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: Thu, 20 Jul 2017 09:14:54 +0900 (JST) Message-ID: <20170720.091454.2073526586086847652.tkk@misasa.okayama-u.ac.jp> References: <20170719.121817.1770061592165445558.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 1500509720 981 195.159.176.226 (20 Jul 2017 00:15:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 20 Jul 2017 00:15:20 +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 Thu Jul 20 02:15:17 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 1dXz7a-0008Gk-QH for ged-emacs-devel@m.gmane.org; Thu, 20 Jul 2017 02:15:14 +0200 Original-Received: from localhost ([::1]:35488 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXz7e-0006Kn-Ol for ged-emacs-devel@m.gmane.org; Wed, 19 Jul 2017 20:15:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39902) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXz7Y-0006Ki-JA for emacs-devel@gnu.org; Wed, 19 Jul 2017 20:15:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXz7T-0006dW-Ja for emacs-devel@gnu.org; Wed, 19 Jul 2017 20:15:12 -0400 Original-Received: from mxl065v65.mxlogic.net ([208.81.65.65]:44030 helo=s14p02o142.mxlogic.net) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dXz7T-0006Uo-1k for emacs-devel@gnu.org; Wed, 19 Jul 2017 20:15:07 -0400 Original-Received: from unknown [42.127.236.175] (EHLO mlsec.cc.okayama-u.ac.jp) by s14p02o142.mxlogic.net(mxl_mta-8.5.0-1834) over TLS secured channel with ESMTP id 006ff695.0.249151.00-399.540008.s14p02o142.mxlogic.net (envelope-from ); Wed, 19 Jul 2017 18:14:57 -0600 (MDT) X-MXL-Hash: 596ff6016721982f-a98652973a9186cc51e11b5c7e89869edaec9e73 Original-Received: from alml002.ouadm.okayama-u.ac.jp (unknown [42.127.236.168]) by mlsec.cc.okayama-u.ac.jp with smtp id 70d8_2276_b878dd2d_bde0_4e8d_8bef_0f858c483317; Thu, 20 Jul 2017 09:14:54 +0900 Original-Received: from localhost (vesta.misasa.okayama-u.ac.jp [150.46.48.154]) by alml002.ouadm.okayama-u.ac.jp (Postfix) with ESMTPSA id 6E56C4C0A8C; Thu, 20 Jul 2017 09:14:55 +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, RV6075=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6075> : inlines <5984> : streams <1754923> : uri <2466202> X-AnalysisOut: [v=2.2 cv=ebZNR/MH 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=7H7b1mJsnIdI06eICpwA:9 a=7Zwj6sZBwVKJAoWSPK] X-AnalysisOut: [xL6X1jA+E=:19 a=CjuIK1q_8ugA:10] X-Spam: [F=0.5000000000; CM=0.500; MH=0.500(2017071919); S=0.202(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.65.65 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:216882 Archived-At: >> I want to construct edit-menu dynamically depending on event. >> Using the technique, code will look: > > I think that should be > >> (defun my-edit-map (start-event) >> ; ... >> menu-bar-edit-menu) > > (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) That works. Thank you for the revision. 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. This technique binds a keymap. I cannot find a way to call flyspell-correct-word. CONCLUSION: Still your change is needed.