From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michal Sojka Newsgroups: gmane.emacs.help Subject: Bug in outline-magic.el Date: Fri, 28 Jun 2013 18:06:46 +0200 Message-ID: <877ghe43u1.fsf@steelpick.2x.cz> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1372435639 22267 80.91.229.3 (28 Jun 2013 16:07:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Jun 2013 16:07:19 +0000 (UTC) Cc: Emacs mailing list To: Carsten Dominik Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jun 28 18:07:18 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UsbCf-0006Vr-Iz for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Jun 2013 18:07:17 +0200 Original-Received: from localhost ([::1]:56857 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsbCf-0007a0-0j for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Jun 2013 12:07:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsbCI-0007RQ-Ez for help-gnu-emacs@gnu.org; Fri, 28 Jun 2013 12:06:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UsbCH-0008Sq-1m for help-gnu-emacs@gnu.org; Fri, 28 Jun 2013 12:06:54 -0400 Original-Received: from max.feld.cvut.cz ([147.32.192.36]:48459) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsbCG-0008Sb-RL for help-gnu-emacs@gnu.org; Fri, 28 Jun 2013 12:06:52 -0400 Original-Received: from localhost (unknown [192.168.200.7]) by max.feld.cvut.cz (Postfix) with ESMTP id E35DD3CFE99; Fri, 28 Jun 2013 18:06:50 +0200 (CEST) X-Virus-Scanned: IMAP STYX AMAVIS Original-Received: from max.feld.cvut.cz ([192.168.200.1]) by localhost (styx.feld.cvut.cz [192.168.200.7]) (amavisd-new, port 10044) with ESMTP id pfVPlfgz6LcT; Fri, 28 Jun 2013 18:06:46 +0200 (CEST) Original-Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34]) by max.feld.cvut.cz (Postfix) with ESMTP id 917E53CFE91; Fri, 28 Jun 2013 18:06:46 +0200 (CEST) Original-Received: from wsh by steelpick.2x.cz with local (Exim 4.80) (envelope-from ) id 1UsbCA-0000k7-Fr; Fri, 28 Jun 2013 18:06:46 +0200 User-Agent: Notmuch/0.15.2 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 147.32.192.36 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:91818 Archived-At: 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=E2=80=99t 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 =E2=80=98outline-cycle=E2=80=99, the whol= e buffer gets hidden. Subsequent runs of =E2=80=98outline-cycle=E2=80=99 fail and everyth= ing remains hidden. The failure is caused by (error =E2=80=9Cbefore first heading=E2=80= =9D) 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