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 monnier@iro.umontreal.ca-20140109015919-e2odlbm4kphig5ya 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: F o l l o w SPC m o d e SPC v b b r o k n SPC e n SPC w h e n SPC s t a r t e d SPC w i n d o w SPC s e l e c t e d SPC f r o m b u t SPC c u b u r SPC t SPC c u r r e n t SPC b u f f e r SPC s i s s e l e c t e d SPC w w h e n SPC . - C-e h e n SPC C o m p i l e C-x p C-x p C-x o C-x o C-x o C-x o C-h k C-x o C-x o C-x o x 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)