From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tak Kunihiro Newsgroups: gmane.emacs.devel 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) Message-ID: <20170721.131154.778619680886235556.tkk@misasa.okayama-u.ac.jp> References: <20170720.091454.2073526586086847652.tkk@misasa.okayama-u.ac.jp> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1500610486 20638 195.159.176.226 (21 Jul 2017 04:14:46 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 21 Jul 2017 04:14:46 +0000 (UTC) Cc: tkk@misasa.okayama-u.ac.jp, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: npostavs@users.sourceforge.net Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 21 06:14:41 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dYPKm-0004kC-TB for ged-emacs-devel@m.gmane.org; Fri, 21 Jul 2017 06:14:37 +0200 Original-Received: from localhost ([::1]:40928 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dYPKq-0001fg-J2 for ged-emacs-devel@m.gmane.org; Fri, 21 Jul 2017 00:14:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42345) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dYPKJ-0001fb-N8 for emacs-devel@gnu.org; Fri, 21 Jul 2017 00:14:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dYPKE-00032U-PF for emacs-devel@gnu.org; Fri, 21 Jul 2017 00:14:07 -0400 Original-Received: from mxl069v66.mxlogic.net ([208.81.69.66]:20323 helo=s18p02o143.mxlogic.net) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dYPKE-0002yk-2w for emacs-devel@gnu.org; Fri, 21 Jul 2017 00:14:02 -0400 Original-Received: from unknown [42.127.236.175] (EHLO mlsec.cc.okayama-u.ac.jp) by s18p02o143.mxlogic.net(mxl_mta-8.5.0-1834) over TLS secured channel with ESMTP id e7f71795.0.156234.00-365.357515.s18p02o143.mxlogic.net (envelope-from ); Thu, 20 Jul 2017 22:13:54 -0600 (MDT) X-MXL-Hash: 59717f822fc07233-7ed8d2aa1a203dd176efd907d328a9384992a831 Original-Received: from alml002.ouadm.okayama-u.ac.jp (unknown [42.127.236.168]) by mlsec.cc.okayama-u.ac.jp with smtp id 4e7d_e7e7_05f8a566_ad0a_4ef2_a8d8_50dc8938393a; Fri, 21 Jul 2017 13:13:46 +0900 Original-Received: from localhost (unknown [172.24.2.234]) by alml002.ouadm.okayama-u.ac.jp (Postfix) with ESMTPSA id 506EF4C0C1C; Fri, 21 Jul 2017 13:13:46 +0900 (JST) In-Reply-To: X-Mailer: Mew version 6.7 on Emacs 25.2 / Mule 6.0 (HANACHIRUSATO) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 11 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 4 Rules triggered EDT_SA_AU_PASS=0, EDT_SA_DN_PASS=0, EDT_SA_TS_PASS=0, RV6076=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6076> : inlines <5988> : streams <1755087> : uri <2466915> X-AnalysisOut: [v=2.2 cv=GOR4KqFK c=1 sm=1 tr=0 a=8LLPK8U+aGQ6qN8QlyMYtQ==] X-AnalysisOut: [:117 a=8LLPK8U+aGQ6qN8QlyMYtQ==:17 a=kj9zAlcOel0A:10 a=G3g] X-AnalysisOut: [G6ho9WtcA:10 a=asNfx6W-3jgbWIGrf0YA:9 a=7Zwj6sZBwVKJAoWSPK] X-AnalysisOut: [xL6X1jA+E=:19 a=CjuIK1q_8ugA:10] X-Spam: [F=0.5000000000; CM=0.500; MH=0.500(2017072020); S=0.200(2015072901)] X-MAIL-FROM: X-SOURCE-IP: [42.127.236.175] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 208.81.69.66 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:216910 Archived-At: >>> (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.