Do I really want to call execute-command-on-buffer?
This is a really nifty function, but should I call it all the time? Adding the name of the buffer automatically is sweet... until I don't want that feature.
This commit is contained in:
parent
097431544e
commit
f9003e172f
2 changed files with 6 additions and 6 deletions
|
@ -90,7 +90,7 @@ And some Mac-specific settings:
|
||||||
(add-to-list 'default-frame-alist '(ns-appearance . dark)))
|
(add-to-list 'default-frame-alist '(ns-appearance . dark)))
|
||||||
#+end_src
|
#+end_src
|
||||||
* Support Packages
|
* Support Packages
|
||||||
** Piper and DWIM Shell Commands
|
** Piper
|
||||||
Rewriting my shell scripts in Emacs Lisp uses my [[https://gitlab.com/howardabrams/emacs-piper][emacs-piper project]], and this code spills into my configuration code, so let's load it now:
|
Rewriting my shell scripts in Emacs Lisp uses my [[https://gitlab.com/howardabrams/emacs-piper][emacs-piper project]], and this code spills into my configuration code, so let's load it now:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package piper
|
(use-package piper
|
||||||
|
@ -606,7 +606,7 @@ Let's try this general "space" prefix by defining some top-level operations, inc
|
||||||
(ha-leader
|
(ha-leader
|
||||||
"SPC" '("M-x" . execute-extended-command)
|
"SPC" '("M-x" . execute-extended-command)
|
||||||
"." '("repeat" . repeat)
|
"." '("repeat" . repeat)
|
||||||
"!" '("shell command" . dwim-shell-command)
|
"!" '("shell command" . shell-command)
|
||||||
"|" 'piper
|
"|" 'piper
|
||||||
"X" '("org capture" . org-capture)
|
"X" '("org capture" . org-capture)
|
||||||
"L" '("store org link" . org-store-link)
|
"L" '("store org link" . org-store-link)
|
||||||
|
|
|
@ -938,11 +938,11 @@ Sometimes you need to change something about the current file you are editing...
|
||||||
|
|
||||||
Will rename the current file to now have a .txt extension.
|
Will rename the current file to now have a .txt extension.
|
||||||
See `eshell-display-modifier-help' for details on that."
|
See `eshell-display-modifier-help' for details on that."
|
||||||
(interactive "sCommand to execute: ")
|
|
||||||
(let* ((file-name (buffer-file-name))
|
(let* ((file-name (buffer-file-name))
|
||||||
(full-cmd (cond ((string-match (rx "$$") cmd)
|
(full-cmd (cond ((string-match (rx "$$") cmd)
|
||||||
(replace-regexp-in-string (rx "$$") file-name cmd))
|
(replace-regexp-in-string (rx "$$") file-name cmd))
|
||||||
((string-match (rx (literal file-name)) cmd)
|
((and file-name (string-match (rx (literal file-name)) cmd))
|
||||||
cmd)
|
cmd)
|
||||||
(t
|
(t
|
||||||
(concat cmd " " file-name)))))
|
(concat cmd " " file-name)))))
|
||||||
|
@ -974,7 +974,7 @@ Here is where we associate all the functions and their hooks with =eshell=, thro
|
||||||
|
|
||||||
:hook ((eshell-pred-load . ha-eshell-add-predicates))
|
:hook ((eshell-pred-load . ha-eshell-add-predicates))
|
||||||
|
|
||||||
:bind (("M-!" . execute-command-on-file-buffer)
|
:bind (("M-!" . eshell-command)
|
||||||
("s-1" . execute-command-on-file-buffer)
|
("s-1" . execute-command-on-file-buffer)
|
||||||
:map eshell-mode-map
|
:map eshell-mode-map
|
||||||
("M-R" . eshell-insert-history)
|
("M-R" . eshell-insert-history)
|
||||||
|
@ -991,7 +991,7 @@ Add leader commands to call my defined functions:
|
||||||
"a e r" '("remote" . eshell-remote)
|
"a e r" '("remote" . eshell-remote)
|
||||||
"a e p" '("project" . eshell-project)
|
"a e p" '("project" . eshell-project)
|
||||||
"a e g" '("at point" . eshell-here-on-line)
|
"a e g" '("at point" . eshell-here-on-line)
|
||||||
"a e !" '("exec on file-buffer" . execute-command-on-file-buffer))
|
"a e b" '("exec on file-buffer" . execute-command-on-file-buffer))
|
||||||
#+end_src
|
#+end_src
|
||||||
No, i’m not sure why =use-package= has an issue with both =:hook=, =:bind= and =:config= directives in sequence.
|
No, i’m not sure why =use-package= has an issue with both =:hook=, =:bind= and =:config= directives in sequence.
|
||||||
* Technical Artifacts :noexport:
|
* Technical Artifacts :noexport:
|
||||||
|
|
Loading…
Reference in a new issue