unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stephen Berman <Stephen.Berman@gmx.net>
Subject: allout bug
Date: Thu, 21 Sep 2006 15:15:50 +0200	[thread overview]
Message-ID: <87eju54ayh.fsf@escher.local.home> (raw)

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	other threads:[~2006-09-21 13:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-21 13:15 Stephen Berman [this message]
2006-09-21 16:51 ` allout bug Ken Manheimer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eju54ayh.fsf@escher.local.home \
    --to=stephen.berman@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).