emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Thomas Morgan <tlm@ziiuu.com>
To: emacs-orgmode@gnu.org
Subject: Clock-in in agenda makes some headings with links disappear
Date: Wed, 14 May 2014 03:41:31 -0400	[thread overview]
Message-ID: <87egzw24es.fsf@algol.ziiuu.com> (raw)

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

Dear Org mode hackers,

I came across a bug in Org-mode 8.2.6.  I had an overdue
TODO item in the agenda with a link at the end of the heading
text.  I clocked it in with `I' and the heading text
disappeared; only the link remained visible on that line in
the agenda.

This bug was reproducible for a while and I made the attached
patch which fixed it, but I didn't succeed in making a minimal
test case, and now I'm not able to reproduce it at all.

The problem seemed to be that `(beginning-of-line 0)' was
not moving to the beginning of the line, but between closing
brackets in the link.  I thought this might be related to
`inhibit-field-text-motion', but enabling that didn't help,
nor did using `(forward-line -1)'.  What seemed to solve it
was adding `(beginning-of-line)' after `(forward-line -1)',
as in the patch.

I know this is not a very helpful bug report but thought I'd
send it anyway in case someone else has seen the same problem
and understands what's going on.

Best regards,
Thomas


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-bug-mading-agenda-line-disappear-on-clock-in.patch --]
[-- Type: text/x-diff, Size: 1337 bytes --]

From 06cde5027e8ca93d82d14c5c0b46deb3e1c80b25 Mon Sep 17 00:00:00 2001
From: Thomas Morgan <tlm@ziiuu.com>
Date: Tue, 13 May 2014 23:52:48 -0400
Subject: [PATCH] Fix bug mading agenda line disappear on clock-in.

In some cases with a link at the end of the line,
`(beginning-of-line 0)' moves to a position within
the link (between the closing bracket of the link
description and the following closing bracket) and
not to the beginning of the line.

Then the properties at that position in the link
are made the properties of the whole line, and the
entire line disappears.

* lisp/org-agenda.el (org-agenda-change-all-lines): Move backward one
  line and to the beginning of that line as an explicit second step.

TINYCHANGE
---
 lisp/org-agenda.el |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index e2a0629..428d31f 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -8895,7 +8895,8 @@ If FORCE-TAGS is non nil, the car of it returns the new tags."
 	  (save-restriction
 	    (narrow-to-region (point-at-bol) (point-at-eol))
 	    (org-agenda-finalize)))
-	(beginning-of-line 0)))))
+	(forward-line -1)
+	(beginning-of-line)))))
 
 (defun org-agenda-align-tags (&optional line)
   "Align all tags in agenda items to `org-agenda-tags-column'."
-- 
1.7.10.4


             reply	other threads:[~2014-05-14  7:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-14  7:41 Thomas Morgan [this message]
2014-05-15  9:21 ` Clock-in in agenda makes some headings with links disappear Bastien
2014-05-16  2:59   ` Thomas Morgan
2014-05-19  3:29     ` Thomas Morgan
2014-05-21  2:25     ` Bastien
2014-05-21 15:35     ` Bastien
2014-05-22 10:51       ` Bastien
2014-05-25  9:27       ` Thomas Morgan
2014-05-25 12:52         ` Thomas Morgan
2014-05-25 17:58           ` Thomas Morgan
2014-05-26 13:03             ` Bastien
2014-05-26 13:02           ` Bastien

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=87egzw24es.fsf@algol.ziiuu.com \
    --to=tlm@ziiuu.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).