mirror of
https://codeberg.org/scip/dot-emacs.git
synced 2025-12-17 04:20:57 +01:00
using require
This commit is contained in:
19
lisp/init-occur.el
Normal file
19
lisp/init-occur.el
Normal file
@@ -0,0 +1,19 @@
|
||||
;; *** Occur
|
||||
;; https://oremacs.com/2015/01/26/occur-dwim/
|
||||
;; https://github.com/abo-abo/hydra/wiki/Emacs
|
||||
(defun occur-dwim ()
|
||||
"Call `occur' with a sane default, chosen as the thing under point or selected region"
|
||||
(interactive)
|
||||
(push (if (region-active-p)
|
||||
(buffer-substring-no-properties
|
||||
(region-beginning)
|
||||
(region-end))
|
||||
(let ((sym (thing-at-point 'symbol)))
|
||||
(when (stringp sym)
|
||||
(regexp-quote sym))))
|
||||
regexp-history)
|
||||
(call-interactively 'occur))
|
||||
|
||||
|
||||
(provide 'init-occur)
|
||||
;;; init-occur.el ends here
|
||||
Reference in New Issue
Block a user