1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-10 00:42:17 -07:00

Use images in Emacs Lisp Intro manual (bug#80519)

* doc/lispintro/emacs-lisp-intro.texi (Lists diagrammed)
(Symbols as Chest, kill-ring-yank-pointer, lambda): Use @image and
remove ASCII-art diagrams, which are now on separate *.txt files.
(header): Remove print-postscript-figures and its commentary.

* doc/lispintro/Makefile.in (auxfiles): New file list.
(${buildinfodir}/%.txt, ${buildinfodir}/%.png): New targets.
(${buildinfodir}/eintr.info): Depend on ${auxfiles}.
(infoclean): Remove ${auxfiles}.

* doc/lispintro/cons-1.png:
* doc/lispintro/cons-1.txt:
* doc/lispintro/cons-2.png:
* doc/lispintro/cons-2.txt:
* doc/lispintro/cons-2a.png:
* doc/lispintro/cons-2a.txt:
* doc/lispintro/cons-3.png:
* doc/lispintro/cons-3.txt:
* doc/lispintro/cons-4.png:
* doc/lispintro/cons-4.txt:
* doc/lispintro/cons-5.png:
* doc/lispintro/cons-5.txt:
* doc/lispintro/drawers.png:
* doc/lispintro/drawers.txt:
* doc/lispintro/lambda-1.png:
* doc/lispintro/lambda-1.txt:
* doc/lispintro/lambda-2.png:
* doc/lispintro/lambda-2.txt:
* doc/lispintro/lambda-3.png:
* doc/lispintro/lambda-3.txt: New files, from Matto Fransen
<matto@matto.nl>.
This commit is contained in:
Eli Zaretskii 2026-03-08 14:51:13 +02:00
parent bb7e993734
commit 468dad2c5a
22 changed files with 111 additions and 190 deletions

View file

@ -84,9 +84,37 @@ ps: $(PS_TARGETS)
${buildinfodir}:
${MKDIR_P} $@
auxfiles = \
${buildinfodir}/cons-1.png \
${buildinfodir}/cons-1.txt \
${buildinfodir}/cons-2.png \
${buildinfodir}/cons-2.txt \
${buildinfodir}/cons-2a.png \
${buildinfodir}/cons-2a.txt \
${buildinfodir}/cons-3.png \
${buildinfodir}/cons-3.txt \
${buildinfodir}/cons-4.png \
${buildinfodir}/cons-4.txt \
${buildinfodir}/cons-5.png \
${buildinfodir}/cons-5.txt \
${buildinfodir}/drawers.png \
${buildinfodir}/drawers.txt \
${buildinfodir}/lambda-1.png \
${buildinfodir}/lambda-1.txt \
${buildinfodir}/lambda-2.png \
${buildinfodir}/lambda-2.txt \
${buildinfodir}/lambda-3.png \
${buildinfodir}/lambda-3.txt
${buildinfodir}/%.txt: ${srcdir}/%.txt | ${buildinfodir}
cp $< $@
${buildinfodir}/%.png: ${srcdir}/%.png | ${buildinfodir}
cp $< $@
# The file name eintr must fit within 5 characters, to allow for
# -NN extensions to fit into DOS 8+3 limits without clashing.
${buildinfodir}/eintr.info: ${srcs} | ${buildinfodir}
${buildinfodir}/eintr.info: ${srcs} ${auxfiles} | ${buildinfodir}
$(AM_V_GEN)$(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ $<
emacs-lisp-intro.dvi: ${srcs}
@ -117,6 +145,7 @@ infoclean:
rm -f \
$(buildinfodir)/eintr.info \
$(buildinfodir)/eintr.info-[1-9]
rm -f $(auxfiles)
bootstrap-clean maintainer-clean: distclean infoclean
rm -f TAGS

BIN
doc/lispintro/cons-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

5
doc/lispintro/cons-1.txt Normal file
View file

@ -0,0 +1,5 @@
___ ___ ___ ___ ___ ___
|___|___|--> |___|___|--> |___|___|--> nil
| | |
| | |
--> rose --> violet --> buttercup

BIN
doc/lispintro/cons-2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

7
doc/lispintro/cons-2.txt Normal file
View file

@ -0,0 +1,7 @@
bouquet
|
| ___ ___ ___ ___ ___ ___
--> |___|___|--> |___|___|--> |___|___|--> nil
| | |
| | |
--> rose --> violet --> buttercup

BIN
doc/lispintro/cons-2a.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

View file

@ -0,0 +1,7 @@
bouquet
|
| -------------- --------------- ----------------
| | car | cdr | | car | cdr | | car | cdr |
-->| rose | o------->| violet | o------->| butter- | nil |
| | | | | | | cup | |
-------------- --------------- ----------------

BIN
doc/lispintro/cons-3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

8
doc/lispintro/cons-3.txt Normal file
View file

@ -0,0 +1,8 @@
bouquet flowers
| |
| ___ ___ | ___ ___ ___ ___
--> | | | --> | | | | | |
|___|___|----> |___|___|--> |___|___|--> nil
| | |
| | |
--> rose --> violet --> buttercup

BIN
doc/lispintro/cons-4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

8
doc/lispintro/cons-4.txt Normal file
View file

@ -0,0 +1,8 @@
bouquet flowers
| |
| ___ ___ ___ ___ | ___ ___ ___ ___
--> | | | | | | --> | | | | | |
|___|___|----> |___|___|----> |___|___|---->|___|___|--> nil
| | | |
| | | |
--> lily --> rose --> violet --> buttercup

BIN
doc/lispintro/cons-5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

12
doc/lispintro/cons-5.txt Normal file
View file

@ -0,0 +1,12 @@
kill-ring kill-ring-yank-pointer
| |
| ___ ___ | ___ ___ ___ ___
---> | | | --> | | | | | |
|___|___|----> |___|___|--> |___|___|--> nil
| | |
| | |
| | --> "yet more text"
| |
| --> "a different piece of text"
|
--> "some text"

BIN
doc/lispintro/drawers.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

22
doc/lispintro/drawers.txt Normal file
View file

@ -0,0 +1,22 @@
Chest of Drawers Contents of Drawers
__ o0O0o __
/ \
---------------------
| directions to | [map to]
| symbol name | bouquet
| |
+---------------------+
| directions to |
| symbol definition | [none]
| |
+---------------------+
| directions to | [map to]
| variable value | (rose violet buttercup)
| |
+---------------------+
| directions to |
| property list | [not described here]
| |
+---------------------+
|/ \|

View file

@ -41,16 +41,6 @@
@clear largebook
@end ifset
@c ================ Included Figures ================
@c If you clear this, the figures will be printed as ASCII diagrams
@c rather than PostScript/PDF.
@c (This is not relevant to Info, since Info only handles ASCII.)
@iftex
@set print-postscript-figures
@end iftex
@c clear print-postscript-figures
@comment %**end of header
@c per rms and peterb, use 10pt fonts for the main text, mostly to
@ -9567,25 +9557,10 @@ which holds the address for the atom @samp{buttercup}.
@need 1200
This sounds more complicated than it is and is easier seen in a diagram:
@c clear print-postscript-figures
@c !!! cons-cell-diagram #1
@ifset print-postscript-figures
@sp 1
@center @image{cons-1}
@sp 1
@end ifset
@ifclear print-postscript-figures
@smallexample
@group
___ ___ ___ ___ ___ ___
|___|___|--> |___|___|--> |___|___|--> nil
| | |
| | |
--> rose --> violet --> buttercup
@end group
@end smallexample
@end ifclear
@noindent
In the diagram, each box represents a word of computer memory that
@ -9610,26 +9585,10 @@ evaluation of the expression
@need 1250
@noindent
creates a situation like this:
@c cons-cell-diagram #2
@ifset print-postscript-figures
@sp 1
@center @image{cons-2}
@sp 1
@end ifset
@ifclear print-postscript-figures
@smallexample
@group
bouquet
|
| ___ ___ ___ ___ ___ ___
--> |___|___|--> |___|___|--> |___|___|--> nil
| | |
| | |
--> rose --> violet --> buttercup
@end group
@end smallexample
@end ifclear
@noindent
In this example, the symbol @code{bouquet} holds the address of the first
@ -9638,26 +9597,10 @@ pair of boxes.
@need 1200
This same list can be illustrated in a different sort of box notation
like this:
@c cons-cell-diagram #2a
@ifset print-postscript-figures
@sp 1
@center @image{cons-2a}
@sp 1
@end ifset
@ifclear print-postscript-figures
@smallexample
@group
bouquet
|
| -------------- --------------- ----------------
| | car | cdr | | car | cdr | | car | cdr |
-->| rose | o------->| violet | o------->| butter- | nil |
| | | | | | | cup | |
-------------- --------------- ----------------
@end group
@end smallexample
@end ifclear
(Symbols consist of more than pairs of addresses, but the structure of
a symbol is made up of addresses. Indeed, the symbol @code{bouquet}
@ -9681,29 +9624,10 @@ evaluation of the following expression
@need 800
@noindent
produces this:
@c cons-cell-diagram #3
@ifset print-postscript-figures
@sp 1
@center @image{cons-3}
@sp 1
@end ifset
@ifclear print-postscript-figures
@sp 1
@smallexample
@group
bouquet flowers
| |
| ___ ___ | ___ ___ ___ ___
--> | | | --> | | | | | |
|___|___|----> |___|___|--> |___|___|--> nil
| | |
| | |
--> rose --> violet --> buttercup
@end group
@end smallexample
@sp 1
@end ifclear
@noindent
The value of @code{flowers} is @code{(violet buttercup)}, which is
@ -9731,29 +9655,11 @@ the expression
@need 1500
@noindent
produces:
@c cons-cell-diagram #4
@ifset print-postscript-figures
@sp 1
@center @image{cons-4}
@sp 1
@end ifset
@ifclear print-postscript-figures
@sp 1
@smallexample
@group
bouquet flowers
| |
| ___ ___ ___ ___ | ___ ___ ___ ___
--> | | | | | | --> | | | | | |
|___|___|----> |___|___|----> |___|___|---->|___|___|--> nil
| | | |
| | | |
--> lily --> rose --> violet --> buttercup
@end group
@end smallexample
@sp 1
@end ifclear
@need 1200
@noindent
@ -9810,43 +9716,10 @@ Reference Manual}.)
@need 1500
Here is a fanciful representation:
@c chest-of-drawers diagram
@ifset print-postscript-figures
@sp 1
@center @image{drawers}
@sp 1
@end ifset
@ifclear print-postscript-figures
@sp 1
@smallexample
@group
Chest of Drawers Contents of Drawers
__ o0O0o __
/ \
---------------------
| directions to | [map to]
| symbol name | bouquet
| |
+---------------------+
| directions to |
| symbol definition | [none]
| |
+---------------------+
| directions to | [map to]
| variable value | (rose violet buttercup)
| |
+---------------------+
| directions to |
| property list | [not described here]
| |
+---------------------+
|/ \|
@end group
@end smallexample
@sp 1
@end ifclear
@node List Exercise
@section Exercise
@ -9959,32 +9832,10 @@ by both the @code{kill-ring} and the @code{kill-ring-yank-pointer}. The
words ``a different piece of text'' and ``yet more text'' are not
duplicated. Instead, the two Lisp variables point to the same pieces of
text. Here is a diagram:
@c cons-cell-diagram #5
@ifset print-postscript-figures
@sp 1
@center @image{cons-5}
@sp 1
@end ifset
@ifclear print-postscript-figures
@smallexample
@group
kill-ring kill-ring-yank-pointer
| |
| ___ ___ | ___ ___ ___ ___
---> | | | --> | | | | | |
|___|___|----> |___|___|--> |___|___|--> nil
| | |
| | |
| | --> "yet more text"
| |
| --> "a different piece of text"
|
--> "some text"
@end group
@end smallexample
@sp 1
@end ifclear
Both the variable @code{kill-ring} and the variable
@code{kill-ring-yank-pointer} are pointers. But the kill ring itself is
@ -20706,24 +20557,10 @@ equivalent of @code{multiply-by-seven} is:
@need 1250
@noindent
If we want to multiply 3 by 7, we can write:
@c clear print-postscript-figures
@c lambda example diagram #1
@ifset print-postscript-figures
@sp 1
@center @image{lambda-1}
@sp 1
@end ifset
@ifclear print-postscript-figures
@smallexample
@group
(multiply-by-seven 3)
\_______________/ ^
| |
function argument
@end group
@end smallexample
@end ifclear
@noindent
This expression returns 21.
@ -20731,44 +20568,18 @@ This expression returns 21.
@need 1250
@noindent
Similarly, we can write:
@c lambda example diagram #2
@ifset print-postscript-figures
@sp 1
@center @image{lambda-2}
@sp 1
@end ifset
@ifclear print-postscript-figures
@smallexample
@group
((lambda (number) (* 7 number)) 3)
\____________________________/ ^
| |
anonymous function argument
@end group
@end smallexample
@end ifclear
@need 1250
@noindent
If we want to divide 100 by 50, we can write:
@c lambda example diagram #3
@ifset print-postscript-figures
@sp 1
@center @image{lambda-3}
@sp 1
@end ifset
@ifclear print-postscript-figures
@smallexample
@group
((lambda (arg) (/ arg 50)) 100)
\______________________/ \_/
| |
anonymous function argument
@end group
@end smallexample
@end ifclear
@noindent
This expression returns 2. The 100 is passed to the function, which

BIN
doc/lispintro/lambda-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View file

@ -0,0 +1,4 @@
(multiply-by-seven 3)
\_______________/ ^
| |
function argument

BIN
doc/lispintro/lambda-2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View file

@ -0,0 +1,4 @@
((lambda (number) (* 7 number)) 3)
\____________________________/ ^
| |
anonymous function argument

BIN
doc/lispintro/lambda-3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View file

@ -0,0 +1,4 @@
((lambda (arg) (/ arg 50)) 100)
\______________________/ \_/
| |
anonymous function argument