GNU bug report logs - #2439
23.0.60; [patch] `Mark set' clobbers useful message in ibuffer

Previous Next

Package: emacs;

Reported by: Geoff Gole <geoffgole <at> gmail.com>

Date: Mon, 23 Feb 2009 02:35:04 UTC

Severity: normal

Tags: patch

Done: Juanma Barranquero <lekktu <at> gmail.com>

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 2439 in the body.
You can then email your comments to 2439 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-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2439; Package emacs. (Mon, 23 Feb 2009 02:35:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Geoff Gole <geoffgole <at> gmail.com>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Mon, 23 Feb 2009 02:35:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Geoff Gole <geoffgole <at> gmail.com>
To: emacs-pretest-bug <at> gnu.org
Subject: 23.0.60; [patch] `Mark set' clobbers useful message in ibuffer
Date: Mon, 23 Feb 2009 11:26:49 +0900
In ibuffer, running ibuffer-toggle-sorting-mode will produce a useful
message telling the user what the buffer is now sorted by. That
message is immediately clobbered by an useless `Mark set' message
(useless because ibuffer stomps all over any such mark).

To reproduce:

  emacs -Q
  M-x ibuffer
  ,
  C-h e and observe that both "Sorting by ..." and "Mark set" appear

A patch follows (against GNU Emacs 23.0.60.1 (i486-pc-linux-gnu, GTK+
Version 2.12.11) of 2008-11-22 on elegiac, modified by Debian).

diff -c -L /usr/share/emacs/23.0.60/lisp/ibuffer.el.gz -L
/tmp/buffer-content-31328m2 /tmp/jka-com3132uwF
/tmp/buffer-content-31328m2
*** /usr/share/emacs/23.0.60/lisp/ibuffer.el.gz
--- /tmp/buffer-content-31328m2
***************
*** 2277,2283 ****
        (setq buffer-read-only t)
        (set-buffer-modified-p ibuffer-did-modification)
        (setq ibuffer-did-modification nil)
!       (goto-line (1+ orig)))))

  (defun ibuffer-quit ()
    "Quit this `ibuffer' session.
--- 2277,2284 ----
        (setq buffer-read-only t)
        (set-buffer-modified-p ibuffer-did-modification)
        (setq ibuffer-did-modification nil)
!       (goto-char 1)
!       (forward-line orig))))

  (defun ibuffer-quit ()
    "Quit this `ibuffer' session.




Tags added: patch Request was from Juanma Barranquero <lekktu <at> gmail.com> to control <at> emacsbugs.donarmstrong.com. (Mon, 23 Feb 2009 10:55:03 GMT) Full text and rfc822 format available.

Reply sent to Juanma Barranquero <lekktu <at> gmail.com>:
You have taken responsibility. (Mon, 23 Feb 2009 11:10:05 GMT) Full text and rfc822 format available.

Notification sent to Geoff Gole <geoffgole <at> gmail.com>:
bug acknowledged by developer. (Mon, 23 Feb 2009 11:10:05 GMT) Full text and rfc822 format available.

Message #12 received at 2439-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Geoff Gole <geoffgole <at> gmail.com>
Cc: 2439-done <at> debbugs.gnu.org
Subject: Re: bug#2439: 23.0.60; [patch] `Mark set' clobbers useful message in 
	ibuffer
Date: Mon, 23 Feb 2009 12:01:57 +0100
On Mon, Feb 23, 2009 at 03:26, Geoff Gole <geoffgole <at> gmail.com> wrote:

> A patch follows (against GNU Emacs 23.0.60.1 (i486-pc-linux-gnu, GTK+
> Version 2.12.11) of 2008-11-22 on elegiac, modified by Debian).

Installed, thanks.

    Juanma




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2439; Package emacs. (Mon, 23 Feb 2009 21:35:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Xavier Maillard <xma <at> gnu.org>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Mon, 23 Feb 2009 21:35:03 GMT) Full text and rfc822 format available.

Message #17 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Xavier Maillard <xma <at> gnu.org>
To: Geoff Gole <geoffgole <at> gmail.com>
Cc: emacs-pretest-bug <at> gnu.org
Subject: Re: bug#2439: 23.0.60;
	[patch] `Mark set' clobbers useful message in ibuffer
Date: Mon, 23 Feb 2009 22:25:03 +0100
   In ibuffer, running ibuffer-toggle-sorting-mode will produce a useful
   message telling the user what the buffer is now sorted by. That
   message is immediately clobbered by an useless `Mark set' message
   (useless because ibuffer stomps all over any such mark).

Confirmed. Your patch fixed that oddity.

	Xavier
-- 
http://www.gnu.org
http://www.april.org
http://www.lolica.org




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2439; Package emacs. (Wed, 25 Feb 2009 16:35:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> IRO.UMontreal.CA>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Wed, 25 Feb 2009 16:35:03 GMT) Full text and rfc822 format available.

Message #22 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Geoff Gole <geoffgole <at> gmail.com>
Cc: 2439 <at> debbugs.gnu.org, emacs-pretest-bug <at> gnu.org
Subject: Re: bug#2439: 23.0.60; [patch] `Mark set' clobbers useful message in ibuffer
Date: Wed, 25 Feb 2009 11:30:10 -0500
> !       (goto-char 1)
> !       (forward-line orig))))

Thanks for your patch, but please try to avoid hardcoding "1" as above.
Just use (point-min) instead.


        Stefan






Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2439; Package emacs. (Wed, 25 Feb 2009 16:35:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> IRO.UMontreal.CA>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Wed, 25 Feb 2009 16:35:05 GMT) Full text and rfc822 format available.

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2439; Package emacs. (Wed, 25 Feb 2009 16:55:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juanma Barranquero <lekktu <at> gmail.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Wed, 25 Feb 2009 16:55:05 GMT) Full text and rfc822 format available.

Message #32 received at 2439 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>, 2439 <at> debbugs.gnu.org
Cc: Geoff Gole <geoffgole <at> gmail.com>
Subject: Re: bug#2439: 23.0.60; [patch] `Mark set' clobbers useful message in 
	ibuffer
Date: Wed, 25 Feb 2009 17:51:22 +0100
On Wed, Feb 25, 2009 at 17:30, Stefan Monnier <monnier <at> iro.umontreal.ca> wrote:

> Thanks for your patch, but please try to avoid hardcoding "1" as above.
> Just use (point-min) instead.

What is the point, when having a narrowed buffer would be an error?

In this case,

  (goto-char 1)
  (forward-line orig)

is not the same as

  (goto-line (1+ orig))

because `goto-line' uses `(save-restriction (widen) ...)'. So, if
anything, is not that the patch should use `point-min', but that it
should use

  (save-restriction
    (widen)
    (goto-char 1)
    (forward-line orig))

though I don't think narrowing the ibuffer buffer and then sorting is
a common enough operation to worry about it. Same for bs-down, where I
implemented the same fix.

    Juanma




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2439; Package emacs. (Wed, 25 Feb 2009 19:55:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> IRO.UMontreal.CA>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Wed, 25 Feb 2009 19:55:05 GMT) Full text and rfc822 format available.

Message #37 received at 2439 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: 2439 <at> debbugs.gnu.org, Geoff Gole <geoffgole <at> gmail.com>
Subject: Re: bug#2439: 23.0.60; [patch] `Mark set' clobbers useful message in
Date: Wed, 25 Feb 2009 14:53:56 -0500
>> Thanks for your patch, but please try to avoid hardcoding "1" as above.
>> Just use (point-min) instead.
> What is the point, when having a narrowed buffer would be an error?

Because 1 is sometimes an error, whereas (point-min) isn't.

> because `goto-line' uses `(save-restriction (widen) ...)'. So, if
> anything, is not that the patch should use `point-min', but that it
> should use

>   (save-restriction
>     (widen)
>     (goto-char 1)
>     (forward-line orig))

No, it should be

   (save-restriction
     (widen)
     (goto-char (point-min))
     (forward-line orig))

> though I don't think narrowing the ibuffer buffer and then sorting is
> a common enough operation to worry about it.  Same for bs-down, where
> I implemented the same fix.

Agreed.  But still using (point-min) rather than 1.


        Stefan




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2439; Package emacs. (Wed, 25 Feb 2009 22:40:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juanma Barranquero <lekktu <at> gmail.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Wed, 25 Feb 2009 22:40:04 GMT) Full text and rfc822 format available.

Message #42 received at 2439 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 2439 <at> debbugs.gnu.org, Geoff Gole <geoffgole <at> gmail.com>
Subject: Re: bug#2439: 23.0.60; [patch] `Mark set' clobbers useful message in
Date: Wed, 25 Feb 2009 23:37:26 +0100
On Wed, Feb 25, 2009 at 20:53, Stefan Monnier <monnier <at> iro.umontreal.ca> wrote:

> Agreed.  But still using (point-min) rather than 1.

OK, fixed in these two cases. There are still 31 instances of
(goto-char 1) in 24 files:

autoinsert.el
indent.el
simple.el
emacs-lisp\gulp.el
emacs-lisp\testcover.el
international\ja-dic-cnv.el
international\quail.el
mail\mail-utils.el
mail\mailalias.el
net\ange-ftp.el
nxml\rng-cmpct.el
play\dissociate.el
progmodes\ada-xref.el
progmodes\cperl-mode.el
progmodes\ebrowse.el
progmodes\idlwave.el
progmodes\ps-mode.el
textmodes\page.el
textmodes\reftex-cite.el
textmodes\reftex-dcr.el
textmodes\reftex-index.el
textmodes\reftex-parse.el
textmodes\reftex-ref.el
textmodes\reftex.el

    Juanma




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2439; Package emacs. (Thu, 26 Feb 2009 05:05:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Geoff Gole <geoffgole <at> gmail.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Thu, 26 Feb 2009 05:05:05 GMT) Full text and rfc822 format available.

Message #47 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Geoff Gole <geoffgole <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>, emacs-pretest-bug <at> gnu.org,
        2439 <at> debbugs.gnu.org, lekktu <at> gmail.com
Subject: Re: bug#2439: 23.0.60; [patch] `Mark set' clobbers useful message in 
	ibuffer
Date: Thu, 26 Feb 2009 14:00:43 +0900
> Thanks for your patch, but please try to avoid hardcoding "1" as above.
> Just use (point-min) instead.

Good point. I took a peek at the source of goto-line to see if it did
anything that I'd need to replicate, and grabbed the line from there
without thinking.

Should goto-line also use (point-min)?

> I don't think narrowing the ibuffer buffer and then sorting is
> a common enough operation to worry about it.

I didn't bother with handling restrictions, as they don't seem to be
respected by ibuffer. Narrowed ibuffer buffers will either behave
strangely or simply clobber the restriction.

Perhaps I should have mentioned that in a comment or when submitting the patch.




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2439; Package emacs. (Thu, 26 Feb 2009 05:05:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Geoff Gole <geoffgole <at> gmail.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Thu, 26 Feb 2009 05:05:07 GMT) Full text and rfc822 format available.

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2439; Package emacs. (Thu, 26 Feb 2009 15:25:08 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Thu, 26 Feb 2009 15:25:08 GMT) Full text and rfc822 format available.

Message #57 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Geoff Gole <geoffgole <at> gmail.com>
Cc: emacs-pretest-bug <at> gnu.org, 2439 <at> debbugs.gnu.org,
        lekktu <at> gmail.com
Subject: Re: bug#2439: 23.0.60; [patch] `Mark set' clobbers useful message in
Date: Thu, 26 Feb 2009 10:17:15 -0500
> I didn't bother with handling restrictions, as they don't seem to be
> respected by ibuffer. Narrowed ibuffer buffers will either behave
> strangely or simply clobber the restriction.

> Perhaps I should have mentioned that in a comment or when submitting
> the patch.

This issue is unrelated to your patch, really.


        Stefan




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2439; Package emacs. (Thu, 26 Feb 2009 15:25:11 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Thu, 26 Feb 2009 15:25:11 GMT) Full text and rfc822 format available.

Message #62 received at 2439 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: 2439 <at> debbugs.gnu.org, Geoff Gole <geoffgole <at> gmail.com>
Subject: Re: bug#2439: 23.0.60; [patch] `Mark set' clobbers useful message in
Date: Thu, 26 Feb 2009 10:16:15 -0500
>> Agreed.  But still using (point-min) rather than 1.

> OK, fixed in these two cases. There are still 31 instances of
> (goto-char 1) in 24 files:

There's no hurry to change that code.  Just keep it in mind when you
write new code or modify existing code.


        Stefan




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2439; Package emacs. (Thu, 26 Feb 2009 15:25:14 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Thu, 26 Feb 2009 15:25:14 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> emacsbugs.donarmstrong.com. (Fri, 27 Mar 2009 14:24:12 GMT) Full text and rfc822 format available.

This bug report was last modified 16 years and 147 days ago.

Previous Next


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