unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: bvraghav@iitk.ac.in, 23987@debbugs.gnu.org
Subject: bug#23987: 24.5; Icy with Ggtags Problem
Date: Thu, 21 Jul 2016 09:44:44 -0700 (PDT)	[thread overview]
Message-ID: <3010c050-4257-4c00-82be-9a0437e2a4cc@default> (raw)
In-Reply-To: <87zipk2kq4.fsf@ram.bvr.dp.lan>

>    Error running timer `compilation-auto-jump': (error "Selecting
>    deleted buffer")

This might, as supposed, be a ggtags issue.  But I wonder if this
isn't actually a `compile.el' issue.

It seems like asking for trouble for any function
(e.g. `compilation-auto-jump') that is invoked by an idle timer
to be doing something based on evaluation of `(current-buffer)',
in particular, without testing whether the result of that
evaluation is a live buffer.

In the present case, a user is apparently doing code completion.
And in the case of Icicles, that can involve use of the minibuffer.

I suspect that `compilation-auto-jump' should control itself, and
act only in the buffer that it apparently expects to be acting in.

Seems like fragile code.  Any reason why an idle-timer function
should assume something about what buffer is current or should
not bother to check whether `(current-buffer)' is a live buffer?

My guess is that this is not a ggtags or Icicles issue, but is
just dumb behavior by `compilation-auto-jump'.

This is my suggestion, FWIW:

(defun compilation-auto-jump (buffer pos)
  (when (buffer-live-p buffer) ; <===========================
    (with-current-buffer buffer
      (goto-char pos)
      (let ((win  (get-buffer-window buffer 0)))
        (when win (set-window-point win pos)))
      (when compilation-auto-jump-to-first-error
	 (compile-goto-error)))))

Seems like a no-brainer...





  parent reply	other threads:[~2016-07-21 16:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-14 17:27 bug#23987: 24.5; Icy with Ggtags Problem B.V. Raghav
2016-07-20  7:42 ` Glenn Morris
2016-07-21 16:44 ` Drew Adams [this message]
2016-07-22 12:06   ` B.V. Raghav
2016-07-22 14:01     ` Drew Adams
2016-07-22 14:51       ` B.V. Raghav

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3010c050-4257-4c00-82be-9a0437e2a4cc@default \
    --to=drew.adams@oracle.com \
    --cc=23987@debbugs.gnu.org \
    --cc=bvraghav@iitk.ac.in \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).