From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: James Thomas Newsgroups: gmane.emacs.help Subject: Re: operations on path lists Date: Sat, 11 Feb 2023 13:48:39 +0530 Message-ID: <87o7q062e8.fsf@gmx.net> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10091"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1.90 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Samuel Wales Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 11 09:17:26 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 1pQl4X-0002Rm-Tw for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 11 Feb 2023 09:17:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pQl4C-00048w-1L; Sat, 11 Feb 2023 03:17:04 -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 1pQl4A-00048m-1o for help-gnu-emacs@gnu.org; Sat, 11 Feb 2023 03:17:02 -0500 Original-Received: from mout.gmx.net ([212.227.15.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQl43-00021G-8Y for help-gnu-emacs@gnu.org; Sat, 11 Feb 2023 03:17:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1676103408; bh=WmW9ce3VVf6dY6zcw6LQOOgPc6jcWn7kWJZ9I+Ggppc=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=ewybwhGejE3uuqtyx1CYeXedJ6s7MfOzkOJuq/OiDy65HwhK5Cg6B/8fvSQSYczS8 OaAR3fYtcj8oIYRCRhMr4GgG2IwHEUlZKkNB5rYERUkb8n/EKoGpGwQhH4DKkp2zcz /vVk4rOuCgT+MH7YA9W4/dLULqdW1sJbLzHgxEk5sy3C2OOD/ESv6QTyzjjvcfxUBw yBHS2/tOa7LOrhQuzOgTIC2TQOQ+Gc02Tj+3h7zSZHugrejjByzLWMA4DbFa0DuP56 C1k8OIZxs8t4TRxpYlYzcJqJAe2j5tCQHFP4HnJt5nJzXVAS1OvS1QMedmI85BIb5K v8xel1KdyOG3w== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from Geek ([117.194.158.196]) by mail.gmx.net (mrgmx005 [212.227.17.184]) with ESMTPSA (Nemesis) id 1Mf0BM-1oxklp3d8c-00gcCs; Sat, 11 Feb 2023 09:16:48 +0100 In-Reply-To: (Samuel Wales's message of "Fri, 3 Feb 2023 22:32:55 -0700") X-Provags-ID: V03:K1:EyR8740oJX+pZ55D5XlemsGsz0kQhOF86MFDbM5aM6q00AdGLtQ zv+xwdyp6geDllK01ja+C4lApouAZFjA/B+jzl1KP3gdiak9NQCG/KyznLl8YtoK707XfRb Bhyn7UxXune/FND1ltJoGtXFvNOYCv0vqRWfe0w9C1RW7+3NuIo4WUpokB7rl52g5CeMhKv IvlTYRRZfL9GkhOCMOhWQ== UI-OutboundReport: notjunk:1;M01:P0:2RBbQAH/W7Q=;5t3o1EQsuO0LVVwNPskIyoBVije QP6lM4QW+57gSXPGqWGUWb0jiyt78v0Y+WMZxguWdFsSTr6QTyKQs6NbkxPoaLwf+FeyIGQUm Fp119SPEA3lXSYaU2vHLVRd7V9a7tfxlXKQLttvmqtmxVC3pL2uxfA/aTAlqnRwICPpyW9IgI Aff5HlZyeOwChePHFMGcV1P3E9lS35fBUizwYQrtbRFGOWFkux0x7DD0tB5w/hQ4kmoVhSJxq EcowmPrruMen4B4hGsynrPnk5TV8kfGqFLOK9yxKKCw2tHb3ZkkJCq7wvg6ePXyYtRJqcXqKn f/vccPedG33Dc5D9L7IxB+jcoBjU5PLrm/dDop3I6lyoCsMcBykTEmzT7+3b37VlSGjRkVLF7 7zOM6DXav3f0yI/QwVlBk3XYXnp2u4V47cA4FzXLXE0MiiA4HeWiyUQwNrjD8enh2FtfGKQam UlgBH3mPO7Dxok8MC4FhmuP8UKnRckQRCjFk82PWDImTxcthL1u3ZEoc2LkeeVG0C+UpbhZ5p FbzAED9y21molFAT8as8DNS7bRE5HzoEKKafHJvB6ooxxQlkQieYxE4ka9QIwTW4LsjPxlN1T KDyeMadeeQ44S80sIueFH1thqH1jN0hhZ32y4M6XcP6jAC0QDd2g1WZ1CIsCycDBQ1ZPcTlsb Limnz6fZMISnPaZFSQnJpp9ZBEad3jTK+iN+dFP8kLi1wywvSOiZQ/gZOOPM7MF1HopfOUi6O WAU6VBOXFfAeUFWac0ZlyAmFcWeQAOyH17/udBkGvi4+NgBAIz2oNKRAENVjU9vdmjzOFb5n Received-SPF: pass client-ip=212.227.15.18; envelope-from=jimjoe@gmx.net; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, 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:142695 Archived-At: Samuel Wales wrote: > 1. shortcut all subsequent paths > > if a path is like ./.../...foo.../.../...foo..., then eliminate that line. > i.e. eliminate paths that have common prefix paths on any previous line. (With point at the beginning, do) M-x replace-regexp RET, then paste the following expression (without quotes - note the newline at the beginning), then RET twice. " .*\(/[^/ ]*foo[^/ ]\).*\1.*$" > 2. highlight adjacent subsequent paths' common components > > if i have paths like > > ./hi/foo > ./hi/there/foo > ./whatever/whatever/foo > > then i want line 2 to have ./hi/ highlighted. i might also like this > one for, not paths, but lines, to show intra-component differences. > but in that case, it might be the difference i want highlghted, and it > need not be a prefix or a suffix. This can also be done with a similar regexp. I suggest you get familiar with "Syntax of Regexps" in the Elisp manual. You will also need this: https://emacs.stackexchange.com/questions/37272/highlight-different-regexp-groups-with-different-colors > and suppose that i want to copy these dirs to another dir, or so. the > components and paths can be long. Additionally, you can set the resulting buffer in dired-virtual-mode (from the dired-x package) and then run: M-: (setq-local directory-listing-before-filename-regexp " +") RET ...to use it as a normal dired buffer (for copying, deleting etc). --