[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: CVS Emacs switch-to-buffer issue.
From: |
Rob Kramer |
Subject: |
Re: CVS Emacs switch-to-buffer issue. |
Date: |
Mon, 08 Nov 2004 04:08:31 GMT |
User-agent: |
KNode/0.8.0 |
Reply to self..
> The elisp solution is a hack. Is there an official way to do this? Should
> the test in buffer.c above do a buffer_record() before returning?
The patch below makes switch-to-buffer record_buffer again if switching to
current-buffer. Don't know if it makes any sense to do things this way, but
it solves my problem...
Cheers,
Rob
RCS file: /cvsroot/emacs/emacs/src/buffer.c,v
retrieving revision 1.465
diff -u -3 -p -r1.465 buffer.c
--- src/buffer.c 26 Oct 2004 09:45:16 -0000 1.465
+++ src/buffer.c 8 Nov 2004 03:56:49 -0000
@@ -1684,9 +1684,16 @@ the window-buffer correspondences. */)
char *err;
if (EQ (buffer, Fwindow_buffer (selected_window)))
- /* Basically a NOP. Avoid signalling an error if the selected window
- is dedicated, or a minibuffer, ... */
- return Fset_buffer (buffer);
+ {
+ /* Basically a NOP. Avoid signalling an error if the selected window
+ is dedicated, or a minibuffer, ... */
+ register Lisp_Object buf = Fset_buffer (buffer);
+
+ if (!NILP (buf) && NILP (norecord))
+ record_buffer (buf);
+
+ return buf;
+ }
err = no_switch_window (selected_window);
if (err) error (err);