unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#42233: 28.0.50; Fix lisp/allout-widgets.el too-shallow successor decoration problem
@ 2020-07-06 18:37 Ken Manheimer
       [not found] ` <handler.42233.B.159406070023024.ack@debbugs.gnu.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Ken Manheimer @ 2020-07-06 18:37 UTC (permalink / raw)
  To: 42233


[-- Attachment #1.1: Type: text/plain, Size: 4061 bytes --]

In the current version of lisp/allout-widgets, the process of decorating a
succession of items is disrupted if an item is encountered at a level
shallower than any prior item in the file. The attached patch prevents that
disruption, enabling the decoration process to continue subsequent to the
too-shallow item. (Ideally it should also decorate the aberrant item, but
this patch does not achieve that.)

It so happens that allout-widgets.el itself provides a fine example of the
problem. Visit the file then activate allout-mode followed by
allout-widgets-mode. The allout-widgets decoration process will get an
error, reported in the mode line as "Wrong type argument:
integer-or-marker-p, nil", and in *Messages* as
"allout-get-or-create-item-widget: Wrong type argument:
integer-or-marker-p, nil", and the Local emacs vars topic will be entirely
undecorated.

That attached fix could prevent the error and cause the contents of the
Local emacs vars topic to be decorated, but not the topic itself. The patch
also increases the depth of the topic so it is consistent with the
preceeding topics.

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:
For information about GNU Emacs and the GNU system, type C-h C-a.
user-error: Minibuffer window is not active
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:
  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
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: 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 easymenu 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 cl-loaddefs cl-lib
sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
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 46910 7577)
 (symbols 48 6117 1)
 (strings 32 15556 1866)
 (string-bytes 1 510277)
 (vectors 16 9360)
 (vector-slots 8 127308 9687)
 (floats 8 20 27)
 (intervals 56 184 0)
 (buffers 992 11))

[-- Attachment #1.2: Type: text/html, Size: 4434 bytes --]

[-- Attachment #2: 0001-Don-t-let-item-decoration-be-disrupted-by-too-shallo.patch --]
[-- Type: application/octet-stream, Size: 1638 bytes --]

From bb1cc1208ccfc6d245b0fc9dfdc1cfc0cda86820 Mon Sep 17 00:00:00 2001
From: Ken Manheimer <ken.manheimer@gmail.com>
Date: Mon, 6 Jul 2020 14:18:57 -0400
Subject: [PATCH] Don't let item decoration be disrupted by too-shallow items.

* lisp/allout-widgets.el (allout-decorate-item-and-context): Check for
parent-position having value before using it.

Also, shift local emacs vars topic deeper so it doesn't constitute
an instance of that particular aberrant case.
---
 lisp/allout-widgets.el | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/lisp/allout-widgets.el b/lisp/allout-widgets.el
index fbdddca7d7..0b85fb831e 100644
--- a/lisp/allout-widgets.el
+++ b/lisp/allout-widgets.el
@@ -1594,7 +1594,10 @@ allout-decorate-item-and-context
       (if is-container
           (progn (widget-put item-widget :is-container t)
                  (setq reverse-siblings-chart (list 1)))
-        (goto-char (widget-apply parent :actual-position :from))
+        (let ((parent-position (widget-apply parent
+                                             :actual-position :from)))
+          (when parent-position
+            (goto-char parent-position)))
         (if (widget-get parent :is-container)
             ;; `allout-goto-prefix' will go to first non-container item:
             (allout-goto-prefix)
@@ -2389,7 +2392,7 @@ allout-widgets-run-unit-tests
 ;;;_ : provide
 (provide 'allout-widgets)
 
-;;;_. Local emacs vars.
-;;;_ , Local variables:
-;;;_ , allout-layout: (-1 : 0)
-;;;_ , End:
+;;;_ . Local emacs vars.
+;;;_  , Local variables:
+;;;_  , allout-layout: (-1 : 0)
+;;;_  , End:
-- 
2.17.1


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

* bug#42233: Acknowledgement (28.0.50; Fix lisp/allout-widgets.el too-shallow successor decoration problem)
       [not found] ` <handler.42233.B.159406070023024.ack@debbugs.gnu.org>
@ 2020-07-20 19:15   ` Ken Manheimer
  0 siblings, 0 replies; 2+ messages in thread
From: Ken Manheimer @ 2020-07-20 19:15 UTC (permalink / raw)
  To: 42233-done

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

Fix committed in 8684216542889fa57daa32072104afc69785907f and pushed to
main repository main and (mistakenly) emacs-27 branchesu

On Mon, Jul 6, 2020 at 2:39 PM GNU bug Tracking System <help-debbugs@gnu.org>
wrote:

> Thank you for filing a new bug report with debbugs.gnu.org.
>
> This is an automatically generated reply to let you know your message
> has been received.
>
> Your message is being forwarded to the package maintainers and other
> interested parties for their attention; they will reply in due course.
>
> Your message has been sent to the package maintainer(s):
>  bug-gnu-emacs@gnu.org
>
> If you wish to submit further information on this problem, please
> send it to 42233@debbugs.gnu.org.
>
> Please do not send mail to help-debbugs@gnu.org unless you wish
> to report a problem with the Bug-tracking system.
>
> --
> 42233: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=42233
> GNU Bug Tracking System
> Contact help-debbugs@gnu.org with problems
>

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

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

end of thread, other threads:[~2020-07-20 19:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-06 18:37 bug#42233: 28.0.50; Fix lisp/allout-widgets.el too-shallow successor decoration problem Ken Manheimer
     [not found] ` <handler.42233.B.159406070023024.ack@debbugs.gnu.org>
2020-07-20 19:15   ` bug#42233: Acknowledgement (28.0.50; Fix lisp/allout-widgets.el too-shallow successor decoration problem) Ken Manheimer

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).