[Adrian, since this affects ERC, too, would you please take a look at
this patch? It's correct in theory, but I don't know anything about
ERC.]
Nelson Ferreira writes:
I am sorry, but should there have been a patch attached?
Yes; you should have received the resend by now. Very sorry about that!
This has also happened to me in some ERC buffers, specially the ones
where part of the history from logs were pulled out from the disk. I
will try to remember if there were any more cases. Those 2 are
certainly the ones I encounter repeatedly.
Thanks! I've taken a look at ERC. I have no idea what they think
they're doing here in erc-log.el:
;;;functionality referenced from erc.el
(defun erc-log-setup-logging ()
"Setup the buffer-local logging variables in the current buffer.
This function is destined to be run from `erc-connect-pre-hook'."
(when (erc-logging-enabled)
(auto-save-mode -1)
(setq buffer-offer-save t
buffer-file-name "")
;; code continues ...
The empty string looks very suspicious, I can't see how anything good
might come of it. I propose changing it to nil and setq'ing
buffer-file-truename to nil, too, to maintain the invariant. If that
doesn't work, you might need to change it to something like
(setq buffer-offer-save t
buffer-file-name (erc-current-logfile buffer)
buffer-file-truename (file-truename buffer-file-name))
or you could try
(setq buffer-offer-save t
buffer-file-name ""
buffer-file-truename (file-truename buffer-file-name))
but it all seems very hackish.
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/erc/ChangeLog,v
retrieving revision 1.40
diff -U0 -r1.40 ChangeLog
--- ChangeLog 2 May 2006 06:38:43 -0000 1.40
+++ ChangeLog 14 Nov 2006 09:02:44 -0000
@@ -0,0 +1,5 @@
+2006-11-14 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * erc-dcc.el (erc-dcc-find-file,erc-log-setup-logging):
+ Maintain buffer-file-name invariant.
+
Index: erc-dcc.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/erc/erc-dcc.el,v
retrieving revision 1.9
diff -u -r1.9 erc-dcc.el
--- erc-dcc.el 19 Feb 2006 12:57:28 -0000 1.9
+++ erc-dcc.el 14 Nov 2006 09:02:50 -0000
@@ -776,7 +776,9 @@
(defun erc-dcc-find-file (file)
(with-current-buffer (generate-new-buffer (file-name-nondirectory file))
(insert-file-contents-literally file)
- (setq buffer-file-name file)
+ ;; XEmacs change: maintain invariant for truename vs. name.
+ (setq buffer-file-name file
+ buffer-file-truename (file-truename buffer-file-name))
(current-buffer)))
(defun erc-dcc-file-to-name (file)
Index: erc-log.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/erc/erc-log.el,v
retrieving revision 1.9
diff -u -r1.9 erc-log.el
--- erc-log.el 19 Feb 2006 12:57:29 -0000 1.9
+++ erc-log.el 14 Nov 2006 09:02:51 -0000
@@ -219,7 +219,8 @@
(when (erc-logging-enabled)
(auto-save-mode -1)
(setq buffer-offer-save t
- buffer-file-name "")
+ buffer-file-name nil
+ buffer-file-truename nil)
(cond ((boundp 'write-file-functions)
(set (make-local-variable 'write-file-functions)
'(erc-save-buffer-in-logs)))
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches