From: John Paul Wallington Date: Tue, 29 Oct 2002 04:21:03 +0000 (+0000) Subject: (ibuffer-mouse-popup-menu): Set point before popping X-Git-Tag: ttn-vms-21-2-B4~12678 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a1793b2dd29c08c236e4d9a236c55080ee1ec2c6;p=emacs.git (ibuffer-mouse-popup-menu): Set point before popping up filter groups menu. Preserve point unless a menu command has moved it from point clicked. --- 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." (defun ibuffer-mouse-popup-menu (event) "Display a menu of operations." (interactive "e") - (let ((eventpt (save-excursion - (mouse-set-point event) - (point)))) + (let ((eventpt (posn-point (event-end event))) + (origpt (point))) (unwind-protect (if (get-text-property eventpt 'ibuffer-filter-group-name) - (popup-menu ibuffer-mode-groups-popup) + (progn + (goto-char eventpt) + (popup-menu ibuffer-mode-groups-popup)) (let ((inhibit-read-only t)) (ibuffer-save-marks ;; hm. we could probably do this in a better fashion @@ -884,7 +885,9 @@ width and the longest string in LIST." (ibuffer-set-mark ibuffer-marked-char)) (save-excursion (popup-menu ibuffer-mode-operate-map))))) - (setq buffer-read-only t)))) + (setq buffer-read-only t) + (if (eq eventpt (point)) + (goto-char origpt))))) (defun ibuffer-skip-properties (props direction) (while (and (not (eobp))