aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/tutorial.el
diff options
context:
space:
mode:
authorChong Yidong2006-11-21 16:11:30 +0000
committerChong Yidong2006-11-21 16:11:30 +0000
commitd166ca6de5d41f5e9a57f5111a53bcb811064966 (patch)
treebd81f75d0f3d820bae7e49a965a63216a55f3d90 /lisp/tutorial.el
parent5e08fcbaceb46d490c249e17f4f6b7930b64b0ee (diff)
downloademacs-d166ca6de5d41f5e9a57f5111a53bcb811064966.tar.gz
emacs-d166ca6de5d41f5e9a57f5111a53bcb811064966.zip
(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."
255 (backward-sentence [?\M-a]) 255 (backward-sentence [?\M-a])
256 (forward-sentence [?\M-e]) 256 (forward-sentence [?\M-e])
257 257
258 (newline "\r")
258 259
259 (beginning-of-buffer [?\M-<]) 260 (beginning-of-buffer [?\M-<])
260 (end-of-buffer [?\M->]) 261 (end-of-buffer [?\M->])
@@ -280,6 +281,7 @@ LEFT and RIGHT are the elements to compare."
280 ;; C-u 8 * to insert ********. 281 ;; C-u 8 * to insert ********.
281 282
282 (delete-backward-char [backspace]) 283 (delete-backward-char [backspace])
284 (delete-backward-char "\d")
283 (delete-char [?\C-d]) 285 (delete-char [?\C-d])
284 286
285 (backward-kill-word [(meta backspace)]) 287 (backward-kill-word [(meta backspace)])
@@ -375,7 +377,10 @@ LEFT and RIGHT are the elements to compare."
375 ;;(tutorial-arg (button-get button 'tutorial-arg)) 377 ;;(tutorial-arg (button-get button 'tutorial-arg))
376 (explain-key-desc (button-get button 'explain-key-desc)) 378 (explain-key-desc (button-get button 'explain-key-desc))
377 (changed-keys (with-current-buffer tutorial-buffer 379 (changed-keys (with-current-buffer tutorial-buffer
378 (tutorial--find-changed-keys tutorial--default-keys)))) 380 (save-excursion
381 (goto-char (point-min))
382 (tutorial--find-changed-keys
383 tutorial--default-keys)))))
379 (when changed-keys 384 (when changed-keys
380 (insert 385 (insert
381 "The following key bindings used in the tutorial had been changed 386 "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" )
416 (when (listp where) 421 (when (listp where)
417 (setq where "list")) 422 (setq where "list"))
418 ;; Tell where the old binding is now: 423 ;; Tell where the old binding is now:
419 (insert (format " %-11s " where)) 424 (insert (format " %-11s "
425 (if (string= "" where)
426 (format "M-x %s" def-fun-txt)
427 where)))
420 ;; Insert a link with more information, for example 428 ;; Insert a link with more information, for example
421 ;; current binding and keymap or information about 429 ;; current binding and keymap or information about
422 ;; cua-mode replacements: 430 ;; cua-mode replacements:
@@ -616,14 +624,21 @@ CHANGED-KEYS should be a list in the format returned by
616 (let ((here (point)) 624 (let ((here (point))
617 (case-fold-search nil) 625 (case-fold-search nil)
618 (key-desc (key-description key))) 626 (key-desc (key-description key)))
627 (cond ((string= "ESC" key-desc)
628 (setq key-desc "<ESC>"))
629 ((string= "RET" key-desc)
630 (setq key-desc "<Return>"))
631 ((string= "DEL" key-desc)
632 (setq key-desc "<Delback>")))
619 (while (re-search-forward 633 (while (re-search-forward
620 (concat (regexp-quote key-desc) 634 (concat "[[:space:]]\\("
621 "[[:space:]]") nil t) 635 (regexp-quote key-desc)
622 (put-text-property (match-beginning 0) 636 "\\)[[:space:]]") nil t)
623 (match-end 0) 637 (put-text-property (match-beginning 1)
638 (match-end 1)
624 'tutorial-remark 'only-colored) 639 'tutorial-remark 'only-colored)
625 (put-text-property (match-beginning 0) 640 (put-text-property (match-beginning 1)
626 (match-end 0) 641 (match-end 1)
627 'face 'tutorial-warning-face) 642 'face 'tutorial-warning-face)
628 (forward-line) 643 (forward-line)
629 (let ((s (get-lang-string tutorial--lang 'tut-chgdkey)) 644 (let ((s (get-lang-string tutorial--lang 'tut-chgdkey))