emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

with-current-buffer (was: fit-window-to-buffer)


From: Juri Linkov
Subject: with-current-buffer (was: fit-window-to-buffer)
Date: Mon, 27 Jun 2005 02:33:05 +0300
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

There is a similar problem related to switching buffers using
`with-current-buffer' and co.  I can't say if it's a bug or not.
For example, `next-error' after finishing has the current 
buffer reported by (current-buffer) not the same as the buffer
where the point eventually lands.  This problem in `next-error'
can be narrowed to the following code:

(progn (get-buffer-create "a")
       (get-buffer-create "b")
       (get-buffer-create "c"))

(defun test ()
  (interactive)
  (set-buffer "a")
  (with-current-buffer "c"
    (pop-to-buffer "b"))
  (message "%s" (buffer-name (current-buffer))))

(test)

At the end, it print "a" as the current buffer name, but actually
this command makes the buffer "b" current.  Shouldn't it print "b"?

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]