From mboxrd@z Thu Jan 1 00:00:00 1970 From: Miguel Morin Subject: Re: Bug: refiling gobbles a newline and absorbs the next heading [9.1.9 (release_9.1.9-65-g5e4542 @ /Applications/Emacs.app/Contents/Resources/lisp/org/)] Date: Tue, 11 Feb 2020 15:34:41 +0000 Message-ID: References: <87k151czrg.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:44669) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1XYp-0003rs-HR for emacs-orgmode@gnu.org; Tue, 11 Feb 2020 10:34:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1XYo-0003pR-Ip for emacs-orgmode@gnu.org; Tue, 11 Feb 2020 10:34:51 -0500 In-reply-to: <87k151czrg.fsf@gnu.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sender: "Emacs-orgmode" To: Bastien Cc: emacs-orgmode@gnu.org Hi Bastien, Yes, it works! I appreciate your work, thank you very much. I tested the code with the Org 9.3.3 and confirm that the first issue I reported is fixed: now when I run `org-capture` and delete lines at the end of the org-capture buffer I cannot delete the newline that in the org buffer separates the capture item from the next heading. The other issue I reported is still there, i.e. running this code: ``` (defun +org|insert-newlines () (beginning-of-buffer) (insert "\nhello world!\n") (end-of-buffer) (insert "\nhello world!\n")) +org|insert-newlines (add-hook 'org-capture-before-finalize-hook #'+org|insert-newlines) (+org|insert-newlines) ``` will insert "hello world!" at the beginning and end of the org buffer and not the org-capture buffer. I'm not sure if this is intended, and I never use this feature anyway. So I'm happy to close this matter here. Miguel On Wed, 05 Feb 2020 at 06:30 WET, Bastien wrote: > Hi Miguel, > > I made a change in Org maint branch that could somehow impact the > issue you reported. Can you test and see if it does? > > Morin writes: > >> In the course of fixing this, I found another bug in using the hook >> `org-capture-before-finalize-hook`, which adds text at the beginning >> and end of the org buffer and not in the beggining and end of the >> capture item. > > If this is really another bug, please fill a different bug report for > it, it helps us track all issues separately. > > Thanks,