diff options
Diffstat (limited to 'ebuild-mode.el')
-rw-r--r-- | ebuild-mode.el | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/ebuild-mode.el b/ebuild-mode.el index 3189b52..d3002a1 100644 --- a/ebuild-mode.el +++ b/ebuild-mode.el @@ -822,14 +822,19 @@ This will be added to the `write-contents-functions' hook." ;; make-local-hook gives a byte-compiler warning in GNU Emacs (make-local-hook 'write-contents-hooks) (add-hook 'write-contents-hooks 'ebuild-repo-mode-before-save t t)) - (setq fill-column 72) - (setq tab-width 4) + (unless (local-variable-p 'fill-column) + (setq fill-column 72)) + (unless (local-variable-p 'tab-width) + (setq tab-width 4)) (when (derived-mode-p 'nxml-mode) (eval-when-compile (ignore-errors (require 'nxml-mode))) - (let ((indent (if ebuild-mode-xml-indent-tabs 4 2))) - (set (make-local-variable 'nxml-child-indent) indent) - (set (make-local-variable 'nxml-attribute-indent) (* 2 indent))) - (setq indent-tabs-mode ebuild-mode-xml-indent-tabs))) + (unless (or (local-variable-p 'nxml-child-indent) + (local-variable-p 'nxml-attribute-indent)) + (let ((indent (if ebuild-mode-xml-indent-tabs 4 2))) + (set (make-local-variable 'nxml-child-indent) indent) + (set (make-local-variable 'nxml-attribute-indent) (* 2 indent)))) + (unless (local-variable-p 'indent-tabs-mode) + (setq indent-tabs-mode ebuild-mode-xml-indent-tabs)))) ;;;###autoload (defun ebuild-repo-mode-maybe-enable () |