From b2343cef32f287505dfe49ab1b2f4a8abecbcdc0 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Wed, 17 Mar 2010 16:11:13 +0100 Subject: [PATCH] Fix cursor position after changing bullet types --- lisp/ChangeLog | 4 ++++ lisp/org-list.el | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7a33fa527..e9a657846 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2010-03-17 Carsten Dominik + + * org-list.el (org-fix-bullet-type): Improve cursor positioning. + 2010-03-15 Carsten Dominik * org.el (org-adaptive-fill-regexp-backup): New variable. diff --git a/lisp/org-list.el b/lisp/org-list.el index 31463ec84..92e71cfd3 100644 --- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -852,7 +852,7 @@ Also, fix the indentation." (interactive) (unless (org-at-item-p) (error "This is not a list")) (let ((line (org-current-line)) - (col (current-column)) + (chars-from-eol (- (point-at-eol) (point))) (ind (current-indentation)) ind1 bullet oldbullet) ;; find where this list begins @@ -883,7 +883,7 @@ Also, fix the indentation." (org-shift-item-indentation (- (length bullet) (length oldbullet)))))) (org-goto-line line) - (org-move-to-column col) + (goto-char (max (point-at-bol) (- (point-at-eol) chars-from-eol))) (if (string-match "[0-9]" bullet) (org-renumber-ordered-list 1))))