From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Vivier Subject: Re: [PATCH] org.el: Fix newline at eob in org-insert-heading Date: Sat, 16 Feb 2019 10:31:19 +0100 Message-ID: <87va1kgjvc.fsf@hidden> References: <20190211133813.4348-1-zaephon@gmail.com> <878sygp1pc.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([209.51.188.92]:37181) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guwJt-0003Pg-OD for emacs-orgmode@gnu.org; Sat, 16 Feb 2019 04:31:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guwJr-0006hm-Ui for emacs-orgmode@gnu.org; Sat, 16 Feb 2019 04:31:37 -0500 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:41128) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1guwJr-00062b-OB for emacs-orgmode@gnu.org; Sat, 16 Feb 2019 04:31:35 -0500 Received: by mail-wr1-x443.google.com with SMTP id n2so623235wrw.8 for ; Sat, 16 Feb 2019 01:31:23 -0800 (PST) In-Reply-To: <878sygp1pc.fsf@nicolasgoaziou.fr> 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.org@gnu.org Sender: "Emacs-orgmode" To: Nicolas Goaziou Cc: emacs-orgmode@gnu.org Hello, Nicolas Goaziou writes: >> The problem is due to `eobp' returning t when point is on the last >> character of the narrowed buffer (as explained in its docstring). >> Since those `eobp' predicates in `org-insert-heading' are probably >> there to ensure a newline at the end of the *file*, checking whether >> the buffer is *narrowed* (with `buffer-narrowed-p') prior to inserting >> the newline fixes the problem. > > I don't think this would be a sufficient fix, because the buffer can be > narrowed and, yet, showing the end of the file. Yes, this is also something that I noticed, and I=E2=80=99d sent another pa= tch that address issue as a reply to the original email. However, not knowing whether to submit the patch as is, squash it with the previous one, or send it as a new thread altogether, I ended doing a clumsy job. If you check it, you=E2=80=99ll see at the end of the commit message an app= ended note on that issue. > Anyway, I don't think this final newline is needed. I removed it. This > should fix your issue. Please let me know if you encounter other > glitches in that area. Thank you. I=E2=80=99ll let you know if I encounter anything unexpected. Best, P.S.: I=E2=80=99d sent the patches with the wrong email. This is now resol= ved. --=20 Leo Vivier English Studies & General Linguistics Master Student, English Department Universit=C3=A9 Rennes 2