emacs-devel
[Top][All Lists]
Advanced

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

buffer-auto-mode-alist (was: Scratch buffer annoyance)


From: Juri Linkov
Subject: buffer-auto-mode-alist (was: Scratch buffer annoyance)
Date: Mon, 20 Aug 2007 02:16:16 +0300
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

>     (defvar buffer-auto-mode-alist
>       (append
>       '(("\\`\*scratch\*\\'" . lisp-interaction-mode))
>       auto-mode-alist))
>
> A user could set it that way, but I don't want to include the value of
> auto-mode-alist in the default value.  I would rather keep buffer names
> and file names separate and have separate features to act on them.

I think the best way to implement this feature is to add a new hook
`after-create-buffer-hook' containing a function that sets buffer
mode according to `buffer-auto-mode-alist'.  This hook could be called
from `get-buffer-create'.

This hook will also help to remove defadvice for `create-file-buffer'
in uniquify.el when a uniquify renaming function will be appended
after buffer-auto-mode-alist renaming function in this hook.

-- 
Juri Linkov
http://www.jurta.org/emacs/




reply via email to

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