;;; -*- lexical-binding: t -*- ;; ;; this file: ;; https://dataswamp.org/~incal/emacs-init/dired-kill-ext.el (require 'dired-aux) (advice-add #'dired-do-rename :before #'dired-kill-ext) ;; (advice-remove #'dired-do-rename #'dired-kill-ext) (defun dired-kill-ext (&optional _) (save-excursion (goto-char (pos-eol)) (when (re-search-backward "\\.[[:alnum:]]+\\b" (pos-bol) t) (let ((ext (match-string-no-properties 0))) (kill-new ext) (message "%s" ext) )))) ;; (dired-kill-ext) index.php ;; (dired-kill-ext) E-Type Life .ft Nana Hedin.webm (provide 'dired-kill-ext)