* suggestion: M-m should move point to first word on line
@ 2013-02-08 2:42 Meng Weng Wong
2013-02-08 4:35 ` Yagnesh Raghava Yakkala
2013-02-11 15:15 ` Bastien
0 siblings, 2 replies; 7+ messages in thread
From: Meng Weng Wong @ 2013-02-08 2:42 UTC (permalink / raw)
To: emacs-orgmode@gnu.org Mailing List
Ordinarily, M-m is bound to (back-to-indentation) – move point to the first non-whitespace character on the line. It differs from C-a.
Might it make sense for org-mode to override M-m?
Move the point to the first "user" word on the line, to the first non-asterisk/whitespace/dash/TODO character on the line.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: suggestion: M-m should move point to first word on line
2013-02-08 2:42 suggestion: M-m should move point to first word on line Meng Weng Wong
@ 2013-02-08 4:35 ` Yagnesh Raghava Yakkala
2013-02-11 15:15 ` Bastien
1 sibling, 0 replies; 7+ messages in thread
From: Yagnesh Raghava Yakkala @ 2013-02-08 4:35 UTC (permalink / raw)
To: Meng Weng Wong; +Cc: emacs-orgmode@gnu.org Mailing List
Hello Meng,
On Feb 08 2013, Meng Weng Wong <mengwong@gmail.com> wrote:
> Ordinarily, M-m is bound to (back-to-indentation) – move point to the first
> non-whitespace character on the line. It differs from C-a.
>
> Might it make sense for org-mode to override M-m?
>
> Move the point to the first "user" word on the line, to the first
> non-asterisk/whitespace/dash/TODO character on the line.
Alternatively, you can set `org-special-ctrl-a/e' to t and use C-a for your
desired movement.
Thanks.,
--
ఎందరో మహానుభావులు అందరికి వందనములు.
YYR
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: suggestion: M-m should move point to first word on line
2013-02-08 2:42 suggestion: M-m should move point to first word on line Meng Weng Wong
2013-02-08 4:35 ` Yagnesh Raghava Yakkala
@ 2013-02-11 15:15 ` Bastien
2013-02-12 7:03 ` Eric S Fraga
1 sibling, 1 reply; 7+ messages in thread
From: Bastien @ 2013-02-11 15:15 UTC (permalink / raw)
To: Meng Weng Wong; +Cc: emacs-orgmode@gnu.org Mailing List
[-- Attachment #1: Type: text/plain, Size: 611 bytes --]
Hi Meng Weng,
Meng Weng Wong <mengwong@gmail.com> writes:
> Ordinarily, M-m is bound to (back-to-indentation) – move point to
> the first non-whitespace character on the line. It differs from C-a.
>
> Might it make sense for org-mode to override M-m?
Not to override `M-m' but perhaps to define "*" as a syntactic
whitespace character.
Patch attached -- use with caution. I tested it a bit and it seems
to work, but not all tests pass and there may be side-effects that I
could not observe.
In the meantime, I guess
org-special-ctrl-a
org-special-ctrl-a/e
are useful enough, as already pointed.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: syntax.patch --]
[-- Type: text/x-patch, Size: 441 bytes --]
diff --git a/lisp/org.el b/lisp/org.el
index 4555ed1..d6ae281 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5177,6 +5177,7 @@ The following commands are available:
(org-set-tag-faces 'org-tag-faces org-tag-faces))
;; Calc embedded
(org-set-local 'calc-embedded-open-mode "# ")
+ (modify-syntax-entry ?* " ")
(modify-syntax-entry ?@ "w")
(modify-syntax-entry ?\" "\"")
(if org-startup-truncated (setq truncate-lines t))
[-- Attachment #3: Type: text/plain, Size: 14 bytes --]
--
Bastien
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: suggestion: M-m should move point to first word on line
2013-02-11 15:15 ` Bastien
@ 2013-02-12 7:03 ` Eric S Fraga
2013-02-12 7:33 ` Bastien
0 siblings, 1 reply; 7+ messages in thread
From: Eric S Fraga @ 2013-02-12 7:03 UTC (permalink / raw)
To: Bastien; +Cc: emacs-orgmode@gnu.org Mailing List, Meng Weng Wong
[-- Attachment #1: Type: text/plain, Size: 1165 bytes --]
Bastien <bzg@altern.org> writes:
[...]
> Not to override `M-m' but perhaps to define "*" as a syntactic
> whitespace character.
>
> Patch attached -- use with caution. I tested it a bit and it seems
> to work, but not all tests pass and there may be side-effects that I
> could not observe.
Bastien,
this seems to cause a problem with org-ctrl-c-minus when trying to cycle
a bullet point past +. That is, it works if the bullet is - so you can
cycle to the next which is + but you cannot cycle past that.
I've tried this batch with org up to date a few minutes ago (ignore my
signature info below as this emacs is running a slightly older
org). Emacs was started with -Q.
Debug trace:
,----
| Debugger entered--Lisp error: (args-out-of-range 85 88)
| replace-match(" " nil nil "*" 1)
| org-cycle-list-bullet(nil)
| call-interactively(org-cycle-list-bullet)
| org-ctrl-c-minus()
| call-interactively(org-ctrl-c-minus nil nil)
`----
Point was at column 0 of the first item in the attached minimal org
file.
I hope that's enough info...
Thanks,
eric
--
: Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D
: in Emacs 24.3.50.1 and Org 7.9.3e-975-g1eccd2
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: examplebug.org --]
[-- Type: text/org, Size: 155 bytes --]
#+TITLE: examplebug.org
#+AUTHOR: Eric S Fraga
* cycling list bullet points
+ the first item
+ the second item
+ and the third and last item
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: suggestion: M-m should move point to first word on line
2013-02-12 7:03 ` Eric S Fraga
@ 2013-02-12 7:33 ` Bastien
2013-02-12 22:42 ` Eric S Fraga
2013-02-15 11:02 ` Bastien
0 siblings, 2 replies; 7+ messages in thread
From: Bastien @ 2013-02-12 7:33 UTC (permalink / raw)
To: Eric Fraga; +Cc: emacs-orgmode@gnu.org Mailing List, Meng Weng Wong
[-- Attachment #1: Type: text/plain, Size: 575 bytes --]
Hi Eric,
thanks for testing.
Eric S Fraga <e.fraga@ucl.ac.uk> writes:
> this seems to cause a problem with org-ctrl-c-minus when trying to cycle
> a bullet point past +. That is, it works if the bullet is - so you can
> cycle to the next which is + but you cannot cycle past that.
Attached patch (against master) fixes this problem.
I'm not sure I'm in favor of this change, though, I expect
it to cause other problems and the benefit looks small for
now.
Do you see other reasons than M-m where stars as whitespace
chars are useful? What about *markup*?
Thanks,
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org.el-org-mode-Set-to-be-syntactically-a-whitespace.patch --]
[-- Type: text/x-patch, Size: 1603 bytes --]
From a41bc3569e6812ce0c35e50abfc91590a47919c6 Mon Sep 17 00:00:00 2001
From: Bastien Guerry <bzg@altern.org>
Date: Tue, 12 Feb 2013 08:30:14 +0100
Subject: [PATCH] org.el (org-mode): Set ?* to be syntactically a whitespace
character
* org-list.el (org-list-bullet-string): Don't skip all
whitespace characters, skip whitespace and tab explicitely.
* org.el (org-mode): Set ?* to be syntactically a whitespace
character.
---
lisp/org-list.el | 4 ++--
lisp/org.el | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/lisp/org-list.el b/lisp/org-list.el
index d86746f..e4d6d6d 100644
--- a/lisp/org-list.el
+++ b/lisp/org-list.el
@@ -1081,8 +1081,8 @@ It determines the number of whitespaces to append by looking at
org-list-two-spaces-after-bullet-regexp bullet))
" "
" ")))
- (string-match "\\S-+\\([ \t]*\\)" bullet)
- (replace-match spaces nil nil bullet 1))))
+ (if (string-match "[^ \t]+\\([ \t]*\\)" bullet)
+ (replace-match spaces nil nil bullet 1)))))
(defun org-list-swap-items (beg-A beg-B struct)
"Swap item starting at BEG-A with item starting at BEG-B in STRUCT.
diff --git a/lisp/org.el b/lisp/org.el
index 461cdf0..a58c10b 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5173,6 +5173,7 @@ The following commands are available:
(org-set-tag-faces 'org-tag-faces org-tag-faces))
;; Calc embedded
(org-set-local 'calc-embedded-open-mode "# ")
+ (modify-syntax-entry ?* " ")
(modify-syntax-entry ?@ "w")
(modify-syntax-entry ?\" "\"")
(if org-startup-truncated (setq truncate-lines t))
--
1.8.1.2
[-- Attachment #3: Type: text/plain, Size: 14 bytes --]
--
Bastien
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: suggestion: M-m should move point to first word on line
2013-02-12 7:33 ` Bastien
@ 2013-02-12 22:42 ` Eric S Fraga
2013-02-15 11:02 ` Bastien
1 sibling, 0 replies; 7+ messages in thread
From: Eric S Fraga @ 2013-02-12 22:42 UTC (permalink / raw)
To: Bastien; +Cc: emacs-orgmode@gnu.org Mailing List, Meng Weng Wong
Bastien <bzg@altern.org> writes:
[...]
> I'm not sure I'm in favor of this change, though, I expect
> it to cause other problems and the benefit looks small for
> now.
>
> Do you see other reasons than M-m where stars as whitespace
> chars are useful? What about *markup*?
I have no issues with the current behaviour (i.e. the behaviour without
your patch). I only tried out the patch to see what would happen! ;-) I
never use M-m, relying on C-a (well, org variant actually) to do what I
want.
thanks,
eric
--
: Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D
: in Emacs 24.3.50.1 and Org 7.9.3e-988-g1f8c8d
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: suggestion: M-m should move point to first word on line
2013-02-12 7:33 ` Bastien
2013-02-12 22:42 ` Eric S Fraga
@ 2013-02-15 11:02 ` Bastien
1 sibling, 0 replies; 7+ messages in thread
From: Bastien @ 2013-02-15 11:02 UTC (permalink / raw)
To: Eric Fraga; +Cc: emacs-orgmode@gnu.org Mailing List, Meng Weng Wong
Hi,
Bastien <bzg@altern.org> writes:
> Eric S Fraga <e.fraga@ucl.ac.uk> writes:
>
>> this seems to cause a problem with org-ctrl-c-minus when trying to cycle
>> a bullet point past +. That is, it works if the bullet is - so you can
>> cycle to the next which is + but you cannot cycle past that.
>
> Attached patch (against master) fixes this problem.
I'm not applying this patch. I don't think there is a real
need to make * characters as whitespaces, and checking against
whitespaces syntax chars happens to often in the code for such
a change to be safe.
--
Bastien
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-02-15 11:47 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-08 2:42 suggestion: M-m should move point to first word on line Meng Weng Wong
2013-02-08 4:35 ` Yagnesh Raghava Yakkala
2013-02-11 15:15 ` Bastien
2013-02-12 7:03 ` Eric S Fraga
2013-02-12 7:33 ` Bastien
2013-02-12 22:42 ` Eric S Fraga
2013-02-15 11:02 ` Bastien
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.