From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ivan Shmakov 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: Mon, 13 Oct 2014 11:12:31 +0000 Message-ID: <87vbnoz0io.fsf@violet.siamics.net> References: <87zjd0digk.fsf@secretsauce.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1413198802 1645 80.91.229.3 (13 Oct 2014 11:13:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 13 Oct 2014 11:13:22 +0000 (UTC) To: 18697@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 13 13:13:16 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XddYy-0004vo-6G for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 Oct 2014 13:13:16 +0200 Original-Received: from localhost ([::1]:32974 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XddYx-0008TQ-CW for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 Oct 2014 07:13:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36679) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XddYp-0008TC-EO for bug-gnu-emacs@gnu.org; Mon, 13 Oct 2014 07:13:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XddYl-00030q-53 for bug-gnu-emacs@gnu.org; Mon, 13 Oct 2014 07:13:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50908) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XddYk-00030c-RO for bug-gnu-emacs@gnu.org; Mon, 13 Oct 2014 07:13:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XddYk-0003zf-7H for bug-gnu-emacs@gnu.org; Mon, 13 Oct 2014 07:13:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ivan Shmakov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 Oct 2014 11:13:02 +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: patch Original-Received: via spool by 18697-submit@debbugs.gnu.org id=B18697.141319876515328 (code B ref 18697); Mon, 13 Oct 2014 11:13:02 +0000 Original-Received: (at 18697) by debbugs.gnu.org; 13 Oct 2014 11:12:45 +0000 Original-Received: from localhost ([127.0.0.1]:42472 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XddYS-0003z9-D6 for submit@debbugs.gnu.org; Mon, 13 Oct 2014 07:12:45 -0400 Original-Received: from fely.am-1.org ([78.47.74.50]:36061) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XddYP-0003yy-DM for 18697@debbugs.gnu.org; Mon, 13 Oct 2014 07:12:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=siamics.net; s=a2013295; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:Sender:References:Subject:To:From; bh=u/P5jPa0kGvEamikJ9AchMln7aPPUmepDMCSXj91ny8=; b=IJMz1Tn99yto+HPoS0OaHUlPh+4P1tSJ8BEgO20VtjdCpUbyT756YrmxaCqMeZf3PM8UNUyDFZPQIv9afpuCjfTxjoOfsCcKLQlm88Iwwch3aQEhqLVekyZctX9FEML+rzlpbtZxSmrOSI2RaubC7rqt5TxYBTi4POpHj7pXTSA=; Original-Received: from [2a02:2560:6d4:26ca::1:1d] (helo=violet.siamics.net) by fely.am-1.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1XddYO-0000x1-4m for 18697@debbugs.gnu.org; Mon, 13 Oct 2014 11:12:40 +0000 Original-Received: from localhost ([::1] helo=violet.siamics.net) by violet.siamics.net with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1XddYG-0007Sv-Cy for 18697@debbugs.gnu.org; Mon, 13 Oct 2014 18:12:32 +0700 In-Reply-To: <87zjd0digk.fsf@secretsauce.net> (Dima Kogan's message of "Sun, 12 Oct 2014 15:35:55 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:94456 >>>>> Dima Kogan writes: > 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. [=E2=80=A6] > --- a/lisp/hi-lock.el > +++ b/lisp/hi-lock.el > @@ -419,7 +419,10 @@ highlighting will not update as you type." > (interactive > (list > (hi-lock-regexp-okay > - (read-regexp "Regexp to highlight line" 'regexp-history-last)) > + (read-regexp "Regexp to highlight line" > + (if mark-active > + (buffer-substring-no-properties (point) (mark)) > + 'regexp-history-last))) > (hi-lock-read-face-name))) > (or (facep face) (setq face 'hi-yellow)) > (unless hi-lock-mode (hi-lock-mode 1)) I don=E2=80=99t seem to understand; is mark-active ever supposed to become nil when /not/ in the transient-mark-mode? Personally, I find the latter distracting enough not to ever turn it on. So, I guess that the above would mean that I=E2=80=99d always be getting anything I have for the region (which may easily be a substantial portion of the buffer) for the default. Thus, at the very least, the above should probably use (and transient-mark-mode mark-active) as the condition, or something like that. [=E2=80=A6] --=20 FSF associate member #7257 http://boycottsystemd.org/ =E2=80=A6 3013 B6A0= 230E 334A