summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2010-06-25 08:23:25 +0200
committerCarsten Dominik <carsten.dominik@gmail.com>2010-06-25 08:23:25 +0200
commit732884dbeb1a0f939b6f436a9d2bab9dcc9e3f8e (patch)
tree657363c03825777d021594a23a65368c16b60d36
parentae20361475ae80550ac228838784da14d8ac841e (diff)
downloadorg-mode-732884dbeb1a0f939b6f436a9d2bab9dcc9e3f8e.tar.gz
Fix the behavior of C-a when visible-mode is active
* lisp/org.el (org-truely-invisible-p): New function. (org-beginning-of-line): Use `org-truely-invisible-p'. Sebastien Vauban writes: > I'm reporting some movement problem I've observed. When on any line, let's say > the last clock one: > > - `C-e' moves the cursor to the end of it > - `C-a' moves the cursor at the level of `LOGBOOK'. > > --8<---------------cut here---------------start------------->8--- > **** Emails and News > :PROPERTIES: > :ID: 62849012-ae7a-4885-a552-b34516d3fd06 > :Effort: 1:00 > :END: > :LOGBOOK: > CLOCK: [2010-06-01 Tue 08:35]--[2010-06-01 Tue 09:20] => 0:45 > CLOCK: [2010-06-02 Wed 09:10]--[2010-06-02 Wed 10:20] => 1:10 > CLOCK: [2010-06-03 Thu 09:25]--[2010-06-03 Thu 10:20] => 0:55 > CLOCK: [2010-06-04 Fri 09:00]--[2010-06-04 Fri 10:00] => 1:00 > CLOCK: [2010-06-07 Mon 09:05]--[2010-06-07 Mon 10:25] => 1:20 > CLOCK: [2010-06-08 Tue 09:05]--[2010-06-08 Tue 10:30] => 1:25 > CLOCK: [2010-06-09 Wed 09:05]--[2010-06-09 Wed 10:20] => 1:15 > CLOCK: [2010-06-10 Thu 09:05]--[2010-06-10 Thu 10:20] => 1:15 > CLOCK: [2010-06-11 Fri 09:15]--[2010-06-11 Fri 10:00] => 0:45 > CLOCK: [2010-06-14 Mon 09:15]--[2010-06-14 Mon 10:10] => 0:55 > :END: > --8<---------------cut here---------------end--------------->8--- > > This is -- at least -- true whenever `M-x visible-mode' is enabled.
-rw-r--r--lisp/org.el15
1 files changed, 13 insertions, 2 deletions
diff --git a/lisp/org.el b/lisp/org.el
index a721b0e..21a1467 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -18560,8 +18560,8 @@ beyond the end of the headline."
(if (bobp)
nil
(backward-char 1)
- (if (org-invisible-p)
- (while (and (not (bobp)) (org-invisible-p))
+ (if (org-truely-invisible-p)
+ (while (and (not (bobp)) (org-truely-invisible-p))
(backward-char 1)
(beginning-of-line 1))
(forward-char 1))))
@@ -18779,6 +18779,17 @@ interactive command with similar behavior."
(outline-invisible-p)
(get-char-property (point) 'invisible)))
+(defun org-truely-invisible-p ()
+ "Check if point is at a character currently not visible.
+This version does not only check the character property, but also
+`visible-mode'."
+ ;; Early versions of noutline don't have `outline-invisible-p'.
+ (if (org-bound-and-true-p visible-mode)
+ nil
+ (if (fboundp 'outline-invisible-p)
+ (outline-invisible-p)
+ (get-char-property (point) 'invisible))))
+
(defun org-invisible-p2 ()
"Check if point is at a character currently not visible."
(save-excursion