From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joost Kremers Newsgroups: gmane.emacs.help Subject: Re: Select/highlight and *copy* matches of some regex Date: Mon, 27 Jun 2022 23:09:51 +0200 Message-ID: <875yklolp3.fsf@fastmail.fm> References: <82a978f3-e974-4d8f-b87e-5707ffec0b5b@www.fastmail.com> <87pmitvn8x.fsf@rub.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36659"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.6.11; emacs 28.1.50 Cc: help-gnu-emacs@gnu.org To: Stephen Berman Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 27 23:16:22 2022 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 1o5w5k-0009It-3W for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 27 Jun 2022 23:16:22 +0200 Original-Received: from localhost ([::1]:58748 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o5w5i-0005hX-EU for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 27 Jun 2022 17:16:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57290) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5w1q-0004Th-5P for help-gnu-emacs@gnu.org; Mon, 27 Jun 2022 17:12:18 -0400 Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]:38711) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5w1n-0003Ua-M9 for help-gnu-emacs@gnu.org; Mon, 27 Jun 2022 17:12:17 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id B6B605C00E8; Mon, 27 Jun 2022 17:12:11 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 27 Jun 2022 17:12:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm2; t=1656364331; x=1656450731; bh=TSIrS3cbmw IxIItUm0S+9TP5+eo+kh+W09hPXlJ5cY0=; b=UJ0BwmQh8WampECaF6zcaTXiHo PNvPqB+ljLCu1jOGrkLoc7SoEKn3n+BWEnE1Gf/GuTRy7fegnHNAP4E4m/1Y9LDj atAqwZMPD5CF0HkiNlib/buW9E0MlrLwZkuNy33bMXkquQKkGjvX6ZdQOVwmPJHM mIXbUHvlS7bay3uoO0yEtwmJNGH7LtXVI/8xaDln09IhRr47FS4J0yYnxxU1lvh1 7XSS/DjFnhviXgMNU/DFOUC49DT15u4S2FUbVSx+OC8EJJIlojwV8L43pPs6sRjI bb4tUkExHo3an0V1N/qjh0s7+Q8sQY5lAXfbLmAkisLKB7yQyMbebvkVJ4pA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1656364331; x=1656450731; bh=TSIrS3cbmwIxIItUm0S+9TP5+eo+ kh+W09hPXlJ5cY0=; b=SSa4sOMkMFDviTPwqueB9wJ5Ew556kBYAgEgPXHuiQDG 9U/Kywe5bze1tvo93ablrpgbHIAGPclOJmkZwAVd/BOm98oZMlXVqUF3c2DFR3E3 b9hethTIOrgym/0UsZ9iTVj2An57bnQ+xMYJLs9gH8WFAvP3cNWKwzsSuq71tvuI jnjAQ6IXZ9ctQYwdfjWDsneptxD3rNLeMrDAdA4ZIytLo8TgXo2472KECapK4UBZ B1DkCN+fE2ZVL04FwNGM6dedKeovKLbIPjOghsjaWc+2WlwneVCj9GMsWByrTNvG VtvPzE2LqUsrPC1dX9deXwsstysuDndTz3Z+dEW3xw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudeghedgudeiudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpehffgfhvfevufffjgfkgggtsehttdertddtredtnecuhfhrohhmpeflohho shhtucfmrhgvmhgvrhhsuceojhhoohhsthhkrhgvmhgvrhhssehfrghsthhmrghilhdrfh hmqeenucggtffrrghtthgvrhhnpefgiefhuddtteeljeehveekjedtffeuheffhffffeet ieetfeehtdektdeitdekffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehjohhoshhtkhhrvghmvghrshesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Feedback-ID: ie15541ac:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 27 Jun 2022 17:12:10 -0400 (EDT) In-reply-to: <87pmitvn8x.fsf@rub.de> Received-SPF: pass client-ip=66.111.4.26; envelope-from=joostkremers@fastmail.fm; helo=out2-smtp.messagingengine.com 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" Xref: news.gmane.io gmane.emacs.help:138132 Archived-At: On Mon, Jun 27 2022, Stephen Berman wrote: > On Mon, 27 Jun 2022 17:52:48 +0200 Joost wrote: >> The first part, highlighting all matches, is not a problem. But I haven't >> found a way yet to then extract all matches. > > Is this (suitably tweaked) good enough? > > (let ((matches "")) > (while (re-search-forward "lang=.." nil t) > (setq matches (concat matches (match-string 0) "\n"))) > (kill-new matches)) Yeah, it's easy to code something up that collects all matches of some regex is a buffer. I'm just a little surprised that this isn't already possible, from isearch or hi-lock-mode or something... -- Joost Kremers Life has its moments