all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Gerd Möllmann" <gerd.moellmann@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: monnier@iro.umontreal.ca, 66022@debbugs.gnu.org
Subject: bug#66022: 30.0.50; kmacro overwriting global keybindings
Date: Sun, 17 Sep 2023 11:50:16 +0200	[thread overview]
Message-ID: <m2led5qgbr.fsf@Pro.fritz.box> (raw)
In-Reply-To: <837copgnu3.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 17 Sep 2023 12:18:12 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Gerd Möllmann <gerd.moellmann@gmail.com>
>> Cc: monnier@iro.umontreal.ca,  66022@debbugs.gnu.org
>> Date: Sun, 17 Sep 2023 10:58:11 +0200
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> >> > What does use-package do when the "package" is "emacs"?  IOW, at what
>> >> > point in time will the above binding be executed, and what event will
>> >> > trigger that?
>> >> 
>> >> Nothing.  It's sort of an idiom I found on the net for general
>> >> customizations and so on that don't belong to a particular package.
>> >> Some people apparently name it "general".
>> >
>> > So the above binding of F2 is never executed in your case?  Or else,
>> > how should I interpret your "Nothing" response to my question about
>> > the point in time when this binding is executed?
>> 
>> No, sorry for not being clear.  I meant use-package doesn't load a
>> package, or something like that.  It executes normally, and in
>> particular, it uses bind-key for the :bind clause, so that F2 gets
>> bound.
>
> Does it do that immediately as that particular use-package form is
> read and interpreted, or does it do it later (e.g., after the init
> file was loaded or something)?
>
> I'm trying to figure out when could the autoloaded bindings become in
> effect so as to countermand your use-package bindings (if this is what
> happens; does it?).

Hm, I must confess I'm not a great use-package expert, but maybe we can
figure this out.  I used pp-macro-expand-last-sexp on the use-package in
my .init.el.  The result is at the end.

