From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Lawrence 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 Message-ID: <87bom065bq.fsf@berkeley.edu> References: <4FA7155C.5000306@binghamton.edu> <87fwbc66dr.fsf@berkeley.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([208.118.235.92]:52611) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SREbJ-0002X5-Lm for emacs-orgmode@gnu.org; Sun, 06 May 2012 23:27:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SREbH-0002iS-Oj for emacs-orgmode@gnu.org; Sun, 06 May 2012 23:27:05 -0400 Received: from plane.gmane.org ([80.91.229.3]:39663) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SREbH-0002i4-Hu for emacs-orgmode@gnu.org; Sun, 06 May 2012 23:27:03 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SREbD-000546-Sa for emacs-orgmode@gnu.org; Mon, 07 May 2012 05:26:59 +0200 Received: from c-67-164-33-170.hsd1.ca.comcast.net ([67.164.33.170]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 07 May 2012 05:26:59 +0200 Received: from richard.lawrence by c-67-164-33-170.hsd1.ca.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 07 May 2012 05:26:59 +0200 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 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