emacs-devel
[Top][All Lists]
Advanced

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

Re: major mode in new buffers


From: René Kyllingstad
Subject: Re: major mode in new buffers
Date: Tue, 30 Mar 2010 18:42:14 +0200

2010/3/30 Juri Linkov <address@hidden>:
>> new buffers get default-major-mode. I would find it more convenient if
>> auto-mode-alist was used.
>>
>> Is there a disadvantage to that?
>
> You can see in http://thread.gmane.org/gmane.emacs.devel/115520/focus=115794
> that the following code can be used for a new non-file buffer to set its
> major mode based on the buffer name:
>
>  (setq-default major-mode (lambda ()
>                             (if buffer-file-name
>                                 (fundamental-mode)
>                               (let ((buffer-file-name (buffer-name)))
>                                 (set-auto-mode)))))

Thank you for both the code and link to the thread!


-- René




reply via email to

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