Commit ace5925a authored by David Byers's avatar David Byers
Browse files

Show a help link about changing languages at startup

Detailed changes:
> 2003-12-10  David Byers  <byers@lysator.liu.se>
>
> 	* startup.el (kom-start-anew): Show a help link when setting the
> 	language.
>
> 	* lyskom-rest.el (lyskom-format-aux-help): The argument for a
> 	conditional format is not optional, so we can handle extending
> 	format strings with additional boolean conditionals without
> 	altering the argument lists where they are used.
>
1a12,13
>
> 	* NEWS-0.48: Updated to here.
parent 5f880c3e
2003-12-10 David Byers <byers@lysator.liu.se>
* startup.el (kom-start-anew): Show a help link when setting the
language.
* lyskom-rest.el (lyskom-format-aux-help): The argument for a
conditional format is not optional, so we can handle extending
format strings with additional boolean conditionals without
altering the argument lists where they are used.
2003-12-07 David Byers <byers@lysator.liu.se>
* NEWS-0.48: Updated to here.
Handle user privileges:
* commands2.el (kom-change-privileges): New command.
(kom-status-person): Print privileges.
......
......@@ -1441,7 +1441,7 @@ On since %#8s%#9s")
(which-language . "Change language to: ")
(send-formatted . "Send as formatted text? ")
(changing-language-to . "Changing to %#1s.\n")
(language-set-to . "Language set to %#1s.\n")
(language-set-to . "Language set to %#1s%#2?b%[ %#3@[%#2s]%]%[%].\n")
(language-not-loaded . "%#1s is unavailable.\n")
(reformat-html . "HTML")
......
......@@ -33,6 +33,8 @@
;;;;
(defvar lyskom-help-parse-debugging (getenv "LYSKOM_HELP_DEBUG"))
;;; Note that these are duplicated in help.el. Change one and change both!
(defsubst lyskom-help-create-data (tag attr data)
......@@ -77,7 +79,7 @@ Value returned is always nil."
(h1 nil nil (cref TEXT) nil)
(h2 nil nil (cref TEXT) nil)
(h3 nil nil (cref TEXT) nil)
(p nil nil (b i cref list TEXT) nil)
(p nil nil (b i cref list refer TEXT) nil)
(b nil nil (cref TEXT) nil)
(i nil nil (cref TEXT) nil)
(list nil (header) (item) nil)
......@@ -112,20 +114,24 @@ TAG ATTRS CONTENTS")
(defvar lyskom-help-parse-command-ref-list nil)
(defvar lyskom-help-parse-unresolved-section-references nil)
(defun lyskom-help-parse-process-section (parse)
(setq lyskom-help-parse-section-list
(cons (intern (lyskom-help-data-get-attr 'id parse))
lyskom-help-parse-section-list)))
lyskom-help-parse-section-list))
)
(defun lyskom-help-parse-process-section-ref (parse)
(setq lyskom-help-parse-section-ref-list
(cons (intern (lyskom-help-data-get-attr 'id parse))
lyskom-help-parse-section-ref-list)))
lyskom-help-parse-section-ref-list))
)
(defun lyskom-help-parse-process-command-ref (parse)
(setq lyskom-help-parse-command-ref-list
(cons (intern (lyskom-help-data-get-attr 'id parse))
lyskom-help-parse-command-ref-list)))
lyskom-help-parse-command-ref-list))
)
(defun lyskom-help-parse-process-finish (parse)
(lyskom-help-traverse id lyskom-help-parse-section-list
......@@ -135,7 +141,8 @@ TAG ATTRS CONTENTS")
(setq lyskom-help-parse-unresolved-section-references
lyskom-help-parse-section-ref-list)
(error "Unresolved help section references: %s"
lyskom-help-parse-section-ref-list)))
lyskom-help-parse-section-ref-list))
)
......@@ -168,6 +175,10 @@ TAG ATTRS CONTENTS")
start (match-end 0)))
(nreverse result))))
(defun lyskom-help-debug (fmt &rest args)
(and lyskom-help-parse-debugging
(apply 'message fmt args)))
(defun lyskom-help-parse-string (string &optional containing-syntax)
"Convert a help string STRING to a tree, checking it as we go.
CONTAINING-SYNTAX is the syntax specification for the containing tag."
......@@ -190,6 +201,8 @@ CONTAINING-SYNTAX is the syntax specification for the containing tag."
(syntax (assq tag-symbol lyskom-help-syntax))
(contents nil))
(lyskom-help-debug "%s %S" tag attrs)
;; Check that the tag is known
(unless syntax (error "Unknown tag %s" tag))
......@@ -238,7 +251,7 @@ CONTAINING-SYNTAX is the syntax specification for the containing tag."
(if (string-match (concat "</" tag ">") string tag-end)
(setq end-tag-start (match-beginning 0)
end-tag-end (match-end 0))
(error "Unterminated tag: %s %s" tag string))))
(error "Unterminated tag: %s" tag tag-start))))
;; Have the position of the end tag
;; Put the element we found into result
......@@ -257,7 +270,10 @@ CONTAINING-SYNTAX is the syntax specification for the containing tag."
;; Postprocess the parsed element
(when (lyskom-help-syntax-postprocess syntax)
(funcall (lyskom-help-syntax-postprocess syntax) (car result))))))
(lyskom-help-debug " > postprocess")
(funcall (lyskom-help-syntax-postprocess syntax) (car result))
(lyskom-help-debug " < postprocess")
))))
;; No more tags
;; There's just text left. Record it.
......
<!-- -*-mode: xml-*- -->
<help language="en">
<section id="language-help" prompt="">
<h2>Language Settings</h2>
<p>
You can switch the language in this session by using the command
<cref id="kom-change-language" /> or the Emacs command <i>M-x
kom-change-language</i>. To also change the key bindings (this
will affect all sessions), type C-u before the command (e.g. C-u
x<cref id="kom-change-language" />).
</p>
<p>
For full information, including how to change the default
language, see <refer id="language" /> (this information will be
presented using the current language selection).
</p>
</section>
<section id="language" prompt="Language">
<h1>Multiple language support</h1>
<p>
The elisp client can be built to support multiple languages. The
default is to build with support for english and swedish, with
english as the default language selection.
</p>
<h2>Temporary Language Change</h2>
<p>
Use <cref id="kom-change-language" /> to temporarily switch
languages. Please note that you must give a prefix argument to
<cref id="kom-change-language" /> to change the key binding.
Key bindings are changed in <i>all</i> sessions, not just the
one where the command is given.
</p>
<h2>Permanent Language Change</h2>
<p>
Use <cref id="kom-customize" /> to change languages permanently.
By saving the language selection in .emacs, that language will
be the default the next time you start Emacs and load the elisp
client.
</p>
<h2>Changing the default language</h2>
<p>
There are a number of ways to change the default language in the
elisp client. The client looks at the following, in order, until
it finds a useful setting:
</p>
<list>
<item>The variable kom-default-language (change it with <cref
id="kom-customize" />)</item>
<item>The environment variable KOMLANGUAGE</item>
<item>The environment variable LC_ALL</item>
<item>The environment variable LC_MESSAGES</item>
<item>The environment variable LANG</item>
</list>
<p>
The variable kom-default-language can be set to a list of
symbols, where each symbol corresponds to a language. Se the
list below for available languages. The first language on the
list that is supported by the client will be used.
</p>
<p>
The environment variables should be set to a language code. For
example, the value "sv" will cause the client to use Swedish.
</p>
<h2>Known languages</h2>
<list>
<item>sv - Swedish</item>
<item>en - English</item>
</list>
</section>
<section id="conferences" prompt="Conferences">
<h1>Conferences</h1>
......
<!-- -*-mode: xml-*- -->
<help language="sv">
<section id="language-help" prompt="">
<h2>Language Settings</h2>
<p>
You can switch the language in this session by using the command
<cref id="kom-change-language" /> or the Emacs command <i>M-x
kom-change-language</i>. To also change the key bindings (this
will affect all sessions), type C-u before the command (e.g. C-u
x<cref id="kom-change-language" />).
</p>
<p>
For full information, including how to change the default
language, see <refer id="language" /> (this information will be
presented using the current language selection).
</p>
</section>
<section id="language" prompt="Språk i elispklienten">
<h1>Stöd för flera språk</h1>
<p>
Elispklienten kan byggas med stöd för flera språk. Standard är
att bygga med svenska och engelska, med engelska förvalt.
</p>
<h2>Tillfälligt språkbyte</h2>
<p>
Använd <cref id="kom-change-language" /> för att byta språk
tillfälligt. Notera att det krävs ett prefixargument till <cref
id="kom-change-language" /> för att byta tangentbindningar. Dessa
byts då i <i>alla</i> sessioner, inte bara i den där man ger
kommandot.
</p>
<h2>Permanent språkbyte</h2>
<p>
Använd <cref id="kom-customize" /> för att byta språk permanent.
Genom att spara språkinställningen i .emacs kommer det att bli
standardspråk i klienten.
</p>
<h2>Ändra standardspråk</h2>
<p>
Det finns många sätt att ändra standardspråk i klienten.
Klienten tittar i tur och ordning på följande:
</p>
<list>
<item>Variabeln kom-default-language (ändra med <cref
id="kom-customize" />)</item>
<item>Omgivningsvariabeln KOMLANGUAGE</item>
<item>Omgivningsvariabeln LC_ALL</item>
<item>Omgivningsvariabeln LC_MESSAGES</item>
<item>Omgivningsvariabeln LANG</item>
</list>
<p>
Variabeln kom-default-language kan sättas till en lista av
symboler, där varje symbol motsvarar ett språk. Se nedan för en
lista av språk som elispklienten kan ha stöd för. Det första
språk på listan som elispklienten klarar kommer att användas.
</p>
<p>
Omgivningvariablerna skall vara satta till en språk-kod. Till
exempel innebär värdet "sv" att elispklientn skall använda
svenska som standardspråk.
</p>
<h2>Kända språk</h2>
<list>
<item>sv - Svenska</item>
<item>en - Engelska</item>
</list>
</section>
<section id="conferences" prompt="Veta mer om möten">
<h1>Möten</h1>
......
......@@ -1546,6 +1546,7 @@ Deferred insertions are not supported."
((< pad-length 0) (- 0 pad-length))
(t pad-length))))
(if (and arg-no
(not (eq format-letter ?\?))
(< (format-state->length format-state) arg-no))
(signal 'lyskom-format-error (list 'lyskom-format
": too few arguments")))
......
......@@ -649,7 +649,19 @@ shown to other users."
(setq-default lyskom-language lyskom-language)
(setq-default kom-default-language (list lyskom-language)))
(lyskom-format-insert-before-prompt
'language-set-to (lyskom-language-name (lyskom-default-language))))
'language-set-to
(lyskom-language-name (lyskom-default-language))
"Help on changing languages"
`(face underline
mouse-face highlight
lyskom-button t
lyskom-button-text ""
lyskom-button-type func
lyskom-buffer ,(current-buffer)
lyskom-button-arg
(kom-help ("Changing Languages" . language-help))))
)
(setq lyskom-have-one-login t))
(when ignored-user-area-vars
......
......@@ -1474,7 +1474,7 @@ Uppkopplad sedan %#8s%#9s")
(which-language . "ndra sprk till: ")
(send-formatted . "Skicka in som formatterad text? ")
(changing-language-to . "Byter till %#1_s.\n")
(language-set-to . "Sprket r %#1_s.\n")
(language-set-to . "Sprket r %#1_s%#2?b%[ %#3@[%#2s]%]%[%].\n")
(language-not-loaded . "%#1s finns inte tillgngligt.\n")
(reformat-html . "HTML")
......
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