SUPERSEDES APPROVE COMMIT 21.5
This is basically the same as originally submitted, but the
documentation is slightly better worded.
steve@uwakimon /playpen/src/XEmacs/git-integration $ git diff HEAD~2
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 663a24f..a38b498 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -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.
+
diff --git a/src/ChangeLog b/src/ChangeLog
index 6ec0a68..3e99ee2 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -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.
+
diff --git a/lisp/info.el b/lisp/info.el
index 5c70168..1106117 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -717,7 +717,8 @@ node of a file of this name."
;; Nooooooooooo! Info-index can extend across more
;; than one file (e.g. XEmacs, Lispref)
;; 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)
@@ -1052,7 +1053,8 @@ actually get any text from."
(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.
@@ -1423,7 +1425,8 @@ invoke \"xemacs -batch -f Info-batch-reb
(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
@@ -1531,7 +1534,8 @@ versions of NAME. Only the suffixes are
(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))))
diff --git a/src/buffer.c b/src/buffer.c
index a20b7d9..9bff2ce 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -2635,6 +2635,8 @@ It may not be a list of functions.
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 */
@@ -2647,12 +2649,11 @@ Each buffer has its own value of this va
#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 /*
*** end of patch ***
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches