From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hongyi Zhao Newsgroups: gmane.emacs.help Subject: Re: Automatically highlight all same occurrence of same stuff which has been currently marked/selected. Date: Sun, 21 May 2023 09:44:20 +0800 Message-ID: References: <87zg5ybi6u.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9616"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Michael Heerdegen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 21 03:45:19 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 1q0Y8L-0002Hr-Qs for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 21 May 2023 03:45:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q0Y7i-0002LF-Pw; Sat, 20 May 2023 21:44:38 -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 1q0Y7g-0002Kx-2Z for help-gnu-emacs@gnu.org; Sat, 20 May 2023 21:44:36 -0400 Original-Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q0Y7e-0002aN-Jh for help-gnu-emacs@gnu.org; Sat, 20 May 2023 21:44:35 -0400 Original-Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-96fa4a6a79bso110479666b.3 for ; Sat, 20 May 2023 18:44:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684633472; x=1687225472; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=krKKaNn4/COkwpPgOptHU2nZvimj+2ZLEg745TAmdCQ=; b=DbV1jpqpR8eoSf4s1UVb74beJEhjETPY2hm0B7R9+m8C3Dx8wzSoxFkm5ky2caRMQj XkSe62LnNxWMa34C8nrNu1+yQ+qOG+i3aAUwJYtfznact94/ncZZQoxNZSyUYS1ImFME YDgmXmK/PLTVBU97vzXtF9b+eASc2goOZTuG1BdgFqNNgognKosR1qJE9wZXKBCy9LtE gz0WL5F0OysaF2DbEABXUrU/sXhbDFIkjsD9FWGFrEXGkNOFW9+8x1FWlLL7Gof9xIMI hECA67RQMc6wNFKna1fXfIAUPFhEKH8AImYVUptPW12Q6tKcjxK9umw85/opjUJhw7Yw Jycg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684633472; x=1687225472; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=krKKaNn4/COkwpPgOptHU2nZvimj+2ZLEg745TAmdCQ=; b=ZDO7sQj8MShZU/H0vEPQToCMIphbmDBUbDP5jLMV7sAdqthzUEIMKdqCou5voZiP0B EJ6ysrsNnhVIPDw0vXVa3NV8H43gJKtCca1hHJ3Y2byhxT66lr+SeNEv3TgywAstbX0x eEeVlixkbhvHEWkVq22YKF8R8JLVYh808tKZr7QZTUQXin88SN4PuLL5aR5TFz+5bkOn f/n9ENSjj6GSd/iLxPQTv1em4h2gPeJiLvmd65qR4QjHTX/3bMa1DcOHittfcLebzbHW 1d2tqqlM5SoNLQUUsf9akhjivPentvhMrHFcsA/2s8QATre3WA8083U8AcTl7JkqihvB OaDA== X-Gm-Message-State: AC+VfDyR5BC4CAA8Lt6lgwRNQJ/wZXS32vgu3hKhlUPGQxn7+/8bDbm0 ELvHQ/dxgopB+4qBOcyzZ7u0IESDzpxY+qrFVLBjxpYt2XuuHvPjni4= X-Google-Smtp-Source: ACHHUZ7Bqsp5XhzFZAVGK6OcSBNS5d5yMxR67b6lLIYCqTL31ISl9Sw4j4KYXUuI2MzlOUYLRc3pd+FtB/+SEfaoEus= X-Received: by 2002:a17:906:6a1f:b0:96f:504b:4672 with SMTP id qw31-20020a1709066a1f00b0096f504b4672mr7782123ejc.13.1684633472519; Sat, 20 May 2023 18:44:32 -0700 (PDT) In-Reply-To: <87zg5ybi6u.fsf@web.de> Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=hongyi.zhao@gmail.com; helo=mail-ej1-x635.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, 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:143687 Archived-At: On Sun, May 21, 2023 at 9:14=E2=80=AFAM Michael Heerdegen wrote: > > Hongyi Zhao writes: > > > Say, I have the following: > > > > foo ... > > .. bar... > > baz foo > > > > Then when I select one of the `foo` above, the two `foo`s will be > > highlighted automatically. Any tips for achieving this? > > "high-lock.el" - in particular, M-x highlight-regexp ...? Should even > catch the region string as DEFAULT for the regexp (not regexp-quoted > though). The following packages do the trick: (use-package idle-highlight-mode :config (setq idle-highlight-idle-time 0.2) (idle-highlight-global-mode) ;; :hook ((prog-mode text-mode) . idle-highlight-mode) ) (use-package symbol-overlay :config (symbol-overlay-mode) (global-set-key (kbd "M-i") 'symbol-overlay-put) (global-set-key (kbd "M-n") 'symbol-overlay-switch-forward) (global-set-key (kbd "M-p") 'symbol-overlay-switch-backward) ;; (global-set-key (kbd "") 'symbol-overlay-mode) (global-set-key (kbd "") 'symbol-overlay-remove-all) ) > Michael. Zhao