+2011-08-24 Juri Linkov <juri@jurta.org>
+
+ * isearch.el (isearch-ring-adjust1): Start visiting previous
+ search strings from the index 0 (-1 + 1) instead of 1 (0 + 1).
+ (isearch-repeat, isearch-edit-string): Call `isearch-ring-adjust1'
+ for empty search string (when the last search string is reused
+ automatically) to adjust the isearch ring to the last element and
+ prepare the correct index for further M-p commands (bug#9185).
+
2011-08-24 Kenichi Handa <handa@m17n.org>
* international/ucs-normalize.el: If decomposition property of
isearch-word isearch-new-word))
;; Empty isearch-string means use default.
- (if (= 0 (length isearch-string))
- (setq isearch-string (or (car (if isearch-regexp
- regexp-search-ring
- search-ring))
- "")
-
- isearch-message
- (mapconcat 'isearch-text-char-description
- isearch-string ""))
- ;; This used to set the last search string,
- ;; but I think it is not right to do that here.
- ;; Only the string actually used should be saved.
- ))
+ (when (= 0 (length isearch-string))
+ (setq isearch-string (or (car (if isearch-regexp
+ regexp-search-ring
+ search-ring))
+ "")
+
+ isearch-message
+ (mapconcat 'isearch-text-char-description
+ isearch-string ""))
+ ;; After taking the last element, adjust ring to previous one.
+ (isearch-ring-adjust1 nil)))
;; This used to push the state as of before this C-s, but it adds
;; an inconsistent state where part of variables are from the
isearch-message
(mapconcat 'isearch-text-char-description
isearch-string "")
- isearch-case-fold-search isearch-last-case-fold-search))
+ isearch-case-fold-search isearch-last-case-fold-search)
+ ;; After taking the last element, adjust ring to previous one.
+ (isearch-ring-adjust1 nil))
;; If already have what to search for, repeat it.
(or isearch-success
(progn
()
(set yank-pointer-name
(setq yank-pointer
- (mod (+ (or yank-pointer 0)
+ (mod (+ (or yank-pointer (if advance 0 -1))
(if advance -1 1))
length)))
(setq isearch-string (nth yank-pointer ring)