From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Konstantin Kharlamov Newsgroups: gmane.emacs.bugs Subject: bug#35062: [PATCH v3 2/3] constify a bit of xterm.c Date: Sat, 20 Apr 2019 14:58:18 +0300 Message-ID: <1555761498.18656.4@yandex.ru> References: <20190407021331.948-1-Hi-Angel@yandex.ru> <20190407021331.948-2-Hi-Angel@yandex.ru> <8336mml3s7.fsf@gnu.org> <1f700b05-16a8-1159-e2e3-61f9699981a1@cs.ucla.edu> <1555722559.16908.0@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="98425"; mail-complaints-to="usenet@blaine.gmane.org" Cc: eggert@cs.ucla.edu, 35062@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 20 13:59:12 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hHoeG-000PU3-0d for geb-bug-gnu-emacs@m.gmane.org; Sat, 20 Apr 2019 13:59:12 +0200 Original-Received: from localhost ([127.0.0.1]:40394 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHoeF-0006CA-1N for geb-bug-gnu-emacs@m.gmane.org; Sat, 20 Apr 2019 07:59:11 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:51302) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHoe8-0006C3-9F for bug-gnu-emacs@gnu.org; Sat, 20 Apr 2019 07:59:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hHoe6-0007dh-W9 for bug-gnu-emacs@gnu.org; Sat, 20 Apr 2019 07:59:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60559) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hHoe6-0007db-T3 for bug-gnu-emacs@gnu.org; Sat, 20 Apr 2019 07:59:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hHoe6-00085Q-BW for bug-gnu-emacs@gnu.org; Sat, 20 Apr 2019 07:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Konstantin Kharlamov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Apr 2019 11:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35062 X-GNU-PR-Package: emacs Original-Received: via spool by 35062-submit@debbugs.gnu.org id=B35062.155576151131047 (code B ref 35062); Sat, 20 Apr 2019 11:59:02 +0000 Original-Received: (at 35062) by debbugs.gnu.org; 20 Apr 2019 11:58:31 +0000 Original-Received: from localhost ([127.0.0.1]:45870 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHoda-00084g-Iv for submit@debbugs.gnu.org; Sat, 20 Apr 2019 07:58:30 -0400 Original-Received: from forward106o.mail.yandex.net ([37.140.190.187]:51897) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHodY-00084T-6a for 35062@debbugs.gnu.org; Sat, 20 Apr 2019 07:58:29 -0400 Original-Received: from mxback12j.mail.yandex.net (mxback12j.mail.yandex.net [IPv6:2a02:6b8:0:1619::87]) by forward106o.mail.yandex.net (Yandex) with ESMTP id 8D6755061088; Sat, 20 Apr 2019 14:58:21 +0300 (MSK) Original-Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback12j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id gxWtWNLqkl-wKCaPWrc; Sat, 20 Apr 2019 14:58:21 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1555761501; bh=ooP/8pIDDcjSTTzQkTsDUq4BO1M2SJT/pFFVeV1MFIk=; h=In-Reply-To:Cc:To:Subject:From:References:Date:Message-Id; b=ds65s8pXmp0KC1V27RjL2NQQm7lz1flQwh6jQAjPmTeNWGsKwhHndz9VMZVdDWpuc sp48p7vPxP+KbibkV3a74fPF3Mvbt4h8j9ZTfTHVEL75aQTMsBAuSDozBO4QXlRnYP Q9zTUP/T0lu70cj/OgWx2VR02N/JOr8PD7GMWAwA= Authentication-Results: mxback12j.mail.yandex.net; dkim=pass header.i=@yandex.ru Original-Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Ue6KgpRLuo-wJ20Fbi8; Sat, 20 Apr 2019 14:58:19 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) In-Reply-To: <1555760844.18656.3@yandex.ru> X-Mailer: geary/emphasize-participated-in~g736c62cb-dirty X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:157893 Archived-At: On =D0=A1=D0=B1, Apr 20, 2019 at 14:47, Konstantin Kharlamov=20 wrote: >=20 >=20 > On =D0=A1=D0=B1, Apr 20, 2019 at 14:25, Konstantin Kharlamov=20 > wrote: >>=20 >>=20 >> On =D0=A1=D0=B1, Apr 20, 2019 at 14:23, Konstantin Kharlamov=20 >> =7F wrote: >>>=20 >>>=20 >>> On =D0=A1=D0=B1, Apr 20, 2019 at 14:01, Eli Zaretskii wr= ote: >>>>> Date: Sat, 20 Apr 2019 13:31:44 +0300 >>>>> From: Konstantin Kharlamov >>>>> Cc: eggert@cs.ucla.edu, 35062@debbugs.gnu.org >>>>>=20 >>>>> On =D0=A1=D0=B1, Apr 20, 2019 at 09:53, Eli Zaretskii = =20 >>>>> =7F=7F=7F=7Fwrote: >>>>> >> Date: Sat, 20 Apr 2019 04:09:19 +0300 >>>>> >> From: Konstantin Kharlamov >>>>> >> Cc: Eli Zaretskii , 35062@debbugs.gnu.org >>>>> >> >>>>> > I don't think I follow: Emacs's search commands do highlight=20 >>>>> the >>>>> > matches, and we also have symbol-search commands ("M-s _"=20 >>>>> =7F=7F=7F=7Fetc.), =7F=7F=7F=7F=7Fso >>>>> > what exactly is missing? >>>>>=20 >>>>> See: to any search a word in Emacs you have to either type it=20 >>>>> =7F=7F=7F=7F=7F=7F=7F=7F=7Fmanually >>>>> or copy-paste it. And then if you get unlucky to have next match >>>>> offscreen, the search gonna carry currently visible portion of=20 >>>>> =7F=7F=7F=7Ftext >>>>> away. >>>>>=20 >>>>> In other editors and IDEs it's implemented instead by selecting=20 >>>>> a =7F=7F=7F=7F=7F=7F=7F=7F=7Fword, >>>>> which makes the editor to highlight matches. >>>>=20 >>>> "M-s ." will highlight matches for the symbol at point, without=20 >>>> even >>>> requiring you to select that symbol. >>>=20 >>> Wow, that's cool, I didn't know about=20 >>> =7F=7F=7F(isearch-forward-symbol-at-point). >>>=20 >>>>> That's similar to what highlight-symbol.el is doing: you put a=20 >>>>> =7F=7F=7F=7F=7F=7F=7Fcaret >>>>> over a text, and after a short timeout (IIRC you can't set=20 >>>>> timeout >>>>> to 0 as it introduces lags to Emacs) it highlights visible=20 >>>>> matches >>>>> of the symbol under the caret. And then, if you want to, you can >>>>> press a hotkey to lock the highlight. >>>>=20 >>>> So you want to avoid typing "M-s .", is that right? But selecting=20 >>>> a >>>> symbol will need more keystrokes (except for very short symbols),=20 >>>> so >>>> where's the gain in that? >>>=20 >>> Well, me not knowing about "M-s ." aside, I understand one can't=20 >>> =7F=7F=7Fdirectly compare having to select a text in other editors with= =20 >>> =7F=7FEmacs, =7Fbecause those are mouse-oriented, and Emacs is=20 >>> =7F=7Fkeyboard-oriented. The =7F"Emacsy" solution is implemented in=20 >>> =7F=7Fhighlight-symbol.el, and it is =7Fquicker than typing "M-s .": yo= u=20 >>> =7F=7Fjust put a caret over a symbol, and =7Fmatches are automatically=20 >>> shown. >>>=20 >>> I just thought if I can write an analog of highlight-symbol.el by=20 >>> =7F=7F=7Fbinding the "M-s ." >>=20 >> =E2=80=A6by binding the function to idle-timeout and post that as an=20 >> answer =7Fhere=20 >> =7Fhttps://stackoverflow.com/questions/385661/how-to-highlight-all-occur= rences-of-a-word-in-an-emacs-buffer=20 >> =7Fbut I figured that this gonna make caret to jump to beginning of a=20 >> =7Fword every time, so probably no. >>=20 >> (sorry, accidentally pressed Ctrl+enter in mail client instead of=20 >> =7FCtrl+Backspace) >>=20 > Btw, I just tried setting (setq highlight-symbol-idle-delay 0) in=20 > highlight-symbol.el, and it doesn't lag for me! This is amazing! I'll=20 > try to keep it for today to see how it goes. >=20 Ah, never mind, typing the text is impossible. =