SUPERSEDES RECOMMEND 21.4
Urk, this time I'll include the patch.
Vin, please review. The recommendation is based on theory; I will be
testing, and Nelson too, I guess.
A separate patch was submitted for 21.5.
steve@uwakimon /playpen/src/XEmacs/21.4 $ cvs diff -U 0 {lisp,src}/ChangeLog;
echo''; cvs diff -u lisp/info.el src/buffer.c
Index: lisp/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/ChangeLog,v
retrieving revision 1.266.2.95
diff -U0 -r1.266.2.95 ChangeLog
--- lisp/ChangeLog 4 Jul 2006 13:18:03 -0000 1.266.2.95
+++ lisp/ChangeLog 14 Nov 2006 03:43:15 -0000
@@ -0,0 +1,8 @@
+2006-11-14 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * info.el (Info-find-file-node, Info-insert-dir)
+ (Info-read-subfile, Info-insert-file-contents): Maintain invariant
+ `(equal buffer-file-truename (file-truename buffer-file-name))'.
+ Thanks to Nelson Ferreira <nelson.ferreira(a)ieee.org> for report
+ and discussion.
+
Index: src/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.290.2.112
diff -U0 -r1.290.2.112 ChangeLog
--- src/ChangeLog 3 Aug 2006 00:24:24 -0000 1.290.2.112
+++ src/ChangeLog 14 Nov 2006 03:43:18 -0000
@@ -0,0 +1,7 @@
+2006-11-14 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * buffer.c (buffer-file-name): Document invariant.
+ (buffer-file-truename): Sync wording to buffer-file-name.
+ Thanks to Nelson Ferreira <nelson.ferreira(a)ieee.org> for report
+ and discussion.
+
Index: lisp/info.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/info.el,v
retrieving revision 1.22.2.4
diff -u -r1.22.2.4 info.el
--- lisp/info.el 27 Jan 2004 02:58:12 -0000 1.22.2.4
+++ lisp/info.el 14 Nov 2006 03:43:36 -0000
@@ -699,7 +699,8 @@
Info-current-subfile nil
Info-current-file-completions nil
Info-index-alternatives nil
- buffer-file-name nil)
+ buffer-file-name nil
+ buffer-file-truename nil)
(erase-buffer)
(if (string= "dir" (file-name-nondirectory filename))
(Info-insert-dir)
@@ -1034,7 +1035,8 @@
(message "Composing main Info directory...done"))
(setq Info-dir-contents (buffer-string)))
(setq default-directory (file-name-as-directory Info-dir-contents-directory))
- (setq buffer-file-name (caar Info-dir-file-attributes)))
+ (setq buffer-file-name (caar Info-dir-file-attributes)
+ buffer-file-truename (file-truename buffer-file-name)))
(defmacro Info-directory-files (dir-file &optional all full nosort files-only)
"Return a list of Info files living in the same directory as DIR-FILE.
@@ -1405,7 +1407,8 @@
(throw 'foo t)))))
(or (equal Info-current-subfile lastfilename)
(let ((buffer-read-only nil))
- (setq buffer-file-name nil)
+ (setq buffer-file-name nil
+ buffer-file-truename nil)
(widen)
(erase-buffer)
(Info-insert-file-contents (Info-suffixed-file
@@ -1513,7 +1516,8 @@
(call-process shell-file-name nil t nil shell-command-switch command)
(message "")
(when visit
- (setq buffer-file-name file)
+ (setq buffer-file-name file
+ buffer-file-truename (file-truename buffer-file-name))
(set-buffer-modified-p nil)
(clear-visited-file-modtime)))
(insert-file-contents file visit))))
Index: src/buffer.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/buffer.c,v
retrieving revision 1.41.2.8
diff -u -r1.41.2.8 buffer.c
--- src/buffer.c 31 Jan 2005 02:55:04 -0000 1.41.2.8
+++ src/buffer.c 15 Nov 2006 04:40:29 -0000
@@ -2821,6 +2821,8 @@
DEFVAR_BUFFER_LOCAL ("buffer-file-name", filename /*
Name of file visited in current buffer, or nil if not visiting a file.
Each buffer has its own value of this variable.
+Code that changes this variable must maintain the invariant
+`(equal buffer-file-truename (file-truename buffer-file-name))'.
*/ );
#if 0 /* FSFmacs */
@@ -2833,12 +2835,11 @@
#endif /* FSFmacs */
DEFVAR_BUFFER_LOCAL ("buffer-file-truename", file_truename /*
-The real name of the file visited in the current buffer,
-or nil if not visiting a file. This is the result of passing
-buffer-file-name to the `file-truename' function. Every buffer has
-its own value of this variable. This variable is automatically
-maintained by the functions that change the file name associated
-with a buffer.
+The real name of the file visited in the current buffer, or nil if not
+visiting a file. This is the result of passing `buffer-file-name' to the
+`file-truename' function. Every buffer has its own value of this variable.
+Code that changes the file name associated with a buffer maintains the
+invariant `(equal buffer-file-truename (file-truename buffer-file-name))'.
*/ );
DEFVAR_BUFFER_LOCAL ("buffer-auto-save-file-name", auto_save_file_name /*
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches