forked from mirrors/org-mode
Replace non-interactive use of `org-next-item' and `org-previous-item'.
* org.el (org-skip-over-state-notes): do not compute bottom point at each item. * org-mouse.el (org-mouse-for-each-item): use `org-apply-on-list' instead of moving to each item.
This commit is contained in:
parent
59fa0d12c8
commit
60fcd2fa7e
|
@ -148,6 +148,7 @@
|
||||||
(declare-function org-agenda-change-all-lines "org-agenda"
|
(declare-function org-agenda-change-all-lines "org-agenda"
|
||||||
(newhead hdmarker &optional fixface just-this))
|
(newhead hdmarker &optional fixface just-this))
|
||||||
(declare-function org-verify-change-for-undo "org-agenda" (l1 l2))
|
(declare-function org-verify-change-for-undo "org-agenda" (l1 l2))
|
||||||
|
(declare-function org-apply-on-list "org-list" (function init-value &rest args))
|
||||||
|
|
||||||
(defvar org-mouse-plain-list-regexp "\\([ \t]*\\)\\([-+*]\\|[0-9]+[.)]\\) "
|
(defvar org-mouse-plain-list-regexp "\\([ \t]*\\)\\([-+*]\\|[0-9]+[.)]\\) "
|
||||||
"Regular expression that matches a plain list.")
|
"Regular expression that matches a plain list.")
|
||||||
|
@ -576,14 +577,11 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:"
|
||||||
(goto-char (second contextdata))
|
(goto-char (second contextdata))
|
||||||
(re-search-forward ".*" (third contextdata))))))
|
(re-search-forward ".*" (third contextdata))))))
|
||||||
|
|
||||||
(defun org-mouse-for-each-item (function)
|
(defun org-mouse-for-each-item (funct)
|
||||||
(save-excursion
|
;; Functions called by `org-apply-on-list' need an argument
|
||||||
(ignore-errors
|
(let ((wrap-fun (lambda (c) (funcall funct))))
|
||||||
(while t (org-previous-item)))
|
(when (org-in-item-p)
|
||||||
(ignore-errors
|
(org-apply-on-list wrap-fun nil))))
|
||||||
(while t
|
|
||||||
(funcall function)
|
|
||||||
(org-next-item)))))
|
|
||||||
|
|
||||||
(defun org-mouse-bolp ()
|
(defun org-mouse-bolp ()
|
||||||
"Return true if there only spaces, tabs, and '*' before point.
|
"Return true if there only spaces, tabs, and '*' before point.
|
||||||
|
|
|
@ -11775,10 +11775,11 @@ EXTRA is additional text that will be inserted into the notes buffer."
|
||||||
(defun org-skip-over-state-notes ()
|
(defun org-skip-over-state-notes ()
|
||||||
"Skip past the list of State notes in an entry."
|
"Skip past the list of State notes in an entry."
|
||||||
(if (looking-at "\n[ \t]*- State") (forward-char 1))
|
(if (looking-at "\n[ \t]*- State") (forward-char 1))
|
||||||
|
(when (org-in-item-p)
|
||||||
|
(let ((limit (org-list-bottom-point)))
|
||||||
(while (looking-at "[ \t]*- State")
|
(while (looking-at "[ \t]*- State")
|
||||||
(condition-case nil
|
(goto-char (or (org-get-next-item (point) limit)
|
||||||
(org-next-item)
|
(org-get-end-of-item limit)))))))
|
||||||
(error (org-end-of-item)))))
|
|
||||||
|
|
||||||
(defun org-add-log-note (&optional purpose)
|
(defun org-add-log-note (&optional purpose)
|
||||||
"Pop up a window for taking a note, and add this note later at point."
|
"Pop up a window for taking a note, and add this note later at point."
|
||||||
|
|
Loading…
Reference in New Issue