emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carlos Pita <carlosjosepita@gmail.com>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: [PATCH] Avoid extra space when removing state
Date: Fri, 8 Mar 2019 23:19:21 -0300	[thread overview]
Message-ID: <CAELgYhd9f=15_bmc7i4aLmZctsUcwYfrMP3OshFwH-M4P5y3Vw@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 239 bytes --]

Hi all,

here is a patch removing an extra space that is left when one selects
an empty state from the completing read interface. I simply replaced a
check for non-null with a check for org-string-nw-p in org-todo.

Best regards
--
Carlos

[-- Attachment #2: 0001-Avoid-extra-space-when-removing-state.patch --]
[-- Type: text/x-patch, Size: 953 bytes --]

From 9f137a50e1f18e067b4b9ca8836993b212d93093 Mon Sep 17 00:00:00 2001
From: memeplex <carlosjosepita@gmail.com>
Date: Fri, 8 Mar 2019 23:12:16 -0300
Subject: [PATCH] Avoid extra space when removing state

* lisp/org.el (org-todo): check if org-string-nw-p instead of non nil.
---
 lisp/org.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 668482932..655c5733b 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -12082,7 +12082,7 @@ When called through ELisp, arg is also interpreted in the following way:
 			     (run-hook-with-args-until-success
 			      'org-todo-get-default-hook org-state org-last-state)
 			     org-state))
-		 (next (if org-state (concat " " org-state " ") " "))
+		 (next (if (org-string-nw-p org-state) (concat " " org-state " ") " "))
 		 (change-plist (list :type 'todo-state-change :from this :to org-state
 				     :position startpos))
 		 dolog now-done-p)
-- 
2.21.0


             reply	other threads:[~2019-03-09  2:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-09  2:19 Carlos Pita [this message]
2019-03-09 10:01 ` [PATCH] Avoid extra space when removing state Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAELgYhd9f=15_bmc7i4aLmZctsUcwYfrMP3OshFwH-M4P5y3Vw@mail.gmail.com' \
    --to=carlosjosepita@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).