]> code.delx.au - gnu-emacs/blobdiff - lisp/isearch.el
(Flookup_key, Faccessible_keymaps, describe_vector,
[gnu-emacs] / lisp / isearch.el
index aef204c02cc6cc3f2e12976cddaace3c7fcdc8f1..bb0afebb8ec9b46fdc2b5ea86587e7b38c028994 100644 (file)
@@ -312,6 +312,11 @@ Default value, nil, means edit the string instead."
       (define-key map "\C-\\" 'isearch-toggle-input-method)
       (define-key map "\C-^" 'isearch-toggle-specified-input-method)
 
+;;; I think the normal meaning of Mouse-2 is more natural.
+;;;       ;; People expect to be able to paste with the mouse.
+;;;       (define-key map [mouse-2] #'isearch-yank-kill)
+;;;       (define-key map [down-mouse-2] nil)
+
       (setq isearch-mode-map map)
       ))
 
@@ -647,6 +652,17 @@ is treated as a regexp.  See \\[isearch-forward] for more info."
 
   (force-mode-line-update)
 
+  ;; If we ended in the middle of some intangible text,
+  ;; move to the further end of that intangible text.
+  (let ((after (if (eobp) nil
+                (get-text-property (point) 'intangible)))
+       (before (if (bobp) nil
+                 (get-text-property (1- (point)) 'intangible))))
+    (when (and before after (eq before after))
+      (if isearch-forward
+         (goto-char (next-single-property-change (point) 'intangible))
+       (goto-char (previous-single-property-change (point) 'intangible)))))
+
   (if (and (> (length isearch-string) 0) (not nopush))
       ;; Update the ring data.
       (isearch-update-ring isearch-string isearch-regexp))
@@ -1189,13 +1205,13 @@ and the meta character is unread so that it applies to editing the string."
   "Quote special characters for incremental search."
   (interactive)
   (let ((char (read-quoted-char (isearch-message t))))
-    ;; Assume character codes 0200 - 0377 stand for 
-    ;; European characters in Latin-1, and convert them
-    ;; to Emacs characters.
+    ;; Assume character codes 0200 - 0377 stand for characters in some
+    ;; single-byte character set, and convert them to Emacs
+    ;; characters.
     (and enable-multibyte-characters
         (>= char ?\200)
         (<= char ?\377)
-        (setq char (+ char nonascii-insert-offset)))
+        (setq char (unibyte-char-to-multibyte char)))
     (isearch-process-search-char char)))
 
 (defun isearch-return-char ()
@@ -1213,7 +1229,7 @@ Obsolete."
     (if (and enable-multibyte-characters
             (>= char ?\200)
             (<= char ?\377))
-       (isearch-process-search-char (+ char nonascii-insert-offset))
+       (isearch-process-search-char (unibyte-char-to-multibyte char))
       (if current-input-method
          (isearch-process-search-multibyte-characters char)
        (isearch-process-search-char char)))))
@@ -1238,7 +1254,7 @@ If you want to search for just a space, type C-q SPC."
   ;; Append the char to the search string, update the message and re-search.
   (isearch-process-search-string 
    (isearch-char-to-string char) 
-   (if (>= char 0200)
+   (if (>= char ?\200)
        (char-to-string char)
      (isearch-text-char-description char))))
 
@@ -1613,13 +1629,13 @@ If there is no completion possible, say so and continue searching."
        ;; Check that invisibility runs up to END.
        (save-excursion
         (goto-char beg)
-        (let 
-            ;; can-be-opened keeps track if we can open some overlays.
-            ((can-be-opened (eq search-invisible 'open))
-             ;; the list of overlays that could be opened
-             (crt-overlays nil))
+        (let (
+              ;; can-be-opened keeps track if we can open some overlays.
+              (can-be-opened (eq search-invisible 'open))
+              ;; the list of overlays that could be opened
+              (crt-overlays nil))
           (when (and can-be-opened isearch-hide-immediately) 
-              (isearch-close-unecessary-overlays beg end))
+            (isearch-close-unecessary-overlays beg end))
           ;; If the following character is currently invisible,
           ;; skip all characters with that same `invisible' property value.
           ;; Do that over and over.