NEWS 269 KB
Newer Older
Dave Love's avatar
#  
Dave Love committed
1 2 3 4 5 6 7
GNU Emacs NEWS -- history of user-visible changes.  23 Jan 1999
Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
See the end for copying conditions.

Please send Emacs bug reports to bug-gnu-emacs@gnu.org.
For older news, see the file ONEWS.

Dave Love's avatar
Dave Love committed
8 9 10 11 12

* Installation Changes in Emacs 21.1

** `movemail' defaults to supporting POP.  You can turn this off using
the --without-pop configure option, should that be necessary.
Dave Love's avatar
#  
Dave Love committed
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

* Changes in Emacs 21.1

** Faces and frame parameters.

There are four new faces `scroll-bar', `border', `cursor' and `mouse'.
Setting the frame parameters `scroll-bar-foreground' and
`scroll-bar-background' sets foreground and background color of face
`scroll-bar' and vice versa.  Setting frame parameter `border-color'
sets the background color of face `border' and vice versa.  Likewise
for frame parameters `cursor-color' and face `cursor', and frame
parameter `mouse-color' and face `mouse'.

Changing frame parameter `font' sets font-related attributes of the
`default' face and vice versa.  Setting frame parameters
`foreground-color' or `background-color' sets the colors of the 
`default' face and vice versa.

Gerd Moellmann's avatar
Gerd Moellmann committed
31 32 33 34 35 36
** New face `menu'.

The face `menu' can be used to change colors and font of Emacs' menus.
Setting the font of LessTif/Motif menus is currently not supported;
attempts to set the font are ignored in this case.

Dave Love's avatar
#  
Dave Love committed
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338
** New frame parameter `screen-gamma' for gamma correction.

The new frame parameter `screen-gamma' specifies gamma-correction for
colors.  Its value may be nil, the default, in which case no gamma
correction occurs, or a number > 0, usually a float, that specifies
the screen gamma of a frame's display.

PC monitors usually have a screen gamma of 2.2.  smaller values result
in darker colors.  You might want to try a screen gamma of 1.5 for LCD
color displays.  The viewing gamma Emacs uses is 0.4545. (1/2.2).

The X resource name of this parameter is `screenGamma', class
`ScreenGamma'.

** Emacs has a new redisplay engine.

The new redisplay handles characters of variable width and height.
Italic text can be used without redisplay problems.  Fonts containing
oversized characters, i.e. characters larger than the logical height
of a font can be used.  Images of various formats can be displayed in
the text.

** Emacs has a new face implementation.

The new faces no longer fundamentally use X font names to specify the
font.  Instead, each face has several independent attributes--family,
height, width, weight and slant--that it may or may not specify.
These attributes can be merged from various faces, and then together
specify a font.

Faces are supported on terminals that can display color or fonts.
These terminal capabilities are auto-detected.  Details can be found
under Lisp changes, below.

** New default font is Courier 12pt.

** When using a windowing terminal, Emacs window now has a cursor of
its own.  When the window is selected, the cursor is solid; otherwise,
it is hollow.

** Bitmap areas to the left and right of windows are used to display
truncation marks, continuation marks, overlay arrows and alike.  The
foreground, background, and stipple of these areas can be changed by
customizing face `fringe'.

** The mode line under X is now drawn with shadows by default.  You
can change its appearance by modifying the face `modeline'.

** LessTif support.

Emacs now runs with LessTif (see <http://www.lesstif.org>).  You will
need a version 0.88.1 or later.

** Toolkit scroll bars.

Emacs now uses toolkit scrollbars if available.  When configured for
LessTif/Motif, it will use that toolkit's scrollbar.  Otherwise, when
configured for Lucid and Athena widgets, it will use the Xaw3d scroll
bar if Xaw3d is available.  You can turn off the use of toolkit scroll
bars by specifying `--with-toolkit-scroll-bars=no' when configuring
Emacs.

When you encounter problems with the Xaw3d scroll bar, watch out how
Xaw3d is compiled on your system.  If the Makefile generated from
Xaw3d's Imakefile contains a `-DNARROWPROTO' compiler option, and your
Emacs system configuration file `s/your-system.h' does not contain a
define for NARROWPROTO, you might consider adding it.  Take
`s/freebsd.h' as an example.

Alternatively, if you don't have access to the Xaw3d source code, take
a look at your system's imake configuration file, for example in the
directory `/usr/X11R6/lib/X11/config' (paths are different on
different systems).  You will find files `*.cf' there.  If your
system's cf-file contains a line like `#define NeedWidePrototypes NO',
add a `#define NARROWPROTO' to your Emacs system configuration file.

The reason for this is that one Xaw3d function uses `double' or
`float' function parameters depending on the setting of NARROWPROTO.
This is not a problem when Imakefiles are used because each system's
image configuration file contains the necessary information.  Since
Emacs doesn't use imake, this has do be done manually.

** Toggle buttons and radio buttons in menus.

When compiled with LessTif (or Motif) support, Emacs uses toolkit
widgets for radio and toggle buttons in menus.  When configured for
Lucid, Emacs draws radio buttons and toggle buttons similar to Motif.

** Highlighting of trailing whitespace.

When `show-trailing-whitespace' is non-nil, Emacs displays trailing
whitespace in the face `trailing-whitespace'.  Trailing whitespace is
defined as spaces or tabs at the end of a line.  To avoid busy
highlighting when entering new text, trailing whitespace is not
displayed if point is at the end of the line containing the
whitespace.

** Busy-cursor.

Emacs can optionally display a busy-cursor under X.  You can turn the
display on or off by customizing group `cursor'.

** Blinking cursor

M-x blink-cursor-mode toggles a blinking cursor under X and on
terminals having terminal capabilities `vi', `vs', and `ve'.  Blinking
and related parameters like frequency and delay can be customized in
the group `cursor'.

** New font-lock support mode `jit-lock-mode'.

This support mode is roughly equivalent to `lazy-lock' but is
generally faster.  It supports stealth and deferred fontification.
See the documentation of the function `jit-lock-mode' for more
details.

Font-lock uses jit-lock-mode as default support mode, so you don't
have to do anything to activate it.

** Tabs and variable-width text.

Tabs are now displayed with stretch properties; the width of a tab is
defined as a multiple of the normal character width of a frame, and is
independent of the fonts used in the text where the tab appears.
Thus, tabs can be used to line up text in different fonts.

** Enhancements of the Lucid menu bar

*** The Lucid menu bar now supports the resource "margin".

	emacs.pane.menubar.margin: 5

The default margin is 4 which makes the menu bar appear like the Motif
one.

*** Arrows that indicate sub-menus are now drawn with shadows, like in
Motif.

** Hscrolling in C code.

Horizontal scrolling now happens automatically.

** Tool bar support.

Emacs supports a tool bar at the top of a frame under X.  For details
how to define a tool bar, see the page describing Lisp-level changes.

** Mouse-sensitive mode line.

Different parts of the mode line under X have been made
mouse-sensitive.  Moving the mouse to a mouse-sensitive part in the mode
line changes the appearance of the mouse pointer to an arrow, and help
about available mouse actions is displayed either in the echo area, or
in the tooltip window if you have enabled one.

Currently, the following actions have been defined:

- Mouse-1 on the buffer name in the mode line switches between two
buffers.

- Mouse-2 on the buffer-name switches to the next buffer, and
M-mouse-2 switches to the previous buffer in the buffer list.

- Mouse-3 on the buffer-name displays a buffer menu.

