From mboxrd@z Thu Jan 1 00:00:00 1970 From: Toby Cubitt Subject: [PATCH] Make org-[beginning|end]-of-line respect visual-line-mode Date: Tue, 6 Nov 2012 13:30:50 +0100 Message-ID: <20121106123050.GA27247@c3po> Reply-To: Toby Cubitt Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="ReaqsoxgOBHFXBhH" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:48392) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TViIj-0003xs-9g for emacs-orgmode@gnu.org; Tue, 06 Nov 2012 07:30:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TViIb-000145-Es for emacs-orgmode@gnu.org; Tue, 06 Nov 2012 07:30:41 -0500 Received: from starfish.geekisp.com ([216.168.135.166]:20028) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1TViIb-00013s-An for emacs-orgmode@gnu.org; Tue, 06 Nov 2012 07:30:33 -0500 Content-Disposition: inline List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode --ReaqsoxgOBHFXBhH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject line and commit message says it all. Toby -- Dr T. S. Cubitt Mathematics and Quantum Information group Department of Mathematics Complutense University Madrid, Spain email: tsc25@cantab.net web: www.dr-qubit.org --ReaqsoxgOBHFXBhH Content-Type: text/x-patch; charset=us-ascii Content-Disposition: attachment; filename="0001-Make-org-end-of-line-respect-visual-line-mode.patch" >From bca045ffd27d41630c52a67390767cd622544bb9 Mon Sep 17 00:00:00 2001 From: "Toby S. Cubitt" Date: Tue, 6 Nov 2012 13:25:15 +0100 Subject: [PATCH] Make org-end-of-line respect visual-line-mode * lisp/org.el (org-beginning-of-line, org-end-of-line): Use beginning-of-visual-line and end-of-visual-line to move to beginning/end of line in visual-line-mode. --- lisp/org.el | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 2aa70bd..4ce4ed3 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -21567,7 +21567,8 @@ beyond the end of the headline." (car org-special-ctrl-a/e) org-special-ctrl-a/e)) refpos) - (if (org-bound-and-true-p line-move-visual) + (if (or (org-bound-and-true-p visual-line-mode) + (org-bound-and-true-p line-move-visual)) (beginning-of-visual-line 1) (beginning-of-line 1)) (if (and arg (fboundp 'move-beginning-of-line)) @@ -21578,7 +21579,9 @@ beyond the end of the headline." (if (org-truely-invisible-p) (while (and (not (bobp)) (org-truely-invisible-p)) (backward-char 1) - (beginning-of-line 1)) + (if (org-bound-and-true-p visual-line-mode) + (beginning-of-visual-line 1) + (beginning-of-line 1))) (forward-char 1)))) (when special (cond @@ -21633,7 +21636,8 @@ the cursor is already beyond the end of the headline." (cond ((or (not special) arg) (call-interactively - (if (fboundp 'move-end-of-line) 'move-end-of-line 'end-of-line))) + (if (org-bound-and-true-p visual-line-mode) 'end-of-visual-line + (if (fboundp 'move-end-of-line) 'move-end-of-line 'end-of-line)))) ((memq type '(headline inlinetask)) (let ((pos (point))) (beginning-of-line 1) @@ -21657,7 +21661,8 @@ the cursor is already beyond the end of the headline." (when (org-invisible-p2) (backward-char))) (t (call-interactively - (if (fboundp 'move-end-of-line) 'move-end-of-line 'end-of-line)))) + (if (org-bound-and-true-p visual-line-mode) 'end-of-visual-line + (if (fboundp 'move-end-of-line) 'move-end-of-line 'end-of-line))))) (org-no-warnings (and (featurep 'xemacs) (setq zmacs-region-stays t))))) (define-key org-mode-map "\C-a" 'org-beginning-of-line) -- 1.7.8.6 --ReaqsoxgOBHFXBhH--