;;; tutorial.el --- tutorial for Emacs
-;; Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2011 Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: help, internal
+;; Package: emacs
;; This file is part of GNU Emacs.
for the function it is remapped to)"
(with-output-to-temp-buffer (help-buffer)
(help-setup-xref (list #'tutorial--describe-nonstandard-key value)
- (interactive-p))
+ (called-interactively-p 'interactive))
(with-current-buffer (help-buffer)
(insert
"Your Emacs customizations override the default binding for this key:"
" is the command `")
(insert (format "%s" db))
(insert "'. "
- "However, your customizations have rebound it to the command `")
- (insert (format "%s" cb))
- (insert "'.")
+ "However, your customizations have "
+ (if cb
+ (format "rebound it to the command `%s'" cb)
+ "unbound it"))
+ (insert ".")
(when mapsym
(insert " (For the more advanced user:"
" This binding is in the keymap `"
(format "%s" db)
"'.")))
(fill-region (point-min) (point)))))
- (print-help-return-message))))
+ (help-print-return-message))))
(defun tutorial--sort-keys (left right)
"Sort predicate for use with `tutorial--default-keys'.
(save-buffers-kill-terminal [?\C-x ?\C-c])
;; * SUMMARY
- (scroll-up [?\C-v])
- (scroll-down [?\M-v])
+ (scroll-up-command [?\C-v])
+ (scroll-down-command [?\M-v])
(recenter-top-bottom [?\C-l])
;; * BASIC CURSOR CONTROL
;; * INSERTING AND DELETING
;; C-u 8 * to insert ********.
(delete-backward-char "\d")
- (delete-char [?\C-d])
+ (delete-forward-char [?\C-d])
(backward-kill-word [?\M-\d])
(kill-word [?\M-d])
(kill-line [?\C-k])
(yank-pop [?\M-y])
;; * UNDO
- (advertised-undo [?\C-x ?u])
- (advertised-undo [?\C-x ?u])
+ (undo [?\C-x ?u])
;; * FILES
(find-file [?\C-x ?\C-f])
"Give detailed help about changed keys."
(with-output-to-temp-buffer (help-buffer)
(help-setup-xref (list #'tutorial--detailed-help button)
- (interactive-p))
+ (called-interactively-p 'interactive))
(with-current-buffer (help-buffer)
(let* ((tutorial-buffer (button-get button 'tutorial-buffer))
(explain-key-desc (button-get button 'explain-key-desc))
(insert "
It is OK to change key bindings, but changed bindings do not
correspond to what the tutorial says.\n\n")
- (print-help-return-message)))))
+ (help-print-return-message)))))
(defun tutorial--find-changed-keys (default-keys)
"Find the key bindings used in the tutorial that have changed.
current-language-environment
"English")))
(filename (get-language-info lang 'tutorial))
- ;; Choose a buffer name including the language so that
- ;; several languages can be tested simultaneously:
- (tut-buf-name (concat "TUTORIAL (" lang ")"))
+ (tut-buf-name filename)
(old-tut-buf (get-buffer tut-buf-name))
(old-tut-win (when old-tut-buf (get-buffer-window old-tut-buf t)))
(old-tut-is-ok (when old-tut-buf
(if old-tut-file
(progn
(insert-file-contents (tutorial--saved-file))
+ (let ((enable-local-variables :safe))
+ (hack-local-variables))
(goto-char (point-min))
(setq old-tut-point
(string-to-number
(goto-char tutorial--point-before-chkeys)
(setq tutorial--point-before-chkeys (point-marker)))
(insert-file-contents (expand-file-name filename tutorial-directory))
+ (let ((enable-local-variables :safe))
+ (hack-local-variables))
(forward-line)
(setq tutorial--point-before-chkeys (point-marker)))
(when (< old-point 1)
(setq old-point 1))
(goto-char old-point))
+ ;; Delete the arch-tag line, so as not to confuse readers.
+ (goto-char (point-max))
+ (if (search-backward ";;; arch-tag: " nil t)
+ (delete-region (point) (point-max)))
(goto-char (point-min))
(search-forward "\n<<")
(beginning-of-line)
(provide 'tutorial)
-;; arch-tag: c8e80aef-c3bb-4ffb-8af6-22171bf0c100
;;; tutorial.el ends here