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:44:24 -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="36520"; 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:45:13 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 1pOQLR-0009IA-Lb for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 04 Feb 2023 22:45:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pOQKm-00066Y-Kp; Sat, 04 Feb 2023 16:44:32 -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 1pOQKk-000667-R8 for help-gnu-emacs@gnu.org; Sat, 04 Feb 2023 16:44:30 -0500 Original-Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pOQKi-0001Cw-V4 for help-gnu-emacs@gnu.org; Sat, 04 Feb 2023 16:44:30 -0500 Original-Received: by mail-lf1-x134.google.com with SMTP id j17so12689242lfr.3 for ; Sat, 04 Feb 2023 13:44:28 -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=tfhO0MvY/8ttt3bilAONUKvBZp+ZNZ7BxxUN6WiHP8k=; b=fn82V8q2W2mY1SmMPuarBHPMgDMDhmZQeQUN3KyDBeiIO44m0G28bXO4gtn4Yx3e8x bBfgmq4oUYHhcLPkv5+kZFx+OcoXP4z4u575ivqr2xtEaeNqTRs9OrdMrLoo44RYSs9J FmfVSYysUXhZBi+KHczCDWxSlJ+XI7QDkrT1QCrDb/ZCxCtlxiB6kTCNPLXCN1sXg6JC 1JZhbvfKnYU6ESSXCMpflTrCgCMEW268J5FZvjejO8ASGMLXz1el4KY2llJbyhRvVeAK Rv5TQpa226VD1hHNOXext3ii3OIeYgfpYsxqfZFl5QEnWCPfKGC2jFWobOfyMPo94Ggh yipQ== 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=tfhO0MvY/8ttt3bilAONUKvBZp+ZNZ7BxxUN6WiHP8k=; b=Wxv56NBSiX+iYSZXzcuTFgmq3ZP+SAdC53YbWDtHctbERUnavYcqr9/ZDFyInvogB1 G4KwXXGgvxX+K6j3AKVbfpKEMLeQSKBF4ZJHwAE1odaEvxTsrFQlt3bSxuZQqrtGnVVa baNnf1qMikp3vI5bJQAQLcZ7KYNOwS8AlDBBVBhtTiobBXejOvgCuXWKRs275mXAX4Ho AsJO+mVxONvttvNLX8CMwHsFWpTAua/VA1eNDSkN01TisP2BAd2AsYrAH7r+zsCgzHYb RfOhg0ktDsJn/p/0qU/YYthxZ4cX+ScEF3uQCb86eK3xtjRQbuOOIg4v+JB+M12mtAVo HmcA== X-Gm-Message-State: AO0yUKUcCQl3iVgzO9YTzFGq7564us672eqKcQwfRnDq205YvioPGdrE VNl4x2DahfRx5x+2rRtrSzrOAdUqGlrOYm+qQyQb0qAkEeE+Fw== X-Google-Smtp-Source: AK7set/kderp5f4w2uBPLLe+Zi5M77dwgDyN79MtFwCrGGCZmMiPDV2ReIyUgPvDvr1m/Uz3ZgkcPkzuIhbpACfwjvc= X-Received: by 2002:ac2:5633:0:b0:4d5:a736:8665 with SMTP id b19-20020ac25633000000b004d5a7368665mr2640141lff.11.1675547065677; Sat, 04 Feb 2023 13:44:25 -0800 (PST) Original-Received: by 2002:aa6:c266:0:b0:23b:5e81:46ba with HTTP; Sat, 4 Feb 2023 13:44:24 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::134; envelope-from=samologist@gmail.com; helo=mail-lf1-x134.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:142603 Archived-At: 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