From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Samuel Wales Newsgroups: gmane.emacs.help Subject: Re: operations on path lists Date: Sat, 4 Feb 2023 14:49:42 -0700 Message-ID: References: <87y1pdkg6p.fsf@dataswamp.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22314"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 04 22:50:32 2023 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pOQQa-0005bP-12 for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 04 Feb 2023 22:50:32 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pOQPy-0006mx-Eq; Sat, 04 Feb 2023 16:49:54 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pOQPs-0006me-Lz for help-gnu-emacs@gnu.org; Sat, 04 Feb 2023 16:49:48 -0500 Original-Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pOQPq-00020p-Qu for help-gnu-emacs@gnu.org; Sat, 04 Feb 2023 16:49:48 -0500 Original-Received: by mail-lf1-x135.google.com with SMTP id j17so12699857lfr.3 for ; Sat, 04 Feb 2023 13:49:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:references:in-reply-to:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=GyWeP0e0LLrhMqG34OrI/4lAyV1/WlFHBTlXUTEOG4I=; b=kOy0ADZYcDYqbFPWL7IHfx+F1M9/QeugtInRd6pEH7CB7wpS96FkUtunw2i9DgwSde UssKgcccWdiKgmeHU1hFFJuREysyK6BQsljXShZyW6eIZ5jtsSlRmyR4bhY0griMyxYU YEE9ygo2twNCPf2EQJp3he6Yls82p536n5WxLx3Sg1WnGMNPpY2VL8xTfPa+X8OLIBMM f1qOHRRUlYI8wgeG1oOCerEzzNctN1j459rANc2AnCCA7g3+EJdEhb9Rq3C858n8QEam 7NHlNBUzshxD5ipTdn9q4mdyB/kDKDFL6LvzcnescL9QAMwkR2iazJKMNBOWuCbfxWkM 1kuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:references:in-reply-to:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GyWeP0e0LLrhMqG34OrI/4lAyV1/WlFHBTlXUTEOG4I=; b=r5Dt98S9RRYVQCEhz8YFXg2Bj6ZUvyauUZdktd2venuj8wYX+w0Bu7DvxQWBPkbAzG IhHrsFHUL/LPeiAaQc1ytPJo/5Zy9FH8BHDySxFW/5E0Ye25Vg4+71WQcJ6unvIAuP/i 2RwCSIRLgBtBZ+MSc052M/+9L0IBRICXmly00elI0bqcYkt/LCnHmLjvwJj9/OkAaWRk BptBf5zACh2ty1ebq8WXg1eJHDXXsrmH5gsbSBiILINSIF/AHQ4OvqS8cdcbZjtWIwrY clByRFDf4XBwzJF3Mpj6hbpSVkf2bF8oI8nvThFD4Ei+nzDGKzXXHP4YpAGXpfFclc2n Io4A== X-Gm-Message-State: AO0yUKWD1x1E+es6LUSQYmhq2YwLdMIeAx2XxV1MGU3R4GL80TDM2Gnb bjp9m/w6ohSQBYFcQzLvsu3Ov5k9z/uDT/3JoG2EnPEN4r1NgQ== X-Google-Smtp-Source: AK7set8Z0ovw/+RNgziU1mreNJBu2EdU0Dmpxt8Q8VxdJ80gkBv9oR9uGjgh2bjZI56dbvLnn/rhhtP2ddxpjL74O8g= X-Received: by 2002:a19:a405:0:b0:4cb:44bc:980 with SMTP id q5-20020a19a405000000b004cb44bc0980mr2710245lfc.47.1675547384090; Sat, 04 Feb 2023 13:49:44 -0800 (PST) Original-Received: by 2002:aa6:c266:0:b0:23b:5e81:46ba with HTTP; Sat, 4 Feb 2023 13:49:42 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::135; envelope-from=samologist@gmail.com; helo=mail-lf1-x135.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:142604 Archived-At: 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 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 wrote: >> * Emanuel Berg [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