unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Samuel Wales <samologist@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: operations on path lists
Date: Sat, 4 Feb 2023 14:44:24 -0700	[thread overview]
Message-ID: <CAJcAo8u53TRGCcOruSZXtQ_guj84KxUHRCaYTe_D67+Qn4ojVA@mail.gmail.com> (raw)
In-Reply-To: <Y96jvuHPXiXaw8O6@protected.localdomain>

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



  parent reply	other threads:[~2023-02-04 21:44 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-04  5:32 operations on path lists Samuel Wales
2023-02-04  6:32 ` Jean Louis
2023-02-04  8:06   ` Emanuel Berg
2023-02-04 17:21     ` [External] : " Drew Adams
2023-02-04 18:32       ` Jean Louis
2023-02-04 21:51         ` Emanuel Berg
2023-02-07  8:34           ` Jean Louis
2023-02-07 10:26             ` Emanuel Berg
2023-02-07 22:39           ` Jean Louis
2023-02-08  2:48             ` Drew Adams
2023-02-08 18:46               ` Drew Adams
2023-02-08 20:09               ` Jean Louis
2023-02-04 18:28     ` Jean Louis
2023-02-04 21:41       ` Emanuel Berg
2023-02-07  8:33         ` Jean Louis
2023-02-07 10:30           ` Emanuel Berg
2023-02-07 14:55             ` [External] : " Drew Adams
2023-02-07 14:55           ` Drew Adams
2023-02-04 21:44       ` Samuel Wales [this message]
2023-02-04 21:49         ` Samuel Wales
2023-02-04 14:59   ` Emanuel Berg
2023-02-07  7:35     ` Jean Louis
2023-02-07 10:27       ` Emanuel Berg
2023-02-11  8:18 ` James Thomas
2023-02-11 14:02 ` Ruijie Yu via Users list for the GNU Emacs text editor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJcAo8u53TRGCcOruSZXtQ_guj84KxUHRCaYTe_D67+Qn4ojVA@mail.gmail.com \
    --to=samologist@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).