GNU bug report logs - #11242
24.1.50; Switching to rmai view buffer

Previous Next

Package: emacs;

Reported by: rms <at> gnu.org

Date: Sat, 14 Apr 2012 04:19:01 UTC

Severity: minor

Merged with 11219

Found in version 24.1.50

Done: Chong Yidong <cyd <at> gnu.org>

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 11242 in the body.
You can then email your comments to 11242 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#11242; Package emacs. (Sat, 14 Apr 2012 04:19:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to rms <at> gnu.org:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 14 Apr 2012 04:19:01 GMT) Full text and rfc822 format available.

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

From: Richard Stallman <rms <at> gnu.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.1.50; Switching to rmai view buffer
Date: Sat, 14 Apr 2012 00:17:05 -0400
I have found out more about the bug that switches to the
Rmail view buffer, named ` *message-viewer RMAIL*'.

It happened after I typed C-c C-c at the *mail* buffer.
It switched to ` *message-viewer RMAIL*'.spontaneously.
It has happened several times recently.

The buffers whose names start with space should never be
shown to the user unless expicitly requested.

I will continue investigating.


In GNU Emacs 24.1.50.1 (mips64el-unknown-linux-gnu, GTK+ Version 2.12.12)
 of 2012-04-10 on theobromine2
Bzr revision: 107831 larsi <at> gnus.org-20120410025139-hm28pdi28nbr8ybg
Configured using:
 `configure 'CFLAGS=-g -O0''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  shell-dirtrack-mode: t
  gpm-mouse-mode: t
  display-battery-mode: t
  tooltip-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
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Recent input:
e r DEL DEL DEL d e r a t i o n . C-a ESC f ESC f ESC 
f , SPC d a n g e r o s SPC t h DEL DEL DEL DEL u s 
SPC a n d SPC h a r m f u l SPC a s SPC i t SPC i s 
ESC q C-n RET RET T h e SPC r e a l SPC o b s t a c 
l e SPC t o SPC t h i s SPC m a y SPC b e SPC f r o 
m SPC f r e e SPC e x p l o i t a t i o n SPC t r e 
a t i e s . C-o RET U r u g u a y SPC a n d SPC A u 
s t r a l i a SPC h a v e SPC C-l C-x 1 t r i e d SPC 
p a r t i a l SPC m e a s u r e s SPC a l o n g SPC 
t h e SPC s a m e SPC l i e DEL n e s ESC q SPC a n 
d ESC q SPC n DEL h a v e SPC b e e n SPC a t t a c 
k e d SPC f o r SPC i t SPC t h i s SPC w a y . C-d 
C-c C-c C-x b * s c TAB RET o DEL ESC > RET o l d - 
ESC TAB m a i ESC TAB C-j ESC x r e p o r t SPC e m 
a c s SPC b u g RET

Recent messages:
Auto-saving...done
Quit [2 times]
Auto-saving...done
Auto-saving...done
Auto-saving...done
Sending...
Wrote /home/rms/outgoing/out-55
Sending...done
Mark set
Making completion list...

Load-path shadows:
None found.

Features:
(shadow emacsbug conf-mode ind-util vc-bzr log-edit easy-mmode
pcvs-util add-log vc ediff-merg ediff-diff ediff-wind ediff-help
ediff-util ediff-mult ediff-init ediff vc-dispatcher parse-time vc-cvs
sgml-mode utf-7 dired-aux china-util etags dabbrev multi-isearch
rmailout ispell shell pcomplete grep compile comint ansi-color ring
quail help-mode view newcomment mailalias qp rmailmm message sendmail
format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode
mailabbrev gmm-utils mailheader mail-parse rfc2231 rmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils dired regexp-opt
t-mouse time-date battery paren cus-start cus-load tooltip ediff-hook
vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image
fringe lisp-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 loaddefs button faces cus-face files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
dbusbind dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty emacs)


--
Dr Richard Stallman
President, Free Software Foundation
51 Franklin St
Boston MA 02110
USA
www.fsf.org  www.gnu.org
Skype: No way! That's nonfree (freedom-denying) software.
  Use free telephony http://directory.fsf.org/category/tel/




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11242; Package emacs. (Sat, 14 Apr 2012 13:32:02 GMT) Full text and rfc822 format available.

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

From: martin rudalics <rudalics <at> gmx.at>
To: rms <at> gnu.org
Cc: 11242 <at> debbugs.gnu.org
Subject: Re: bug#11242: 24.1.50; Switching to rmai view buffer
Date: Sat, 14 Apr 2012 15:30:10 +0200
> It happened after I typed C-c C-c at the *mail* buffer.
> It switched to ` *message-viewer RMAIL*'.spontaneously.
> It has happened several times recently.
>
> The buffers whose names start with space should never be
> shown to the user unless expicitly requested.
>
> I will continue investigating.

