emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Xebar Saram <zeltakc@gmail.com>
To: Richard Lawrence <richard.lawrence@berkeley.edu>
Cc: org mode <emacs-orgmode@gnu.org>
Subject: Re: A simple way to search only headlines
Date: Fri, 7 Jun 2013 20:05:21 -0400	[thread overview]
Message-ID: <CAOQHXPrKceyZO1mmA=MFKZDqr+uXu-_AuP7GtLWeEoCOgZuDKA@mail.gmail.com> (raw)
In-Reply-To: <87mwr1egjr.fsf@berkeley.edu>

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

Hi Richard

Fantastic, thx alot for the code snippet and detailed explanation, it
really helps to understand what goes on. unfortunately i get an error:

Wrong type argument: commandp, (lambda nil (org-agenda nil "s" "<"))

any clue?

best

Z.


On Fri, Jun 7, 2013 at 5:50 PM, Richard Lawrence <
richard.lawrence@berkeley.edu> wrote:

> Xebar Saram <zeltakc@gmail.com> writes:
>
> > Thank you both Thorsten and Seb, i really appreciate the help!
> >
> > Seb, you wrote: The programming equivalent to C-c a s is:
> >
> >     (org-agenda nil "s")
> >
> > That's what you'd have to bind to a key (using a "lambda" function).
> >
> > im a complete neewb and dont really have any idea on how to do the above,
> > can you show me an example?
>
> I think you're looking for something like:
>
> (define-key org-mode-map (kbd "C-M-h") (lambda () (org-agenda nil "s"
> "<")))
>
> You could put a line like that in your .emacs.  Here's what it does:
> #+BEGIN_SRC emacs-lisp
> (define-key    ;; insert a new keybinding
>   org-mode-map ;; into the Org mode map (so this won't affect bindings in
> non-Org buffers)
>
>   ;; This is the key we're binding: C-M-h, for "headline" search
>   ;; You can use whatever key you like, but you might want to check first
> that it isn't
>   ;; already bound to something else (e.g., via C-h k from an Org buffer).
>   ;; The kbd macro converts a string representation to the appropriate key
> code.
>   (kbd "C-M-h")
>
>   ;; This is the function to run when the key is pressed.  The lambda
>   ;; form creates an anonymous function which calls org-agenda with
>   ;; the "s" argument and a restriction to current buffer.
>   (lambda () (org-agenda nil "s" "<")))
> #+END_SRC
>
> Best,
> Richard
>
>
>

[-- Attachment #2: Type: text/html, Size: 2587 bytes --]

  reply	other threads:[~2013-06-08  0:05 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-01 16:35 A simple way to search only headlines Xebar Saram
2013-06-01 20:10 ` Tassilo Horn
2013-06-03  7:48   ` Sebastien Vauban
2013-06-03 12:16     ` Xebar Saram
2013-06-04  7:18       ` Thorsten Jolitz
2013-06-04  7:50       ` Sebastien Vauban
2013-06-07 20:31         ` Xebar Saram
2013-06-07 21:50           ` Richard Lawrence
2013-06-08  0:05             ` Xebar Saram [this message]
2013-06-08  0:34               ` Richard Lawrence
2013-06-08  5:25             ` Nick Dokos
2013-06-10  7:34               ` Sebastien Vauban
2013-06-10 13:06                 ` Nick Dokos
2013-06-10 15:04                   ` Sebastien Vauban
2013-06-11  4:31                     ` Nick Dokos
2013-06-11 12:27                       ` Suvayu Ali
2013-06-11 14:42                         ` Thorsten Jolitz
2013-06-11 22:01                           ` Suvayu Ali
2013-06-11 23:55                             ` Thorsten Jolitz

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='CAOQHXPrKceyZO1mmA=MFKZDqr+uXu-_AuP7GtLWeEoCOgZuDKA@mail.gmail.com' \
    --to=zeltakc@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=richard.lawrence@berkeley.edu \
    /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).