From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Lawrence Subject: Re: A simple way to search only headlines Date: Fri, 07 Jun 2013 14:50:48 -0700 Message-ID: <87mwr1egjr.fsf@berkeley.edu> References: <87sj11a8yq.fsf@thinkpad.tsdh.de> <86y5arocrz.fsf@somewhere.org> <86k3mae2mo.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41880) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ul4gZ-0007Ap-3h for emacs-orgmode@gnu.org; Fri, 07 Jun 2013 17:59:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ul4gY-00067K-6I for emacs-orgmode@gnu.org; Fri, 07 Jun 2013 17:59:03 -0400 Received: from plane.gmane.org ([80.91.229.3]:37588) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ul4gX-00067E-Vt for emacs-orgmode@gnu.org; Fri, 07 Jun 2013 17:59:02 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Ul4gX-0004Vn-92 for emacs-orgmode@gnu.org; Fri, 07 Jun 2013 23:59:01 +0200 Received: from c-50-161-39-52.hsd1.ca.comcast.net ([50.161.39.52]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 07 Jun 2013 23:59:01 +0200 Received: from richard.lawrence by c-50-161-39-52.hsd1.ca.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 07 Jun 2013 23:59:01 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Xebar Saram 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