From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#12988: [PATCH] RE: bug#12988: isearch fails to persistently indicate case sensitivity Date: Sun, 25 Nov 2012 09:55:07 -0800 Message-ID: <0DE2FE5504D24DB884020513B403F9C4@us.oracle.com> References: <1353809123.37107.YahooMailClassic@web141102.mail.bf1.yahoo.com> <87ip8u6m77.fsf@mail.jurta.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1353866198 22067 80.91.229.3 (25 Nov 2012 17:56:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 25 Nov 2012 17:56:38 +0000 (UTC) Cc: 12988@debbugs.gnu.org To: "'Juri Linkov'" , "'Kelly Dean'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Nov 25 18:56:46 2012 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 1TcgRh-00061Y-2z for geb-bug-gnu-emacs@m.gmane.org; Sun, 25 Nov 2012 18:56:45 +0100 Original-Received: from localhost ([::1]:54589 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TcgRW-0003V6-9y for geb-bug-gnu-emacs@m.gmane.org; Sun, 25 Nov 2012 12:56:34 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:49221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TcgRR-0003Uy-5t for bug-gnu-emacs@gnu.org; Sun, 25 Nov 2012 12:56:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TcgRM-0003Yw-Ck for bug-gnu-emacs@gnu.org; Sun, 25 Nov 2012 12:56:29 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56425) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TcgRM-0003Yk-8n for bug-gnu-emacs@gnu.org; Sun, 25 Nov 2012 12:56:24 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TcgSv-0005yd-UD for bug-gnu-emacs@gnu.org; Sun, 25 Nov 2012 12:58:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 25 Nov 2012 17:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12988 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12988-submit@debbugs.gnu.org id=B12988.135386623022911 (code B ref 12988); Sun, 25 Nov 2012 17:58:01 +0000 Original-Received: (at 12988) by debbugs.gnu.org; 25 Nov 2012 17:57:10 +0000 Original-Received: from localhost ([127.0.0.1]:38442 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TcgS1-0005xO-Ja for submit@debbugs.gnu.org; Sun, 25 Nov 2012 12:57:09 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:37187) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TcgRv-0005ww-In for 12988@debbugs.gnu.org; Sun, 25 Nov 2012 12:57:04 -0500 Original-Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id qAPHtJGP021970 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 25 Nov 2012 17:55:20 GMT Original-Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id qAPHtJ0s026589 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 25 Nov 2012 17:55:19 GMT Original-Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id qAPHtI5E021992; Sun, 25 Nov 2012 11:55:19 -0600 Original-Received: from dradamslap1 (/71.202.147.44) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 25 Nov 2012 09:55:18 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <87ip8u6m77.fsf@mail.jurta.org> Thread-Index: Ac3K80lYVvhkKAjnS3qH2oOWSNcFlwAMVXrg X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.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:67459 Archived-At: > > But if instead you do M-c, the minibuffer just momentarily flashes > > a case sensitivity indicator, then gives no indication of case > > sensitivity status while you type your search string. > > Adding "case-sensitive" to the search prompt would make it too long. > adding a shorter abbreviation like "cs" would make it too cryptic. This is not an unsolvable problem. There is probably more than one reasonable way to solve it. I think I've mentioned this way before, but perhaps not: In Isearch+, the mode-line lighter makes clear (continually) whether searching is currently case-sensitive. Vanilla Emacs could do likewise. When case-sensitive, the lighter is `Isearch'. When case-insensitive, the lighter is `ISEARCH'. This is one simple way to make things clear to users. It requires no extra space anywhere. Here is a simplified version of the code I use. (In Isearch+, the lighter also indicates by its face whether search is wrapped - that is not done here.) This code should be usable by vanilla Isearch. (defun isearch-highlight-lighter () "Update minor-mode mode-line lighter to reflect case sensitivity." (let ((case-fold-search isearch-case-fold-search)) (when (and (eq case-fold-search t) search-upper-case) (setq case-fold-search (isearch-no-upper-case-p isearch-string isearch-regexp))) ;; Vanilla Isearch uses `isearch-mode', hence the first of these. (setq minor-mode-alist (delete '(isearch-mode isearch-mode) minor-mode-alist) minor-mode-alist (delete '(isearch-mode " ISEARCH") minor-mode-alist) minor-mode-alist (delete '(isearch-mode " Isearch") minor-mode-alist)) (let ((lighter (if case-fold-search " ISEARCH" " Isearch"))) (add-to-list 'minor-mode-alist `(isearch-mode ,lighter)))) (condition-case nil (redisplay t) (error nil))) (add-hook 'isearch-update-post-hook 'isearch-highlight-lighter) (defun isearch-toggle-case-fold () "Toggle case folding in searching on or off." (interactive) (setq isearch-case-fold-search (if isearch-case-fold-search nil 'yes) isearch-success t isearch-adjusted t) (isearch-highlight-lighter) (let ((message-log-max nil)) (message "%s%s [case %ssensitive]" (isearch-message-prefix nil isearch-nonincremental) isearch-message (if isearch-case-fold-search "in" ""))) (sit-for 1) (isearch-update)) However, I notice that, from `emacs -Q' and this code, with an empty search string the lighter does not change until you type something. And (regardless of the search string) the lighter does not change until after the delay for showing the "case-[in]sensitive" message. Neither of those problems exists for Isearch+. I don't have the time to dig into why they happen for vanilla Isearch. If you are interested, the Isearch+ code is here. Clearly something else in that code prevents these two minor problems. http://www.emacswiki.org/emacs-en/download/isearch%2b.el HTH.