jed-users mailing list

[2003 Date Index] [2003 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: return value of find_file()


begin  Joerg Sommer <joerg@xxxxxxxxxxxx> wrote:
> Hello,
> 
> what returns find_file()? In my jedfuns.txt is only named, it returns a
> int_type, but what's the meaning of this value isn't said.

Klaus Schmid suggests me in a PM to write a patch and here is it:
#v+
--- -	2003-06-07 13:37:24.000000000 +0200
+++ jedfuns.txt	2003-06-07 13:22:57.000000000 +0200
@@ -1155,6 +1155,11 @@
    current window.  Use the `read_file' function to find a file but not
    associate it with the current window.
 
+ RETURN VALUE
+   1  : file found on disk and now its buffer is active
+   0  : file not found on disk, a new buffer was opened
+   -1 : file isn't readable, but a new buffer was opened
+
  SEE ALSO
    read_file
 --------------------------------------------------------------
#v-

But I still have wish: find_file() shouldn't open a buffer for a file,
that isn't readable like /bin or /etc/shadow.
#v+
--- ledit.c.orig	2003-06-07 13:34:02.000000000 +0200
+++ ledit.c	2003-06-07 13:34:05.000000000 +0200
@@ -726,6 +726,8 @@
       case -2:
 	jed_verror ("File %s not readable.", dirfile);
 	status = -1;
+	kill_buffer_cmd (buf->name);
+	buf == NULL;
 	break;
 	     
       case -1:
#v-

Bye, Joerg.

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2003 date index] [2003 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]