* org-beginning-of-line vs visual-line-mode @ 2009-07-06 10:06 Rudi Schlatte 2009-07-06 15:49 ` Carsten Dominik 0 siblings, 1 reply; 4+ messages in thread From: Rudi Schlatte @ 2009-07-06 10:06 UTC (permalink / raw) To: emacs-orgmode Greetings, I run emacs cvs head and the org-mode that is bundled with it. Visual- line-mode is turned on. The display part of visual-line-mode (breaking long lines into paragraphs visually) works as expected, but C-a (org-beginning-of- line) jumps to the start of the paragraph (i.e. start of the "physical" line). It would be nice if C-a jumped to the beginning of the screen line. Cheers, and thanks for an excellent tool for writing! Rudi ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: org-beginning-of-line vs visual-line-mode 2009-07-06 10:06 org-beginning-of-line vs visual-line-mode Rudi Schlatte @ 2009-07-06 15:49 ` Carsten Dominik 2009-07-07 13:01 ` Rudi Schlatte 0 siblings, 1 reply; 4+ messages in thread From: Carsten Dominik @ 2009-07-06 15:49 UTC (permalink / raw) To: Rudi Schlatte; +Cc: emacs-orgmode On Jul 6, 2009, at 12:06 PM, Rudi Schlatte wrote: > Greetings, > > I run emacs cvs head and the org-mode that is bundled with it. > Visual-line-mode is turned on. > > The display part of visual-line-mode (breaking long lines into > paragraphs visually) works as expected, but C-a (org-beginning-of- > line) jumps to the start of the paragraph (i.e. start of the > "physical" line). It would be nice if C-a jumped to the beginning > of the screen line. > > Cheers, and thanks for an excellent tool for writing! You can get back the emacs 23 way of doing things with (add-hook 'org-mode-hook (lambda () (define-key org-mode-map "\C-a" 'move-beginning-of-line) (define-key org-mode-map "\C-a" 'move-end-of-line))) I personally don't like visual line mode at all, because much of what I am doing is line-based stuff (source code, for example, or headlines in Org), and I want these commands to got to syntactic positions, not visual positions that depend on the width of my window. - Carsten ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: org-beginning-of-line vs visual-line-mode 2009-07-06 15:49 ` Carsten Dominik @ 2009-07-07 13:01 ` Rudi Schlatte 2009-07-07 13:14 ` Carsten Dominik 0 siblings, 1 reply; 4+ messages in thread From: Rudi Schlatte @ 2009-07-07 13:01 UTC (permalink / raw) To: Carsten Dominik; +Cc: emacs-orgmode On 06.07.2009, at 17:49, Carsten Dominik wrote: > On Jul 6, 2009, at 12:06 PM, Rudi Schlatte wrote: > >> Greetings, >> >> I run emacs cvs head and the org-mode that is bundled with it. >> Visual-line-mode is turned on. >> >> The display part of visual-line-mode (breaking long lines into >> paragraphs visually) works as expected, but C-a (org-beginning-of- >> line) jumps to the start of the paragraph (i.e. start of the >> "physical" line). It would be nice if C-a jumped to the beginning >> of the screen line. >> >> Cheers, and thanks for an excellent tool for writing! > > You can get back the emacs 23 way of doing things with > > (add-hook 'org-mode-hook > (lambda () > (define-key org-mode-map "\C-a" 'move-beginning-of-line) > (define-key org-mode-map "\C-a" 'move-end-of-line))) > > I personally don't like visual line mode at all, because much > of what I am doing is line-based stuff (source code, for example, > or headlines in Org), and I want these commands to got to > syntactic positions, not visual positions that depend on the > width of my window. Thanks for the quick reply! Fwiw, I agree about the drawbacks of visual-line-mode, but somewhat to my surprise I found that I like it in text modes, so I turn it on conditionally in text-mode-hook. On the other hand, I use org-special-ctrl-a/e as well. So I hacked in treatment of line-move-visual at the beginnings of org-{beginning|end}- of-line (sorry no unified diff, just pasted the function beginnings): (defun org-beginning-of-line (&optional arg) "Go to the beginning of the current line. If that is invisible, continue to a visible line beginning. This makes the function of C-a more intuitive. If this is a headline, and `org-special-ctrl-a/e' is set, ignore tags on the first attempt, and only move to after the tags when the cursor is already beyond the end of the headline." (interactive "P") (let ((pos (point)) refpos) (if line-move-visual (beginning-of-visual-line 1) (beginning-of-line 1)) (if (and arg (fboundp 'move-beginning-of-line)) [...] and (defun org-end-of-line (&optional arg) "Go to the end of the line. If this is a headline, and `org-special-ctrl-a/e' is set, ignore tags on the first attempt, and only move to after the tags when the cursor is already beyond the end of the headline." (interactive "P") (if (or (not org-special-ctrl-a/e) (not (org-on-heading-p)) arg) (call-interactively (cond (line-move-visual 'end-of-visual-line) ((fboundp 'move-end-of-line) 'move- end-of-line) (t 'end-of-line))) (let ((pos (point))) (beginning-of-line 1) [...] For emacsen <23, the check for line-move-visual should use boundp or bound-and-true-p, of course. I believe these changes count as trivial w.r.t. copyright assignment, should you decide to merge them (which I'd be happy if you did, of course :) ). Greetings, Rudi ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: org-beginning-of-line vs visual-line-mode 2009-07-07 13:01 ` Rudi Schlatte @ 2009-07-07 13:14 ` Carsten Dominik 0 siblings, 0 replies; 4+ messages in thread From: Carsten Dominik @ 2009-07-07 13:14 UTC (permalink / raw) To: Rudi Schlatte; +Cc: emacs-orgmode Hi Rudi, I have applied your patch. I agree that it is too small to cause copyright problems. Thanks - Carsten On Jul 7, 2009, at 3:01 PM, Rudi Schlatte wrote: > On 06.07.2009, at 17:49, Carsten Dominik wrote: >> On Jul 6, 2009, at 12:06 PM, Rudi Schlatte wrote: >> >>> Greetings, >>> >>> I run emacs cvs head and the org-mode that is bundled with it. >>> Visual-line-mode is turned on. >>> >>> The display part of visual-line-mode (breaking long lines into >>> paragraphs visually) works as expected, but C-a (org-beginning-of- >>> line) jumps to the start of the paragraph (i.e. start of the >>> "physical" line). It would be nice if C-a jumped to the beginning >>> of the screen line. >>> >>> Cheers, and thanks for an excellent tool for writing! >> >> You can get back the emacs 23 way of doing things with >> >> (add-hook 'org-mode-hook >> (lambda () >> (define-key org-mode-map "\C-a" 'move-beginning-of-line) >> (define-key org-mode-map "\C-a" 'move-end-of-line))) >> >> I personally don't like visual line mode at all, because much >> of what I am doing is line-based stuff (source code, for example, >> or headlines in Org), and I want these commands to got to >> syntactic positions, not visual positions that depend on the >> width of my window. > > Thanks for the quick reply! Fwiw, I agree about the drawbacks of > visual-line-mode, but somewhat to my surprise I found that I like it > in text modes, so I turn it on conditionally in text-mode-hook. > > On the other hand, I use org-special-ctrl-a/e as well. So I hacked > in treatment of line-move-visual at the beginnings of org-{beginning| > end}-of-line (sorry no unified diff, just pasted the function > beginnings): > > (defun org-beginning-of-line (&optional arg) > "Go to the beginning of the current line. If that is invisible, > continue > to a visible line beginning. This makes the function of C-a more > intuitive. > If this is a headline, and `org-special-ctrl-a/e' is set, ignore > tags on the > first attempt, and only move to after the tags when the cursor is > already > beyond the end of the headline." > (interactive "P") > (let ((pos (point)) refpos) > (if line-move-visual > (beginning-of-visual-line 1) > (beginning-of-line 1)) > (if (and arg (fboundp 'move-beginning-of-line)) > [...] > > and > > (defun org-end-of-line (&optional arg) > "Go to the end of the line. > If this is a headline, and `org-special-ctrl-a/e' is set, ignore > tags on the > first attempt, and only move to after the tags when the cursor is > already > beyond the end of the headline." > (interactive "P") > (if (or (not org-special-ctrl-a/e) > (not (org-on-heading-p)) > arg) > (call-interactively (cond (line-move-visual 'end-of-visual-line) > ((fboundp 'move-end-of-line) 'move- > end-of-line) > (t 'end-of-line))) > (let ((pos (point))) > (beginning-of-line 1) > [...] > > For emacsen <23, the check for line-move-visual should use boundp or > bound-and-true-p, of course. > > I believe these changes count as trivial w.r.t. copyright > assignment, should you decide to merge them (which I'd be happy if > you did, of course :) ). > > Greetings, > > Rudi > ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-07-07 13:15 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-07-06 10:06 org-beginning-of-line vs visual-line-mode Rudi Schlatte 2009-07-06 15:49 ` Carsten Dominik 2009-07-07 13:01 ` Rudi Schlatte 2009-07-07 13:14 ` Carsten Dominik
Code repositories for project(s) associated with this external index https://git.savannah.gnu.org/cgit/emacs.git https://git.savannah.gnu.org/cgit/emacs/org-mode.git This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.