;ELC ;;; Compiled by cyd@localhost on Mon Apr 23 22:21:13 2007 ;;; from file /home/cyd/emacs/lisp/tutorial.el ;;; in Emacs version 22.0.99 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. (if (and (boundp 'emacs-version) (< (aref emacs-version (1- (length emacs-version))) ?A) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19.29"))) (error "`tutorial.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\302\303\304\305\306\307%\207" [require help-mode custom-declare-face tutorial-warning-face ((t :inherit font-lock-warning-face)) "Face used to highlight warnings in the tutorial." :group help] 6) #@38 Point before display of key changes. (defvar tutorial--point-before-chkeys 0 (#$ . 785)) (make-variable-buffer-local 'tutorial--point-before-chkeys) #@37 Point after display of key changes. (defvar tutorial--point-after-chkeys 0 (#$ . 940)) (make-variable-buffer-local 'tutorial--point-after-chkeys) #@20 Tutorial language. (defvar tutorial--lang nil (#$ . 1092)) (make-variable-buffer-local 'tutorial--lang) #@934 Give more information about a changed key binding. This is used in `help-with-tutorial'. The information includes the key sequence that no longer has a default binding, the default binding and the current binding. It also tells in what keymap the new binding has been done and how to access the function in the default binding from the keyboard. For `cua-mode' key bindings that try to combine CUA key bindings with default Emacs bindings information about this is shown. VALUE should have either of these formats: (cua-mode) (current-binding KEY-FUN DEF-FUN KEY WHERE) Where KEY is a key sequence whose standard binding has been changed KEY-FUN is the actual binding for KEY DEF-FUN is the standard binding of KEY WHERE is a text describing the key sequences to which DEF-FUN is bound now (or, if it is remapped, a key sequence for the function it is remapped to) (defalias 'tutorial--describe-nonstandard-key #[(value) "\306 \220\307\310Dt\"\210r\306 q\210\311\312\261\210\313@\314=\203#\315c\210\202\327@\316=\203\327A@\3178\3208\3218\322\323 \322-./ \203i @0\3240-\313#1 A1/=\203e0\322*\202D\f\203q\325\326!\210\327\330-!\331\261\210\332\333.\"c\210\334\335\261\210\332\333/\"c\210\336c\210\n\203\236\337\340\332\333\n\"\341\261\210 \342\230\203\270\343.!\204\320\344\332\333.\"\345\261\210\202\320\346\347 \350\230\203\304\342\202\305\351 \352\332\333.\"\336\261\210.\353e`\"\210)\354 )\221\207" [value inhibit-read-only mapsym maps map where help-buffer help-setup-xref tutorial--describe-nonstandard-key "Your Emacs customizations override the default binding for this key:" "\n\n" t cua-mode "CUA mode is enabled.\n\nWhen CUA mode is enabled, you can use C-z, C-x, C-c, and C-v to\nundo, cut, copy, and paste in addition to the normal Emacs\nbindings. The C-x and C-c keys only do cut and copy when the\nregion is active, so in most cases, they do not conflict with the\nnormal function of these prefix keys.\n\nIf you really need to perform a command which starts with one of\nthe prefix keys even when the region is active, you have three\noptions:\n- press the prefix key twice very quickly (within 0.2 seconds),\n- press the prefix key and the following key within 0.2 seconds, or\n- use the SHIFT key with the prefix key, i.e. C-S-x or C-S-c." current-binding 2 3 4 nil current-active-maps lookup-key mapatoms #[(s) "?\205#\303 !\205#\304 J!\205# \302=?\205#\n J=\205# \211\207" [mapsym s map boundp keymapp] 2] "The default Emacs binding for the key " key-description " is the command `" format "%s" "'. " "However, your customizations have rebound it to the command `" "'." " (For the more advanced user:" " This binding is in the keymap `" "'.)" "" keymapp "\n\nYou can use M-x " " RET instead." "\n\nWith your current key bindings" " you can use " "the menus" "the key " " to get the function `" fill-region print-help-return-message key db cb m mb] 9 (#$ . 1203)]) #@219 Sort predicate for use with `tutorial--default-keys'. This is a predicate function to `sort'. The sorting is for presentation purpose only and is done on the key sequence. LEFT and RIGHT are the elements to compare. (defalias 'tutorial--sort-keys #[(left right) "\306\211A@)\307\"\306\n\211A@)\307\" \2037 \2037 <\2037 <\2037 @ @\232\2037 A A\202 @ @\211\203V\f\203V <\203V\f<\203V\310 \f\"\202\215\311 !\203h\311\f!\203h \fV\202\215\311 !\203r\312\202\215\311\f!\203|\307\202\215 9\205\215\f9\205\215\313\f!\313 !\231,\207" [left x right y cy cx append nil tutorial--sort-keys wholenump t symbol-name] 5 (#$ . 4222)]) #@58 Default Emacs key bindings that the tutorial depends on. (defconst tutorial--default-keys (byte-code "\203\303\202 \301\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372 \373B\2578\374\n\375\"*\207" [window-system suspend-emacs default-keys iconify-or-deiconify-frame (ESC-prefix [27]) (Control-X-prefix [24]) (mode-specific-command-prefix [3]) (save-buffers-kill-emacs [24 3]) (scroll-up [22]) (scroll-down [134217846]) (recenter [12]) (forward-char [6]) (backward-char [2]) (forward-word [134217830]) (backward-word [134217826]) (next-line [14]) (previous-line [16]) (move-beginning-of-line [1]) (move-end-of-line [5]) (backward-sentence [134217825]) (forward-sentence [134217829]) (newline " ") (beginning-of-buffer [134217788]) (end-of-buffer [134217790]) (universal-argument [21]) (keyboard-quit [7]) (downcase-region [24 12]) (delete-other-windows [24 49]) (delete-backward-char "") (delete-char [4]) (backward-kill-word [134217855]) (kill-word [134217828]) (kill-line [11]) (kill-sentence [134217835]) (set-mark-command [0]) (set-mark-command [67108896]) (kill-region [23]) (yank [25]) (yank-pop [134217849]) (advertised-undo [24 117]) (advertised-undo [24 117]) (find-file [24 6]) (save-buffer [24 19]) (list-buffers [24 2]) (switch-to-buffer [24 98]) (save-some-buffers [24 115]) (execute-extended-command [134217848]) (describe-mode [8 109]) (set-fill-column [24 102]) (fill-paragraph [134217841]) (isearch-forward [19]) (isearch-backward [18]) (split-window-vertically [24 50]) (scroll-other-window [134217750]) (other-window [24 111]) (find-file-other-window [24 52 6]) (keyboard-escape-quit [27 27 27]) (describe-key-briefly [8 99]) (describe-key [8 107]) ([26]) sort tutorial--sort-keys] 57) (#$ . 4879)) #@40 Give detailed help about changed keys. (defalias 'tutorial--detailed-help #[(button) "\306 \220\307\310Dt\"\210r\306 q\210\311\301\"\311\302\"r q\210\212eb\210\312 !*\211\203\356\313c\210\314\315 \316\317\320$c\210)\f\321.\211/\203\355/@\211.A@0.@1\322.82\323.83\324.84\3250!5\3261!6r q\210\3271!)7\321807=\204\3426\n\230\203\227\330\3316G\332\3336%\210\3346\335\261\210\336j\210\3372\3400\341\342\343\344&\210\345j\2103<\203\272\3463\315\3473\350\230\203\313\315\3512\"\202\3153\"c\210\3374@\341\352\3404A\343\344&\210\353c\210. /A\211/\204B*\354c\210\355 ,\221\207" [button tutorial-buffer explain-key-desc tutorial--default-keys changed-keys frm help-buffer help-setup-xref tutorial--detailed-help button-get tutorial--find-changed-keys "The following key bindings used in the tutorial have been changed\nfrom the Emacs default:\n\n" " %-14s %-27s %-16s\n" format "Standard Key" "Command" "In Your Emacs" nil 2 3 4 command-remapping key-description key-binding put-text-property 0 face tutorial-warning-face " " " " 18 insert-button value action #[(button) "\301\302\303\"!\207" [button describe-function button-get value] 4 nil nil] follow-link t 45 "list" " %-16s " "" "M-x %s" #[(b) "\302\301\"\303 !)\207" [b value button-get tutorial--describe-nonstandard-key] 3 nil nil] "\n" "\nIt is OK to change key bindings, but changed bindings do not\ncorrespond to what the tutorial says.\n\n" print-help-return-message tk #1=#:--cl-dolist-temp-- def-fun key def-fun-txt where remark rem-fun key-txt key-fun tot-len] 11 (#$ . 6781)]) #@1068 Find the key bindings used in the tutorial that have changed. Return a list with elements of the form '(KEY DEF-FUN DEF-FUN-TXT WHERE REMARK QUIET) where KEY is a key sequence whose standard binding has been changed DEF-FUN is the standard binding of KEY DEF-FUN-TXT is a short descriptive text for DEF-FUN WHERE is a text describing the key sequences to which DEF-FUN is bound now (or, if it is remapped, a key sequence for the function it is remapped to) REMARK is a list with info about rebinding. It has either of these formats: (TEXT cua-mode) (TEXT current-binding KEY-FUN DEF-FUN KEY WHERE) Here TEXT is a link text to show to the user. The rest of the list is used to show information when the user clicks the link. KEY-FUN is the actual binding for KEY. QUIET is t if this changed keybinding should be handled quietly. This is used by `tutorial--display-changes'. (defalias 'tutorial--find-changed-keys #[(default-keys) "\306\211\307\310!\311\216r\nq\210\312 \210 \306\211\203\203 @\211A@8\f@9\313\3149\":\3159!;9\316=\203A\317<\320\"\202E\3218!=\322;\203R;\202T9!\211>\203{\323>@!>\324>GW\203~>\325\326GO\326\230\203~\327>\202~\330>\306=9=\204z=\203\227=\3159!=\204z\203\2778\331\232\203\252=\332=\204\2708\333\232\203\277=\334=\203\277\335\336D\202j\203 9\316=\203\331=\337\232\203\331\340\211:\2049\341=\203\356=\342\232\203\356\343\211:\2049\344=\203 =\345\232\203 \346\211:\203 \347\336D\350>\202j\351\352!\203<\351\353!\203<+\354=\203<9\355=\203.=\356=\204z9\357=\203<=\360=\204z?\203]8\361\232\203O=\362\232\204z8\363\232\203]=\364\232\204z\365\366=98>\257\367\30189:>\306\257\"\210. A\211\204- *\207" [remark changed-keys #1=#:temp-buffer default-keys kdf #2=#:--cl-dolist-temp-- nil generate-new-buffer " *temp*" ((byte-code "\301!\203\n\302!\210\301\207" [#1# buffer-name kill-buffer] 2)) fundamental-mode format "%s" command-remapping ESC-prefix lookup-key [27] key-binding where-is-internal key-description 10 0 "" "the menus" "" [22] cua-paste [26] undo "cua-mode, more info" cua-mode (keymap (118 . cua-repeat-replace-region)) "\"ESC prefix\"" mode-specific-command-prefix (keymap (timeout . copy-region-as-kill)) "\"C-c prefix\"" Control-X-prefix (keymap (timeout . kill-region)) "\"C-x prefix\"" "cua-mode replacement" "Same key" boundp viper-mode-string viper-current-state vi-state isearch-forward viper-isearch-forward isearch-backward viper-isearch-backward [C-delete] kill-word [C-backspace] backward-kill-word "more info" current-binding add-to-list key def-fun def-fun-txt rem-fun global-map key-fun where normal-erase-is-backspace] 9 (#$ . 8384)]) (defalias 'tutorial--key-description #[(key) "\302!\211\303\230\203\304\202# \305\230\203\306\202# \307\230\203\"\310\202# )\207" [key desc key-description "ESC" "" "RET" "" "DEL" ""] 3]) #@207 Display changes to some default key bindings. If some of the default key bindings that the tutorial depends on have been changed then display the changes in the tutorial buffer with some explanatory links. (defalias 'tutorial--display-changes #[nil "\306!\307\310 \"\311`\311\312\313\314\315#\316Q9\317\320!\203#\321\322!\210 \204-\317\320!\203g\323:\324\"\323:\325\";\211<\203f;\203f=b\210<\326\261\210\327;\330p\331\332\333\334\335\336& \210\337c\210\340=`\341#\210*eb\210\3429d\334#\205F\343\344\345!\n\"\211\203j\346\345\224\347\"\204j @> A\211?@@?A@A\350?8B\311\211CD\311EB\351\230\204AB\352\230\203\274\353\354A\"B\355 F\323:\356\"C\323:\357\"DC\205\340D\205\340\353C>B#E\340\345\224\345\225\360#\210E\203A\361?8\203\362\345\224\345\225\363E$\210\202A\212\361?\233\334\240\210\311y\210\346`\347\"\364=\203\311y\210\202`\365E\326\261\210\327D\330p\331\332\366>\333\334\335\336& \210\367c\210\340\f`\370#\210).\202j.\207" [tutorial--default-keys changed-keys changed-keys-alist changed-key start case-fold-search tutorial--find-changed-keys mapcar #[(ck) "\301@!B\207" [ck tutorial--key-description] 2] nil "[[:space:]]\\(" mapconcat #[(kdf) "\301\302A@!!\207" [kdf regexp-quote tutorial--key-description] 3] "\\|" "\\)[[:punct:][:space:]]" boundp viper-mode-string require cus-edit get-lang-string tut-chgdhead tut-chgdhead2 " [" insert-button tutorial-buffer action tutorial--detailed-help follow-link t face link "]\n\n" add-text-properties (tutorial-remark remark face tutorial-warning-face read-only t) re-search-forward assoc match-string 1 get-text-property tutorial-remark 3 "Same key" "" format "M-x %s" point-marker tut-chgdkey tut-chgdkey2 (face tutorial-warning-face tutorial-remark key-sequence) 5 put-text-property help-echo remark "** " explain-key-desc "] **\n" (tutorial-remark remark rear-nonsticky t face tutorial-warning-face read-only t) keybindings-regexp tutorial--lang head2 head tutorial--point-before-chkeys desc ck key def-fun where s1 s2 help-string tutorial--point-after-chkeys] 13 (#$ . 11520)]) #@41 Directory to which tutorials are saved. (defalias 'tutorial--saved-dir #[nil "\301\302\303=\203\f\304\202 \305\"\207" [system-type expand-file-name "tutorial" ms-dos "~/_emacs.d/" "~/.emacs.d/"] 4 (#$ . 13636)]) #@39 File name in which to save tutorials. (defalias 'tutorial--saved-file #[nil "\303! \203 \304\230\203\n\305P\306\n\307 \"*\207" [tutorial--lang ext file-name file-name-extension "" ".tut" expand-file-name tutorial--saved-dir] 3 (#$ . 13857)]) #@64 Remove the remark lines that was added to the tutorial buffer. (defalias 'tutorial--remove-remarks #[nil "\212eb\210\303\211\211\304`\305\"\203`\211\202\306`\305\"\211\205@\306\n\305\"\304\n\305\" \2040d b\210\307=\204\n\n |\210\202\n,\207" [prop-val prop-end prop-start nil get-text-property tutorial-remark next-single-property-change key-sequence] 3 (#$ . 14114)]) #@214 Save the tutorial buffer. This saves the part of the tutorial before and after the area showing changed keys. It also saves the point position and the position where the display of changed bindings was inserted. (defalias 'tutorial--save-tutorial #[nil "\300\301\302\217\207" [err (byte-code "\300\301!\205\n\302\303 !\207" [y-or-n-p "Save your position in the tutorial? " tutorial--save-tutorial-to tutorial--saved-file] 2) ((error (byte-code "\301\302\303!\"\207" [err message "Error saving tutorial state: %s" error-message-string] 4)))] 3 (#$ . 14506)]) #@93 Save the tutorial buffer to SAVED-FILE. See `tutorial--save-tutorial' for more information. (defalias 'tutorial--save-tutorial-to #[(saved-file) "\306 \204 \307`W\205y\310 \311\312 !\204\313\314\315\217\210\312 !\203t\n\316U\203+`\2029`\nW\2036`[\2029`\nZ`\311\317\320 \210eb\210\321!\322\321\323!!\322\261\210\313\324\325\217\210\313\326\327\217\210 b\210\203m\330\331!\202p\330\332!,\202x\330\333 \"*\207" [save-err tutorial-dir tutorial--point-after-chkeys inhibit-read-only buffer-undo-list old-point buffer-modified-p 1 tutorial--saved-dir nil file-directory-p err (make-directory tutorial-dir nil) ((error (byte-code "\303\304\305 \306\n!#\207" [save-err tutorial-dir err t warn "Could not create directory %s: %s" error-message-string] 5))) 0 t tutorial--remove-remarks number-to-string "\n" marker-position (byte-code "\301\302\211#\207" [saved-file write-region nil] 4) ((error (byte-code "\303\304\305 \306\n!#\207" [save-err saved-file err t warn "Could not save tutorial to %s: %s" error-message-string] 5))) (undo-only) ((error)) message "Could not save tutorial state." "Saved tutorial state." "Can't save tutorial: %s is not a directory" tut-point tutorial--point-before-chkeys] 5 (#$ . 15073)]) #@695 Select the Emacs learn-by-doing tutorial. If there is a tutorial version written in the language of the selected language environment, that version is used. If there's no tutorial in that language, `TUTORIAL' is selected. With ARG, you are asked to choose which language. If DONT-ASK-FOR-REVERT is non-nil the buffer is reverted without any question when restarting the tutorial. If any of the standard Emacs key bindings that are used in the tutorial have been changed then an explanatory note about this is shown in the beginning of the tutorial buffer. When the tutorial buffer is killed the content and the point position in the buffer is saved so that the tutorial may be resumed later. (defalias 'help-with-tutorial #[(&optional arg dont-ask-for-revert) "\306\307!\203-\310\311\312\313!\203(\314 P!\203\"\315\316!\210\313\317!\202+\315\320!\202+\315 !*\207\n\203A \321\303\322\"\210\323\324\325\326#)\202M\327\f\324\"\203L\f\202M\326\327 \324\"@\330 \331QA\332A!\211B\205i\333B\334\"CB\205u\335B!?D\336E\337FeGC\203\224\340\341\342\333B\334\"!!!\210\202\236B\203\236\343B!\210\344 \210B\203\267D\204\267H?\205\265\314\345!?DD?\205,\343\346A!!\210B\204\314\347 \210 \204\324\350\351!\210 I\352\353 !E\334J\354 \210)\315\355!\210\356\317!\210\336K\321\357\360\336\334$\210H\203\376\336EE\203\314\361!EE\203>\362\353 !\210eb\210\363\364\365 \366 \"!F\336y\210\363\364\365 \366 \"!L\336y\210e`|\210Lb\210\367 L\202N\362\370@M\"!\210\336y\210\367 L\371 \210H\204^\315\316!\210\356\317!\210E\203\210\317FV\203pF[\202uFG\\\211N\337W\203\200\337NNb\210)\202$eb\210\372\373!\210\374 \210\212\337y\210\375\376!)\203\247`\337y\210`|\210\202\324\375\377!\203\270\201Q\201R!\210\202\324\375\201S!\210\201Q\201T!\210\372\201U!\210\201Q\201V!\210\374 \210\201W\201X !\201Ye`\"Z\201ZZ\211O\201[W\203`\336\210`|\210\201\\O!\210\202 \201\\O\201]\245!\210\337y\210\201\\O\211\201]\245Z!\210)eb\210\336P\201^\336!.\207" [prompt2 prompt1 arg minibuffer-setup-hook current-language-environment lang boundp viper-current-state "You can not run the Emacs tutorial directly because you have enabled Viper." "\nThere is however a Viper tutorial you can run instead.\nRun the Viper tutorial? " fboundp viper-tutorial y-or-n-p message "" 0 "Tutorial aborted by user" add-hook minibuffer-completion-help read-language-name tutorial "Language: " "English" get-language-info "TUTORIAL (" ")" get-buffer get-buffer-window t buffer-modified-p nil 1 raise-frame window-frame select-window switch-to-buffer delete-other-windows "You have changed the Tutorial buffer. Revert it? " get-buffer-create text-mode error "Variable lang is nil" file-exists-p tutorial--saved-file erase-buffer "Preparing tutorial ..." sit-for kill-buffer-hook tutorial--save-tutorial "Resume your last saved tutorial? " insert-file-contents string-to-number buffer-substring-no-properties line-beginning-position line-end-position point-marker expand-file-name tutorial--display-changes search-forward "\n<<" beginning-of-line looking-at "\\[" "<>" filename tut-buf-name old-tut-buf old-tut-win old-tut-is-ok old-tut-file old-tut-point tutorial--point-after-chkeys dont-ask-for-revert tutorial--lang inhibit-read-only buffer-auto-save-file-name tutorial--point-before-chkeys data-directory old-point n buffer-undo-list replace-match "[Middle of page left blank for didactic purposes. Text continues below]" "<<" "[" ">>" "]" window-height selected-window count-lines 6 8 newline 2 set-buffer-modified-p] 7 (#$ . 16319) "P"]) #@332 Language specific strings for Emacs. This is an association list with the keys equal to the strings that can be returned by `read-language-name'. The elements in the list are themselves association lists with keys that are string ids and values that are the language specific strings. See `get-lang-string' for more information. (defconst lang-strings '(("English" (tut-chgdkey . "%s has been rebound, but you can use %s instead") (tut-chgdkey2 . "More") (tut-chgdhead . "\n NOTICE: The main purpose of the Emacs tutorial is to teach you\n the most important standard Emacs commands (key bindings).\n However, your Emacs has been customized by changing some of\n these basic editing commands, so it doesn't correspond to the\n tutorial. We have inserted colored notices where the altered\n commands have been introduced.") (tut-chgdhead2 . "More"))) (#$ . 19943)) #@591 Get a language specific string for Emacs. In certain places Emacs can replace a string showed to the user with a language specific string. This function retrieves such strings. LANG is the language specification. It should be one of those strings that can be returned by `read-language-name'. STRINGID is a symbol that specifies the string to retrieve. If no string is found for STRINGID in the choosen language then the English string is returned unless NO-ENG-FALLBACK is non-nil. See `lang-strings' for more information. Currently this feature is only used in `help-with-tutorial'. (defalias 'get-lang-string #[(lang stringid &optional no-eng-fallback) "\306 \"\307\211\203\306\f A\"\211\203 A)\n\204( \204(\310\311\f\312#\n*\207" [lang lang-strings found-string my-lang-strings stringid entry assoc nil get-lang-string "English" t no-eng-fallback] 5 (#$ . 20817)]) (provide 'tutorial)