unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#13348: 24.3.50; `C-s', `C-r', `RET' in `minibuffer-local-isearch-map'
@ 2013-01-03 18:45 Drew Adams
  2013-01-04  0:04 ` Juri Linkov
  2013-05-15 23:22 ` Juri Linkov
  0 siblings, 2 replies; 6+ messages in thread
From: Drew Adams @ 2013-01-03 18:45 UTC (permalink / raw)
  To: 13348

`M-e' in Isearch is `isearch-edit-string'.  Here is its doc:
 
  Edit the search string in the minibuffer.
  The following additional command keys are active while editing.
 
  M-x exit-minibuffer to resume incremental searching with the edited string.
  RET to do one nonincremental search.
  C-s to resume isearching forward.
  C-r to resume isearching backward.
  C-M-i to complete the search string using the search ring.
  C-x 8 RET to insert a Unicode character by name (with completion).
 
  If first char entered is C-w, then do word search instead.
 
Now do this: `C-s M-e C-h k C-s'.  You see this:
 
  C-s runs the command isearch-forward-exit-minibuffer, which is an
  interactive compiled Lisp function in `isearch.el'.
 
  It is bound to C-s.
 
  (isearch-forward-exit-minibuffer)
 
  Not documented.
 
Not documented?  Why not?  Emacs users deserve better.
 
These commands (for keys `C-s', `C-r', `RET') are explicitly called out
in the doc for `isearch-edit-string'.  They should have doc strings.
`C-M-i' (`isearch-complete-edit') does, and so should all of the other
keys mentioned in the doc of `isearch-edit-string'.
 
In GNU Emacs 24.3.50.1 (i386-mingw-nt5.1.2600)
 of 2012-12-31 on ODIEONE
Bzr revision: 111388 rudalics@gmx.at-20121231113513-subz2dazg6yjukzh
Windowing system distributor `Microsoft Corp.', version 5.1.2600
Configured using:
 `configure --with-gcc (4.7) --no-opt --enable-checking --cflags
 -IC:/Devel/emacs/build/include --ldflags -LC:/Devel/emacs/build/lib'
 






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#13348: 24.3.50; `C-s', `C-r', `RET' in `minibuffer-local-isearch-map'
  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-15 23:22 ` Juri Linkov
  1 sibling, 1 reply; 6+ messages in thread
From: Juri Linkov @ 2013-01-04  0:04 UTC (permalink / raw)
  To: Drew Adams; +Cc: 13348

>   (isearch-forward-exit-minibuffer)
>
>   Not documented.
>
> Not documented?  Why not?  Emacs users deserve better.

Is this what you expected?

=== modified file 'lisp/isearch.el'
--- lisp/isearch.el	2013-01-02 16:13:04 +0000
+++ lisp/isearch.el	2013-01-04 00:03:23 +0000
@@ -1291,11 +1293,13 @@ (defun isearch-nonincremental-exit-minib
   (exit-minibuffer))

 (defun isearch-forward-exit-minibuffer ()
+  "Resume isearching forward."
   (interactive)
   (setq isearch-new-forward t)
   (exit-minibuffer))

 (defun isearch-reverse-exit-minibuffer ()
+  "Resume isearching backward."
   (interactive)
   (setq isearch-new-forward nil)
   (exit-minibuffer))





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#13348: 24.3.50; `C-s', `C-r', `RET' in `minibuffer-local-isearch-map'
  2013-01-04  0:04 ` Juri Linkov
@ 2013-01-04  0:42   ` Drew Adams
  2013-05-07  8:49     ` Juri Linkov
  0 siblings, 1 reply; 6+ messages in thread
From: Drew Adams @ 2013-01-04  0:42 UTC (permalink / raw)
  To: 'Juri Linkov'; +Cc: 13348

> Is this what you expected?

>  (defun isearch-forward-exit-minibuffer ()
> +  "Resume isearching forward."
> 
>  (defun isearch-reverse-exit-minibuffer ()
> +  "Resume isearching backward."

Sure, but why not say also what the searching is resuming _from_?

It's not necessarily the case that someone checking this documentation gets
there from `C-h k' from within an Isearch edit.






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#13348: 24.3.50; `C-s', `C-r', `RET' in `minibuffer-local-isearch-map'
  2013-01-04  0:42   ` Drew Adams
@ 2013-05-07  8:49     ` Juri Linkov
  2013-05-08 21:04       ` Juri Linkov
  0 siblings, 1 reply; 6+ messages in thread
From: Juri Linkov @ 2013-05-07  8:49 UTC (permalink / raw)
  To: Drew Adams; +Cc: 13348

>> Is this what you expected?
>
>>  (defun isearch-forward-exit-minibuffer ()
>> +  "Resume isearching forward."
>>
>>  (defun isearch-reverse-exit-minibuffer ()
>> +  "Resume isearching backward."
>
> Sure, but why not say also what the searching is resuming _from_?

It would be more helpful if you wrote these docstrings
as you want instead of explaining your wishes.
Now I added your additions below.

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

=== modified file 'lisp/isearch.el'
--- lisp/isearch.el	2013-05-01 08:10:12 +0000
+++ lisp/isearch.el	2013-05-07 08:48:31 +0000
@@ -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)
@@ -1273,7 +1274,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."
@@ -1303,17 +1303,14 @@ (defun isearch-edit-string ()
 	   (mapconcat 'isearch-text-char-description
 		      isearch-new-string "")))))
 
-(defun isearch-nonincremental-exit-minibuffer ()
-  (interactive)
-  (setq isearch-nonincremental t)
-  (exit-minibuffer))
-
 (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))






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#13348: 24.3.50; `C-s', `C-r', `RET' in `minibuffer-local-isearch-map'
  2013-05-07  8:49     ` Juri Linkov
@ 2013-05-08 21:04       ` Juri Linkov
  0 siblings, 0 replies; 6+ messages in thread
From: Juri Linkov @ 2013-05-08 21:04 UTC (permalink / raw)
  To: Drew Adams; +Cc: 13348

> 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






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#13348: 24.3.50; `C-s', `C-r', `RET' in `minibuffer-local-isearch-map'
  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-05-15 23:22 ` Juri Linkov
  1 sibling, 0 replies; 6+ messages in thread
From: Juri Linkov @ 2013-05-15 23:22 UTC (permalink / raw)
  To: Drew Adams; +Cc: 13348-done

> Not documented?  Why not?  Emacs users deserve better.

It is documented now.





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-05-15 23:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2013-05-15 23:22 ` Juri Linkov

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).