help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

cool E-Lisp


From: Emanuel Berg
Subject: cool E-Lisp
Date: Sat, 26 Mar 2022 09:27:51 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]