GNU bug report logs - #11939
24.1; `save-buffers-kill-emacs' loses minibuffer focus when it calls `list-processes'

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Fri, 13 Jul 2012 18:07:01 UTC

Severity: normal

Found in version 24.1

Done: martin rudalics <rudalics <at> gmx.at>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 11939 <at> debbugs.gnu.org
Subject: bug#11939: 24.1; `save-buffers-kill-emacs' loses minibuffer focus whenit	calls	`list-processes'
Date: Thu, 26 Jul 2012 18:05:45 +0200
>>  > So I tried instead redirecting the focus to the minibuffer
>>  > frame.  That worked OK, but the default buffer for killing
>>  > with C-x k was ` *Minibuf-0*', not *shell* or *Process List*.
>>  >
>>  > It seems that when a new frame is created, the default
>>  > value for C-x k (and other buffer commands) becomes *Minibuf-0*.
>>  > I can of course choose not to use the default value, but it
>>  > would be good to get this part fixed also.
>>
>> You mean *Minibuf-0* became the current buffer?  Probably so
>> because you selected its window.
>
> I did not do so explicitly, AFAIK.  But perhaps read-from-minibuffer (actually
> the C code for it) does that?  I do not see anywhere that I do so in my code.

It indeed selects the window and sets the current buffer.  But C-x k
should never offer *Minibuf-0* for killing.  Does it really prompt with
*Minibuf-0*?  If so, then the following excerpt from Fcall_interactively

	case 'b':   		/* Name of existing buffer */
	  args[i] = Fcurrent_buffer ();
	  if (EQ (selected_window, minibuf_window))
	    args[i] = Fother_buffer (args[i], Qnil, Qnil);
	  args[i] = Fread_buffer (callint_message, args[i], Qt);
	  break;

is broken.  IIUC it means that the current buffer is the buffer of the
minibuffer window (how did that happen?) but the minibuffer window is
not selected.  What is missing from the form below to reproduce it?

(progn
  (add-hook 'after-make-frame-functions
	    #'(lambda (frame)
		(redirect-frame-focus
		 frame (window-frame (minibuffer-window)))))
  (setq pop-up-frame-function (lambda () (make-frame '((minibuffer . nil)))))
  (setq pop-up-frames t)
  (display-buffer "*Messages*")
  (yes-or-no-p "???"))

martin




This bug report was last modified 12 years and 288 days ago.

Previous Next


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