emacs-orgmode
[Top][All Lists]
Advanced

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

[O] [PATCH] Fix spaces with `org-remove-timestamp-with-keyword'


From: Leo Vivier
Subject: [O] [PATCH] Fix spaces with `org-remove-timestamp-with-keyword'
Date: Thu, 21 Feb 2019 16:43:56 +0100

* 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’re at the end of the line before
deleting the space fixes it.
---
Here’s a little unrelated patch for an issue I’ve 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
-- 
2.20.1




reply via email to

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