GNU bug report logs - #12795
24.2.50; ibuffers mark commands are quirky

Previous Next

Package: emacs;

Reported by: Andreas Politz <politza <at> fh-trier.de>

Date: Sun, 4 Nov 2012 00:51:01 UTC

Severity: minor

Tags: patch

Found in version 24.2.50

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Andreas Politz <politza <at> fh-trier.de>
To: 12795 <at> debbugs.gnu.org
Subject: bug#12795: 24.2.50; ibuffers mark commands are quirky
Date: Sun, 04 Nov 2012 01:47:06 +0100
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




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

Previous Next


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