From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dale Sedivec Subject: Bug: Blank line when logging state changes [9.0.9 (9.0.9-692-gfbf31d.dirty-elpaplus @ /tmp/emacs/.emacs.d/elpa/org-plus-contrib-20170801/)] Date: Tue, 1 Aug 2017 11:27:05 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="089e0822f47ca637c30555b3a03c" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37786) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dca1O-00058V-Lg for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 12:27:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dca1N-0006mY-GK for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 12:27:50 -0400 Received: from mail-yw0-x230.google.com ([2607:f8b0:4002:c05::230]:33175) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dca1N-0006gK-7H for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 12:27:49 -0400 Received: by mail-yw0-x230.google.com with SMTP id p68so13363296ywg.0 for ; Tue, 01 Aug 2017 09:27:47 -0700 (PDT) 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: emacs-orgmode@gnu.org --089e0822f47ca637c30555b3a03c Content-Type: multipart/alternative; boundary="089e0822f47ca637c00555b3a03a" --089e0822f47ca637c00555b3a03a Content-Type: text/plain; charset="UTF-8" Hi! I think a recent change to org-split-string in master may have made logging of state changes a little uglier, adding "\\" and an empty line with trailing whitespace. Steps to reproduce: 1. Start fresh Emacs with no local configuration (e.g. mkdir /tmp/emacs && HOME=/tmp/emacs emacs) 2. Install org-plus-contrib package dated 20170731 3. Create an org file with the following two lines: ~~~~~~ #+TODO: TODO(!) DONE(!) * Test ~~~~~~ 4. Move point to the beginning of the "* Test" headline and call org-todo with C-c C-t to change it to a TODO item Expected result: ~~~~~~ * TODO Test - State "TODO" from [2017-08-01 Tue 11:18] ~~~~~~ Actual result: ~~~~~~ * TODO Test - State "TODO" from [2017-08-01 Tue 11:18] \\ ~~~~~~ Note the " \\" and blank line with trailing whitespace in the actual result. I strongly suspect this is a result of a change in behavior of org-split-string in f776e65373. Before that commit, calling (org-split-string "" "\n") as org-store-log-note is doing returned nil. After f776e65373 it returns '(""). IMHO the new behavior of org-split-string actually seems correct to me (splitting a string should arguably never result in nil), so I've fixed this by patching org-store-log-note as demonstrated in the attached patch. Regards, Dale --089e0822f47ca637c00555b3a03a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi!

I think a recent change to org-spli= t-string in master may have made logging of state changes a little uglier, = adding "\\" and an empty line with trailing whitespace.=C2=A0 Ste= ps to reproduce:

1. Start fresh Emacs with no loca= l configuration (e.g. mkdir /tmp/emacs && HOME=3D/tmp/emacs emacs)<= /div>

2. Install org-plus-contrib package dated 20170731=

3. Create an org file with the following two line= s:

~~~~~~
#+TODO: TODO(!) DONE(!)
* Test
~~~~~~

4. Move poi= nt to the beginning of the "* Test" headline and call org-todo wi= th C-c C-t to change it to a TODO item

Expected re= sult:

~~~~~~
* TODO Test
= =C2=A0 - State "TODO" =C2=A0 =C2=A0 =C2=A0 from =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[2017-08-01 Tue 11:18]
~~~~~= ~

Actual result:

~~~~~~
* TODO Test
=C2=A0 - State "TODO" =C2=A0 = =C2=A0 =C2=A0 from =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[2017-08= -01 Tue 11:18] \\
=C2=A0 =C2=A0=C2=A0
~~~~~~

Note the " \\" and blank line with trailing = whitespace in the actual result.

I strongly suspec= t this is a result of a change in behavior of org-split-string in=C2=A0f776= e65373.=C2=A0 Before that commit, calling

=C2=A0 = =C2=A0 (org-split-string "" "\n")

<= div>as org-store-log-note is doing returned nil.=C2=A0 After f776e65373=C2= =A0it returns '("").

IMHO the new be= havior of org-split-string actually seems correct to me (splitting a string= should arguably never result in nil), so I've fixed this by patching o= rg-store-log-note as demonstrated in the attached patch.

Regards,
Dale
--089e0822f47ca637c00555b3a03a-- --089e0822f47ca637c30555b3a03c Content-Type: text/plain; charset="US-ASCII"; name="org-store-log-note.diff" Content-Disposition: attachment; filename="org-store-log-note.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_j5tsqdgz0 LS0tIG9yZy5lbC5vcmlnCTIwMTctMDgtMDEgMTA6NTg6NTYuMDAwMDAwMDAwIC0wNTAwCisrKyBv cmcuZWwJMjAxNy0wOC0wMSAxMToyNjoxMi4wMDAwMDAwMDAgLTA1MDAKQEAgLTEzNjQwLDcgKzEz NjQwLDkgQEAKICAgICAgIChzZXRxIHR4dCAocmVwbGFjZS1tYXRjaCAiIiB0IHQgdHh0KSkpCiAg ICAgKHdoZW4gKHN0cmluZy1tYXRjaCAiXFxzLStcXCciIHR4dCkKICAgICAgIChzZXRxIHR4dCAo cmVwbGFjZS1tYXRjaCAiIiB0IHQgdHh0KSkpCi0gICAgKHNldHEgbGluZXMgKG9yZy1zcGxpdC1z dHJpbmcgdHh0ICJcbiIpKQorICAgIChzZXRxIGxpbmVzIChpZiAoemVyb3AgKGxlbmd0aCB0eHQp KQorCQkgICAgbmlsCisJCSAgKG9yZy1zcGxpdC1zdHJpbmcgdHh0ICJcbiIpKSkKICAgICAod2hl biAob3JnLXN0cmluZy1udy1wIG5vdGUpCiAgICAgICAoc2V0cSBub3RlCiAJICAgIChvcmctcmVw bGFjZS1lc2NhcGVzCg== --089e0822f47ca637c30555b3a03c--