From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#33852: 26.1; unhighlight-regexp unnecessary prompt Date: Thu, 13 Aug 2020 05:14:56 -0700 Message-ID: References: <83muof1o01.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12520"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 33852@debbugs.gnu.org, Xiansheng Ca To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 13 14:16:10 2020 Return-path: Envelope-to: geb-bug-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 1k6C9R-000397-Je for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 13 Aug 2020 14:16:09 +0200 Original-Received: from localhost ([::1]:43164 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k6C9Q-0006KQ-Lj for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 13 Aug 2020 08:16:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43840) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k6C9J-0006K1-Vl for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2020 08:16:01 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35792) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k6C9J-0002L5-N6 for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2020 08:16:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k6C9J-0006jZ-Io for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2020 08:16:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 13 Aug 2020 12:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33852 X-GNU-PR-Package: emacs Original-Received: via spool by 33852-submit@debbugs.gnu.org id=B33852.159732090725808 (code B ref 33852); Thu, 13 Aug 2020 12:16:01 +0000 Original-Received: (at 33852) by debbugs.gnu.org; 13 Aug 2020 12:15:07 +0000 Original-Received: from localhost ([127.0.0.1]:47335 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k6C8Q-0006iB-ND for submit@debbugs.gnu.org; Thu, 13 Aug 2020 08:15:07 -0400 Original-Received: from mail-yb1-f172.google.com ([209.85.219.172]:35607) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k6C8L-0006gn-Sn for 33852@debbugs.gnu.org; Thu, 13 Aug 2020 08:15:02 -0400 Original-Received: by mail-yb1-f172.google.com with SMTP id y134so3197465yby.2 for <33852@debbugs.gnu.org>; Thu, 13 Aug 2020 05:15:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:user-agent :mime-version:date:message-id:subject:to:cc; bh=TSGGB6e2vghx3oZTSLgDpiR2RrhUGPKbmw9iy1C6/Z8=; b=pSbedULxTZqbv4CynvuyEEe+h6/ggruC59MxyS4Pn9ZWUA2ul4LBlZMkNTuKkKckNc q5m/2dKQJtxeV5Kp1LnhypERMBvRZym81B8Z17OefdDd3Si2LD+/1VKk0TtUazNqtAQ7 ZIjSLjDO3DAKR/pj5pdfOrbjr+RSdK/hjvhWR7GuIIrsY+RLr38RdN0TPIttCANXjrDN 8IbMp2wI5pbGcjR1Bw4r0VN3aMd0eAhC6q1VGPH/O8cKutaNqW8LGmHtHJPHWQKgWBqq uRcfS9YkGolVvemSHwhuMDdMndb5AflIU0PI/qfKM3c8MWkAbN4CaMHVWE+b5V1lxt2Q tSIw== X-Gm-Message-State: AOAM532BeBAxv/JZFVb/4eFLRIyMb6n17W8BOR6yWZ8SRhVhn7hbKZw1 c7ZRRTFy6RGbj5Ymqudl4TfdvC6fzC/F4f0Tz8E= X-Google-Smtp-Source: ABdhPJyT3z8pEgKhmAfSnZc6nywB/W7aj37ITnupodoSWJdEJYoI+o459rwDoS26DVDdei28vNfanuTtbgn5ECNJ/MA= X-Received: by 2002:a25:7007:: with SMTP id l7mr5971204ybc.85.1597320896543; Thu, 13 Aug 2020 05:14:56 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Thu, 13 Aug 2020 05:14:56 -0700 In-Reply-To: <83muof1o01.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 05 Jan 2019 10:56:30 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:185012 Archived-At: Eli Zaretskii writes: >> From: Xiansheng Ca >> Date: Sun, 23 Dec 2018 04:49:30 -0600 >> >> In hi-lock-mode, after highlighting a single regular expression such >> as by M-s h r regexp , then unhighlighting with M-s h u, >> I'm prompted "Regexp to unhighlight (default regexp):", but any choice >> other than the default is rejected with the message "[No Match]". I >> would prefer not to be prompted if there is only a single acceptable >> choice. >> >> I believe the patch below implements this proposed behavior. Thank you >> for taking the time to consider this. >> [...] >> + (list (if (and (consp defaults) (null (cdr defaults))) (car defaults) >> + (completing-read (if (null defaults) >> + "Regexp to unhighlight: " >> + (format "Regexp to unhighlight >> (default %s): " >> + (car defaults))) >> + hi-lock-interactive-patterns >> + nil t nil nil defaults))))))) > > What happens if the command is invoked with point on a portion of text > that is highlighted by a hi-lock regexp? Wouldn't the command then > silently unhighlight only that regexp, and won't allow the user to > specify any other regexp? > > IOW, if the list of completions has only one element (btw, this fact > can be more elegantly established by calling 'length'), it does not > necessarily mean that there's only one hi-lock regexp defined in the > buffer. Should we consider that as well? That was 1.5 years ago. Any updates here? Xiansheng Ca, did you have a chance to look at Eli's questions above? Best regards, Stefan Kangas