In deft mode I can change the default text extension using
(setq deft-extension "txt")
Is there any way to support multiple file types? (e.g. I have a mix of .txt .md and .org files in my directory)
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.Sign up to join this community
Building on the workaround in @ws6079's answer, you can use advice to specify a default extension for new files.
Here's an example that defaults to
txt (using Emacs 24.4-style advice):
(setq deft-extension "") (defvar deft-default-extension "txt") (defun my/deft-default-extension (orig-func &rest args) (let ((deft-extension deft-default-extension)) (apply orig-func args))) (when (not (version< emacs-version "24.4")) (advice-add 'deft-new-file :around #'my/deft-default-extension))