all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michal Sojka <sojkam1@fel.cvut.cz>
To: Carsten Dominik <carsten.dominik@gmail.com>
Cc: Emacs mailing list <help-gnu-emacs@gnu.org>
Subject: Bug in outline-magic.el
Date: Fri, 28 Jun 2013 18:06:46 +0200	[thread overview]
Message-ID: <877ghe43u1.fsf@steelpick.2x.cz> (raw)

Dear Carsten,

I think that there is a bug in outline-magic.el. See below. I put the
same text also at
http://www.emacswiki.org/emacs/Comments_on_outline-magic.el.

The version 0.9 (or 20120505.1234 from MELPA) doesn’t work for me. In
some files (e.g. outline-magic.el itself), when the point is at the
beginning of the buffer and I run ‘outline-cycle’, the whole buffer gets
hidden. Subsequent runs of ‘outline-cycle’ fail and everything remains
hidden. The failure is caused by (error “before first heading”) called
from `outline-back-to-heading`.

I run GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.4.2) of 2013-04-13 on trouble, modified by Debian.

This patch fixes the problem.

diff --git a/outline-magic.el b/outline-magic.el
index 52ca5cf..81331c5 100644
--- a/outline-magic.el
+++ b/outline-magic.el
@@ -266,7 +266,13 @@ them set by set, separated by a nil element.  See the example for
        (setq this-command 'outline-cycle-showall))
        (t
        ;; Default action: go to overview
-       (hide-sublevels 1)
+       (let ((toplevel (cond
+                        (current-prefix-arg (prefix-numeric-value current-prefix-arg))
+                        ((save-excursion (beginning-of-line)
+                                         (looking-at outline-regexp))
+                         (max 1 (funcall outline-level)))
+                        (t 1))))
+         (hide-sublevels toplevel))
        (message "OVERVIEW")
        (setq this-command 'outline-cycle-overview))))

Best regards,
-Michal



             reply	other threads:[~2013-06-28 16:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-28 16:06 Michal Sojka [this message]
2013-06-28 16:59 ` Bug in outline-magic.el Thorsten Jolitz
2013-06-30 20:58   ` Michal Sojka
2013-06-30 22:07     ` Thorsten Jolitz
2013-06-30 23:00     ` Michal Sojka
2013-06-30 23:51       ` Thorsten Jolitz

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

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

  git send-email \
    --in-reply-to=877ghe43u1.fsf@steelpick.2x.cz \
    --to=sojkam1@fel.cvut.cz \
    --cc=carsten.dominik@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.