29 Apr 10:49
Re: sortm arguments
From: Henrik Frisk <henrik.frisk <at> mhm.lu.se>
Subject: Re: sortm arguments
Newsgroups: gmane.mail.mh-e.user
Date: 2008-04-29 08:49:20 GMT
Subject: Re: sortm arguments
Newsgroups: gmane.mail.mh-e.user
Date: 2008-04-29 08:49:20 GMT
> > (defun my-mh-sort-folder (arg) > > "Sort current folder by subject or sender." > > (interactive "p") > > (if (= 1 arg) > > (setq mh-sortm-args '(-textfield subject -limit 0))) > > (if (= 2 arg) > > (setq mh-sortm-args '(-textfield from -limit 0))) > > (mh-sort-folder 4)) > > Generally, local variables are preferred in this kind of usage to avoid > unintentional side-effects: > > (let (mh-sortm-args (cond ((= 1 arg) > '(-textfield subject -limit 0)) > ((= 2 arg) > '(-textfield from -limit 0)))) > (mh-sort-folder 4)) > I see your point, thanks! Perhaps obvious, I'm just starting to get aquainted with emacs Lisp... I figured the best way to learn is to get my hands dirty with it. I realize this is getting a little off topic but running the function now results in the error: `let' bindings can have only one value-form: cond, ((= 1 arg) (quote (-textfield subject -limit 0))), ((= 2 arg) (quote (-textfield from -limit 0))) /h ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
RSS Feed