diff options
| -rw-r--r-- | lisp/simple.el | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index cdbbd876e3b..bcd26da13ed 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -2876,11 +2876,13 @@ Normally, history elements are matched case-insensitively if | |||
| 2876 | makes the search case-sensitive. | 2876 | makes the search case-sensitive. |
| 2877 | See also `minibuffer-history-case-insensitive-variables'." | 2877 | See also `minibuffer-history-case-insensitive-variables'." |
| 2878 | (interactive | 2878 | (interactive |
| 2879 | (let* ((enable-recursive-minibuffers t) | 2879 | (let* ((n (prefix-numeric-value current-prefix-arg)) |
| 2880 | (enable-recursive-minibuffers t) | ||
| 2880 | (regexp (read-from-minibuffer | 2881 | (regexp (read-from-minibuffer |
| 2881 | (format-prompt "Previous element matching regexp" | 2882 | (format-prompt "%s element matching regexp" |
| 2882 | (and minibuffer-history-search-history | 2883 | (and minibuffer-history-search-history |
| 2883 | (car minibuffer-history-search-history))) | 2884 | (car minibuffer-history-search-history)) |
| 2885 | (if (>= n 0) "Previous" "Next")) | ||
| 2884 | nil minibuffer-local-map nil | 2886 | nil minibuffer-local-map nil |
| 2885 | 'minibuffer-history-search-history | 2887 | 'minibuffer-history-search-history |
| 2886 | (car minibuffer-history-search-history)))) | 2888 | (car minibuffer-history-search-history)))) |
| @@ -2888,9 +2890,9 @@ See also `minibuffer-history-case-insensitive-variables'." | |||
| 2888 | (list (if (string= regexp "") | 2890 | (list (if (string= regexp "") |
| 2889 | (if minibuffer-history-search-history | 2891 | (if minibuffer-history-search-history |
| 2890 | (car minibuffer-history-search-history) | 2892 | (car minibuffer-history-search-history) |
| 2891 | (user-error "No previous history search regexp")) | 2893 | (user-error "No history search regexp")) |
| 2892 | regexp) | 2894 | regexp) |
| 2893 | (prefix-numeric-value current-prefix-arg)))) | 2895 | n))) |
| 2894 | (unless (zerop n) | 2896 | (unless (zerop n) |
| 2895 | (if (and (zerop minibuffer-history-position) | 2897 | (if (and (zerop minibuffer-history-position) |
| 2896 | (null minibuffer-text-before-history)) | 2898 | (null minibuffer-text-before-history)) |
| @@ -2948,20 +2950,23 @@ Normally, history elements are matched case-insensitively if | |||
| 2948 | `case-fold-search' is non-nil, but an uppercase letter in REGEXP | 2950 | `case-fold-search' is non-nil, but an uppercase letter in REGEXP |
| 2949 | makes the search case-sensitive." | 2951 | makes the search case-sensitive." |
| 2950 | (interactive | 2952 | (interactive |
| 2951 | (let* ((enable-recursive-minibuffers t) | 2953 | (let* ((n (prefix-numeric-value current-prefix-arg)) |
| 2952 | (regexp (read-from-minibuffer "Next element matching (regexp): " | 2954 | (enable-recursive-minibuffers t) |
| 2953 | nil | 2955 | (regexp (read-from-minibuffer |
| 2954 | minibuffer-local-map | 2956 | (format-prompt "%s element matching regexp" |
| 2955 | nil | 2957 | (and minibuffer-history-search-history |
| 2956 | 'minibuffer-history-search-history | 2958 | (car minibuffer-history-search-history)) |
| 2957 | (car minibuffer-history-search-history)))) | 2959 | (if (>= n 0) "Next" "Previous")) |
| 2960 | nil minibuffer-local-map nil | ||
| 2961 | 'minibuffer-history-search-history | ||
| 2962 | (car minibuffer-history-search-history)))) | ||
| 2958 | ;; Use the last regexp specified, by default, if input is empty. | 2963 | ;; Use the last regexp specified, by default, if input is empty. |
| 2959 | (list (if (string= regexp "") | 2964 | (list (if (string= regexp "") |
| 2960 | (if minibuffer-history-search-history | 2965 | (if minibuffer-history-search-history |
| 2961 | (car minibuffer-history-search-history) | 2966 | (car minibuffer-history-search-history) |
| 2962 | (user-error "No previous history search regexp")) | 2967 | (user-error "No history search regexp")) |
| 2963 | regexp) | 2968 | regexp) |
| 2964 | (prefix-numeric-value current-prefix-arg)))) | 2969 | n))) |
| 2965 | (previous-matching-history-element regexp (- n))) | 2970 | (previous-matching-history-element regexp (- n))) |
| 2966 | 2971 | ||
| 2967 | (defvar minibuffer-temporary-goal-position nil) | 2972 | (defvar minibuffer-temporary-goal-position nil) |