Skip to content

Instantly share code, notes, and snippets.

@secemp9
Created November 7, 2024 10:45
Show Gist options
  • Save secemp9/e522c8a24bd16e9ebc6ee54ab662f651 to your computer and use it in GitHub Desktop.
Save secemp9/e522c8a24bd16e9ebc6ee54ab662f651 to your computer and use it in GitHub Desktop.
;(defun shellfm ()
;(interactive)
; (shell-command-on-region
; (point-min) (point-max) "cat $@"))
(defun shell-command-on-buffer ()
"Asks for a command and executes it in inferior shell with current buffer
as input."
(interactive)
(shell-command-on-region
(point-min) (point-max) "~/sed.emacs $@ ")
(next-window-any-frame)
(eval-buffer))
(global-set-key (kbd "M-/") 'shell-command-on-buffer)
(global-set-key (kbd "M-:") 'eval-buffer)
(defun last-30-commands ()
(interactive)
(kmacro-start-macro-or-insert-counter nil)
(shell-command-on-buffer)
(eval-buffer)
(shell-command-on-buffer)
(eval-buffer)
(kmacro-end-or-call-macro nil))
grep -v "^;" | sed '/#+BEGIN_SRC emacs-lisp/!d;s//&\n/;s/.*\n//;:a;/#+END_SRC/bb;$!{n;ba};:b;s//\n&/;P;D' $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment