emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Matiyam <matiyam@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Modify org-remember-templates to include a name to show when selecting it
Date: Wed, 10 Oct 2007 12:15:30 +0200	[thread overview]
Message-ID: <fei8ri$3ea$1@sea.gmane.org> (raw)

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

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

--------------------------------------------

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch-org-remember-apply-template.txt --]
[-- Type: text/x-diff; name="patch-org-remember-apply-template.txt", Size: 1758 bytes --]

=== 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))



[-- Attachment #3: Type: text/plain, Size: 204 bytes --]

_______________________________________________
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

             reply	other threads:[~2007-10-10 10:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-10 10:15 Matiyam [this message]
2007-10-10 21:23 ` Modify org-remember-templates to include a name to show when selecting it Rainer Stengele
2007-10-11  7:29 ` Carsten Dominik

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='fei8ri$3ea$1@sea.gmane.org' \
    --to=matiyam@gmail.com \
    --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).