emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] master a2ee819: Let delete-selection-mode work with po


From: Tak Kunihiro
Subject: Re: [Emacs-diffs] master a2ee819: Let delete-selection-mode work with popup-menu commands (Bug#27569)
Date: Wed, 19 Jul 2017 12:18:17 +0900 (JST)

> menu-bar-edit-menu
>           :filter ,(lambda (_) menu-bar-edit-menu)))
> ;; delete-selection now works correctly with yank invoked via the mouse-3 menu
> (delete-selection-mode +1)
> 
> So perhaps my change to popup-menu isn't really needed...

I want to construct edit-menu dynamically depending on event.
Using the technique, code will look:

(define-key global-map [mouse-3]
  (lambda (event)
    (interactive "e")
    (let ((my-edit-map (my-edit-map event)))
      `(menu-item "Edit menu" my-edit-map
                  :filter ,(lambda (_) my-edit-map)))))
;; delete-selection now works correctly with yank invoked via the mouse-3 menu
(delete-selection-mode +1)

(defun my-edit-map (start-event)
  ; ...
  menu-bar-edit-menu)

CONCLUSION:
I appreciate your change and I think it is needed.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]