all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#12795: 24.2.50; ibuffers mark commands are quirky
@ 2012-11-04  0:47 Andreas Politz
  2012-11-17  7:15 ` Chong Yidong
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Politz @ 2012-11-04  0:47 UTC (permalink / raw)
  To: 12795

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





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#12795: 24.2.50; ibuffers mark commands are quirky
  2012-11-04  0:47 bug#12795: 24.2.50; ibuffers mark commands are quirky Andreas Politz
@ 2012-11-17  7:15 ` Chong Yidong
  0 siblings, 0 replies; 2+ messages in thread
From: Chong Yidong @ 2012-11-17  7:15 UTC (permalink / raw)
  To: Andreas Politz; +Cc: 12795-done

Andreas Politz <politza@fh-trier.de> 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.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-11-17  7:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-04  0:47 bug#12795: 24.2.50; ibuffers mark commands are quirky Andreas Politz
2012-11-17  7:15 ` Chong Yidong

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.