From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#18697: 25.0.50; [PATCH] hi-lock interactive functions now default to the active region, if there is one Date: Fri, 28 Jun 2019 22:09:31 +0300 Organization: LINKOV.NET Message-ID: <87h889bq00.fsf@mail.linkov.net> References: <87zjd0digk.fsf@secretsauce.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="242112"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 18697@debbugs.gnu.org, Dima Kogan To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 28 21:40:02 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.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hgwj3-0010lE-SX for geb-bug-gnu-emacs@m.gmane.org; Fri, 28 Jun 2019 21:40:02 +0200 Original-Received: from localhost ([::1]:35834 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgwj2-0004nW-MB for geb-bug-gnu-emacs@m.gmane.org; Fri, 28 Jun 2019 15:40:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53093) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgwOp-0006rr-BG for bug-gnu-emacs@gnu.org; Fri, 28 Jun 2019 15:19:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hgwOm-0000SR-RZ for bug-gnu-emacs@gnu.org; Fri, 28 Jun 2019 15:19:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57713) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hgwOk-0000Qc-21 for bug-gnu-emacs@gnu.org; Fri, 28 Jun 2019 15:19:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hgwOj-0007OV-R1 for bug-gnu-emacs@gnu.org; Fri, 28 Jun 2019 15:19:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 Jun 2019 19:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18697 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: wontfix patch Original-Received: via spool by 18697-submit@debbugs.gnu.org id=B18697.156174953828413 (code B ref 18697); Fri, 28 Jun 2019 19:19:01 +0000 Original-Received: (at 18697) by debbugs.gnu.org; 28 Jun 2019 19:18:58 +0000 Original-Received: from localhost ([127.0.0.1]:43024 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hgwOf-0007OD-VC for submit@debbugs.gnu.org; Fri, 28 Jun 2019 15:18:58 -0400 Original-Received: from chocolate.birch.relay.mailchannels.net ([23.83.209.35]:57918) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hgwOc-0007O3-Nd for 18697@debbugs.gnu.org; Fri, 28 Jun 2019 15:18:56 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 868CA5E1860; Fri, 28 Jun 2019 19:18:53 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a62.g.dreamhost.com (100-96-87-96.trex.outbound.svc.cluster.local [100.96.87.96]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id E40CF5E2183; Fri, 28 Jun 2019 19:18:52 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a62.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.2); Fri, 28 Jun 2019 19:18:53 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Wide-Eyed-Relation: 6f477ed83bb1ec44_1561749533292_2733199011 X-MC-Loop-Signature: 1561749533292:2317248851 X-MC-Ingress-Time: 1561749533291 Original-Received: from pdx1-sub0-mail-a62.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a62.g.dreamhost.com (Postfix) with ESMTP id C0338836DF; Fri, 28 Jun 2019 12:18:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=TiQedbTzd0ZeFp6PVxfewsVPT/g=; b= iZGEBLD3E7UWqmL5AG6tzUHP0Ghymw0yNM5I69GjraBecXkanSYDlKXUjBxkYGq0 M6YQ7XU8QMKsmzmUb9tbbv/FmAcmectDAisVrkusnOe3ifk3gAmQn3PuJLBnrmZB Vh9kopzFVgvcSlDG4Sh+nEYsBx2SOQE8wn4rcxWUTIk= Original-Received: from mail.jurta.org (m91-129-109-60.cust.tele2.ee [91.129.109.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a62.g.dreamhost.com (Postfix) with ESMTPSA id 62A93836F7; Fri, 28 Jun 2019 12:18:45 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a62 In-Reply-To: (Lars Ingebrigtsen's message of "Tue, 25 Jun 2019 23:29:01 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduvddrvddtgddufeejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdelrdeitdenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdelrdeitddprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehlrghrshhisehgnhhushdrohhrghenucevlhhushhtvghrufhiiigvpedt 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:161762 Archived-At: >> Attached is a small feature patch. Currently when a hi-lock.el function >> is called interactively, the default offered by (read-regexp) is the >> last value. >> >> With the patch, the behavior is the same if no active region is >> available; if an active region IS available, the default is the contents >> of the region. > > Hm... I think this sounds kinda unusual? We don't have any other > prompting functions that default to using the contents of the region (if > it's active), I think? Wouldn't the following patch satisfy the request by allowing to use M-n M-n to fetch the active region in the hi-lock command prompt: diff --git a/lisp/replace.el b/lisp/replace.el index 9d1b7bf747..15309a6a22 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -775,6 +775,8 @@ read-regexp-suggestions appends the list returned by this function to the end of values available via \\\\[next-history-element]." (list + (when (use-region-p) + (buffer-substring-no-properties (region-beginning) (region-end))) (find-tag-default-as-regexp) (find-tag-default-as-symbol-regexp) (car regexp-search-ring)