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

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

outline-regexp) using ";; *+ " for elisp code


From: Christopher Dimech
Subject: outline-regexp) using ";; *+ " for elisp code
Date: Tue, 11 May 2021 10:32:24 +0200

You are right, setq-local does not take effect.  How does defvar solve the 
problem?

   (setq-local rgc ";;; \\*+ ")

   (add-hook 'emacs-lisp-mode-hook
             (lambda ()
               (set (make-local-variable 'outline-regexp) rgc)))

> Sent: Tuesday, May 11, 2021 at 8:19 PM
> From: "Joost Kremers" <joostkremers@fastmail.fm>
> To: "Christopher Dimech" <dimech@gmx.com>
> Cc: help-gnu-emacs@gnu.org
> Subject: Re: outline-regexp) using ";; *+ " for elisp code
>
>
> On Tue, May 11 2021, Christopher Dimech wrote:
> > Any reason why using rgc does not work, whereas things are good when I use
> > the string directly in the call "make-local-variable"?
> >
> >    (setq-local rgc ";;; \\*+ ")
>
> Where is this call? =setq-local= sets the variable's value in the buffer in
> which it is executed. If this call is in your init file, it's not going to 
> have
> any effect on your Emacs session.
>
> In your init file, you'll want =defvar= or =defvar-local=. (Note, the =local= 
> part
> here does not have the same meaning as the =local= part in =setq-local=. See 
> the
> doc strings for details.)
>
> --
> Joost Kremers
> Life has its moments
>



reply via email to

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