From: Noam Postavsky <npostavs@users.sourceforge.net>
To: Drew Adams <drew.adams@oracle.com>
Cc: 29599@debbugs.gnu.org
Subject: bug#29599: 26.0; `dframe.el' binds keys unconditionally when loaded
Date: Mon, 18 Dec 2017 20:40:05 -0500 [thread overview]
Message-ID: <878tdzbimi.fsf@users.sourceforge.net> (raw)
In-Reply-To: <ae1299ec-4ecc-4d16-845f-dc778688188e@default> (Drew Adams's message of "Wed, 6 Dec 2017 22:10:52 -0800 (PST)")
[-- Attachment #1: Type: text/plain, Size: 1234 bytes --]
Drew Adams <drew.adams@oracle.com> writes:
> I must have done something after my init file was loaded that required
> `dframe.elc' to be loaded, and that load overwrote bindings I made in my
> init file.
>
> I don't know what I did that caused dframe to be loaded, but that
> shouldn't matter. I don't think it should overwrite key bindings
> just by being loaded.
Yeah (it's probably the loading-on-completion thing again).
> Shouldn't dframe.el bind its own commands to `special-event-map' keys
> only if those keys are not already bound?
> I don't know what it's doing or why, but this doesn't seem very polite
> of it. Why should it think that just by being loaded it should
> (re-)bind keys?
The root problem is that there is no easy way to share the bindings. I
think those keys should be bound to a function which calls runs a hook,
like focus-in and focus-out events are. Actually, it sort of looks like
dframe is trying to install such a hook; the functions it puts don't do
anything except call `dframe-make-frame-{visible,iconify,delete}-function'.
Anyway, at a minimum, we can't have keybindings being modified by just a
load. Here's a patch which moves the keybinding to dframe-frame-mode
activation instead.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 1789 bytes --]
From e7965c6f4f9dcce7f38ab9a51cd2638d5feb5c66 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@gmail.com>
Date: Mon, 18 Dec 2017 20:30:10 -0500
Subject: [PATCH] Don't bind dframe events on load (Bug#29599)
* lisp/dframe.el (dframe-set-special-events): New function, containing
previous top-level key binding code.
(dframe-frame-mode): Use it.
---
lisp/dframe.el | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/lisp/dframe.el b/lisp/dframe.el
index 7f77d8991f..0766bd068d 100644
--- a/lisp/dframe.el
+++ b/lisp/dframe.el
@@ -288,6 +288,7 @@ dframe-frame-mode
(set frame-var nil))
;; Set this as our currently attached frame
(setq dframe-attached-frame (selected-frame))
+ (dframe-set-special-events)
(run-hooks popup-hook)
;; Updated the buffer passed in to contain all the hacks needed
;; to make it work well in a dedicated window.
@@ -543,16 +544,14 @@ dframe-detach
)))
;;; Special frame event proxies
-;;
-(if (boundp 'special-event-map)
- (progn
- (define-key special-event-map [make-frame-visible]
- 'dframe-handle-make-frame-visible)
- (define-key special-event-map [iconify-frame]
- 'dframe-handle-iconify-frame)
- (define-key special-event-map [delete-frame]
- 'dframe-handle-delete-frame))
- )
+(defun dframe-set-special-events ()
+ (when (boundp 'special-event-map)
+ (define-key special-event-map [make-frame-visible]
+ 'dframe-handle-make-frame-visible)
+ (define-key special-event-map [iconify-frame]
+ 'dframe-handle-iconify-frame)
+ (define-key special-event-map [delete-frame]
+ 'dframe-handle-delete-frame)))
(defvar dframe-make-frame-visible-function nil
"Function used when a dframe controlled frame is de-iconified.
--
2.11.0
next prev parent reply other threads:[~2017-12-19 1:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-07 6:10 bug#29599: 26.0; `dframe.el' binds keys unconditionally when loaded Drew Adams
2017-12-19 1:40 ` Noam Postavsky [this message]
2017-12-19 2:15 ` Drew Adams
2017-12-19 3:51 ` Noam Postavsky
2017-12-19 5:21 ` Drew Adams
2017-12-19 13:15 ` Noam Postavsky
2017-12-19 15:22 ` Drew Adams
2018-01-03 1:59 ` Noam Postavsky
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=878tdzbimi.fsf@users.sourceforge.net \
--to=npostavs@users.sourceforge.net \
--cc=29599@debbugs.gnu.org \
--cc=drew.adams@oracle.com \
/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.