[Top][All Lists]

[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

Cool extention to dired!

;;; -*- lexical-binding: t -*-
;; this file:

(require 'dired-aux)

(advice-add #'dired-do-rename :before #'dired-get-ext)

(defun dired-get-ext (&optional _)
    (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

reply via email to

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