emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] improve doc for org-use-speed-commands
@ 2013-10-23  9:08 Oleh
  2013-11-05 16:34 ` Bastien
  0 siblings, 1 reply; 4+ messages in thread
From: Oleh @ 2013-10-23  9:08 UTC (permalink / raw)
  To: org mode

[-- Attachment #1: Type: text/plain, Size: 333 bytes --]

Hi all,

I have my headings abbreviated to one star and often
instead of executing org-speed-command, I get a letter inserted
because the point isn't exactly at the beginning of line.

Problem is solved by setting `org-use-speed-commands' to an appropriate
lambda. I attach a patch to add this lambda to the docstring.

regards
Oleh

[-- Attachment #2: 0001-lisp-org.el-add-an-example-for-org-use-speed-command.patch --]
[-- Type: application/octet-stream, Size: 974 bytes --]

From 91b82c7ecb1ed5f32a46dc8510118e386a8077d6 Mon Sep 17 00:00:00 2001
From: Oleh Krehel <ohwoeowho@gmail.com>
Date: Wed, 23 Oct 2013 11:00:53 +0200
Subject: [PATCH] lisp/org.el: add an example for `org-use-speed-commands'
 docstring.

---
 lisp/org.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 55fdd3c..3467646 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -1002,7 +1002,11 @@ new-frame        Make a new frame each time.  Note that in this case
 (defcustom org-use-speed-commands nil
   "Non-nil means activate single letter commands at beginning of a headline.
 This may also be a function to test for appropriate locations where speed
-commands should be active."
+commands should be active.
+
+For example:
+  (setq org-use-speed-commands
+      (lambda () (and (looking-at org-outline-regexp) (looking-back \"^\\**\"))))"
   :group 'org-structure
   :type '(choice
 	  (const :tag "Never" nil)
-- 
1.8.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] improve doc for org-use-speed-commands
  2013-10-23  9:08 [PATCH] improve doc for org-use-speed-commands Oleh
@ 2013-11-05 16:34 ` Bastien
  2013-11-05 17:44   ` Oleh
  0 siblings, 1 reply; 4+ messages in thread
From: Bastien @ 2013-11-05 16:34 UTC (permalink / raw)
  To: Oleh; +Cc: org mode

Hi Oleh,

Oleh <ohwoeowho@gmail.com> writes:

> I have my headings abbreviated to one star and often
> instead of executing org-speed-command, I get a letter inserted
> because the point isn't exactly at the beginning of line.
>
> Problem is solved by setting `org-use-speed-commands' to an appropriate
> lambda. I attach a patch to add this lambda to the docstring.

I think having an example is fine, but it'd be nice to tell the users
what the lambda is exactly doing.  Can you add a line about this and
resend the patch?

Thanks!

-- 
 Bastien

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] improve doc for org-use-speed-commands
  2013-11-05 16:34 ` Bastien
@ 2013-11-05 17:44   ` Oleh
  2013-11-05 18:15     ` Bastien
  0 siblings, 1 reply; 4+ messages in thread
From: Oleh @ 2013-11-05 17:44 UTC (permalink / raw)
  To: Bastien; +Cc: org mode

[-- Attachment #1: Type: text/plain, Size: 690 bytes --]

Hi Bastien,

Here's the updated patch.

regards,
Oleh

On Tue, Nov 5, 2013 at 5:34 PM, Bastien <bzg@gnu.org> wrote:
> Hi Oleh,
>
> Oleh <ohwoeowho@gmail.com> writes:
>
>> I have my headings abbreviated to one star and often
>> instead of executing org-speed-command, I get a letter inserted
>> because the point isn't exactly at the beginning of line.
>>
>> Problem is solved by setting `org-use-speed-commands' to an appropriate
>> lambda. I attach a patch to add this lambda to the docstring.
>
> I think having an example is fine, but it'd be nice to tell the users
> what the lambda is exactly doing.  Can you add a line about this and
> resend the patch?
>
> Thanks!
>
> --
>  Bastien

[-- Attachment #2: 0001-lisp-org.el-add-an-example-for-org-use-speed-command.patch --]
[-- Type: text/x-patch, Size: 1074 bytes --]

From d57aa803e80995b0f74c9aba63903447a6df7382 Mon Sep 17 00:00:00 2001
From: Oleh Krehel <ohwoeowho@gmail.com>
Date: Wed, 23 Oct 2013 11:00:53 +0200
Subject: [PATCH] lisp/org.el: add an example for `org-use-speed-commands'
 docstring.

---
 lisp/org.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 647ed33..04f12de 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -1010,7 +1010,13 @@ new-frame        Make a new frame each time.  Note that in this case
 (defcustom org-use-speed-commands nil
   "Non-nil means activate single letter commands at beginning of a headline.
 This may also be a function to test for appropriate locations where speed
-commands should be active."
+commands should be active.
+
+For example, to make the speed commands active whenever point is on
+any star which is part of the headline:
+
+  (setq org-use-speed-commands
+      (lambda () (and (looking-at org-outline-regexp) (looking-back \"^\\**\"))))"
   :group 'org-structure
   :type '(choice
 	  (const :tag "Never" nil)
-- 
1.8.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] improve doc for org-use-speed-commands
  2013-11-05 17:44   ` Oleh
@ 2013-11-05 18:15     ` Bastien
  0 siblings, 0 replies; 4+ messages in thread
From: Bastien @ 2013-11-05 18:15 UTC (permalink / raw)
  To: Oleh; +Cc: org mode

Oleh <ohwoeowho@gmail.com> writes:

> Here's the updated patch.

Applied with some minor edits and a ChangeLog, thanks!

-- 
 Bastien

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-11-05 18:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-23  9:08 [PATCH] improve doc for org-use-speed-commands Oleh
2013-11-05 16:34 ` Bastien
2013-11-05 17:44   ` Oleh
2013-11-05 18:15     ` Bastien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).