diff options
Diffstat (limited to 'doc/lispintro/emacs-lisp-intro.texi')
| -rw-r--r-- | doc/lispintro/emacs-lisp-intro.texi | 101 |
1 files changed, 50 insertions, 51 deletions
diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index f1480a44b3d..a27a969f91b 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi @@ -3862,10 +3862,10 @@ tiger!} will be printed; otherwise, @code{nil} will be returned. @group (defun type-of-animal (characteristic) "Print message in echo area depending on CHARACTERISTIC. -If the CHARACTERISTIC is the symbol `fierce', +If the CHARACTERISTIC is the symbol ‘fierce’, then warn of a tiger." (if (equal characteristic 'fierce) - (message "It's a tiger!"))) + (message "It’s a tiger!"))) @end group @end smallexample @@ -3887,7 +3887,7 @@ can evaluate the following two expressions to see the results: @c Following sentences rewritten to prevent overfull hbox. @noindent When you evaluate @code{(type-of-animal 'fierce)}, you will see the -following message printed in the echo area: @code{"It's a tiger!"}; and +following message printed in the echo area: @code{"It’s a tiger!"}; and when you evaluate @code{(type-of-animal 'zebra)} you will see @code{nil} printed in the echo area. @@ -3918,7 +3918,7 @@ The parts of the function that match this template look like this: @group (defun type-of-animal (characteristic) "Print message in echo area depending on CHARACTERISTIC. -If the CHARACTERISTIC is the symbol `fierce', +If the CHARACTERISTIC is the symbol ‘fierce’, then warn of a tiger." @var{body: the} @code{if} @var{expression}) @end group @@ -3948,7 +3948,7 @@ looks like this: @smallexample @group (if (equal characteristic 'fierce) - (message "It's a tiger!"))) + (message "It’s a tiger!"))) @end group @end smallexample @@ -3971,7 +3971,7 @@ In the first exercise of @code{type-of-animal}, the argument is equal to @code{fierce}, the expression, @code{(equal characteristic 'fierce)}, returns a value of true. When this happens, the @code{if} evaluates the second argument or then-part of the @code{if}: -@code{(message "It's tiger!")}. +@code{(message "It’s a tiger!")}. On the other hand, in the second exercise of @code{type-of-animal}, the argument @code{zebra} is passed to @code{type-of-animal}. @code{zebra} @@ -4034,12 +4034,11 @@ arguments to the function. @group (defun type-of-animal (characteristic) ; @r{Second version.} "Print message in echo area depending on CHARACTERISTIC. -If the CHARACTERISTIC is the symbol `fierce', -then warn of a tiger; -else say it's not fierce." +If the CHARACTERISTIC is the symbol ‘fierce’, +then warn of a tiger; else say it’s not fierce." (if (equal characteristic 'fierce) - (message "It's a tiger!") - (message "It's not fierce!"))) + (message "It’s a tiger!") + (message "It’s not fierce!"))) @end group @end smallexample @sp 1 @@ -4056,12 +4055,12 @@ else say it's not fierce." @c Following sentence rewritten to prevent overfull hbox. @noindent When you evaluate @code{(type-of-animal 'fierce)}, you will see the -following message printed in the echo area: @code{"It's a tiger!"}; but +following message printed in the echo area: @code{"It’s a tiger!"}; but when you evaluate @code{(type-of-animal 'zebra)}, you will see -@code{"It's not fierce!"}. +@code{"It’s not fierce!"}. (Of course, if the @var{characteristic} were @code{ferocious}, the -message @code{"It's not fierce!"} would be printed; and it would be +message @code{"It’s not fierce!"} would be printed; and it would be misleading! When you write code, you need to take into account the possibility that some such argument will be tested by the @code{if} and write your program accordingly.) @@ -6349,7 +6348,7 @@ With arg N, put point N/10 of the way from the true beginning. @end group @group -Don't use this in Lisp programs! +Don’t use this in Lisp programs! \(goto-char (point-min)) is faster and does not set the mark." (interactive "P") @@ -7605,8 +7604,8 @@ Here is the complete text of the version 22 implementation of the function: @smallexample @group (defun zap-to-char (arg char) - "Kill up to and including ARG'th occurrence of CHAR. -Case is ignored if `case-fold-search' is non-nil in the current buffer. + "Kill up to and including ARG’th occurrence of CHAR. +Case is ignored if ‘case-fold-search’ is non-nil in the current buffer. Goes backward if ARG is negative; error if CHAR not found." (interactive "p\ncZap to char: ") (if (char-table-p translation-table-for-input) @@ -7864,7 +7863,7 @@ to make one entry in the kill ring. In Lisp code, optional third arg YANK-HANDLER, if non-nil, specifies the yank-handler text property to be set on the killed -text. See `insert-for-yank'." +text. See ‘insert-for-yank’." ;; Pass point first, then mark, because the order matters ;; when calling kill-append. (interactive (list (point) (mark))) @@ -8292,9 +8291,9 @@ function: @smallexample @group (defun copy-region-as-kill (beg end) - "Save the region as if killed, but don't kill it. + "Save the region as if killed, but don’t kill it. In Transient Mark mode, deactivate the mark. -If `interprogram-cut-function' is non-nil, also save the text for a window +If ‘interprogram-cut-function’ is non-nil, also save the text for a window system cut and paste." (interactive "r") @end group @@ -8593,9 +8592,9 @@ The @code{kill-new} function looks like this: @group (defun kill-new (string &optional replace yank-handler) "Make STRING the latest kill in the kill ring. -Set `kill-ring-yank-pointer' to point to it. +Set ‘kill-ring-yank-pointer’ to point to it. -If `interprogram-cut-function' is non-nil, apply it to STRING. +If `interprogram-cut-function’ is non-nil, apply it to STRING. Optional second argument REPLACE non-nil means that STRING will replace the front of the kill ring, rather than being added to the list. @dots{}" @@ -9268,7 +9267,7 @@ documentation string. For example: @smallexample @group (defvar shell-command-default-error-buffer nil - "*Buffer name for `shell-command' @dots{} error output. + "*Buffer name for ‘shell-command’ @dots{} error output. @dots{} ") @end group @end smallexample @@ -10090,10 +10089,10 @@ With argument, rotate that many kills forward (or backward, if negative)." (defun current-kill (n &optional do-not-move) "Rotate the yanking point by N places, and then return that kill. -If N is zero, `interprogram-paste-function' is set, and calling it +If N is zero, ‘interprogram-paste-function’ is set, and calling it returns a string, then that string is added to the front of the kill ring and returned as the latest kill. -If optional arg DO-NOT-MOVE is non-nil, then don't actually move the +If optional arg DO-NOT-MOVE is non-nil, then don’t actually move the yanking point; just return the Nth kill forward." (let ((interprogram-paste (and (= n 0) interprogram-paste-function @@ -11107,7 +11106,7 @@ up the number of pebbles in a triangle. @smallexample @group (defun triangle-using-dotimes (number-of-rows) - "Using dotimes, add up the number of pebbles in a triangle." + "Using ‘dotimes’, add up the number of pebbles in a triangle." (let ((total 0)) ; otherwise a total is a void variable (dotimes (number number-of-rows total) (setq total (+ total (1+ number)))))) @@ -11952,7 +11951,7 @@ duo that uses recursion." @group (defun triangle-recursive-helper (sum counter number) "Return SUM, using COUNTER, through NUMBER inclusive. -This is the `helper' component of a two function duo +This is the “helper” component of a two function duo that uses recursion." (if (> counter number) sum @@ -12428,10 +12427,10 @@ Here is the code for @code{forward-sentence}: @smallexample @group (defun forward-sentence (&optional arg) - "Move forward to next `sentence-end'. With argument, repeat. -With negative argument, move backward repeatedly to `sentence-beginning'. + "Move forward to next ‘sentence-end’. With argument, repeat. +With negative argument, move backward repeatedly to ‘sentence-beginning’. -The variable `sentence-end' is a regular expression that matches ends of +The variable ‘sentence-end’ is a regular expression that matches ends of sentences. Also, every paragraph boundary terminates sentences as well." @end group @group @@ -13515,8 +13514,8 @@ For example: @group (let* ((foo 7) (bar (* 3 foo))) - (message "'bar' is %d." bar)) - @result{} 'bar' is 21. + (message "‘bar’ is %d." bar)) + @result{} ‘bar’ is 21. @end group @end smallexample @@ -13758,7 +13757,7 @@ All this leads to the following function definition: "Print number of words in the region. Words are defined as at least one word-constituent character followed by at least one character that -is not a word-constituent. The buffer's syntax +is not a word-constituent. The buffer’s syntax table determines which characters these are." (interactive "r") (message "Counting words in region ... ") @@ -13825,7 +13824,7 @@ parenthesis and type @kbd{C-x C-e} to install it. (defun @value{COUNT-WORDS} (beginning end) "Print number of words in the region. Words are defined as at least one word-constituent character followed -by at least one character that is not a word-constituent. The buffer's +by at least one character that is not a word-constituent. The buffer’s syntax table determines which characters these are." @end group @group @@ -14987,13 +14986,13 @@ beginning of the file. The function definition looks like this: @smallexample @group (defun lengths-list-file (filename) - "Return list of definitions' lengths within FILE. + "Return list of definitions’ lengths within FILE. The returned list is a list of numbers. Each number is the number of words or symbols in one function definition." @end group @group - (message "Working on '%s' ... " filename) + (message "Working on ‘%s’ ... " filename) (save-excursion (let ((buffer (find-file-noselect filename)) (lengths-list)) @@ -15759,7 +15758,7 @@ simpler to write a list manually. Here it is: 160 170 180 190 200 210 220 230 240 250 260 270 280 290 300) - "List specifying ranges for `defuns-per-range'.") + "List specifying ranges for ‘defuns-per-range’.") @end group @end smallexample @@ -17522,7 +17521,7 @@ Incidentally, @code{load-library} is an interactive interface to the @group (defun load-library (library) "Load the library named LIBRARY. -This is an interface to the function `load'." +This is an interface to the function ‘load’." (interactive (list (completing-read "Load library: " (apply-partially 'locate-file-completion-table @@ -19006,12 +19005,12 @@ The @code{current-kill} function is used by @code{yank} and by @group (defun current-kill (n &optional do-not-move) "Rotate the yanking point by N places, and then return that kill. -If N is zero, `interprogram-paste-function' is set, and calling it +If N is zero, ‘interprogram-paste-function’ is set, and calling it returns a string, then that string is added to the front of the kill ring and returned as the latest kill. @end group @group -If optional arg DO-NOT-MOVE is non-nil, then don't actually move the +If optional arg DO-NOT-MOVE is non-nil, then don’t actually move the yanking point; just return the Nth kill forward." (let ((interprogram-paste (and (= n 0) interprogram-paste-function @@ -19350,8 +19349,8 @@ beginning (and mark at end). With argument N, reinsert the Nth most recently killed stretch of killed text. When this command inserts killed text into the buffer, it honors -`yank-excluded-properties' and `yank-handler' as described in the -doc string for `insert-for-yank-1', which see. +‘yank-excluded-properties’ and ‘yank-handler’ as described in the +doc string for ‘insert-for-yank-1’, which see. See also the command \\[yank-pop]." @end group @@ -19925,7 +19924,7 @@ row, and the value of the width of the top line, which is calculated @group (defun Y-axis-element (number full-Y-label-width) "Construct a NUMBERed label element. -A numbered element looks like this ' 5 - ', +A numbered element looks like this ‘ 5 - ’, and is padded as needed so all line up with the element for the largest number." @end group @@ -20026,7 +20025,7 @@ the @code{print-Y-axis} function, which inserts the list as a column. Height must be the maximum height of the graph. Full width is the width of the highest label element." ;; Value of height and full-Y-label-width -;; are passed by 'print-graph'. +;; are passed by ‘print-graph’. @end group @group (let ((start (point))) @@ -21151,7 +21150,7 @@ each column." @end group @group ;; Value of symbol-width and full-Y-label-width -;; are passed by 'print-graph'. +;; are passed by ‘print-graph’. (let* ((leading-spaces (make-string full-Y-label-width ? )) ;; symbol-width @r{is provided by} graph-body-print @@ -21251,7 +21250,7 @@ Here are all the graphing definitions in their final form: 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250) - "List specifying ranges for `defuns-per-range'.") + "List specifying ranges for ‘defuns-per-range’.") @end group @group @@ -21312,14 +21311,14 @@ as graph-symbol.") @smallexample @group (defun lengths-list-file (filename) - "Return list of definitions' lengths within FILE. + "Return list of definitions’ lengths within FILE. The returned list is a list of numbers. Each number is the number of words or symbols in one function definition." @end group @group - (message "Working on '%s' ... " filename) + (message "Working on ‘%s’ ... " filename) (save-excursion (let ((buffer (find-file-noselect filename)) (lengths-list)) @@ -21449,7 +21448,7 @@ The strings are either graph-blank or graph-symbol." @group (defun Y-axis-element (number full-Y-label-width) "Construct a NUMBERed label element. -A numbered element looks like this ' 5 - ', +A numbered element looks like this ‘ 5 - ’, and is padded as needed so all line up with the element for the largest number." @end group @@ -21479,7 +21478,7 @@ Optionally, print according to VERTICAL-STEP." @end group @group ;; Value of height and full-Y-label-width -;; are passed by 'print-graph'. +;; are passed by ‘print-graph’. (let ((start (point))) (insert-rectangle (Y-axis-column height full-Y-label-width vertical-step)) @@ -21644,7 +21643,7 @@ each column." @end group @group ;; Value of symbol-width and full-Y-label-width -;; are passed by 'print-graph'. +;; are passed by ‘print-graph’. (let* ((leading-spaces (make-string full-Y-label-width ? )) ;; symbol-width @r{is provided by} graph-body-print |
