emacs-bug-tracker
[Top][All Lists]
Advanced

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

[debbugs-tracker] bug#16426: closed (24.3.50; Follow-mode broken when wi


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#16426: closed (24.3.50; Follow-mode broken when window is selected from another buffer, like compile-goto-error (worked in 24.2, broken in 24.3))
Date: Thu, 16 Jan 2014 00:29:02 +0000

Your message dated Wed, 15 Jan 2014 19:28:08 -0500
with message-id <address@hidden>
and subject line Re: bug#16426: Acknowledgement (24.3.50; Follow-mode broken 
when window is selected from another buffer, like compile-goto-error (worked in 
24.2, broken in 24.3))
has caused the debbugs.gnu.org bug report #16426,
regarding 24.3.50; Follow-mode broken when window is selected from another 
buffer, like compile-goto-error (worked in 24.2, broken in 24.3)
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
16426: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16426
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 24.3.50; Follow-mode broken when window is selected from another buffer, like compile-goto-error (worked in 24.2, broken in 24.3) Date: Sun, 12 Jan 2014 21:46:56 +0100
When a window is selected by a command like `compile-goto-error', and the buffer of that window have follow-mode enabled, the wrong location is displayed.

Steps to repeat:

    emacs -Q src/alloc.c
    Make the window wide enough for three columns.
    C-x 3
    C-x 3
    M-x balance-windows RET
    M-x follow-mode RET
    C-x o
    C-x o
    M-x grep RET for *.c RET
    C-x o
    Go to a match of a line number a couple of pages into alloc.c, say line 1001
    RET
    Here, alloc.c is selected, but the wrong line is displayed.

This worked in Emacs 24.2 but is broken in Emacs 24.3 and on the bzr trunk.

The cause of the error seems to be a major rewrite of follow-mode. In the 24.2 version, the function `follow-post-command-hook' picked up the point to work on, "dest", from the buffer associated with the window. In 24.3, is simply use `(point)' of the current buffer.

I guess that this is a mistake introduced when the new function `follow-adjust-window' was broken out from `follow-post-command-hook'. "dest" is now a parameter of the new function, unfortunately, in the call "(point)" is passed, which is located outside of the `(with-current-buffer (window-buffer win) ...)' construct. Hence, it uses the point of the current buffer rather than of the buffer of the selected window, which it should.


(defun follow-post-command-hook ()
  "Ensure that the windows in Follow mode are adjacent after each command."
  (unless (input-pending-p)
    (let ((follow-inside-post-command-hook t)
 (win (selected-window)))
      ;; Work in the selected window, not in the current buffer.
      (with-current-buffer (window-buffer win)
(unless (and (symbolp this-command)
    (get this-command 'follow-mode-use-cache))
 (setq follow-windows-start-end-cache nil)))
      (follow-adjust-window win (point)))))      <-----        **** Outside `with-current-buffer'.

(defun follow-adjust-window (win dest)
  ;; Adjust the window WIN and its followers.
  ...)

Clearly, the parameter `dest' gets its value from (point). However, as this is outside the `with-current-buffer' construct it get it's value from current buffer, not the buffer of the selected window (as before).

It should be trivial to fix, e.g. by adding `dest' to the `let', and setting in the `with-current-construct' of `follow-post-command-hook', and pass it, rather than (point) -- but I leave it to you to do the actual implementation.

Sincerely,
    Anders Lindgren

Ps. I'm the original author of Follow mode.

In GNU Emacs 24.3.50.1 (x86_64-apple-darwin13.0.0, NS apple-appkit-1265.00)
 of 2014-01-09 on macpro.lan
Repository revision: 115931 address@hidden
Windowing system distributor `Apple', version 10.3.1265
Configured using:
 `configure --with-ns'

Important settings:
  value of $LC_CTYPE: UTF-8
  locale-coding-system: utf-8-unix

Major mode: Help

Minor modes in effect:
  shell-dirtrack-mode: t
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> F o 
l l o w SPC m o d e SPC v b <backspace> <backspace> 
b r o k n SPC <backspace> <backspace> e n SPC w h e 
n SPC s t a r t e d SPC <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
w i n d o w SPC s e l e c t e d SPC f r o m <backspace> 
<backspace> <backspace> <backspace> b u t SPC c u <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
b u r SPC <backspace> <backspace> t SPC c u r r e n 
t SPC b u f f e r SPC s <backspace> i s <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> s e l e c t e d SPC <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> w <backspace> w h e n SPC <left> 
<left> <left> <left> <left> <left> <left> <left> <left> 
<left> <left> <left> <left> <left> <left> <left> <left> 
<left> <right> <backspace> . <backspace> - C-e <backspace> 
<backspace> <backspace> <backspace> h e n SPC <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> C o m p i l e <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> C-x p C-x p C-x o C-x o C-x o C-x o C-h 
k <return> <down> <down> <down> C-x o C-x o C-x o <escape> 
x <up> <return>

Recent messages:
follow-post-command-hook
follow-adjust-window
C-x p is undefined [3 times]
Making completion list...
Undo! [5 times]
Quit
C-x p is undefined
Quit
C-x p is undefined
Type "q" to restore previous buffer.

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils misearch multi-isearch jka-compr find-func
help-mode shell pcomplete grep compile comint ansi-color ring follow
advice help-fns easy-mmode cl-macs gv vc-bzr cc-langs cl cl-loaddefs
cl-lib cc-mode cc-fonts easymenu cc-guess cc-menus cc-cmds cc-styles
cc-align cc-engine cc-vars cc-defs time-date tooltip electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel ns-win tool-bar dnd fontset
image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode
register page menu-bar rfn-eshadow timer select scroll-bar mouse
jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
cocoa ns multi-tty emacs)


--- End Message ---
--- Begin Message --- Subject: Re: bug#16426: Acknowledgement (24.3.50; Follow-mode broken when window is selected from another buffer, like compile-goto-error (worked in 24.2, broken in 24.3)) Date: Wed, 15 Jan 2014 19:28:08 -0500 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
> Below is a patch to correct the problem described in the bug report.

I installed a patch which is based on yours (but simply removes the
`dest' arg since it's always equal to (point) anyway).


        Stefan


--- End Message ---

reply via email to

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