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: Samuel Wales
Subject: Re: operations on path lists
Date: Sat, 4 Feb 2023 14:49:42 -0700

i should have left out the find altogether.  i eill try to be more
clear next time.  although i really tried.  :]

On 2/4/23, Samuel Wales <samologist@gmail.com> wrote:
> thanks.  i was aware that emacs lisp can do that find.  i was trying
> to be clear about the origin of the path list, so as to help motivate
> the example of a set of lines that, in the case i was omst interested
> in, were fs paths.
>
> also, i put in the sort, but could hae left it out for better
> generality.  but the find could be much more complex and part of
> something that naturally occurs while using the shell in shell mode,
> and further processing like deleting lines can be done.  the point i
> was trying to make is that i have a set of lines.  and the sub-case of
> lines that are paths is what i was most interested in.
>
> and the problem is one of distinguishing the lines so that there is
> more clarity for the user.  and possibly shortcutting.
>
> in other words, i was not asking about find, but about the path lists.
> :]  but thank you for the find code.  :]
>
>
> On 2/4/23, Jean Louis <bugs@gnu.support> wrote:
>> * 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/
>>
>>
>
>
> --
> The Kafka Pandemic
>
> A blog about science, health, human rights, and misopathy:
> https://thekafkapandemic.blogspot.com
>


-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com



reply via email to

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