summaryrefslogtreecommitdiff
path: root/lisp/org
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2012-12-12 21:29:15 -0800
committerGlenn Morris <rgm@gnu.org>2012-12-12 21:29:15 -0800
commit727f97393714c5c92aef793f0749ebfde1d14f3c (patch)
tree1bb7d815c7b2a1f1076fa0b0afbdab70045215a0 /lisp/org
parentd20704efe62cf45255252168b4f4c453a8c88430 (diff)
parentbfe6ffb652954956ca984d594deb88d45f8cfd77 (diff)
Merge from emacs-24; up to 2012-11-30T04:44:52Z!cyd@gnu.org
Diffstat (limited to 'lisp/org')
-rw-r--r--lisp/org/ChangeLog86
-rw-r--r--lisp/org/org-agenda.el13
-rw-r--r--lisp/org/org-bibtex.el2
-rw-r--r--lisp/org/org-clock.el2
-rw-r--r--lisp/org/org-element.el18
-rw-r--r--lisp/org/org-latex.el9
-rw-r--r--lisp/org/org-list.el4
-rw-r--r--lisp/org/org-remember.el16
-rw-r--r--lisp/org/org-src.el23
-rw-r--r--lisp/org/org-table.el4
-rw-r--r--lisp/org/org-timer.el3
-rw-r--r--lisp/org/org-version.el2
-rw-r--r--lisp/org/org.el90
13 files changed, 199 insertions, 73 deletions
diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog
index 98383e56532..f7715198464 100644
--- a/lisp/org/ChangeLog
+++ b/lisp/org/ChangeLog
@@ -1,3 +1,89 @@
+2012-12-13 Bastien Guerry <bzg@gnu.org>
+
+ * org-latex.el (org-export-latex-links): Escape raw path when
+ exporting links to files.
+
+ * org-src.el (org-src-native-tab-command-maybe): Fix bug: the
+ S-TAB key should not trigger a native TAB command.
+
+ * org.el (org-open-at-point): Allow to open any link within
+ footnotes definition, not only bracket links.
+
+ * org.el (org-sort-entries): Bugfix: keep track of the clock
+ marker when sorting entries. Enhance the docstring.
+
+ * org-clock.el (org-clock-out): Use `user-error' when the user
+ tries to clock out while there is no running clock.
+
+ * org-table.el (org-table-sort-lines): Ensure coordinates are
+ correctly displayed when sorting.
+
+ * org.el (org-do-sort): Enhance prompt.
+
+ * org-agenda.el (org-agenda-finalize): Also activate plain links.
+
+ * org-timer.el (org-timer-stop): Add message.
+
+ * org-agenda.el (org-agenda-schedule, org-agenda-deadline):
+ Fix redundant messages.
+
+ * org-agenda.el (org-agenda-finalize): Fix clock highlighting.
+
+ * org.el (org-additional-option-like-keywords): Add "INDEX:".
+
+ * org-install.el: Enhance warning.
+
+2012-12-13 Erik Hetzner <egh@e6h.org> (tiny change)
+
+ * org.el (org-log-into-drawer): Honor the nil value for the
+ :LOG_INTO_DRAWER: property.
+
+2012-12-13 Le Wang <l26wang@gmail.com> (tiny change)
+
+ * org-src.el (org-edit-src-exit): Fix editing source section with
+ blank lines.
+
+2012-12-13 Le Wang <le.wang@agworld.com.au>
+
+ * org-src.el (org-edit-src-code): Use marker with insertion type
+ t to track end and remove hack requiring delete from beg to (1- end).
+
+2012-12-13 Nicolas Goaziou <n.goaziou@gmail.com>
+
+ * org-element.el (org-element-context): When point is between two
+ objects, be sure to return the second one.
+
+ * org-list.el (org-list-separating-blank-lines-number): When
+ computing number of blank lines separating items, also count those
+ in unparsed blocks, like example blocks.
+
+ * org.el (org-end-of-line): When visual line mode is on, really
+ move by visual lines. Small refactoring.
+
+ * org.el (org-end-of-line): On a hidden block make sure to
+ delegate motion to `end-of-line' instead of `move-end-of-line' in
+ order to stay on the current line.
+
+2012-12-13 Rafael Laboissiere <rafael@laboissiere.net> (tiny change)
+
+ * org-bibtex.el: In the documentation section of the file, fix the
+ broken URL to Andrew Roberts' document on BibTeX entries.
+
+ * org-remember.el (org-remember-handler): Correctly strip the
+ comment lines in the temporary buffer *Remember* when handling a
+ remember note.
+
+ * org-remember.el (org-remember-apply-template): Start the
+ commented lines in the Remember temporary buffer with the
+ appropriate characters.
+
+2012-12-13 Toby S. Cubitt <tsc25@cantab.net>
+
+ * org.el (org-beginning-of-line): Check `visual-line-mode' instead
+ of `line-visual-mode' to determine whether to move by visual lines.
+
+ * org.el (org-kill-line): Use the `org-bound-and-true-p' macro.
+
2012-12-04 Chong Yidong <cyd@gnu.org>
* org-bibtex.el (org-bibtex-ask): Use visual-line-mode instead of
diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el
index 36f3fcb9974..a2e919f5944 100644
--- a/lisp/org/org-agenda.el
+++ b/lisp/org/org-agenda.el
@@ -3517,6 +3517,9 @@ generating a new one."
(while (org-activate-bracket-links (point-max))
(add-text-properties (match-beginning 0) (match-end 0)
'(face org-link)))
+ (while (org-activate-plain-links (point-max))
+ (add-text-properties (match-beginning 0) (match-end 0)
+ '(face org-link)))
(org-agenda-align-tags)
(unless org-agenda-with-colors
(remove-text-properties (point-min) (point-max) '(face nil))))
@@ -3531,7 +3534,11 @@ generating a new one."
(org-agenda-fontify-priorities))
(when (and org-agenda-dim-blocked-tasks org-blocker-hook)
(org-agenda-dim-blocked-tasks))
- (org-agenda-mark-clocking-task)
+ ;; We need to widen when `org-agenda-finalize' is called from
+ ;; `org-agenda-change-all-lines' (e.g. in `org-agenda-clock-in')
+ (save-restriction
+ (widen)
+ (org-agenda-mark-clocking-task))
(when org-agenda-entry-text-mode
(org-agenda-entry-text-hide)
(org-agenda-entry-text-show))
@@ -8602,7 +8609,7 @@ ARG is passed through to `org-schedule'."
(goto-char pos)
(setq ts (org-schedule arg time)))
(org-agenda-show-new-time marker ts "S"))
- (message "Item scheduled for %s" ts)))
+ (message "%s" ts)))
(defun org-agenda-deadline (arg &optional time)
"Schedule the item at point.
@@ -8622,7 +8629,7 @@ ARG is passed through to `org-deadline'."
(goto-char pos)
(setq ts (org-deadline arg time)))
(org-agenda-show-new-time marker ts "D"))
- (message "Deadline for this item set to %s" ts)))
+ (message "%s" ts)))
(defun org-agenda-clock-in (&optional arg)
"Start the clock on the currently selected item."
diff --git a/lisp/org/org-bibtex.el b/lisp/org/org-bibtex.el
index aaae8d52de8..bd84107161b 100644
--- a/lisp/org/org-bibtex.el
+++ b/lisp/org/org-bibtex.el
@@ -88,7 +88,7 @@
;;
;; - All Bibtex information is taken from the document compiled by
;; Andrew Roberts from the Bibtex manual, available at
-;; http://www.andy-roberts.net/misc/latex/sessions/bibtex/bibentries.pdf
+;; http://www.andy-roberts.net/res/writing/latex/bibentries.pdf
;;
;;; History:
;;
diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el
index 3f252fd8c32..e8ced67e694 100644
--- a/lisp/org/org-clock.el
+++ b/lisp/org/org-clock.el
@@ -1447,7 +1447,7 @@ to, overriding the existing value of `org-clock-out-switch-to-state'."
(delq 'org-mode-line-string global-mode-string))
(setq frame-title-format org-frame-title-format-backup)
(force-mode-line-update)
- (if fail-quietly (throw 'exit t) (error "No active clock")))
+ (if fail-quietly (throw 'exit t) (user-error "No active clock")))
(let ((org-clock-out-switch-to-state
(if switch-to-state
(completing-read "Switch to state: "
diff --git a/lisp/org/org-element.el b/lisp/org/org-element.el
index 5da2dec3fb3..51b89585010 100644
--- a/lisp/org/org-element.el
+++ b/lisp/org/org-element.el
@@ -4316,18 +4316,22 @@ and :post-blank properties."
(funcall (intern (format "org-element-%s-parser"
(car closest-cand))))))
(cbeg (org-element-property :contents-begin object))
- (cend (org-element-property :contents-end object)))
+ (cend (org-element-property :contents-end object))
+ (obj-end (org-element-property :end object)))
(cond
;; ORIGIN is after OBJECT, so skip it.
- ((< (org-element-property :end object) origin)
- (goto-char (org-element-property :end object)))
- ;; ORIGIN is within a non-recursive object or at an
- ;; object boundaries: Return that object.
+ ((<= obj-end origin)
+ (if (/= obj-end end) (goto-char obj-end)
+ (throw 'exit
+ (org-element-put-property
+ object :parent parent))))
+ ;; ORIGIN is within a non-recursive object or at
+ ;; an object boundaries: Return that object.
((or (not cbeg) (> cbeg origin) (< cend origin))
(throw 'exit
(org-element-put-property object :parent parent)))
- ;; Otherwise, move within current object and restrict
- ;; search to the end of its contents.
+ ;; Otherwise, move within current object and
+ ;; restrict search to the end of its contents.
(t (goto-char cbeg)
(org-element-put-property object :parent parent)
(setq parent object
diff --git a/lisp/org/org-latex.el b/lisp/org/org-latex.el
index 9ce84f14e92..a53470df8be 100644
--- a/lisp/org/org-latex.el
+++ b/lisp/org/org-latex.el
@@ -2291,14 +2291,13 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
(concat type ":" raw-path))
((equal type "file")
(if (and (org-file-image-p
- (expand-file-name
- raw-path)
+ (expand-file-name (org-link-unescape raw-path))
org-export-latex-inline-image-extensions)
- (or (get-text-property 0 'org-no-description
- raw-path)
+ (or (get-text-property 0 'org-no-description raw-path)
(equal desc full-raw-path)))
(setq imgp t)
- (progn (when (string-match "\\(.+\\)::.+" raw-path)
+ (progn (setq raw-path (org-link-unescape raw-path))
+ (when (string-match "\\(.+\\)::.+" raw-path)
(setq raw-path (match-string 1 raw-path)))
(if (file-exists-p raw-path)
(concat type "://" (expand-file-name raw-path))
diff --git a/lisp/org/org-list.el b/lisp/org/org-list.el
index 10f5e6ec6a9..993272aeb98 100644
--- a/lisp/org/org-list.el
+++ b/lisp/org/org-list.el
@@ -1230,7 +1230,9 @@ some heuristics to guess the result."
;; Are there blank lines inside the list so far?
((save-excursion
(goto-char (org-list-get-top-point struct))
- (org-list-search-forward
+ ;; Do not use `org-list-search-forward' so blank lines
+ ;; in blocks can be counted in.
+ (re-search-forward
"^[ \t]*$" (org-list-get-item-end-before-blank item struct) t))
1)
;; Default choice: no blank line.
diff --git a/lisp/org/org-remember.el b/lisp/org/org-remember.el
index d555ca65d21..5cfe70f7af6 100644
--- a/lisp/org/org-remember.el
+++ b/lisp/org/org-remember.el
@@ -472,12 +472,12 @@ to be run from that hook to function properly."
(erase-buffer)
(insert (substitute-command-keys
(format
- "## %s \"%s\" -> \"* %s\"
-## C-u C-c C-c like C-c C-c, and immediately visit note at target location
-## C-0 C-c C-c \"%s\" -> \"* %s\"
-## %s to select file and header location interactively.
-## C-2 C-c C-c as child (C-3: as sibling) of the currently clocked item
-## To switch templates, use `\\[org-remember]'. To abort use `C-c C-k'.\n\n"
+ "# %s \"%s\" -> \"* %s\"
+# C-u C-c C-c like C-c C-c, and immediately visit note at target location
+# C-0 C-c C-c \"%s\" -> \"* %s\"
+# %s to select file and header location interactively.
+# C-2 C-c C-c as child (C-3: as sibling) of the currently clocked item
+# To switch templates, use `\\[org-remember]'. To abort use `C-c C-k'.\n\n"
(if org-remember-store-without-prompt " C-c C-c" " C-1 C-c C-c")
(abbreviate-file-name (or file org-default-notes-file))
(or headline "")
@@ -840,12 +840,12 @@ See also the variable `org-reverse-note-order'."
(if (= end beg) (setq beg (1- beg)))
(put-text-property beg end 'org-position-cursor t)))
(goto-char (point-min))
- (while (looking-at "^[ \t]*\n\\|^##.*\n")
+ (while (looking-at "^[ \t]*\n\\|^# .*\n")
(replace-match ""))
(when org-remember-delete-empty-lines-at-end
(goto-char (point-max))
(beginning-of-line 1)
- (while (and (looking-at "[ \t]*$\\|##.*") (> (point) 1))
+ (while (and (looking-at "[ \t]*$\\|[ \t]*# .*") (> (point) 1))
(delete-region (1- (point)) (point-max))
(beginning-of-line 1)))
(catch 'quit
diff --git a/lisp/org/org-src.el b/lisp/org/org-src.el
index b4d4c0489a9..f91da19ec32 100644
--- a/lisp/org/org-src.el
+++ b/lisp/org/org-src.el
@@ -215,11 +215,22 @@ buffer."
(setq org-edit-src-saved-temp-window-config (current-window-configuration)))
(let* ((mark (and (org-region-active-p) (mark)))
(case-fold-search t)
- (info (org-edit-src-find-region-and-lang))
+ (info
+ ;; If the src region consists in no lines, we insert a blank
+ ;; line.
+ (let* ((temp (org-edit-src-find-region-and-lang))
+ (beg (nth 0 temp))
+ (end (nth 1 temp)))
+ (if (>= end beg) temp
+ (goto-char beg)
+ (insert "\n")
+ (org-edit-src-find-region-and-lang))))
(full-info (org-babel-get-src-block-info 'light))
(org-mode-p (derived-mode-p 'org-mode)) ;; derived-mode-p is reflexive
(beg (make-marker))
- (end (make-marker))
+ ;; Move marker with inserted text for case when src block is
+ ;; just one empty line, i.e. beg == end.
+ (end (copy-marker nil t))
(allow-write-back-p (null code))
block-nindent total-nindent ovl lang lang-f single lfmt buffer msg
begline markline markcol line col transmitted-variables)
@@ -689,10 +700,9 @@ with \",*\", \",#+\", \",,*\" and \",,#+\"."
(kill-buffer buffer))
(goto-char beg)
(when allow-write-back-p
- (delete-region beg (max beg (1- end)))
- (unless (string-match "^[ \t]*$" code)
- (insert code)
- (delete-char 1))
+ (delete-region beg (max beg end))
+ (unless (string-match "\\`[ \t]*\\'" code)
+ (insert code))
(goto-char beg)
(if single (just-one-space)))
(if (memq t (mapcar (lambda (overlay)
@@ -820,6 +830,7 @@ issued in the language major mode buffer."
Alter code block according to effect of TAB in the language major
mode."
(and org-src-tab-acts-natively
+ (not (equal this-command 'org-shifttab))
(let ((org-src-strip-leading-and-trailing-blank-lines nil))
(org-babel-do-key-sequence-in-edit-buffer (kbd "TAB")))))
diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el
index 0555041231b..f7cae3c8bf2 100644
--- a/lisp/org/org-table.el
+++ b/lisp/org/org-table.el
@@ -1594,6 +1594,7 @@ should be done in reverse order."
(interactive "P")
(let* ((thisline (org-current-line))
(thiscol (org-table-current-column))
+ (otc org-table-overlay-coordinates)
beg end bcol ecol tend tbeg column lns pos)
(when (equal thiscol 0)
(if (org-called-interactively-p 'any)
@@ -1642,12 +1643,15 @@ should be done in reverse order."
x))
(org-split-string (buffer-substring beg end) "\n")))
(setq lns (org-do-sort lns "Table" with-case sorting-type))
+ (when org-table-overlay-coordinates
+ (org-table-toggle-coordinate-overlays))
(delete-region beg end)
(move-marker beg nil)
(move-marker end nil)
(insert (mapconcat 'cdr lns "\n") "\n")
(org-goto-line thisline)
(org-table-goto-column thiscol)
+ (when otc (org-table-toggle-coordinate-overlays))
(message "%d lines sorted, based on column %d" (length lns) column)))
;;;###autoload
diff --git a/lisp/org/org-timer.el b/lisp/org/org-timer.el
index a314564b94a..8a5b599eca2 100644
--- a/lisp/org/org-timer.el
+++ b/lisp/org/org-timer.el
@@ -162,7 +162,8 @@ With prefix arg STOP, stop it entirely."
(run-hooks 'org-timer-stop-hook)
(setq org-timer-start-time nil
org-timer-pause-time nil)
- (org-timer-set-mode-line 'off))
+ (org-timer-set-mode-line 'off)
+ (message "Timer stopped"))
;;;###autoload
(defun org-timer (&optional restart no-insert-p)
diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el
index 564b49a5cea..de434885b12 100644
--- a/lisp/org/org-version.el
+++ b/lisp/org/org-version.el
@@ -11,7 +11,7 @@
(defun org-git-version ()
"The Git version of org-mode.
Inserted by installing org-mode or when a release is made."
- (let ((org-git-version "7.9.2+-GNU-Emacs-24-3"))
+ (let ((org-git-version "7.9.2+-GNU-Emacs-24-3 (commit 488eea)"))
org-git-version))
;;;###autoload
(defvar org-odt-data-dir "/usr/share/emacs/etc/org"
diff --git a/lisp/org/org.el b/lisp/org/org.el
index 45dbe2754e8..60e2a8be550 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -2498,9 +2498,10 @@ a subtree."
"Return the value of `org-log-into-drawer', but let properties overrule.
If the current entry has or inherits a LOG_INTO_DRAWER property, it will be
used instead of the default value."
- (let ((p (org-entry-get nil "LOG_INTO_DRAWER" 'inherit)))
+ (let ((p (org-entry-get nil "LOG_INTO_DRAWER" 'inherit t)))
(cond
- ((or (not p) (equal p "nil")) org-log-into-drawer)
+ ((not p) org-log-into-drawer)
+ ((equal p "nil") nil)
((equal p "t") "LOGBOOK")
(t p))))
@@ -8016,11 +8017,12 @@ a time stamp, by a property or by priority.
The command prompts for the sorting type unless it has been given to the
function through the SORTING-TYPE argument, which needs to be a character,
-\(?n ?N ?a ?A ?t ?T ?s ?S ?d ?D ?p ?P ?r ?R ?f ?F). Here is the
+\(?n ?N ?a ?A ?t ?T ?s ?S ?d ?D ?p ?P ?o ?O ?r ?R ?f ?F). Here is the
precise meaning of each character:
n Numerically, by converting the beginning of the entry/item to a number.
a Alphabetically, ignoring the TODO keyword and the priority, if any.
+o By order of TODO keywords.
t By date/time, either the first active time stamp in the entry, or, if
none exist, by the first inactive one.
s By the scheduled date/time.
@@ -8040,6 +8042,13 @@ Comparing entries ignores case by default. However, with an optional argument
WITH-CASE, the sorting considers case as well."
(interactive "P")
(let ((case-func (if with-case 'identity 'downcase))
+ (cmstr
+ ;; The clock marker is lost when using `sort-subr', let's
+ ;; store the clocking string.
+ (when (equal (marker-buffer org-clock-marker) (current-buffer))
+ (save-excursion
+ (goto-char org-clock-marker)
+ (looking-back "^.*") (match-string-no-properties 0))))
start beg end stars re re2
txt what tmp)
;; Find beginning and end of region to sort
@@ -8096,7 +8105,7 @@ WITH-CASE, the sorting considers case as well."
(message
"Sort %s: [a]lpha [n]umeric [p]riority p[r]operty todo[o]rder [f]unc
[t]ime [s]cheduled [d]eadline [c]reated
- A/N/T/S/D/C/P/O/F means reversed:"
+ A/N/P/R/O/F/T/S/D/C means reversed:"
what)
(setq sorting-type (read-char-exclusive))
@@ -8193,6 +8202,12 @@ WITH-CASE, the sorting considers case as well."
((= dcst ?f) compare-func)
((member dcst '(?p ?t ?s ?d ?c)) '<)))))
(run-hooks 'org-after-sorting-entries-or-items-hook)
+ ;; Reset the clock marker if needed
+ (when cmstr
+ (save-excursion
+ (goto-char start)
+ (search-forward cmstr nil t)
+ (move-marker org-clock-marker (point))))
(message "Sorting entries...done")))
(defun org-do-sort (table what &optional with-case sorting-type)
@@ -8204,7 +8219,7 @@ the car of the elements of the table.
If WITH-CASE is non-nil, the sorting will be case-sensitive."
(unless sorting-type
(message
- "Sort %s: [a]lphabetic. [n]umeric. [t]ime. A/N/T means reversed:"
+ "Sort %s: [a]lphabetic, [n]umeric, [t]ime. A/N/T means reversed:"
what)
(setq sorting-type (read-char-exclusive)))
(let ((dcst (downcase sorting-type))
@@ -9644,7 +9659,7 @@ application the system uses for this file type."
(not (org-in-regexp org-bracket-link-regexp)))
(org-follow-timestamp-link))
((and (or (org-footnote-at-reference-p) (org-footnote-at-definition-p))
- (not (org-in-regexp org-bracket-link-regexp)))
+ (not (org-in-regexp org-any-link-re)))
(org-footnote-action))
(t
(let (type path link line search (pos (point)))
@@ -11219,7 +11234,7 @@ This function can be used in a hook."
"COLUMNS:" "PROPERTY:"
"CAPTION:" "LABEL:"
"SETUPFILE:"
- "INCLUDE:"
+ "INCLUDE:" "INDEX:"
"BIND:"
"MACRO:"))
@@ -21270,7 +21285,7 @@ beyond the end of the headline."
(car org-special-ctrl-a/e)
org-special-ctrl-a/e))
refpos)
- (if (org-bound-and-true-p line-move-visual)
+ (if (org-bound-and-true-p visual-line-mode)
(beginning-of-visual-line 1)
(beginning-of-line 1))
(if (and arg (fboundp 'move-beginning-of-line))
@@ -21331,36 +21346,33 @@ the cursor is already beyond the end of the headline."
(interactive "P")
(let ((special (if (consp org-special-ctrl-a/e) (cdr org-special-ctrl-a/e)
org-special-ctrl-a/e))
- (type (org-element-type
- (save-excursion (beginning-of-line) (org-element-at-point)))))
- (cond
- ((or (not special) arg)
- (call-interactively
- (if (fboundp 'move-end-of-line) 'move-end-of-line 'end-of-line)))
- ((memq type '(headline inlinetask))
- (let ((pos (point)))
- (beginning-of-line 1)
- (if (looking-at (org-re ".*?\\(?:\\([ \t]*\\)\\(:[[:alnum:]_@#%:]+:\\)?[ \t]*\\)?$"))
- (if (eq special t)
- (if (or (< pos (match-beginning 1)) (= pos (match-end 0)))
- (goto-char (match-beginning 1))
- (goto-char (match-end 0)))
- (if (or (< pos (match-end 0))
- (not (eq this-command last-command)))
- (goto-char (match-end 0))
- (goto-char (match-beginning 1))))
- (call-interactively
- (if (fboundp 'move-end-of-line) 'move-end-of-line 'end-of-line)))))
- ((memq type
- '(center-block comment-block drawer dynamic-block example-block
- export-block item plain-list property-drawer
- quote-block special-block src-block verse-block))
- ;; Never move past the ellipsis.
- (or (eolp) (move-end-of-line 1))
- (when (org-invisible-p2) (backward-char)))
- (t
- (call-interactively
- (if (fboundp 'move-end-of-line) 'move-end-of-line 'end-of-line))))
+ (move-fun (cond ((org-bound-and-true-p visual-line-mode)
+ 'end-of-visual-line)
+ ((fboundp 'move-end-of-line) 'move-end-of-line)
+ (t 'end-of-line))))
+ (if (or (not special) arg) (call-interactively move-fun)
+ (let* ((element (save-excursion (beginning-of-line)
+ (org-element-at-point)))
+ (type (org-element-type element)))
+ (cond
+ ((memq type '(headline inlinetask))
+ (let ((pos (point)))
+ (beginning-of-line 1)
+ (if (looking-at (org-re ".*?\\(?:\\([ \t]*\\)\\(:[[:alnum:]_@#%:]+:\\)?[ \t]*\\)?$"))
+ (if (eq special t)
+ (if (or (< pos (match-beginning 1)) (= pos (match-end 0)))
+ (goto-char (match-beginning 1))
+ (goto-char (match-end 0)))
+ (if (or (< pos (match-end 0))
+ (not (eq this-command last-command)))
+ (goto-char (match-end 0))
+ (goto-char (match-beginning 1))))
+ (call-interactively move-fun))))
+ ((org-element-property :hiddenp element)
+ ;; If element is hidden, `move-end-of-line' would put point
+ ;; after it. Use `end-of-line' to stay on current line.
+ (call-interactively 'end-of-line))
+ (t (call-interactively move-fun)))))
(org-no-warnings (and (featurep 'xemacs) (setq zmacs-region-stays t)))))
(define-key org-mode-map "\C-a" 'org-beginning-of-line)
@@ -21400,7 +21412,7 @@ depending on context."
(not (y-or-n-p "Kill hidden subtree along with headline? ")))
(error "C-k aborted - would kill hidden subtree")))
(call-interactively
- (if (and (boundp 'visual-line-mode) visual-line-mode) 'kill-visual-line 'kill-line)))
+ (if (org-bound-and-true-p visual-line-mode) 'kill-visual-line 'kill-line)))
((looking-at (org-re ".*?\\S-\\([ \t]+\\(:[[:alnum:]_@#%:]+:\\)\\)[ \t]*$"))
(kill-region (point) (match-beginning 1))
(org-set-tags nil t))