summaryrefslogtreecommitdiff
path: root/lisp/tutorial.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2006-11-21 16:11:30 +0000
committerChong Yidong <cyd@stupidchicken.com>2006-11-21 16:11:30 +0000
commitd166ca6de5d41f5e9a57f5111a53bcb811064966 (patch)
treebd81f75d0f3d820bae7e49a965a63216a55f3d90 /lisp/tutorial.el
parent5e08fcbaceb46d490c249e17f4f6b7930b64b0ee (diff)
downloademacs-d166ca6de5d41f5e9a57f5111a53bcb811064966.tar.gz
(tutorial--default-keys): Add newline and delete-backward-char bindings.
(tutorial--detailed-help): Save excursion when finding keys. Correct warning string for M-x FOO case. (tutorial--display-changes): Print special keys in tutorial style. Tweak search regexp for changed keys.
Diffstat (limited to 'lisp/tutorial.el')
-rw-r--r--lisp/tutorial.el31
1 files changed, 23 insertions, 8 deletions
diff --git a/lisp/tutorial.el b/lisp/tutorial.el
index 564797752fa..b171ee9a07b 100644
--- a/lisp/tutorial.el
+++ b/lisp/tutorial.el
@@ -255,6 +255,7 @@ LEFT and RIGHT are the elements to compare."
(backward-sentence [?\M-a])
(forward-sentence [?\M-e])
+ (newline "\r")
(beginning-of-buffer [?\M-<])
(end-of-buffer [?\M->])
@@ -280,6 +281,7 @@ LEFT and RIGHT are the elements to compare."
;; C-u 8 * to insert ********.
(delete-backward-char [backspace])
+ (delete-backward-char "\d")
(delete-char [?\C-d])
(backward-kill-word [(meta backspace)])
@@ -375,7 +377,10 @@ LEFT and RIGHT are the elements to compare."
;;(tutorial-arg (button-get button 'tutorial-arg))
(explain-key-desc (button-get button 'explain-key-desc))
(changed-keys (with-current-buffer tutorial-buffer
- (tutorial--find-changed-keys tutorial--default-keys))))
+ (save-excursion
+ (goto-char (point-min))
+ (tutorial--find-changed-keys
+ tutorial--default-keys)))))
(when changed-keys
(insert
"The following key bindings used in the tutorial had been changed
@@ -416,7 +421,10 @@ from Emacs default in the " (buffer-name tutorial-buffer) " buffer:\n\n" )
(when (listp where)
(setq where "list"))
;; Tell where the old binding is now:
- (insert (format " %-11s " where))
+ (insert (format " %-11s "
+ (if (string= "" where)
+ (format "M-x %s" def-fun-txt)
+ where)))
;; Insert a link with more information, for example
;; current binding and keymap or information about
;; cua-mode replacements:
@@ -616,14 +624,21 @@ CHANGED-KEYS should be a list in the format returned by
(let ((here (point))
(case-fold-search nil)
(key-desc (key-description key)))
+ (cond ((string= "ESC" key-desc)
+ (setq key-desc "<ESC>"))
+ ((string= "RET" key-desc)
+ (setq key-desc "<Return>"))
+ ((string= "DEL" key-desc)
+ (setq key-desc "<Delback>")))
(while (re-search-forward
- (concat (regexp-quote key-desc)
- "[[:space:]]") nil t)
- (put-text-property (match-beginning 0)
- (match-end 0)
+ (concat "[[:space:]]\\("
+ (regexp-quote key-desc)
+ "\\)[[:space:]]") nil t)
+ (put-text-property (match-beginning 1)
+ (match-end 1)
'tutorial-remark 'only-colored)
- (put-text-property (match-beginning 0)
- (match-end 0)
+ (put-text-property (match-beginning 1)
+ (match-end 1)
'face 'tutorial-warning-face)
(forward-line)
(let ((s (get-lang-string tutorial--lang 'tut-chgdkey))