unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#19493: [PATCH] Fix trailing ... for outline-toggle-children
@ 2015-01-03  0:04 Oleh Krehel
       [not found] ` <handler.19493.B.142024344824250.ack@debbugs.gnu.org>
  2015-01-16 13:32 ` bug#19493: [PATCH] Fix trailing ... for outline-toggle-children Dmitry Gutov
  0 siblings, 2 replies; 8+ messages in thread
From: Oleh Krehel @ 2015-01-03  0:04 UTC (permalink / raw)
  To: 19493

[-- Attachment #1: Type: text/plain, Size: 184 bytes --]

Hello,

Calling `outline-toggle-children' twice for a test.org with these
contents:

    * foo
    bar

results in:

    * foo
    bar...

I attach a patch to fix this.

regards,
Oleh

[-- Attachment #2: 0001-Fix-trailing-.-in-outline.patch --]
[-- Type: text/x-patch, Size: 1153 bytes --]

From a70f169e5f5d224d46b421cb800f24ea75f3709f Mon Sep 17 00:00:00 2001
From: Oleh Krehel <ohwoeowho@gmail.com>
Date: Sat, 3 Jan 2015 00:55:59 +0100
Subject: [PATCH] Fix trailing ... in outline

* lisp/outline.el (outline-next-preface): Don't go backward char when
  at end of buffer.

This will fix the problem of calling `outline-toggle-children' twice
in a row for the file's last heading.
---
 lisp/outline.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/outline.el b/lisp/outline.el
index 11d71fb..260073d 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -420,9 +420,10 @@ or else the number of characters matched by `outline-regexp'."
 If there's no following heading line, stop before the newline
 at the end of the buffer."
   (if (re-search-forward (concat "\n\\(?:" outline-regexp "\\)")
-			 nil 'move)
+                         nil 'move)
       (goto-char (match-beginning 0)))
-  (if (and (bolp) (or outline-blank-line (eobp)) (not (bobp)))
+  (if (and (bolp) (or outline-blank-line (eobp))
+           (not (bobp)) (not (eobp)))
       (forward-char -1)))
 
 (defun outline-next-heading ()
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-02-23 11:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-03  0:04 bug#19493: [PATCH] Fix trailing ... for outline-toggle-children Oleh Krehel
     [not found] ` <handler.19493.B.142024344824250.ack@debbugs.gnu.org>
2015-01-16 10:07   ` bug#19493: Acknowledgement ([PATCH] Fix trailing ... for outline-toggle-children) Oleh Krehel
2015-01-16 13:32 ` bug#19493: [PATCH] Fix trailing ... for outline-toggle-children Dmitry Gutov
2015-01-16 14:12   ` Oleh Krehel
2015-01-19  4:14     ` Dmitry Gutov
2015-02-07 18:07       ` Oleh Krehel
2015-02-08  0:08         ` Dmitry Gutov
2016-02-23 11:27         ` Lars Ingebrigtsen

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).