unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* setting
@ 2013-06-13 12:16 Rainer M Krug
  2013-06-13 13:28 ` setting Thorsten Jolitz
  0 siblings, 1 reply; 3+ messages in thread
From: Rainer M Krug @ 2013-06-13 12:16 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 595 bytes --]

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?

Thanks,

Rainer

-- 
Rainer M. Krug

email: RMKrug<at>gmail<dot>com

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: setting
  2013-06-13 12:16 setting Rainer M Krug
@ 2013-06-13 13:28 ` Thorsten Jolitz
  2013-06-13 13:49   ` setting Rainer M Krug
  0 siblings, 1 reply; 3+ messages in thread
From: Thorsten Jolitz @ 2013-06-13 13:28 UTC (permalink / raw)
  To: help-gnu-emacs

Rainer M Krug <Rainer@krugs.de> writes:


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

,---------------------
| (auto-revert-mode 1)
`---------------------

? (untested)

-- 
cheers,
Thorsten




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: setting
  2013-06-13 13:28 ` setting Thorsten Jolitz
@ 2013-06-13 13:49   ` Rainer M Krug
  0 siblings, 0 replies; 3+ messages in thread
From: Rainer M Krug @ 2013-06-13 13:49 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1647 bytes --]


Thorsten Jolitz <tjolitz@gmail.com> writes:

> Rainer M Krug <Rainer@krugs.de> writes:
>
>
>> 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?
>
> ,---------------------
> | (auto-revert-mode 1)
> `---------------------


In the manual it says:

,----
| To enable or disable a minor mode in a local variables list, use the
| eval keyword with a Lisp expression that runs the mode command (see
| Minor Modes). For example, the following local variables list enables
| Eldoc mode (see Lisp Doc) by calling eldoc-mode with no argument
| (calling it with an argument of 1 would do the same), and disables Font
| Lock mode (see Font Lock) by calling font-lock-mode with an argument of
| -1.
| 
|      ;; Local Variables:
|      ;; eval: (eldoc-mode)
|      ;; eval: (font-lock-mode -1)
|      ;; End:
`----

so it has to be:

,----
| eval: (auto-revert-mode)
`----

But is there function which I can use in my function
org-babel-mark-file-as-tangled so that this is inserted *with the
appropriate comment character*?

Rainer

>
> ? (untested)

-- 
Rainer M. Krug

email: RMKrug<at>gmail<dot>com

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-06-13 13:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-13 12:16 setting Rainer M Krug
2013-06-13 13:28 ` setting Thorsten Jolitz
2013-06-13 13:49   ` setting Rainer M Krug

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).