GNU bug report logs - #28995
xref next-error breaks with with-selected-window in next-error-hook

Previous Next

Package: emacs;

Reported by: Jonathan Kotta <jpkotta <at> gmail.com>

Date: Wed, 25 Oct 2017 16:19:02 UTC

Severity: normal

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 28995 in the body.
You can then email your comments to 28995 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#28995; Package emacs. (Wed, 25 Oct 2017 16:19:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Kotta <jpkotta <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 25 Oct 2017 16:19:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jonathan Kotta <jpkotta <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: xref next-error breaks with with-selected-window in next-error-hook
Date: Wed, 25 Oct 2017 11:17:04 -0500
[Message part 1 (text/plain, inline)]
Evaluate:

(defun jpk/next-error-hook ()
  (let ((win (get-buffer-window next-error-last-buffer)))
    (when (window-live-p win)
      (with-selected-window win ;; breaks with xref
        (message "window: %s" win)))))
(add-hook 'next-error-hook #'jpk/next-error-hook)

Run xref-find-references on e.g. add-hook
Run next-error or previous-error at least twice.

Repeating next-error doesn't find the next match after the 2nd invocation.
Running previous-error behaves similarly.  I can use a mouse to click on an
any match, but next/previous-error will still only move between the clicked
match and the next.  I can only cycle between two matches.

For reference, this is my original hook:

(defun jpk/next-error-hook ()
  (let ((win (get-buffer-window next-error-last-buffer))
        (buf (buffer-name next-error-last-buffer))
        (recenter-redisplay nil))
    (when (window-live-p win)
      (with-selected-window win
        (recenter)))))

The question on Stack Exchange: https://emacs.stackexchange.com/q/36260/651

In GNU Emacs 25.3.1 (x86_64-pc-linux-gnu, X toolkit, Xaw scroll bars)
 of 2017-09-12 built on shannon
Windowing system distributor 'The X.Org Foundation', version 11.0.11905000
Configured using:
 'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --with-x-toolkit=lucid --with-xft --without-gconf
 --without-gsettings --with-modules --with-gameuser=:games
 '--program-transform-name=s/^ctags$/ctags.emacs/' 'CFLAGS=-march=x86-64
 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt'
 CPPFLAGS=-D_FORTIFY_SOURCE=2
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS NOTIFY ACL GNUTLS
LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS LUCID X11
MODULES

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Emacs-Lisp

Minor modes in effect:
  diff-auto-refine-mode: t
  tooltip-mode: t
  global-eldoc-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 messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Mark set
jpk/next-error-hook
(jpk/next-error-hook)
Quit [2 times]
Mark set
Note: file is write protected
window: #<window 7 on *xref*> [11 times]

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message dired format-spec rfc822 mml
mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils pulse
semantic/symref/grep grep compile comint ansi-color semantic/symref
semantic/util-modes semantic/util semantic semantic/tag semantic/lex
semantic/fw mode-local find-func cedet vc-hg vc-git diff-mode easy-mmode
vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs vc vc-dispatcher thingatpt
xref cl-seq project ring eieio byte-opt bytecomp byte-compile cl-extra
help-mode easymenu cconv eieio-core cl-macs gv cl-loaddefs pcase cl-lib
time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset
image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese charscript case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer cl-preloaded 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 dbusbind inotify dynamic-setting
font-render-setting x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 121559 6089)
 (symbols 48 23516 0)
 (miscs 40 80 140)
 (strings 32 27164 5634)
 (string-bytes 1 818145)
 (vectors 16 17422)
 (vector-slots 8 491703 4664)
 (floats 8 264 116)
 (intervals 56 628 18)
 (buffers 976 21))

-- 
Thanks,

Jonathan Kotta

Hofstadter's Law:
    It always takes longer than you expect, even
    when you take into account Hofstadter's Law.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28995; Package emacs. (Wed, 25 Oct 2017 20:18:02 GMT) Full text and rfc822 format available.

Message #8 received at 28995 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Jonathan Kotta <jpkotta <at> gmail.com>, 28995 <at> debbugs.gnu.org
Subject: Re: bug#28995: xref next-error breaks with with-selected-window in
 next-error-hook
Date: Wed, 25 Oct 2017 23:17:40 +0300
On 10/25/17 7:17 PM, Jonathan Kotta wrote:
> Evaluate:
> 
> (defun jpk/next-error-hook ()
>    (let ((win (get-buffer-window next-error-last-buffer)))
>      (when (window-live-p win)
>        (with-selected-window win ;; breaks with xref
>          (message "window: %s" win)))))
> (add-hook 'next-error-hook #'jpk/next-error-hook)
> 
> Run xref-find-references on e.g. add-hook
> Run next-error or previous-error at least twice.
> 
> Repeating next-error doesn't find the next match after the 2nd 
> invocation. Running previous-error behaves similarly.  I can use a mouse 
> to click on an any match, but next/previous-error will still only move 
> between the clicked match and the next.  I can only cycle between two 
> matches.

Can you reproduce this starting with 'emacs -Q'? I can't.




Reply sent to Juri Linkov <juri <at> linkov.net>:
You have taken responsibility. (Tue, 17 Apr 2018 20:34:03 GMT) Full text and rfc822 format available.

Notification sent to Jonathan Kotta <jpkotta <at> gmail.com>:
bug acknowledged by developer. (Tue, 17 Apr 2018 20:34:03 GMT) Full text and rfc822 format available.

Message #13 received at 28995-done <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Jonathan Kotta <jpkotta <at> gmail.com>
Cc: 28995-done <at> debbugs.gnu.org
Subject: Re: bug#28995: xref next-error breaks with with-selected-window in
 next-error-hook
Date: Tue, 17 Apr 2018 23:30:31 +0300
It seems this is already fixed together with bug#27362.
If not, then please reopen.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 16 May 2018 11:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 318 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.