Could you try running your Emacs with something like

(defun wcch ()
  (when (get-buffer-window " *message-viewer RMAIL*" t)
    (backtrace)))

(add-hook 'window-configuration-change-hook 'wcch)

activated?

martin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11242; Package emacs. (Sat, 14 Apr 2012 18:34:01 GMT) Full text and rfc822 format available.

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

From: Richard Stallman <rms <at> gnu.org>
To: rms <at> gnu.org
Cc: 11242 <at> debbugs.gnu.org
Subject: Re: bug#11242: 24.1.50; Switching to rmai view buffer
Date: Sat, 14 Apr 2012 14:31:56 -0400
The problem is that other-buffer sometimes returns
` *message-viewer RMAIL*'.

other-buffer must never return a buffer whose name starts
with space, except perhaps it was recently displayed.

Meanwhile, I sometimes find that C-c C-c in Mail mode does not switch
buffers at all; it stays in the Mail buffer.  That is a different
manifestation but I suspect it is the same bug.

--
Dr Richard Stallman
President, Free Software Foundation
51 Franklin St
Boston MA 02110
USA
www.fsf.org  www.gnu.org
Skype: No way! That's nonfree (freedom-denying) software.
  Use free telephony http://directory.fsf.org/category/tel/




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11242; Package emacs. (Sat, 14 Apr 2012 18:54:03 GMT) Full text and rfc822 format available.

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

From: martin rudalics <rudalics <at> gmx.at>
To: rms <at> gnu.org
Cc: 11242 <at> debbugs.gnu.org
Subject: Re: bug#11242: 24.1.50; Switching to rmai view buffer
Date: Sat, 14 Apr 2012 20:52:00 +0200
> The problem is that other-buffer sometimes returns
> ` *message-viewer RMAIL*'.

If you look at the code of `other-buffer' that doesn't seem possible:
Both loops trigger iff

     (SREF (BVAR (XBUFFER (buf), name), 0) != ' ')

so please try my recipe.

> other-buffer must never return a buffer whose name starts
> with space, except perhaps it was recently displayed.
>
> Meanwhile, I sometimes find that C-c C-c in Mail mode does not switch
> buffers at all; it stays in the Mail buffer.  That is a different
> manifestation but I suspect it is the same bug.

What command does C-c C-c run?

martin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11242; Package emacs. (Sat, 14 Apr 2012 19:22:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: martin rudalics <rudalics <at> gmx.at>
Cc: rms <at> gnu.org, 11242 <at> debbugs.gnu.org
Subject: Re: bug#11242: 24.1.50; Switching to rmai view buffer
Date: Sat, 14 Apr 2012 22:18:00 +0300
> Date: Sat, 14 Apr 2012 20:52:00 +0200
> From: martin rudalics <rudalics <at> gmx.at>
> Cc: 11242 <at> debbugs.gnu.org
> 
>  > Meanwhile, I sometimes find that C-c C-c in Mail mode does not switch
>  > buffers at all; it stays in the Mail buffer.  That is a different
>  > manifestation but I suspect it is the same bug.
> 
> What command does C-c C-c run?

It runs the command mail-send-and-exit.




Forcibly Merged 11219 11242. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 14 Apr 2012 20:00:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11242; Package emacs. (Sun, 15 Apr 2012 02:20:03 GMT) Full text and rfc822 format available.

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

From: Richard Stallman <rms <at> gnu.org>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 11242 <at> debbugs.gnu.org
Subject: Re: bug#11242: 24.1.50; Switching to rmai view buffer
Date: Sat, 14 Apr 2012 22:18:30 -0400
    If you look at the code of `other-buffer' that doesn't seem possible:
    Both loops trigger iff

	  (SREF (BVAR (XBUFFER (buf), name), 0) != ' ')

    so please try my recipe.

What recipe?

--
Dr Richard Stallman
President, Free Software Foundation
51 Franklin St
Boston MA 02110
USA
www.fsf.org  www.gnu.org
Skype: No way! That's nonfree (freedom-denying) software.
  Use free telephony http://directory.fsf.org/category/tel/




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11242; Package emacs. (Sun, 15 Apr 2012 02:21:01 GMT) Full text and rfc822 format available.

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

