From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Christopher W. Ryan" Subject: Re: can I force all-caps in part of a headline in a capture template? Date: Mon, 07 May 2012 08:28:37 -0400 Message-ID: <4FA7BFF5.6010302@binghamton.edu> References: <4FA7155C.5000306@binghamton.edu> <87fwbc66dr.fsf@berkeley.edu> <87bom065bq.fsf@berkeley.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:39516) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRN3S-0007UH-V6 for emacs-orgmode@gnu.org; Mon, 07 May 2012 08:28:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SRN3R-0000gs-3i for emacs-orgmode@gnu.org; Mon, 07 May 2012 08:28:42 -0400 Received: from hrndva-omtalb.mail.rr.com ([71.74.56.122]:23091) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRN3Q-0000cL-Vc for emacs-orgmode@gnu.org; Mon, 07 May 2012 08:28:41 -0400 In-Reply-To: <87bom065bq.fsf@berkeley.edu> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Richard, this is great! Thank you. --Chris Richard Lawrence wrote: > Richard Lawrence 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 > >