From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#30209: Fix wrong behavior of 'outline-headers-as-kill' command Date: Tue, 20 Feb 2018 19:31:13 -0500 Message-ID: <87zi43420e.fsf@gmail.com> References: <87606r5hkg.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1519173012 24545 195.159.176.226 (21 Feb 2018 00:30:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 21 Feb 2018 00:30:12 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) Cc: Dmitry Safronov To: 30209@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Feb 21 01:30:08 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eoIIR-0005xE-5m for geb-bug-gnu-emacs@m.gmane.org; Wed, 21 Feb 2018 01:30:07 +0100 Original-Received: from localhost ([::1]:58367 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eoIKT-0004oU-BQ for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 Feb 2018 19:32:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eoIKL-0004n2-OT for bug-gnu-emacs@gnu.org; Tue, 20 Feb 2018 19:32:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eoIKJ-0008Tu-34 for bug-gnu-emacs@gnu.org; Tue, 20 Feb 2018 19:32:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45504) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eoIKI-0008Tj-RW for bug-gnu-emacs@gnu.org; Tue, 20 Feb 2018 19:32:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eoIKI-0000lx-Dl for bug-gnu-emacs@gnu.org; Tue, 20 Feb 2018 19:32:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 21 Feb 2018 00:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30209 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 30209-submit@debbugs.gnu.org id=B30209.15191730842918 (code B ref 30209); Wed, 21 Feb 2018 00:32:02 +0000 Original-Received: (at 30209) by debbugs.gnu.org; 21 Feb 2018 00:31:24 +0000 Original-Received: from localhost ([127.0.0.1]:53400 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eoIJg-0000ku-4R for submit@debbugs.gnu.org; Tue, 20 Feb 2018 19:31:24 -0500 Original-Received: from mail-io0-f174.google.com ([209.85.223.174]:33108) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eoIJd-0000kY-Pg; Tue, 20 Feb 2018 19:31:22 -0500 Original-Received: by mail-io0-f174.google.com with SMTP id n7so298917iob.0; Tue, 20 Feb 2018 16:31:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=f2YwnhW52cYcJH9hseATT4H64VsgQ/q9TNCQTwX5h4k=; b=TrcXMRYrc9cgkmiC5ka0YCWuOXdnNcKoW+ULWCu1QyfyWj/CYAV2WS2j9bgPbXbqEk nwhvs5bauHmJ/tXETVmQkcN1KWcjS8JZFYvtcoYnES94JdfNdEArzmpZsCcMe0sy9EIV OSylOcdIQsQ+Yoop9TU3RjEDybnH2zCGzYns5pSdmYr5+HcZ/yWrYUnimPqap0N1WEiE c2PZ86II4UecsIbOJsfSITTCuRO3Nyu+irAs4YdmNep5Ft6V4rKgFQrtyHSKTW3/g3e6 7uPQgqvV7ECx21+8ZpZB5mU14KIKQTM5RG1vu4SNAnDlCxq26LpAt5OpuPYMOhxx8ffY t/Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=f2YwnhW52cYcJH9hseATT4H64VsgQ/q9TNCQTwX5h4k=; b=YUXU7zlWxNRArsiB8UklUiUDBUZxhbSk7AwBbvD88FKf3ejIyOu2WIKm+vvKpYPCER P6Xj0bE1sGVyPjKMvP8ZQkKG5gnSMRexVQTo/h71L9qZV8Lk3BsvBUaDHGifX65Hhl2k r8mkfHypr6oDUc50YU2mhGXRz2taynRwg+SDg0cFf71CybZ3HECoer/5rSWJl2imHMfZ wu7rn+60++qsrrB00K0d/+9Dj2+8tZXprvRbuPiPRX/b0khFZAAnv9Y2HasqOAAYnnWs ZFKcw2xxbzOubrNEHFAZFayP9H+Vikx9REdOWaKM8rECT6s34dyINFSCeNFyfPab9Q61 3b1Q== X-Gm-Message-State: APf1xPCL3z1x3mKgpsmCWSn6K2Aai2uSNTv2B5Dwu4n7OgQhQB0o821N 8EeconjQvpTFzmm2TXqIGMio2g== X-Google-Smtp-Source: AG47ELuKXCSMUMwyG4VkZDI31UM3NLYsG/IWHBMIo+uL0vrD6n2hHUb/vCn4zxUdu2D7cht7ZsElXA== X-Received: by 10.107.192.2 with SMTP id q2mr2123531iof.112.1519173075707; Tue, 20 Feb 2018 16:31:15 -0800 (PST) Original-Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id s70sm9389404itb.0.2018.02.20.16.31.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Feb 2018 16:31:14 -0800 (PST) In-Reply-To: <87606r5hkg.fsf@gmail.com> (Noam Postavsky's message of "Tue, 20 Feb 2018 19:09:51 -0500") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:143525 Archived-At: --=-=-= Content-Type: text/plain tags 30209 + patch quit Noam Postavsky 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). --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Fix-wrong-behavior-of-outline-headers-as-kill-comman.patch Content-Description: patch >From de625d053871edcdec683e4e4d560b7a47d27e65 Mon Sep 17 00:00:00 2001 From: Dmitry Safronov Date: Mon, 22 Jan 2018 12:19:00 +0100 Subject: [PATCH] Fix wrong behavior of 'outline-headers-as-kill' command (Bug#30209) * 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 (save-restriction (narrow-to-region beg end) (goto-char (point-min)) - (let ((buffer (current-buffer)) - start end) + (let ((buffer (current-buffer)) start end) (with-temp-buffer + (let ((temp-buffer (current-buffer))) (with-current-buffer buffer ;; Boundary condition: starting on heading: (when (outline-on-heading-p) (outline-back-to-heading) (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) -- 2.11.0 --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=0001-Fix-wrong-behavior-of-outline-headers-as-kill-comman.patch Content-Description: patch >From de625d053871edcdec683e4e4d560b7a47d27e65 Mon Sep 17 00:00:00 2001 From: Dmitry Safronov Date: Mon, 22 Jan 2018 12:19:00 +0100 Subject: [PATCH] Fix wrong behavior of 'outline-headers-as-kill' command (Bug#30209) * outline.el (outline-headers-as-kill): Fix heading duplication. Copyright-paperwork-exempt: yes --- lisp/outline.el | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/lisp/outline.el b/lisp/outline.el index 7cf56abd23..669935bbc1 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -1100,28 +1100,26 @@ outline-headers-as-kill (save-restriction (narrow-to-region beg end) (goto-char (point-min)) - (let ((buffer (current-buffer)) - start end) - (with-temp-buffer - (with-current-buffer buffer - ;; Boundary condition: starting on heading: - (when (outline-on-heading-p) - (outline-back-to-heading) - (setq start (point) - end (progn (outline-end-of-heading) - (point))) - (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) - end (progn (outline-end-of-heading) (point))) - (with-current-buffer temp-buffer - (insert-buffer-substring buffer start end) - (insert "\n\n")))))) - (kill-new (buffer-string))))))) + (let ((buffer (current-buffer)) start end) + (with-temp-buffer + (let ((temp-buffer (current-buffer))) + (with-current-buffer buffer + ;; Boundary condition: starting on heading: + (when (outline-on-heading-p) + (outline-back-to-heading) + (setq start (point) + end (progn (outline-end-of-heading) (point))) + (with-current-buffer temp-buffer + (insert-buffer-substring buffer start end) + (insert "\n\n"))) + (while (outline-next-heading) + (unless (outline-invisible-p) + (setq start (point) + end (progn (outline-end-of-heading) (point))) + (with-current-buffer temp-buffer + (insert-buffer-substring buffer start end) + (insert "\n\n")))))) + (kill-new (buffer-string))))))) (provide 'outline) (provide 'noutline) -- 2.11.0 --=-=-= Content-Type: text/plain > From: Dmitry Safronov > Subject: Re: bug#30209: Fix wrong behavior of 'outline-headers-as-kill' command > To: Noam Postavsky > 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 fsf-records@gnu.org and await further instructions. https://git.savannah.gnu.org/cgit/gnulib.git/tree/doc/Copyright/request-assign.program --=-=-=--