From cf59e41cd43faf1ebb5b80f3b2519477ebbbceee Mon Sep 17 00:00:00 2001 From: Alp Aker Date: Wed, 30 Oct 2013 14:35:19 -0400 Subject: [PATCH] Ensure unmarking in buffer menu clears 'S' marks. (Bug#15761) * buff-menu.el (Buffer-menu--unmark): New function. (Buffer-menu-unmark, Buffer-menu-backup-unmark): Use it. --- lisp/ChangeLog | 6 ++++++ lisp/buff-menu.el | 12 ++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5a91ad0f55c..114896f070e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2013-10-30 Alp Aker + + Ensure unmarking in buffer menu clears 'S' marks. (Bug#15761) + * buff-menu.el (Buffer-menu--unmark): New function. + (Buffer-menu-unmark, Buffer-menu-backup-unmark): Use it. + 2013-10-30 Glenn Morris * Makefile.in (AUTOGENEL): Add org/org-loaddefs.el. diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el index 58fde695b39..627c02f6e62 100644 --- a/lisp/buff-menu.el +++ b/lisp/buff-menu.el @@ -353,14 +353,22 @@ It will be displayed by the \\\\[Buffer-menu-select] comma "Cancel all requested operations on buffer on this line and move down. Optional prefix arg means move up." (interactive "P") - (tabulated-list-set-col 0 " " t) + (Buffer-menu--unmark) (forward-line (if backup -1 1))) (defun Buffer-menu-backup-unmark () "Move up and cancel all requested operations on buffer on line above." (interactive) (forward-line -1) - (tabulated-list-set-col 0 " " t)) + (Buffer-menu--unmark)) + +(defun Buffer-menu--unmark () + (tabulated-list-set-col 0 " " t) + (let ((buf (Buffer-menu-buffer))) + (when buf + (if (buffer-modified-p buf) + (tabulated-list-set-col 2 "*" t) + (tabulated-list-set-col 2 " " t))))) (defun Buffer-menu-delete (&optional arg) "Mark the buffer on this Buffer Menu buffer line for deletion. -- 2.39.2