From 4e0fad540f3a250df12d60cf304347a38537b56f Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Fri, 10 May 2013 08:59:07 +0200 Subject: [PATCH] Fix point adjustment after beginning/end of line commands * lisp/org.el (org-beginning-of-line,org-end-of-line): Set disable-point-adjustment when the command ends next to invisible text. --- lisp/org.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 745fb821d..b9d3894af 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -22636,7 +22636,10 @@ beyond the end of the headline." (when (and (= (point) pos) (eq last-command this-command)) (goto-char after-bullet)))))))) (org-no-warnings - (and (featurep 'xemacs) (setq zmacs-region-stays t))))) + (and (featurep 'xemacs) (setq zmacs-region-stays t)))) + (setq disable-point-adjustment + (or (not (invisible-p (point))) + (not (invisible-p (max (point-min) (1- (point)))))))) (defun org-end-of-line (&optional arg) "Go to the end of the line. @@ -22673,7 +22676,10 @@ the cursor is already beyond the end of the headline." ;; 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))))) + (org-no-warnings (and (featurep 'xemacs) (setq zmacs-region-stays t)))) + (setq disable-point-adjustment + (or (not (invisible-p (point))) + (not (invisible-p (max (point-min) (1- (point)))))))) (define-key org-mode-map "\C-a" 'org-beginning-of-line) (define-key org-mode-map "\C-e" 'org-end-of-line)