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: Christopher W. Ryan
Subject: Re: [O] can I force all-caps in part of a headline in a capture template?
Date: Mon, 07 May 2012 08:28:37 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.16) Gecko/20101206 SeaMonkey/2.0.11

Richard, this is great!  Thank you.

--Chris

Richard Lawrence wrote:
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]