unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#6848: insert-kbd-macro
@ 2010-08-12 14:36 Goodrich, Charles H. (KSC-ASRC-433)[ASRC AEROSPACE]
  2016-06-01  0:00 ` Noam Postavsky
  0 siblings, 1 reply; 3+ messages in thread
From: Goodrich, Charles H. (KSC-ASRC-433)[ASRC AEROSPACE] @ 2010-08-12 14:36 UTC (permalink / raw)
  To: 6848

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

For bug report See text below:

Charlie Goodrich
ASRC Aerospace, Systems Engineering
Mail Stop ASRC-48
Kennedy Space Center, FL 32899
location: M7-409 (EDL) 2103A
phone: (321) 867-6956
---------------------------------------------------------------------------------bug report -------------------------

From: Charlie Goodrich <cgoodrich@localhost.localdomain>
To: bug-gnu-emacs@gnu.org
Subject: insert-kbd-macro
--text follows this line--

Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list,
and to the gnu.emacs.bug news group.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

The Emacs info file claims:
   If you give `insert-kbd-macro' a numeric argument, it makes
additional Lisp code to record the keys (if any) that you have bound to
MACRONAME, so that the macro will be reassigned the same keys when you
load the file.
I created a macro, named it with `C-x C-k n', bound it to key <f5> and inserted the macro definition in the buffer with M-x insert-kbd-macro.  Then, I inserted the same macro again with a numeric argument M-1 M-x insert-kbd-macro.  The code inserted was exactly the same.  No additional code was added to record the keys bound to the macro.  Following is the macro definition as inserted both times:

(fset 'fill-number-list
   (lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ([down return 67108896 up up 134217841 backspace 24 24] 0 "%d")) arg)))



If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
If you would like to further debug the crash, please read the file
/usr/local/stow/emacs-22.3/share/emacs/22.3/etc/DEBUG for instructions.


In GNU Emacs 22.3.2 (x86_64-unknown-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2009-06-18 on rpl1
Windowing system distributor `Colin Harrison', version 11.0.60900031
configured using `configure  '--prefix=/usr/local/stow/emacs-22.3' 'CC=/usr/bin/gcc' 'CPP=/usr/bin/cpp''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8
  default-enable-multibyte-characters: t

Major mode: Text

Minor modes in effect:
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  auto-compression-mode: t
  line-number-mode: t

Recent input:
C-SPC C-x C-x C-x C-x <f4> C-_ <up> <f3> <down> <return>
C-SPC <up> <up> M-q <backspace> C-x C-x <f4> C-_ C-_
C-_ <down-mouse-1> <mouse-1> <f4> <f4> <f4> <f4> <f4>
C-x C-k n f i l l - n u m b e r - l i s t <return>
C-x C-k b <f5> M-x i n s e r t SPC k SPC SPC C-g M-5
M-x i n s e SPC k SPC SPC <return> f i l l - n u m
SPC SPC <return> <down-mouse-1> <mouse-1> C-x b <tab>
* m e s <tab> SPC <tab> <backspace> <backspace> <backspace>
M e <tab> <return> C-x b <return> <help-echo> <down-mouse-1>
<mouse-1> <backspace> SPC <down-mouse-1> <mouse-1>
<backspace> SPC <down-mouse-1> <mouse-1> <backspace>
SPC <down-mouse-1> <mouse-1> <backspace> SPC <down-mouse-1>
<mouse-1> <backspace> SPC <down-mouse-1> <mouse-1>
<f5> <f5> C-_ C-_ C-_ C-_ C-_ C-_ C-_ C-_ <backspace>
SPC <down-mouse-1> <mouse-1> <down-mouse-1> <mouse-1>
M-1 M-x i n s SPC k SPC SPC <return> f i l l - n u
SPC SPC <return> <return> <down-mouse-4> <mouse-4>
<down-mouse-4> <mouse-4> <down-mouse-1> <mouse-1> <down-mouse-1>
<mouse-1> C-x C-k b 5 M-x i n s C-g C-x C-k b 5 M-1
M-x i n s e SPC k SPC SPC SPC <return> f i l l - n
u SPC SPC SPC SPC <return> <help-echo> <down-mouse-1>
<mouse-1> C-h i g k e y b o r SPC <backspace> a SPC
SPC <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> k e <tab> <tab> <backspace>
<backspace> <backspace> C-g m e m a c s <return> g
k e y <tab> b o a r d SPC m a c r o s <return> m s
a v <tab> <return> <down-mouse-5> <mouse-5> <down-mouse-5>
<mouse-5> <down-mouse-5> <mouse-5> <down-mouse-5> <mouse-5>
<down-mouse-5> <mouse-5> <double-down-mouse-5> <double-mouse-5>
<down-mouse-4> <mouse-4> <help-echo> <down-mouse-1>
<mouse-1> q <return> <help-echo> <help-echo> <menu-bar>
<help-menu> <send-emacs-bug-report>

Recent messages:
Keyboard macro bound to C-x C-k 5
Auto-saving...done
Loading info...
Loading easymenu...done
Loading info...done
Composing main Info directory...done
call-interactively: Text is read-only
Quit
Making completion list...
Loading emacsbug...done


[-- Attachment #2: Type: text/html, Size: 7903 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#6848: insert-kbd-macro
  2010-08-12 14:36 bug#6848: insert-kbd-macro Goodrich, Charles H. (KSC-ASRC-433)[ASRC AEROSPACE]
@ 2016-06-01  0:00 ` Noam Postavsky
  2017-02-22  2:46   ` npostavs
  0 siblings, 1 reply; 3+ messages in thread
From: Noam Postavsky @ 2016-06-01  0:00 UTC (permalink / raw)
  To: 6848

There are 2 ways to bind a macro: with global-set-key or
kmacro-bind-to-key. The former binds a key to a symbol, while the
latter binds to a lambda. The fix for #5481 fixed the lambda case but
broke the symbol case. Should be easy enough to handle both:

diff --git i/lisp/macros.el w/lisp/macros.el
index f7a4732..c456dcb 100644
--- i/lisp/macros.el
+++ w/lisp/macros.el
@@ -140,8 +140,9 @@ insert-kbd-macro
     (prin1 definition (current-buffer))))
     (insert ")\n")
     (if keys
-    (let ((keys (where-is-internal (symbol-function macroname)
-                       '(keymap))))
+        (let ((keys (or (where-is-internal (symbol-function macroname)
+                                           '(keymap))
+                        (where-is-internal macroname '(keymap)))))
       (while keys
         (insert "(global-set-key ")
         (prin1 (car keys) (current-buffer))





^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#6848: insert-kbd-macro
  2016-06-01  0:00 ` Noam Postavsky
@ 2017-02-22  2:46   ` npostavs
  0 siblings, 0 replies; 3+ messages in thread
From: npostavs @ 2017-02-22  2:46 UTC (permalink / raw)
  To: 6848

tags 6848 fixed
close 6848 26.1
quit

Fix pushed to master [1: 907bad07f2].

1: 2017-02-21 21:44:54 -0500 907bad07f25ca91e72ebb29a468c6b1b8b91fa49
  Find macro binding for symbol-bound macros too (Bug#6848)





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-22  2:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-12 14:36 bug#6848: insert-kbd-macro Goodrich, Charles H. (KSC-ASRC-433)[ASRC AEROSPACE]
2016-06-01  0:00 ` Noam Postavsky
2017-02-22  2:46   ` npostavs

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).