- Mouse-1 on the read-only status in the mode line (`%' or `*')
toggles the read-only status.

- Mouse-3 on the mode name display a minor-mode menu.

** LessTif/Motif file selection dialog.

When Emacs is configured to use LessTif or Motif, reading a file name
from a menu will pop up a file selection dialog if `use-dialogs' is
non-nil.

** Emacs can display faces on TTY frames.

Emacs automatically detects terminals that are able to display colors.
Faces with a weight greater than normal are displayed extra-bright, if
the terminal supports it.  Faces with a weight less than normal and
italic faces are displayed dimmed, if the terminal supports it.
Underlined faces are displayed underlined if possible.  Other face
attributes like overlines, strike-throught, box are ignored.

** Sound support

Emacs supports playing sound files on GNU/Linux and the free BSDs
(Voxware driver and native BSD driver, aka as Luigi's driver).
Currently supported file formats are RIFF-WAVE (*.wav) and Sun Audio
(*.au).  You must configure Emacs with the option `--with-sound=yes'
to enable sound support.

** A new variable, backup-by-copying-when-privileged-mismatch, gives
the highest file uid for which backup-by-copying-when-mismatch will be
forced on.  The assumption is that uids less than or equal to this
value are special uids (root, bin, daemon, etc.--not real system
users) and that files owned by these users should not change ownership,
even if your system policy allows users other than root to edit them.

The default is 200; set the variable to nil to disable the feature.

** A block cursor can be drawn as wide as the glyph under it under X.

As an example: if a block cursor is over a tab character, it will be
drawn as wide as that tab on the display.  To do this, set
`x-stretch-cursor' to a non-nil value.

** Empty display lines at the end of a buffer may be marked with a
bitmap (this is similar to the tilde displayed by vi).

This behavior is activated by setting the buffer-local variable
`indicate-empty-lines' to a non-nil value.  The default value of this
variable is found in `default-indicate-empty-lines'.

** There is a new "aggressive" scrolling method.

When scrolling up because point is above the window start, if the
value of the buffer-local variable `scroll-up-aggessively' is a
number, Emacs chooses a new window start so that point ends up that
fraction of the window's height from the bottom of the window.

When scrolling down because point is below the window end, if the
value of the buffer-local variable `scroll-down-aggessively' is a
number, Emacs chooses a new window start so that point ends up that
fraction of the window's height from the top of the window.

** The rectangle commands now avoid inserting undesirable spaces,
notably at the end of lines.

All these functions have been rewritten to avoid inserting unwanted
spaces, and an optional prefix now allows them to behave the old way.

** The new command M-x query-replace-regexp-eval acts like
query-replace-regexp, but takes a Lisp expression which is evaluated
after each match to get the replacement text.

** Emacs now resizes mini-windows if appropriate.

If a message is longer than one line, or mini-buffer contents are
longer than one line, Emacs now resizes the mini-window unless it is
on a frame of its own.  You can control the maximum mini-window size
by setting the following variable:

- User option: max-mini-window-height

Maximum height for resizing mini-windows.  If a float, it specifies a
fraction of the mini-window frame's height.  If an integer, it
specifies a number of lines.  If nil, don't resize.

Default is 0.25.

** Changes to RefTeX mode

*** RefTeX has new support for index generation.  Index entries can be
    created with `C-c <', with completion available on index keys.
    Pressing `C-c /' indexes the word at the cursor with a default
    macro.  `C-c >' compiles all index entries into an alphabetically
    sorted *Index* buffer which looks like the final index.  Entries
    can be edited from that buffer.

*** Label and citation key selection now allow to select several
    items and reference them together (use `m' to mark items, `a' or
    `A' to use all marked entries).

*** reftex.el has been split into a number of smaller files to reduce
    memory use when only a part of RefTeX is being used.

*** a new command `reftex-view-crossref-from-bibtex' (bound to `C-c &'
    in BibTeX-mode) can be called in a BibTeX database buffer in order
    to show locations in LaTeX documents where a particular entry has
    been cited.

** The M-x time-stamp command (most commonly used on write-file-hooks)
has the following new features:

*** The patterns for finding the time stamp and for updating a pattern
may match text spanning multiple lines.  For example, some people like
to have the filename and date on separate lines.  The new variable
time-stamp-inserts-lines controls the matching for multi-line patterns.

*** More than one time stamp can be updated in the same file.  This
feature is useful if you need separate time stamps in a program source
file to both include in formatted documentation and insert in the
compiled binary.  The same time-stamp will be written at each matching
pattern.  The variable time-stamp-count enables this new feature; it
defaults to 1.

** Tooltips.

Tooltips are small X windows displaying a help string at the current
mouse position.  To use them, use the Lisp package `tooltip' which you
can access via the user option `tooltip-mode'.

Tooltips also provides support for GUD debugging.  If activated,
variable values can be displayed in tooltips by pointing at them with
the mouse in source buffers.  You can customize various aspects of the
tooltip display in the group `tooltip'.

** Customize changes

*** Customize now supports comments about customized items.  Use the
Dave Love's avatar
Dave Love committed
339 340
`State' menu to add comments.  Note that customization comments will
cause the customizations to fail in earlier versions of Emacs.
Dave Love's avatar
#  
Dave Love committed
341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369

*** The new option `custom-buffer-done-function' says whether to kill
Custom buffers when you've done with them or just bury them (the
default).

** New features in evaluation commands

The commands to evaluate Lisp expressions, such as C-M-x in Lisp
modes, C-j in Lisp Interaction mode, and M-:, now bind the variables
print-level, print-length, and debug-on-error based on the
customizable variables eval-expression-print-level,
eval-expression-print-length, and eval-expression-debug-on-error.

** Dired changes

*** New variable `dired-recursive-deletes' determines if the delete
command will delete non-empty directories recursively.  The default
is, delete only empty directories.

*** New variable `dired-recursive-copies' determines if the copy
command will copy directories recursively.  The default is, do not
copy directories recursively.

** The variable mail-specify-envelope-from controls whether to
use the -f option when sending mail.

** In Isearch mode, mouse-2 in the echo area now yanks the current
selection into the search string rather than giving an error.

Dave Love's avatar
Dave Love committed
370 371 372 373
** Ange-ftp allows you to specify of a port number in remote file
names cleanly.  It is appended to the host name, separated by a hash
sign, e.g. `/foo@bar.org#666:mumble'.  (This syntax comes from EFS.)

Gerd Moellmann's avatar
Gerd Moellmann committed
374 375 376 377 378 379
** Shell script mode changes.

Shell script mode (sh-script) can now indent scripts for shells
derived from sh and rc.  The indentation style is customizeable, and
sh-script can attempt to "learn" the current buffer's style.

380 381 382 383
** Emacs now attempts to determine the initial language environment
and preferred and locale coding systems systematically from the
LC_ALL, LC_CTYPE, and LANG environment variables during startup.

Dave Love's avatar
Dave Love committed
384 385 386 387 388
** New language environments `Latin-8' and `Latin-9'.
These correspond respectively to the ISO character sets 8859-14
(Celtic) and 8859-15 (updated Latin-1, with the Euro sign).  There is
currently no specific input method support for them.

Dave Love's avatar
#  
Dave Love committed
389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404
** New modes and packages

*** 5x5.el is a simple puzzle game.

*** hl-line.el provides a minor mode to highlight the current line.

*** ansi-color.el translates ANSI terminal escapes into text-properties.

*** delphi.el provides a major mode for editing the Delphi (Object
Pascal) language.

*** quickurl.el provides a simple method of inserting a URL based on
the text at point.

*** sql.el provides an interface to SQL data bases.

Dave Love's avatar
Dave Love committed
405 406
*** fortune.el uses the fortune program to create mail/news signatures.

Dave Love's avatar
#  
Dave Love committed
407 408
*** whitespace.el ???

Gerd Moellmann's avatar
Gerd Moellmann committed
409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461
*** PostScript mode (ps-mode) is a new major mode for editing PostScript
files. It offers: interaction with a PostScript interpreter, including
(very basic) error handling; fontification, easily customizable for
interpreter messages; auto-indentation; insertion of EPSF templates and
often used code snippets; viewing of BoundingBox; commenting out /
uncommenting regions; conversion of 8bit characters to PostScript octal
codes. All functionality is accessible through a menu.

*** delim-col helps to prettify columns in a text region or rectangle.

Here is an example of columns:

horse	apple	bus
dog	pineapple	car	EXTRA
porcupine	strawberry	airplane

Doing the following settings:

   (setq delimit-columns-str-before "[ ")
   (setq delimit-columns-str-after " ]")
   (setq delimit-columns-str-separator ", ")
   (setq delimit-columns-separator "\t")


Selecting the lines above and typing:

   M-x delimit-columns-region

It results:

[ horse    , apple     , bus     ,       ]
[ dog      , pineapple , car     , EXTRA ]
[ porcupine, strawberry, airplane,       ]

delim-col has the following options:

   delimit-columns-str-before		Specify a string to be inserted
					before all columns.

   delimit-columns-str-separator	Specify a string to be inserted
					between each column.

   delimit-columns-str-after		Specify a string to be inserted
					after all columns.

   delimit-columns-separator		Specify a regexp which separates
					each column.

delim-col has the following commands:

   delimit-columns-region	Prettify all columns in a text region.
   delimit-columns-rectangle	Prettify all columns in a text rectangle.

Gerd Moellmann's avatar
Gerd Moellmann committed
462 463 464 465 466 467 468 469 470 471 472 473 474 475
*** The package recentf.el maintains a menu for visiting files that
were operated on recently.  When enabled, a new "Open Recent" submenu
is displayed in the "Files" menu.

The recent files list is automatically saved across Emacs sessions.

To enable/disable recentf use M-x recentf-mode.

To enable recentf at Emacs startup use
M-x customize-variable RET recentf-mode RET.

To change the number of recent files displayed and others options use
M-x customize-group RET recentf RET.

Dave Love's avatar
Dave Love committed
476 477 478
*** elide-head.el provides a mechanism for eliding boilerplate header
text.

Dave Love's avatar
#  
Dave Love committed
479 480 481 482
** Withdrawn packages

*** mldrag.el has been removed.  mouse.el provides the same
functionality with aliases for the mldrag functions.
Dave Love's avatar
Dave Love committed
483 484

*** eval-reg.el has been obsoleted by changes to edebug.el.
485 486 487 488

** Not new, but not mentioned before:
M-w when Transient Mark mode is enabled disables the mark.

Dave Love's avatar
#  
Dave Love committed
489 490 491 492 493 494 495 496

* Lisp changes in Emacs 21.1 (see following page for display-related features)

Note that +++ before an item means the Lisp manual has been updated.
--- means that I have decided it does not need to be in the Lisp manual.
When you add a new item, please add it without either +++ or ---
so I will know I still need to look at it -- rms.

497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514
** New functions and variables for locales.

The new variable `locale-coding-system' specifies how to encode and
decode strings passed to low-level message functions like strerror and
time functions like strftime.  The new variables `messages-locale' and
`time-locale' give the system locales to be used during the next
invocations of these two types of functions; the new variables
`previous-messages-locale' and `previous-time-locale' give the locales
most recently used.

The new function `set-locale-environment' sets the language
environment, preferred coding system, and locale coding system from
the system locale as specified by the LC_ALL, LC_CTYPE, and LANG
environment variables.  It is normally invoked during startup.  It
uses the new variables `locale-language-names',
`locale-charset-language-names', and `locale-preferred-coding-systems'
to make its decisions.

Stefan Monnier's avatar
Stefan Monnier committed
515 516 517 518 519
** syntax tables now understand nested comments.
To declare a comment syntax as allowing nesting, just add an `n'
modifier to either of the characters of the comment end and the comment
start sequences.

520 521 522
** The function `pixmap-spec-p' has been renamed `bitmap-spec-p'
because `bitmap' is more in line with the usual X terminology.

Dave Love's avatar
#  
Dave Love committed
523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802
** New function `propertize'

The new function `propertize' can be used to conveniently construct
strings with text properties.

- Function: propertize STRING &rest PROPERTIES

Value is a copy of STRING with text properties assigned as specified
by PROPERTIES.  PROPERTIES is a sequence of pairs PROPERTY VALUE, with
PROPERTY being the name of a text property and VALUE being the
specified value of that property.  Example:

  (propertize "foo" 'face 'bold 'read-only t)

+++
** push and pop macros.

A simple version of the push and pop macros of Common Lisp
is now defined in Emacs Lisp.  These macros allow only symbols
as the place that holds the list to be changed.

(push NEWELT LISTNAME)  add NEWELT to the front of LISTNAME's value.
(pop LISTNAME)          return first elt of LISTNAME, and remove it
			(thus altering the value of LISTNAME).

+++
** Regular expressions now support Posix character classes such
as [:alpha:], [:space:] and so on.

[:digit:]  matches 0 through 9
[:cntrl:]  matches ASCII control characters
[:xdigit:]  matches 0 through 9, a through f and A through F.
[:blank:]  matches space and tab only
[:graph:]  matches graphic characters--everything except ASCII control chars,
	   space, and DEL.
[:print:]  matches printing characters--everything except ASCII control chars
	   and DEL.
[:alnum:]  matches letters and digits.
	   (But at present, for multibyte characters,
	    it matches anything that has word syntax.)
[:alpha:]  matches letters.
	   (But at present, for multibyte characters,
	    it matches anything that has word syntax.)
[:ascii:]  matches ASCII (unibyte) characters.
[:nonascii:]  matches non-ASCII (multibyte) characters.
[:lower:]  matches anything lower-case.
[:punct:]  matches punctuation.
	   (But at present, for multibyte characters,
	    it matches anything that has non-word syntax.)
[:space:]  matches anything that has whitespace syntax.
[:upper:]  matches anything upper-case.
[:word:]   matches anything that has word syntax.

+++
** Emacs now has built-in hash tables.

The following functions are defined for hash tables:

- Function: make-hash-table ARGS

The argument list ARGS consists of keyword/argument pairs.  All arguments
are optional.  The following arguments are defined:

:test TEST

TEST must be a symbol specifying how to compare keys.  Default is `eql'.
Predefined are `eq', `eql' and `equal'.  If TEST is not predefined,
it must have been defined with `define-hash-table-test'.

:size SIZE

SIZE must be an integer > 0 giving a hint to the implementation how
many elements will be put in the hash table.  Default size is 65.

:rehash-size REHASH-SIZE

REHASH-SIZE specifies by how much to grow a hash table once it becomes
full.  If REHASH-SIZE is an integer, add that to the hash table's old
size to get the new size.  Otherwise, REHASH-SIZE must be a float >
1.0, and the new size is computed by multiplying REHASH-SIZE with the
old size.  Default rehash size is 1.5.

:rehash-threshold THRESHOLD

THRESHOLD must be a float > 0 and <= 1.0 specifying when to resize the
hash table.  It is resized when the ratio of (number of entries) /
(size of hash table) is >= THRESHOLD.  Default threshold is 0.8.

:weakness WEAK

WEAK must be either nil, one of the symbols `key, `value', or t.
Entries are removed from weak tables during garbage collection if
their key and/or value are not referenced elsewhere outside of the
hash table.  Default are non-weak hash tables.

- Function: makehash &optional TEST

Similar to make-hash-table, but only TEST can be specified.

- Function: hash-table-p TABLE

Returns non-nil if TABLE is a hash table object.

- Function: copy-hash-table TABLE

Returns a copy of TABLE.  Only the table itself is copied, keys and
values are shared.

- Function: hash-table-count TABLE

Returns the number of entries in TABLE.

- Function: hash-table-rehash-size TABLE

Returns the rehash size of TABLE.

- Function: hash-table-rehash-threshold TABLE

Returns the rehash threshold of TABLE.

- Function: hash-table-rehash-size TABLE

Returns the size of TABLE.

- Function: hash-table-rehash-test TABLE

Returns the test TABLE uses to compare keys.

- Function: hash-table-weakness TABLE

Returns the weakness specified for TABLE.

- Function: clrhash TABLE

Clear TABLE.

- Function: gethash KEY TABLE &optional DEFAULT

Look up KEY in TABLE and return its associated VALUE or DEFAULT if
not found.

- Function: puthash KEY VALUE TABLE 

Associate KEY with VALUE in TABLE.  If KEY is already associated with
another value, replace the old value with VALUE.

- Function: remhash KEY TABLE

Remove KEY from TABLE if it is there.

- Function: maphash FUNCTION TABLE

Call FUNCTION for all elements in TABLE.  FUNCTION must take two
arguments KEY and VALUE.

- Function: sxhash OBJ

Return a hash code for Lisp object OBJ.

- Function: define-hash-table-test NAME TEST-FN HASH-FN

Define a new hash table test named NAME.  If NAME is specified as
a test in `make-hash-table', the table created will use TEST-FN for
comparing keys, and HASH-FN to compute hash codes for keys.  Test 
and hash function are stored as symbol property `hash-table-test'
of NAME with a value of (TEST-FN HASH-FN).

TEST-FN must take two arguments and return non-nil if they are the same.

HASH-FN must take one argument and return an integer that is the hash
code of the argument.  The function should use the whole range of
integer values for hash code computation, including negative integers.

Example: The following creates a hash table whose keys are supposed to
be strings that are compared case-insensitively.

  (defun case-fold-string= (a b)
    (compare-strings a nil nil b nil nil t))

  (defun case-fold-string-hash (a)
    (sxhash (upcase a)))

  (define-hash-table-test 'case-fold 'case-fold-string= 
                          'case-fold-string-hash))

  (make-hash-table :test 'case-fold)

+++
** The Lisp reader handles circular structure.

It now works to use the #N= and #N# constructs to represent
circular structures.  For example, #1=(a . #1#) represents
a cons cell which is its own cdr.

+++
** The Lisp printer handles circular structure.

If you bind print-circle to a non-nil value, the Lisp printer outputs
#N= and #N# constructs to represent circular and shared structure.

+++
** If the second argument to `move-to-column' is anything but nil or
t, that means replace a tab with spaces if necessary to reach the
specified column, but do not add spaces at the end of the line if it
is too short to reach that column.

+++
** perform-replace has a new feature:  the REPLACEMENTS argument may
now be a cons cell (FUNCTION . DATA).  This means to call FUNCTION
after each match to get the replacement text.  FUNCTION is called with
two arguments: DATA, and the number of replacements already made.

If the FROM-STRING contains any upper-case letters,
perform-replace also turns off `case-fold-search' temporarily
and inserts the replacement text without altering case in it.

+++
** The function buffer-size now accepts an optional argument
to specify which buffer to return the size of.

+++
** The calendar motion commands now run the normal hook
calendar-move-hook after moving point.

+++
** The new variable small-temporary-file-directory specifies a
directory to use for creating temporary files that are likely to be
small.  (Certain Emacs features use this directory.)  If
small-temporary-file-directory is nil, they use
temporary-file-directory instead.

+++
** The variable `inhibit-modification-hooks', if non-nil, inhibits all
the hooks that track changes in the buffer.  This affects
`before-change-functions' and `after-change-functions', as well as
hooks attached to text properties and overlay properties.

+++
** assoc-delete-all is a new function that deletes all the
elements of an alist which have a particular value as the car.

+++
** make-temp-file provides a more reliable way to create a temporary file.

make-temp-file is used like make-temp-name, except that it actually
creates the file before it returns.  This prevents a timing error,
ensuring that no other job can use the same name for a temporary file.

+++
** New exclusive-open feature in `write-region'

The optional seventh arg is now called MUSTBENEW.  If non-nil, it insists
on a check for an existing file with the same name.  If MUSTBENEW
is `excl', that means to get an error if the file already exists;
never overwrite. If MUSTBENEW is neither nil nor `excl', that means
ask for confirmation before overwriting, but do go ahead and
overwrite the file if the user gives confirmation.

If the MUSTBENEW argument in `write-region' is `excl',
that means to use a special feature in the `open' system call
to get an error if the file exists at that time.
The error reported is `file-already-exists'.

+++
** Function `format' now handles text properties.

Text properties of the format string are applied to the result string.
If the result string is longer than the format string, text properties
ending at the end of the format string are extended to the end of the
result string.

Text properties from string arguments are applied to the result
string where arguments appear in the result string.

Example:

  (let ((s1 "hello, %s")
        (s2 "world"))
     (put-text-property 0 (length s1) 'face 'bold s1)
     (put-text-property 0 (length s2) 'face 'italic s2)
Gerd Moellmann's avatar
Gerd Moellmann committed
803
     (format s1 s2))
Dave Love's avatar
#  
Dave Love committed
804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001

results in a bold-face string with an italic `world' at the end.

+++
** Messages can now be displayed with text properties.

Text properties are handled as described above for function `format'.
The following example displays a bold-face message with an italic
argument in it.

  (let ((msg "hello, %s!")
        (arg "world"))
     (put-text-property 0 (length msg) 'face 'bold msg)
     (put-text-property 0 (length arg) 'face 'italic arg)
     (message msg arg))

+++
** Sound support

Emacs supports playing sound files on GNU/Linux and the free BSDs
(Voxware driver and native BSD driver, aka as Luigi's driver).

Currently supported file formats are RIFF-WAVE (*.wav) and Sun Audio
(*.au).  You must configure Emacs with the option `--with-sound=yes'
to enable sound support.

Sound files can be played by calling (play-sound SOUND).  SOUND is a
list of the form `(sound PROPERTY...)'.  The function is only defined
when sound support is present for the system on which Emacs runs.  The
functions runs `play-sound-functions' with one argument which is the
sound to play, before playing the sound.

The following sound properties are supported:

- `:file FILE'

FILE is a file name.  If FILE isn't an absolute name, it will be
searched relative to `data-directory'.

- `:volume VOLUME'

VOLUME must be an integer in the range 0..100 or a float in the range
0..1.  This property is optional.

Other properties are ignored.

** `multimedia' is a new Finder keyword and Custom group.

* New Lisp-level Display features in Emacs 21.1

Note that +++ before an item means the Lisp manual has been updated.
--- means that I have decided it does not need to be in the Lisp manual.
When you add a new item, please add it without either +++ or ---
so I will know I still need to look at it -- rms.

** New face implementation.

Emacs faces have been reimplemented from scratch.  They don't use XLFD
font names anymore and face merging now works as expected.

+++
*** New faces.

Each face can specify the following display attributes:

   1. Font family or fontset alias name.
   
   2. Relative proportionate width, aka character set width or set
   width (swidth), e.g. `semi-compressed'.
   
   3. Font height in 1/10pt
   
   4. Font weight, e.g. `bold'.
   
   5. Font slant, e.g. `italic'.
   
   6. Foreground color.
   
   7. Background color.

   8. Whether or not characters should be underlined, and in what color.

   9. Whether or not characters should be displayed in inverse video.

   10. A background stipple, a bitmap.

   11. Whether or not characters should be overlined, and in what color.

   12. Whether or not characters should be strike-through, and in what
   color.

   13. Whether or not a box should be drawn around characters, its
   color, the width of the box lines, and 3D appearance.

Faces are frame-local by nature because Emacs allows to define the
same named face (face names are symbols) differently for different
frames.  Each frame has an alist of face definitions for all named
faces.  The value of a named face in such an alist is a Lisp vector
with the symbol `face' in slot 0, and a slot for each each of the face
attributes mentioned above.

There is also a global face alist `face-new-frame-defaults'.  Face
definitions from this list are used to initialize faces of newly
created frames.
   
A face doesn't have to specify all attributes.  Those not specified
have a nil value.  Faces specifying all attributes are called
`fully-specified'.

+++
*** Face merging.

The display style of a given character in the text is determined by
combining several faces.  This process is called `face merging'.  Any
aspect of the display style that isn't specified by overlays or text
properties is taken from the `default' face.  Since it is made sure
that the default face is always fully-specified, face merging always
results in a fully-specified face.

+++
*** Face realization.

After all face attributes for a character have been determined by
merging faces of that character, that face is `realized'.  The
realization process maps face attributes to what is physically
available on the system where Emacs runs.  The result is a `realized
face' in form of an internal structure which is stored in the face
cache of the frame on which it was realized.

Face realization is done in the context of the charset of the
character to display because different fonts and encodings are used
for different charsets.  In other words, for characters of different
charsets, different realized faces are needed to display them.

Except for composite characters, faces are always realized for a
specific character set and contain a specific font, even if the face
being realized specifies a fontset.  The reason is that the result of
the new font selection stage is better than what can be done with
statically defined font name patterns in fontsets.

In unibyte text, Emacs' charsets aren't applicable; function
`char-charset' reports ASCII for all characters, including those >
0x7f.  The X registry and encoding of fonts to use is determined from
the variable `face-default-registry' in this case.  The variable is
initialized at Emacs startup time from the font the user specified for
Emacs.

Currently all unibyte text, i.e. all buffers with
`enable-multibyte-characters' nil are displayed with fonts of the same
registry and encoding `face-default-registry'.  This is consistent
with the fact that languages can also be set globally, only.

++++
**** Clearing face caches.

The Lisp function `clear-face-cache' can be called to clear face caches
on all frames.  If called with a non-nil argument, it will also unload
unused fonts.

+++
*** Font selection.
   
Font selection tries to find the best available matching font for a
given (charset, face) combination.  This is done slightly differently
for faces specifying a fontset, or a font family name.

If the face specifies a fontset name, that fontset determines a
pattern for fonts of the given charset.  If the face specifies a font
family, a font pattern is constructed.  Charset symbols have a
property `x-charset-registry' for that purpose that maps a charset to
an XLFD registry and encoding in the font pattern constructed.

Available fonts on the system on which Emacs runs are then matched
against the font pattern.  The result of font selection is the best
match for the given face attributes in this font list.

Font selection can be influenced by the user.

The user can specify the relative importance he gives the face
attributes width, height, weight, and slant by setting
face-font-selection-order (faces.el) to a list of face attribute
names.  The default is (:width :height :weight :slant), and means
that font selection first tries to find a good match for the font
width specified by a face, then---within fonts with that width---tries
to find a best match for the specified font height, etc.

Setting `face-alternative-font-family-alist' allows the user to
specify alternative font families to try if a family specified by a
face doesn't exist.

+++
**** Scalable fonts

Emacs can make use of scalable fonts but doesn't do so by default,
since the use of too many or too big scalable fonts may crash XFree86
servers.

To enable scalable font use, set the variable
Gerd Moellmann's avatar
Gerd Moellmann committed
1002
`scalable-fonts-allowed'.  A value of nil, the default, means never use
Dave Love's avatar
#  
Dave Love committed
1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221
scalable fonts.  A value of t means any scalable font may be used.
Otherwise, the value must be a list of regular expressions.  A
scalable font may then be used if it matches a regular expression from
that list.  Example:

  (setq scalable-fonts-allowed '("muleindian-2$"))

allows the use of scalable fonts with registry `muleindian-2'.

+++
*** Functions and variables related to font selection.

- Function: x-family-fonts &optional FAMILY FRAME

Return a list of available fonts of family FAMILY on FRAME.  If FAMILY
is omitted or nil, list all families.  Otherwise, FAMILY must be a
string, possibly containing wildcards `?' and `*'.

If FRAME is omitted or nil, use the selected frame.  Each element of
the result is a vector [FAMILY WIDTH POINT-SIZE WEIGHT SLANT FIXED-P
FULL REGISTRY-AND-ENCODING].  FAMILY is the font family name.
POINT-SIZE is the size of the font in 1/10 pt.  WIDTH, WEIGHT, and
SLANT are symbols describing the width, weight and slant of the font.
These symbols are the same as for face attributes.  FIXED-P is non-nil
if the font is fixed-pitch.  FULL is the full name of the font, and
REGISTRY-AND-ENCODING is a string giving the registry and encoding of
the font.  The result list is sorted according to the current setting
of the face font sort order.

- Function: x-font-family-list 

Return a list of available font families on FRAME.  If FRAME is
omitted or nil, use the selected frame.  Value is a list of conses
(FAMILY . FIXED-P) where FAMILY is a font family, and FIXED-P is
non-nil if fonts of that family are fixed-pitch.

- Variable: font-list-limit

Limit for font matching.  If an integer > 0, font matching functions
won't load more than that number of fonts when searching for a
matching font.  The default is currently 100.

+++
*** Setting face attributes.

For the most part, the new face implementation is interface-compatible
with the old one.  Old face attribute related functions are now
implemented in terms of the new functions `set-face-attribute' and
`face-attribute'.

Face attributes are identified by their names which are keyword
symbols.  All attributes can be set to `unspecified'.

The following attributes are recognized:

`:family'

VALUE must be a string specifying the font family, e.g. ``courier'',
or a fontset alias name.  If a font family is specified, wild-cards `*'
and `?' are allowed.

`:width'

VALUE specifies the relative proportionate width of the font to use.
It must be one of the symbols `ultra-condensed', `extra-condensed',
`condensed', `semi-condensed', `normal', `semi-expanded', `expanded',
`extra-expanded', or `ultra-expanded'.

`:height'

VALUE must be an integer specifying the height of the font to use in
1/10 pt.

`:weight'

VALUE specifies the weight of the font to use.  It must be one of the
symbols `ultra-bold', `extra-bold', `bold', `semi-bold', `normal',
`semi-light', `light', `extra-light', `ultra-light'.

`:slant'

VALUE specifies the slant of the font to use.  It must be one of the
symbols `italic', `oblique', `normal', `reverse-italic', or
`reverse-oblique'.

`:foreground', `:background'

VALUE must be a color name, a string.

`:underline'

VALUE specifies whether characters in FACE should be underlined.  If
VALUE is t, underline with foreground color of the face.  If VALUE is
a string, underline with that color.  If VALUE is nil, explicitly
don't underline.

`:overline'

VALUE specifies whether characters in FACE should be overlined.  If
VALUE is t, overline with foreground color of the face.  If VALUE is a
string, overline with that color.  If VALUE is nil, explicitly don't
overline.

`:strike-through'

VALUE specifies whether characters in FACE should be drawn with a line
striking through them.  If VALUE is t, use the foreground color of the
face.  If VALUE is a string, strike-through with that color.  If VALUE
is nil, explicitly don't strike through.

`:box'

VALUE specifies whether characters in FACE should have a box drawn
around them.  If VALUE is nil, explicitly don't draw boxes.  If
VALUE is t, draw a box with lines of width 1 in the foreground color
of the face.  If VALUE is a string, the string must be a color name,
and the box is drawn in that color with a line width of 1.  Otherwise,
VALUE must be a property list of the form `(:line-width WIDTH
:color COLOR :style STYLE)'.  If a keyword/value pair is missing from
the property list, a default value will be used for the value, as
specified below.  WIDTH specifies the width of the lines to draw; it
defaults to 1.  COLOR is the name of the color to draw in, default is
the foreground color of the face for simple boxes, and the background
color of the face for 3D boxes.  STYLE specifies whether a 3D box
should be draw.  If STYLE is `released-button', draw a box looking
like a released 3D button.  If STYLE is `pressed-button' draw a box
that appears like a pressed button.  If STYLE is nil, the default if
the property list doesn't contain a style specification, draw a 2D
box.

`:inverse-video'

VALUE specifies whether characters in FACE should be displayed in
inverse video. VALUE must be one of t or nil.

`:stipple'

If VALUE is a string, it must be the name of a file of pixmap data.
The directories listed in the `x-bitmap-file-path' variable are
searched.  Alternatively, VALUE may be a list of the form (WIDTH
HEIGHT DATA) where WIDTH and HEIGHT are the size in pixels, and DATA
is a string containing the raw bits of the bitmap.  VALUE nil means
explicitly don't use a stipple pattern.

For convenience, attributes `:family', `:width', `:height', `:weight',
and `:slant' may also be set in one step from an X font name:

`:font'

Set font-related face attributes from VALUE.  VALUE must be a valid
XLFD font name.  If it is a font name pattern, the first matching font
is used--this is for compatibility with the behavior of previous
versions of Emacs.

For compatibility with Emacs 20, keywords `:bold' and `:italic' can
be used to specify that a bold or italic font should be used.  VALUE
must be t or nil in that case.  A value of `unspecified' is not allowed."

Please see also the documentation of `set-face-attribute' and
`defface'.

*** Face attributes and X resources

The following X resource names can be used to set face attributes
from X resources:

  Face attribute	X resource		class
-----------------------------------------------------------------------
  :family		attributeFamily .	Face.AttributeFamily
  :width		attributeWidth		Face.AttributeWidth
  :height		attributeHeight		Face.AttributeHeight
  :weight		attributeWeight		Face.AttributeWeight
  :slant		attributeSlant		Face.AttributeSlant
   foreground		attributeForeground	Face.AttributeForeground
  :background		attributeBackground .	Face.AttributeBackground
  :overline		attributeOverline	Face.AttributeOverline
  :strike-through	attributeStrikeThrough	Face.AttributeStrikeThrough
  :box			attributeBox		Face.AttributeBox
  :underline		attributeUnderline	Face.AttributeUnderline
  :inverse-video	attributeInverse	Face.AttributeInverse
  :stipple		attributeStipple	Face.AttributeStipple
	or		attributeBackgroundPixmap 
						Face.AttributeBackgroundPixmap
  :font			attributeFont		Face.AttributeFont
  :bold			attributeBold		Face.AttributeBold
  :italic		attributeItalic .	Face.AttributeItalic
  :font			attributeFont		Face.AttributeFont

+++
*** Text property `face'.

The value of the `face' text property can now be a single face
specification or a list of such specifications.  Each face
specification can be

1. A symbol or string naming a Lisp face.

2. A property list of the form (KEYWORD VALUE ...) where each
   KEYWORD is a face attribute name, and VALUE is an appropriate value
   for that attribute.  Please see the doc string of `set-face-attribute'
   for face attribute names.

3. Conses of the form (FOREGROUND-COLOR . COLOR) or
   (BACKGROUND-COLOR . COLOR) where COLOR is a color name.  This is
   for compatibility with previous Emacs versions.

+++
** Support functions for colors on text-only terminals.

The function `face-register-tty-color' can be used to define colors
for use on TTY frames.  It maps a color name to a color number on the
terminal.  Emacs defines a couple of default color mappings by
default.  You can get defined colors with a call to
`tty-defined-colors'.  The function `face-clear-tty-colors' can be
used to clear the mapping table.

+++
** The minibuffer prompt is now actually inserted in the minibuffer.

1222
This makes it possible to scroll through the prompt, if you want to.
Dave Love's avatar
#  
Dave Love committed
1223 1224 1225 1226 1227

The function minubuffer-prompt-end returns the current position of the
end of the minibuffer prompt, if the minibuffer is current.
Otherwise, it returns zero.

1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246
** New `field' abstraction in buffers.

There is now code to support an abstraction called `fields' in emacs
buffers.  A field is a contiguous region of text with the same `field'
text-property.

Certain functions, such as forward-word, forward-sentence,
forward-paragraph, beginning-of-line, etc., stop moving when they come
to the boundary between fields (beginning-of-line and end-of-line will
not let the point move past the field boundary, but other movement
commands continue into the next field if repeated).

The new function constrain-to-field may be used to achieve similar
behavior; other new field functions include field-beginning, field-end,
erase-field, and field-string.

Now that the minibuffer prompt is inserted into the minibuffer, it is in
a separate field from the user-input part of the buffer, so that many
editing commands treat the user's text separately from the prompt.
Dave Love's avatar
#  
Dave Love committed
1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314

+++
** Image support.

Emacs can now display images.  Images are inserted into text by giving
strings or buffer text a `display' text property containing one of
(AREA IMAGE) or IMAGE.  The display of the `display' property value
replaces the display of the characters having that property.

If the property value has the form (AREA IMAGE), AREA must be one of
`(margin left-margin)', `(margin right-margin)' or `(margin nil)'.  If
AREA is `(margin nil)', IMAGE will be displayed in the text area of a
window, otherwise it will be displayed in the left or right marginal
area.

IMAGE is an image specification.

*** Image specifications

Image specifications are lists of the form `(image PROPS)' where PROPS
is a property list whose keys are keyword symbols.  Each
specifications must contain a property `:type TYPE' with TYPE being a
symbol specifying the image type, e.g. `xbm'.

The following is a list of properties all image types share.

`:ascent ASCENT'

ASCENT must be a number in the range 0..100, and specifies the percentage
of the image's height to use for its ascent.  Default is 50.

`:margin MARGIN'

MARGIN must be a number >= 0 specifying how many pixels to put as 
margin around the image.  Default is 0.

`:relief RELIEF'

RELIEF is analogous to the `:relief' attribute of faces.  Puts a relief
around an image.

`:algorithm ALGO'

Apply an image algorithm to the image before displaying it.  ALGO must
be a symbol specifying the algorithm.  Currently only `laplace' is
supported which applies a Laplace edge detection algorithm to an image
which is intended to display images "disabled."

`:heuristic-mask BG'

If BG is not nil, build a clipping mask for the image, so that the
background of a frame is visible behind the image.  If BG is t,
determine the background color of the image by looking at the 4
corners of the image, assuming the most frequently occuring color from
the corners is the background color of the image.  Otherwise, BG must
be a list `(RED GREEN BLUE)' specifying the color to assume for the
background of the image.

`:file FILE'

Load image from FILE.  If FILE is not absolute after expanding it,
search for the image in `data-directory'.  Some image types support
building images from data.  When this is done, no `:file' property
may be present in the image specification.


*** Supported image types

Gerd Moellmann's avatar
Gerd Moellmann committed
1315
**** XBM, image type `xbm'.
Dave Love's avatar
#  
Dave Love committed
1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442

XBM images don't require an external library.  Additional image
properties supported are

`:foreground FG'

FG must be a string specifying the image foreground color.  Default
is the frame's foreground.

`:background FG'

BG must be a string specifying the image foreground color.  Default is
the frame's background color.

XBM images can be constructed from data instead of file.  In this
case, the image specification must contain the following properties
instead of a `:file' property.

`:width WIDTH'

WIDTH specifies the width of the image in pixels.

`:height HEIGHT'

HEIGHT specifies the height of the image in pixels.

`:data DATA'

DATA must be either

   1. a string large enough to hold the bitmap data, i.e. it must
   have a size >= (WIDTH + 7) / 8 * HEIGHT

   2. a bool-vector of size >= WIDTH * HEIGHT

   3. a vector of strings or bool-vectors, one for each line of the
   bitmap.

**** XPM, image type `xpm'

XPM images require the external library `libXpm', package
`xpm-3.4k.tar.gz', version 3.4k or later.  Make sure the library is
found when Emacs is configured by supplying appropriate paths via
`--x-includes' and `--x-libraries'.

Additional image properties supported are:

`:color-symbols SYMBOLS'

SYMBOLS must be a list of pairs (NAME . COLOR), with NAME being the
name of color as it appears in an XPM file, and COLOR being an X color
name.

XPM images can be built from memory instead of files.  In that case,
add a `:data' property instead of a `:file' property.

`:data DATA'

DATA must be a string containing an XPM image.  The contents of the 
string are of the same format as that of XPM files.

The XPM library uses libz in its implementation so that it is able
to display compressed images.

**** PBM, image type `pbm'

PBM images don't require an external library.  Color, gray-scale and
mono images are supported.  There are no additional image properties
defined.

**** JPEG, image type `jpeg'

Support for JPEG images requires the external library `libjpeg',
package `jpegsrc.v6a.tar.gz', or later.  There are no additional image
properties defined.

**** TIFF, image type `tiff'

Support for TIFF images requires the external library `libtiff',
package `tiff-v3.4-tar.gz', or later.  There are no additional image
properties defined.

**** GIF, image type `gif'

Support for GIF images requires the external library `libungif', package
`libungif-4.1.0', or later.

Additional image properties supported are:

`:index INDEX'

INDEX must be an integer >= 0.  Load image number INDEX from a
multi-image GIF file.  An error is signalled if INDEX is too large.

This could be used to implement limited support for animated GIFs.
For example, the following function displays a multi-image GIF file
at point-min in the current buffer, switching between sub-images
every 0.1 seconds.

(defun show-anim (file max)
  "Display multi-image GIF file FILE which contains MAX subimages."
  (display-anim (current-buffer) file 0 max t))

(defun display-anim (buffer file idx max first-time)
  (when (= idx max)
    (setq idx 0))
  (let ((img (create-image file nil :index idx)))
    (save-excursion
      (set-buffer buffer)
      (goto-char (point-min))
      (unless first-time (delete-char 1))
      (insert-image img "x"))
    (run-with-timer 0.1 nil 'display-anim buffer file (1+ idx) max nil)))

**** PNG, image type `png'

Support for PNG images requires the external library `libpng',
package `libpng-1.0.2.tar.gz', or later.  There are no additional image
properties defined.

**** Ghostscript, image type `postscript'.

Additional image properties supported are:

`:pt-width WIDTH'

WIDTH is width of the image in pt (1/72 inch).  WIDTH must be an
Gerd Moellmann's avatar
Gerd Moellmann committed
1443
integer.  This is a required property.
Dave Love's avatar
#  
Dave Love committed
1444 1445 1446 1447

`:pt-height HEIGHT'

HEIGHT specifies the height of the image in pt (1/72 inch).  HEIGHT
Gerd Moellmann's avatar
Gerd Moellmann committed
1448
must be a integer.  This is an required property.
Dave Love's avatar
#  
Dave Love committed
1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773