I'd say it looks like the bind-key is done like so

  (condition-case-unless-debug err
      (progn
        ...
	(unless (fboundp 'mode-line-other-buffer)
	  (autoload #'mode-line-other-buffer "emacs" nil t))
        ...
        (bind-key ...)

This is the full macro expansion:

(progn
  (defvar use-package--warning47
    #'(lambda (keyword err)
	(let
	    ((msg
	      (format "%s/%s: %s" 'emacs keyword
		      (error-message-string err))))
	  (display-warning 'use-package msg :error))))
  (condition-case-unless-debug err
      (progn
	(let ((custom--inhibit-theme-enable nil))
	  (unless (memq 'use-package custom-known-themes)
	    (deftheme use-package) (enable-theme 'use-package)
	    (setq custom-enabled-themes
		  (remq 'use-package custom-enabled-themes)))
	  (custom-theme-set-variables 'use-package
				      '(cursor-type 'bar nil nil
						    "Customized with use-package emacs")
				      '(scroll-bar-mode nil nil nil
							"Customized with use-package emacs")
				      '(custom-enabled-themes
					'(modus-vivendi) nil nil
					"Customized with use-package emacs")
				      '(default-frame-alist
					'((height . 82) (width . 120))
					nil nil
					"Customized with use-package emacs")
				      '(ns-alternate-modifier 'meta
							      nil nil
							      "Customized with use-package emacs")
				      '(ns-left-command-modifier
					'super nil nil
					"Customized with use-package emacs")
				      '(ns-right-alternate-modifier
					'none nil nil
					"Customized with use-package emacs")
				      '(ns-right-command-modifier
					'meta nil nil
					"Customized with use-package emacs")
				      '(duplicate-line-final-position
					1 nil nil
					"Customized with use-package emacs")
				      '(enable-local-eval t nil nil
							  "Customized with use-package emacs")
				      '(enable-local-variables :all
							       nil nil
							       "Customized with use-package emacs")
				      '(help-window-select t nil nil
							   "Customized with use-package emacs")
				      '(server-mode t nil nil
						    "Customized with use-package emacs")
				      '(send-mail-function
					'smtpmail-send-it nil nil
					"Customized with use-package emacs")
				      '(vc-follow-symlinks t nil nil
							   "Customized with use-package emacs")
				      '(disabled-command-function nil
								  nil
								  nil
								  "Customized with use-package emacs")
				      '(ring-bell-function 'ignore nil
							   nil
							   "Customized with use-package emacs")
				      '(initial-scratch-message nil
								nil
								nil
								"Customized with use-package emacs")))
	(unless (fboundp 'undo) (autoload #'undo "emacs" nil t))
	(unless (fboundp 'undo-redo)
	  (autoload #'undo-redo "emacs" nil t))
	(unless (fboundp 'ibuffer) (autoload #'ibuffer "emacs" nil t))
	(unless (fboundp 'zap-up-to-char)
	  (autoload #'zap-up-to-char "emacs" nil t))
	(unless (fboundp 'mode-line-other-buffer)
	  (autoload #'mode-line-other-buffer "emacs" nil t))
	(unless (fboundp 'duplicate-dwim)
	  (autoload #'duplicate-dwim "emacs" nil t))
	(unless (fboundp 'switch-to-buffer)
	  (autoload #'switch-to-buffer "emacs" nil t))
	(unless (fboundp 'beginning-of-buffer)
	  (autoload #'beginning-of-buffer "emacs" nil t))
	(unless (fboundp 'end-of-buffer)
	  (autoload #'end-of-buffer "emacs" nil t))
	(unless (fboundp 'previous-buffer)
	  (autoload #'previous-buffer "emacs" nil t))
	(unless (fboundp 'next-buffer)
	  (autoload #'next-buffer "emacs" nil t))
	(unless (fboundp 'execute-extended-command)
	  (autoload #'execute-extended-command "emacs" nil t))
	(unless (fboundp 'delete-other-windows)
	  (autoload #'delete-other-windows "emacs" nil t))
	(unless (fboundp 'global-text-scale-adjust)
	  (autoload #'global-text-scale-adjust "emacs" nil t))
	(eval-after-load 'emacs
	  '(condition-case-unless-debug err
	       (progn
		 (defun my-startup-time nil
		   (message "Start time %s." (emacs-init-time)))
		 (add-hook 'emacs-startup-hook #'my-startup-time) t)
	     (error (funcall use-package--warning47 :config err))))
	(bind-keys :package emacs ("C-z" . undo) ("C-S-z" . undo-redo)
		   ("C-x C-b" . ibuffer) ("C-x 6") ("C-x C-k")
		   ("M-z" . zap-up-to-char)
		   ("<f2>" . mode-line-other-buffer)
		   ("C-c o" . mode-line-other-buffer)
		   ("C-c C-o" . mode-line-other-buffer)
		   ("<f4>" lambda nil (interactive)
		    (kill-buffer (current-buffer)))
		   ("C-c k" lambda nil (interactive)
		    (kill-buffer (current-buffer)))
		   ("C-c C-k" lambda nil (interactive)
		    (kill-buffer (current-buffer)))
		   ("C-<up>" lambda nil (interactive) (scroll-up 1))
		   ("C-<down>" lambda nil (interactive)
		    (scroll-down 1))
		   ("C-<tab>" . other-window)
		   ("C-c d" . duplicate-dwim) (" " . switch-to-buffer)
		   ("s-<up>" . beginning-of-buffer)
		   ("s-<down>" . end-of-buffer)
		   ("s-<left>" . previous-buffer)
		   ("s-<right>" . next-buffer)
		   ("s-x" . execute-extended-command)
		   ("s-o" . delete-other-windows)
		   ("s-+" . global-text-scale-adjust)
		   ("s--" . global-text-scale-adjust) ("s-h") ("s-m")
		   ("s-p") ("s-q")))
    (error (funcall use-package--warning47 :catch err))))







  reply	other threads:[~2023-09-17  9:50 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-16  6:38 bug#66022: 30.0.50; kmacro overwriting global keybindings Gerd Möllmann
2023-09-16  7:01 ` Andreas Schwab
2023-09-16  7:36   ` Gerd Möllmann
2023-09-16 18:44     ` Gerd Möllmann
2023-09-16 20:06       ` Andreas Schwab
2023-09-16 20:18         ` Gerd Möllmann
2023-09-16 20:37           ` Andreas Schwab
2023-09-16 20:55             ` Gerd Möllmann
2023-09-17  6:05 ` Eli Zaretskii
2023-09-17  6:31   ` Gerd Möllmann
2023-09-17  6:40     ` Gerd Möllmann
2023-09-17  6:47       ` Eli Zaretskii
2023-09-17  6:52         ` Gerd Möllmann
2023-09-17  8:53           ` Eli Zaretskii
2023-09-17  8:58             ` Gerd Möllmann
2023-09-17  9:18               ` Eli Zaretskii
2023-09-17  9:50                 ` Gerd Möllmann [this message]
2023-09-17 10:02                 ` Gerd Möllmann
2023-09-17 10:45                   ` Eli Zaretskii
2023-09-17 11:07                     ` Gerd Möllmann
2023-09-17 11:23                       ` Eli Zaretskii
2023-09-17 11:26                         ` Gerd Möllmann
2023-09-17 17:13                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-17 18:10                         ` Gerd Möllmann
2023-09-17 19:10                           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-18 14:36                             ` Gerd Möllmann
2023-09-18 14:42                               ` Gerd Möllmann
2023-09-18 14:52                                 ` Eli Zaretskii
2023-09-18 14:56                                   ` Gerd Möllmann
2023-09-18 15:09                                     ` Eli Zaretskii
2023-09-18 15:18                                       ` Gerd Möllmann
2023-09-18 15:25                                         ` Gerd Möllmann
2023-09-18 16:25                                           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-18 16:33                                             ` Gerd Möllmann
2023-09-18 17:00                                               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-18 17:54                                                 ` Gerd Möllmann
2023-09-18 18:24                                                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-18 18:27                                                     ` Gerd Möllmann
2023-09-20  9:57                                                     ` Gerd Möllmann
2023-09-20 14:11                                                       ` Eli Zaretskii
2023-09-20 14:22                                                         ` Gerd Möllmann
2023-09-20 15:04                                                           ` Eli Zaretskii
2023-09-20 15:09                                                             ` Gerd Möllmann
2023-09-20 16:56                                                           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-20 18:24                                                             ` Gerd Möllmann
2023-09-20 18:50                                                               ` Alan Third
2023-09-20 19:04                                                                 ` Gerd Möllmann
2023-09-21  5:13                                                                 ` Gerd Möllmann
2023-09-20 19:05                                                             ` Alan Third
2023-09-18 17:03                                           ` Eli Zaretskii
2023-09-18 17:42                                             ` Gerd Möllmann
2023-09-18 16:23                                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-18 17:19                                       ` Eli Zaretskii
2023-10-04  5:01 ` Gerd Möllmann

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=m2led5qgbr.fsf@Pro.fritz.box \
    --to=gerd.moellmann@gmail.com \
    --cc=66022@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.