From: Richard Stallman <rms <at> gnu.org>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 11242 <at> debbugs.gnu.org
Subject: Re: bug#11242: 24.1.50; Switching to rmai view buffer
Date: Sat, 14 Apr 2012 22:18:31 -0400
    What command does C-c C-c run?

mail-send-and-exit.
It calls mail-bury, which gets ` *message-viewer RMAIL'
as the value of newbuf.


--
Dr Richard Stallman
President, Free Software Foundation
51 Franklin St
Boston MA 02110
USA
www.fsf.org  www.gnu.org
Skype: No way! That's nonfree (freedom-denying) software.
  Use free telephony http://directory.fsf.org/category/tel/




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11242; Package emacs. (Sun, 15 Apr 2012 08:16:02 GMT) Full text and rfc822 format available.

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

From: martin rudalics <rudalics <at> gmx.at>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: rms <at> gnu.org, 11242 <at> debbugs.gnu.org
Subject: Re: bug#11242: 24.1.50; Switching to rmai view buffer
Date: Sun, 15 Apr 2012 10:14:09 +0200
> It runs the command mail-send-and-exit.

which calls `mail-bury' where we have two options to show a buffer whose
name starts with a space, namely

(defun mail-bury (&optional arg)
  ...
    (bury-buffer (current-buffer)) <---------- HERE
    ...
      (switch-to-buffer newbuf)))) <----------- OR HERE

and we'd have to find out which of these is responsible.

martin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11242; Package emacs. (Sun, 15 Apr 2012 08:16:02 GMT) Full text and rfc822 format available.

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

From: martin rudalics <rudalics <at> gmx.at>
To: rms <at> gnu.org
Cc: 11242 <at> debbugs.gnu.org
Subject: Re: bug#11242: 24.1.50; Switching to rmai view buffer
Date: Sun, 15 Apr 2012 10:14:16 +0200
>     If you look at the code of `other-buffer' that doesn't seem possible:
>     Both loops trigger iff
> 
> 	  (SREF (BVAR (XBUFFER (buf), name), 0) != ' ')
> 
>     so please try my recipe.
> 
> What recipe?

Please put

(defun wcch ()
  (when (get-buffer-window " *message-viewer RMAIL*" t)
    (backtrace)))

(add-hook 'window-configuration-change-hook 'wcch)

in your .emacs and when it triggers post the backtrace here.

Thanks, martin





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11242; Package emacs. (Sun, 15 Apr 2012 20:15:02 GMT) Full text and rfc822 format available.

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

From: Richard Stallman <rms <at> gnu.org>
To: martin rudalics <rudalics <at> gmx.at>
Cc: eliz <at> gnu.org, 11242 <at> debbugs.gnu.org
Subject: Re: bug#11242: 24.1.50; Switching to rmai view buffer
Date: Sun, 15 Apr 2012 16:12:33 -0400
    which calls `mail-bury' where we have two options to show a buffer whose
    name starts with a space, namely

    (defun mail-bury (&optional arg)
       ...
	 (bury-buffer (current-buffer)) <---------- HERE
	 ...
	   (switch-to-buffer newbuf)))) <----------- OR HERE

