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: Stefan Monnier
Subject: Re: major mode in new buffers
Date: Tue, 30 Mar 2010 23:02:32 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

>> 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)))))

> Try

>   emacs -Q -l ehelp --eval "(setq-default major-mode ...etc)"
>   M-x electric-describe-function <RET> car <RET>
>   r

What about it?


        Stefan




reply via email to

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