diff options
| -rw-r--r-- | .emacs | 33 |
1 files changed, 18 insertions, 15 deletions
@@ -96,9 +96,13 @@ (set-variable 'tab-width new-width) (message "changed from %s to %s" old-width new-width))) +(defun my/kill (stuff) + (kill-new stuff) + (message "Copied \"%s\"" stuff)) + (defun my/kill-ring-filename () (interactive) - (kill-new (or (buffer-file-name) default-directory))) + (my/kill (or (buffer-file-name) default-directory))) (defun my/kill-ring-pipe-region (command) (interactive (list (read-shell-command "Shell command on region: "))) @@ -107,13 +111,13 @@ (insert input) (call-process-region (point-min) (point-max) shell-file-name t t nil shell-command-switch command) - (kill-new (buffer-string))))) + (my/kill (buffer-string))))) (defun my/kill-ring-shell (command) (interactive (list (read-shell-command "Shell command: "))) (with-temp-buffer (call-process-shell-command command nil t) - (kill-new (buffer-string)))) + (my/kill (buffer-string)))) (defun my/make-project-wide (f) "Make a function which will run F from the project's root directory." @@ -271,18 +275,13 @@ (defun my/describe-revision (rev) "Format a Git revision in a format suitable for changelogs." (interactive - (list - (let* ((rev (my/revision-at-point)) - (prompt (format-prompt "Revision" rev))) - (read-string prompt nil nil rev)))) - (let* ((rev-fmt "%cd \"%s\" (%h)") - (desc - (string-trim - (shell-command-to-string - (format "git show --no-patch --date=short --format='%s' %s" - rev-fmt rev))))) - (kill-new desc) - (message desc))) + (list (let ((rev (my/revision-at-point))) + (read-string (format-prompt "Revision" rev) + nil nil rev)))) + (my/kill (string-trim + (shell-command-to-string + (format "git show --no-patch --date=short --format='%s' %s" + "%cd \"%s\" (%h)" rev))))) ;; Major modes configuration @@ -387,6 +386,10 @@ (my/unfroggify) (my/froggify))) +(defun my/message-id () + (interactive) + (my/kill (mail-header-message-id (gnus-summary-article-header)))) + ;; Font stuff 🤷🤦. Emacs comes with sensible defaults (e.g. the ;; default fontset includes Symbola for various subgroups of the ;; "symbol" script), but no color font by default. |
