From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Vivier Subject: [PATCH] Fix spaces with `org-remove-timestamp-with-keyword' Date: Thu, 21 Feb 2019 16:43:56 +0100 Message-ID: <87zhqpxi2r.fsf@hidden> References: <20190218002547.30325-1-leo.vivier@gmail.com> <87mumsqepg.fsf@nicolasgoaziou.fr> <871s44cbzb.fsf@hidden> <87sgwkoue5.fsf@nicolasgoaziou.fr> <87d0nnnbkf.fsf@hidden> <877edvn6g3.fsf@hidden> <874l8zn5vz.fsf@hidden> <87y36asiap.fsf@nicolasgoaziou.fr> <87y36atwdl.fsf@hidden> <878sy9ywwm.fsf@hidden> <8736ohywqw.fsf@hidden> 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]:38116) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gwqW5-0003bi-P4 for emacs-orgmode@gnu.org; Thu, 21 Feb 2019 10:44:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gwqW3-0007b3-Qy for emacs-orgmode@gnu.org; Thu, 21 Feb 2019 10:44:05 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:36563) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gwqW0-0007Xn-6q for emacs-orgmode@gnu.org; Thu, 21 Feb 2019 10:44:02 -0500 Received: by mail-wr1-x429.google.com with SMTP id o17so31141230wrw.3 for ; Thu, 21 Feb 2019 07:43:58 -0800 (PST) In-Reply-To: <8736ohywqw.fsf@hidden> 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 * lisp/org.el (org-remove-timestamp-with-keyword): Fix space deletion between timestamps When an entry had a CLOSED, a DEADLINE and a SCHEDULED timestamps, removing the middle one caused the space between the 1st and 3rd to be removed as well. Checking whether we=E2=80=99re at the end of the line bef= ore deleting the space fixes it. --- Here=E2=80=99s a little unrelated patch for an issue I=E2=80=99ve stumbled = upon whilst testing the previous patch. lisp/org.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/org.el b/lisp/org.el index ae9494672..4c3c3cd78 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -12944,6 +12944,7 @@ nil." (while (re-search-backward re beg t) (replace-match "") (if (and (string-match "\\S-" (buffer-substring (point-at-bol) (point))) + (eolp) (equal (char-before) ?\ )) (backward-delete-char 1) (when (string-match "^[ \t]*$" (buffer-substring --=20 2.20.1