1 point

Also a thank you from my side. At the moment I am scanning an org table with over 350 rows and looking for doubles. Next I have to reference the doubles to the first of the doubles. And I discovered thanks to this magnificent tutorial that I can edit all doubles in one place, the occur buffer. And add the references through the edit mode of the occur buffer. Wow… this is really great.

permalink
report
reply
1 point

Wow TIL about the occur behavior with prefix arg.

I usually call my own wrapper command that runs occur for the selected region (instead of limiting to region) or the symbol at point (the most common case when programming). Thanks to your video I added prefix arg support:

(defun hoagie-occur-sexp-or-region ()
  "Run occur for the sexp at point, or the active region.
By default, occur _limits the search to the region_ if it is active."
  (interactive)
  (occur (if (use-region-p)
             (buffer-substring-no-properties (region-beginning)
                                             (region-end))
           (thing-at-point 'sexp t))
         (when current-prefix-arg
	       (prefix-numeric-value current-prefix-arg))))

Thank you!!!

permalink
report
reply

Emacs

!emacs@communick.news

Create post

A community for the timeless and infinitely powerful editor. Want to see what Emacs is capable of?!

Get Emacs

  • Windows
  • Mac OS X
  • GNU/Linux and BSD (Just get it from your distribution’s package manager)

Rules

  1. Posts should be emacs related
  2. Be kind please
  3. Yes, we already know: Google results for “emacs” and “vi” link to each other. We good.

Emacs Resources

Emacs Tutorials

Useful Emacs configuration files and distributions

Quick pain-saver tip

Community stats

  • 18

    Monthly active users

  • 562

    Posts

  • 2.4K

    Comments