unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: "Drew Adams" <drew.adams@oracle.com>
Cc: 13348@debbugs.gnu.org
Subject: bug#13348: 24.3.50; `C-s', `C-r', `RET' in `minibuffer-local-isearch-map'
Date: Thu, 09 May 2013 00:04:53 +0300	[thread overview]
Message-ID: <87wqr9mbd6.fsf@mail.jurta.org> (raw)
In-Reply-To: <87a9o7duul.fsf@mail.jurta.org> (Juri Linkov's message of "Tue, 07 May 2013 11:49:18 +0300")

> Also I noticed that `isearch-nonincremental-exit-minibuffer'
> has no effect, so I removed it instead of adding a docstring
> to this unused function:

Better than removing is to mark it obsolete.

I propose also to rename the recently added function
`isearch-insert-char-by-name' to `isearch-char-by-name'
(using naming convention like in `isearch-other-meta-char'
and `isearch-printing-char') because it doesn't insert a character
to the buffer but adds a character to the search string:

=== modified file 'lisp/isearch.el'
--- lisp/isearch.el	2013-05-01 08:10:12 +0000
+++ lisp/isearch.el	2013-05-08 20:49:59 +0000
@@ -47,7 +47,7 @@
 ;; modify the search string before executing the search.  There are
 ;; three commands to terminate the editing: C-s and C-r exit the
 ;; minibuffer and search forward and reverse respectively, while C-m
-;; exits and does a nonincremental search.
+;; exits and searches in the last search direction.
 
 ;; Exiting immediately from isearch uses isearch-edit-string instead
 ;; of nonincremental-search, if search-nonincremental-instead is non-nil.
@@ -515,12 +515,12 @@ (defvar isearch-mode-map
     (define-key map "\M-so" 'isearch-occur)
     (define-key map "\M-shr" 'isearch-highlight-regexp)
 
-    ;; The key translations defined in the C-x 8 prefix should insert
-    ;; characters into the search string.  See iso-transl.el.
+    ;; The key translations defined in the C-x 8 prefix should add
+    ;; characters to the search string.  See iso-transl.el.
     (define-key map "\C-x" nil)
     (define-key map [?\C-x t] 'isearch-other-control-char)
     (define-key map "\C-x8" nil)
-    (define-key map "\C-x8\r" 'isearch-insert-char-by-name)
+    (define-key map "\C-x8\r" 'isearch-char-by-name)
 
     map)
   "Keymap for `isearch-mode'.")
@@ -528,7 +528,7 @@ (defvar isearch-mode-map
 (defvar minibuffer-local-isearch-map
   (let ((map (make-sparse-keymap)))
     (set-keymap-parent map minibuffer-local-map)
-    (define-key map "\r"    'isearch-nonincremental-exit-minibuffer)
+    (define-key map "\r"    'exit-minibuffer)
     (define-key map "\M-\t" 'isearch-complete-edit)
     (define-key map "\C-s"  'isearch-forward-exit-minibuffer)
     (define-key map "\C-r"  'isearch-reverse-exit-minibuffer)
@@ -679,6 +679,8 @@ (defun isearch-forward (&optional regexp
 Type \\[isearch-yank-pop] to replace string just yanked into search prompt
  with string killed before it.
 Type \\[isearch-quote-char] to quote control character to search for it.
+Type \\[isearch-char-by-name] to add a character to search by Unicode name,\
+ with completion.
 \\[isearch-abort] while searching or when search has failed cancels input\
  back to what has
  been found successfully.
@@ -1273,7 +1275,6 @@ (defun isearch-edit-string ()
 The following additional command keys are active while editing.
 \\<minibuffer-local-isearch-map>
 \\[exit-minibuffer] to resume incremental searching with the edited string.
-\\[isearch-nonincremental-exit-minibuffer] to do one nonincremental search.
 \\[isearch-forward-exit-minibuffer] to resume isearching forward.
 \\[isearch-reverse-exit-minibuffer] to resume isearching backward.
 \\[isearch-complete-edit] to complete the search string using the search ring."
@@ -1307,13 +1308,18 @@ (defun isearch-nonincremental-exit-minib
   (interactive)
   (setq isearch-nonincremental t)
   (exit-minibuffer))
+;; Changing the value of `isearch-nonincremental' has no effect here,
+;; because `isearch-edit-string' ignores this change.  Thus marked as obsolete.
+(make-obsolete 'isearch-nonincremental-exit-minibuffer 'exit-minibuffer "24.4")
 
 (defun isearch-forward-exit-minibuffer ()
+  "Resume isearching forward from the minibuffer that edits the search string."
   (interactive)
   (setq isearch-new-forward t)
   (exit-minibuffer))
 
 (defun isearch-reverse-exit-minibuffer ()
+  "Resume isearching backward from the minibuffer that edits the search string."
   (interactive)
   (setq isearch-new-forward nil)
   (exit-minibuffer))
@@ -1866,11 +1872,12 @@ (defun isearch-yank-line ()
    (lambda () (let ((inhibit-field-text-motion t))
 		(line-end-position (if (eolp) 2 1))))))
 
-(defun isearch-insert-char-by-name ()
-  "Read a character by its Unicode name and insert it into search string."
+(defun isearch-char-by-name ()
+  "Read a character by its Unicode name and add it to the search string.
+Completion is available like in `read-char-by-name' used by `insert-char'."
   (interactive)
   (with-isearch-suspended
-   (let ((char (read-char-by-name "Insert character (Unicode name or hex): ")))
+   (let ((char (read-char-by-name "Add character to search (Unicode name or hex): ")))
      (when char
        (setq isearch-new-string (concat isearch-string (string char))
 	     isearch-new-message (concat isearch-message

=== modified file 'doc/emacs/search.texi'
--- doc/emacs/search.texi	2013-01-01 09:11:05 +0000
+++ doc/emacs/search.texi	2013-05-08 20:52:42 +0000
@@ -175,7 +175,7 @@ (@pxref{Faces}).  The current search str
 
 @kindex M-e @r{(Incremental search)}
   To edit the current search string in the minibuffer without
-replacing it with items from the search ring, type @kbd{M-e}.  Type
+replacing it with items from the search ring, type @kbd{M-e}.  Type @key{RET},
 @kbd{C-s} or @kbd{C-r} to finish editing the string and search for it.
 
 @node Error in Isearch






  reply	other threads:[~2013-05-08 21:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-03 18:45 bug#13348: 24.3.50; `C-s', `C-r', `RET' in `minibuffer-local-isearch-map' Drew Adams
2013-01-04  0:04 ` Juri Linkov
2013-01-04  0:42   ` Drew Adams
2013-05-07  8:49     ` Juri Linkov
2013-05-08 21:04       ` Juri Linkov [this message]
2013-05-15 23:22 ` Juri Linkov

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87wqr9mbd6.fsf@mail.jurta.org \
    --to=juri@jurta.org \
    --cc=13348@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).