Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View and edit the filter stack #2

Open
Boruch-Baum opened this issue May 2, 2024 · 0 comments
Open

View and edit the filter stack #2

Boruch-Baum opened this issue May 2, 2024 · 0 comments

Comments

@Boruch-Baum
Copy link

Boruch-Baum commented May 2, 2024

Hi. I've started toying with your package and really enjoy it. For me, it immediately became important to be able to view and manipulate the filter stack. I wasn't always certain what exactly was on the filter stack, and I wanted to make subtle changes to elements in the middle of the filter stack. What I came up with for my personal use is this:

(use-package occur-x
:hook (occur-mode . turn-on-occur-x-mode)
:config
(defcustom occur-x-view-preference 'pp-eval-expression
  "How to be view the `occur-x' filter stack.
This should be the name of a function that takes a single
argument, symbol `occur-x-filter-ops'. The function 
`refine' from the MELPA package of the same name is a
good option for this. Note that using `refine' will add that
package's ability to edit, re-arrange, and otherwise
directly manipulate items on the filter stack."
  :type 'symbol)

(defun occur-x-view ()
  "View the filter list."
  (interactive)
  (unless (eq major-mode 'occur-mode)
    (user-error "Occur-x-view: Current buffer isn't an occur buffer."))
  (funcall occur-x-view-preference 'occur-x-filter-ops))

(setq occur-x-view-preference 'refine)

:bind (:map occur-x-mode-map ("v" . 'occur-x-view)))

Some version of this capability might benefit some of your other users. Personally, I recommend that you DON'T add the refine package as a dependency because it itself pulls in many dependencies and my coding ethos is to avoid bloat. I did it on my personal Emacs because I had the refine package installed anyway (and I use it a lot).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant