Subject: bug#12795: closed (Re: bug#12795: 24.2.50; ibuffers mark commands are quirky)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 17 Nov 2012 07:17:02 +0000

Your bug report

#12795: 24.2.50; ibuffers mark commands are quirky

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
12795: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12795
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#12795: 24.2.50; ibuffers mark commands are quirky
From: Chong Yidong <[email-masked]>
To: Andreas Politz <[email-masked]>
Cc: [email-masked]
Date: Sat, 17 Nov 2012 15:15:33 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Andreas Politz <[email-masked]> writes:

> I found some problems with ibuffers movement commands: The mark commands
> in ibuffer use a "P" interactive spec and error on C-u prefix args. They
> don't support negative arguments and the backwards unmarking behaviour
> is non-standard (= dired).  The attached patch addresses these points.

Thanks, committed to trunk.

Subject: 24.2.50; ibuffers mark commands are quirky
From: Andreas Politz <[email-masked]>
To: [email-masked]
Date: Sun, 04 Nov 2012 01:47:06 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hey Emacs guys !

I found some problems with ibuffers movement commands: The mark commands
in ibuffer use a "P" interactive spec and error on C-u prefix args. They
don't support negative arguments and the backwards unmarking behaviour
is non-standard (= dired).  The attached patch addresses these points.

-ap

diff -c -L /usr/share/emacs/24.2.50/lisp/ibuffer.el.gz -L \#\<buffer\ ibuffer.el.gz\> /tmp/jka-com2962CdI /tmp/buffer-content-2962cxU
*** /usr/share/emacs/24.2.50/lisp/ibuffer.el.gz
--- #<buffer ibuffer.el.gz>
***************
*** 1359,1382 ****
  (defun ibuffer-mark-forward (arg)
    "Mark the buffer on this line, and move forward ARG lines.
  If point is on a group name, this function operates on that group."
!   (interactive "P")
!   (ibuffer-mark-interactive arg ibuffer-marked-char 1))
  
  (defun ibuffer-unmark-forward (arg)
    "Unmark the buffer on this line, and move forward ARG lines.
  If point is on a group name, this function operates on that group."
!   (interactive "P")
!   (ibuffer-mark-interactive arg ?\s 1))
  
  (defun ibuffer-unmark-backward (arg)
    "Unmark the buffer on this line, and move backward ARG lines.
  If point is on a group name, this function operates on that group."
!   (interactive "P")
!   (ibuffer-mark-interactive arg ?\s -1))
  
! (defun ibuffer-mark-interactive (arg mark movement)
    (ibuffer-assert-ibuffer-mode)
    (or arg (setq arg 1))
    (ibuffer-forward-line 0)
    (ibuffer-aif (get-text-property (point) 'ibuffer-filter-group-name)
        (progn
--- 1359,1385 ----
  (defun ibuffer-mark-forward (arg)
    "Mark the buffer on this line, and move forward ARG lines.
  If point is on a group name, this function operates on that group."
!   (interactive "p")
!   (ibuffer-mark-interactive arg ibuffer-marked-char))
  
  (defun ibuffer-unmark-forward (arg)
    "Unmark the buffer on this line, and move forward ARG lines.
  If point is on a group name, this function operates on that group."
!   (interactive "p")
!   (ibuffer-mark-interactive arg ?\s))
  
  (defun ibuffer-unmark-backward (arg)
    "Unmark the buffer on this line, and move backward ARG lines.
  If point is on a group name, this function operates on that group."
!   (interactive "p")
!   (ibuffer-unmark-forward (- arg)))
  
! (defun ibuffer-mark-interactive (arg mark &optional movement)
    (ibuffer-assert-ibuffer-mode)
    (or arg (setq arg 1))
+   ;; deprecated movement argument
+   (when (and movement (< movement 0))
+     (setq arg (- arg)))
    (ibuffer-forward-line 0)
    (ibuffer-aif (get-text-property (point) 'ibuffer-filter-group-name)
        (progn
***************
*** 1386,1393 ****
      (let ((inhibit-read-only t))
        (while (> arg 0)
  	(ibuffer-set-mark mark)
! 	(ibuffer-forward-line movement t)
! 	(setq arg (1- arg))))))
  
  (defun ibuffer-set-mark (mark)
    (ibuffer-assert-ibuffer-mode)
--- 1389,1400 ----
      (let ((inhibit-read-only t))
        (while (> arg 0)
  	(ibuffer-set-mark mark)
! 	(ibuffer-forward-line 1 t)
! 	(setq arg (1- arg)))
!       (while (< arg 0)
! 	(ibuffer-forward-line -1 t)
! 	(ibuffer-set-mark mark)
! 	(setq arg (1+ arg))))))
  
  (defun ibuffer-set-mark (mark)
    (ibuffer-assert-ibuffer-mode)

Diff finished.  Sun Nov  4 01:32:54 2012