Last active
June 4, 2020 06:35
-
-
Save sje30/c829a271b8b6d6b4f0fd to your computer and use it in GitHub Desktop.
makefile-eval-current-target
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; This is inspired by Org mode: hitting C-c C-c inside a Makefile | |
;; rule will run "make TARGET" where TARGET is the name of the current | |
;; target at point. | |
;; Stephen Eglen 2016-01-31 GPL applies. | |
(defun makefile-eval-current-target () | |
"Evaluate the current Makefile rule in a *Compile* buffer." | |
(interactive) | |
(let ((target (makefile-add-log-defun))) | |
(if (null target) | |
(message "No target could be found.") | |
(compile (format "make -k %s" target))))) | |
(add-hook 'makefile-mode-hook | |
'(lambda () (define-key makefile-mode-map | |
"\C-c\C-c" 'makefile-eval-current-target))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun yank-url-from-chrome () | |
"Grab the current URL from Chrome and yank into point." | |
(interactive) | |
(shell-command | |
"xdotool search --onlyvisible --class Chrome windowfocus key ctrl+l key ctrl+c") | |
(shell-command | |
"xdotool search --onlyvisible --class Emacs windowfocus key ctrl+y")) | |
(defalias 'yu 'yank-url-from-chrome) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment