emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Clock-in in agenda makes some headings with links disappear
@ 2014-05-14  7:41 Thomas Morgan
  2014-05-15  9:21 ` Bastien
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas Morgan @ 2014-05-14  7:41 UTC (permalink / raw)
  To: emacs-orgmode

[-- 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


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-05-26 13:04 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-14  7:41 Clock-in in agenda makes some headings with links disappear Thomas Morgan
2014-05-15  9:21 ` 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

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).