(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)
))
(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))
"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 ()
(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)))))
;; 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))))
;; 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.