It's neither one.  It's done by this code.

    ;; If there is an Rmail buffer, return to it nicely
    ;; even if this message was not started by an Rmail command.
    (unless return-action
      (dolist (buffer (buffer-list))
	(if (eq (buffer-local-value 'major-mode buffer) 'rmail-mode)
	    (setq return-action `(rmail-mail-return ,newbuf)))))

When the bug occurs, NEWBUF is the message view buffer.
It was returned by other-buffer.

    (defun wcch ()
       (when (get-buffer-window " *message-viewer RMAIL*" t)
	 (backtrace)))

    (add-hook 'window-configuration-change-hook 'wcch)

    in your .emacs and when it triggers post the backtrace here.

There is no need.  I already said how that buffer gets selected:
later in mail-bury, where it handles return-action.

--
Dr Richard Stallman
President, Free Software Foundation
51 Franklin St
Boston MA 02110
USA
www.fsf.org  www.gnu.org
Skype: No way! That's nonfree (freedom-denying) software.
  Use free telephony http://directory.fsf.org/category/tel/




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11242; Package emacs. (Mon, 16 Apr 2012 08:16:02 GMT) Full text and rfc822 format available.

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

From: martin rudalics <rudalics <at> gmx.at>
To: rms <at> gnu.org
Cc: eliz <at> gnu.org, 11242 <at> debbugs.gnu.org
Subject: Re: bug#11242: 24.1.50; Switching to rmai view buffer
Date: Mon, 16 Apr 2012 10:15:54 +0200
>     which calls `mail-bury' where we have two options to show a buffer whose
>     name starts with a space, namely
>
>     (defun mail-bury (&optional arg)
>        ...
> 	 (bury-buffer (current-buffer)) <---------- HERE
> 	 ...
> 	   (switch-to-buffer newbuf)))) <----------- OR HERE
>
> It's neither one.  It's done by this code.
>
>     ;; If there is an Rmail buffer, return to it nicely
>     ;; even if this message was not started by an Rmail command.
>     (unless return-action
>       (dolist (buffer (buffer-list))
> 	(if (eq (buffer-local-value 'major-mode buffer) 'rmail-mode)
> 	    (setq return-action `(rmail-mail-return ,newbuf)))))

Maybe.  But how can you be sure that `bury-buffer' has no effect?  Do
you have a buffer in rmail-mode at that time?  Is `rmail-mail-return'
definitely called?  Is NEWBUF really a buffer starting with a space?

martin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11242; Package emacs. (Mon, 16 Apr 2012 10:19:02 GMT) Full text and rfc822 format available.

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

From: Chong Yidong <cyd <at> gnu.org>
To: rms <at> gnu.org
Cc: martin rudalics <rudalics <at> gmx.at>, 11242 <at> debbugs.gnu.org
Subject: Re: bug#11242: 24.1.50; Switching to rmai view buffer
Date: Mon, 16 Apr 2012 18:18:09 +0800
Richard Stallman <rms <at> gnu.org> writes:

> It's neither one.  It's done by this code.
>
>     ;; If there is an Rmail buffer, return to it nicely
>     ;; even if this message was not started by an Rmail command.
>     (unless return-action
>       (dolist (buffer (buffer-list))
> 	(if (eq (buffer-local-value 'major-mode buffer) 'rmail-mode)
> 	    (setq return-action `(rmail-mail-return ,newbuf)))))

This code is wrong; the NEWBUF should not be passed to
rmail-mail-return, it should be the BUFFER variable in the loop.  I've
committed a fix.


BTW, having code in mail-bury to specially handle Rmail buffers is kinda
ugly.  This probably needs to be folded into the quit-window mechanism,
somehow.  In the first place, I'm not even sure it's appropriate to
redirect the user to an Rmail buffer if the mail command was not started
from Rmail.




bug closed, send any further explanations to 11242 <at> debbugs.gnu.org and rms <at> gnu.org Request was from Chong Yidong <cyd <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 16 Apr 2012 10:19:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11242; Package emacs. (Mon, 16 Apr 2012 22:02:02 GMT) Full text and rfc822 format available.

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

From: Richard Stallman <rms <at> gnu.org>
To: Chong Yidong <cyd <at> gnu.org>
Cc: 11242 <at> debbugs.gnu.org
Subject: Re: bug#11242: 24.1.50; Switching to rmai view buffer
Date: Mon, 16 Apr 2012 18:01:48 -0400
    This code is wrong; the NEWBUF should not be passed to
    rmail-mail-return, it should be the BUFFER variable in the loop.  I've
    committed a fix.

I think you're right.

However, it is nonetheless true that other-buffer should not return
buffers whose names start with space.

    BTW, having code in mail-bury to specially handle Rmail buffers is kinda
    ugly.  This probably needs to be folded into the quit-window mechanism,
    somehow.  In the first place, I'm not even sure it's appropriate to
    redirect the user to an Rmail buffer if the mail command was not started
    from Rmail.

Yes it is appropriate.  I put it in because the lack of it was a
nuisance.

But if that feature were removed, look what would happen:

    (if (and (null arg) return-action)
	(apply (car return-action) (cdr return-action))
      (switch-to-buffer newbuf))))

It would switch to NEWBUF, the same bug as was just happening.

--
Dr Richard Stallman
President, Free Software Foundation
51 Franklin St
Boston MA 02110
USA
www.fsf.org  www.gnu.org
Skype: No way! That's nonfree (freedom-denying) software.
  Use Ekiga or an ordinary phone call




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

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

Previous Next


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