[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#30209: Fix wrong behavior of 'outline-headers-as-kill' command

From: Noam Postavsky
Subject: bug#30209: Fix wrong behavior of 'outline-headers-as-kill' command
Date: Tue, 20 Feb 2018 19:31:13 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux)

tags 30209 + patch

Noam Postavsky <address@hidden> writes:

> [forwarding to list

Dang it, I messed up the forwarding by trying to trim out the
repetition.  Oh well, here's the patch formatted by git.  First I'll
show the whitespace-ignoring version of that patch, which gets the point
across with a bit less noise (the full version is attached afterward).

>From de625d053871edcdec683e4e4d560b7a47d27e65 Mon Sep 17 00:00:00 2001
From: Dmitry Safronov <address@hidden>
Date: Mon, 22 Jan 2018 12:19:00 +0100
Subject: [PATCH] Fix wrong behavior of 'outline-headers-as-kill' command

* outline.el (outline-headers-as-kill): Fix heading duplication.

Copyright-paperwork-exempt: yes
 lisp/outline.el | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/lisp/outline.el b/lisp/outline.el
index 7cf56abd23..669935bbc1 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -1100,20 +1100,18 @@ outline-headers-as-kill
       (narrow-to-region beg end)
       (goto-char (point-min))
-      (let ((buffer (current-buffer))
-           start end)
+      (let ((buffer (current-buffer)) start end)
+          (let ((temp-buffer (current-buffer)))
             (with-current-buffer buffer
               ;; Boundary condition: starting on heading:
               (when (outline-on-heading-p)
                 (setq start (point)
-                   end (progn (outline-end-of-heading)
-                              (point)))
+                      end (progn (outline-end-of-heading) (point)))
+                (with-current-buffer temp-buffer
                   (insert-buffer-substring buffer start end)
                   (insert "\n\n")))
-         (let ((temp-buffer (current-buffer)))
-           (with-current-buffer buffer
               (while (outline-next-heading)
                 (unless (outline-invisible-p)
                   (setq start (point)

Attachment: 0001-Fix-wrong-behavior-of-outline-headers-as-kill-comman.patch
Description: patch

> From: Dmitry Safronov <address@hidden>
> Subject: Re: bug#30209: Fix wrong behavior of 'outline-headers-as-kill' 
> command
> To: Noam Postavsky <address@hidden>
> Date: Mon, 19 Feb 2018 13:06:46 +0100 (1 day, 12 hours, 16 minutes ago)
>> Have you assigned copyright for Emacs?  (I
>> guess the patch will be small enough to apply anyway, but it needs to be
>> marked in that case.)
> Where can I assign copyright for Emacs?

Fill in the form at [1], send it to address@hidden and await
further instructions.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]