Rainer M Krug writes: [snip (54 lines)] >>>> ,---- >>>> | (defvar org-babel-tangled-file nil >>>> | "If non-nill, current file was tangled with org-babel-tangle") >>>> | (put 'org-babel-tangled-file 'safe-local-variable 'booleanp) >>>> | >>>> | (defun org-babel-mark-file-as-tangled () >>>> | (add-file-local-variable 'org-babel-tangled-file t) >>>> | (basic-save-buffer)) >>>> | >>>> | (add-hook 'org-babel-post-tangle-hook 'org-babel-mark-file-as-tangled) >>>> `---- >>>> >> >> I think the above code should be considered an implementation rather >> than simply a test. This is exactly what the post-tangle hook is >> intended to support. Is there a motivating reason for this behavior to >> be "built in"? > > As pointed out, I think the possibility to easily add local variables to > the tangled file, will be valuable. I would opt for an the buil-in > option, as this could e.g. be used to set the file read-only in emacs, > adding svn information, etc. > > This could be achieved by supplying one variable containing strings, > which contains the names of the local variables to be added and their values. > > For the time being, I will add the suggested code to my emacs.org. I stumbled upon one problem, though: I want to mame the tengled file, when nopened in emacs, to have the minor mode auto-revert-mode. So I did the following, which obviously did not work: ,---- | (defvar org-babel-tangled-file nil | "If non-nill, current file was tangled with org-babel-tangle") | (put 'org-babel-tangled-file 'safe-local-variable 'booleanp) | | (defun org-babel-mark-file-as-tangled () | (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)) | | (add-hook 'org-babel-post-tangle-hook 'org-babel-mark-file-as-tangled) `---- So is tere a way, of adding the line ,---- | eval: (auto-revert-mode) `---- to the file local variables, so that emacs sutomatically enables auto-revert-mode? Thanks, Rainer > >> > [snip (38 lines)] -- Rainer M. Krug email: RMKruggmailcom