* cool E-Lisp
@ 2022-03-26 8:27 Emanuel Berg via Users list for the GNU Emacs text editor
0 siblings, 0 replies; only message in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2022-03-26 8:27 UTC (permalink / raw)
To: help-gnu-emacs
E-Lisp - I Just Wanna Be With You 2022
https://www.youtube.com/watch?v=pbWLvwE8zfw
Cool extention to dired!
;;; -*- 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-get-ext)
(defun dired-get-ext (&optional _)
(save-excursion
(goto-char (point-at-eol))
(when (re-search-backward "\\.[[:alnum:]]+\\b" (point-at-bol) t)
(kill-new (match-string-no-properties 0) ))))
;; test:
;; (dired-get-ext) index.php (kills .php)
;; (dired-get-ext) E-Type Life .ft Nana Hedin.webm (kills .webm)
;; remove:
;; (advice-remove #'dired-do-rename #'dired-get-ext)
--
underground experts united
https://dataswamp.org/~incal
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-03-26 8:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-26 8:27 cool E-Lisp Emanuel Berg via Users list for the GNU Emacs text editor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).