aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Paul Wallington2002-10-29 04:21:03 +0000
committerJohn Paul Wallington2002-10-29 04:21:03 +0000
commita1793b2dd29c08c236e4d9a236c55080ee1ec2c6 (patch)
tree11548f806f6a6e30c5cb93767ffe0419b322ded9
parente53f3118cd0bb2de129934047f3f5e382dc9acf9 (diff)
downloademacs-a1793b2dd29c08c236e4d9a236c55080ee1ec2c6.tar.gz
emacs-a1793b2dd29c08c236e4d9a236c55080ee1ec2c6.zip
(ibuffer-mouse-popup-menu): Set point before popping
up filter groups menu. Preserve point unless a menu command has moved it from point clicked.
-rw-r--r--lisp/ibuffer.el13
1 files changed, 8 insertions, 5 deletions
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index d37d5c6f644..464961cc417 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -869,12 +869,13 @@ width and the longest string in LIST."
869(defun ibuffer-mouse-popup-menu (event) 869(defun ibuffer-mouse-popup-menu (event)
870 "Display a menu of operations." 870 "Display a menu of operations."
871 (interactive "e") 871 (interactive "e")
872 (let ((eventpt (save-excursion 872 (let ((eventpt (posn-point (event-end event)))
873 (mouse-set-point event) 873 (origpt (point)))
874 (point))))
875 (unwind-protect 874 (unwind-protect
876 (if (get-text-property eventpt 'ibuffer-filter-group-name) 875 (if (get-text-property eventpt 'ibuffer-filter-group-name)
877 (popup-menu ibuffer-mode-groups-popup) 876 (progn
877 (goto-char eventpt)
878 (popup-menu ibuffer-mode-groups-popup))
878 (let ((inhibit-read-only t)) 879 (let ((inhibit-read-only t))
879 (ibuffer-save-marks 880 (ibuffer-save-marks
880 ;; hm. we could probably do this in a better fashion 881 ;; hm. we could probably do this in a better fashion
@@ -884,7 +885,9 @@ width and the longest string in LIST."
884 (ibuffer-set-mark ibuffer-marked-char)) 885 (ibuffer-set-mark ibuffer-marked-char))
885 (save-excursion 886 (save-excursion
886 (popup-menu ibuffer-mode-operate-map))))) 887 (popup-menu ibuffer-mode-operate-map)))))
887 (setq buffer-read-only t)))) 888 (setq buffer-read-only t)
889 (if (eq eventpt (point))
890 (goto-char origpt)))))
888 891
889(defun ibuffer-skip-properties (props direction) 892(defun ibuffer-skip-properties (props direction)
890 (while (and (not (eobp)) 893 (while (and (not (eobp))