[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#14784: Occur from more Isearch types
From: |
Lars Ingebrigtsen |
Subject: |
bug#14784: Occur from more Isearch types |
Date: |
Wed, 26 Jun 2019 17:44:15 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Juri Linkov <juri@jurta.org> writes:
> Like bug#14673 added `Buffer-menu-multi-occur' to invoke Occur
> from multiple marked buffers, it would also make sense to invoke Occur
> from other search types where the search space differs from the default
> single-buffer search. Then typing `M-s o' in the minibuffer's isearch
> will show occurrences from all minibuffer history elements, and
> when typed in the comint's history isearch, will show occurrences
> from all shell history elements:
[...]
> +(defun minibuffer-occur (regexp &optional nlines)
> + "Show all entries in the minibuffer history containing a match for REGEXP.
> +Like `occur', but acts on the contents of the minibuffer history
> +in the currently active minibuffer."
> + (interactive (occur-read-primary-args))
> + (when (and (minibufferp) minibuffer-history-variable)
> + (let* ((history-variable minibuffer-history-variable)
> + (history (symbol-value history-variable)))
> + (with-current-buffer
> + (get-buffer-create (format " *Minibuffer history %s*"
> + history-variable))
> + (erase-buffer)
> + (dolist (line history)
> + (insert (query-replace-descr line) "\n"))
> + (occur-1 regexp nlines (list (current-buffer)))))))
That's an interesting feature... But with normal `C-s i foo M-s o', we
can then jump to the result, while we can't really do that there, can
we? So there's a bit of a disconnect between using an Occur buffer and
the minibuffer...
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bug#14784: Occur from more Isearch types,
Lars Ingebrigtsen <=