From: Richard Lawrence <richard.lawrence@berkeley.edu>
To: emacs-orgmode@gnu.org
Subject: Re: can I force all-caps in part of a headline in a capture template?
Date: Sun, 06 May 2012 20:24:57 -0700 [thread overview]
Message-ID: <87bom065bq.fsf@berkeley.edu> (raw)
In-Reply-To: 87fwbc66dr.fsf@berkeley.edu
Richard Lawrence <richard.lawrence@berkeley.edu> writes:
> Try this: in your .emacs, add the following code:
>
> (defun prompt-for-lastname-and-upcase ()
> (upcase (read-string "Last name: ")))
>
> This defines a function that will prompt the user to type a last name
> into the minibuffer, converts the result into uppercase, and returns it
> as a string.
>
> Then, in your capture template, change "%^{LASTNAME}" to
> "%(prompt-for-lastname-and-upcase)".
By the way, if you need to do the same thing for other fields, you can
do something like this instead:
(defun prompt-and-upcase (prompt-str)
(upcase (read-string prompt-str)))
This generalizes the original function I gave you; you can pass in a
prompt string.
Then, in your capture template, wherever you need an uppercase field:
%(prompt-and-upcase "Whatever prompt you need: ")
e.g.,
%(prompt-and-upcase "Last name: ")
Best,
Richard
next prev parent reply other threads:[~2012-05-07 3:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-07 0:20 can I force all-caps in part of a headline in a capture template? Christopher W. Ryan
2012-05-07 3:02 ` Richard Lawrence
2012-05-07 3:24 ` Richard Lawrence [this message]
2012-05-07 12:28 ` Christopher W. Ryan
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bom065bq.fsf@berkeley.edu \
--to=richard.lawrence@berkeley.edu \
--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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.