Re: New package `outline-occur'

Roi Martin <[email protected]>
Newsgroups gmane.emacs.devel
Message-ID <[email protected]>
Juri Linkov <[email protected]> writes:

>>> If you find it useful, and given that it only depends on built-in
>>> functionalities (Outline and Occur), would it make sense to add it to
>>> core?  Otherwise, what about GNU ELPA?
>>
>> I think this is a strong candidate for the core, since the actual code
>> (excluding documentation) is about 10 lines of code.  I've CC'ed Juri
>> for a second opinion, but I think you can already draft up a patch
>> against emacs.git.
>
> Indeed, it's completely suitable for core since it's just
> one command 'outline-occur'.  But we need to make minor changes
> before installing it in outline.el.

Sounds great!  I'll draft a patch and send it to debbugs.  So, we can
continue the review there.

> Since 'outline-mode' and 'outline-minor-mode' use dedicated
> keymaps, we need to bind a new key (the suggested key 'M-o'
> is the most intuitive) under the existing prefix keys
> 'outline-mode-prefix-map' and 'outline-minor-mode-prefix'.

Besides the `outline-mode' and `outline-minor-mode' keymaps, I also
thought on adding it to `search-map'.  Something like this:

  (keymap-set search-map "M-o" #'outline-occur)

So, you can do `M-s M-o' from any buffer---even if the Outline modes are
not enabled.  What do you think?

> Also instead of 'outline-occur-regexp-override-alist',
> the proper way is to add a new buffer-local variable
> (e.g. 'outline-occur-regexp' nil by default)
> that can be set in the mode hooks.

I'll change it.  That makes the code even simpler.

> Also overriding 'occur-hook' with 'pop-to-buffer' is not
> the right way to customize the buffer display behavior.
> Either the command can override with 'display-buffer-overriding-action',
> or we can leave the customization to users with 'display-buffer-alist'.

I'd like the Occur buffer to pop up by default, so I'll take a look at
`display-buffer-overriding-action' and change the code accordingly.

Thanks for the comments!

        Roi
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.