summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2013-05-10 08:59:07 +0200
committerCarsten Dominik <carsten.dominik@gmail.com>2013-05-10 08:59:07 +0200
commit4e0fad540f3a250df12d60cf304347a38537b56f (patch)
treebf5caf24aac48892b31f98621286ed6ec91bc2ea
parent7350e29eaea84511c027cc64d3a3968091b839ae (diff)
downloadorg-mode-4e0fad540f3a250df12d60cf304347a38537b56f.tar.gz
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.
-rw-r--r--lisp/org.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 745fb82..b9d3894 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)