From e9196279f4edec5d8504f33f8bf9f7119720acd6 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Fri, 25 Sep 2009 07:58:54 +0100 Subject: [PATCH] Make C-e not jump after the ellipsis of a folded headline --- lisp/ChangeLog | 6 ++++++ lisp/org.el | 18 ++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6fcdce0f8..81326e4a8 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2009-09-25 Carsten Dominik + + * org.el (org-special-ctrl-a/e): Improve documentation and + customize type. + (org-end-of-line): Don't jump to after the ellipsis. + 2009-09-24 Carsten Dominik * org.el (org-fontify-meta-lines-and-blocks): Treat lines with a diff --git a/lisp/org.el b/lisp/org.el index 32ffc5f53..a700c4d6b 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -765,7 +765,9 @@ it to the beginning of the line. `C-e' will jump to the end of the headline, ignoring the presence of tags in the headline. A second `C-e' will then jump to the true end of the -line, after any tags. +line, after any tags. This also means that, when this variable is +non-nil, `C-e' also will never jump beyond the end of the heading of a +folded section, i.e. not after the ellipses. When set to the symbol `reversed', the first `C-a' or `C-e' works normally, going to the true line boundary first. Only a directly following, identical @@ -776,17 +778,17 @@ set separately." :group 'org-edit-structure :type '(choice (const :tag "off" nil) - (const :tag "after stars/bullet and before tags first" t) - (const :tag "true line boundary first" reversed) + (const :tag "on: after stars/bullet and before tags first" t) + (const :tag "reversed: true line boundary first" reversed) (cons :tag "Set C-a and C-e separately" (choice :tag "Special C-a" (const :tag "off" nil) - (const :tag "after stars/bullet first" t) - (const :tag "before stars/bullet first" reversed)) + (const :tag "on: after stars/bullet first" t) + (const :tag "reversed: before stars/bullet first" reversed)) (choice :tag "Special C-e" (const :tag "off" nil) - (const :tag "before tags first" t) - (const :tag "after tags first" reversed))))) + (const :tag "on: before tags first" t) + (const :tag "reversed: after tags first" reversed))))) (if (fboundp 'defvaralias) (defvaralias 'org-special-ctrl-a 'org-special-ctrl-a/e)) @@ -16612,7 +16614,7 @@ beyond the end of the headline." (t 'end-of-line))) (let ((pos (point))) (beginning-of-line 1) - (if (looking-at (org-re ".*?\\([ \t]*\\)\\(:[[:alnum:]_@:]+:\\)[ \t]*$")) + (if (looking-at (org-re ".*?\\(?:\\([ \t]*\\)\\(:[[:alnum:]_@:]+:\\)?[ \t]*\\)?$")) (if (eq special t) (if (or (< pos (match-beginning 1)) (= pos (match-end 0)))