emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

allout bug


From: Stephen Berman
Subject: allout bug
Date: Thu, 21 Sep 2006 15:15:50 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

If you call allout-show-current-branches on a heading that contains
subheadings, it raises a "Wrong type argument: number-or-marker-p"
error.[1] You also get this error if you use `+' in an exposure-spec
applied to a heading that contains subheadings.  The reason in both
cases is that allout-show-current-branches calls allout-show-children
with argument `t', which is passed to the `levels' argument of
allout-chart-subtree and there barfs on the first numerical comparison
test it hits.  I don't know what the best fix for this is, but the
following patch to allout-chart-subtree has worked fine for me so far,
though it looks like an ugly hack:

*** cvsroot/emacs/lisp/allout.el        2006-09-17 12:24:22.000000000 +0200
--- allout.el                           2006-09-19 16:37:44.000000000 +0200
***************
*** 2551,2556 ****
--- 2551,2557 ----
      (while (and (not (eobp))
                                        ; Still within original topic?
                (< orig-depth (setq curr-depth allout-recent-depth))
+               (setq levels curr-depth)
                (cond ((= prev-depth curr-depth)
                       ;; Register this one and move on:
                       (setq chart (cons allout-recent-prefix-beginning chart))

It seems more logical not to pass `t' in allout-show-children but
instead a number that specifies the maximum heading depth.  But what
determines that?  Maybe it could somehow be tied to
max-lisp-eval-depth.  By the way, this bug has existed since at least
allout.el version 1.29.4.2 from Emacs 21.3.

Steve Berman

Footnotes: 
[1] You only get the error if point is on the visible part of the
heading; if point is on the invisible part, `t' does not get passed to
the `levels' argument of allout-chart-subtree.  In this case, however,
the entire subtree is exposed, which seems to circumvent the intended
effect of allout-show-current-branches.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]