Subject: bug#42492: Documentation error in summary at top of section 17.1, emacs.info (emacs-27 branch)

From: Bob Halley <[email-masked]>
Date: Thu, 23 Jul 2020 09:31:24 -0700

The summary info about keyboard macro key bindings at the start of section 17.1 of emacs.info says:

‘<F4>’
‘C-x e’
     If a keyboard macro is being defined, end the definition;
     otherwise, execute the most recent keyboard macro
     (‘kmacro-end-or-call-macro’).

This suggests that <F4> and C-x e are both bound to kmacro-end-or-call-macro.  <F4> is, but C-x e is not; it is bound to kmacro-end-and-call-macro by the autoloads in kmacro.el (note "and" vs "or"):

;;; Provide some binding for startup:
;;;###autoload (global-set-key "\C-x(" 'kmacro-start-macro)
;;;###autoload (global-set-key "\C-x)" 'kmacro-end-macro)
;;;###autoload (global-set-key "\C-xe" 'kmacro-end-and-call-macro)
;;;###autoload (global-set-key [f3] 'kmacro-start-macro-or-insert-counter)
;;;###autoload (global-set-key [f4] 'kmacro-end-or-call-macro)

The text further down in this section describes the bindings correctly:

   In addition to the <F3> and <F4> commands described above, Emacs also
supports an older set of key bindings for defining and executing
keyboard macros.  To begin a macro definition, type ‘C-x (’
(‘kmacro-start-macro’); as with <F3>, a prefix argument appends this
definition to the last keyboard macro.  To end a macro definition, type
‘C-x )’ (‘kmacro-end-macro’).  To execute the most recent macro, type
‘C-x e’ (‘kmacro-end-and-call-macro’).  If you enter ‘C-x e’ while
defining a macro, the macro is terminated and executed immediately.
Immediately after typing ‘C-x e’, you can type ‘e’ repeatedly to
immediately repeat the macro one or more times.  You can also give ‘C-x
e’ a repeat argument, just like <F4> (when it is used to execute a
macro).

So, I think this is just a problem with the summary.  It might be appropriate for the summary to mention C-x ) too, as if you don't want to use function keys, you can't tell how to end a macro without executing it.

/Bob

(And my thanks to everyone maintaining emacs!)

In GNU Emacs 27.0.91 (build 1, x86_64-apple-darwin19.5.0, NS appkit-1894.50 Version 10.15.5 (Build 19F101))
 of 2020-07-10 built on howl.local
Repository revision: 6290850dac130521551913ce78671fcccfe5c0f3
Repository branch: emacs-27
Windowing system distributor 'Apple', version 10.3.1894
System Description:  Mac OS X 10.15.6

Configured using:
 'configure --without-x --with-ns -with-wide-int
 LIBXML2_CFLAGS=-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libxml2
 LDFLAGS=-L/usr/local/opt/texinfo/lib --without-pop'

Configured features:
NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES
THREADS PDUMPER GMP

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Emacs-Lisp

Minor modes in effect:
  pyvenv-mode: t
  shell-dirtrack-mode: t
  projectile-mode: t
  delete-selection-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-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
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail
rmail-loaddefs text-property-search mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils bug-reference eieio-opt
speedbar sb-image ezimage dframe find-func jka-compr imenu rfc-mode helm
helm-source eieio-compat helm-multi-match helm-lib async smerge-mode
diff vc vc-dispatcher misearch multi-isearch vc-git diff-mode easy-mmode
whitespace company-oddmuse company-keywords company-etags company-gtags
company-dabbrev-code company-dabbrev company-files company-cmake
company-xcode company-clang company-eclim company-template company-bbdb
material-theme cl-extra yasnippet highlight-indentation flymake-proc
flymake warnings company-capf company pcase help-fns radix-tree
help-mode elpy advice elpy-rpc pyvenv eshell esh-cmd esh-ext esh-opt
esh-proc esh-io esh-arg esh-module esh-groups esh-util elpy-shell
elpy-profile elpy-django s elpy-refactor python tramp-sh tramp
tramp-loaddefs trampver tramp-integration tramp-compat shell pcomplete
parse-time iso8601 time-date ls-lisp format-spec ido files-x etags
fileloop generator xref project cus-edit cus-start cus-load wid-edit
cc-styles cc-align cc-engine cc-vars cc-defs exec-path-from-shell dim
projectile grep compile comint ansi-color ring ibuf-ext ibuffer
ibuffer-loaddefs thingatpt server edmacro kmacro rth-funcs delsel info
package easymenu browse-url url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map
url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode elisp-mode lisp-mode prog-mode register page
tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse
jit-lock font-lock syntax facemenu font-core term/tty-colors frame
minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite charscript charprop case-table epa-hook jka-cmpr-hook help
simple abbrev obarray cl-preloaded nadvice loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
threads kqueue cocoa ns multi-tty make-network-process emacs)

Memory information:
((conses 16 260697 19593)
 (symbols 48 21689 1)
 (strings 32 70638 3607)
 (string-bytes 1 2337953)
 (vectors 16 40190)
 (vector-slots 8 1218969 117038)
 (floats 8 184 373)
 (intervals 56 15320 453)
 (buffers 1000 40))