From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wes Hardaker Subject: Suggestion with bad patch for org-remember-templates Date: Wed, 31 Dec 2008 07:39:18 -0800 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LI3AL-0006w1-7g for emacs-orgmode@gnu.org; Wed, 31 Dec 2008 10:39:25 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LI3AJ-0006vp-JQ for emacs-orgmode@gnu.org; Wed, 31 Dec 2008 10:39:24 -0500 Received: from [199.232.76.173] (port=39230 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LI3AJ-0006vm-Du for emacs-orgmode@gnu.org; Wed, 31 Dec 2008 10:39:23 -0500 Received: from dcn236-43.dcn.davis.ca.us ([168.150.236.43]:33392 helo=wes.hardakers.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LI3AI-00030V-OB for emacs-orgmode@gnu.org; Wed, 31 Dec 2008 10:39:23 -0500 Received: from localhost (wlap.dyn.hardakers.net [127.0.0.1]) by wes.hardakers.net (Postfix) with ESMTP id 3FDF639A0FF for ; Wed, 31 Dec 2008 07:39:18 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org My templates for remind are numerous. So much that they don't fit in a single mini-buffer line (and I stopped using auto-expanding minibuffers years ago when I had issues with it; I suspect it's safer now and I just haven't tried again). But anyway, I started thinking: you know... that *Remember* buffer is sitting there open and blank when selecting a template. Can't we put the list of templates there? So I hacked together a quick patch to put the contents in the *Remember* buffer and it works just fine. I'm not an expert elisp hacker as I dabble in it only every few years, hence the reason "bad" is in the subject line. It's also left as an exercise to the reader to make the inserted contents prettier (like a table, rather than one item per line). --- org-remember.el.~1~ 2008-10-25 03:57:02.000000000 -0700 +++ org-remember.el 2008-12-26 06:32:51.000000000 -0800 @@ -286,7 +286,23 @@ (string-to-char org-force-remember-template-char) org-force-remember-template-char)) (t - (message "Select template: %s" + (let ((currbuf (current-buffer))) + (switch-to-buffer remember-buffer t) + (erase-buffer) + (insert "Select template:\n" + (mapconcat + (lambda (x) + (cond + ((not (string-match "\\S-" (nth 1 x))) + (format " [%c]" (car x))) + ((equal (downcase (car x)) + (downcase (aref (nth 1 x) 0))) + (format " [%c]%s" (car x) + (substring (nth 1 x) 1))) + (t (format " [%c]%s" (car x) (nth 1 x))))) + templates " \n")) + (switch-to-buffer currbuf t)) + (message "Select template: %s" (mapconcat (lambda (x) (cond -- "In the bathtub of history the truth is harder to hold than the soap, and much more difficult to find." -- Terry Pratchett