emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Oleh <ohwoeowho@gmail.com>
To: Bastien <bzg@gnu.org>
Cc: org mode <emacs-orgmode@gnu.org>
Subject: Re: [PATCH] improve doc for org-use-speed-commands
Date: Tue, 5 Nov 2013 18:44:00 +0100	[thread overview]
Message-ID: <CAA01p3r5k47Z08ugWAdMTOQ-T-vky2TYxkb8McdAkiiMkNfBbw@mail.gmail.com> (raw)
In-Reply-To: <87a9hiu7ru.fsf@bzg.ath.cx>

[-- 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


  reply	other threads:[~2013-11-05 17:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2013-11-05 18:15     ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAA01p3r5k47Z08ugWAdMTOQ-T-vky2TYxkb8McdAkiiMkNfBbw@mail.gmail.com \
    --to=ohwoeowho@gmail.com \
    --cc=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).