Subject: 28.0.50; Fix for missed item undecoration on allout-widgets-mode deactivation
From: Ken Manheimer <[email-masked]>
To: [email-masked]
Date: Sun, 5 Jul 2020 17:04:56 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

The attached patch fixes the bug described below.

In the current version (the current Gnu emacs repository master) of
allout-widgets-mode, exiting the mode fails to undecorate the first item if
it's at the start of the buffer. You can confirm this by creating a simple
outline like the following (indented to distinguish it, the bullets need to
be at the left margin in the actual text):

* First item
.* Second item

Then activate allout-mode and allout-widgets-mode, and then
deactivate allout-widgets-mode. The widget decorations will not be properly
removed from the first item.

The attached patch rectifies this bug so all decorations are properly
removed.

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

Recent messages:
Allout-Widgets mode disabled in current buffer
M-o C-x o is undefined
Quit
Mark set [2 times]
Quit
Allout mode enabled in current buffer
Allout-Widgets mode enabled in current buffer
M-x is undefined
M-p is undefined
Allout-Widgets mode disabled in current buffer

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: Fundamental

Minor modes in effect:
  allout-mode: t
  tooltip-mode: t
  global-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 epa derived epg epg-config gnus-util rmail
rmail-loaddefs text-property-search time-date 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
pcase wid-edit allout ffap thingatpt url-parse auth-source cl-seq eieio
eieio-core cl-macs eieio-loaddefs password-cache json subr-x map seq
byte-opt gv bytecomp byte-compile cconv url-vars vc-git diff-mode
easymenu easy-mmode cl-loaddefs cl-lib bug-reference 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 74548 7639)
 (symbols 48 8879 1)
 (strings 32 23418 2064)
 (string-bytes 1 775322)
 (vectors 16 13294)
 (vector-slots 8 168908 9258)
 (floats 8 33 150)
 (intervals 56 369 0)
 (buffers 992 15))