emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] can I force all-caps in part of a headline in a capture template


From: Richard Lawrence
Subject: Re: [O] can I force all-caps in part of a headline in a capture template?
Date: Sun, 06 May 2012 20:24:57 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Richard Lawrence <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]