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: Fri, 21 Jul 2017 13:11:54 +0900 (JST)

>>> (define-key global-map [mouse-3]
>>>   `(menu-item "Edit menu" my-edit-map
>>>           :filter ,(lambda (_) (my-edit-map (aref (this-command-keys) 0)))))
>>> ;; delete-selection now works correctly with yank invoked via the mouse-3 
>>> menu
>>> (delete-selection-mode +1)
>>
>> I want to call flyspell-correct-word when word under event is
>> flyspell-incorrect (mouse-2 is too hard to access).  When not, then
>> the dynamic edit menu.
>
> (defun my-edit-map (event)
>   (if (get-text-property (posn-point (event-start event))
>              'flyspell-incorrect)
>       #'flyspell-correct-word
>   menu-bar-edit-menu))
>

> Just return the `flyspell-correct-word' symbol.


Now I got rid of usage of popup-menu in the code.

(defun my-edit-map (event)
  (let ((faces-at-point (mapcar (lambda (xxx) (overlay-get xxx 'face))
                                (overlays-at (posn-point (event-start 
event))))))
    (cond
     ((member 'flyspell-incorrect faces-at-point)
      #'flyspell-correct-word)
     (t
      menu-bar-edit-menu))))


I confirmed that without the patch of menu-bar, yank via edit-menu
deletes region.  Thank you for instructions.

CONCLUSION:
Your change is not needed.



reply via email to

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