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: Joost Kremers
Subject: Re: setting the mode of a buffer
Date: 12 Mar 2014 22:19:17 GMT
User-agent: slrn/pre1.0.0-18 (Linux)

lee wrote:
> Joost Kremers <address@hidden> writes:
> The mode is byte-compiled --- it mainly provides some syntax
> highlighting.  Mostly, changes are to defcustoms to add another keyword
> for the highlighting.

Reevaluating a defcustom will normally reset the value of the variable,
so there's no need to unload and reload the file. 

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

Yes, but you do not need to unload it first. If you reload the file, the
new definitions will replace the old ones.

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

You do need to reload it, compiling alone is not enough.

IME defvar definitions aren't always updated when you reload a file, but
that's easily remedied with a setq in an *ielm* buffer. (Do `M-x ielm'
if you don't know about ielm. It's a god send.)


-- 
Joost Kremers                                   address@hidden
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)


reply via email to

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