From mboxrd@z Thu Jan 1 00:00:00 1970 From: James TD Smith Subject: Re: Suggestion with bad patch for org-remember-templates Date: Sat, 3 Jan 2009 18:45:36 +0000 Message-ID: <20090103184536.GA2267@yog-sothoth.mohorovi.cc> References: 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 1LJBVH-0006KB-RO for emacs-orgmode@gnu.org; Sat, 03 Jan 2009 13:45:43 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LJBVG-0006Jz-CY for emacs-orgmode@gnu.org; Sat, 03 Jan 2009 13:45:43 -0500 Received: from [199.232.76.173] (port=51440 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LJBVG-0006Jw-3m for emacs-orgmode@gnu.org; Sat, 03 Jan 2009 13:45:42 -0500 Received: from 81-86-40-42.dsl.pipex.com ([81.86.40.42]:54186 helo=yog-sothoth.mohorovi.cc) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LJBVF-0002AC-EB for emacs-orgmode@gnu.org; Sat, 03 Jan 2009 13:45:41 -0500 Received: from yog-sothoth.mohorovi.cc (localhost [127.0.0.1]) by yog-sothoth.mohorovi.cc (8.14.2/8.14.2) with ESMTP id n03Ijach026054 for ; Sat, 3 Jan 2009 18:45:36 GMT (envelope-from ahktenzero@mohorovi.cc) Received: (from ahktenzero@localhost) by yog-sothoth.mohorovi.cc (8.14.2/8.14.2/Submit) id n03IjaTL026053 for emacs-orgmode@gnu.org; Sat, 3 Jan 2009 18:45:36 GMT (envelope-from ahktenzero@mohorovi.cc) Content-Disposition: inline In-Reply-To: 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 list Hi Carsten and Wes, On 2009-01-03 18:26:16(+0100), Carsten Dominik wrote: > Hi Wes, > > yes, a better display of the remember template options would be useful. > However, right now the remember interface, because I believe that > James is working on a rewrite of the remember integration. Maybe he > wants to put this on his list? > > - Carsten The selection interface will need to be redesigned anyway to cope with multi-stage selection. Using the remember buffer to display the available templates makes sense, I also like the idea of using a tabular layout. I am still working on the remember rewrite. Unfortunately I haven't been able to devote as much time to it as I had wanted, so it's still not ready for wider testing. I think I'm about 2/3rds of the way through the refactoring and adding plist templates. I have auto-expanding minibuffers turned on (Emacs 22.2) and haven't noticed any problems with them, so I'd suggest Wes give them another try. > On Dec 31, 2008, at 4:39 PM, Wes Hardaker wrote: > > > 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 -- |---|