emacs-devel
[Top][All Lists]
Advanced

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

with-current-buffer "cleanup" bug


From: Chong Yidong
Subject: with-current-buffer "cleanup" bug
Date: Sat, 14 Nov 2009 10:51:20 -0500

Hi Stefan,

I just reverted your change to help-mode.el, because it led to a bug:
`C-h f describe-minor-mode', and any other help command that creates a
help buffer larger than its window size, left point at the end of the
buffer.

If you're wholesale changing `save-excursion + set-buffer' to
`with-current-buffer', this is wrong.  The `with-current-buffer' macro
does not save point (or mark), so this can lead to code behavior change.
You need to fix this, or we're likely see a long slow trickle of related
bugs in the coming weeks and months.


*** help-mode.el.~1.68~ 2009-11-14 10:40:18.000000000 -0500
--- help-mode.el.~1.69.~        2009-11-14 10:30:40.000000000 -0500
***************
*** 413,420 ****
  help buffers.  Variable `help-back-label' specifies the text for
  that."
    (interactive "b")
!   (save-excursion
!     (set-buffer (or buffer (current-buffer)))
      (goto-char (point-min))
      ;; Skip the header-type info, though it might be useful to parse
      ;; it at some stage (e.g. "function in `library'").
--- 413,419 ----
  help buffers.  Variable `help-back-label' specifies the text for
  that."
    (interactive "b")
!   (with-current-buffer (or buffer (current-buffer))
      (goto-char (point-min))
      ;; Skip the header-type info, though it might be useful to parse
      ;; it at some stage (e.g. "function in `library'").




reply via email to

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