all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: npostavs@users.sourceforge.net
To: Tak Kunihiro <tkk@misasa.okayama-u.ac.jp>
Cc: 27569@debbugs.gnu.org
Subject: bug#27569: delete-selection on yank via popup-menu
Date: Tue, 11 Jul 2017 21:12:01 -0400	[thread overview]
Message-ID: <8737a2fogu.fsf@users.sourceforge.net> (raw)
In-Reply-To: <20170711.165928.1681891806866192564.tkk@misasa.okayama-u.ac.jp> (Tak Kunihiro's message of "Tue, 11 Jul 2017 16:59:28 +0900 (JST)")

[-- Attachment #1: Type: text/plain, Size: 255 bytes --]

tags 27569 + patch
quit

Tak Kunihiro <tkk@misasa.okayama-u.ac.jp> writes:

> Could you push to the master?

Okay, I'll wait a couple more days and then push the following (I think
doing setq on this-command makes more sense than let-binding after all).


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 1122 bytes --]

From 52c16f83b6781c83676507c165e69aaad0a3b2fd Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@gmail.com>
Date: Tue, 11 Jul 2017 21:09:10 -0400
Subject: [PATCH v2] Let delete-selection-mode work with popup-menu commands
 (Bug#27569)

* lisp/menu-bar.el (popup-menu): Run `pre-command-hook' with
`this-command' set to the selected command.
---
 lisp/menu-bar.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 9c7bcffbaa..107043b501 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -2360,6 +2360,10 @@ (defun popup-menu (menu &optional position prefix from-menu-bar)
       ;; `setup-specified-language-environment', for instance,
       ;; expects this to be set from a menu keymap.
       (setq last-command-event (car (last event)))
+      ;; Update `this-command' and run `pre-command-hook' so that
+      ;; things like `delete-selection-pre-hook' will work correctly.
+      (setq this-command cmd)
+      (run-hook 'pre-command-hook)
       ;; mouse-major-mode-menu was using `command-execute' instead.
       (call-interactively cmd))))
 
-- 
2.11.1


  reply	other threads:[~2017-07-12  1:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-03 23:15 bug#27569: delete-selection on yank via popup-menu Tak Kunihiro
2017-07-03 23:36 ` npostavs
2017-07-04 23:11   ` Tak Kunihiro
2017-07-11  7:59     ` Tak Kunihiro
2017-07-12  1:12       ` npostavs [this message]
2017-07-18  4:35         ` Tak Kunihiro
2017-07-18 10:43           ` npostavs
2017-07-22 14:40             ` npostavs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8737a2fogu.fsf@users.sourceforge.net \
    --to=npostavs@users.sourceforge.net \
    --cc=27569@debbugs.gnu.org \
    --cc=tkk@misasa.okayama-u.ac.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.