From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Daniel_Mart=C3=ADn?= Newsgroups: gmane.emacs.help Subject: Re: Automatically highlight all same occurrence of same stuff which has been currently marked/selected. Date: Mon, 22 May 2023 13:16:53 +0200 Message-ID: References: <87cz2udugp.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12273"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (darwin) Cc: Hongyi Zhao , help-gnu-emacs To: Philip Kaludercic Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 22 13:17:48 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 1q13Xw-0002zb-OV for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 22 May 2023 13:17:48 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q13XR-00012C-LK; Mon, 22 May 2023 07:17:17 -0400 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 1q13XD-0000zD-NZ for help-gnu-emacs@gnu.org; Mon, 22 May 2023 07:17:10 -0400 Original-Received: from sonic309-24.consmr.mail.ir2.yahoo.com ([77.238.179.82]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q13XB-0000Hs-Ko for help-gnu-emacs@gnu.org; Mon, 22 May 2023 07:17:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1684754216; bh=jqB+tdZ8mzSH3qrL6hu5nOa39KKfFlHXOqWHWQ6dhzw=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=f93A2Npfe370sjS+1Q5JkR87/ODxYyvjzly15rGsXsXGwuqDBZNXhd3oePmy2okVjmPUICYSaoupvZQ+vYZaPQeIpCoogtrOy8b1uMfgWNxD1gL9S489dgVpAlhZs+EXtRmFDlK5rjc/aq2r7UAL0kSDkUGzQ60i2zmTVym8UxzzJfDxtOtAIgLoZ1APSQassF7IpPM9zAfM6f97MG2+3O0vJuR1sj79oP+h8zPyK9BcqRMKCLaAExFzoyj5c4csQZbyaqnPpBOc39gRet4e03VP+trgyN9YY7SWpO73Sqx+lOGFs2+b3AMwzOkMeMZeBb2MVuVUH/FaFH9WXuBnCA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1684754216; bh=1I0RZstbgfkLFZ8XGCLmHxjiqyosp4QYmJsTfsCPiy5=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=EHvahP7K1wfuZ2Gi5iGOcyjjqtmPCMbciQcYaT36IJVq44cvRU5CNXY9iOuN09G7xGAku8YpK8yqR8HVuwUWFipSINPOq7r+ywcohDLBDBhCAVLZUoTH2+/ovCo0PNeErLSvhPgUyNYRojuDehwoDCFaPALJ+n8Le0q+/fgUPdBFz9qg10xol+TjTET7eZZu4/00KxwAn0QZMPVEcl38oZugkR9U/J9l+CNKlZIT0TOwFDyj8uxf2wmrZn2wW+ceQkn622/jrVICUg3YxaJJEdIIug3wtoWzBJ7lc1sWRi5Tkqx/VsWllgAfkDb71XGX4Ygtnd0MBZ7rjd63PbuyYA== X-YMail-OSG: lnQ87hEVM1kkbkon0FLhZ0VOAtO6YA_zH4r7YgDwfQR.Nwl62HJLAW4VpWENOJ0 C1fIwXEDGU_rOirvPo4RE4ar2Yrr14Pb1GiZ5vxQRMD4VYUV2wattzEC37u6.wLrQkuaa.lmhKQw bt.Y9UJA7itGbUfRm34eZsMQ4BS..QFtcoXARdRv7ZBEAJqhEQ9t92clsr64y3J2svW_Z2PNjw6M MuotCD3zZGrfkApRVv7Vy_cEFc0kF6vEGAX_1DdxEaqg6xcWAuypdsjNukEwipT8z417Fu5KNH5b B4r2oRxElfS2pGHmTsgXUWnYdjy5diSRHmSxtMQNGAXP1JWkRn74UQvLK2TCYI6zXPVFIdVUR4cP lnWZRvlhGOuPSxmNkRV5ai4b6OQLpab6rH.6s8L6JpxS5aErSSKXDhc5kl7pzbSJcyDgAtFEMdY8 0sGgL82WGNwat_7nEvanBOVvbkobl8Iez7rRRVA_FOKDkRWEDNxaPWfV348tDfkGWhasgbFuYtM3 M_ZbeSly5xL_u6FsijBPi2hkNotub6YIkeqpVM_Tv_dOo5EVqPGOcA16TGZAFoKTxBpoiUCI5EFa 8CUpgoqD0_HHisfMDXDmKHpArit2aSqXrbURyTJZbCjuaX2xBwdTgm7E.nbc_6CB1gM8PKtNeTYV 7.dgmHjgTEvKcRnesJyDiNBnF8Iq414_HgmqLm8lTOSnMnHJKB48gmh0VWPIME40nI_x4I1LMxRs f5msx.QfIJxAmHK.ikjpF11BYKjojVstCeKLHw4XttDj4v3F_0Z0eWHV8pJM1Sw_MwrrNNfMj5aC hkXwwk9w5KK1zy7U30DFb_sT7m2IcTTd0rEz5grWR7 X-Sonic-MF: X-Sonic-ID: 5c2022e2-ef54-4fbf-8baa-b5bf97316dba Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.ir2.yahoo.com with HTTP; Mon, 22 May 2023 11:16:56 +0000 Original-Received: by hermes--production-ir2-7867f454fc-nvr6n (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 34ad41c0eef36a8821586dcd2eb31fdf; Mon, 22 May 2023 11:16:54 +0000 (UTC) In-Reply-To: <87cz2udugp.fsf@posteo.net> (Philip Kaludercic's message of "Sun, 21 May 2023 07:17:26 +0000") X-Mailer: WebService/1.1.21495 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=77.238.179.82; envelope-from=mardani29@yahoo.es; helo=sonic309-24.consmr.mail.ir2.yahoo.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=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-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:143704 Archived-At: Philip Kaludercic writes: > > I have this command > > ;;;; Search the selected region > (defun site/isearch-region (start end) > "Start isearch with the contents between START and END." > (interactive (if (use-region-p) > (list (region-beginning) (region-end)) > (user-error "No region"))) > (when (and start end) > (deactivate-mark) > (isearch-mode t) > (isearch-yank-string (buffer-substring start end)))) > > (global-set-key (kbd "M-s M-s") #'site/isearch-region) > > that searches for whatever is selected. That also highlights every > occurrence. > And, since Emacs 28.1, one can select the region and press M-s M-. (`isearch-forward-thing-at-point`). By default, Emacs will try to search for the active region first (see `isearch-forward-thing-at-point` to customize this behavior).