From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matiyam Subject: Modify org-remember-templates to include a name to show when selecting it Date: Wed, 10 Oct 2007 12:15:30 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart7208318.uAxhEWDQ7E" Content-Transfer-Encoding: 7Bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IfYds-0006Tf-O2 for emacs-orgmode@gnu.org; Wed, 10 Oct 2007 06:18:16 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IfYds-0006TP-1i for emacs-orgmode@gnu.org; Wed, 10 Oct 2007 06:18:16 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IfYdr-0006TH-QC for emacs-orgmode@gnu.org; Wed, 10 Oct 2007 06:18:15 -0400 Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IfYdr-00088Q-6s for emacs-orgmode@gnu.org; Wed, 10 Oct 2007 06:18:15 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1IfYdV-0002KK-G3 for emacs-orgmode@gnu.org; Wed, 10 Oct 2007 10:17:53 +0000 Received: from 195.55.69.66 ([195.55.69.66]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 10 Oct 2007 10:17:53 +0000 Received: from matiyam by 195.55.69.66 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 10 Oct 2007 10:17:53 +0000 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --nextPart7208318.uAxhEWDQ7E Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8Bit Hi! In my setup i have 5 org-remember-templates. Since my memory is not very good :), i have modified org-remember-templates to include another element in the list that tells me the name of it. And then org-remember-apply-template to, when prompting for selecting the template, show the name along with the keycode. Something like: Select template: Work (w) Home (h) I think the patch is easy enough, so i haven't created a bug. I hope this helps somebody. Thanks for org-mode, it's helping me a lot!!! -- M ----------------------------------------------- === modified file 'org.el' --- org.el 2007-10-10 09:37:27 +0000 +++ org.el 2007-10-10 10:05:28 +0000 @@ -1411,11 +1411,14 @@ (defcustom org-remember-templates nil "Templates for the creation of remember buffers. When nil, just let remember make the buffer. -When not nil, this is a list of 4-element lists. In each entry, the first +When not nil, this is a list of 5-element lists. In each entry, the first element is a character, a unique key to select this template. -The second element is the template. The third element is optional and can +The second element is a string that will appear when you are prompted to +select which template to use, so it's easier to choose one when you have +more than a couple of them. +The third element is the template. The fourth element is optional and can specify a destination file for remember items created with this template. -The default file is given by `org-default-notes-file'. An optional forth +The default file is given by `org-default-notes-file'. An optional fifth element can specify the headline in that file that should be offered first when the user is asked to file the entry. The default headline is given in the variable `org-remember-default-headline'. @@ -12445,10 +12448,10 @@ (t (message "Select template: %s" (mapconcat - (lambda (x) (char-to-string (car x))) + (lambda (x) (format "%s (%s)" (cadr x) (char-to-string (car x)))) org-remember-templates " ")) (read-char-exclusive))))) - (entry (cdr (assoc char org-remember-templates))) + (entry (cddr (assoc char org-remember-templates))) (tpl (car entry)) (plist-p (if org-store-link-plist t nil)) (file (if (and (nth 1 entry) (stringp (nth 1 entry)) -------------------------------------------- --nextPart7208318.uAxhEWDQ7E Content-Type: text/x-diff; name="patch-org-remember-apply-template.txt" Content-Transfer-Encoding: 8Bit Content-Disposition: attachment; filename="patch-org-remember-apply-template.txt" === modified file 'org.el' --- org.el 2007-10-10 09:37:27 +0000 +++ org.el 2007-10-10 10:05:28 +0000 @@ -1411,11 +1411,14 @@ (defcustom org-remember-templates nil "Templates for the creation of remember buffers. When nil, just let remember make the buffer. -When not nil, this is a list of 4-element lists. In each entry, the first +When not nil, this is a list of 5-element lists. In each entry, the first element is a character, a unique key to select this template. -The second element is the template. The third element is optional and can +The second element is a string that will appear when you are prompted to +select which template to use, so it's easier to choose one when you have +more than a couple of them. +The third element is the template. The fourth element is optional and can specify a destination file for remember items created with this template. -The default file is given by `org-default-notes-file'. An optional forth +The default file is given by `org-default-notes-file'. An optional fifth element can specify the headline in that file that should be offered first when the user is asked to file the entry. The default headline is given in the variable `org-remember-default-headline'. @@ -12445,10 +12448,10 @@ (t (message "Select template: %s" (mapconcat - (lambda (x) (char-to-string (car x))) + (lambda (x) (format "%s (%s)" (cadr x) (char-to-string (car x)))) org-remember-templates " ")) (read-char-exclusive))))) - (entry (cdr (assoc char org-remember-templates))) + (entry (cddr (assoc char org-remember-templates))) (tpl (car entry)) (plist-p (if org-store-link-plist t nil)) (file (if (and (nth 1 entry) (stringp (nth 1 entry)) --nextPart7208318.uAxhEWDQ7E Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --nextPart7208318.uAxhEWDQ7E--