Subject: bug#42246: 28.0.50; lisp/allout-widgets.el: Resolve missing button-region keymap bindings

From: Ken Manheimer <[email-masked]>
Date: Tue, 7 Jul 2020 10:49:43 -0400

In the current development version of allout-widgets.el, some useful global
bindings are missing when the cursor is in the icon area of a topic. The
attached patch rectifies this by inheriting the button-area (and body-area)
keymaps from both the (current-global-keymap) and (current-local-keymap).

To replicate the problem before applying the patch, visit
lisp/allout-widgets.el and activate allout-mode and allout-widgets-mode.
Then position the cursor on a bullet icon by hitting `Ctrl-A' twice, or by
using the mouse. Then try to go to the beginning of the buffer by hitting
`Esc-<', and you will see `M-< is undefined'.

(This is the last of the items I already had on my allout-widgets queue
pending resolution.)

Ken

In GNU Emacs 28.0.50 (build 4, x86_64-pc-linux-gnu, GTK+ Version 3.22.30,
cairo version 1.15.10)
 of 2020-07-07 built on gram
Repository revision: 3f990c3cccf85e64399bf98ea3e61cb618e8455c
Repository branch: master
Windowing system distributor 'HC-Consult', version 11.0.12005001
System Description: Ubuntu 18.04.4 LTS

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Quit
Mark set
Allout mode enabled in current buffer
Allout-Widgets mode enabled in current buffer
M-< is undefined
M-x is undefined

Configured using:
 'configure --with-gnutls=ifavailable --with-x-toolkit=yes
 --with-xpm=ifavailable --with-jpeg=ifavailable --with-gif=ifavailable
 --with-tiff=ifavailable'

Configured features:
PNG CAIRO SOUND DBUS GSETTINGS GLIB NOTIFY INOTIFY FREETYPE HARFBUZZ
ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS PDUMPER

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

Major mode: ELisp/d

Minor modes in effect:
  allout-widgets-mode: t
  allout-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-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 password-cache epa derived epg epg-config gnus-util
rmail rmail-loaddefs text-property-search time-date subr-x seq byte-opt
gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils allout-widgets wid-edit allout
vc-git diff-mode easymenu easy-mmode cl-loaddefs cl-lib tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win
x-win term/common-win x-dnd 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 dbusbind inotify dynamic-setting system-font-setting
font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 102984 8403)
 (symbols 48 7749 1)
 (strings 32 19900 839)
 (string-bytes 1 648936)
 (vectors 16 12072)
 (vector-slots 8 151162 12185)
 (floats 8 26 40)
 (intervals 56 5234 202)
 (buffers 992 12))