From ebbcdf5d18e17d7c6a7a7b0c80a85663927d6676 Mon Sep 17 00:00:00 2001 From: Magnus Henoch Date: Wed, 9 Mar 2011 15:03:03 +0000 Subject: Declare indentation options as "safe" in erlang-mode for Emacs Emacs has a facility for setting options on a per-file basis based on comments in the source file. By default, all options are considered "unsafe", and the user is queried before the variable is set. This patch declares the variables erlang-indent-level, erlang-indent-guard and erlang-argument-indent to be safe, if the value specified in the source file is valid. Such declarations usually look like this: %% -*- erlang-indent-level: 2 -*- and appear on the first line of the file. --- lib/tools/emacs/erlang.el | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/tools') diff --git a/lib/tools/emacs/erlang.el b/lib/tools/emacs/erlang.el index ed825a298f..17b093ee34 100644 --- a/lib/tools/emacs/erlang.el +++ b/lib/tools/emacs/erlang.el @@ -466,14 +466,17 @@ To activate the workaround, place the following in your `~/.emacs' file: (defvar erlang-indent-level 4 "*Indentation of Erlang calls/clauses within blocks.") +(put 'erlang-indent-level 'safe-local-variable 'integerp) (defvar erlang-indent-guard 2 "*Indentation of Erlang guards.") +(put 'erlang-indent-guard 'safe-local-variable 'integerp) (defvar erlang-argument-indent 2 "*Indentation of the first argument in a function call. When nil, indent to the column after the `(' of the function.") +(put 'erlang-argument-indent 'safe-local-variable '(lambda (val) (or (null val) (integerp val)))) (defvar erlang-tab-always-indent t "*Non-nil means TAB in Erlang mode should always re-indent the current line, -- cgit v1.2.3