Commit 70ecabee authored by David Kågedal's avatar David Kågedal
Browse files

* startup.el (kom-start-anew): Don't reset the default

kom-default-language if the user set it in .emacs.

* vars.el.in (lyskom-maybe-setq, lyskom-maybe-setq-default): New
macros to facilitate using kom-dont-read-saved-variables.
parent 2ba21502
2002-05-24 David Kågedal <davidk@lysator.liu.se>
* startup.el (kom-start-anew): Don't reset the default
kom-default-language if the user set it in .emacs.
* vars.el.in (lyskom-maybe-setq, lyskom-maybe-setq-default): New
macros to facilitate using kom-dont-read-saved-variables.
2002-05-24 Per Cederqvist <ceder@ingate.com> 2002-05-24 Per Cederqvist <ceder@ingate.com>
* Makefile: Force re-creation of $(VARS-EL) when lyskom.el is * Makefile: Force re-creation of $(VARS-EL) when lyskom.el is
......
...@@ -289,7 +289,8 @@ if 'lyskom-menu is not found." ...@@ -289,7 +289,8 @@ if 'lyskom-menu is not found."
(symbol-name language))))) (symbol-name language)))))
(defun lyskom-set-language (language scope) (defun lyskom-set-language (language scope)
"Set the current language to LANGUAGE." "Set the current language to LANGUAGE.
Returns non-nil on success and nil on failure."
(cond ((not (assq language lyskom-languages)) (cond ((not (assq language lyskom-languages))
(lyskom-format-insert-before-prompt 'language-not-loaded (lyskom-format-insert-before-prompt 'language-not-loaded
(lyskom-language-name language)) (lyskom-language-name language))
......
...@@ -560,7 +560,7 @@ shown to other users." ...@@ -560,7 +560,7 @@ shown to other users."
(when (lyskom-set-language kom-default-language 'local) (when (lyskom-set-language kom-default-language 'local)
(unless lyskom-have-one-login (unless lyskom-have-one-login
(lyskom-set-language kom-default-language 'global) (lyskom-set-language kom-default-language 'global)
(setq-default kom-default-language kom-default-language) (lyskom-maybe-setq-default kom-default-language kom-default-language)
(setq-default lyskom-language kom-default-language)) (setq-default lyskom-language kom-default-language))
(lyskom-format-insert (lyskom-format-insert
'language-set-to 'language-set-to
......
...@@ -101,6 +101,19 @@ Inheritance only works with the LysKOM buffer handling functions." ...@@ -101,6 +101,19 @@ Inheritance only works with the LysKOM buffer handling functions."
t means don't read any variables. A list means don't read variables that t means don't read any variables. A list means don't read variables that
are in the list.") are in the list.")
(defmacro lyskom-maybe-setq (var value)
"This is a wrapper around setq that does nothing
if the variable is in kom-dont-read-saved-variables."
`(cond ((eq kom-dont-read-saved-variables t) nil)
((memq var kom-dont-read-saved-variables) nil)
(t (set var (eval value)))))
(defmacro lyskom-maybe-setq-default (var value)
"This is a wrapper around setq-default that does nothing
if the variable is in kom-dont-read-saved-variables."
`(cond ((eq kom-dont-read-saved-variables t) nil)
((memq var kom-dont-read-saved-variables) nil)
(t (set-default var (eval value)))))
;;;; ================================================================ ;;;; ================================================================
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment