help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: operations on path lists


From: Jean Louis
Subject: Re: operations on path lists
Date: Sat, 4 Feb 2023 21:28:14 +0300
User-agent: Mutt/2.2.9+54 (af2080d) (2022-11-21)

* Emanuel Berg <incal@dataswamp.org> [2023-02-04 17:55]:
> Jean Louis wrote:
> 
> > (cond ((file-directory-p file) (expand-file-name file))
> >       (t nil))
> 
> (when (file-directory-p file)
>   (expand-file-name file) )

I am aware of it, I prefer using `cond' as I get more clarity. 

You may get more clarity with `when'.

Btw. it reminds me that I also have `rcd-unless':

(defmacro rcd-unless (condition &optional message &rest body)
  (declare (indent 2))
  `(cond (,condition
          ,@body)
         (t (rcd-message ,message))))

So I use it this way:

(rcd-unless nil
    "Cannot execute"
  (message "OK I execute"))

I am not sure if I will keep it, but I like it. `rcd-message' you can replace 
with `message' to understand it.

As often I have situation where in the `unless' condition I want to tell to 
user "why" it does not work. So message is displayed in mini buffer.


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]