Commit 815e080f authored by David Byers's avatar David Byers
Browse files

Added help on individual commands; XEmacs compatibility; updated menus

parent 275280f8
2009-03-08 David Byers <davby@ida.liu.se> 2009-03-08 David Byers <davby@ida.liu.se>
Add access to command descriptions:
* help.el (lyskom-help-on-command): New function.
XEmacs compatibility:
* compatibility.el (detect-coding-string): Compatibility
definition for XEmacs.
Defensive coding for bug 1660: Defensive coding for bug 1660:
* edit-text.el (lyskom-create-text-handler): New parameter * edit-text.el (lyskom-create-text-handler): New parameter
...@@ -169,7 +175,7 @@ ...@@ -169,7 +175,7 @@
(lyskom-en-mode-map): Bind "vu" to "View URL". (lyskom-en-mode-map): Bind "vu" to "View URL".
2007-07-20 Hans Eric Svensson <eric+lyskom@lysator.liu.se> 2007-07-20 Hans Eric Svensson <eric+lyskom@lysator.liu.se>
* view-text.el (lyskom-follow-comments): Adjusted to take into * view-text.el (lyskom-follow-comments): Adjusted to take into
account that text-read-p doesn't know if a text *should* be read, account that text-read-p doesn't know if a text *should* be read,
it only only knows if a text *is marked* as read. it only only knows if a text *is marked* as read.
...@@ -318,7 +324,6 @@ ...@@ -318,7 +324,6 @@
(lyskom-format-insert-at-point): Simplified. (lyskom-format-insert-at-point): Simplified.
(lyskom-format-insert): Simplified. (lyskom-format-insert): Simplified.
>>>>>>> 44.943
2007-06-26 <David Byers@GULAG> 2007-06-26 <David Byers@GULAG>
* utilities.el (lyskom-indirect-assq): If assoc-list is t, then * utilities.el (lyskom-indirect-assq): If assoc-list is t, then
...@@ -608,7 +613,7 @@ ...@@ -608,7 +613,7 @@
(lyskom-string-to-int): Clarifyig comment in docstring. (lyskom-string-to-int): Clarifyig comment in docstring.
2007-04-26 Hans Eric Svensson <eric+lyskom@lysator.liu.se> 2007-04-26 Hans Eric Svensson <eric+lyskom@lysator.liu.se>
* lyskom-rest.el (lyskom-cache-all-memberships): New function * lyskom-rest.el (lyskom-cache-all-memberships): New function
which loads memberships into cache, so that we can be really sure which loads memberships into cache, so that we can be really sure
that we haven't read a specific text. that we haven't read a specific text.
...@@ -748,7 +753,7 @@ ...@@ -748,7 +753,7 @@
to menu. to menu.
Fix bug 1510: Fix bug 1510:
* vars.el.in (lyskom-commands): Added kom-review-mode-comments. * vars.el.in (lyskom-commands): Added kom-review-more-comments.
* swedish-strings.el,english-strings.el * swedish-strings.el,english-strings.el
(lyskom-sv-mode-map,lyskom-en-mode-map): Added (lyskom-sv-mode-map,lyskom-en-mode-map): Added
......
...@@ -1827,6 +1827,7 @@ not function names." ...@@ -1827,6 +1827,7 @@ not function names."
(lyskom-insert-before-prompt (concat msg "\n")) (lyskom-insert-before-prompt (concat msg "\n"))
(message msg)))) (message msg))))
;;;============================================================ ;;;============================================================
;;; Visa user-arean (kom-show-user-area) ;;; Visa user-arean (kom-show-user-area)
;;; ;;;
......
...@@ -315,6 +315,12 @@ KEYS should be a string in the format used for saving keyboard macros ...@@ -315,6 +315,12 @@ KEYS should be a string in the format used for saving keyboard macros
(lyskom-original-string-width (lyskom-string-make-multibyte str))) (lyskom-original-string-width (lyskom-string-make-multibyte str)))
(t (lyskom-original-string-width str)))))) (t (lyskom-original-string-width str))))))
;; XEmacs doesn't have detect-coding-string
;; Make a version that just plain doesn't do anything
(lyskom-function-alias detect-coding-string (string &optional highest)
(if highest 'undecided '(undecided)))
;;; ================================================================ ;;; ================================================================
;;; Faces and windows and stuff ;;; Faces and windows and stuff
......
...@@ -75,7 +75,7 @@ Value returned is always nil." ...@@ -75,7 +75,7 @@ Value returned is always nil."
(defvar lyskom-help-syntax (defvar lyskom-help-syntax
'((help (language) nil (section) lyskom-help-parse-process-finish) '((help (language) nil (section) lyskom-help-parse-process-finish)
(section (id prompt) nil (p list h1 h2 h3 inline refer keymap) lyskom-help-parse-process-section) (section (id prompt) nil (p list h1 h2 h3 inline refer keymap call) lyskom-help-parse-process-section)
(h1 nil nil (cref TEXT) nil) (h1 nil nil (cref TEXT) nil)
(h2 nil nil (cref TEXT) nil) (h2 nil nil (cref TEXT) nil)
(h3 nil nil (cref TEXT) nil) (h3 nil nil (cref TEXT) nil)
...@@ -85,6 +85,7 @@ Value returned is always nil." ...@@ -85,6 +85,7 @@ Value returned is always nil."
(list nil (header) (item) nil) (list nil (header) (item) nil)
(item nil nil (refer b i cref TEXT) nil) (item nil nil (refer b i cref TEXT) nil)
(keymap nil nil nil) (keymap nil nil nil)
(call (function) nil nil)
(inline (id) nil nil lyskom-help-parse-process-section-ref) (inline (id) nil nil lyskom-help-parse-process-section-ref)
(refer (id) nil nil lyskom-help-parse-process-section-ref) (refer (id) nil nil lyskom-help-parse-process-section-ref)
(cref (id) nil nil lyskom-help-parse-process-command-ref) (cref (id) nil nil lyskom-help-parse-process-command-ref)
......
<!-- -*-mode: xml-*- --> <!-- -*-mode: xml-*- -->
<help language="en"> <help language="en">
<section id="help-on-command" prompt="Command description">
<call function="lyskom-help-on-command" />
</section>
<section id="commands" prompt="Keyboard commands"> <section id="commands" prompt="Keyboard commands">
<p>Keyboard commands:</p> <p>Keyboard commands:</p>
<keymap /> <keymap />
......
<!-- -*-mode: xml-*- --> <!-- -*-mode: xml-*- -->
<help language="sv"> <help language="sv">
<section id="help-on-command" prompt="Kommandobeskrivning">
<call function="lyskom-help-on-command" />
</section>
<section id="commands" prompt="Snabbkommandon"> <section id="commands" prompt="Snabbkommandon">
<p>Snabbommandon:</p> <p>Snabbommandon:</p>
<keymap /> <keymap />
......
...@@ -92,6 +92,7 @@ ...@@ -92,6 +92,7 @@
(refer . lyskom-help-format-refer) (refer . lyskom-help-format-refer)
(cref . lyskom-help-format-cref) (cref . lyskom-help-format-cref)
(section . lyskom-help-format-section) (section . lyskom-help-format-section)
(call . lyskom-help-call-function)
(TEXT . lyskom-help-format-TEXT)) (TEXT . lyskom-help-format-TEXT))
) )
...@@ -165,6 +166,10 @@ ...@@ -165,6 +166,10 @@
(let ((this-command-keys nil)) (let ((this-command-keys nil))
(lyskom-insert (lyskom-help t)))) (lyskom-insert (lyskom-help t))))
(defun lyskom-help-call-function (data)
(let ((fn (lyskom-help-data-get-attr 'function data)))
(funcall (intern fn))))
(defun lyskom-help-format-refer (data) (defun lyskom-help-format-refer (data)
(let* ((id (intern (lyskom-help-data-get-attr 'id data))) (let* ((id (intern (lyskom-help-data-get-attr 'id data)))
(section (lyskom-help-get-section id)) (section (lyskom-help-get-section id))
...@@ -223,3 +228,37 @@ ...@@ -223,3 +228,37 @@
(lyskom-fill-region (point-min) (point-max)))) (lyskom-fill-region (point-min) (point-max))))
(lyskom-insert "\n\n") (lyskom-insert "\n\n")
(set-marker start nil))) (set-marker start nil)))
(defvar lyskom-swedish-bindings-reverse)
(defun lyskom-help-on-command (&rest args)
(let* ((cmd (lyskom-read-extended-command))
(specials (lyskom-menu-guess-shortcuts (current-local-map)))
(shortcut nil))
(when cmd
(if (assq cmd specials)
(unless (lyskom-traverse key (cdr (assq cmd specials))
(unless (condition-case nil
(eq (lookup-key (current-local-map) key) cmd)
(error nil))
(lyskom-traverse-break t)))
(setq shortcut
(mapconcat
(lambda (key)
(if (assq key lyskom-swedish-bindings-reverse)
(symbol-name
(cdr (assq key lyskom-swedish-bindings-reverse)))
(single-key-description key)))
(car (cdr (assq cmd specials)))
" ")))
(setq shortcut (delq nil (mapcar (lambda (kd) (unless (symbolp (elt kd 0)) kd))
(where-is-internal cmd)))))
(lyskom-format-insert "\n%#1C%#2?b%[ [%#2s]%]%[%]\n\n%#3s\n\n"
cmd
(if (stringp shortcut)
shortcut
(mapconcat
(lambda (x)
(format "`%s'" (key-description x)))
shortcut ", "))
(documentation cmd)))))
...@@ -350,7 +350,7 @@ Automatically created with def-komtype" type) ...@@ -350,7 +350,7 @@ Automatically created with def-komtype" type)
(charset (lyskom-mime-content-type-get content-type 'charset))) (charset (lyskom-mime-content-type-get content-type 'charset)))
(condition-case nil (condition-case nil
(cond (charset (lyskom-mime-decode-string str charset)) (cond (charset (lyskom-mime-decode-string str charset))
((and (setq charset (detect-coding-string str t)) ((and (setq charset (lyskom-detect-coding-string str t))
(not (memq charset '(raw-text undecided)))) (not (memq charset '(raw-text undecided))))
(lyskom-mime-decode-string str charset)) (lyskom-mime-decode-string str charset))
((setq charset lyskom-server-coding-system) ((setq charset lyskom-server-coding-system)
......
...@@ -125,6 +125,7 @@ ...@@ -125,6 +125,7 @@
(hline) (hline)
(item kom-save-text) (item kom-save-text)
(item kom-save-text-body) (item kom-save-text-body)
(item kom-view-url-in-text)
(hline) (hline)
(item kom-compare-texts) (item kom-compare-texts)
(item kom-diff-texts) (item kom-diff-texts)
......
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