@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
@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.
@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
@smallexample
@group
(if (equal characteristic 'fierce)
- (message "It's a tiger!")))
+ (message "It’s a tiger!")))
@end group
@end smallexample
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}
@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
@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.)
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")
@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)
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)))
@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
@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{}"
@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
(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
@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))))))
@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
@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
@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
"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 ... ")
(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
@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))
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
@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
@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
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
@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
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)))
@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
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
@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))
@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
@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))
@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