all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Juri Linkov'" <juri@jurta.org>,
	"'Daniel Colascione'" <dan.colascione@gmail.com>
Cc: emacs-devel@gnu.org
Subject: RE: RFC: [PATCH] isearch enhancements: symbol mode; syntactic filtering
Date: Thu, 7 Jul 2011 20:23:58 -0700	[thread overview]
Message-ID: <2A75A6DFE4AB403993132914C05D07F6@us.oracle.com> (raw)
In-Reply-To: <87liw9mxrh.fsf@mail.jurta.org>

> > - Case sensitivity is now displayed alongside other isearch 
> >   settings in the isearch prompt.
> 
> This is a good change as well, but one possible problem is that
> its message string "case-insensitive " (17 characters) is too long
> for the isearch prompt.

In Isearch+, I just change the case of the minor-mode lighter in the mode line
to indicate case-sensitivity: `Isearch' (case-sensitive) vs `ISEARCH'
(insensitive).  (I do the same thing in Icicles, for completion.)

That adds no chars to either the prompt or the minor-mode lighter, and I find it
is sufficiently noticeable (and always present during Isearch).

This is all that's needed:

1. Add this call to `isearch-toggle-case-fold':
(isearch-highlight-lighter)

2. Add this definition (or equivalent):

(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)))
    (setq minor-mode-alist
          (delete '(isearch-mode " ISEARCH") minor-mode-alist)
          minor-mode-alist
          (delete '(isearch-mode " Isearch") minor-mode-alist))
    (add-to-list
     'minor-mode-alist
     `(isearch-mode ,(if case-fold-search " ISEARCH" " Isearch"))))
  (condition-case nil (redisplay t) (error nil)))

3. (add-hook 'isearch-update-post-hook 'isearch-highlight-lighter)

For the Emacs source code you would not need to use the hook (#3).
You would just add the lighter change to function `isearch-update'.




  parent reply	other threads:[~2011-07-08  3:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-07 14:20 RFC: [PATCH] isearch enhancements: symbol mode; syntactic filtering Daniel Colascione
2011-07-07 14:53 ` Lennart Borgman
2011-07-07 20:51 ` Stefan Monnier
2011-07-07 21:39   ` Daniel Colascione
2011-07-08  0:20 ` Juri Linkov
2011-07-08  0:49   ` Daniel Colascione
2011-07-08 19:27     ` Juri Linkov
2011-07-08  3:23   ` Drew Adams [this message]
2011-07-08 13:04     ` Stefan Monnier
2011-07-08 21:05 ` Lennart Borgman
2011-07-08 21:19   ` Drew Adams
2011-07-08 21:50     ` Juri Linkov
2011-07-08 22:34       ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2A75A6DFE4AB403993132914C05D07F6@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=dan.colascione@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=juri@jurta.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.