Skip to content

Instantly share code, notes, and snippets.

@xenodium
Created January 12, 2024 09:39
Show Gist options
  • Save xenodium/848713ee8d9321ea4cdf4ebddb8e211d to your computer and use it in GitHub Desktop.
Save xenodium/848713ee8d9321ea4cdf4ebddb8e211d to your computer and use it in GitHub Desktop.
Add own elisp-demos snippets
(defun advised:elisp-demos--search (orig-fun symbol)
(cl-letf* ((orig-insert-file-contents (symbol-function 'insert-file-contents))
((symbol-function 'insert-file-contents)
(lambda (filename &optional visit beg end replace)
(apply orig-insert-file-contents filename visit beg end replace nil)
(apply orig-insert-file-contents "/private/tmp/mine.org" visit beg end replace nil))))
(funcall orig-fun symbol)))
(advice-add 'elisp-demos--search :around #'advised:elisp-demos--search)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment