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

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

Re: setting minor mode via file local variable from function


From: Stephen Berman
Subject: Re: setting minor mode via file local variable from function
Date: Fri, 14 Jun 2013 00:03:34 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

On Thu, 13 Jun 2013 14:16:40 +0200 Rainer M Krug <Rainer@krugs.de> wrote:

> Hi
>
> I have the following function definition:
>
> ,----
> | (defun org-babel-mark-file-as-tangled ()
> |   (when  (string-match "[.]R" (buffer-file-name))
> |       (add-file-local-variable 'org-babel-tangled-file t)
> |       (add-file-local-variable 'buffer-read-only t)
> |       (basic-save-buffer)))
> `----
>
> Now I would like to set the minor mode (auto-revert-mode) as
> well. According to the manual, one should use
>
> ,----
> | eval: (auto-revert-mode)
> `----
>
> But how can I include this in my function above?

How about this:

 (defun org-babel-mark-file-as-tangled ()
   (when  (string-match "[.]R" (buffer-file-name))
       (add-file-local-variable 'org-babel-tangled-file t)
       (add-file-local-variable 'buffer-read-only t)
       (add-file-local-variable 'eval '(auto-revert-mode))
       (basic-save-buffer)))

Steve Berman




reply via email to

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