summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2011-07-18 13:51:15 +0200
committerNicolas Goaziou <n.goaziou@gmail.com>2011-07-18 13:51:15 +0200
commita161ecfd6acfd23f5cde94f8950484da75f1ca5c (patch)
tree5ccfdd005b610ede75a44d8df0b230774b0a9e43
parent3aa87582b6d5d46dc13de28f0a6e50d7bb31a764 (diff)
downloadorg-mode-a161ecfd6acfd23f5cde94f8950484da75f1ca5c.tar.gz
org-list: move point after asking for new term when inserting an item
* lisp/org-list.el (org-list-insert-item): actualize code comments. (org-insert-item): for consistency, point cannot be moved at a surprising place when the user is being asked to choose a new description term to insert in the list. Point should stay where the user called the command.
-rw-r--r--lisp/org-list.el11
1 files changed, 5 insertions, 6 deletions
diff --git a/lisp/org-list.el b/lisp/org-list.el
index 120d18a..fa2d3f9 100644
--- a/lisp/org-list.el
+++ b/lisp/org-list.el
@@ -1216,10 +1216,9 @@ function ends.
This function modifies STRUCT."
(let ((case-fold-search t))
- ;; 1. Get information about list: structure, usual helper
- ;; functions, position of point with regards to item start
- ;; (BEFOREP), blank lines number separating items (BLANK-NB),
- ;; position of split (POS) if we're allowed to (SPLIT-LINE-P).
+ ;; 1. Get information about list: position of point with regards
+ ;; to item start (BEFOREP), blank lines number separating items
+ ;; (BLANK-NB), if we're allowed to (SPLIT-LINE-P).
(let* ((item (progn (goto-char pos) (goto-char (org-list-get-item-begin))))
(item-end (org-list-get-item-end item struct))
(item-end-no-blank (org-list-get-item-end-before-blank item struct))
@@ -2127,8 +2126,8 @@ item is invisible."
(org-at-item-timer-p))
;; Timer list: delegate to `org-timer-item'.
(progn (org-timer-item) t)
- (goto-char itemp)
- (let* ((struct (org-list-struct))
+ (let* ((struct (save-excursion (goto-char itemp)
+ (org-list-struct)))
(prevs (org-list-prevs-alist struct))
;; If we're in a description list, ask for the new term.
(desc (when (org-list-get-tag itemp struct)