diff options
| -rw-r--r-- | lispintro/ChangeLog | 20 | ||||
| -rw-r--r-- | lispintro/emacs-lisp-intro.texi | 105 |
2 files changed, 70 insertions, 55 deletions
diff --git a/lispintro/ChangeLog b/lispintro/ChangeLog index 4784cfde92b..249ae0d3037 100644 --- a/lispintro/ChangeLog +++ b/lispintro/ChangeLog | |||
| @@ -1,5 +1,25 @@ | |||
| 1 | 2006-11-05 Robert J. Chassell <bob@rattlesnake.com> | 1 | 2006-11-05 Robert J. Chassell <bob@rattlesnake.com> |
| 2 | 2 | ||
| 3 | * emacs-lisp-intro.texi: Yet more minor changes: | ||
| 4 | (defcustom): Said that `:options' is usually for a hook. Remove | ||
| 5 | extraneous space in parenthetical remark concerning | ||
| 6 | `text-mode-hook-identify'. At end, mention other defines, too. | ||
| 7 | (Beginning a .emacs File): Reverse words about comments so they | ||
| 8 | parallel numbers of listed semi-colons. | ||
| 9 | (Text and Auto-fill): Remove extraneous blank line in example. | ||
| 10 | (Mail Aliases): Remove extraneous blank line in example. | ||
| 11 | (Keybindings): Reformat as needed with `key' rather than `kbd'. | ||
| 12 | (Keybindings, Miscellaneous, Mode Line): For small book format, start | ||
| 13 | section name on top of new page. | ||
| 14 | (Simple Extension): Replace longer expression with | ||
| 15 | `emacs-major-version'. Remove comment about `number-to-string' | ||
| 16 | function. | ||
| 17 | (Miscellaneous): Add filename option, `-H', to `grep' example | ||
| 18 | (debug, debug-on-entry): Replace `GNU Emacs 22' with `a recent | ||
| 19 | GNU Emacs'. | ||
| 20 | (edebug): More properly state where to place point for 'M-x | ||
| 21 | edebug-defun'. | ||
| 22 | |||
| 3 | * emacs-lisp-intro.texi: More minor changes. | 23 | * emacs-lisp-intro.texi: More minor changes. |
| 4 | Center images for TeX output. | 24 | Center images for TeX output. |
| 5 | (kill-new function): Remove indentation for sentence talking about | 25 | (kill-new function): Remove indentation for sentence talking about |
diff --git a/lispintro/emacs-lisp-intro.texi b/lispintro/emacs-lisp-intro.texi index ef2d2fea111..1ea17f14704 100644 --- a/lispintro/emacs-lisp-intro.texi +++ b/lispintro/emacs-lisp-intro.texi | |||
| @@ -24,7 +24,7 @@ | |||
| 24 | 24 | ||
| 25 | @comment %**end of header | 25 | @comment %**end of header |
| 26 | 26 | ||
| 27 | @set edition-number 3.04 | 27 | @set edition-number 3.05 |
| 28 | @set update-date 5 November 2006 | 28 | @set update-date 5 November 2006 |
| 29 | 29 | ||
| 30 | @ignore | 30 | @ignore |
| @@ -17082,7 +17082,7 @@ The @code{:type} keyword tells Emacs the kind of data to which | |||
| 17082 | Customization buffer. | 17082 | Customization buffer. |
| 17083 | 17083 | ||
| 17084 | The @code{:options} keyword specifies a suggested list of values for | 17084 | The @code{:options} keyword specifies a suggested list of values for |
| 17085 | the variable. Currently, you can use @code{:options} only for a hook. | 17085 | the variable. Usually, @code{:options} applies to a hook. |
| 17086 | The list is only a suggestion; it is not exclusive; a person who sets | 17086 | The list is only a suggestion; it is not exclusive; a person who sets |
| 17087 | the variable may set it to other values; the list shown following the | 17087 | the variable may set it to other values; the list shown following the |
| 17088 | @code{:options} keyword is intended to offer convenient choices to a | 17088 | @code{:options} keyword is intended to offer convenient choices to a |
| @@ -17092,6 +17092,7 @@ Finally, the @code{:group} keyword tells the Emacs Customization | |||
| 17092 | command in which group the variable is located. This tells where to | 17092 | command in which group the variable is located. This tells where to |
| 17093 | find it. | 17093 | find it. |
| 17094 | 17094 | ||
| 17095 | The @code{defcustom} function recognizes more than a dozen keywords. | ||
| 17095 | For more information, see @ref{Customization, , Writing Customization | 17096 | For more information, see @ref{Customization, , Writing Customization |
| 17096 | Definitions, elisp, The GNU Emacs Lisp Reference Manual}. | 17097 | Definitions, elisp, The GNU Emacs Lisp Reference Manual}. |
| 17097 | 17098 | ||
| @@ -17135,8 +17136,7 @@ It will look like this: | |||
| 17135 | @noindent | 17136 | @noindent |
| 17136 | (The @code{text-mode-hook-identify} function tells | 17137 | (The @code{text-mode-hook-identify} function tells |
| 17137 | @code{toggle-text-mode-auto-fill} which buffers are in Text mode. | 17138 | @code{toggle-text-mode-auto-fill} which buffers are in Text mode. |
| 17138 | It comes on automatically. | 17139 | It comes on automatically.) |
| 17139 | ) | ||
| 17140 | 17140 | ||
| 17141 | The @code{custom-set-variables} function works somewhat differently | 17141 | The @code{custom-set-variables} function works somewhat differently |
| 17142 | than a @code{setq}. While I have never learned the differences, I | 17142 | than a @code{setq}. While I have never learned the differences, I |
| @@ -17187,11 +17187,12 @@ expressions myself. | |||
| 17187 | 17187 | ||
| 17188 | @findex defsubst | 17188 | @findex defsubst |
| 17189 | @findex defconst | 17189 | @findex defconst |
| 17190 | Incidentally, @code{defsubst} defines an inline function. The syntax | 17190 | Incidentally, to be more complete concerning defines: @code{defsubst} |
| 17191 | is just like that of @code{defun}. @code{defconst} defines a symbol | 17191 | defines an inline function. The syntax is just like that of |
| 17192 | as a constant. The intent is that neither programs nor users should | 17192 | @code{defun}. @code{defconst} defines a symbol as a constant. The |
| 17193 | ever change a value set by @code{defconst}. (You can change it; the | 17193 | intent is that neither programs nor users should ever change a value |
| 17194 | value set is a variable; but please do not.) | 17194 | set by @code{defconst}. (You can change it; the value set is a |
| 17195 | variable; but please do not.) | ||
| 17195 | 17196 | ||
| 17196 | @node Beginning a .emacs File, Text and Auto-fill, defcustom, Emacs Initialization | 17197 | @node Beginning a .emacs File, Text and Auto-fill, defcustom, Emacs Initialization |
| 17197 | @section Beginning a @file{.emacs} File | 17198 | @section Beginning a @file{.emacs} File |
| @@ -17240,9 +17241,9 @@ adding to it ever since. | |||
| 17240 | @noindent | 17241 | @noindent |
| 17241 | This describes the usual conventions for comments in Emacs Lisp. | 17242 | This describes the usual conventions for comments in Emacs Lisp. |
| 17242 | Everything on a line that follows a semicolon is a comment. Two, | 17243 | Everything on a line that follows a semicolon is a comment. Two, |
| 17243 | three, and four semicolons are used as section and subsection | 17244 | three, and four semicolons are used as subsection and section markers. |
| 17244 | markers. (@xref{Comments, ,, elisp, The GNU Emacs Lisp Reference | 17245 | (@xref{Comments, ,, elisp, The GNU Emacs Lisp Reference Manual}, for |
| 17245 | Manual}, for more about comments.) | 17246 | more about comments.) |
| 17246 | 17247 | ||
| 17247 | @smallexample | 17248 | @smallexample |
| 17248 | @group | 17249 | @group |
| @@ -17288,7 +17289,6 @@ Auto Fill mode. | |||
| 17288 | ; The next two lines put Emacs into Text mode | 17289 | ; The next two lines put Emacs into Text mode |
| 17289 | ; and Auto Fill mode, and are for writers who | 17290 | ; and Auto Fill mode, and are for writers who |
| 17290 | ; want to start writing prose rather than code. | 17291 | ; want to start writing prose rather than code. |
| 17291 | |||
| 17292 | (setq default-major-mode 'text-mode) | 17292 | (setq default-major-mode 'text-mode) |
| 17293 | (add-hook 'text-mode-hook 'turn-on-auto-fill) | 17293 | (add-hook 'text-mode-hook 'turn-on-auto-fill) |
| 17294 | @end group | 17294 | @end group |
| @@ -17411,7 +17411,6 @@ reminders. | |||
| 17411 | ; To enter mail mode, type `C-x m' | 17411 | ; To enter mail mode, type `C-x m' |
| 17412 | ; To enter RMAIL (for reading mail), | 17412 | ; To enter RMAIL (for reading mail), |
| 17413 | ; type `M-x rmail' | 17413 | ; type `M-x rmail' |
| 17414 | |||
| 17415 | (setq mail-aliases t) | 17414 | (setq mail-aliases t) |
| 17416 | @end group | 17415 | @end group |
| 17417 | @end smallexample | 17416 | @end smallexample |
| @@ -17471,6 +17470,7 @@ See sections ``Tabs vs.@: Spaces'' and ``Local Variables in | |||
| 17471 | Files'' in @cite{The GNU Emacs Manual}. | 17470 | Files'' in @cite{The GNU Emacs Manual}. |
| 17472 | @end iftex | 17471 | @end iftex |
| 17473 | 17472 | ||
| 17473 | @need 1700 | ||
| 17474 | @node Keybindings, Keymaps, Indent Tabs Mode, Emacs Initialization | 17474 | @node Keybindings, Keymaps, Indent Tabs Mode, Emacs Initialization |
| 17475 | @section Some Keybindings | 17475 | @section Some Keybindings |
| 17476 | 17476 | ||
| @@ -17498,13 +17498,14 @@ This also shows how to set a key globally, for all modes. | |||
| 17498 | The command is @code{global-set-key}. It is followed by the | 17498 | The command is @code{global-set-key}. It is followed by the |
| 17499 | keybinding. In a @file{.emacs} file, the keybinding is written as | 17499 | keybinding. In a @file{.emacs} file, the keybinding is written as |
| 17500 | shown: @code{\C-c} stands for `control-c', which means `press the | 17500 | shown: @code{\C-c} stands for `control-c', which means `press the |
| 17501 | control key and the @kbd{c} key at the same time'. The @code{w} means | 17501 | control key and the @key{c} key at the same time'. The @code{w} means |
| 17502 | `press the @kbd{w} key'. The keybinding is surrounded by double | 17502 | `press the @key{w} key'. The keybinding is surrounded by double |
| 17503 | quotation marks. In documentation, you would write this as @kbd{C-c | 17503 | quotation marks. In documentation, you would write this as |
| 17504 | w}. (If you were binding a @key{META} key, such as @kbd{M-c}, rather | 17504 | @w{@kbd{C-c w}}. (If you were binding a @key{META} key, such as |
| 17505 | than a @key{CTRL} key, you would write @code{\M-c}. @xref{Init | 17505 | @kbd{M-c}, rather than a @key{CTRL} key, you would write |
| 17506 | Rebinding, , Rebinding Keys in Your Init File, emacs, The GNU Emacs | 17506 | @w{@code{\M-c}} in your @file{.emacs} file. @xref{Init Rebinding, , |
| 17507 | Manual}, for details.) | 17507 | Rebinding Keys in Your Init File, emacs, The GNU Emacs Manual}, for |
| 17508 | details.) | ||
| 17508 | 17509 | ||
| 17509 | The command invoked by the keys is @code{compare-windows}. Note that | 17510 | The command invoked by the keys is @code{compare-windows}. Note that |
| 17510 | @code{compare-windows} is preceded by a single quote; otherwise, Emacs | 17511 | @code{compare-windows} is preceded by a single quote; otherwise, Emacs |
| @@ -17793,8 +17794,8 @@ Here is a typical example: | |||
| 17793 | @end smallexample | 17794 | @end smallexample |
| 17794 | 17795 | ||
| 17795 | @noindent | 17796 | @noindent |
| 17796 | (@code{html-helper-mode} is an alternative to @code{html-mode}, which | 17797 | (@code{html-helper-mode} is an older alternative to @code{html-mode}, |
| 17797 | is a standard part of the distribution). | 17798 | which is a standard part of the distribution.) |
| 17798 | 17799 | ||
| 17799 | @noindent | 17800 | @noindent |
| 17800 | This expression autoloads the @code{html-helper-mode} function. It | 17801 | This expression autoloads the @code{html-helper-mode} function. It |
| @@ -17866,18 +17867,18 @@ the following conditional: | |||
| 17866 | @smallexample | 17867 | @smallexample |
| 17867 | @group | 17868 | @group |
| 17868 | (cond | 17869 | (cond |
| 17869 | ((string-equal (number-to-string 21) (substring (emacs-version) 10 12)) | 17870 | (= 21 emacs-major-version) |
| 17870 | ;; evaluate version 21 code | 17871 | ;; evaluate version 21 code |
| 17871 | ( @dots{} )) | 17872 | ( @dots{} )) |
| 17872 | ((string-equal (number-to-string 22) (substring (emacs-version) 10 12)) | 17873 | (= 22 emacs-major-version) |
| 17873 | ;; evaluate version 22 code | 17874 | ;; evaluate version 22 code |
| 17874 | ( @dots{} ))) | 17875 | ( @dots{} ))) |
| 17875 | @end group | 17876 | @end group |
| 17876 | @end smallexample | 17877 | @end smallexample |
| 17877 | 17878 | ||
| 17878 | For example, in contrast to version 20, version 21 blinks its cursor | 17879 | For example, in contrast to version 20, more recent versions blink |
| 17879 | by default. I hate such blinking, as well as some other features in | 17880 | their cursors by default. I hate such blinking, as well as other |
| 17880 | version 21, so I placed the following in my @file{.emacs} | 17881 | features, so I placed the following in my @file{.emacs} |
| 17881 | file@footnote{When I start instances of Emacs that do not load my | 17882 | file@footnote{When I start instances of Emacs that do not load my |
| 17882 | @file{.emacs} file or any site file, I also turn off blinking: | 17883 | @file{.emacs} file or any site file, I also turn off blinking: |
| 17883 | 17884 | ||
| @@ -17892,8 +17893,8 @@ emacs -Q - D | |||
| 17892 | 17893 | ||
| 17893 | @smallexample | 17894 | @smallexample |
| 17894 | @group | 17895 | @group |
| 17895 | (if (string-equal "21" (substring (emacs-version) 10 12)) | 17896 | (when (or (= 21 emacs-major-version) |
| 17896 | (progn | 17897 | (= 22 emacs-major-version)) |
| 17897 | (blink-cursor-mode 0) | 17898 | (blink-cursor-mode 0) |
| 17898 | ;; Insert newline when you press `C-n' (next-line) | 17899 | ;; Insert newline when you press `C-n' (next-line) |
| 17899 | ;; at the end of the buffer | 17900 | ;; at the end of the buffer |
| @@ -17919,20 +17920,11 @@ emacs -Q - D | |||
| 17919 | ;; (Use numeric argument to turn on) | 17920 | ;; (Use numeric argument to turn on) |
| 17920 | (tooltip-mode nil) | 17921 | (tooltip-mode nil) |
| 17921 | ;; If tooltips turned on, make tips appear promptly | 17922 | ;; If tooltips turned on, make tips appear promptly |
| 17922 | (setq tooltip-delay 0.1) ; default is one second | 17923 | (setq tooltip-delay 0.1) ; default is 0.7 second |
| 17923 | )) | 17924 | ) |
| 17924 | @end group | 17925 | @end group |
| 17925 | @end smallexample | 17926 | @end smallexample |
| 17926 | 17927 | ||
| 17927 | @noindent | ||
| 17928 | (You will note that instead of typing @code{(number-to-string 21)}, I | ||
| 17929 | decided to save typing and wrote `21' as a string, @code{"21"}, rather | ||
| 17930 | than convert it from an integer to a string. In this instance, this | ||
| 17931 | expression is better than the longer, but more general | ||
| 17932 | @code{(number-to-string 21)}. However, if you do not know ahead of | ||
| 17933 | time what type of information will be returned, then the | ||
| 17934 | @code{number-to-string} function will be needed.) | ||
| 17935 | |||
| 17936 | @node X11 Colors, Miscellaneous, Simple Extension, Emacs Initialization | 17928 | @node X11 Colors, Miscellaneous, Simple Extension, Emacs Initialization |
| 17937 | @section X11 Colors | 17929 | @section X11 Colors |
| 17938 | 17930 | ||
| @@ -18010,9 +18002,11 @@ in those cases, I often specify an image rather than a plain color.}: | |||
| 18010 | xsetroot -solid Navy -fg white & | 18002 | xsetroot -solid Navy -fg white & |
| 18011 | @end smallexample | 18003 | @end smallexample |
| 18012 | 18004 | ||
| 18005 | @need 1700 | ||
| 18013 | @node Miscellaneous, Mode Line, X11 Colors, Emacs Initialization | 18006 | @node Miscellaneous, Mode Line, X11 Colors, Emacs Initialization |
| 18014 | @section Miscellaneous Settings for a @file{.emacs} File | 18007 | @section Miscellaneous Settings for a @file{.emacs} File |
| 18015 | 18008 | ||
| 18009 | @need 1250 | ||
| 18016 | Here are a few miscellaneous settings: | 18010 | Here are a few miscellaneous settings: |
| 18017 | @sp 1 | 18011 | @sp 1 |
| 18018 | 18012 | ||
| @@ -18096,13 +18090,15 @@ problem recently.) | |||
| 18096 | @noindent | 18090 | @noindent |
| 18097 | or start GNU Emacs with the command @code{emacs -nbc}. | 18091 | or start GNU Emacs with the command @code{emacs -nbc}. |
| 18098 | 18092 | ||
| 18099 | @item Ignore case when using `grep'@* | 18093 | @need 1250 |
| 18100 | @samp{-n}@w{ } Prefix each line of output with line number@* | 18094 | @item When using `grep'@* |
| 18101 | @samp{-i}@w{ } Ignore case distinctions@* | 18095 | @samp{-i}@w{ } Ignore case distinctions@* |
| 18096 | @samp{-n}@w{ } Prefix each line of output with line number@* | ||
| 18097 | @samp{-H}@w{ } Print the filename for each match.@* | ||
| 18102 | @samp{-e}@w{ } Protect patterns beginning with a hyphen character, @samp{-} | 18098 | @samp{-e}@w{ } Protect patterns beginning with a hyphen character, @samp{-} |
| 18103 | 18099 | ||
| 18104 | @smallexample | 18100 | @smallexample |
| 18105 | (setq grep-command "grep -n -i -e ") | 18101 | (setq grep-command "grep -i -nH -e ") |
| 18106 | @end smallexample | 18102 | @end smallexample |
| 18107 | 18103 | ||
| 18108 | @ignore | 18104 | @ignore |
| @@ -18165,9 +18161,7 @@ For a boot script: | |||
| 18165 | @smallexample | 18161 | @smallexample |
| 18166 | @group | 18162 | @group |
| 18167 | loadkeys /usr/share/keymaps/i386/qwerty/emacs2.kmap.gz | 18163 | loadkeys /usr/share/keymaps/i386/qwerty/emacs2.kmap.gz |
| 18168 | |||
| 18169 | @exdent or | 18164 | @exdent or |
| 18170 | |||
| 18171 | install-keymap emacs2 | 18165 | install-keymap emacs2 |
| 18172 | @end group | 18166 | @end group |
| 18173 | @end smallexample | 18167 | @end smallexample |
| @@ -18200,6 +18194,7 @@ xmodmap -e "keysym Alt_L = Meta_L Alt_L" | |||
| 18200 | @end group | 18194 | @end group |
| 18201 | @end smallexample | 18195 | @end smallexample |
| 18202 | 18196 | ||
| 18197 | @need 1700 | ||
| 18203 | @node Mode Line, , Miscellaneous, Emacs Initialization | 18198 | @node Mode Line, , Miscellaneous, Emacs Initialization |
| 18204 | @section A Modified Mode Line | 18199 | @section A Modified Mode Line |
| 18205 | @vindex default-mode-line-format | 18200 | @vindex default-mode-line-format |
| @@ -18422,8 +18417,8 @@ argument of 4: | |||
| 18422 | @end smallexample | 18417 | @end smallexample |
| 18423 | 18418 | ||
| 18424 | @noindent | 18419 | @noindent |
| 18425 | In GNU Emacs version 21, you will create and enter a | 18420 | In a recent GNU Emacs, you will create and enter a @file{*Backtrace*} |
| 18426 | @file{*Backtrace*} buffer that says: | 18421 | buffer that says: |
| 18427 | 18422 | ||
| 18428 | @noindent | 18423 | @noindent |
| 18429 | @smallexample | 18424 | @smallexample |
| @@ -18472,9 +18467,9 @@ version 21. | |||
| 18472 | However, suppose you are not quite certain what is going on? | 18467 | However, suppose you are not quite certain what is going on? |
| 18473 | You can read the complete backtrace. | 18468 | You can read the complete backtrace. |
| 18474 | 18469 | ||
| 18475 | In this case, you need to run GNU Emacs 22, which automatically starts | 18470 | In this case, you need to run a recent GNU Emacs, which automatically |
| 18476 | the debugger that puts you in the @file{*Backtrace*} buffer; or else, | 18471 | starts the debugger that puts you in the @file{*Backtrace*} buffer; or |
| 18477 | you need to start the debugger manually as described below. | 18472 | else, you need to start the debugger manually as described below. |
| 18478 | 18473 | ||
| 18479 | Read the @file{*Backtrace*} buffer from the bottom up; it tells you | 18474 | Read the @file{*Backtrace*} buffer from the bottom up; it tells you |
| 18480 | what Emacs did that led to the error. Emacs made an interactive call | 18475 | what Emacs did that led to the error. Emacs made an interactive call |
| @@ -18514,8 +18509,8 @@ then run your test again. | |||
| 18514 | @section @code{debug-on-entry} | 18509 | @section @code{debug-on-entry} |
| 18515 | @findex debug-on-entry | 18510 | @findex debug-on-entry |
| 18516 | 18511 | ||
| 18517 | GNU Emacs 22 starts the debugger automatically when your function has | 18512 | A recent GNU Emacs starts the debugger automatically when your |
| 18518 | an error. | 18513 | function has an error. |
| 18519 | 18514 | ||
| 18520 | @ignore | 18515 | @ignore |
| 18521 | GNU Emacs version 20 and before did not; it simply | 18516 | GNU Emacs version 20 and before did not; it simply |
| @@ -18725,7 +18720,8 @@ Interactive mode.) | |||
| 18725 | @need 1500 | 18720 | @need 1500 |
| 18726 | However, to prepare this function definition for Edebug, you must | 18721 | However, to prepare this function definition for Edebug, you must |
| 18727 | first @dfn{instrument} the code using a different command. You can do | 18722 | first @dfn{instrument} the code using a different command. You can do |
| 18728 | this by positioning your cursor within the definition and typing | 18723 | this by positioning your cursor within or just after the definition |
| 18724 | and typing | ||
| 18729 | 18725 | ||
| 18730 | @smallexample | 18726 | @smallexample |
| 18731 | M-x edebug-defun RET | 18727 | M-x edebug-defun RET |
| @@ -22635,4 +22631,3 @@ airplane. | |||
| 22635 | @ignore | 22631 | @ignore |
| 22636 | arch-tag: da1a2154-531f-43a8-8e33-fc7faad10acf | 22632 | arch-tag: da1a2154-531f-43a8-8e33-fc7faad10acf |
| 22637 | @end ignore | 22633 | @end ignore |
| 22638 | |||