From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: outline.el Date: Mon, 26 Apr 2004 09:59:27 +0300 Organization: JURTA Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <87k70389m4.fsf@mail.jurta.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1082967533 16312 80.91.224.253 (26 Apr 2004 08:18:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 26 Apr 2004 08:18:53 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Mon Apr 26 10:18:45 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BI1K9-0000jt-00 for ; Mon, 26 Apr 2004 10:18:45 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BI1K9-00054K-00 for ; Mon, 26 Apr 2004 10:18:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BI18a-0002AJ-TH for emacs-devel@quimby.gnus.org; Mon, 26 Apr 2004 04:06:48 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1BI0zJ-0008IG-QD for emacs-devel@gnu.org; Mon, 26 Apr 2004 03:57:13 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BI0yH-0007Ia-Rl for emacs-devel@gnu.org; Mon, 26 Apr 2004 03:56:42 -0400 Original-Received: from [66.33.219.4] (helo=spork.dreamhost.com) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BI0vc-00066t-Pv for emacs-devel@gnu.org; Mon, 26 Apr 2004 03:53:25 -0400 Original-Received: from mail.jurta.org (80-235-33-250-dsl.mus.estpak.ee [80.235.33.250]) by spork.dreamhost.com (Postfix) with ESMTP id 9ABEE11DC0D for ; Mon, 26 Apr 2004 00:53:11 -0700 (PDT) Original-To: emacs-devel@gnu.org User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:22158 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:22158 The main purpose of Outline mode is to represent the outline structure in a compact way. Currently, outline.el partly fails at this by displaying useless empty lines between heading lines. Empty lines are only useful to separate large blocks of text, but in Outline mode, where they separate one-line heading lines, empty lines simply waste space. The following patch hides empty lines, and so lets outline.el display twice more headings than now. The first change hides empty lines except at the end of the buffer. The second change doesn't show empty lines for headings. The third change also fixes incorrect handling of empty lines for outline editing functions outline-move-subtree-down and outline-move-subtree-up. Index: lisp/outline.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/outline.el,v retrieving revision 1.5 diff -c -r1.5 outline.el *** lisp/outline.el 21 Jan 2004 03:25:37 -0000 1.5 --- lisp/outline.el 26 Apr 2004 04:07:14 -0000 *************** *** 349,355 **** (if (re-search-forward (concat "\n\\(?:" outline-regexp "\\)") nil 'move) (goto-char (match-beginning 0))) ! (if (and (bolp) (not (bobp))) (forward-char -1))) (defun outline-next-heading () --- 349,355 ---- (if (re-search-forward (concat "\n\\(?:" outline-regexp "\\)") nil 'move) (goto-char (match-beginning 0))) ! (if (and (bolp) (eobp) (not (bobp))) (forward-char -1))) (defun outline-next-heading () *************** *** 769,778 **** (defun outline-show-heading () "Show the current heading and move to its end." ! (outline-flag-region (- (point) ! (if (bobp) 0 ! (if (eq (char-before (1- (point))) ?\n) ! 2 1))) (progn (outline-end-of-heading) (point)) nil)) --- 770,776 ---- (defun outline-show-heading () "Show the current heading and move to its end." ! (outline-flag-region (- (point) (if (bobp) 0 1)) (progn (outline-end-of-heading) (point)) nil)) *************** *** 840,849 **** (if (bolp) (progn ;; Go to end of line before heading ! (forward-char -1) ! (if (bolp) ! ;; leave blank line before heading ! (forward-char -1)))))) (defun show-branches () "Show all subheadings of this heading, but not their bodies." --- 838,844 ---- (if (bolp) (progn ;; Go to end of line before heading ! (forward-char -1))))) (defun show-branches () "Show all subheadings of this heading, but not their bodies." -- Juri Linkov http://www.jurta.org/emacs/