help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: setting the mode of a buffer


From: lee
Subject: Re: setting the mode of a buffer
Date: Fri, 07 Mar 2014 12:28:06 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Joost Kremers <address@hidden> writes:

> lee wrote:
>> Perhaps I´m going all wrong about this and there is a better way to
>> reload a mode?
>
> It's possible you don't need to reload the mode at all. This is Lisp,
> after all, not C. If you change a function definition, you only need to
> eval it (eval-defun, bound to C-M-x in emacs-lisp-mode), or you can
> recompile the entire file.
>
> If you change a defvar, eval'ing that won't load the new value, but you
> can simply use setq to set the new value.
>
> IME it's hardly never necessary to actually unload a feature and then
> reload it.

The mode is byte-compiled --- it mainly provides some syntax
highlighting.  Mostly, changes are to defcustoms to add another keyword
for the highlighting.

When I make a change, I byte-compile again.  From there on, I need some
way to apply the changes.  So far, I´ve been reloading the mode to
achieve this.

Are you saying that changes are magically applied by recompiling?  Or
should I use 'M-x eval-defun my-mode' to apply them after recompiling?
And when I do so, wouldn´t emacs figure that it already knows the mode
because it´s already loaded and continue to use the previous version?


-- 
Knowledge is volatile and fluid.  Software is power.



reply via email to

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