aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaroly Lorentey2004-04-23 14:44:11 +0000
committerKaroly Lorentey2004-04-23 14:44:11 +0000
commitced7ed5611e2a6e60a5ac7a97e165545843d0fa9 (patch)
tree85194b67c680d1a37af652a4b614a7e1fcd336ba
parent6ad9aaa961f1ac376bdaa1a5516d0481e6c7fafa (diff)
parentf24814e0e9806db8d01c16b8d8592d6e9b9ee481 (diff)
downloademacs-ced7ed5611e2a6e60a5ac7a97e165545843d0fa9.tar.gz
emacs-ced7ed5611e2a6e60a5ac7a97e165545843d0fa9.zip
Merged in changes from CVS trunk.
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-230 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-231 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-232 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-233 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-234 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-235 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-236 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-237 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-238 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-239 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-240 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-152
-rw-r--r--etc/ChangeLog4
-rw-r--r--etc/NEWS41
-rw-r--r--etc/TODO175
-rw-r--r--leim/ChangeLog24
-rw-r--r--leim/makefile.w32-in2
-rw-r--r--lib-src/ChangeLog4
-rw-r--r--lib-src/makefile.w32-in2
-rw-r--r--lisp/ChangeLog314
-rw-r--r--lisp/ChangeLog.1016
-rw-r--r--lisp/Makefile.in2
-rw-r--r--lisp/add-log.el2
-rw-r--r--lisp/autoinsert.el2
-rw-r--r--lisp/calendar/time-date.el2
-rw-r--r--lisp/cvs-status.el42
-rw-r--r--lisp/dabbrev.el29
-rw-r--r--lisp/descr-text.el17
-rw-r--r--lisp/desktop.el240
-rw-r--r--lisp/diff-mode.el13
-rw-r--r--lisp/dired.el44
-rw-r--r--lisp/emacs-lisp/byte-run.el5
-rw-r--r--lisp/emacs-lisp/bytecomp.el6
-rw-r--r--lisp/emacs-lisp/checkdoc.el49
-rw-r--r--lisp/emacs-lisp/disass.el4
-rw-r--r--lisp/emacs-lisp/easymenu.el4
-rw-r--r--lisp/font-lock.el17
-rw-r--r--lisp/frame.el9
-rw-r--r--lisp/gnus/mailcap.el1
-rw-r--r--lisp/help-fns.el22
-rw-r--r--lisp/help-mode.el11
-rw-r--r--lisp/image.el44
-rw-r--r--lisp/info.el61
-rw-r--r--lisp/international/mule-cmds.el10
-rw-r--r--lisp/international/mule-util.el22
-rw-r--r--lisp/international/mule.el4
-rw-r--r--lisp/international/quail.el32
-rw-r--r--lisp/iswitchb.el8
-rw-r--r--lisp/mail/rmail.el17
-rw-r--r--lisp/makefile.w32-in7
-rw-r--r--lisp/menu-bar.el3
-rw-r--r--lisp/mh-e/mh-e.el11
-rw-r--r--lisp/net/telnet.el20
-rw-r--r--lisp/progmodes/cc-cmds.el2
-rw-r--r--lisp/progmodes/compile.el302
-rw-r--r--lisp/progmodes/cperl-mode.el9
-rw-r--r--lisp/progmodes/gdb-ui.el48
-rw-r--r--lisp/progmodes/python.el2
-rw-r--r--lisp/recentf.el17
-rw-r--r--lisp/replace.el20
-rw-r--r--lisp/simple.el137
-rw-r--r--lisp/subr.el17
-rw-r--r--lisp/textmodes/fill.el10
-rw-r--r--lisp/textmodes/paragraphs.el62
-rw-r--r--lisp/vc-svn.el15
-rw-r--r--lisp/view.el1
-rw-r--r--lisp/window.el5
-rw-r--r--lisp/x-dnd.el18
-rw-r--r--lispintro/ChangeLog4
-rw-r--r--lispintro/makefile.w32-in2
-rw-r--r--lispref/ChangeLog4
-rw-r--r--lispref/makefile.w32-in2
-rw-r--r--man/ChangeLog4
-rw-r--r--man/makefile.w32-in2
-rw-r--r--man/widget.texi47
-rw-r--r--nt/ChangeLog8
-rw-r--r--nt/gmake.defs3
-rw-r--r--nt/makefile.def3
-rw-r--r--nt/makefile.nt3
-rw-r--r--nt/makefile.w32-in2
-rw-r--r--nt/nmake.defs3
-rw-r--r--src/ChangeLog121
-rw-r--r--src/dispextern.h54
-rw-r--r--src/dispnew.c24
-rw-r--r--src/fns.c15
-rw-r--r--src/fontset.c59
-rw-r--r--src/image.c12
-rw-r--r--src/keyboard.c57
-rw-r--r--src/keymap.c6
-rw-r--r--src/lisp.h7
-rw-r--r--src/macterm.c174
-rw-r--r--src/makefile.w32-in2
-rw-r--r--src/w32term.c153
-rw-r--r--src/w32term.h1
-rw-r--r--src/window.c95
-rw-r--r--src/window.h6
-rw-r--r--src/xdisp.c202
-rw-r--r--src/xterm.c154
-rw-r--r--src/xterm.h1
87 files changed, 2168 insertions, 1069 deletions
diff --git a/etc/ChangeLog b/etc/ChangeLog
index dd992a3194d..40e1c1a8932 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,7 @@
12004-04-22 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * TODO: Use outline mode. Remove compile.el entry (done).
4
12004-04-18 Juri Linkov <juri@jurta.org> 52004-04-18 Juri Linkov <juri@jurta.org>
2 6
3 * TUTORIAL.fr, TUTORIAL.pl, TUTORIAL.ru, TUTORIAL.sl, TUTORIAL.sv 7 * TUTORIAL.fr, TUTORIAL.pl, TUTORIAL.ru, TUTORIAL.sl, TUTORIAL.sv
diff --git a/etc/NEWS b/etc/NEWS
index 1659cccf12b..9320ae29174 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -88,6 +88,11 @@ types any more. Add -DUSE_LISP_UNION_TYPE if you want union types.
88 88
89* Changes in Emacs 21.4 89* Changes in Emacs 21.4
90 90
91** You can now use next-error (C-x `) and previous-error to advance to
92the next/previous matching line found by M-x occur.
93
94** Telnet will now prompt you for a port number with C-u M-x telnet.
95
91+++ 96+++
92** New command line option -Q. 97** New command line option -Q.
93 98
@@ -374,6 +379,11 @@ If you prefer the old behavior, you can set the new user option
374Info files on your system for a string, and builds a menu of the 379Info files on your system for a string, and builds a menu of the
375possible matches. 380possible matches.
376 381
382*** Images in Info pages are supported.
383Info pages show embedded images, in Emacs frames with image support.
384Info documentation that includes images, processed with makeinfo
385version 4.7 or newer, compiles to Info pages with embedded images.
386
377+++ 387+++
378*** The default value for `Info-scroll-prefer-subnodes' is now nil. 388*** The default value for `Info-scroll-prefer-subnodes' is now nil.
379 389
@@ -1950,9 +1960,34 @@ configuration files.
1950 1960
1951* Lisp Changes in Emacs 21.4 1961* Lisp Changes in Emacs 21.4
1952 1962
1963** New functions posn-at-point and posn-at-x-y returns
1964click-event-style position information for a given visible buffer
1965position or for a given window pixel coordinate.
1966
1967** Function pos-visible-in-window-p now returns the pixel coordinates
1968and partial visiblity state of the corresponding row, if the PARTIALLY
1969arg is non-nil.
1970
1971** The function `eql' is now available without requiring the CL package.
1972
1953** The display space :width and :align-to text properties are now 1973** The display space :width and :align-to text properties are now
1954supported on text terminals. 1974supported on text terminals.
1955 1975
1976** Support for displaying image slices
1977
1978*** New display property (slice X Y WIDTH HEIGHT) may be used with
1979an image property to display only a specific slice of the image.
1980
1981*** Function insert-image has new optional fourth arg to
1982specify image slice (X Y WIDTH HEIGHT).
1983
1984*** New function insert-sliced-image inserts a given image as a
1985specified number of evenly sized slices (rows x columns).
1986
1987*** Trailing newlines no longer contribute to the height of a display
1988row; instead the height of the newline glyph is reduced. This allows
1989sliced images to use a height less than the default line height.
1990
1956** Enhancements to stretch display properties 1991** Enhancements to stretch display properties
1957 1992
1958The display property stretch specification form `(space PROPS)', where 1993The display property stretch specification form `(space PROPS)', where
@@ -2071,6 +2106,12 @@ number of corresponding line in current buffer.
2071variable `sentence-end-without-space' which contains such characters 2106variable `sentence-end-without-space' which contains such characters
2072that end a sentence without following spaces. 2107that end a sentence without following spaces.
2073 2108
2109** The function `sentence-end' should be used to obtain the value of
2110the variable `sentence-end'. If the variable `sentence-end' is nil,
2111then this function returns the regexp constructed from the variables
2112`sentence-end-without-period', `sentence-end-double-space' and
2113`sentence-end-without-space'.
2114
2074+++ 2115+++
2075** The flags, width, and precision options for %-specifications in function 2116** The flags, width, and precision options for %-specifications in function
2076`format' are now documented. Some flags that were accepted but not 2117`format' are now documented. Some flags that were accepted but not
diff --git a/etc/TODO b/etc/TODO
index 1249e57ac98..ca8835645d8 100644
--- a/etc/TODO
+++ b/etc/TODO
@@ -1,4 +1,4 @@
1 -*-text-*- 1 -*-outline-*-
2 2
3If you are ready to start working on any of these TODO items, we 3If you are ready to start working on any of these TODO items, we
4appreciate your help; please write to emacs-devel@gnu.org so we can be 4appreciate your help; please write to emacs-devel@gnu.org so we can be
@@ -7,51 +7,48 @@ it best. Since Emacs is an FSF-copyrighted package, please be
7prepared to sign legal papers to transfer the copyright on your work 7prepared to sign legal papers to transfer the copyright on your work
8to the FSF. 8to the FSF.
9 9
10Small but important fixes needed in existing features: 10* Small but important fixes needed in existing features:
11 11
12* Make compile.el record the markers that point to error loci 12** Fix the kill/yank treatment of invisible text. At the moment,
13 on text properties in the error message lines.
14
15* Fix the kill/yank treatment of invisible text. At the moment,
16 invisible text is placed in the kill-ring, so that the contents of 13 invisible text is placed in the kill-ring, so that the contents of
17 the ring may not correspond to the text as displayed to the user. It 14 the ring may not correspond to the text as displayed to the user. It
18 ought to be possible to omit text which is invisible (due to a 15 ought to be possible to omit text which is invisible (due to a
19 text-property, overlay, or selective display) from the kill-ring. 16 text-property, overlay, or selective display) from the kill-ring.
20 17
21Important features: 18* Important features:
22 19
23* Provide user-friendly ways to list all available font families, 20** Provide user-friendly ways to list all available font families,
24 display a font as a sample, etc. [fx is looking at multilingual 21 display a font as a sample, etc. [fx is looking at multilingual
25 font selection for Emacs 22.] 22 font selection for Emacs 22.]
26 23
27* Program Enriched mode to read and save in RTF. [Is there actually a 24** Program Enriched mode to read and save in RTF. [Is there actually a
28 decent single definition of RTF? Maybe see info at 25 decent single definition of RTF? Maybe see info at
29 http://latex2rtf.sourceforge.net/.] 26 http://latex2rtf.sourceforge.net/.]
30 27
31* Implement something better than the current Refill mode. This 28** Implement something better than the current Refill mode. This
32 probably needs some primitive support. 29 probably needs some primitive support.
33 30
34* Implement primitive and higher-level functions to allow filling 31** Implement primitive and higher-level functions to allow filling
35 properly with variable-pitch faces. 32 properly with variable-pitch faces.
36 33
37* Implement a smoother vertical scroll facility, one that allows 34** Implement a smoother vertical scroll facility, one that allows
38 C-v to scroll through a tall image. 35 C-v to scroll through a tall image.
39 36
40* Implement other text formatting properties. 37** Implement other text formatting properties.
41** Footnotes that can appear either in place or at the end of the page. 38*** Footnotes that can appear either in place or at the end of the page.
42** text property that says "don't break line in middle of this". 39*** text property that says "don't break line in middle of this".
43 Don't break the line between two characters that have the 40 Don't break the line between two characters that have the
44 same value of this property. 41 same value of this property.
45** Discretionary hyphens that are not visible when they are at end of line. 42*** Discretionary hyphens that are not visible when they are at end of line.
46 43
47* Make movemail work with IMAP. 44** Make movemail work with IMAP.
48 45
49* Internationalize Emacs's messages. [Note that this is of limited 46** Internationalize Emacs's messages. [Note that this is of limited
50 use until the menus can display multilingual text. It also doesn't 47 use until the menus can display multilingual text. It also doesn't
51 address important issues like using the names of symbols essentially 48 address important issues like using the names of symbols essentially
52 as documentation, e.g. in command names and Custom. -- fx] 49 as documentation, e.g. in command names and Custom. -- fx]
53 50
54* Make the Lucid menu widget display multilingual text. [This 51** Make the Lucid menu widget display multilingual text. [This
55 probably needs to be done from actual Emacs buffers, either directly 52 probably needs to be done from actual Emacs buffers, either directly
56 in the menu or by rendering in an unmapped window and copying the 53 in the menu or by rendering in an unmapped window and copying the
57 pixels. Note that the relevant Xlib functions assume a specific 54 pixels. Note that the relevant Xlib functions assume a specific
@@ -60,48 +57,63 @@ Important features:
60 port now displays multilingual text in menus, but only insofar as 57 port now displays multilingual text in menus, but only insofar as
61 Emacs can encode it as utf-8 and gtk can display the result.] 58 Emacs can encode it as utf-8 and gtk can display the result.]
62 59
63* Remove the limitation that window and frame widths and heights can 60** Remove the limitation that window and frame widths and heights can
64 be only full columns/lines. 61 be only full columns/lines.
65 62
66Other features we would like: 63* Other features we would like:
64
65** Ability to map a key, including all modified-combinations.
66 E.g map mouse-4 to wheel-up as well as M-mouse-4 -> M-wheel-up
67 M-C-mouse-4 -> M-C-wheel-up, H-S-C-M-s-double-mouse-4 ->
68 H-S-C-M-s-double-wheel-up, ...
67 69
68* Have a command suggestion help system that recognizes patterns 70** Beefed-up syntax-tables.
71*** recognize multi-character syntactic entities like `begin' and `end'.
72*** nested string-delimiters (for Postscript's (foo(bar)baz) strings).
73*** support for infix operators (with precedence).
74*** support for the $ (paired delimiter) in parse-partial-sexp.
75*** support for hook-chars whose effect on the parsing-state is specified
76 by elisp code. Thus a char could both close a string and open a comment
77 at the same time and do it in a context-sensitive way.
78*** ability to add mode-specific data to the partial-parse-state.
79
80** Have a command suggestion help system that recognizes patterns
69 of commands which could be replaced with a simpler common command. 81 of commands which could be replaced with a simpler common command.
70 It should not make more than one suggestion per 10 minutes. 82 It should not make more than one suggestion per 10 minutes.
71 83
72* Add a way to define input methods by computing them (when first used) 84** Add a way to define input methods by computing them (when first used)
73 from other input methods. Then redefine C-x 8 to use a 85 from other input methods. Then redefine C-x 8 to use a
74 user-selected input method, with the default being the union of 86 user-selected input method, with the default being the union of
75 latin-1-prefix and latin-1-postfix. 87 latin-1-prefix and latin-1-postfix.
76 88
77* Implement a clean way to use different major modes for 89** Implement a clean way to use different major modes for
78 different parts of a buffer. 90 different parts of a buffer.
79 91
80* Give start-process the ability to direct standard-error 92** Give start-process the ability to direct standard-error
81 output to a different filter. 93 output to a different filter.
82 94
83* Make desktop.el save the "frame configuration" of Emacs (in some 95** Make desktop.el save the "frame configuration" of Emacs (in some
84 useful sense). 96 useful sense).
85 97
86* Give desktop.el a feature to switch between different named 98** Give desktop.el a feature to switch between different named
87 desktops. 99 desktops.
88 100
89* Replace finder.el with something that generates an Info file 101** Replace finder.el with something that generates an Info file
90 which gives the same information through a menu structure. [Dave 102 which gives the same information through a menu structure. [Dave
91 Love started on this.] 103 Love started on this.]
92 104
93* Implement a variant of uncompress.el or jka-compr.el that works with 105** Implement a variant of uncompress.el or jka-compr.el that works with
94 GNU Privacy Guard for encryption. [Code exists but isn't assigned. 106 GNU Privacy Guard for encryption. [Code exists but isn't assigned.
95 See the Gnus development sources for assigned code concerning GPG 107 See the Gnus development sources for assigned code concerning GPG
96 use with mail, which is probably a good start.] 108 use with mail, which is probably a good start.]
97 109
98* Save undo information in files, and reload it when needed 110** Save undo information in files, and reload it when needed
99 for undoing. 111 for undoing.
100 112
101* Merge the Emacs regex.c with the Glibc regex.c. 113** Merge the Emacs regex.c with the Glibc regex.c.
102 They split off a few years ago through negligence. 114 They split off a few years ago through negligence.
103 115
104* Change the Windows NT menu code 116** Change the Windows NT menu code
105 so that it handles the deep_p argument and avoids 117 so that it handles the deep_p argument and avoids
106 regenerating the whole menu bar menu tree except 118 regenerating the whole menu bar menu tree except
107 when the user tries to use the menubar. 119 when the user tries to use the menubar.
@@ -111,87 +123,87 @@ Other features we would like:
111 thread has processed the MENU_BAR_ACTIVATE_EVENT and regenerated 123 thread has processed the MENU_BAR_ACTIVATE_EVENT and regenerated
112 the whole menu bar. In the mean time, it should process other messages. 124 the whole menu bar. In the mean time, it should process other messages.
113 125
114* Get some major packages installed: W3/url (development version needs 126** Get some major packages installed: W3/url (development version needs
115 significant work), PSGML. Check the assignments file for other 127 significant work), PSGML. Check the assignments file for other
116 packages which might go in and have been missed. 128 packages which might go in and have been missed.
117 129
118* Make keymaps a first-class Lisp object (this means a rewrite of 130** Make keymaps a first-class Lisp object (this means a rewrite of
119 keymap.c). What should it do apart from being opaque ? 131 keymap.c). What should it do apart from being opaque ?
120 multiple inheritance ? faster where-is ? no more fix_submap_inheritance ? 132 multiple inheritance ? faster where-is ? no more fix_submap_inheritance ?
121 what else ? 133 what else ?
122 134
123* Provide real menus on ttys. The MS-DOS implementation can serve as 135** Provide real menus on ttys. The MS-DOS implementation can serve as
124 an example how to do part of this. 136 an example how to do part of this.
125 137
126* Implement popular parts of the rest of the CL functions as compiler 138** Implement popular parts of the rest of the CL functions as compiler
127 macros in cl-macs. 139 macros in cl-macs.
128 140
129* Highlight rectangles (`mouse-track-rectangle-p' in XEmacs). Already in CUA, 141** Highlight rectangles (`mouse-track-rectangle-p' in XEmacs). Already in CUA,
130 but it's a valuable feature worth making more general. 142 but it's a valuable feature worth making more general.
131 143
132* Support simultaneous tty and X frames. [For a partial 144** Support simultaneous tty and X frames. [For a partial
133 implementation, see tla branch 145 implementation, see tla branch
134 lorentey@elte.hu--2004/emacs--multi-tty--0 at 146 lorentey@elte.hu--2004/emacs--multi-tty--0 at
135 http://lorentey.web.elte.hu/arch/2004] 147 http://lorentey.web.elte.hu/arch/2004]
136 148
137* Provide MIME support for Rmail using the Gnus MIME library. [Maybe 149** Provide MIME support for Rmail using the Gnus MIME library. [Maybe
138 not now feasible, given Gnus maintenance decisions. fx looked at 150 not now feasible, given Gnus maintenance decisions. fx looked at
139 this and can say where some of the problems are.] 151 this and can say where some of the problems are.]
140 152
141* Eliminate the storm of warnings concerning char/unsigned char 153** Eliminate the storm of warnings concerning char/unsigned char
142 mismatches that we get with proprietary compilers on various systems. 154 mismatches that we get with proprietary compilers on various systems.
143 They make it difficult to spot the important warnings. 155 They make it difficult to spot the important warnings.
144 156
145* Fix anything necessary to use `long long' EMACS_INTs with GCC. 157** Fix anything necessary to use `long long' EMACS_INTs with GCC.
146 158
147* Split out parts of lisp.h and generate Makefile dependencies 159** Split out parts of lisp.h and generate Makefile dependencies
148 automatically. 160 automatically.
149 161
150* Update the FAQ. 162** Update the FAQ.
151 163
152* Allow auto-compression-mode to use zlib calls if zlib is available. 164** Allow auto-compression-mode to use zlib calls if zlib is available.
153 [It's required for PNG, so may be linked anyhow.] 165 [It's required for PNG, so may be linked anyhow.]
154 166
155* Add a --pristine startup flag which does -q --no-site-file plus 167** Add a --pristine startup flag which does -q --no-site-file plus
156 ignoring X resources (Doze equivalents?) and most of the 168 ignoring X resources (Doze equivalents?) and most of the
157 environment. What should not be ignored needs consideration. 169 environment. What should not be ignored needs consideration.
158 170
159* Investigate using the language environment (or locale?) to set up 171** Investigate using the language environment (or locale?) to set up
160 more things, such as the default Ispell dictionary, calendar 172 more things, such as the default Ispell dictionary, calendar
161 holidays, quoting characters?,... 173 holidays, quoting characters?,...
162 174
163* Improve the GC (generational, incremental). (We may be able to use 175** Improve the GC (generational, incremental). (We may be able to use
164 the Boehm collector.) [See the Boehm-GC branch in CVS for work on 176 the Boehm collector.) [See the Boehm-GC branch in CVS for work on
165 this.] 177 this.]
166 178
167* Check what hooks would help Emacspeak -- see the defadvising in W3. 179** Check what hooks would help Emacspeak -- see the defadvising in W3.
168 180
169* Add horizontal scroll bars. 181** Add horizontal scroll bars.
170 182
171* Provide an optional feature which computes a scroll bar slider's 183** Provide an optional feature which computes a scroll bar slider's
172 size and its position from lines instead of characters. 184 size and its position from lines instead of characters.
173 185
174* Make the Custom themes support do useful things. 186** Make the Custom themes support do useful things.
175 187
176* Investigate using GNU Lightning or similar system for incremental 188** Investigate using GNU Lightning or similar system for incremental
177 compilation of selected bytecode functions to subrs. Converting CCL 189 compilation of selected bytecode functions to subrs. Converting CCL
178 programs to native code is probably the first thing to try, though. 190 programs to native code is probably the first thing to try, though.
179 191
180* Add support for SVG (Scalable Vector Graphics) rendering to 192** Add support for SVG (Scalable Vector Graphics) rendering to
181 Emacs. 193 Emacs.
182 194
183* Allow unknown image types to be rendered via an external program 195** Allow unknown image types to be rendered via an external program
184 converting them to, say, PBM (in the same way as PostScript?). 196 converting them to, say, PBM (in the same way as PostScript?).
185 197
186* Allow displaying an X window from an external program in a buffer, 198** Allow displaying an X window from an external program in a buffer,
187 e.g. to render graphics from Java applets. [gerd and/or wmperry 199 e.g. to render graphics from Java applets. [gerd and/or wmperry
188 thought this was feasible.] 200 thought this was feasible.]
189 201
190* Allow images (not just text) in the margin to be mouse-sensitive. 202** Allow images (not just text) in the margin to be mouse-sensitive.
191 (Requires recursing through display properties). Provide some way 203 (Requires recursing through display properties). Provide some way
192 to simulate mouse-clicks on marginal text without a mouse. 204 to simulate mouse-clicks on marginal text without a mouse.
193 205
194* Implement Lisp functions to determine properly whether a character 206** Implement Lisp functions to determine properly whether a character
195 is displayable (particularly needed in XFree 4, sigh). Use it to 207 is displayable (particularly needed in XFree 4, sigh). Use it to
196 define useful glyphs that may be displayed as images or unicodes 208 define useful glyphs that may be displayed as images or unicodes
197 (with ASCIIfied fallback via latin1-disp). Examples include 209 (with ASCIIfied fallback via latin1-disp). Examples include
@@ -199,40 +211,33 @@ Other features we would like:
199 tree displays generally, mode-line mail indicator. [See work done 211 tree displays generally, mode-line mail indicator. [See work done
200 already for Emacs 22 and consult fx.] 212 already for Emacs 22 and consult fx.]
201 213
202* Do something to make rms happy with fx's dynamic loading, and use it 214** Do something to make rms happy with fx's dynamic loading, and use it
203 to implement things like auto-loaded buffer parsers and database 215 to implement things like auto-loaded buffer parsers and database
204 access in cases which need more than Lisp. 216 access in cases which need more than Lisp.
205 217
206* Extend ps-print to deal with multiple font sizes, images, and extra 218** Extend ps-print to deal with multiple font sizes, images, and extra
207 encodings. 219 encodings.
208 220
209* Provide portable undumping using mmap (per gerd design). 221** Provide portable undumping using mmap (per gerd design).
210
211* Replace gmalloc.c with the modified Doug Lea code from the current
212 GNU libc so that the special mmapping of buffers can be removed --
213 that apparently loses under Solaris, at least. [fx has mostly done
214 this.]
215 222
216* Use the XIE X extension, if available, for image display. 223** Use the XIE X extension, if available, for image display.
217 224
218* Make monochrome images display using the foreground and background 225** Make monochrome images display using the foreground and background
219 colors of the applicable faces. 226 colors of the applicable faces.
220 227
221* Add support for rendering antialiased text, probably using 228** Add support for rendering antialiased text, probably using
222 XRender/Freetype. 229 XRender/Freetype.
223 230
224* Rewrite make-docfile to be clean and maintainable. 231** Port the conservative stack marking code of Emacs' garbage collector
225
226* Port the conservative stack marking code of Emacs' garbage collector
227 to more systems, so that we can completely get rid of GCPROs. 232 to more systems, so that we can completely get rid of GCPROs.
228 233
229* Reorder defcustom's in each package so that the more important 234** Reorder defcustom's in each package so that the more important
230 options come first in the Customize buffers. This could be done by 235 options come first in the Customize buffers. This could be done by
231 either rearranging the file (since options are shown in the order 236 either rearranging the file (since options are shown in the order
232 they appear in the *.el files), or by adding a few :set-after 237 they appear in the *.el files), or by adding a few :set-after
233 attributes. 238 attributes.
234 239
235* Maybe document the features of libraries missing from the manual (or 240** Maybe document the features of libraries missing from the manual (or
236 ancillary manuals, including the Lisp manual in some cases). 241 ancillary manuals, including the Lisp manual in some cases).
237 This is not worth doing for all of these packages and we need not 242 This is not worth doing for all of these packages and we need not
238 aim for completeness, but some may be worth documenting. 243 aim for completeness, but some may be worth documenting.
@@ -253,21 +258,21 @@ Other features we would like:
253 cvs-status (should be described in PCL-CVS manual); other progmodes, 258 cvs-status (should be described in PCL-CVS manual); other progmodes,
254 probably in separate manual. 259 probably in separate manual.
255 260
256* Convert the XPM bitmaps to PPM, replace the PBMs with them and scrap 261** Convert the XPM bitmaps to PPM, replace the PBMs with them and scrap
257 the XPMs so that the colour versions work generally. (Requires care 262 the XPMs so that the colour versions work generally. (Requires care
258 with the colour used for the transparent regions.) 263 with the colour used for the transparent regions.)
259 264
260* Convenient access to the `values' variable. It would be nice to have an 265** Convenient access to the `values' variable. It would be nice to have an
261 interface that would show you the printed reps of the elements of the 266 interface that would show you the printed reps of the elements of the
262 list in a menu, let you select one of the values, and put it into some 267 list in a menu, let you select one of the values, and put it into some
263 other variable, without changing the value of `values'. 268 other variable, without changing the value of `values'.
264 269
265* Fix skip-chars-{for,back}ward to allow character classes. 270** Fix skip-chars-{for,back}ward to allow character classes.
266 271
267* (Controlled by a flag) make open and close syntax match exactly, 272** (Controlled by a flag) make open and close syntax match exactly,
268 i.e. `(' doesn't match `]'. 273 i.e. `(' doesn't match `]'.
269 274
270* Specify parameter ID-FORMAT in all calls to `file-attributes' and 275** Specify parameter ID-FORMAT in all calls to `file-attributes' and
271 `directory-files-and-attributes' where attributes UID or GID are used. 276 `directory-files-and-attributes' where attributes UID or GID are used.
272 Whenever possible, use value 'string. 277 Whenever possible, use value 'string.
273 When done, change meaning of default value from 'integer to 'string. 278 When done, change meaning of default value from 'integer to 'string.
@@ -275,4 +280,18 @@ Other features we would like:
275 the definition of `file-attributes' and `directory-files-and-attributes' 280 the definition of `file-attributes' and `directory-files-and-attributes'
276 and from the calls. 281 and from the calls.
277 282
283* Internal changes
284
285** Replace gmalloc.c with the modified Doug Lea code from the current
286 GNU libc so that the special mmapping of buffers can be removed --
287 that apparently loses under Solaris, at least. [fx has mostly done
288 this.]
289
290** Rewrite make-docfile to be clean and maintainable.
291
292** Add an inferior-comint-minor-mode to capture the common set of operations
293 offered by major modes that offer an associated inferior
294 comint-derived mode. I.e. basically make cmuscheme.el generic.
295 For use by sml-mode, python-mode, tex-mode, scheme-mode, ...
296
278;;; arch-tag: b0a3e40b-726a-457d-9999-ba848321b036 297;;; arch-tag: b0a3e40b-726a-457d-9999-ba848321b036
diff --git a/leim/ChangeLog b/leim/ChangeLog
index 5ef6b3d4467..0a9705c1b5d 100644
--- a/leim/ChangeLog
+++ b/leim/ChangeLog
@@ -1,3 +1,7 @@
12004-04-23 Juanma Barranquero <lektu@terra.es>
2
3 * makefile.w32-in: Add "-*- makefile -*-" mode tag.
4
12004-04-09 Andrew Innes <andrewi@gnu.org> 52004-04-09 Andrew Innes <andrewi@gnu.org>
2 6
3 * makefile.w32-in (distclean clean): Remove nmake specific 7 * makefile.w32-in (distclean clean): Remove nmake specific
@@ -31,7 +35,7 @@
312004-01-22 Ognyan Kulev <ogi@fmi.uni-sofia.bg> (tiny change) 352004-01-22 Ognyan Kulev <ogi@fmi.uni-sofia.bg> (tiny change)
32 36
33 * quail/cyrillic.el ("bulgarian-phonetic"): Docstring fixed. 37 * quail/cyrillic.el ("bulgarian-phonetic"): Docstring fixed.
34 Duplicated entry removed. 38 Duplicate entry removed.
35 ("bulgarian-bds"): Docstring fixed. 39 ("bulgarian-bds"): Docstring fixed.
36 40
372003-10-06 Dave Love <fx@gnu.org> 412003-10-06 Dave Love <fx@gnu.org>
@@ -52,7 +56,7 @@
52 56
532003-07-21 KAWABATA, Taichi <kawabata@m17n.org> 572003-07-21 KAWABATA, Taichi <kawabata@m17n.org>
54 58
55 * quail/indian.el (quail-indian-update-translation): Adjusted the 59 * quail/indian.el (quail-indian-update-translation): Adjust the
56 behaviour according to the change of quail-translate-key. 60 behaviour according to the change of quail-translate-key.
57 61
582003-05-22 Kenichi Handa <handa@m17n.org> 622003-05-22 Kenichi Handa <handa@m17n.org>
@@ -71,11 +75,11 @@
71 75
722003-02-27 David Kastrup <dak@gnu.org> 762003-02-27 David Kastrup <dak@gnu.org>
73 77
74 * quail/greek.el (greek-babel): add koronis transliteration. 78 * quail/greek.el (greek-babel): Add koronis transliteration.
75 79
762003-02-23 David Kastrup <dak@gnu.org> 802003-02-23 David Kastrup <dak@gnu.org>
77 81
78 * quail/greek.el (greek-babel): fix <' accent. 82 * quail/greek.el (greek-babel): Fix <' accent.
79 83
802003-02-17 Dave Love <fx@gnu.org> 842003-02-17 Dave Love <fx@gnu.org>
81 85
@@ -89,7 +93,7 @@
892003-02-11 KAWABATA, Taichi <kawabata@m17n.org> 932003-02-11 KAWABATA, Taichi <kawabata@m17n.org>
90 94
91 * quail/indian.el (punjabi-itrans, gujarati-itrans, oriya-itrans) 95 * quail/indian.el (punjabi-itrans, gujarati-itrans, oriya-itrans)
92 (bengali-itrans, assamese-itrans, telugu-itrans kannada-itrans) 96 (bengali-itrans, assamese-itrans, telugu-itrans, kannada-itrans)
93 (malayalam-itrans, tamil-itrans): New ITRANS based input methods. 97 (malayalam-itrans, tamil-itrans): New ITRANS based input methods.
94 (punjabi-inscript, gujarati-inscript, oriya-inscript) 98 (punjabi-inscript, gujarati-inscript, oriya-inscript)
95 (bengali-inscript, assamese-inscript, telugu-inscript) 99 (bengali-inscript, assamese-inscript, telugu-inscript)
@@ -104,7 +108,7 @@
104 108
1052003-02-05 David Kastrup <dak@gnu.org> 1092003-02-05 David Kastrup <dak@gnu.org>
106 110
107 * quail/greek.el: fix iota accent typos in greek-babel 111 * quail/greek.el: Fix iota accent typos in greek-babel
108 encoding. 112 encoding.
109 113
1102003-01-05 Dave Love <fx@gnu.org> 1142003-01-05 Dave Love <fx@gnu.org>
@@ -234,8 +238,8 @@
234 238
2352002-01-07 Jaeyoun Chung <jay@kldp.org> 2392002-01-07 Jaeyoun Chung <jay@kldp.org>
236 240
237 * quail/hangul.el: removed key sequence mapping for O[rsfaqtTd]. 241 * quail/hangul.el: Remove key sequence mapping for O[rsfaqtTd].
238 Not used for Korean Hangul Type 2. (request from emacs-kr mailing 242 Not used for Korean Hangul Type 2 (request from emacs-kr mailing
239 list). 243 list).
240 244
2412002-01-03 Eli Zaretskii <eliz@is.elta.co.il> 2452002-01-03 Eli Zaretskii <eliz@is.elta.co.il>
@@ -282,7 +286,7 @@
282 286
2832001-12-03 Jaeyoun Chung <jay@kldp.org> 2872001-12-03 Jaeyoun Chung <jay@kldp.org>
284 288
285 * quail/hangul3.el: Added a few convenient composing sequences for 289 * quail/hangul3.el: Add a few convenient composing sequences for
286 Korean keyboard type 3 users. 290 Korean keyboard type 3 users.
287 291
2882001-11-29 Dave Love <fx@gnu.org> 2922001-11-29 Dave Love <fx@gnu.org>
@@ -293,7 +297,7 @@
293 297
2942001-11-28 Juanma Barranquero <lektu@terra.es> 2982001-11-28 Juanma Barranquero <lektu@terra.es>
295 299
296 * makefile.w32-in (INDIAN): Adjusted for the file name change; 300 * makefile.w32-in (INDIAN): Adjust for the file name change;
297 quail/devanagari.elc -> quail/indian.elc. 301 quail/devanagari.elc -> quail/indian.elc.
298 302
299 * makefile.nt (INDIAN): Likewise. 303 * makefile.nt (INDIAN): Likewise.
diff --git a/leim/makefile.w32-in b/leim/makefile.w32-in
index bb4461c810c..7eea0b41b26 100644
--- a/leim/makefile.w32-in
+++ b/leim/makefile.w32-in
@@ -1,4 +1,4 @@
1# Makefile for leim subdirectory in GNU Emacs on the Microsoft W32 API. 1# -*- Makefile -*- for leim subdirectory in GNU Emacs on the Microsoft W32 API.
2# Copyright (C) 1997 Electrotechnical Laboratory, JAPAN. 2# Copyright (C) 1997 Electrotechnical Laboratory, JAPAN.
3# Licensed to the Free Software Foundation. 3# Licensed to the Free Software Foundation.
4 4
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 7355a29348a..eaf07239901 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,7 @@
12004-04-23 Juanma Barranquero <lektu@terra.es>
2
3 * makefile.w32-in: Add "-*- makefile -*-" mode tag.
4
12004-04-17 Paul Eggert <eggert@gnu.org> 52004-04-17 Paul Eggert <eggert@gnu.org>
2 6
3 * rcs2log (Help): Clarify wording of the usage message. 7 * rcs2log (Help): Clarify wording of the usage message.
diff --git a/lib-src/makefile.w32-in b/lib-src/makefile.w32-in
index 20cf4727362..c4c2604d113 100644
--- a/lib-src/makefile.w32-in
+++ b/lib-src/makefile.w32-in
@@ -1,4 +1,4 @@
1# Makefile for GNU Emacs on the Microsoft W32 API. 1# -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.
2# Copyright (c) 2000-2001 Free Software Foundation, Inc. 2# Copyright (c) 2000-2001 Free Software Foundation, Inc.
3# 3#
4# This file is part of GNU Emacs. 4# This file is part of GNU Emacs.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 513c24e28d9..9d0215df2e4 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,252 @@
12004-04-23 Kenichi Handa <handa@m17n.org>
2
3 * international/mule-util.el (char-displayable-p): Simplified by
4 using internal-char-font.
5
62004-04-23 Juanma Barranquero <lektu@terra.es>
7
8 * makefile.w32-in: Add "-*- makefile -*-" mode tag.
9
102004-04-22 Stefan Monnier <monnier@iro.umontreal.ca>
11
12 * diff-mode.el (diff-next-error): New fun.
13 (diff-mode): Use it.
14
15 * simple.el (next-error): Change arg name.
16 Add support for the documented C-u C-x ` usage.
17
18 * frame.el (special-display-popup-frame, next-multiframe-window)
19 (previous-multiframe-window): Only consider frames on same display.
20
212004-04-22 Lars Hansen <larsh@math.ku.dk>
22
23 * info.el (Info-restore-desktop-buffer): Delete with-no-warnings.
24 * mh-e/mh-e.el (mh-restore-desktop-buffer): Delete with-no-warnings.
25
262004-04-22 Kim F. Storm <storm@cua.dk>
27
28 * net/telnet.el (telnet): Add optional port arg.
29
302004-04-21 Stefan Monnier <monnier@iro.umontreal.ca>
31
32 * progmodes/compile.el (compilation-mode-font-lock-keywords):
33 Minor sanity check on the `hyperlink' slot.
34
35 * Makefile.in (recompile): Compile new files.
36
37 * emacs-lisp/bytecomp.el (batch-byte-recompile-directory):
38 Add byte-recompile-directory's optional `arg'.
39
40 * cvs-status.el (cvs-tree-use-charset): New var.
41 (cvs-tree-char-space, cvs-tree-char-hbar, cvs-tree-char-vbar)
42 (cvs-tree-char-branch, cvs-tree-char-eob, cvs-tree-char-bob)
43 (cvs-status-cvstrees): Use it.
44
45 * emacs-lisp/checkdoc.el (checkdoc-output-mode):
46 Make it a normal major mode.
47 (checkdoc-buffer-label): Make sure the file name is meaningful.
48 (checkdoc-output-to-error-buffer): Remove.
49 (checkdoc-error, checkdoc-start-section): Rewrite.
50
51 * info.el (info-node, info-menu-5, info-xref, info-header-node)
52 (Info-title-1-face, Info-title-2-face, Info-title-3-face)
53 (Info-title-4-face): Use new syntax.
54 (info-xref-visited): Inherit from info-xref.
55
56 * progmodes/python.el (python-maybe-jython): Don't assume point-min==1.
57
582004-04-21 Teodor Zlatanov <tzz@lifelogs.com>
59
60 * simple.el (next-error-last-buffer, next-error-function):
61 New variables for the next-error framework.
62 (next-error-buffer-p): New function.
63 (next-error-find-buffer): Generalize compilation-find-buffer.
64 (next-error, previous-error, first-error, next-error-no-select)
65 (previous-error-no-select): Move from compile.el.
66
67 * replace.el (occur-next-error, occur-1): Hook into the next-error
68 framework.
69
70 * progmodes/compile.el (compilation-start):
71 Set next-error-last-buffer so next-error knows where to jump.
72 (compilation-setup): Set the buffer-local variable
73 next-error-function to 'compilation-next-error-function.
74 (compilation-buffer-p, compilation-buffer-internal-p): Use an
75 alternate way to find if a buffer is a compilation buffer, for
76 next-error convenience.
77 (next-error-no-select, previous-error-no-select, next-error)
78 (previous-error, first-error): Move to simple.el.
79 (compilation-find-buffer): Move to next-error-find-buffer in simple.el.
80 (compilation-last-buffer): Remove.
81 (compilation-start, compilation-next-error, compilation-setup)
82 (compilation-next-error-function, compilation-find-buffer):
83 Remove compilation-last-buffer use.
84
852004-04-21 Juanma Barranquero <lektu@terra.es>
86
87 * makefile.w32-in (WINS): Add url/ directory.
88
89 * font-lock.el (font-lock-preprocessor-face): Remove spurious quote.
90 (font-lock-warning-face): Fix spacing.
91
922004-04-21 Lars Hansen <larsh@math.ku.dk>
93
94 * desktop.el (desktop-buffer-mode-handlers): New variable.
95 Alist of major mode specific functions to restore a desktop buffer.
96 (desktop-buffer-handlers): Make variable obsolete.
97 (desktop-create-buffer): Use desktop-buffer-mode-handlers.
98 Catch errors signaled in handlers. Update buffer count.
99 Evaluate desktop-buffer-point.
100 (desktop-buffer-dired): Rename to dired-restore-desktop-buffer and
101 move to dired.el.
102 (desktop-buffer-info): Rename to Info-restore-desktop-buffer and
103 move to info.el.
104 (desktop-buffer-rmail): Rename to rmail-restore-desktop-buffer and
105 move to mail/rmail.el.
106 (desktop-buffer-mh): Rename to mh-restore-desktop-buffer and move
107 to mh-e/mh-e.el.
108 (desktop-buffer-file): Rename to desktop-restore-file-buffer.
109 On fail, print message (to message buffer) even if
110 desktop-missing-file-warning is nil.
111 (desktop-buffer-misc-data-function): New buffer local variable.
112 Function returning major mode specific data.
113 (desktop-buffer-misc-functions): Make variable obsolete.
114 (desktop-save): Use desktop-buffer-misc-data-function.
115 (desktop-buffer-dired-misc-data): Rename to
116 dired-desktop-buffer-misc-data and move to dired.el.
117 (desktop-buffer-info-misc-data): Rename to
118 Info-desktop-buffer-misc-data and move to info.el.
119 (desktop-read): Add message about number of buffers restored/failed.
120 * dired.el (dired-restore-desktop-buffer) Move from desktop.el.
121 Add parameters. Pause to display error only when
122 desktop-missing-file-warning is non-nil.
123 (dired-desktop-buffer-misc-data): Move from desktop.el. Add parameter.
124 * info.el (Info-restore-desktop-buffer): Move from desktop.el.
125 Add Parameters.
126 (Info-desktop-buffer-misc-data): Move from desktop.el. Add parameter.
127 * mail/rmail.el (rmail-restore-desktop-buffer): Move from desktop.el.
128 Add Parameters.
129 * mh-e/mh-e.el (mh-restore-desktop-buffer): Move from desktop.el.
130 Add Parameters.
131
1322003-04-21 Paul Pogonyshev <pogonyshev@gmx.net>
133
134 * dabbrev.el (dabbrev--substitute-expansion): Fix a bug which lost
135 the case of letters in case-insensitive expansions on certain
136 abbreviations.
137
1382004-04-21 Richard M. Stallman <rms@gnu.org>
139
140 * progmodes/cperl-mode.el (cperl-putback-char):
141 Delete Emacs 18 definition.
142
143 * international/mule.el (ctext-post-read-conversion):
144 Use assoc-string, not assoc-ignore-case.
145
146 * international/mule-cmds.el: Use assoc-string, not assoc-ignore-case.
147
148 * emacs-lisp/easymenu.el (easy-menu-add):
149 Do call x-popup-menu, but only if it's defined.
150
151 * emacs-lisp/disass.el (disassemble): Handle lambda-exp as arg.
152
153 * emacs-lisp/bytecomp.el (byte-compile-no-warnings):
154 Handle multiple args: compile like progn.
155
156 * emacs-lisp/byte-run.el (with-no-warnings): Simplify:
157 take all args as &rest arg.
158
159 * autoinsert.el (auto-insert-alist): Insert the user's name in
160 copyright notice, rather than Free Software Foundation.
161
1622004-04-21 Kenichi Handa <handa@m17n.org>
163
164 * descr-text.el (describe-char): Make it work on *Help* buffer.
165
1662004-04-21 Kim F. Storm <storm@cua.dk>
167
168 * image.el (insert-image): Add optional SLICE arg.
169 (insert-sliced-image): New defun.
170
1712004-04-20 Lawrence Mitchell <wence@gmx.li> (tiny change)
172
173 * subr.el (read-number): Check whether `default' is nil.
174
1752004-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
176
177 * progmodes/compile.el (compilation-error-properties):
178 Split into two.
179 (compilation-internal-error-properties): New one.
180 (compilation-compat-error-properties): Use it. Fix the non-marker case.
181
1822004-04-20 Richard M. Stallman <rms@gnu.org>
183
184 * window.el (split-window-save-restore-data):
185 Don't update the data if OLD-INFO is nil.
186
187 * view.el (view-return-to-alist): Mark it permanent local.
188
189 * subr.el (event-modifiers): Fix the criterion for ASCII control chars.
190
191 * recentf.el (recentf-save-list): Catch and warn about errors.
192
193 * menu-bar.el (menu-bar-update-buffers): Call copy-sequence
194 so "Buffers" won't be pure.
195
196 * help-mode.el (help-mode-finish): Set help-return-alist first
197 thing, setting only the entry for the selected window.
198
199 * help-fns.el (describe-function-1): If many non-control non-meta
200 keys run the command, don't list all of them.
201
2022004-04-20 Juanma Barranquero <lektu@terra.es>
203
204 * vc-svn.el (vc-svn-print-log, vc-svn-diff): Add optional BUFFER
205 arg. Copied from Andre Spiegel's patch of 2004-03-21.
206
207 * calendar/time-date.el (time-to-day-in-year): Fix docstring.
208
2092004-04-20 Kenichi Handa <handa@m17n.org>
210
211 * international/quail.el (quail-lookup-key): New optional arg
212 NOT-RESET-INDICES.
213 (quail-get-translations): Call quail-lookup-key with
214 NOT-RESET-INDICES t.
215 (quail-completion): Likewise.
216 (quail-lookup-map-and-concat): Likewise.
217
2182004-04-20 Kenichi Handa <handa@m17n.org>
219
220 * international/quail.el (quail-update-translation): Don't insert
221 such an unsupported multibyte char in a unibyte buffer.
222
2232004-04-20 Nick Roberts <nick@nick.uklinux.net>
224
225 * progmodes/gdb-ui.el (gdb-frame-parameters): New constant.
226 (gdb-frame-breakpoints-buffer, gdb-frame-stack-buffer)
227 (gdb-frame-threads-buffer, gdb-frame-registers-buffer)
228 (gdb-frame-locals-buffer, gdb-frame-gdb-buffer)
229 (gdb-frame-assembler-buffer): Improve behaviour with
230 multiple frames.
231 (gdb-display-buffer): Extend search to all visible frames.
232
2332004-04-19 Eli Zaretskii <eliz@gnu.org>
234
235 * mail/rmail.el (rmail-convert-to-babyl-format): Don't remove ^M
236 characters left after base64 decoding.
237 (rmail-decode-region): Use -dos variety of `coding', to remove any
238 ^M characters left after qp or base64 decoding.
239
2402004-04-19 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
241
242 * x-dnd.el (x-dnd-open-local-file, x-dnd-open-file): Improve error
243 messages.
244
2452004-04-19 Stephen Eglen <stephen@gnu.org>
246
247 * add-log.el (add-change-log-entry): Update doc string to mention
248 add-log-full-name and add-log-mailing-address.
249
12004-04-18 Juri Linkov <juri@jurta.org> 2502004-04-18 Juri Linkov <juri@jurta.org>
2 251
3 * info.el (Info-find-file, Info-find-node-2): Add history and toc. 252 * info.el (Info-find-file, Info-find-node-2): Add history and toc.
@@ -18,6 +267,22 @@
18 * international/mule-diag.el (list-input-methods): 267 * international/mule-diag.el (list-input-methods):
19 Fix args to help-xref-button. 268 Fix args to help-xref-button.
20 269
270 * help-fns.el (help-with-tutorial): Call `hack-local-variables'
271 to put into effect local variables from TUTORIAL files.
272
273 * textmodes/paragraphs.el (sentence-end) <function>: New fun
274 with default value taken from the variable `sentence-end'.
275 (sentence-end) <defcustom>: Set default to nil. Doc fix.
276 Add nil const to :type.
277 (sentence-end-without-period, sentence-end-double-space)
278 (sentence-end-without-space): Doc fix.
279
280 * textmodes/paragraphs.el (forward-sentence):
281 * textmodes/fill.el (canonically-space-region, fill-nobreak-p)
282 (fill-delete-newlines):
283 * progmodes/cc-cmds.el (c-beginning-of-statement):
284 Use function `sentence-end' instead of variable `sentence-end'.
285
212004-04-18 Andreas Schwab <schwab@suse.de> 2862004-04-18 Andreas Schwab <schwab@suse.de>
22 287
23 * progmodes/compile.el (compilation-start): Set window start to 288 * progmodes/compile.el (compilation-start): Set window start to
@@ -25,7 +290,7 @@
25 290
262004-04-18 John Wiegley <johnw@newartisans.com> 2912004-04-18 John Wiegley <johnw@newartisans.com>
27 292
28 * iswitchb.el (iswitchb-completions): Removed dependency on cl. 293 * iswitchb.el (iswitchb-completions): Remove dependency on cl.
29 294
302004-04-18 Nick Roberts <nick@nick.uklinux.net> 2952004-04-18 Nick Roberts <nick@nick.uklinux.net>
31 296
@@ -38,7 +303,7 @@
38 303
392004-04-17 John Wiegley <johnw@newartisans.com> 3042004-04-17 John Wiegley <johnw@newartisans.com>
40 305
41 * iswitchb.el (iswitchb-max-to-show): Added a new config variable 306 * iswitchb.el (iswitchb-max-to-show): Add a new config variable
42 which limits the number of names shown in the minibuffer. Off by 307 which limits the number of names shown in the minibuffer. Off by
43 default. 308 default.
44 (iswitchb-completions): Use `iswitchb-max-to-show'. This speeds 309 (iswitchb-completions): Use `iswitchb-max-to-show'. This speeds
@@ -124,7 +389,7 @@
1242004-04-16 Masatake YAMATO <jet@gyve.org> 3892004-04-16 Masatake YAMATO <jet@gyve.org>
125 390
126 * simple.el (completion-setup-function): Set an initial value 391 * simple.el (completion-setup-function): Set an initial value
127 to `element-common-end' before entering loop. Set a value 392 to `element-common-end' before entering loop. Set a value
128 to `element-common-end' at the end of loop. 393 to `element-common-end' at the end of loop.
129 The bug is reported by Juri Linkov <juri@jurta.org> in emacs-devel list. 394 The bug is reported by Juri Linkov <juri@jurta.org> in emacs-devel list.
130 (completions-common-part): Rename from completion-de-emphasis. 395 (completions-common-part): Rename from completion-de-emphasis.
@@ -481,7 +746,8 @@
481 Use Info-search-whitespace-regexp. Set Info-search-case-fold. 746 Use Info-search-whitespace-regexp. Set Info-search-case-fold.
482 (Info-search-case-sensitively, Info-search-next): New fun. 747 (Info-search-case-sensitively, Info-search-next): New fun.
483 (Info-up): Move point to the menu item of the current node. 748 (Info-up): Move point to the menu item of the current node.
484 (Info-history): New fun. Add *info-history* to same-window-buffer-names. 749 (Info-history): New fun. Add *info-history* to
750 same-window-buffer-names.
485 (Info-toc): New fun. Add *info-toc* to same-window-buffer-names. 751 (Info-toc): New fun. Add *info-toc* to same-window-buffer-names.
486 (Info-insert-toc): New fun. 752 (Info-insert-toc): New fun.
487 (Info-build-toc): New fun. 753 (Info-build-toc): New fun.
@@ -1731,7 +1997,7 @@
1731 (top-level): Require password.el if visible. Should be mandatory 1997 (top-level): Require password.el if visible. Should be mandatory
1732 once No Gnus has found its way into (X)Emacs. 1998 once No Gnus has found its way into (X)Emacs.
1733 (tramp-read-passwd): Invoke `password-read' if available, 1999 (tramp-read-passwd): Invoke `password-read' if available,
1734 `read-passwd' otherwise. `ange-ftp-read-passwd' isn't used as 2000 `read-passwd' otherwise. `ange-ftp-read-passwd' isn't used as
1735 fallback any longer. 2001 fallback any longer.
1736 (tramp-clear-passwd): New function. 2002 (tramp-clear-passwd): New function.
1737 (tramp-process-actions, tramp-process-multi-actions): 2003 (tramp-process-actions, tramp-process-multi-actions):
@@ -3153,7 +3419,7 @@
3153 3419
3154 * gdb-ui.el (gdb-prompt): Change filter for level 3 annotations, 3420 * gdb-ui.el (gdb-prompt): Change filter for level 3 annotations,
3155 if necessary. 3421 if necessary.
3156 (gdb-ann3): New function. Initialise M-x gdb as for M-x gdba if 3422 (gdb-ann3): New function. Initialise M-x gdb as for M-x gdba if
3157 annotations are detected. 3423 annotations are detected.
3158 (gud-gdba-marker-filter): Use global variable gud-marker-acc 3424 (gud-gdba-marker-filter): Use global variable gud-marker-acc
3159 instead of a local one to allow transition from 3425 instead of a local one to allow transition from
@@ -3247,7 +3513,7 @@
3247 * gdb-ui.el (gdba, gdb-assembler-mode): Call the mode "Machine" as 3513 * gdb-ui.el (gdba, gdb-assembler-mode): Call the mode "Machine" as
3248 a mode called "Assembler" already exists. 3514 a mode called "Assembler" already exists.
3249 (gdb-use-colon-colon-notation, gdb-show-changed-values): New options. 3515 (gdb-use-colon-colon-notation, gdb-show-changed-values): New options.
3250 (gud-watch): Use format option. Remove font properties from string. 3516 (gud-watch): Use format option. Remove font properties from string.
3251 (gdb-var-create-handler, gdb-var-list-children-handler): 3517 (gdb-var-create-handler, gdb-var-list-children-handler):
3252 Don't bother about properties as there are none. 3518 Don't bother about properties as there are none.
3253 (gdb-var-create-handler, gdb-var-list-children-handler) 3519 (gdb-var-create-handler, gdb-var-list-children-handler)
@@ -3340,7 +3606,7 @@
3340 (tramp-handle-file-attributes): Replace proprietary optional 3606 (tramp-handle-file-attributes): Replace proprietary optional
3341 parameter NONNUMERIC by the recently (Emacs 21.4) introduced ID-FORMAT. 3607 parameter NONNUMERIC by the recently (Emacs 21.4) introduced ID-FORMAT.
3342 (tramp-handle-file-attributes-with-perl): Handle parameter 3608 (tramp-handle-file-attributes-with-perl): Handle parameter
3343 NONNUMERIC if set. This wasn't done in the past. 3609 NONNUMERIC if set. This wasn't done in the past.
3344 (tramp-post-connection): Apply second parameter "$2" if 3610 (tramp-post-connection): Apply second parameter "$2" if
3345 `tramp-remote-perl' is called. 3611 `tramp-remote-perl' is called.
3346 3612
@@ -4114,7 +4380,7 @@
4114 * progmodes/gud.el (gud-menu-map, gud-tool-bar-map): 4380 * progmodes/gud.el (gud-menu-map, gud-tool-bar-map):
4115 Replace gud-display with gud-watch. 4381 Replace gud-display with gud-watch.
4116 (gud-speedbar-buttons): Add stuff for watching expressions 4382 (gud-speedbar-buttons): Add stuff for watching expressions
4117 in the speedbar when using M-x gdba. Use dolist on old part 4383 in the speedbar when using M-x gdba. Use dolist on old part
4118 of this function. 4384 of this function.
4119 4385
4120 * gdb-ui.el (gdb-var-list, gdb-var-changed, gdb-update-flag) 4386 * gdb-ui.el (gdb-var-list, gdb-var-changed, gdb-update-flag)
@@ -4349,7 +4615,7 @@
4349 * ffap.el (ffap-shell-prompt-regexp): Add regexp to identify 4615 * ffap.el (ffap-shell-prompt-regexp): Add regexp to identify
4350 common shell prompts that are not common filename or URL characters. 4616 common shell prompts that are not common filename or URL characters.
4351 (ffap-file-at-point): Use the new regexp to strip the prompts from 4617 (ffap-file-at-point): Use the new regexp to strip the prompts from
4352 the file names. This is an issue mostly for user prompts that 4618 the file names. This is an issue mostly for user prompts that
4353 don't have a trailing space and find-file-at-point is invoked from 4619 don't have a trailing space and find-file-at-point is invoked from
4354 within a shell inside emacs. 4620 within a shell inside emacs.
4355 4621
@@ -4566,7 +4832,7 @@
4566 4832
4567 * gdb-ui.el (gud-display1): Use gud-call to prevent extra prompt 4833 * gdb-ui.el (gud-display1): Use gud-call to prevent extra prompt
4568 being displayed in GUD buffer. 4834 being displayed in GUD buffer.
4569 (gdb-idle-input-queue): Remove var. Use just one queue. 4835 (gdb-idle-input-queue): Remove var. Use just one queue.
4570 (gdb-enqueue-idle-input,gdb-dequeue-idle-input): 4836 (gdb-enqueue-idle-input,gdb-dequeue-idle-input):
4571 Remove functions. Use just one queue. 4837 Remove functions. Use just one queue.
4572 (gdb-prompt, gdb-subprompt, def-gdb-auto-update-trigger) 4838 (gdb-prompt, gdb-subprompt, def-gdb-auto-update-trigger)
@@ -4750,7 +5016,7 @@
47502003-08-24 Nick Roberts <nick@nick.uklinux.net> 50162003-08-24 Nick Roberts <nick@nick.uklinux.net>
4751 5017
4752 * progmodes/gud.el (gud-display-line): Don't set window-point if 5018 * progmodes/gud.el (gud-display-line): Don't set window-point if
4753 source buffer is not visible. (Only happens with M-x gdba). 5019 source buffer is not visible. (Only happens with M-x gdba.)
4754 5020
4755 * gdb-ui.el (gdba): Remove gdb-quit (previously removed) from 5021 * gdb-ui.el (gdba): Remove gdb-quit (previously removed) from
4756 documentation. 5022 documentation.
@@ -5789,33 +6055,33 @@
5789 (bibtex-autokey-get-names): Fiddle with regexps. 6055 (bibtex-autokey-get-names): Fiddle with regexps.
5790 (bibtex-generate-autokey): Use identity. 6056 (bibtex-generate-autokey): Use identity.
5791 (bibtex-parse-keys): Use simplified parsing algorithm if 6057 (bibtex-parse-keys): Use simplified parsing algorithm if
5792 bibtex-parse-keys-fast is non-nil. Simplify. Change order of 6058 bibtex-parse-keys-fast is non-nil. Simplify. Change order of
5793 arguments. Return alist of keys. 6059 arguments. Return alist of keys.
5794 (bibtex-parse-strings): Simplify. Return alist of strings. 6060 (bibtex-parse-strings): Simplify. Return alist of strings.
5795 (bibtex-complete-string-cleanup): Fix docstring. 6061 (bibtex-complete-string-cleanup): Fix docstring.
5796 (bibtex-read-key): New function. 6062 (bibtex-read-key): New function.
5797 (bibtex-mode): Fix docstring. Do not parse for keys and 6063 (bibtex-mode): Fix docstring. Do not parse for keys and
5798 strings when the mode is entered. Set fill-paragraph-function to 6064 strings when the mode is entered. Set fill-paragraph-function to
5799 bibtex-fill-field. Setup font-lock-mark-block-function the way 6065 bibtex-fill-field. Setup font-lock-mark-block-function the way
5800 font-lock intended. 6066 font-lock intended.
5801 (bibtex-entry): Use bibtex-read-key. Obey bibtex-autofill-types. 6067 (bibtex-entry): Use bibtex-read-key. Obey bibtex-autofill-types.
5802 (bibtex-parse-entry, bibtex-autofill-entry): New functions. 6068 (bibtex-parse-entry, bibtex-autofill-entry): New functions.
5803 (bibtex-print-help-message, bibtex-remove-OPT-or-ALT) 6069 (bibtex-print-help-message, bibtex-remove-OPT-or-ALT)
5804 (bibtex-Preamble): Avoid hard coded constants. 6070 (bibtex-Preamble): Avoid hard coded constants.
5805 (bibtex-make-field): Fix docstring. Simplify. 6071 (bibtex-make-field): Fix docstring. Simplify.
5806 (bibtex-beginning-of-entry): Always return new position of point. 6072 (bibtex-beginning-of-entry): Always return new position of point.
5807 (bibtex-end-of-entry): Rearrange cond clauses. 6073 (bibtex-end-of-entry): Rearrange cond clauses.
5808 (bibtex-count-entries, bibtex-validate, bibtex-reformat): 6074 (bibtex-count-entries, bibtex-validate, bibtex-reformat):
5809 Update for changes of bibtex-map-entries. 6075 Update for changes of bibtex-map-entries.
5810 (bibtex-ispell-abstract): Do not move point. 6076 (bibtex-ispell-abstract): Do not move point.
5811 (bibtex-entry-index): Use downcase. Simplify. 6077 (bibtex-entry-index): Use downcase. Simplify.
5812 (bibtex-lessp): Handle catch-all. 6078 (bibtex-lessp): Handle catch-all.
5813 (bibtex-find-crossref): Turn into a command. 6079 (bibtex-find-crossref): Turn into a command.
5814 (bibtex-find-entry): Simplify. Use bibtex-read-key. Fix regexp. 6080 (bibtex-find-entry): Simplify. Use bibtex-read-key. Fix regexp.
5815 (bibtex-clean-entry): Use bibtex-read-key. Handle string and 6081 (bibtex-clean-entry): Use bibtex-read-key. Handle string and
5816 preamble entries. 6082 preamble entries.
5817 (bibtex-fill-field-bounds): New function. 6083 (bibtex-fill-field-bounds): New function.
5818 (bibtex-fill-field): New command. Bound to fill-paragraph-function. 6084 (bibtex-fill-field): New command. Bound to fill-paragraph-function.
5819 (bibtex-fill-entry): Use bibtex-fill-field-bounds 6085 (bibtex-fill-entry): Use bibtex-fill-field-bounds
5820 (bibtex-String): Use bibtex-strings. Always obey 6086 (bibtex-String): Use bibtex-strings. Always obey
5821 bibtex-sort-ignore-string-entries. 6087 bibtex-sort-ignore-string-entries.
diff --git a/lisp/ChangeLog.10 b/lisp/ChangeLog.10
index 6aae7e44cdf..cf1743c3490 100644
--- a/lisp/ChangeLog.10
+++ b/lisp/ChangeLog.10
@@ -8320,17 +8320,27 @@
8320 indicating source of entry to add-to-diary-list. 8320 indicating source of entry to add-to-diary-list.
8321 (diary-button-face, diary-entry, diary-goto-entry): New, to 8321 (diary-button-face, diary-entry, diary-goto-entry): New, to
8322 support click to diary file. 8322 support click to diary file.
8323 (fancy-diary-display): Buttonize diary entries. 8323 (fancy-diary-display): Buttonize diary entries. Use new mode
8324 fancy-diary-display-mode.
8324 (list-sexp-diary-entries): Pass a marker indicating source of 8325 (list-sexp-diary-entries): Pass a marker indicating source of
8325 entry to add-to-diary-list. 8326 entry to add-to-diary-list.
8326 (diary-date): Return mark as well as entry. 8327 (diary-date): Return mark as well as entry.
8328 (add-to-diary-list): Add new marker argument, appended to
8329 diary-entries-list.
8330 (diary-mode, fancy-diary-display-mode): New derived modes, for
8331 diary file and fancy diary buffer respectively.
8332 (fancy-diary-font-lock-keywords, diary-font-lock-keywords): New
8333 variables.
8334 (font-lock-diary-sexps, font-lock-diary-date-forms): New
8335 functions, used in diary-font-lock-keywords.
8327 8336
8328 * calendar/calendar.el (diary-face): New. 8337 * calendar/calendar.el (diary-face): New.
8329 (european-calendar-display-form, describe-calendar-mode) 8338 (european-calendar-display-form, describe-calendar-mode)
8330 (mark-visible-calendar-date, calendar-mark-today): Tidy doc string. 8339 (mark-visible-calendar-date, calendar-mark-today): Tidy doc string.
8331 (calendar-make-alist): New. 8340 (calendar-mode): Set up font-lock mode, using new variable
8332 (calendar-mode): Set up font-lock mode. 8341 calendar-font-lock-keywords.
8333 (generate-calendar-window): Fontify if font-lock-mode is on. 8342 (generate-calendar-window): Fontify if font-lock-mode is on.
8343 (calendar-font-lock-keywords): New variable.
8334 8344
83352002-11-16 Ivan Zakharyaschev <imz@altlinux.org> (tiny change) 83452002-11-16 Ivan Zakharyaschev <imz@altlinux.org> (tiny change)
8336 8346
diff --git a/lisp/Makefile.in b/lisp/Makefile.in
index 137a00d802d..8ccb03f69e3 100644
--- a/lisp/Makefile.in
+++ b/lisp/Makefile.in
@@ -282,7 +282,7 @@ compile-after-backup: backup-compiled-files compile-always
282# .elc is present. 282# .elc is present.
283 283
284recompile: doit $(lisp)/progmodes/cc-mode.elc 284recompile: doit $(lisp)/progmodes/cc-mode.elc
285 $(EMACS) $(EMACSOPT) -f batch-byte-recompile-directory $(lisp) 285 $(EMACS) $(EMACSOPT) --eval "(batch-byte-recompile-directory 0)" $(lisp)
286 286
287# CC Mode uses a compile time macro system which causes a compile time 287# CC Mode uses a compile time macro system which causes a compile time
288# dependency in cc-mode.elc on the macros in cc-langs.el and the 288# dependency in cc-mode.elc on the macros in cc-langs.el and the
diff --git a/lisp/add-log.el b/lisp/add-log.el
index 609dfde5f65..ead1fe679d6 100644
--- a/lisp/add-log.el
+++ b/lisp/add-log.el
@@ -445,7 +445,7 @@ Optional arg BUFFER-FILE overrides `buffer-file-name'."
445(defun add-change-log-entry (&optional whoami file-name other-window new-entry) 445(defun add-change-log-entry (&optional whoami file-name other-window new-entry)
446 "Find change log file, and add an entry for today and an item for this file. 446 "Find change log file, and add an entry for today and an item for this file.
447Optional arg WHOAMI (interactive prefix) non-nil means prompt for user 447Optional arg WHOAMI (interactive prefix) non-nil means prompt for user
448name and site. 448name and email (stored in `add-log-full-name' and `add-log-mailing-address').
449 449
450Second arg FILE-NAME is file name of the change log. 450Second arg FILE-NAME is file name of the change log.
451If nil, use the value of `change-log-default-name'. 451If nil, use the value of `change-log-default-name'.
diff --git a/lisp/autoinsert.el b/lisp/autoinsert.el
index 489593aa925..88acbd04792 100644
--- a/lisp/autoinsert.el
+++ b/lisp/autoinsert.el
@@ -136,7 +136,7 @@ If this contains a %s, that will be replaced by the matching rule."
136 (("\\.[1-9]\\'" . "Man page skeleton") 136 (("\\.[1-9]\\'" . "Man page skeleton")
137 "Short description: " 137 "Short description: "
138 ".\\\" Copyright (C), " (substring (current-time-string) -4) " " 138 ".\\\" Copyright (C), " (substring (current-time-string) -4) " "
139 (getenv "ORGANIZATION") | "Free Software Foundation, Inc." 139 (getenv "ORGANIZATION") | (progn user-full-name)
140 " 140 "
141.\\\" You may distribute this file under the terms of the GNU Free 141.\\\" You may distribute this file under the terms of the GNU Free
142.\\\" Documentation Licence. 142.\\\" Documentation Licence.
diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el
index b36d5ab2f31..846231befe6 100644
--- a/lisp/calendar/time-date.el
+++ b/lisp/calendar/time-date.el
@@ -149,7 +149,7 @@ DATE1 and DATE2 should be date-time strings."
149 149
150;;;###autoload 150;;;###autoload
151(defun time-to-day-in-year (time) 151(defun time-to-day-in-year (time)
152 "Return the day number within the year of the date month/day/year." 152 "Return the day number within the year corresponding to TIME."
153 (let* ((tim (decode-time time)) 153 (let* ((tim (decode-time time))
154 (month (nth 4 tim)) 154 (month (nth 4 tim))
155 (day (nth 3 tim)) 155 (day (nth 3 tim))
diff --git a/lisp/cvs-status.el b/lisp/cvs-status.el
index 528ab74e509..96b1f1eb066 100644
--- a/lisp/cvs-status.el
+++ b/lisp/cvs-status.el
@@ -1,4 +1,4 @@
1;;; cvs-status.el --- major mode for browsing `cvs status' output 1;;; cvs-status.el --- major mode for browsing `cvs status' output -*- coding: utf-8 -*-
2 2
3;; Copyright (C) 1999, 2000, 03, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 1999, 2000, 03, 2004 Free Software Foundation, Inc.
4 4
@@ -384,23 +384,45 @@ the list is a three-string list TAG, KIND, REV."
384;;;; CVSTree-style trees 384;;;; CVSTree-style trees
385;;;; 385;;;;
386 386
387(defvar cvs-tree-use-jisx0208 387(defvar cvs-tree-use-jisx0208 nil) ;Old compat var.
388 (and (char-displayable-p (make-char 'japanese-jisx0208 40 44)) t) 388(defvar cvs-tree-use-charset
389 (cond
390 (cvs-tree-use-jisx0208 'jisx0208)
391 ((char-displayable-p ?━) 'unicode)
392 ((char-displayable-p (make-char 'japanese-jisx0208 40 44)) 'jisx0208))
389 "*Non-nil if we should use the graphical glyphs from `japanese-jisx0208'. 393 "*Non-nil if we should use the graphical glyphs from `japanese-jisx0208'.
390Otherwise, default to ASCII chars like +, - and |.") 394Otherwise, default to ASCII chars like +, - and |.")
391 395
392(defconst cvs-tree-char-space 396(defconst cvs-tree-char-space
393 (if cvs-tree-use-jisx0208 (make-char 'japanese-jisx0208 33 33) " ")) 397 (case cvs-tree-use-charset
398 (jisx0208 (make-char 'japanese-jisx0208 33 33))
399 (unicode " ")
400 (t " ")))
394(defconst cvs-tree-char-hbar 401(defconst cvs-tree-char-hbar
395 (if cvs-tree-use-jisx0208 (make-char 'japanese-jisx0208 40 44) "--")) 402 (case cvs-tree-use-charset
403 (jisx0208 (make-char 'japanese-jisx0208 40 44))
404 (unicode "━")
405 (t "--")))
396(defconst cvs-tree-char-vbar 406(defconst cvs-tree-char-vbar
397 (if cvs-tree-use-jisx0208 (make-char 'japanese-jisx0208 40 45) "| ")) 407 (case cvs-tree-use-charset
408 (jisx0208 (make-char 'japanese-jisx0208 40 45))
409 (unicode "┃")
410 (t "| ")))
398(defconst cvs-tree-char-branch 411(defconst cvs-tree-char-branch
399 (if cvs-tree-use-jisx0208 (make-char 'japanese-jisx0208 40 50) "+-")) 412 (case cvs-tree-use-charset
413 (jisx0208 (make-char 'japanese-jisx0208 40 50))
414 (unicode "┣")
415 (t "+-")))
400(defconst cvs-tree-char-eob ;end of branch 416(defconst cvs-tree-char-eob ;end of branch
401 (if cvs-tree-use-jisx0208 (make-char 'japanese-jisx0208 40 49) "`-")) 417 (case cvs-tree-use-charset
418 (jisx0208 (make-char 'japanese-jisx0208 40 49))
419 (unicode "┗")
420 (t "`-")))
402(defconst cvs-tree-char-bob ;beginning of branch 421(defconst cvs-tree-char-bob ;beginning of branch
403 (if cvs-tree-use-jisx0208 (make-char 'japanese-jisx0208 40 51) "+-")) 422 (case cvs-tree-use-charset
423 (jisx0208 (make-char 'japanese-jisx0208 40 51))
424 (unicode "┳")
425 (t "+-")))
404 426
405(defun cvs-tag-lessp (tag1 tag2) 427(defun cvs-tag-lessp (tag1 tag2)
406 (eq (cvs-tag-compare tag1 tag2) 'more2)) 428 (eq (cvs-tag-compare tag1 tag2) 'more2))
@@ -411,7 +433,7 @@ Otherwise, default to ASCII chars like +, - and |.")
411 "Look for a list of tags, and replace it with a tree. 433 "Look for a list of tags, and replace it with a tree.
412Optional prefix ARG chooses between two representations." 434Optional prefix ARG chooses between two representations."
413 (interactive "P") 435 (interactive "P")
414 (when (and cvs-tree-use-jisx0208 436 (when (and cvs-tree-use-charset
415 (not enable-multibyte-characters)) 437 (not enable-multibyte-characters))
416 ;; We need to convert the buffer from unibyte to multibyte 438 ;; We need to convert the buffer from unibyte to multibyte
417 ;; since we'll use multibyte chars for the tree. 439 ;; since we'll use multibyte chars for the tree.
diff --git a/lisp/dabbrev.el b/lisp/dabbrev.el
index 3763f2ccab8..47ffba9873d 100644
--- a/lisp/dabbrev.el
+++ b/lisp/dabbrev.el
@@ -888,23 +888,28 @@ to record whether we upcased the expansion, downcased it, or did neither."
888 ;; matches the start of the expansion, 888 ;; matches the start of the expansion,
889 ;; copy the expansion's case 889 ;; copy the expansion's case
890 ;; instead of downcasing all the rest. 890 ;; instead of downcasing all the rest.
891 ;; Treat a one-capital-letter abbrev as "not all upper case", 891 ;;
892 ;; so as to force preservation of the expansion's pattern 892 ;; Treat a one-capital-letter (possibly with preceding non-letter
893 ;; if the expansion starts with a capital letter. 893 ;; characters) abbrev as "not all upper case", so as to force
894 (let ((expansion-rest (substring expansion 1))) 894 ;; preservation of the expansion's pattern if the expansion starts
895 (if (and (not (and (or (string= expansion-rest (downcase expansion-rest)) 895 ;; with a capital letter.
896 (string= expansion-rest (upcase expansion-rest))) 896 (let ((expansion-rest (substring expansion 1))
897 (or (string= abbrev (downcase abbrev)) 897 (first-letter-position (string-match "[[:alpha:]]" abbrev)))
898 (and (string= abbrev (upcase abbrev)) 898 (if (or (null first-letter-position)
899 (> (length abbrev) 1))))) 899 (and (not (and (or (string= expansion-rest (downcase expansion-rest))
900 (string= abbrev 900 (string= expansion-rest (upcase expansion-rest)))
901 (substring expansion 0 (length abbrev)))) 901 (or (string= abbrev (downcase abbrev))
902 (and (string= abbrev (upcase abbrev))
903 (> (- (length abbrev) first-letter-position)
904 1)))))
905 (string= abbrev
906 (substring expansion 0 (length abbrev)))))
902 (setq use-case-replace nil))) 907 (setq use-case-replace nil)))
903 908
904 ;; If the abbrev and the expansion are both all-lower-case 909 ;; If the abbrev and the expansion are both all-lower-case
905 ;; then don't do any conversion. The conversion would be a no-op 910 ;; then don't do any conversion. The conversion would be a no-op
906 ;; for this replacement, but it would carry forward to subsequent words. 911 ;; for this replacement, but it would carry forward to subsequent words.
907 ;; The goal of this is to preven that carrying forward. 912 ;; The goal of this is to prevent that carrying forward.
908 (if (and (string= expansion (downcase expansion)) 913 (if (and (string= expansion (downcase expansion))
909 (string= abbrev (downcase abbrev))) 914 (string= abbrev (downcase abbrev)))
910 (setq use-case-replace nil)) 915 (setq use-case-replace nil))
diff --git a/lisp/descr-text.el b/lisp/descr-text.el
index 30ef3dcf05e..c73cfeb02c3 100644
--- a/lisp/descr-text.el
+++ b/lisp/descr-text.el
@@ -474,6 +474,7 @@ as well as widgets, buttons, overlays, and text properties."
474 standard-display-table)) 474 standard-display-table))
475 (disp-vector (and display-table (aref display-table char))) 475 (disp-vector (and display-table (aref display-table char)))
476 (multibyte-p enable-multibyte-characters) 476 (multibyte-p enable-multibyte-characters)
477 text-prop-description
477 item-list max-width unicode) 478 item-list max-width unicode)
478 (if (eq charset 'unknown) 479 (if (eq charset 'unknown)
479 (setq item-list 480 (setq item-list
@@ -582,8 +583,14 @@ as well as widgets, buttons, overlays, and text properties."
582 (cons (list "Unicode data" " ") unicodedata)))))) 583 (cons (list "Unicode data" " ") unicodedata))))))
583 (setq max-width (apply #'max (mapcar #'(lambda (x) (length (car x))) 584 (setq max-width (apply #'max (mapcar #'(lambda (x) (length (car x)))
584 item-list))) 585 item-list)))
585 (when (eq (current-buffer) (get-buffer "*Help*")) 586 (setq text-prop-description
586 (error "Can't describe char in Help buffer")) 587 (with-temp-buffer
588 (let ((buf (current-buffer)))
589 (save-excursion
590 (set-buffer buffer)
591 (describe-text-properties pos buf)))
592 (buffer-string)))
593
587 (with-output-to-temp-buffer "*Help*" 594 (with-output-to-temp-buffer "*Help*"
588 (with-current-buffer standard-output 595 (with-current-buffer standard-output
589 (set-buffer-multibyte multibyte-p) 596 (set-buffer-multibyte multibyte-p)
@@ -658,10 +665,8 @@ as well as widgets, buttons, overlays, and text properties."
658 (insert "\nSee the variable `reference-point-alist' for " 665 (insert "\nSee the variable `reference-point-alist' for "
659 "the meaning of the rule.\n")) 666 "the meaning of the rule.\n"))
660 667
661 (let ((output (current-buffer))) 668 (insert text-prop-description)
662 (with-current-buffer buffer 669 (describe-text-mode)))))
663 (describe-text-properties pos output))
664 (describe-text-mode))))))
665 670
666(defalias 'describe-char-after 'describe-char) 671(defalias 'describe-char-after 'describe-char)
667(make-obsolete 'describe-char-after 'describe-char "21.5") 672(make-obsolete 'describe-char-after 'describe-char "21.5")
diff --git a/lisp/desktop.el b/lisp/desktop.el
index beac1f39005..5589097dfde 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -83,12 +83,6 @@
83 83
84;;; Code: 84;;; Code:
85 85
86;; Make the compilation more silent
87(eval-when-compile
88 ;; We use functions from these modules
89 ;; We can't (require 'mh-e) since that wants to load something.
90 (mapcar 'require '(info dired reporter)))
91
92(defvar desktop-file-version "206" 86(defvar desktop-file-version "206"
93 "Version number of desktop file format. 87 "Version number of desktop file format.
94Written into the desktop file and used at desktop read to provide 88Written into the desktop file and used at desktop read to provide
@@ -253,8 +247,9 @@ The variables are saved only when they really are local."
253(defcustom desktop-buffer-modes-to-save 247(defcustom desktop-buffer-modes-to-save
254 '(Info-mode rmail-mode) 248 '(Info-mode rmail-mode)
255 "If a buffer is of one of these major modes, save the buffer state. 249 "If a buffer is of one of these major modes, save the buffer state.
256It is up to the functions in `desktop-buffer-handlers' to decide 250This applies to buffers not visiting a file and not beeing a dired buffer.
257whether the buffer should be recreated or not, and how." 251Modes specified here must have a handler in `desktop-buffer-mode-handlers'
252to be restored."
258 :type '(repeat symbol) 253 :type '(repeat symbol)
259 :group 'desktop) 254 :group 'desktop)
260 255
@@ -272,53 +267,59 @@ Possible values are:
272 :type '(choice (const absolute) (const tilde) (const local)) 267 :type '(choice (const absolute) (const tilde) (const local))
273 :group 'desktop) 268 :group 'desktop)
274 269
275(defcustom desktop-buffer-misc-functions 270;;;###autoload
276 '(desktop-buffer-info-misc-data 271(defvar desktop-buffer-misc-data-function nil
277 desktop-buffer-dired-misc-data) 272 "Function returning major mode specific data for desktop file.
278 "*Functions used to determine auxiliary information for a buffer. 273This variable becomes buffer local when set.
279These functions are called by `desktop-save' in order, with no 274The function specified is called by `desktop-save', with argument
280arguments. If a function returns non-nil, its value is saved along 275DESKTOP-DIRNAME. If it returns non-nil, its value is saved along
281with the state of the buffer for which it was called; no further 276with the state of the buffer for which it was called.
282functions will be called.
283 277
284When file names are returned, they should be formatted using the call 278When file names are returned, they should be formatted using the call
285\"(desktop-file-name FILE-NAME dirname)\". 279\"(desktop-file-name FILE-NAME DESKTOP-DIRNAME)\".
286 280
287Later, when `desktop-read' restores buffers, each of the functions in 281Later, when `desktop-read' calls a function in `desktop-buffer-mode-handlers'
288`desktop-buffer-handlers' will have access to a buffer local variable, 282to restore the buffer, the auxiliary information is passed as argument.")
289named `desktop-buffer-misc', whose value is what the function in 283(make-variable-buffer-local 'desktop-buffer-misc-data-function)
290`desktop-buffer-misc-functions' returned." 284(make-obsolete-variable 'desktop-buffer-misc-functions
291 :type '(repeat function) 285 'desktop-buffer-misc-data-function)
292 :group 'desktop)
293 286
294(defcustom desktop-buffer-handlers 287(defcustom desktop-buffer-mode-handlers '(
295 '(desktop-buffer-dired 288 (dired-mode . dired-restore-desktop-buffer)
296 desktop-buffer-rmail 289 (rmail-mode . rmail-restore-desktop-buffer)
297 desktop-buffer-mh 290 (mh-folder-mode . mh-restore-desktop-buffer)
298 desktop-buffer-info 291 (Info-mode . Info-restore-desktop-buffer))
299 desktop-buffer-file) 292 "Alist of major mode specific functions to restore a desktop buffer.
300 "*Functions called by `desktop-read' in order to create a buffer. 293Functions are called by `desktop-read'. List elements must have the form
301The functions are called without explicit parameters but can use the 294\(MAJOR-MODE . FUNCTION).
302following variables: 295
296Buffers with a major mode not specified here, are restored by the default
297handler `desktop-restore-file-buffer'.
298
299Handlers are called with parameters
303 300
304 desktop-file-version
305 desktop-buffer-file-name 301 desktop-buffer-file-name
306 desktop-buffer-name 302 desktop-buffer-name
303 desktop-buffer-misc
304
305Furthermore, they may use the following variables:
306
307 desktop-file-version
307 desktop-buffer-major-mode 308 desktop-buffer-major-mode
308 desktop-buffer-minor-modes 309 desktop-buffer-minor-modes
309 desktop-buffer-point 310 desktop-buffer-point
310 desktop-buffer-mark 311 desktop-buffer-mark
311 desktop-buffer-read-only 312 desktop-buffer-read-only
312 desktop-buffer-misc
313 desktop-buffer-locals 313 desktop-buffer-locals
314 314
315If one function returns non-nil, no further functions are called. 315If a handler returns a buffer, then the saved mode settings
316If the function returns a buffer, then the saved mode settings
317and variable values for that buffer are copied into it." 316and variable values for that buffer are copied into it."
318 :type '(repeat function) 317 :type 'alist
319 :group 'desktop) 318 :group 'desktop)
320 319
321(put 'desktop-buffer-handlers 'risky-local-variable t) 320(put 'desktop-buffer-mode-handlers 'risky-local-variable t)
321(make-obsolete-variable 'desktop-buffer-handlers
322 'desktop-buffer-mode-handlers)
322 323
323(defcustom desktop-minor-mode-table 324(defcustom desktop-minor-mode-table
324 '((auto-fill-function auto-fill-mode) 325 '((auto-fill-function auto-fill-mode)
@@ -608,7 +609,9 @@ See also `desktop-base-file-name'."
608 (point) 609 (point)
609 (list (mark t) mark-active) 610 (list (mark t) mark-active)
610 buffer-read-only 611 buffer-read-only
611 (run-hook-with-args-until-success 'desktop-buffer-misc-functions) 612 ;; Auxiliary information
613 (when desktop-buffer-misc-data-function
614 (funcall desktop-buffer-misc-data-function dirname))
612 (let ((locals desktop-locals-to-save) 615 (let ((locals desktop-locals-to-save)
613 (loclist (buffer-local-variables)) 616 (loclist (buffer-local-variables))
614 (ll)) 617 (ll))
@@ -703,7 +706,9 @@ It returns t if a desktop file was loaded, nil otherwise."
703 "~")))) 706 "~"))))
704 (if (file-exists-p (expand-file-name desktop-base-file-name desktop-dirname)) 707 (if (file-exists-p (expand-file-name desktop-base-file-name desktop-dirname))
705 ;; Desktop file found, process it. 708 ;; Desktop file found, process it.
706 (let ((desktop-first-buffer nil)) 709 (let ((desktop-first-buffer nil)
710 (desktop-buffer-ok-count 0)
711 (desktop-buffer-fail-count 0))
707 ;; Evaluate desktop buffer. 712 ;; Evaluate desktop buffer.
708 (load (expand-file-name desktop-base-file-name desktop-dirname) t t t) 713 (load (expand-file-name desktop-base-file-name desktop-dirname) t t t)
709 ;; `desktop-create-buffer' puts buffers at end of the buffer list. 714 ;; `desktop-create-buffer' puts buffers at end of the buffer list.
@@ -715,7 +720,12 @@ It returns t if a desktop file was loaded, nil otherwise."
715 (run-hooks 'desktop-delay-hook) 720 (run-hooks 'desktop-delay-hook)
716 (setq desktop-delay-hook nil) 721 (setq desktop-delay-hook nil)
717 (run-hooks 'desktop-after-read-hook) 722 (run-hooks 'desktop-after-read-hook)
718 (message "Desktop loaded.") 723 (message "Desktop: %d buffer%s restored%s."
724 desktop-buffer-ok-count
725 (if (= 1 desktop-buffer-ok-count) "" "s")
726 (if (< 0 desktop-buffer-fail-count)
727 (format ", %d failed to restore" desktop-buffer-fail-count)
728 ""))
719 t) 729 t)
720 ;; No desktop file found. 730 ;; No desktop file found.
721 (desktop-clear) 731 (desktop-clear)
@@ -772,106 +782,21 @@ directory DIRNAME."
772 (desktop-read desktop-dirname)) 782 (desktop-read desktop-dirname))
773 783
774;; ---------------------------------------------------------------------------- 784;; ----------------------------------------------------------------------------
775;; Note: the following functions use the dynamic variable binding in Lisp. 785(defun desktop-restore-file-buffer (desktop-buffer-file-name
776;; 786 desktop-buffer-name
777 787 desktop-buffer-misc)
778(eval-when-compile ; Just to silence the byte compiler 788 "Restore a file buffer."
779 (defvar desktop-file-version) 789 (eval-when-compile ; Just to silence the byte compiler
780 (defvar desktop-buffer-file-name) 790 (defvar desktop-buffer-major-mode)
781 (defvar desktop-buffer-name) 791 (defvar desktop-buffer-locals))
782 (defvar desktop-buffer-major-mode)
783 (defvar desktop-buffer-minor-modes)
784 (defvar desktop-buffer-point)
785 (defvar desktop-buffer-mark)
786 (defvar desktop-buffer-read-only)
787 (defvar desktop-buffer-misc)
788 (defvar desktop-buffer-locals)
789)
790
791(defun desktop-buffer-info-misc-data ()
792 (if (eq major-mode 'Info-mode)
793 (list Info-current-file
794 Info-current-node)))
795
796;; ----------------------------------------------------------------------------
797(defun desktop-buffer-dired-misc-data ()
798 (when (eq major-mode 'dired-mode)
799 (eval-when-compile (defvar dirname))
800 (cons
801 ;; Value of `dired-directory'.
802 (if (consp dired-directory)
803 ;; Directory name followed by list of files.
804 (cons (desktop-file-name (car dired-directory) dirname) (cdr dired-directory))
805 ;; Directory name, optionally with with shell wildcard.
806 (desktop-file-name dired-directory dirname))
807 ;; Subdirectories in `dired-subdir-alist'.
808 (cdr
809 (nreverse
810 (mapcar
811 (function (lambda (f) (desktop-file-name (car f) dirname)))
812 dired-subdir-alist))))))
813
814;; ----------------------------------------------------------------------------
815(defun desktop-buffer-info () "Load an info file."
816 (if (eq 'Info-mode desktop-buffer-major-mode)
817 (progn
818 (let ((first (nth 0 desktop-buffer-misc))
819 (second (nth 1 desktop-buffer-misc)))
820 (when (and first second)
821 (require 'info)
822 (with-no-warnings
823 (Info-find-node first second))
824 (current-buffer))))))
825
826;; ----------------------------------------------------------------------------
827(eval-when-compile (defvar rmail-buffer)) ; Just to silence the byte compiler.
828(defun desktop-buffer-rmail () "Load an RMAIL file."
829 (if (eq 'rmail-mode desktop-buffer-major-mode)
830 (condition-case error
831 (progn (rmail-input desktop-buffer-file-name)
832 (if (eq major-mode 'rmail-mode)
833 (current-buffer)
834 rmail-buffer))
835 (file-locked
836 (kill-buffer (current-buffer))
837 'ignored))))
838
839;; ----------------------------------------------------------------------------
840(defun desktop-buffer-mh () "Load a folder in the mh system."
841 (if (eq 'mh-folder-mode desktop-buffer-major-mode)
842 (with-no-warnings
843 (mh-find-path)
844 (mh-visit-folder desktop-buffer-name)
845 (current-buffer))))
846
847;; ----------------------------------------------------------------------------
848(defun desktop-buffer-dired () "Load a directory using dired."
849 (if (eq 'dired-mode desktop-buffer-major-mode)
850 ;; First element of `desktop-buffer-misc' is the value of `dired-directory'.
851 ;; This value is a directory name, optionally with with shell wildcard or
852 ;; a directory name followed by list of files.
853 (let* ((dired-dir (car desktop-buffer-misc))
854 (dir (if (consp dired-dir) (car dired-dir) dired-dir)))
855 (if (file-directory-p (file-name-directory dir))
856 (progn
857 (dired dired-dir)
858 ;; The following elements of `desktop-buffer-misc' are the keys
859 ;; from `dired-subdir-alist'.
860 (mapcar 'dired-maybe-insert-subdir (cdr desktop-buffer-misc))
861 (current-buffer))
862 (message "Directory %s no longer exists." dir)
863 (sit-for 1)
864 'ignored))))
865
866;; ----------------------------------------------------------------------------
867(defun desktop-buffer-file ()
868 "Load a file."
869 (if desktop-buffer-file-name 792 (if desktop-buffer-file-name
870 (if (or (file-exists-p desktop-buffer-file-name) 793 (if (or (file-exists-p desktop-buffer-file-name)
871 (and desktop-missing-file-warning 794 (let ((msg (format "Desktop: File \"%s\" no longer exists."
872 (y-or-n-p (format 795 desktop-buffer-file-name)))
873 "File \"%s\" no longer exists. Re-create? " 796 (if desktop-missing-file-warning
874 desktop-buffer-file-name)))) 797 (y-or-n-p (concat msg " Re-create? "))
798 (message msg)
799 nil)))
875 (let* ((auto-insert nil) ; Disable auto insertion 800 (let* ((auto-insert nil) ; Disable auto insertion
876 (coding-system-for-read 801 (coding-system-for-read
877 (or coding-system-for-read 802 (or coding-system-for-read
@@ -885,7 +810,7 @@ directory DIRNAME."
885 (functionp desktop-buffer-major-mode) 810 (functionp desktop-buffer-major-mode)
886 (funcall desktop-buffer-major-mode)) 811 (funcall desktop-buffer-major-mode))
887 buf) 812 buf)
888 'ignored))) 813 nil)))
889 814
890;; ---------------------------------------------------------------------------- 815;; ----------------------------------------------------------------------------
891;; Create a buffer, load its file, set is mode, ...; called from Desktop file 816;; Create a buffer, load its file, set is mode, ...; called from Desktop file
@@ -907,20 +832,32 @@ directory DIRNAME."
907 desktop-buffer-misc 832 desktop-buffer-misc
908 &optional 833 &optional
909 desktop-buffer-locals) 834 desktop-buffer-locals)
835 ;; Just to silence the byte compiler. Bound locally in `desktop-read'.
836 (eval-when-compile
837 (defvar desktop-buffer-ok-count)
838 (defvar desktop-buffer-fail-count))
910 ;; To make desktop files with relative file names possible, we cannot 839 ;; To make desktop files with relative file names possible, we cannot
911 ;; allow `default-directory' to change. Therefore we save current buffer. 840 ;; allow `default-directory' to change. Therefore we save current buffer.
912 (save-current-buffer 841 (save-current-buffer
913 (let ( 842 (let (
914 (buffer-list (buffer-list)) 843 (buffer-list (buffer-list))
915 (hlist desktop-buffer-handlers) 844 (result
916 (result) 845 (condition-case err
917 (handler) 846 (funcall (or (cdr (assq desktop-buffer-major-mode desktop-buffer-mode-handlers))
847 'desktop-restore-file-buffer)
848 desktop-buffer-file-name
849 desktop-buffer-name
850 desktop-buffer-misc)
851 (error
852 (message "Desktop: Can't load buffer %s: %s"
853 desktop-buffer-name (error-message-string err))
854 (when desktop-missing-file-warning (sit-for 1))
855 nil)))
918 ) 856 )
919 ;; Call desktop-buffer-handlers to create buffer. 857 (if (bufferp result)
920 (while (and (not result) hlist) 858 (setq desktop-buffer-ok-count (1+ desktop-buffer-ok-count))
921 (setq handler (car hlist)) 859 (setq desktop-buffer-fail-count (1+ desktop-buffer-fail-count))
922 (setq result (funcall handler)) 860 (setq result nil))
923 (setq hlist (cdr hlist)))
924 (unless (bufferp result) (setq result nil)) 861 (unless (bufferp result) (setq result nil))
925 ;; Restore buffer list order with new buffer at end. Don't change 862 ;; Restore buffer list order with new buffer at end. Don't change
926 ;; the order for old desktop files (old desktop module behaviour). 863 ;; the order for old desktop files (old desktop module behaviour).
@@ -947,7 +884,12 @@ directory DIRNAME."
947 desktop-buffer-minor-modes))) 884 desktop-buffer-minor-modes)))
948 ;; Even though point and mark are non-nil when written by `desktop-save' 885 ;; Even though point and mark are non-nil when written by `desktop-save'
949 ;; they may be modified by handlers wanting to set point or mark themselves. 886 ;; they may be modified by handlers wanting to set point or mark themselves.
950 (when desktop-buffer-point (goto-char desktop-buffer-point)) 887 (when desktop-buffer-point
888 (goto-char
889 (condition-case err
890 ;; Evaluate point. Thus point can be something like '(search-forward ...
891 (eval desktop-buffer-point)
892 (error (message "%s" (error-message-string err)) 1))))
951 (when desktop-buffer-mark 893 (when desktop-buffer-mark
952 (if (consp desktop-buffer-mark) 894 (if (consp desktop-buffer-mark)
953 (progn 895 (progn
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el
index d41bfcad58a..17602317958 100644
--- a/lisp/diff-mode.el
+++ b/lisp/diff-mode.el
@@ -48,7 +48,6 @@
48;; 48;;
49;; - Refine hunk on a word-by-word basis. 49;; - Refine hunk on a word-by-word basis.
50;; 50;;
51;; - Use the new next-error-function to allow C-x `.
52;; - Handle `diff -b' output in context->unified. 51;; - Handle `diff -b' output in context->unified.
53 52
54;;; Code: 53;;; Code:
@@ -886,9 +885,14 @@ See `after-change-functions' for the meaning of BEG, END and LEN."
886 (diff-fixup-modifs (point) (cdr diff-unhandled-changes))))) 885 (diff-fixup-modifs (point) (cdr diff-unhandled-changes)))))
887 (setq diff-unhandled-changes nil))) 886 (setq diff-unhandled-changes nil)))
888 887
889;;;; 888(defun diff-next-error (arg reset)
890;;;; The main function 889 ;; Select a window that displays the current buffer so that point
891;;;; 890 ;; movements are reflected in that window. Otherwise, the user might
891 ;; never see the hunk corresponding to the source she's jumping to.
892 (pop-to-buffer (current-buffer))
893 (if reset (goto-char (point-min)))
894 (diff-hunk-next arg)
895 (diff-goto-source))
892 896
893;;;###autoload 897;;;###autoload
894(define-derived-mode diff-mode fundamental-mode "Diff" 898(define-derived-mode diff-mode fundamental-mode "Diff"
@@ -916,6 +920,7 @@ a diff with \\[diff-reverse-direction]."
916 ;; (set (make-local-variable 'paragraph-separate) paragraph-start) 920 ;; (set (make-local-variable 'paragraph-separate) paragraph-start)
917 ;; (set (make-local-variable 'page-delimiter) "--- [^\t]+\t") 921 ;; (set (make-local-variable 'page-delimiter) "--- [^\t]+\t")
918 ;; compile support 922 ;; compile support
923 (set (make-local-variable 'next-error-function) 'diff-next-error)
919 924
920 (when (and (> (point-max) (point-min)) diff-default-read-only) 925 (when (and (> (point-max) (point-min)) diff-default-read-only)
921 (toggle-read-only t)) 926 (toggle-read-only t))
diff --git a/lisp/dired.el b/lisp/dired.el
index f562a0492eb..7440e3c3bfc 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1402,6 +1402,8 @@ Keybindings:
1402 (or switches dired-listing-switches)) 1402 (or switches dired-listing-switches))
1403 (set (make-local-variable 'font-lock-defaults) 1403 (set (make-local-variable 'font-lock-defaults)
1404 '(dired-font-lock-keywords t nil nil beginning-of-line)) 1404 '(dired-font-lock-keywords t nil nil beginning-of-line))
1405 (set (make-local-variable 'desktop-buffer-misc-data-function)
1406 'dired-desktop-buffer-misc-data)
1405 (dired-sort-other dired-actual-switches t) 1407 (dired-sort-other dired-actual-switches t)
1406 (run-mode-hooks 'dired-mode-hook) 1408 (run-mode-hooks 'dired-mode-hook)
1407 (when (featurep 'x-dnd) 1409 (when (featurep 'x-dnd)
@@ -3340,7 +3342,49 @@ Ask means pop up a menu for the user to select one of copy, move or link."
3340 (let ((local-file (x-dnd-get-local-file-uri uri))) 3342 (let ((local-file (x-dnd-get-local-file-uri uri)))
3341 (if local-file (dired-dnd-handle-local-file local-file action) 3343 (if local-file (dired-dnd-handle-local-file local-file action)
3342 nil))) 3344 nil)))
3345
3346
3347;;;; Desktop support
3348
3349(eval-when-compile (require 'desktop))
3350
3351(defun dired-desktop-buffer-misc-data (desktop-dirname)
3352 "Auxiliary information to be saved in desktop file."
3353 (cons
3354 ;; Value of `dired-directory'.
3355 (if (consp dired-directory)
3356 ;; Directory name followed by list of files.
3357 (cons (desktop-file-name (car dired-directory) desktop-dirname)
3358 (cdr dired-directory))
3359 ;; Directory name, optionally with with shell wildcard.
3360 (desktop-file-name dired-directory desktop-dirname))
3361 ;; Subdirectories in `dired-subdir-alist'.
3362 (cdr
3363 (nreverse
3364 (mapcar
3365 (function (lambda (f) (desktop-file-name (car f) desktop-dirname)))
3366 dired-subdir-alist)))))
3343 3367
3368;;;###autoload
3369(defun dired-restore-desktop-buffer (desktop-buffer-file-name
3370 desktop-buffer-name
3371 desktop-buffer-misc)
3372 "Restore a dired buffer specified in a desktop file."
3373 ;; First element of `desktop-buffer-misc' is the value of `dired-directory'.
3374 ;; This value is a directory name, optionally with with shell wildcard or
3375 ;; a directory name followed by list of files.
3376 (let* ((dired-dir (car desktop-buffer-misc))
3377 (dir (if (consp dired-dir) (car dired-dir) dired-dir)))
3378 (if (file-directory-p (file-name-directory dir))
3379 (progn
3380 (dired dired-dir)
3381 ;; The following elements of `desktop-buffer-misc' are the keys
3382 ;; from `dired-subdir-alist'.
3383 (mapcar 'dired-maybe-insert-subdir (cdr desktop-buffer-misc))
3384 (current-buffer))
3385 (message "Desktop: Directory %s no longer exists." dir)
3386 (when desktop-missing-file-warning (sit-for 1))
3387 nil)))
3344 3388
3345 3389
3346(if (eq system-type 'vax-vms) 3390(if (eq system-type 'vax-vms)
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index 9956d5003cc..4ed47129fc9 100644
--- a/lisp/emacs-lisp/byte-run.el
+++ b/lisp/emacs-lisp/byte-run.el
@@ -134,11 +134,10 @@ The result of the body appears to the compiler as a quoted constant."
134 ;; Remember, it's magic. 134 ;; Remember, it's magic.
135 (cons 'progn body)) 135 (cons 'progn body))
136 136
137(defun with-no-warnings (&optional first &rest body) 137(defun with-no-warnings (&rest body)
138 "Like `progn', but prevents compiler warnings in the body." 138 "Like `progn', but prevents compiler warnings in the body."
139 ;; The implementation for the interpreter is basically trivial. 139 ;; The implementation for the interpreter is basically trivial.
140 (if body (car (last body)) 140 (car (last body)))
141 first))
142 141
143 142
144;;; I nuked this because it's not a good idea for users to think of using it. 143;;; I nuked this because it's not a good idea for users to think of using it.
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 43e0732104f..f6e2946aa8b 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -3716,7 +3716,7 @@ being undefined will be suppressed."
3716(byte-defop-compiler-1 with-no-warnings byte-compile-no-warnings) 3716(byte-defop-compiler-1 with-no-warnings byte-compile-no-warnings)
3717(defun byte-compile-no-warnings (form) 3717(defun byte-compile-no-warnings (form)
3718 (let (byte-compile-warnings) 3718 (let (byte-compile-warnings)
3719 (byte-compile-form (cadr form)))) 3719 (byte-compile-form (cons 'progn (cdr form)))))
3720 3720
3721;;; tags 3721;;; tags
3722 3722
@@ -3991,7 +3991,7 @@ already up-to-date."
3991 nil)))) 3991 nil))))
3992 3992
3993;;;###autoload 3993;;;###autoload
3994(defun batch-byte-recompile-directory () 3994(defun batch-byte-recompile-directory (&optional arg)
3995 "Run `byte-recompile-directory' on the dirs remaining on the command line. 3995 "Run `byte-recompile-directory' on the dirs remaining on the command line.
3996Must be used only with `-batch', and kills Emacs on completion. 3996Must be used only with `-batch', and kills Emacs on completion.
3997For example, invoke `emacs -batch -f batch-byte-recompile-directory .'." 3997For example, invoke `emacs -batch -f batch-byte-recompile-directory .'."
@@ -4002,7 +4002,7 @@ For example, invoke `emacs -batch -f batch-byte-recompile-directory .'."
4002 (or command-line-args-left 4002 (or command-line-args-left
4003 (setq command-line-args-left '("."))) 4003 (setq command-line-args-left '(".")))
4004 (while command-line-args-left 4004 (while command-line-args-left
4005 (byte-recompile-directory (car command-line-args-left)) 4005 (byte-recompile-directory (car command-line-args-left) arg)
4006 (setq command-line-args-left (cdr command-line-args-left))) 4006 (setq command-line-args-left (cdr command-line-args-left)))
4007 (kill-emacs 0)) 4007 (kill-emacs 0))
4008 4008
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el
index fddab94dfd4..a4e08ef7970 100644
--- a/lisp/emacs-lisp/checkdoc.el
+++ b/lisp/emacs-lisp/checkdoc.el
@@ -2604,18 +2604,13 @@ This function will not modify `match-data'."
2604(defun checkdoc-output-mode () 2604(defun checkdoc-output-mode ()
2605 "Create and setup the buffer used to maintain checkdoc warnings. 2605 "Create and setup the buffer used to maintain checkdoc warnings.
2606\\<checkdoc-output-mode-map>\\[checkdoc-find-error] - Go to this error location." 2606\\<checkdoc-output-mode-map>\\[checkdoc-find-error] - Go to this error location."
2607 (if (get-buffer checkdoc-diagnostic-buffer) 2607 (kill-all-local-variables)
2608 (get-buffer checkdoc-diagnostic-buffer) 2608 (setq mode-name "Checkdoc"
2609 (save-excursion 2609 major-mode 'checkdoc-output-mode)
2610 (set-buffer (get-buffer-create checkdoc-diagnostic-buffer)) 2610 (set (make-local-variable 'font-lock-defaults)
2611 (kill-all-local-variables) 2611 '((checkdoc-output-font-lock-keywords) t t ((?- . "w") (?_ . "w"))))
2612 (setq mode-name "Checkdoc" 2612 (use-local-map checkdoc-output-mode-map)
2613 major-mode 'checkdoc-output-mode) 2613 (run-mode-hooks 'checkdoc-output-mode-hook))
2614 (set (make-local-variable 'font-lock-defaults)
2615 '((checkdoc-output-font-lock-keywords) t t ((?- . "w") (?_ . "w"))))
2616 (use-local-map checkdoc-output-mode-map)
2617 (run-hooks 'checkdoc-output-mode-hook)
2618 (current-buffer))))
2619 2614
2620(defalias 'checkdoc-find-error-mouse 'checkdoc-find-error) 2615(defalias 'checkdoc-find-error-mouse 'checkdoc-find-error)
2621(defun checkdoc-find-error (&optional event) 2616(defun checkdoc-find-error (&optional event)
@@ -2634,31 +2629,31 @@ This function will not modify `match-data'."
2634(defun checkdoc-buffer-label () 2629(defun checkdoc-buffer-label ()
2635 "The name to use for a checkdoc buffer in the error list." 2630 "The name to use for a checkdoc buffer in the error list."
2636 (if (buffer-file-name) 2631 (if (buffer-file-name)
2637 (file-name-nondirectory (buffer-file-name)) 2632 (file-relative-name (buffer-file-name))
2638 (concat "#<buffer "(buffer-name) ">"))) 2633 (concat "#<buffer "(buffer-name) ">")))
2639 2634
2640(defun checkdoc-start-section (check-type) 2635(defun checkdoc-start-section (check-type)
2641 "Initialize the checkdoc diagnostic buffer for a pass. 2636 "Initialize the checkdoc diagnostic buffer for a pass.
2642Create the header so that the string CHECK-TYPE is displayed as the 2637Create the header so that the string CHECK-TYPE is displayed as the
2643function called to create the messages." 2638function called to create the messages."
2644 (checkdoc-output-to-error-buffer 2639 (let ((dir default-directory)
2645 "\n\n\C-l\n*** " 2640 (label (checkdoc-buffer-label)))
2646 (checkdoc-buffer-label) ": " check-type " V " checkdoc-version)) 2641 (with-current-buffer (get-buffer-create checkdoc-diagnostic-buffer)
2642 (checkdoc-output-mode)
2643 (setq default-directory dir)
2644 (goto-char (point-max))
2645 (insert "\n\n\C-l\n*** " label ": " check-type " V " checkdoc-version))))
2647 2646
2648(defun checkdoc-error (point msg) 2647(defun checkdoc-error (point msg)
2649 "Store POINT and MSG as errors in the checkdoc diagnostic buffer." 2648 "Store POINT and MSG as errors in the checkdoc diagnostic buffer."
2650 (setq checkdoc-pending-errors t) 2649 (setq checkdoc-pending-errors t)
2651 (checkdoc-output-to-error-buffer 2650 (let ((text (list "\n" (checkdoc-buffer-label) ":"
2652 "\n" (checkdoc-buffer-label) ":" 2651 (int-to-string
2653 (int-to-string (count-lines (point-min) (or point (point-min)))) ": " 2652 (count-lines (point-min) (or point (point-min))))
2654 msg)) 2653 ": " msg)))
2655 2654 (with-current-buffer (get-buffer checkdoc-diagnostic-buffer)
2656(defun checkdoc-output-to-error-buffer (&rest text) 2655 (goto-char (point-max))
2657 "Place TEXT into the checkdoc diagnostic buffer." 2656 (apply 'insert text))))
2658 (save-excursion
2659 (set-buffer (checkdoc-output-mode))
2660 (goto-char (point-max))
2661 (apply 'insert text)))
2662 2657
2663(defun checkdoc-show-diagnostics () 2658(defun checkdoc-show-diagnostics ()
2664 "Display the checkdoc diagnostic buffer in a temporary window." 2659 "Display the checkdoc diagnostic buffer in a temporary window."
diff --git a/lisp/emacs-lisp/disass.el b/lisp/emacs-lisp/disass.el
index d8890bd0239..ed632b14cd4 100644
--- a/lisp/emacs-lisp/disass.el
+++ b/lisp/emacs-lisp/disass.el
@@ -4,7 +4,7 @@
4 4
5;; Author: Doug Cutting <doug@csli.stanford.edu> 5;; Author: Doug Cutting <doug@csli.stanford.edu>
6;; Jamie Zawinski <jwz@lucid.com> 6;; Jamie Zawinski <jwz@lucid.com>
7;; Maintainer: Jamie Zawinski <jwz@lucid.com> 7;; Maintainer: FSF
8;; Keywords: internal 8;; Keywords: internal
9 9
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
@@ -57,7 +57,7 @@ redefine OBJECT if it is a symbol."
57 (interactive (list (intern (completing-read "Disassemble function: " 57 (interactive (list (intern (completing-read "Disassemble function: "
58 obarray 'fboundp t)) 58 obarray 'fboundp t))
59 nil 0 t)) 59 nil 0 t))
60 (if (consp object) 60 (if (and (consp object) (not (eq (car object) 'lambda)))
61 (setq object (list 'lambda () object))) 61 (setq object (list 'lambda () object)))
62 (or indent (setq indent 0)) ;Default indent to zero 62 (or indent (setq indent 0)) ;Default indent to zero
63 (save-excursion 63 (save-excursion
diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el
index 88f7657b6bf..dbd7194f50a 100644
--- a/lisp/emacs-lisp/easymenu.el
+++ b/lisp/emacs-lisp/easymenu.el
@@ -478,8 +478,8 @@ Do it only if `easy-menu-precalculate-equivalent-keybindings' is on."
478 (when easy-menu-precalculate-equivalent-keybindings 478 (when easy-menu-precalculate-equivalent-keybindings
479 (if (and (symbolp menu) (not (keymapp menu)) (boundp menu)) 479 (if (and (symbolp menu) (not (keymapp menu)) (boundp menu))
480 (setq menu (symbol-value menu))) 480 (setq menu (symbol-value menu)))
481 ;; x-popup-menu does not exist on tty-only Emacs. 481 (and (keymapp menu) (fboundp 'x-popup-menu)
482 ;; (if (keymapp menu) (x-popup-menu nil menu)) 482 (x-popup-menu nil menu))
483 )) 483 ))
484 484
485(defun add-submenu (menu-path submenu &optional before in-menu) 485(defun add-submenu (menu-path submenu &optional before in-menu)
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index 11d9ba756f1..044c414d84e 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -1562,17 +1562,17 @@ Sets various variables using `font-lock-defaults' (or, if nil, using
1562 (:foreground "DimGray" :weight bold :slant italic)) 1562 (:foreground "DimGray" :weight bold :slant italic))
1563 (((class grayscale) (background dark)) 1563 (((class grayscale) (background dark))
1564 (:foreground "LightGray" :weight bold :slant italic)) 1564 (:foreground "LightGray" :weight bold :slant italic))
1565 (((class color) (min-colors 88) (background light)) 1565 (((class color) (min-colors 88) (background light))
1566 (:foreground "Firebrick")) 1566 (:foreground "Firebrick"))
1567 (((class color) (min-colors 88) (background dark)) 1567 (((class color) (min-colors 88) (background dark))
1568 (:foreground "chocolate1")) 1568 (:foreground "chocolate1"))
1569 (((class color) (min-colors 16) (background light)) 1569 (((class color) (min-colors 16) (background light))
1570 (:foreground "red")) 1570 (:foreground "red"))
1571 (((class color) (min-colors 16) (background dark)) 1571 (((class color) (min-colors 16) (background dark))
1572 (:foreground "red1")) 1572 (:foreground "red1"))
1573 (((class color) (min-colors 8) (background light)) 1573 (((class color) (min-colors 8) (background light))
1574 (:foreground "red")) 1574 (:foreground "red"))
1575 (((class color) (min-colors 8) (background dark)) 1575 (((class color) (min-colors 8) (background dark))
1576 (:foreground "red1")) 1576 (:foreground "red1"))
1577 (t (:weight bold :slant italic))) 1577 (t (:weight bold :slant italic)))
1578 "Font Lock mode face used to highlight comments." 1578 "Font Lock mode face used to highlight comments."
@@ -1673,13 +1673,14 @@ Sets various variables using `font-lock-defaults' (or, if nil, using
1673 '((((class color) (min-colors 88) (background light)) (:foreground "Red" :weight bold)) 1673 '((((class color) (min-colors 88) (background light)) (:foreground "Red" :weight bold))
1674 (((class color) (min-colors 88) (background dark)) (:foreground "Pink" :weight bold)) 1674 (((class color) (min-colors 88) (background dark)) (:foreground "Pink" :weight bold))
1675 (((class color) (min-colors 16) (background light)) (:foreground "Red" :weight bold)) 1675 (((class color) (min-colors 16) (background light)) (:foreground "Red" :weight bold))
1676 (((class color) (min-colors 16) (background dark)) (:foreground "Pink" :weight bold)) (((class color) (min-colors 8)) (:foreground "red")) 1676 (((class color) (min-colors 16) (background dark)) (:foreground "Pink" :weight bold))
1677 (((class color) (min-colors 8)) (:foreground "red"))
1677 (t (:inverse-video t :weight bold))) 1678 (t (:inverse-video t :weight bold)))
1678 "Font Lock mode face used to highlight warnings." 1679 "Font Lock mode face used to highlight warnings."
1679 :group 'font-lock-highlighting-faces) 1680 :group 'font-lock-highlighting-faces)
1680 1681
1681(defface font-lock-preprocessor-face 1682(defface font-lock-preprocessor-face
1682 '((t :inherit 'font-lock-builtin-face)) 1683 '((t :inherit font-lock-builtin-face))
1683 "Font Lock mode face used to highlight preprocessor directives." 1684 "Font Lock mode face used to highlight preprocessor directives."
1684 :group 'font-lock-highlighting-faces) 1685 :group 'font-lock-highlighting-faces)
1685 1686
diff --git a/lisp/frame.el b/lisp/frame.el
index 2be0f6417ff..d8ddfa67862 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -1,6 +1,6 @@
1;;; frame.el --- multi-frame management independent of window systems 1;;; frame.el --- multi-frame management independent of window systems
2 2
3;; Copyright (C) 1993, 1994, 1996, 1997, 2000, 2001, 2003 3;; Copyright (C) 1993, 1994, 1996, 1997, 2000, 2001, 2003, 2004
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Maintainer: FSF 6;; Maintainer: FSF
@@ -131,7 +131,7 @@ use (car ARGS) as a function to do the work.
131Pass it BUFFER as first arg, and (cdr ARGS) gives the rest of the args." 131Pass it BUFFER as first arg, and (cdr ARGS) gives the rest of the args."
132 (if (and args (symbolp (car args))) 132 (if (and args (symbolp (car args)))
133 (apply (car args) buffer (cdr args)) 133 (apply (car args) buffer (cdr args))
134 (let ((window (get-buffer-window buffer t))) 134 (let ((window (get-buffer-window buffer 0)))
135 (or 135 (or
136 ;; If we have a window already, make it visible. 136 ;; If we have a window already, make it visible.
137 (when window 137 (when window
@@ -149,6 +149,7 @@ Pass it BUFFER as first arg, and (cdr ARGS) gives the rest of the args."
149 (let* ((pop-up-frames nil) (pop-up-windows t) 149 (let* ((pop-up-frames nil) (pop-up-windows t)
150 special-display-regexps special-display-buffer-names 150 special-display-regexps special-display-buffer-names
151 (window (display-buffer buffer))) 151 (window (display-buffer buffer)))
152 ;; Only do it if this is a new window:
152 ;; (set-window-dedicated-p window t) 153 ;; (set-window-dedicated-p window t)
153 window)) 154 window))
154 ;; If no window yet, make one in a new frame. 155 ;; If no window yet, make one in a new frame.
@@ -564,7 +565,7 @@ is not considered (see `next-frame')."
564 (interactive) 565 (interactive)
565 (select-window (next-window (selected-window) 566 (select-window (next-window (selected-window)
566 (> (minibuffer-depth) 0) 567 (> (minibuffer-depth) 0)
567 t)) 568 0))
568 (select-frame-set-input-focus (selected-frame))) 569 (select-frame-set-input-focus (selected-frame)))
569 570
570(defun previous-multiframe-window () 571(defun previous-multiframe-window ()
@@ -572,7 +573,7 @@ is not considered (see `next-frame')."
572 (interactive) 573 (interactive)
573 (select-window (previous-window (selected-window) 574 (select-window (previous-window (selected-window)
574 (> (minibuffer-depth) 0) 575 (> (minibuffer-depth) 0)
575 t)) 576 0))
576 (select-frame-set-input-focus (selected-frame))) 577 (select-frame-set-input-focus (selected-frame)))
577 578
578(defun make-frame-on-display (display &optional parameters) 579(defun make-frame-on-display (display &optional parameters)
diff --git a/lisp/gnus/mailcap.el b/lisp/gnus/mailcap.el
index 1663bd3f5f8..6d35e2196ae 100644
--- a/lisp/gnus/mailcap.el
+++ b/lisp/gnus/mailcap.el
@@ -271,6 +271,7 @@ validity. Otherwise, if it is a non-function Lisp symbol or list
271whose car is a symbol, it is `eval'led to yield the validity. If it 271whose car is a symbol, it is `eval'led to yield the validity. If it
272is a string or list of strings, it represents a shell command to run 272is a string or list of strings, it represents a shell command to run
273to return a true or false shell value for the validity.") 273to return a true or false shell value for the validity.")
274(put 'mailcap-mime-data 'risky-local-variable t)
274 275
275(defcustom mailcap-download-directory nil 276(defcustom mailcap-download-directory nil
276 "*Directory to which `mailcap-save-binary-file' downloads files by default. 277 "*Directory to which `mailcap-save-binary-file' downloads files by default.
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index ab76b5eb232..6a71a544638 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -63,6 +63,7 @@ With ARG, you are asked to choose which language."
63 (setq default-directory (expand-file-name "~/")) 63 (setq default-directory (expand-file-name "~/"))
64 (setq buffer-auto-save-file-name nil) 64 (setq buffer-auto-save-file-name nil)
65 (insert-file-contents (expand-file-name filename data-directory)) 65 (insert-file-contents (expand-file-name filename data-directory))
66 (hack-local-variables)
66 (goto-char (point-min)) 67 (goto-char (point-min))
67 (search-forward "\n<<") 68 (search-forward "\n<<")
68 (beginning-of-line) 69 (beginning-of-line)
@@ -354,16 +355,31 @@ KIND should be `var' for a variable or `subr' for a subroutine."
354 (when (commandp function) 355 (when (commandp function)
355 (let* ((remapped (command-remapping function)) 356 (let* ((remapped (command-remapping function))
356 (keys (where-is-internal 357 (keys (where-is-internal
357 (or remapped function) overriding-local-map nil nil))) 358 (or remapped function) overriding-local-map nil nil))
359 non-modified-keys)
360 ;; Which non-control non-meta keys run this command?
361 (dolist (key keys)
362 (if (member (event-modifiers (aref key 0)) '(nil (shift)))
363 (push key non-modified-keys)))
358 (when remapped 364 (when remapped
359 (princ "It is remapped to `") 365 (princ "It is remapped to `")
360 (princ (symbol-name remapped)) 366 (princ (symbol-name remapped))
361 (princ "'")) 367 (princ "'"))
368
362 (when keys 369 (when keys
363 (princ (if remapped " which is bound to " "It is bound to ")) 370 (princ (if remapped " which is bound to " "It is bound to "))
364 ;; FIXME: This list can be very long (f.ex. for self-insert-command). 371 ;; FIXME: This list can be very long (f.ex. for self-insert-command).
365 (princ (mapconcat 'key-description keys ", "))) 372 ;; If there are many, remove them from KEYS.
366 (when (or remapped keys) 373 (if (< (length non-modified-keys) 10)
374 (princ (mapconcat 'key-description keys ", "))
375 (dolist (key non-modified-keys)
376 (setq keys (delq key keys)))
377 (if keys
378 (progn
379 (princ (mapconcat 'key-description keys ", "))
380 (princ ", and many ordinary text characters"))
381 (princ "many ordinary text characters"))))
382 (when (or remapped keys non-modified-keys)
367 (princ ".") 383 (princ ".")
368 (terpri)))) 384 (terpri))))
369 (let* ((arglist (help-function-arglist def)) 385 (let* ((arglist (help-function-arglist def))
diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index 149eebb3d36..4499f5c48cb 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -195,14 +195,17 @@ Commands:
195 195
196;;;###autoload 196;;;###autoload
197(defun help-mode-finish () 197(defun help-mode-finish ()
198 (let ((entry (assq (selected-window) view-return-to-alist)))
199 (if entry (setcdr entry (cons (selected-window)
200 help-return-method))
201 (setq view-return-to-alist
202 (cons (cons (selected-window) help-return-method)
203 view-return-to-alist))))
198 (when (eq major-mode 'help-mode) 204 (when (eq major-mode 'help-mode)
199 ;; View mode's read-only status of existing *Help* buffer is lost 205 ;; View mode's read-only status of existing *Help* buffer is lost
200 ;; by with-output-to-temp-buffer. 206 ;; by with-output-to-temp-buffer.
201 (toggle-read-only 1) 207 (toggle-read-only 1)
202 (help-make-xrefs (current-buffer))) 208 (help-make-xrefs (current-buffer))))
203 (setq view-return-to-alist
204 (list (cons (selected-window) help-return-method))))
205
206 209
207;; Grokking cross-reference information in doc strings and 210;; Grokking cross-reference information in doc strings and
208;; hyperlinking it. 211;; hyperlinking it.
diff --git a/lisp/image.el b/lisp/image.el
index 0e71bd4a349..9d656794aa9 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -176,7 +176,7 @@ means display it in the right marginal area."
176 176
177 177
178;;;###autoload 178;;;###autoload
179(defun insert-image (image &optional string area) 179(defun insert-image (image &optional string area slice)
180 "Insert IMAGE into current buffer at point. 180 "Insert IMAGE into current buffer at point.
181IMAGE is displayed by inserting STRING into the current buffer 181IMAGE is displayed by inserting STRING into the current buffer
182with a `display' property whose value is the image. STRING is 182with a `display' property whose value is the image. STRING is
@@ -184,7 +184,12 @@ defaulted if you omit it.
184AREA is where to display the image. AREA nil or omitted means 184AREA is where to display the image. AREA nil or omitted means
185display it in the text area, a value of `left-margin' means 185display it in the text area, a value of `left-margin' means
186display it in the left marginal area, a value of `right-margin' 186display it in the left marginal area, a value of `right-margin'
187means display it in the right marginal area." 187means display it in the right marginal area.
188SLICE specifies slice of IMAGE to insert. SLICE nil or omitted
189means insert whole image. SLICE is a list (X Y WIDTH HEIGHT)
190specifying the X and Y positions and WIDTH and HEIGHT of image area
191to insert. A float value 0.0 - 1.0 means relative to the width or
192height of the image; integer values are taken as pixel values."
188 ;; Use a space as least likely to cause trouble when it's a hidden 193 ;; Use a space as least likely to cause trouble when it's a hidden
189 ;; character in the buffer. 194 ;; character in the buffer.
190 (unless string (setq string " ")) 195 (unless string (setq string " "))
@@ -204,7 +209,40 @@ means display it in the right marginal area."
204 (let ((start (point))) 209 (let ((start (point)))
205 (insert string) 210 (insert string)
206 (add-text-properties start (point) 211 (add-text-properties start (point)
207 `(display ,image rear-nonsticky (display))))) 212 `(display ,(if slice
213 (list (cons 'slice slice) image)
214 image) rear-nonsticky (display)))))
215
216
217(defun insert-sliced-image (image &optional string area rows cols)
218 (unless string (setq string " "))
219 (unless (eq (car-safe image) 'image)
220 (error "Not an image: %s" image))
221 (unless (or (null area) (memq area '(left-margin right-margin)))
222 (error "Invalid area %s" area))
223 (if area
224 (setq image (list (list 'margin area) image))
225 ;; Cons up a new spec equal but not eq to `image' so that
226 ;; inserting it twice in a row (adjacently) displays two copies of
227 ;; the image. Don't try to avoid this by looking at the display
228 ;; properties on either side so that we DTRT more often with
229 ;; cut-and-paste. (Yanking killed image text next to another copy
230 ;; of it loses anyway.)
231 (setq image (cons 'image (cdr image))))
232 (let ((x 0.0) (dx (/ 1.0001 (or cols 1)))
233 (y 0.0) (dy (/ 1.0001 (or rows 1))))
234 (while (< y 1.0)
235 (while (< x 1.0)
236 (let ((start (point)))
237 (insert string)
238 (add-text-properties start (point)
239 `(display ,(list (list 'slice x y dx dy) image)
240 rear-nonsticky (display)))
241 (setq x (+ x dx))))
242 (setq x 0.0
243 y (+ y dy))
244 (insert "\n"))))
245
208 246
209 247
210;;;###autoload 248;;;###autoload
diff --git a/lisp/info.el b/lisp/info.el
index 5fd9af31202..a284ca7fa2e 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -66,29 +66,29 @@ The Lisp code is executed when the node is selected.")
66(put 'Info-enable-active-nodes 'risky-local-variable t) 66(put 'Info-enable-active-nodes 'risky-local-variable t)
67 67
68(defface info-node 68(defface info-node
69 '((((class color) (background light)) (:foreground "brown" :weight bold :slant italic)) 69 '((((class color) (background light)) :foreground "brown" :weight bold :slant italic)
70 (((class color) (background dark)) (:foreground "white" :weight bold :slant italic)) 70 (((class color) (background dark)) :foreground "white" :weight bold :slant italic)
71 (t (:weight bold :slant italic))) 71 (t :weight bold :slant italic))
72 "Face for Info node names." 72 "Face for Info node names."
73 :group 'info) 73 :group 'info)
74 74
75(defface info-menu-5 75(defface info-menu-5
76 '((((class color)) (:foreground "red1")) 76 '((((class color)) :foreground "red1")
77 (t (:underline t))) 77 (t :underline t))
78 "Face for every third `*' in an Info menu." 78 "Face for every third `*' in an Info menu."
79 :group 'info) 79 :group 'info)
80 80
81(defface info-xref 81(defface info-xref
82 '((((class color) (background light)) (:foreground "blue")) 82 '((((class color) (background light)) :foreground "blue")
83 (((class color) (background dark)) (:foreground "cyan")) 83 (((class color) (background dark)) :foreground "cyan")
84 (t (:underline t))) 84 (t :underline t))
85 "Face for Info cross-references." 85 "Face for Info cross-references."
86 :group 'info) 86 :group 'info)
87 87
88(defface info-xref-visited 88(defface info-xref-visited
89 '((((class color) (background light)) (:foreground "magenta4")) 89 '((t :inherit info-xref)
90 (((class color) (background dark)) (:foreground "magenta4")) 90 (((class color) (background light)) :foreground "magenta4")
91 (t (:underline t))) 91 (((class color) (background dark)) :foreground "magenta4"))
92 "Face for visited Info cross-references." 92 "Face for visited Info cross-references."
93 :group 'info) 93 :group 'info)
94 94
@@ -110,12 +110,12 @@ A header-line does not scroll with the rest of the buffer."
110 :group 'info) 110 :group 'info)
111 111
112(defface info-header-xref 112(defface info-header-xref
113 '((t (:inherit info-xref))) 113 '((t :inherit info-xref))
114 "Face for Info cross-references in a node header." 114 "Face for Info cross-references in a node header."
115 :group 'info) 115 :group 'info)
116 116
117(defface info-header-node 117(defface info-header-node
118 '((t (:inherit info-node))) 118 '((t :inherit info-node))
119 "Face for Info nodes in a node header." 119 "Face for Info nodes in a node header."
120 :group 'info) 120 :group 'info)
121 121
@@ -2907,6 +2907,8 @@ Advanced commands:
2907 ;; This is for the sake of the invisible text we use handling titles. 2907 ;; This is for the sake of the invisible text we use handling titles.
2908 (make-local-variable 'line-move-ignore-invisible) 2908 (make-local-variable 'line-move-ignore-invisible)
2909 (setq line-move-ignore-invisible t) 2909 (setq line-move-ignore-invisible t)
2910 (make-local-variable 'desktop-buffer-misc-data-function)
2911 (setq desktop-buffer-misc-data-function 'Info-desktop-buffer-misc-data)
2910 (add-hook 'clone-buffer-hook 'Info-clone-buffer-hook nil t) 2912 (add-hook 'clone-buffer-hook 'Info-clone-buffer-hook nil t)
2911 (add-hook 'change-major-mode-hook 'font-lock-defontify nil t) 2913 (add-hook 'change-major-mode-hook 'font-lock-defontify nil t)
2912 (Info-set-mode-line) 2914 (Info-set-mode-line)
@@ -3111,26 +3113,26 @@ the variable `Info-file-list-for-emacs'."
3111 (Info-goto-emacs-command-node command))))) 3113 (Info-goto-emacs-command-node command)))))
3112 3114
3113(defface Info-title-1-face 3115(defface Info-title-1-face
3114 '((((type tty pc) (class color)) (:foreground "yellow" :weight bold)) 3116 '((((type tty pc) (class color)) :foreground "yellow" :weight bold)
3115 (t (:height 1.2 :inherit Info-title-2-face))) 3117 (t :height 1.2 :inherit Info-title-2-face))
3116 "Face for Info titles at level 1." 3118 "Face for Info titles at level 1."
3117 :group 'info) 3119 :group 'info)
3118 3120
3119(defface Info-title-2-face 3121(defface Info-title-2-face
3120 '((((type tty pc) (class color)) (:foreground "lightblue" :weight bold)) 3122 '((((type tty pc) (class color)) :foreground "lightblue" :weight bold)
3121 (t (:height 1.2 :inherit Info-title-3-face))) 3123 (t :height 1.2 :inherit Info-title-3-face))
3122 "Face for Info titles at level 2." 3124 "Face for Info titles at level 2."
3123 :group 'info) 3125 :group 'info)
3124 3126
3125(defface Info-title-3-face 3127(defface Info-title-3-face
3126 '((((type tty pc) (class color)) (:weight bold)) 3128 '((((type tty pc) (class color)) :weight bold)
3127 (t (:height 1.2 :inherit Info-title-4-face))) 3129 (t :height 1.2 :inherit Info-title-4-face))
3128 "Face for Info titles at level 3." 3130 "Face for Info titles at level 3."
3129 :group 'info) 3131 :group 'info)
3130 3132
3131(defface Info-title-4-face 3133(defface Info-title-4-face
3132 '((((type tty pc) (class color)) (:weight bold)) 3134 '((((type tty pc) (class color)) :weight bold)
3133 (t (:weight bold :inherit variable-pitch))) 3135 (t :weight bold :inherit variable-pitch))
3134 "Face for Info titles at level 4." 3136 "Face for Info titles at level 4."
3135 :group 'info) 3137 :group 'info)
3136 3138
@@ -3708,6 +3710,23 @@ BUFFER is the buffer speedbar is requesting buttons for."
3708 "^No \".*\" in index$")) 3710 "^No \".*\" in index$"))
3709 (add-to-list 'debug-ignored-errors mess)) 3711 (add-to-list 'debug-ignored-errors mess))
3710 3712
3713;;;; Desktop support
3714
3715(defun Info-desktop-buffer-misc-data (desktop-dirname)
3716 "Auxiliary information to be saved in desktop file."
3717 (list Info-current-file Info-current-node))
3718
3719;;;###autoload
3720(defun Info-restore-desktop-buffer (desktop-buffer-file-name
3721 desktop-buffer-name
3722 desktop-buffer-misc)
3723 "Restore an info buffer specified in a desktop file."
3724 (let ((first (nth 0 desktop-buffer-misc))
3725 (second (nth 1 desktop-buffer-misc)))
3726 (when (and first second)
3727 (Info-find-node first second)
3728 (current-buffer))))
3729
3711(provide 'info) 3730(provide 'info)
3712 3731
3713;;; arch-tag: f2480fe2-2139-40c1-a49b-6314991164ac 3732;;; arch-tag: f2480fe2-2139-40c1-a49b-6314991164ac
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 65e9fcab362..0b7aa54a288 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -1054,7 +1054,7 @@ For a list of useful values for KEY and their meanings,
1054see `language-info-alist'." 1054see `language-info-alist'."
1055 (if (symbolp lang-env) 1055 (if (symbolp lang-env)
1056 (setq lang-env (symbol-name lang-env))) 1056 (setq lang-env (symbol-name lang-env)))
1057 (let ((lang-slot (assoc-ignore-case lang-env language-info-alist))) 1057 (let ((lang-slot (assoc-string lang-env language-info-alist t)))
1058 (if lang-slot 1058 (if lang-slot
1059 (cdr (assq key (cdr lang-slot)))))) 1059 (cdr (assq key (cdr lang-slot))))))
1060 1060
@@ -1597,11 +1597,11 @@ to using the function `set-language-environment'."
1597 :link '(custom-manual "(emacs)Language Environments") 1597 :link '(custom-manual "(emacs)Language Environments")
1598 :set (lambda (symbol value) (set-language-environment value)) 1598 :set (lambda (symbol value) (set-language-environment value))
1599 :get (lambda (x) 1599 :get (lambda (x)
1600 (or (car-safe (assoc-ignore-case 1600 (or (car-safe (assoc-string
1601 (if (symbolp current-language-environment) 1601 (if (symbolp current-language-environment)
1602 (symbol-name current-language-environment) 1602 (symbol-name current-language-environment)
1603 current-language-environment) 1603 current-language-environment)
1604 language-info-alist)) 1604 language-info-alist t))
1605 "English")) 1605 "English"))
1606 ;; custom type will be updated with `set-language-info'. 1606 ;; custom type will be updated with `set-language-info'.
1607 :type (if language-info-alist 1607 :type (if language-info-alist
@@ -1749,7 +1749,7 @@ specifies the character set for the major languages of Western Europe."
1749 (if (symbolp language-name) 1749 (if (symbolp language-name)
1750 (setq language-name (symbol-name language-name))) 1750 (setq language-name (symbol-name language-name)))
1751 (setq language-name "English")) 1751 (setq language-name "English"))
1752 (let ((slot (assoc-ignore-case language-name language-info-alist))) 1752 (let ((slot (assoc-string language-name language-info-alist t)))
1753 (unless slot 1753 (unless slot
1754 (error "Language environment not defined: %S" language-name)) 1754 (error "Language environment not defined: %S" language-name))
1755 (setq language-name (car slot))) 1755 (setq language-name (car slot)))
@@ -2282,7 +2282,7 @@ matches are looked for in the coding system list, treating case and
2282the characters `-' and `_' as insignificant. The coding system base 2282the characters `-' and `_' as insignificant. The coding system base
2283is returned. Thus, for instance, if charset \"ISO8859-2\", 2283is returned. Thus, for instance, if charset \"ISO8859-2\",
2284`iso-latin-2' is returned." 2284`iso-latin-2' is returned."
2285 (or (car (assoc-ignore-case charset locale-charset-alist)) 2285 (or (car (assoc-string charset locale-charset-alist t))
2286 (let ((cs coding-system-alist) 2286 (let ((cs coding-system-alist)
2287 c) 2287 c)
2288 (while (and (not c) cs) 2288 (while (and (not c) cs)
diff --git a/lisp/international/mule-util.el b/lisp/international/mule-util.el
index 3a3539359ec..1d1fe539116 100644
--- a/lisp/international/mule-util.el
+++ b/lisp/international/mule-util.el
@@ -373,27 +373,7 @@ basis, this may not be accurate."
373 ;; On a window system, a character is displayable if we have 373 ;; On a window system, a character is displayable if we have
374 ;; a font for that character in the default face of the 374 ;; a font for that character in the default face of the
375 ;; currently selected frame. 375 ;; currently selected frame.
376 (let ((fontset (frame-parameter (selected-frame) 'font)) 376 (car (internal-char-font nil char)))
377 font-pattern)
378 (if (query-fontset fontset)
379 (setq font-pattern (fontset-font fontset char)))
380 (or font-pattern
381 (setq font-pattern (fontset-font "fontset-default" char)))
382 (if font-pattern
383 (progn
384 ;; Now FONT-PATTERN is a string or a cons of family
385 ;; field pattern and registry field pattern.
386 (or (stringp font-pattern)
387 (let ((family (or (car font-pattern) "*"))
388 (registry (or (cdr font-pattern) "*")))
389 (or (string-match "-" family)
390 (setq family (concat "*-" family)))
391 (or (string-match "-" registry)
392 (setq registry (concat registry "-*")))
393 (setq font-pattern
394 (format "-%s-*-*-*-*-*-*-*-*-*-*-%s"
395 family registry))))
396 (x-list-fonts font-pattern 'default (selected-frame) 1)))))
397 (t 377 (t
398 (let ((coding (terminal-coding-system))) 378 (let ((coding (terminal-coding-system)))
399 (if coding 379 (if coding
diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index 8c95becaf21..de9d3ef8e2c 100644
--- a/lisp/international/mule.el
+++ b/lisp/international/mule.el
@@ -1401,9 +1401,9 @@ Each element must be one of the names listed in the variable
1401 (let* ((M (char-after (+ pos 4))) 1401 (let* ((M (char-after (+ pos 4)))
1402 (L (char-after (+ pos 5))) 1402 (L (char-after (+ pos 5)))
1403 (encoding (match-string 2)) 1403 (encoding (match-string 2))
1404 (encoding-info (assoc-ignore-case 1404 (encoding-info (assoc-string
1405 encoding 1405 encoding
1406 ctext-non-standard-encodings-alist)) 1406 ctext-non-standard-encodings-alist t))
1407 (coding (if encoding-info 1407 (coding (if encoding-info
1408 (nth 1 encoding-info) 1408 (nth 1 encoding-info)
1409 (setq encoding (intern (downcase encoding))) 1409 (setq encoding (intern (downcase encoding)))
diff --git a/lisp/international/quail.el b/lisp/international/quail.el
index 2f275a59dca..9e289c300d9 100644
--- a/lisp/international/quail.el
+++ b/lisp/international/quail.el
@@ -1218,7 +1218,7 @@ selected translation."
1218 (t 1218 (t
1219 (error "Invalid object in Quail map: %s" def)))) 1219 (error "Invalid object in Quail map: %s" def))))
1220 1220
1221(defun quail-lookup-key (key &optional len) 1221(defun quail-lookup-key (key &optional len not-reset-indices)
1222 "Lookup KEY of length LEN in the current Quail map and return the definition. 1222 "Lookup KEY of length LEN in the current Quail map and return the definition.
1223The returned value is a Quail map specific to KEY." 1223The returned value is a Quail map specific to KEY."
1224 (or len 1224 (or len
@@ -1256,7 +1256,7 @@ The returned value is a Quail map specific to KEY."
1256 (if (and (consp translation) (vectorp (cdr translation))) 1256 (if (and (consp translation) (vectorp (cdr translation)))
1257 (progn 1257 (progn
1258 (setq quail-current-translations translation) 1258 (setq quail-current-translations translation)
1259 (if (quail-forget-last-selection) 1259 (if (and (not not-reset-indices) (quail-forget-last-selection))
1260 (setcar (car quail-current-translations) 0)))))) 1260 (setcar (car quail-current-translations) 0))))))
1261 ;; We may have to reform cdr part of MAP. 1261 ;; We may have to reform cdr part of MAP.
1262 (if (and (cdr map) (functionp (cdr map))) 1262 (if (and (cdr map) (functionp (cdr map)))
@@ -1524,6 +1524,28 @@ with more keys."
1524 (let (pos) 1524 (let (pos)
1525 (quail-delete-region) 1525 (quail-delete-region)
1526 (setq pos (point)) 1526 (setq pos (point))
1527 (or enable-multibyte-characters
1528 (let (char)
1529 (if (stringp quail-current-str)
1530 (catch 'tag
1531 (mapc #'(lambda (ch)
1532 (when (/= (unibyte-char-to-multibyte
1533 (multibyte-char-to-unibyte ch))
1534 ch)
1535 (setq char ch)
1536 (throw 'tag nil)))
1537 quail-current-str))
1538 (if (/= (unibyte-char-to-multibyte
1539 (multibyte-char-to-unibyte quail-current-str))
1540 quail-current-str)
1541 (setq char quail-current-str)))
1542 (when char
1543 (message "Can't input %c in the current unibyte buffer" char)
1544 (ding)
1545 (sit-for 2)
1546 (message nil)
1547 (setq quail-current-str nil)
1548 (throw 'quail-tag nil))))
1527 (insert quail-current-str) 1549 (insert quail-current-str)
1528 (move-overlay quail-overlay pos (point)) 1550 (move-overlay quail-overlay pos (point))
1529 (if (overlayp quail-conv-overlay) 1551 (if (overlayp quail-conv-overlay)
@@ -2021,7 +2043,7 @@ minibuffer and the selected frame has no other windows)."
2021 2043
2022(defun quail-get-translations () 2044(defun quail-get-translations ()
2023 "Return a string containing the current possible translations." 2045 "Return a string containing the current possible translations."
2024 (let ((map (quail-lookup-key quail-current-key)) 2046 (let ((map (quail-lookup-key quail-current-key nil t))
2025 (str (copy-sequence quail-current-key))) 2047 (str (copy-sequence quail-current-key)))
2026 (if quail-current-translations 2048 (if quail-current-translations
2027 (quail-update-current-translations)) 2049 (quail-update-current-translations))
@@ -2092,7 +2114,7 @@ are shown (at most to the depth specified `quail-completion-max-depth')."
2092 (quail-setup-completion-buf) 2114 (quail-setup-completion-buf)
2093 (let ((win (get-buffer-window quail-completion-buf 'visible)) 2115 (let ((win (get-buffer-window quail-completion-buf 'visible))
2094 (key quail-current-key) 2116 (key quail-current-key)
2095 (map (quail-lookup-key quail-current-key)) 2117 (map (quail-lookup-key quail-current-key nil t))
2096 (require-update nil)) 2118 (require-update nil))
2097 (with-current-buffer quail-completion-buf 2119 (with-current-buffer quail-completion-buf
2098 (if (and win 2120 (if (and win
@@ -2673,7 +2695,7 @@ function `quail-install-map' (which see)."
2673 (translation-list nil) 2695 (translation-list nil)
2674 map) 2696 map)
2675 (while (> len 0) 2697 (while (> len 0)
2676 (setq map (quail-lookup-key key len) 2698 (setq map (quail-lookup-key key len t)
2677 len (1- len)) 2699 len (1- len))
2678 (if map 2700 (if map
2679 (let* ((def (quail-map-definition map)) 2701 (let* ((def (quail-map-definition map))
diff --git a/lisp/iswitchb.el b/lisp/iswitchb.el
index 4f560820b09..f3744a38337 100644
--- a/lisp/iswitchb.el
+++ b/lisp/iswitchb.el
@@ -300,9 +300,11 @@ example functions that filter buffernames."
300 300
301(defcustom iswitchb-max-to-show nil 301(defcustom iswitchb-max-to-show nil
302 "*If non-nil, limit the number of names shown in the minibuffer. 302 "*If non-nil, limit the number of names shown in the minibuffer.
303This can greatly speed up iswitchb if you have a multitude of 303If this value is N, and N is greater than the number of matching
304buffers open." 304buffers, the first N/2 and the last N/2 matching buffers are
305 :type 'integer 305shown. This can greatly speed up iswitchb if you have a
306multitude of buffers open."
307 :type '(choice (const :tag "Show all" nil) integer)
306 :group 'iswitchb) 308 :group 'iswitchb)
307 309
308(defcustom iswitchb-cannot-complete-hook 'iswitchb-completion-help 310(defcustom iswitchb-cannot-complete-hook 'iswitchb-completion-help
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index f5f6262435a..a8a78abf01b 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -3867,6 +3867,23 @@ encoded string (and the same mask) will decode the string."
3867 (setq i (1+ i))) 3867 (setq i (1+ i)))
3868 (concat string-vector))) 3868 (concat string-vector)))
3869 3869
3870;;;; Desktop support
3871
3872;;;###autoload
3873(defun rmail-restore-desktop-buffer (desktop-buffer-file-name
3874 desktop-buffer-name
3875 desktop-buffer-misc)
3876 "Restore an rmail buffer specified in a desktop file."
3877 (condition-case error
3878 (progn
3879 (rmail-input desktop-buffer-file-name)
3880 (if (eq major-mode 'rmail-mode)
3881 (current-buffer)
3882 rmail-buffer))
3883 (file-locked
3884 (kill-buffer (current-buffer))
3885 nil)))
3886
3870(provide 'rmail) 3887(provide 'rmail)
3871 3888
3872;;; arch-tag: cff0a950-57fe-4f73-a86e-91ff75afd06c 3889;;; arch-tag: cff0a950-57fe-4f73-a86e-91ff75afd06c
diff --git a/lisp/makefile.w32-in b/lisp/makefile.w32-in
index b050d78f76c..fe82e45c04f 100644
--- a/lisp/makefile.w32-in
+++ b/lisp/makefile.w32-in
@@ -1,5 +1,5 @@
1# Makefile for GNU Emacs on the Microsoft W32 API. 1# -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.
2# Copyright (c) 2000-2001 Free Software Foundation, Inc. 2# Copyright (c) 2000,2001,2004 Free Software Foundation, Inc.
3# 3#
4# This file is part of GNU Emacs. 4# This file is part of GNU Emacs.
5# 5#
@@ -161,7 +161,8 @@ WINS=\
161 progmodes \ 161 progmodes \
162 term \ 162 term \
163 textmodes \ 163 textmodes \
164 toolbar 164 toolbar \
165 url
165 166
166doit: 167doit:
167 168
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 7db5f96e6d7..e45d6926d70 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -1557,7 +1557,8 @@ Buffers menu is regenerated."
1557 1557
1558 (setq buffers-menu (cons 'keymap (cons "Select Buffer" buffers-menu))) 1558 (setq buffers-menu (cons 'keymap (cons "Select Buffer" buffers-menu)))
1559 (define-key (current-global-map) [menu-bar buffer] 1559 (define-key (current-global-map) [menu-bar buffer]
1560 (cons "Buffers" buffers-menu))))) 1560 ;; Call copy-sequence so the string is not pure.
1561 (cons (copy-sequence "Buffers") buffers-menu)))))
1561 1562
1562(add-hook 'menu-bar-update-hook 'menu-bar-update-buffers) 1563(add-hook 'menu-bar-update-hook 'menu-bar-update-buffers)
1563 1564
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el
index c4b027f382f..ca81350ba57 100644
--- a/lisp/mh-e/mh-e.el
+++ b/lisp/mh-e/mh-e.el
@@ -2441,6 +2441,17 @@ well.")
2441 "^There is no other window$")) 2441 "^There is no other window$"))
2442 (add-to-list 'debug-ignored-errors mess)) 2442 (add-to-list 'debug-ignored-errors mess))
2443 2443
2444;;;; Desktop support
2445
2446;;;###autoload
2447(defun mh-restore-desktop-buffer (desktop-buffer-file-name
2448 desktop-buffer-name
2449 desktop-buffer-misc)
2450 "Restore an mh folder buffer specified in a desktop file."
2451 (mh-find-path)
2452 (mh-visit-folder desktop-buffer-name)
2453 (current-buffer))
2454
2444(provide 'mh-e) 2455(provide 'mh-e)
2445 2456
2446;;; Local Variables: 2457;;; Local Variables:
diff --git a/lisp/net/telnet.el b/lisp/net/telnet.el
index dac6f228cd6..d42c4335daa 100644
--- a/lisp/net/telnet.el
+++ b/lisp/net/telnet.el
@@ -197,18 +197,28 @@ rejecting one login and prompting again for a username and password.")
197;;;###autoload (add-hook 'same-window-regexps "\\*telnet-.*\\*\\(\\|<[0-9]+>\\)") 197;;;###autoload (add-hook 'same-window-regexps "\\*telnet-.*\\*\\(\\|<[0-9]+>\\)")
198 198
199;;;###autoload 199;;;###autoload
200(defun telnet (host) 200(defun telnet (host &optional port)
201 "Open a network login connection to host named HOST (a string). 201 "Open a network login connection to host named HOST (a string).
202Optional arg PORT specifies alternative port to connect to.
203Interactively, use \\[universal-argument] prefix to be prompted for port number.
204
202Communication with HOST is recorded in a buffer `*PROGRAM-HOST*' 205Communication with HOST is recorded in a buffer `*PROGRAM-HOST*'
203where PROGRAM is the telnet program being used. This program 206where PROGRAM is the telnet program being used. This program
204is controlled by the contents of the global variable `telnet-host-properties', 207is controlled by the contents of the global variable `telnet-host-properties',
205falling back on the value of the global variable `telnet-program'. 208falling back on the value of the global variable `telnet-program'.
206Normally input is edited in Emacs and sent a line at a time." 209Normally input is edited in Emacs and sent a line at a time."
207 (interactive "sOpen connection to host: ") 210 (interactive (list (read-string "Open connection to host: ")
211 (cond
212 ((null current-prefix-arg) nil)
213 ((consp current-prefix-arg) (read-string "Port: "))
214 (t (prefix-numeric-value current-prefix-arg)))))
215 (if (and port (numberp port))
216 (setq port (int-to-string port)))
208 (let* ((comint-delimiter-argument-list '(?\ ?\t)) 217 (let* ((comint-delimiter-argument-list '(?\ ?\t))
209 (properties (cdr (assoc host telnet-host-properties))) 218 (properties (cdr (assoc host telnet-host-properties)))
210 (telnet-program (if properties (car properties) telnet-program)) 219 (telnet-program (if properties (car properties) telnet-program))
211 (name (concat telnet-program "-" (comint-arguments host 0 nil) )) 220 (hname (if port (concat host ":" port) host))
221 (name (concat telnet-program "-" (comint-arguments hname 0 nil) ))
212 (buffer (get-buffer (concat "*" name "*"))) 222 (buffer (get-buffer (concat "*" name "*")))
213 (telnet-options (if (cdr properties) (cons "-l" (cdr properties)))) 223 (telnet-options (if (cdr properties) (cons "-l" (cdr properties))))
214 process) 224 process)
@@ -221,7 +231,9 @@ Normally input is edited in Emacs and sent a line at a time."
221 ;; Don't send the `open' cmd till telnet is ready for it. 231 ;; Don't send the `open' cmd till telnet is ready for it.
222 (accept-process-output process) 232 (accept-process-output process)
223 (erase-buffer) 233 (erase-buffer)
224 (send-string process (concat "open " host "\n")) 234 (send-string process (concat "open " host
235 (if port " " "") (or port "")
236 "\n"))
225 (telnet-mode) 237 (telnet-mode)
226 (setq comint-input-sender 'telnet-simple-send) 238 (setq comint-input-sender 'telnet-simple-send)
227 (setq telnet-count telnet-initial-count)))) 239 (setq telnet-count telnet-initial-count))))
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index c6f60d3dcc0..a61369004e8 100644
--- a/lisp/progmodes/cc-cmds.el
+++ b/lisp/progmodes/cc-cmds.el
@@ -1488,7 +1488,7 @@ more \"DWIM:ey\"."
1488 (save-excursion 1488 (save-excursion
1489 (beginning-of-line) 1489 (beginning-of-line)
1490 (or (not (re-search-backward 1490 (or (not (re-search-backward
1491 sentence-end 1491 (sentence-end)
1492 (c-point 'bopl) 1492 (c-point 'bopl)
1493 t)) 1493 t))
1494 (< (match-end 0) 1494 (< (match-end 0)
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index f75f2763e11..9aaa992ca76 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -125,11 +125,6 @@ describing how the process finished.")
125Each function is called with two arguments: the compilation buffer, 125Each function is called with two arguments: the compilation buffer,
126and a string describing how the process finished.") 126and a string describing how the process finished.")
127 127
128(defvar compilation-last-buffer nil
129 "The most recent compilation buffer.
130A buffer becomes most recent when its compilation is started
131or when it is used with \\[next-error] or \\[compile-goto-error].")
132
133(defvar compilation-in-progress nil 128(defvar compilation-in-progress nil
134 "List of compilation processes now running.") 129 "List of compilation processes now running.")
135(or (assq 'compilation-in-progress minor-mode-alist) 130(or (assq 'compilation-in-progress minor-mode-alist)
@@ -561,17 +556,13 @@ Faces `compilation-error-face', `compilation-warning-face',
561 (setq dir (previous-single-property-change (point) 'directory) 556 (setq dir (previous-single-property-change (point) 'directory)
562 dir (if dir (or (get-text-property (1- dir) 'directory) 557 dir (if dir (or (get-text-property (1- dir) 'directory)
563 (get-text-property dir 'directory))))) 558 (get-text-property dir 'directory)))))
564 (setq file (cons file (car dir)) ; top of dir stack is current 559 (setq file (cons file (car dir)))))
565 file (or (gethash file compilation-locs)
566 (puthash file (list file fmt) compilation-locs)))))
567 ;; This message didn't mention one, get it from previous 560 ;; This message didn't mention one, get it from previous
568 (setq file (previous-single-property-change (point) 'message) 561 (setq file (previous-single-property-change (point) 'message)
569 file (or (if file 562 file (or (if file
570 (nth 2 (car (or (get-text-property (1- file) 'message) 563 (car (nth 2 (car (or (get-text-property (1- file) 'message)
571 (get-text-property file 'message))))) 564 (get-text-property file 'message))))))
572 ;; no previous either -- but don't let font-lock fail 565 '("*unknown*"))))
573 (gethash (setq file '("*unknown*")) compilation-locs)
574 (puthash file (list file fmt) compilation-locs))))
575 ;; All of these fields are optional, get them only if we have an index, and 566 ;; All of these fields are optional, get them only if we have an index, and
576 ;; it matched some part of the message. 567 ;; it matched some part of the message.
577 (and line 568 (and line
@@ -590,74 +581,84 @@ Faces `compilation-error-face', `compilation-warning-face',
590 (setq type (or (and (car type) (match-end (car type)) 1) 581 (setq type (or (and (car type) (match-end (car type)) 1)
591 (and (cdr type) (match-end (cdr type)) 0) 582 (and (cdr type) (match-end (cdr type)) 0)
592 2))) 583 2)))
593 ;; Get first already existing marker (if any has one, all have one). 584 (compilation-internal-error-properties file line end-line col end-col type fmt)))
594 ;; Do this first, as the compilation-assq`s may create new nodes. 585
595 (let* ((marker-line (car (cddr file))) ; a line structure 586(defun compilation-internal-error-properties (file line end-line col end-col type fmt)
596 (marker (nth 3 (cadr marker-line))) ; its marker 587 "Get the meta-info that will be added as text-properties.
597 (compilation-error-screen-columns compilation-error-screen-columns) 588LINE, END-LINE, COL, END-COL are integers or nil.
598 end-marker loc end-loc) 589TYPE can be 0, 1, or 2.
599 (if (not (and marker (marker-buffer marker))) 590FILE should be (FILENAME . DIRNAME) or nil."
600 (setq marker) ; no valid marker for this file 591 (unless file (setq file '("*unknown*")))
601 (setq loc (or line 1) ; normalize no linenumber to line 1 592 (setq file (or (gethash file compilation-locs)
602 marker-line) 593 (puthash file (list file fmt) compilation-locs)))
603 (catch 'marker ; find nearest loc, at least one exists 594 ;; Get first already existing marker (if any has one, all have one).
604 (dolist (x (cddr file)) ; loop over lines 595 ;; Do this first, as the compilation-assq`s may create new nodes.
605 (if (> (or (car x) 1) loc) ; still bigger 596 (let* ((marker-line (car (cddr file))) ; a line structure
606 (setq marker-line x) 597 (marker (nth 3 (cadr marker-line))) ; its marker
607 (if (or (not marker-line) ; first in list 598 (compilation-error-screen-columns compilation-error-screen-columns)
608 (> (- (or (car marker-line) 1) loc) 599 end-marker loc end-loc)
609 (- loc (or (car x) 1)))) ; current line is nearer 600 (if (not (and marker (marker-buffer marker)))
610 (setq marker-line x)) 601 (setq marker) ; no valid marker for this file
611 (throw 'marker t)))) 602 (setq loc (or line 1) ; normalize no linenumber to line 1
612 (setq marker (nth 3 (cadr marker-line)) 603 marker-line)
613 marker-line (car marker-line)) 604 (catch 'marker ; find nearest loc, at least one exists
614 (with-current-buffer (marker-buffer marker) 605 (dolist (x (cddr file)) ; loop over lines
615 (save-restriction 606 (if (> (or (car x) 1) loc) ; still bigger
616 (widen) 607 (setq marker-line x)
617 (goto-char (marker-position marker)) 608 (if (or (not marker-line) ; first in list
618 (when (or end-col end-line) 609 (> (- (or (car marker-line) 1) loc)
619 (beginning-of-line (- (or end-line line) marker-line -1)) 610 (- loc (or (car x) 1)))) ; current line is nearer
620 (if (< end-col 0) 611 (setq marker-line x))
621 (end-of-line) 612 (throw 'marker t))))
622 (if compilation-error-screen-columns 613 (setq marker (nth 3 (cadr marker-line))
623 (move-to-column end-col) 614 marker-line (car marker-line))
624 (forward-char end-col))) 615 (with-current-buffer (marker-buffer marker)
625 (setq end-marker (list (point-marker)))) 616 (save-restriction
626 (beginning-of-line (if end-line 617 (widen)
627 (- end-line line -1) 618 (goto-char (marker-position marker))
628 (- loc marker-line -1))) 619 (when (or end-col end-line)
629 (if col 620 (beginning-of-line (- (or end-line line) marker-line -1))
630 (if compilation-error-screen-columns 621 (if (< end-col 0)
631 (move-to-column col) 622 (end-of-line)
632 (forward-char col)) 623 (if compilation-error-screen-columns
633 (forward-to-indentation 0)) 624 (move-to-column end-col)
634 (setq marker (list (point-marker)))))) 625 (forward-char end-col)))
635 626 (setq end-marker (list (point-marker))))
636 (setq loc (compilation-assq line (cdr file))) 627 (beginning-of-line (if end-line
637 (if end-line 628 (- end-line line -1)
638 (setq end-loc (compilation-assq end-line (cdr file)) 629 (- loc marker-line -1)))
639 end-loc (compilation-assq end-col end-loc)) 630 (if col
640 (if end-col ; use same line element 631 (if compilation-error-screen-columns
641 (setq end-loc (compilation-assq end-col loc)))) 632 (move-to-column col)
642 (setq loc (compilation-assq col loc)) 633 (forward-char col))
643 ;; If they are new, make the loc(s) reference the file they point to. 634 (forward-to-indentation 0))
644 (or (cdr loc) (setcdr loc `(,line ,file ,@marker))) 635 (setq marker (list (point-marker))))))
645 (if end-loc 636
646 (or (cdr end-loc) (setcdr end-loc `(,(or end-line line) ,file ,@end-marker)))) 637 (setq loc (compilation-assq line (cdr file)))
647 638 (if end-line
648 ;; Must start with face 639 (setq end-loc (compilation-assq end-line (cdr file))
649 `(face ,compilation-message-face 640 end-loc (compilation-assq end-col end-loc))
650 message (,loc ,type ,end-loc) 641 (if end-col ; use same line element
651 ,@(if compilation-debug 642 (setq end-loc (compilation-assq end-col loc))))
652 `(debug (,(assoc (with-no-warnings matcher) font-lock-keywords) 643 (setq loc (compilation-assq col loc))
653 ,@(match-data)))) 644 ;; If they are new, make the loc(s) reference the file they point to.
654 help-echo ,(if col 645 (or (cdr loc) (setcdr loc `(,line ,file ,@marker)))
655 "mouse-2: visit this file, line and column" 646 (if end-loc
656 (if line 647 (or (cdr end-loc) (setcdr end-loc `(,(or end-line line) ,file ,@end-marker))))
657 "mouse-2: visit this file and line" 648
658 "mouse-2: visit this file")) 649 ;; Must start with face
659 keymap compilation-button-map 650 `(face ,compilation-message-face
660 mouse-face highlight)))) 651 message (,loc ,type ,end-loc)
652 ,@(if compilation-debug
653 `(debug (,(assoc (with-no-warnings matcher) font-lock-keywords)
654 ,@(match-data))))
655 help-echo ,(if col
656 "mouse-2: visit this file, line and column"
657 (if line
658 "mouse-2: visit this file and line"
659 "mouse-2: visit this file"))
660 keymap compilation-button-map
661 mouse-face highlight)))
661 662
662(defun compilation-mode-font-lock-keywords () 663(defun compilation-mode-font-lock-keywords ()
663 "Return expressions to highlight in Compilation mode." 664 "Return expressions to highlight in Compilation mode."
@@ -702,6 +703,9 @@ Faces `compilation-error-face', `compilation-warning-face',
702 ,(if col `(match-string ,col))))) 703 ,(if col `(match-string ,col)))))
703 (,file compilation-error-face t)) 704 (,file compilation-error-face t))
704 705
706 (unless (or (null (nth 5 item)) (integerp (nth 5 item)))
707 (error "HYPERLINK should be an integer: %s" (nth 5 item)))
708
705 `(,(nth 0 item) 709 `(,(nth 0 item)
706 710
707 ,@(when (integerp file) 711 ,@(when (integerp file)
@@ -962,7 +966,7 @@ exited abnormally with code %d\n"
962 (select-window outwin) 966 (select-window outwin)
963 (goto-char (point-max)))) 967 (goto-char (point-max))))
964 ;; Make it so the next C-x ` will use this buffer. 968 ;; Make it so the next C-x ` will use this buffer.
965 (setq compilation-last-buffer outbuf))) 969 (setq next-error-last-buffer outbuf)))
966 970
967(defun compilation-set-window-height (window) 971(defun compilation-set-window-height (window)
968 "Set the height of WINDOW according to `compilation-window-height'." 972 "Set the height of WINDOW according to `compilation-window-height'."
@@ -1093,6 +1097,10 @@ Runs `compilation-mode-hook' with `run-hooks' (which see)."
1093 (set (make-local-variable 'page-delimiter) 1097 (set (make-local-variable 'page-delimiter)
1094 compilation-page-delimiter) 1098 compilation-page-delimiter)
1095 (compilation-setup) 1099 (compilation-setup)
1100 ;; note that compilation-next-error-function is for interfacing
1101 ;; with the next-error function in simple.el, and it's only
1102 ;; coincidentally named similarly to compilation-next-error
1103 (setq next-error-function 'compilation-next-error-function)
1096 (run-mode-hooks 'compilation-mode-hook)) 1104 (run-mode-hooks 'compilation-mode-hook))
1097 1105
1098(defmacro define-compilation-mode (mode name doc &rest body) 1106(defmacro define-compilation-mode (mode name doc &rest body)
@@ -1154,7 +1162,6 @@ Optional argument MINOR indicates this is called from
1154 (make-local-variable 'compilation-current-error) 1162 (make-local-variable 'compilation-current-error)
1155 (make-local-variable 'compilation-error-screen-columns) 1163 (make-local-variable 'compilation-error-screen-columns)
1156 (make-local-variable 'overlay-arrow-position) 1164 (make-local-variable 'overlay-arrow-position)
1157 (setq compilation-last-buffer (current-buffer))
1158 (set (make-local-variable 'font-lock-extra-managed-props) 1165 (set (make-local-variable 'font-lock-extra-managed-props)
1159 '(directory message help-echo mouse-face debug)) 1166 '(directory message help-echo mouse-face debug))
1160 (set (make-local-variable 'compilation-locs) 1167 (set (make-local-variable 'compilation-locs)
@@ -1271,8 +1278,16 @@ Just inserts the text, but uses `insert-before-markers'."
1271 (insert-before-markers string) 1278 (insert-before-markers string)
1272 (run-hooks 'compilation-filter-hook)))))) 1279 (run-hooks 'compilation-filter-hook))))))
1273 1280
1281;;; test if a buffer is a compilation buffer, assuming we're in the buffer
1282(defsubst compilation-buffer-internal-p ()
1283 "Test if inside a compilation buffer."
1284 (local-variable-p 'compilation-locs))
1285
1286;;; test if a buffer is a compilation buffer, using compilation-buffer-internal-p
1274(defsubst compilation-buffer-p (buffer) 1287(defsubst compilation-buffer-p (buffer)
1275 (local-variable-p 'compilation-locs buffer)) 1288 "Test if BUFFER is a compilation buffer."
1289 (with-current-buffer buffer
1290 (compilation-buffer-internal-p)))
1276 1291
1277(defmacro compilation-loop (< property-change 1+ error) 1292(defmacro compilation-loop (< property-change 1+ error)
1278 `(while (,< n 0) 1293 `(while (,< n 0)
@@ -1303,7 +1318,6 @@ Does NOT find the source line like \\[next-error]."
1303 (or (compilation-buffer-p (current-buffer)) 1318 (or (compilation-buffer-p (current-buffer))
1304 (error "Not in a compilation buffer")) 1319 (error "Not in a compilation buffer"))
1305 (or pt (setq pt (point))) 1320 (or pt (setq pt (point)))
1306 (setq compilation-last-buffer (current-buffer))
1307 (let* ((msg (get-text-property pt 'message)) 1321 (let* ((msg (get-text-property pt 'message))
1308 (loc (car msg)) 1322 (loc (car msg))
1309 last) 1323 last)
@@ -1341,25 +1355,6 @@ Does NOT find the source line like \\[previous-error]."
1341 (interactive "p") 1355 (interactive "p")
1342 (compilation-next-error (- n))) 1356 (compilation-next-error (- n)))
1343 1357
1344(defun next-error-no-select (n)
1345 "Move point to the next error in the compilation buffer and highlight match.
1346Prefix arg N says how many error messages to move forwards (or
1347backwards, if negative).
1348Finds and highlights the source line like \\[next-error], but does not
1349select the source buffer."
1350 (interactive "p")
1351 (next-error n)
1352 (pop-to-buffer compilation-last-buffer))
1353
1354(defun previous-error-no-select (n)
1355 "Move point to previous error in compilation buffer and highlight match.
1356Prefix arg N says how many error messages to move backwards (or
1357forwards, if negative).
1358Finds and highlights the source line like \\[previous-error], but does not
1359select the source buffer."
1360 (interactive "p")
1361 (next-error-no-select (- n)))
1362
1363(defun compilation-next-file (n) 1358(defun compilation-next-file (n)
1364 "Move point to the next error for a different file than the current one. 1359 "Move point to the next error for a different file than the current one.
1365Prefix arg N says how many files to move forwards (or backwards, if negative)." 1360Prefix arg N says how many files to move forwards (or backwards, if negative)."
@@ -1397,55 +1392,17 @@ Use this command in a compilation log buffer. Sets the mark at point there."
1397 1392
1398;; Return a compilation buffer. 1393;; Return a compilation buffer.
1399;; If the current buffer is a compilation buffer, return it. 1394;; If the current buffer is a compilation buffer, return it.
1400;; If compilation-last-buffer is set to a live buffer, use that.
1401;; Otherwise, look for a compilation buffer and signal an error 1395;; Otherwise, look for a compilation buffer and signal an error
1402;; if there are none. 1396;; if there are none.
1403(defun compilation-find-buffer (&optional other-buffer) 1397(defun compilation-find-buffer (&optional other-buffer)
1404 (if (and (not other-buffer) 1398 (next-error-find-buffer other-buffer 'compilation-buffer-internal-p))
1405 (compilation-buffer-p (current-buffer)))
1406 ;; The current buffer is a compilation buffer.
1407 (current-buffer)
1408 (if (and compilation-last-buffer (buffer-name compilation-last-buffer)
1409 (compilation-buffer-p compilation-last-buffer)
1410 (or (not other-buffer) (not (eq compilation-last-buffer
1411 (current-buffer)))))
1412 compilation-last-buffer
1413 (let ((buffers (buffer-list)))
1414 (while (and buffers (or (not (compilation-buffer-p (car buffers)))
1415 (and other-buffer
1416 (eq (car buffers) (current-buffer)))))
1417 (setq buffers (cdr buffers)))
1418 (if buffers
1419 (car buffers)
1420 (or (and other-buffer
1421 (compilation-buffer-p (current-buffer))
1422 ;; The current buffer is a compilation buffer.
1423 (progn
1424 (if other-buffer
1425 (message "This is the only compilation buffer."))
1426 (current-buffer)))
1427 (error "No compilation started!")))))))
1428 1399
1429;;;###autoload 1400;;;###autoload
1430(defun next-error (&optional n) 1401(defun compilation-next-error-function (n &optional reset)
1431 "Visit next compilation error message and corresponding source code.
1432Prefix arg N says how many error messages to move forwards (or
1433backwards, if negative).
1434
1435\\[next-error] normally uses the most recently started compilation or
1436grep buffer. However, it can operate on any buffer with output from
1437the \\[compile] and \\[grep] commands, or, more generally, on any
1438buffer in Compilation mode or with Compilation Minor mode enabled. To
1439specify use of a particular buffer for error messages, type
1440\\[next-error] in that buffer.
1441
1442Once \\[next-error] has chosen the buffer for error messages,
1443it stays with that buffer until you use it in some other buffer which
1444uses Compilation mode or Compilation Minor mode.
1445
1446See variable `compilation-error-regexp-alist' for customization ideas."
1447 (interactive "p") 1402 (interactive "p")
1448 (set-buffer (setq compilation-last-buffer (compilation-find-buffer))) 1403 (set-buffer (compilation-find-buffer))
1404 (when reset
1405 (setq compilation-current-error nil))
1449 (let* ((columns compilation-error-screen-columns) ; buffer's local value 1406 (let* ((columns compilation-error-screen-columns) ; buffer's local value
1450 (last 1) 1407 (last 1)
1451 (loc (compilation-next-error (or n 1) nil 1408 (loc (compilation-next-error (or n 1) nil
@@ -1492,27 +1449,6 @@ See variable `compilation-error-regexp-alist' for customization ideas."
1492 (compilation-goto-locus marker (nth 3 loc) (nth 3 end-loc)) 1449 (compilation-goto-locus marker (nth 3 loc) (nth 3 end-loc))
1493 (setcdr (nthcdr 3 loc) t))) ; Set this one as visited. 1450 (setcdr (nthcdr 3 loc) t))) ; Set this one as visited.
1494 1451
1495;;;###autoload (define-key ctl-x-map "`" 'next-error)
1496
1497(defun previous-error (n)
1498 "Visit previous compilation error message and corresponding source code.
1499Prefix arg N says how many error messages to move backwards (or
1500forwards, if negative).
1501
1502This operates on the output from the \\[compile] and \\[grep] commands."
1503 (interactive "p")
1504 (next-error (- n)))
1505
1506(defun first-error (n)
1507 "Restart at the first error.
1508Visit corresponding source code.
1509With prefix arg N, visit the source code of the Nth error.
1510This operates on the output from the \\[compile] command."
1511 (interactive "p")
1512 (set-buffer (setq compilation-last-buffer (compilation-find-buffer)))
1513 (setq compilation-current-error nil)
1514 (next-error n))
1515
1516(defun compilation-fake-loc (marker file &optional line col) 1452(defun compilation-fake-loc (marker file &optional line col)
1517 "Preassociate MARKER with FILE. 1453 "Preassociate MARKER with FILE.
1518This is useful when you compile temporary files, but want 1454This is useful when you compile temporary files, but want
@@ -1732,17 +1668,25 @@ Pop up the buffer containing MARKER and scroll to MARKER if we ask the user."
1732 1668
1733(defun compilation-compat-error-properties (err) 1669(defun compilation-compat-error-properties (err)
1734 "Map old-style error ERR to new-style message." 1670 "Map old-style error ERR to new-style message."
1735 (let* ((dst (cdr err)) 1671 ;; Old-style structure is (MARKER (FILE DIR) LINE COL) or
1736 (loc (cond ((markerp dst) (list nil nil nil dst)) 1672 ;; (MARKER . MARKER).
1737 ((consp dst) 1673 (let ((dst (cdr err)))
1738 (list (nth 2 dst) (nth 1 dst) 1674 (if (markerp dst)
1739 (cons (cdar dst) (caar dst))))))) 1675 ;; Must start with a face, for font-lock.
1740 ;; Must start with a face, for font-lock. 1676 `(face nil
1741 `(face nil 1677 message ,(list (list nil nil nil dst) 2)
1742 message ,(list loc 2) 1678 help-echo "mouse-2: visit the source location"
1743 help-echo "mouse-2: visit the source location" 1679 keymap compilation-button-map
1744 keymap compilation-button-map 1680 mouse-face highlight)
1745 mouse-face highlight))) 1681 ;; Too difficult to do it by hand: dispatch to the normal code.
1682 (let* ((file (pop dst))
1683 (line (pop dst))
1684 (col (pop dst))
1685 (filename (pop file))
1686 (dirname (pop file))
1687 (fmt (pop file)))
1688 (compilation-internal-error-properties
1689 (cons filename dirname) line nil col nil 2 fmt)))))
1746 1690
1747(defun compilation-compat-parse-errors (limit) 1691(defun compilation-compat-parse-errors (limit)
1748 (when compilation-parse-errors-function 1692 (when compilation-parse-errors-function
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index e13198fb240..c651e06b899 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -926,12 +926,9 @@ the faces: please specify bold, italic, underline, shadow and box.)
926(defun cperl-putback-char (c) ; Emacs 19 926(defun cperl-putback-char (c) ; Emacs 19
927 (set 'unread-command-events (list c))) ; Avoid undefined warning 927 (set 'unread-command-events (list c))) ; Avoid undefined warning
928 928
929(if (boundp 'unread-command-events) 929(if cperl-xemacs-p
930 (if cperl-xemacs-p 930 (defun cperl-putback-char (c) ; XEmacs >= 19.12
931 (defun cperl-putback-char (c) ; XEmacs >= 19.12 931 (setq unread-command-events (list (eval '(character-to-event c))))))
932 (setq unread-command-events (list (eval '(character-to-event c))))))
933 (defun cperl-putback-char (c) ; XEmacs <= 19.11
934 (set 'unread-command-event (eval '(character-to-event c))))) ; Avoid warnings
935 932
936(or (fboundp 'uncomment-region) 933(or (fboundp 'uncomment-region)
937 (defun uncomment-region (beg end) 934 (defun uncomment-region (beg end)
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index b33f8f3f239..fb5a6757a49 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -1,6 +1,6 @@
1;;; gdb-ui.el --- User Interface for running GDB 1;;; gdb-ui.el --- User Interface for running GDB
2 2
3;; Author: Nick Roberts <nick@nick.uklinux.net> 3;; Author: Nick Roberts <nickrob@gnu.org>
4;; Maintainer: FSF 4;; Maintainer: FSF
5;; Keywords: unix, tools 5;; Keywords: unix, tools
6 6
@@ -1141,10 +1141,18 @@ static char *magick[] = {
1141 (gdb-display-buffer 1141 (gdb-display-buffer
1142 (gdb-get-create-buffer 'gdb-breakpoints-buffer))) 1142 (gdb-get-create-buffer 'gdb-breakpoints-buffer)))
1143 1143
1144(defconst gdb-frame-parameters
1145 '((height . 12) (width . 60)
1146 (unsplittable . t)
1147 (tool-bar-lines . nil)
1148 (menu-bar-lines . nil)
1149 (minibuffer . nil)))
1150
1144(defun gdb-frame-breakpoints-buffer () 1151(defun gdb-frame-breakpoints-buffer ()
1145 (interactive) 1152 (interactive)
1146 (switch-to-buffer-other-frame 1153 (select-frame (make-frame gdb-frame-parameters))
1147 (gdb-get-create-buffer 'gdb-breakpoints-buffer))) 1154 (switch-to-buffer (gdb-get-create-buffer 'gdb-breakpoints-buffer))
1155 (set-window-dedicated-p (get-buffer-window (current-buffer)) t))
1148 1156
1149(defvar gdb-breakpoints-mode-map 1157(defvar gdb-breakpoints-mode-map
1150 (let ((map (make-sparse-keymap)) 1158 (let ((map (make-sparse-keymap))
@@ -1264,8 +1272,9 @@ current line."
1264 1272
1265(defun gdb-frame-stack-buffer () 1273(defun gdb-frame-stack-buffer ()
1266 (interactive) 1274 (interactive)
1267 (switch-to-buffer-other-frame 1275 (select-frame (make-frame gdb-frame-parameters))
1268 (gdb-get-create-buffer 'gdb-stack-buffer))) 1276 (switch-to-buffer (gdb-get-create-buffer 'gdb-stack-buffer))
1277 (set-window-dedicated-p (get-buffer-window (current-buffer)) t))
1269 1278
1270(defvar gdb-frames-mode-map 1279(defvar gdb-frames-mode-map
1271 (let ((map (make-sparse-keymap))) 1280 (let ((map (make-sparse-keymap)))
@@ -1340,8 +1349,9 @@ the source buffer."
1340 1349
1341(defun gdb-frame-threads-buffer () 1350(defun gdb-frame-threads-buffer ()
1342 (interactive) 1351 (interactive)
1343 (switch-to-buffer-other-frame 1352 (select-frame (make-frame gdb-frame-parameters))
1344 (gdb-get-create-buffer 'gdb-threads-buffer))) 1353 (switch-to-buffer (gdb-get-create-buffer 'gdb-threads-buffer))
1354 (set-window-dedicated-p (get-buffer-window (current-buffer)) t))
1345 1355
1346(defvar gdb-threads-mode-map 1356(defvar gdb-threads-mode-map
1347 (let ((map (make-sparse-keymap))) 1357 (let ((map (make-sparse-keymap)))
@@ -1421,8 +1431,9 @@ the source buffer."
1421 1431
1422(defun gdb-frame-registers-buffer () 1432(defun gdb-frame-registers-buffer ()
1423 (interactive) 1433 (interactive)
1424 (switch-to-buffer-other-frame 1434 (select-frame (make-frame gdb-frame-parameters))
1425 (gdb-get-create-buffer 'gdb-registers-buffer))) 1435 (switch-to-buffer (gdb-get-create-buffer 'gdb-registers-buffer))
1436 (set-window-dedicated-p (get-buffer-window (current-buffer)) t))
1426 1437
1427;; 1438;;
1428;; Locals buffer. 1439;; Locals buffer.
@@ -1492,8 +1503,9 @@ the source buffer."
1492 1503
1493(defun gdb-frame-locals-buffer () 1504(defun gdb-frame-locals-buffer ()
1494 (interactive) 1505 (interactive)
1495 (switch-to-buffer-other-frame 1506 (select-frame (make-frame gdb-frame-parameters))
1496 (gdb-get-create-buffer 'gdb-locals-buffer))) 1507 (switch-to-buffer (gdb-get-create-buffer 'gdb-locals-buffer))
1508 (set-window-dedicated-p (get-buffer-window (current-buffer)) t))
1497 1509
1498 1510
1499;;;; Window management 1511;;;; Window management
@@ -1514,7 +1526,7 @@ the source buffer."
1514 (set-window-dedicated-p win t)))) 1526 (set-window-dedicated-p win t))))
1515 (setq answer (get-buffer-window buf)) 1527 (setq answer (get-buffer-window buf))
1516 (if (not answer) 1528 (if (not answer)
1517 (let ((window (get-lru-window))) 1529 (let ((window (get-lru-window 'visible)))
1518 (if window 1530 (if window
1519 (progn 1531 (progn
1520 (set-window-buffer window buf) 1532 (set-window-buffer window buf)
@@ -1525,7 +1537,7 @@ the source buffer."
1525 (if (eq gud-comint-buffer (window-buffer win)) 1537 (if (eq gud-comint-buffer (window-buffer win))
1526 (set-window-dedicated-p win nil))))) 1538 (set-window-dedicated-p win nil)))))
1527 (if must-split 1539 (if must-split
1528 (let* ((largest (get-largest-window)) 1540 (let* ((largest (get-largest-window 'visible))
1529 (cur-size (window-height largest)) 1541 (cur-size (window-height largest))
1530 (new-size (and size (< size cur-size) (- cur-size size)))) 1542 (new-size (and size (< size cur-size) (- cur-size size))))
1531 (setq answer (split-window largest new-size)) 1543 (setq answer (split-window largest new-size))
@@ -1590,8 +1602,9 @@ the source buffer."
1590 1602
1591(defun gdb-frame-gdb-buffer () 1603(defun gdb-frame-gdb-buffer ()
1592 (interactive) 1604 (interactive)
1593 (switch-to-buffer-other-frame 1605 (select-frame (make-frame gdb-frame-parameters))
1594 (gdb-get-create-buffer 'gdba))) 1606 (switch-to-buffer (gdb-get-create-buffer 'gdba))
1607 (set-window-dedicated-p (get-buffer-window (current-buffer)) t))
1595 1608
1596(defun gdb-display-gdb-buffer () 1609(defun gdb-display-gdb-buffer ()
1597 (interactive) 1610 (interactive)
@@ -1920,8 +1933,9 @@ BUFFER nil or omitted means use the current buffer."
1920 1933
1921(defun gdb-frame-assembler-buffer () 1934(defun gdb-frame-assembler-buffer ()
1922 (interactive) 1935 (interactive)
1923 (switch-to-buffer-other-frame 1936 (select-frame (make-frame gdb-frame-parameters))
1924 (gdb-get-create-buffer 'gdb-assembler-buffer))) 1937 (switch-to-buffer (gdb-get-create-buffer 'gdb-assembler-buffer))
1938 (set-window-dedicated-p (get-buffer-window (current-buffer)) t))
1925 1939
1926;; modified because if gdb-current-address has changed value a new command 1940;; modified because if gdb-current-address has changed value a new command
1927;; must be enqueued to update the buffer with the new output 1941;; must be enqueued to update the buffer with the new output
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 7a7e62d06ee..a85cd2296ae 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1415,7 +1415,7 @@ The criterion is either a match for `jython-mode' via
1415 (while (re-search-forward 1415 (while (re-search-forward
1416 (rx (and line-start (or "import" "from") (1+ space) 1416 (rx (and line-start (or "import" "from") (1+ space)
1417 (group (1+ (not (any " \t\n.")))))) 1417 (group (1+ (not (any " \t\n."))))))
1418 10000 ; Probably not worth customizing. 1418 (+ (point-min) 10000) ; Probably not worth customizing.
1419 t) 1419 t)
1420 (if (member (match-string 1) python-jython-packages) 1420 (if (member (match-string 1) python-jython-packages)
1421 (throw 'done t)))) 1421 (throw 'done t))))
diff --git a/lisp/recentf.el b/lisp/recentf.el
index 7e379822457..efe4ebc63a4 100644
--- a/lisp/recentf.el
+++ b/lisp/recentf.el
@@ -1137,13 +1137,16 @@ default."
1137 "Save the recent list. 1137 "Save the recent list.
1138Write data into the file specified by `recentf-save-file'." 1138Write data into the file specified by `recentf-save-file'."
1139 (interactive) 1139 (interactive)
1140 (with-temp-buffer 1140 (condition-case error
1141 (erase-buffer) 1141 (with-temp-buffer
1142 (insert (format recentf-save-file-header (current-time-string))) 1142 (erase-buffer)
1143 (recentf-dump-variable 'recentf-list recentf-max-saved-items) 1143 (insert (format recentf-save-file-header (current-time-string)))
1144 (recentf-dump-variable 'recentf-filter-changer-state) 1144 (recentf-dump-variable 'recentf-list recentf-max-saved-items)
1145 (write-file (expand-file-name recentf-save-file)) 1145 (recentf-dump-variable 'recentf-filter-changer-state)
1146 nil)) 1146 (write-file (expand-file-name recentf-save-file))
1147 nil)
1148 (error
1149 (warn "recentf mode: %s" (error-message-string error)))))
1147 1150
1148(defun recentf-load-list () 1151(defun recentf-load-list ()
1149 "Load a previously saved recent list. 1152 "Load a previously saved recent list.
diff --git a/lisp/replace.el b/lisp/replace.el
index 2d26cb5cc66..e14e1314352 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -538,6 +538,7 @@ Alternatively, click \\[occur-mode-mouse-goto] on an item to go to it.
538 (set (make-local-variable 'revert-buffer-function) 'occur-revert-function) 538 (set (make-local-variable 'revert-buffer-function) 'occur-revert-function)
539 (make-local-variable 'occur-revert-arguments) 539 (make-local-variable 'occur-revert-arguments)
540 (add-hook 'change-major-mode-hook 'font-lock-defontify nil t) 540 (add-hook 'change-major-mode-hook 'font-lock-defontify nil t)
541 (setq next-error-function 'occur-next-error)
541 (run-hooks 'occur-mode-hook)) 542 (run-hooks 'occur-mode-hook))
542 543
543(defun occur-revert-function (ignore1 ignore2) 544(defun occur-revert-function (ignore1 ignore2)
@@ -614,6 +615,21 @@ Alternatively, click \\[occur-mode-mouse-goto] on an item to go to it.
614 "Move to the Nth (default 1) previous match in an Occur mode buffer." 615 "Move to the Nth (default 1) previous match in an Occur mode buffer."
615 (interactive "p") 616 (interactive "p")
616 (occur-find-match n #'previous-single-property-change "No earlier matches")) 617 (occur-find-match n #'previous-single-property-change "No earlier matches"))
618
619(defun occur-next-error (&optional argp reset)
620 "Move to the Nth (default 1) next match in an Occur mode buffer.
621Compatibility function for \\[next-error] invocations."
622 (interactive "p")
623 (when reset
624 (occur-find-match 0 #'next-single-property-change "No first match"))
625 (occur-find-match
626 (prefix-numeric-value argp)
627 (if (> 0 (prefix-numeric-value argp))
628 #'previous-single-property-change
629 #'next-single-property-change)
630 "No more matches")
631 (occur-mode-goto-occurrence))
632
617 633
618(defcustom list-matching-lines-default-context-lines 0 634(defcustom list-matching-lines-default-context-lines 0
619 "*Default number of context lines included around `list-matching-lines' matches. 635 "*Default number of context lines included around `list-matching-lines' matches.
@@ -800,7 +816,9 @@ See also `multi-occur'."
800 (setq occur-revert-arguments (list regexp nlines bufs) 816 (setq occur-revert-arguments (list regexp nlines bufs)
801 buffer-read-only t) 817 buffer-read-only t)
802 (if (> count 0) 818 (if (> count 0)
803 (display-buffer occur-buf) 819 (progn
820 (display-buffer occur-buf)
821 (setq next-error-last-buffer occur-buf))
804 (kill-buffer occur-buf))) 822 (kill-buffer occur-buf)))
805 (run-hooks 'occur-hook)))) 823 (run-hooks 'occur-hook))))
806 824
diff --git a/lisp/simple.el b/lisp/simple.el
index 92cdb33fca1..269b78e497a 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1,7 +1,7 @@
1;;; simple.el --- basic editing commands for Emacs 1;;; simple.el --- basic editing commands for Emacs
2 2
3;; Copyright (C) 1985, 86, 87, 93, 94, 95, 96, 97, 98, 99, 3;; Copyright (C) 1985, 86, 87, 93, 94, 95, 96, 97, 98, 99,
4;; 2000, 2001, 2002, 2003 4;; 2000, 01, 02, 03, 04
5;; Free Software Foundation, Inc. 5;; Free Software Foundation, Inc.
6 6
7;; Maintainer: FSF 7;; Maintainer: FSF
@@ -66,6 +66,141 @@
66 (setq list (cdr list))) 66 (setq list (cdr list)))
67 (switch-to-buffer found))) 67 (switch-to-buffer found)))
68 68
69;;; next-error support framework
70(defvar next-error-last-buffer nil
71 "The most recent next-error buffer.
72A buffer becomes most recent when its compilation, grep, or
73similar mode is started, or when it is used with \\[next-error]
74or \\[compile-goto-error].")
75
76(defvar next-error-function nil
77 "Function to use to find the next error in the current buffer.
78The function is called with 2 parameters:
79ARG is an integer specifying by how many errors to move.
80RESET is a boolean which, if non-nil, says to go back to the beginning
81of the errors before moving.
82Major modes providing compile-like functionality should set this variable
83to indicate to `next-error' that this is a candidate buffer and how
84to navigate in it.")
85
86(make-variable-buffer-local 'next-error-function)
87
88(defsubst next-error-buffer-p (buffer &optional extra-test)
89 "Test if BUFFER is a next-error capable buffer."
90 (with-current-buffer buffer
91 (or (and extra-test (funcall extra-test))
92 next-error-function)))
93
94;; Return a next-error capable buffer.
95;; If the current buffer is such, return it.
96;; If next-error-last-buffer is set to a live buffer, use that.
97;; Otherwise, look for a next-error capable buffer and signal an error
98;; if there are none.
99(defun next-error-find-buffer (&optional other-buffer extra-test)
100 (if (and (not other-buffer)
101 (next-error-buffer-p (current-buffer) extra-test))
102 ;; The current buffer is a next-error capable buffer.
103 (current-buffer)
104 (if (and next-error-last-buffer (buffer-name next-error-last-buffer)
105 (next-error-buffer-p next-error-last-buffer extra-test)
106 (or (not other-buffer) (not (eq next-error-last-buffer
107 (current-buffer)))))
108 next-error-last-buffer
109 (let ((buffers (buffer-list)))
110 (while (and buffers (or (not (next-error-buffer-p (car buffers) extra-test))
111 (and other-buffer
112 (eq (car buffers) (current-buffer)))))
113 (setq buffers (cdr buffers)))
114 (if buffers
115 (car buffers)
116 (or (and other-buffer
117 (next-error-buffer-p (current-buffer) extra-test)
118 ;; The current buffer is a next-error capable buffer.
119 (progn
120 (if other-buffer
121 (message "This is the only next-error capable buffer."))
122 (current-buffer)))
123 (error "No next-error capable buffer found!")))))))
124
125(defun next-error (arg &optional reset)
126 "Visit next next-error message and corresponding source code.
127
128If all the error messages parsed so far have been processed already,
129the message buffer is checked for new ones.
130
131A prefix ARG specifies how many error messages to move;
132negative means move back to previous error messages.
133Just \\[universal-argument] as a prefix means reparse the error message buffer
134and start at the first error.
135
136The RESET argument specifies that we should restart from the beginning
137
138\\[next-error] normally uses the most recently started
139compilation, grep, or occur buffer. It can also operate on any
140buffer with output from the \\[compile], \\[grep] commands, or,
141more generally, on any buffer in Compilation mode or with
142Compilation Minor mode enabled, or any buffer in which
143`next-error-function' is bound to an appropriate
144function. To specify use of a particular buffer for error
145messages, type \\[next-error] in that buffer.
146
147Once \\[next-error] has chosen the buffer for error messages,
148it stays with that buffer until you use it in some other buffer which
149uses Compilation mode or Compilation Minor mode.
150
151See variables `compilation-parse-errors-function' and
152\`compilation-error-regexp-alist' for customization ideas."
153 (interactive "P")
154 (if (consp arg) (setq reset t arg nil))
155 (when (setq next-error-last-buffer (next-error-find-buffer))
156 ;; we know here that next-error-function is a valid symbol we can funcall
157 (with-current-buffer next-error-last-buffer
158 (funcall next-error-function (prefix-numeric-value arg) reset))))
159
160(defalias 'goto-next-locus 'next-error)
161(defalias 'next-match 'next-error)
162
163(define-key ctl-x-map "`" 'next-error)
164
165(defun previous-error (n)
166 "Visit previous next-error message and corresponding source code.
167
168Prefix arg N says how many error messages to move backwards (or
169forwards, if negative).
170
171This operates on the output from the \\[compile] and \\[grep] commands."
172 (interactive "p")
173 (next-error (- n)))
174
175(defun first-error (n)
176 "Restart at the first error.
177Visit corresponding source code.
178With prefix arg N, visit the source code of the Nth error.
179This operates on the output from the \\[compile] command, for instance."
180 (interactive "p")
181 (next-error n t))
182
183(defun next-error-no-select (n)
184 "Move point to the next error in the next-error buffer and highlight match.
185Prefix arg N says how many error messages to move forwards (or
186backwards, if negative).
187Finds and highlights the source line like \\[next-error], but does not
188select the source buffer."
189 (interactive "p")
190 (next-error n)
191 (pop-to-buffer next-error-last-buffer))
192
193(defun previous-error-no-select (n)
194 "Move point to the previous error in the next-error buffer and highlight match.
195Prefix arg N says how many error messages to move backwards (or
196forwards, if negative).
197Finds and highlights the source line like \\[previous-error], but does not
198select the source buffer."
199 (interactive "p")
200 (next-error-no-select (- n)))
201
202;;;
203
69(defun fundamental-mode () 204(defun fundamental-mode ()
70 "Major mode not specialized for anything in particular. 205 "Major mode not specialized for anything in particular.
71Other major modes are defined by comparison with this one." 206Other major modes are defined by comparison with this one."
diff --git a/lisp/subr.el b/lisp/subr.el
index 39a9caa3106..57f725fb44c 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -644,14 +644,16 @@ and `down'."
644 (setq type (car type))) 644 (setq type (car type)))
645 (if (symbolp type) 645 (if (symbolp type)
646 (cdr (get type 'event-symbol-elements)) 646 (cdr (get type 'event-symbol-elements))
647 (let ((list nil)) 647 (let ((list nil)
648 (or (zerop (logand type ?\M-\^@)) 648 (char (logand type (lognot (logior ?\M-\^@ ?\C-\^@ ?\S-\^@
649 ?\H-\^@ ?\s-\^@ ?\A-\^@)))))
650 (if (not (zerop (logand type ?\M-\^@)))
649 (setq list (cons 'meta list))) 651 (setq list (cons 'meta list)))
650 (or (and (zerop (logand type ?\C-\^@)) 652 (if (or (not (zerop (logand type ?\C-\^@)))
651 (>= (logand type 127) 32)) 653 (< char 32))
652 (setq list (cons 'control list))) 654 (setq list (cons 'control list)))
653 (or (and (zerop (logand type ?\S-\^@)) 655 (if (or (not (zerop (logand type ?\S-\^@)))
654 (= (logand type 255) (downcase (logand type 255)))) 656 (/= char (downcase char)))
655 (setq list (cons 'shift list))) 657 (setq list (cons 'shift list)))
656 (or (zerop (logand type ?\H-\^@)) 658 (or (zerop (logand type ?\H-\^@))
657 (setq list (cons 'hyper list))) 659 (setq list (cons 'hyper list)))
@@ -1329,7 +1331,8 @@ Optional DEFAULT is a default password to use instead of empty input."
1329 (while 1331 (while
1330 (progn 1332 (progn
1331 (let ((str (read-from-minibuffer prompt nil nil nil nil 1333 (let ((str (read-from-minibuffer prompt nil nil nil nil
1332 (number-to-string default)))) 1334 (and default
1335 (number-to-string default)))))
1333 (setq n (cond 1336 (setq n (cond
1334 ((zerop (length str)) default) 1337 ((zerop (length str)) default)
1335 ((stringp str) (read str))))) 1338 ((stringp str) (read str)))))
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el
index aaa10fbce5f..a888003402d 100644
--- a/lisp/textmodes/fill.el
+++ b/lisp/textmodes/fill.el
@@ -155,7 +155,7 @@ Leave one space between words, two at end of sentences or after colons
155and `sentence-end-without-period'). 155and `sentence-end-without-period').
156Remove indentation from each line." 156Remove indentation from each line."
157 (interactive "*r") 157 (interactive "*r")
158 (let ((end-spc-re (concat "\\(" sentence-end "\\) *\\| +"))) 158 (let ((end-spc-re (concat "\\(" (sentence-end) "\\) *\\| +")))
159 (save-excursion 159 (save-excursion
160 (goto-char beg) 160 (goto-char beg)
161 ;; Nuke tabs; they get screwed up in a fill. 161 ;; Nuke tabs; they get screwed up in a fill.
@@ -349,7 +349,7 @@ and `fill-nobreak-invisible'."
349 (save-excursion 349 (save-excursion
350 (skip-chars-backward ". ") 350 (skip-chars-backward ". ")
351 (and (looking-at "\\.") 351 (and (looking-at "\\.")
352 (not (looking-at sentence-end)))) 352 (not (looking-at (sentence-end)))))
353 ;; Don't split a line if the rest would look like a new paragraph. 353 ;; Don't split a line if the rest would look like a new paragraph.
354 (unless use-hard-newlines 354 (unless use-hard-newlines
355 (save-excursion 355 (save-excursion
@@ -424,10 +424,10 @@ Point is moved to just past the fill prefix on the first line."
424 ;; loses on split abbrevs ("Mr.\nSmith") 424 ;; loses on split abbrevs ("Mr.\nSmith")
425 (let ((eol-double-space-re 425 (let ((eol-double-space-re
426 (cond 426 (cond
427 ((not colon-double-space) (concat sentence-end "$")) 427 ((not colon-double-space) (concat (sentence-end) "$"))
428 ;; Try to add the : inside the `sentence-end' regexp. 428 ;; Try to add the : inside the `sentence-end' regexp.
429 ((string-match "\\[[^][]*\\(\\.\\)[^][]*\\]" sentence-end) 429 ((string-match "\\[[^][]*\\(\\.\\)[^][]*\\]" (sentence-end))
430 (concat (replace-match ".:" nil nil sentence-end 1) "$")) 430 (concat (replace-match ".:" nil nil (sentence-end) 1) "$"))
431 ;; Can't find the right spot to insert the colon. 431 ;; Can't find the right spot to insert the colon.
432 (t "[.?!:][])}\"']*$"))) 432 (t "[.?!:][])}\"']*$")))
433 (sentence-end-without-space-list 433 (sentence-end-without-space-list
diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el
index f7595e24cb5..a86be8646c9 100644
--- a/lisp/textmodes/paragraphs.el
+++ b/lisp/textmodes/paragraphs.el
@@ -120,49 +120,62 @@ text indented by a margin setting."
120This is relevant for filling. See also `sentence-end-without-period' 120This is relevant for filling. See also `sentence-end-without-period'
121and `colon-double-space'. 121and `colon-double-space'.
122 122
123If you change this, you should also change `sentence-end'. See Info 123This value is used by the function `sentence-end' to construct the
124node `Sentences'." 124regexp describing the end of a sentence, in case when the value of
125the variable `sentence-end' is nil. See Info node `Sentences'."
125 :type 'boolean 126 :type 'boolean
126 :group 'fill) 127 :group 'fill)
127 128
128(defcustom sentence-end-without-period nil 129(defcustom sentence-end-without-period nil
129 "*Non-nil means a sentence will end without a period. 130 "*Non-nil means a sentence will end without a period.
130For example, a sentence in Thai text ends with double space but 131For example, a sentence in Thai text ends with double space but
131without a period." 132without a period.
133
134This value is used by the function `sentence-end' to construct the
135regexp describing the end of a sentence, in case when the value of
136the variable `sentence-end' is nil. See Info node `Sentences'."
132 :type 'boolean 137 :type 'boolean
133 :group 'fill) 138 :group 'fill)
134 139
135(defcustom sentence-end-without-space 140(defcustom sentence-end-without-space
136 "$B!#!%!)!*$A!##.#?#!$(0!$!%!)!*$(G!$!%!)!*(B" 141 "$B!#!%!)!*$A!##.#?#!$(0!$!%!)!*$(G!$!%!)!*(B"
137 "*String containing characters that end sentence without following spaces. 142 "*String containing characters that end sentence without following spaces.
138If you change this, you should also change `sentence-end'. See Info 143
139node `Sentences'." 144This value is used by the function `sentence-end' to construct the
145regexp describing the end of a sentence, in case when the value of
146the variable `sentence-end' is nil. See Info node `Sentences'."
140 :group 'paragraphs 147 :group 'paragraphs
141 :type 'string) 148 :type 'string)
142 149
143(defcustom sentence-end 150(defcustom sentence-end nil
144 (purecopy
145 ;; This is a bit stupid since it's not auto-updated when the
146 ;; other variables are changes, but it's still useful info.
147 (concat (if sentence-end-without-period "\\w \\|")
148 "\\([.?!][]\"')}]*"
149 (if sentence-end-double-space
150 "\\($\\| $\\|\t\\| \\)" "\\($\\|[\t ]\\)")
151 "\\|[" sentence-end-without-space "]+\\)"
152 "[ \t\n]*"))
153 "*Regexp describing the end of a sentence. 151 "*Regexp describing the end of a sentence.
154The value includes the whitespace following the sentence. 152The value includes the whitespace following the sentence.
155All paragraph boundaries also end sentences, regardless. 153All paragraph boundaries also end sentences, regardless.
156 154
157The default value specifies that in order to be recognized as the end 155The value nil means to use the default value defined by the
158of a sentence, the ending period, question mark, or exclamation point 156function `sentence-end'. You should always use this function
159must be followed by two spaces, unless it's inside some sort of quotes 157to obtain the value of this variable."
160or parenthesis.
161
162See also the variable `sentence-end-double-space', the variable
163`sentence-end-without-period' and Info node `Sentences'."
164 :group 'paragraphs 158 :group 'paragraphs
165 :type 'regexp) 159 :type '(choice regexp (const :tag "Use default value" nil)))
160
161(defun sentence-end ()
162 "Return the regexp describing the end of a sentence.
163
164This function returns either the value of the variable `sentence-end'
165if it is non-nil, or the default value constructed from the
166variables `sentence-end-double-space', `sentence-end-without-period'
167and `sentence-end-without-space'. The default value specifies
168that in order to be recognized as the end of a sentence, the
169ending period, question mark, or exclamation point must be
170followed by two spaces, unless it's inside some sort of quotes or
171parenthesis. See Info node `Sentences'."
172 (or sentence-end
173 (concat (if sentence-end-without-period "\\w \\|")
174 "\\([.?!][]\"')}]*"
175 (if sentence-end-double-space
176 "\\($\\| $\\|\t\\| \\)" "\\($\\|[\t ]\\)")
177 "\\|[" sentence-end-without-space "]+\\)"
178 "[ \t\n]*")))
166 179
167(defcustom page-delimiter "^\014" 180(defcustom page-delimiter "^\014"
168 "*Regexp describing line-beginnings that separate pages." 181 "*Regexp describing line-beginnings that separate pages."
@@ -411,7 +424,8 @@ The variable `sentence-end' is a regular expression that matches ends of
411sentences. Also, every paragraph boundary terminates sentences as well." 424sentences. Also, every paragraph boundary terminates sentences as well."
412 (interactive "p") 425 (interactive "p")
413 (or arg (setq arg 1)) 426 (or arg (setq arg 1))
414 (let ((opoint (point))) 427 (let ((opoint (point))
428 (sentence-end (sentence-end)))
415 (while (< arg 0) 429 (while (< arg 0)
416 (let ((pos (point)) 430 (let ((pos (point))
417 (par-beg (save-excursion (start-of-paragraph-text) (point)))) 431 (par-beg (save-excursion (start-of-paragraph-text) (point))))
diff --git a/lisp/vc-svn.el b/lisp/vc-svn.el
index 08af8f01977..4db9788cc3b 100644
--- a/lisp/vc-svn.el
+++ b/lisp/vc-svn.el
@@ -334,21 +334,22 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
334;;; History functions 334;;; History functions
335;;; 335;;;
336 336
337(defun vc-svn-print-log (file) 337(defun vc-svn-print-log (file &optional buffer)
338 "Get change log associated with FILE." 338 "Get change log associated with FILE."
339 (save-current-buffer 339 (save-current-buffer
340 (vc-setup-buffer nil) 340 (vc-setup-buffer buffer)
341 (let ((inhibit-read-only t)) 341 (let ((inhibit-read-only t))
342 (goto-char (point-min)) 342 (goto-char (point-min))
343 ;; Add a line to tell log-view-mode what file this is. 343 ;; Add a line to tell log-view-mode what file this is.
344 (insert "Working file: " (file-relative-name file) "\n")) 344 (insert "Working file: " (file-relative-name file) "\n"))
345 (vc-svn-command 345 (vc-svn-command
346 t 346 buffer
347 (if (and (vc-stay-local-p file) (fboundp 'start-process)) 'async 0) 347 (if (and (vc-stay-local-p file) (fboundp 'start-process)) 'async 0)
348 file "log"))) 348 file "log")))
349 349
350(defun vc-svn-diff (file &optional oldvers newvers) 350(defun vc-svn-diff (file &optional oldvers newvers buffer)
351 "Get a difference report using SVN between two versions of FILE." 351 "Get a difference report using SVN between two versions of FILE."
352 (unless buffer (setq buffer "*vc-diff*"))
352 (if (string= (vc-workfile-version file) "0") 353 (if (string= (vc-workfile-version file) "0")
353 ;; This file is added but not yet committed; there is no master file. 354 ;; This file is added but not yet committed; there is no master file.
354 (if (or oldvers newvers) 355 (if (or oldvers newvers)
@@ -356,7 +357,7 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
356 ;; We regard this as "changed". 357 ;; We regard this as "changed".
357 ;; Diff it against /dev/null. 358 ;; Diff it against /dev/null.
358 ;; Note: this is NOT a "svn diff". 359 ;; Note: this is NOT a "svn diff".
359 (apply 'vc-do-command "*vc-diff*" 360 (apply 'vc-do-command buffer
360 1 "diff" file 361 1 "diff" file
361 (append (vc-switches nil 'diff) '("/dev/null"))) 362 (append (vc-switches nil 'diff) '("/dev/null")))
362 ;; Even if it's empty, it's locally modified. 363 ;; Even if it's empty, it's locally modified.
@@ -365,7 +366,7 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
365 (async (and (vc-stay-local-p file) 366 (async (and (vc-stay-local-p file)
366 (or oldvers newvers) ; Svn diffs those locally. 367 (or oldvers newvers) ; Svn diffs those locally.
367 (fboundp 'start-process)))) 368 (fboundp 'start-process))))
368 (apply 'vc-svn-command "*vc-diff*" 369 (apply 'vc-svn-command buffer
369 (if async 'async 0) 370 (if async 'async 0)
370 file "diff" 371 file "diff"
371 (append 372 (append
@@ -377,7 +378,7 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
377 (if async 1 ; async diff => pessimistic assumption 378 (if async 1 ; async diff => pessimistic assumption
378 ;; For some reason `svn diff' does not return a useful 379 ;; For some reason `svn diff' does not return a useful
379 ;; status w.r.t whether the diff was empty or not. 380 ;; status w.r.t whether the diff was empty or not.
380 (buffer-size (get-buffer "*vc-diff*")))))) 381 (buffer-size (get-buffer buffer))))))
381 382
382(defun vc-svn-diff-tree (dir &optional rev1 rev2) 383(defun vc-svn-diff-tree (dir &optional rev1 rev2)
383 "Diff all files at and below DIR." 384 "Diff all files at and below DIR."
diff --git a/lisp/view.el b/lisp/view.el
index 1ee6014c73a..b17cd52ae35 100644
--- a/lisp/view.el
+++ b/lisp/view.el
@@ -137,6 +137,7 @@ subtracted from by `view-mode-exit' when finished viewing the buffer.
137See RETURN-TO-ALIST argument of function `view-mode-exit' for the format of 137See RETURN-TO-ALIST argument of function `view-mode-exit' for the format of
138`view-return-to-alist'.") 138`view-return-to-alist'.")
139(make-variable-buffer-local 'view-return-to-alist) 139(make-variable-buffer-local 'view-return-to-alist)
140(put 'view-return-to-alist 'permanent-local t)
140 141
141(defvar view-exit-action nil 142(defvar view-exit-action nil
142 "nil or a function with one argument (a buffer) called when finished viewing. 143 "nil or a function with one argument (a buffer) called when finished viewing.
diff --git a/lisp/window.el b/lisp/window.el
index 91b91cfb158..2b5a4ab161d 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -327,8 +327,9 @@ new mode line."
327 (with-current-buffer (window-buffer) 327 (with-current-buffer (window-buffer)
328 (if view-mode 328 (if view-mode
329 (let ((old-info (assq old-w view-return-to-alist))) 329 (let ((old-info (assq old-w view-return-to-alist)))
330 (push (cons new-w (cons (and old-info (car (cdr old-info))) t)) 330 (if old-info
331 view-return-to-alist))) 331 (push (cons new-w (cons (car (cdr old-info)) t))
332 view-return-to-alist))))
332 new-w)) 333 new-w))
333 334
334(defun split-window-horizontally (&optional arg) 335(defun split-window-horizontally (&optional arg)
diff --git a/lisp/x-dnd.el b/lisp/x-dnd.el
index 41e9e3e78b2..2ed5d807c36 100644
--- a/lisp/x-dnd.el
+++ b/lisp/x-dnd.el
@@ -309,14 +309,13 @@ and must have the format file:file-name or file:///file-name.
309The last / in file:/// is part of the file name. ACTION is ignored." 309The last / in file:/// is part of the file name. ACTION is ignored."
310 310
311 (let* ((f (x-dnd-get-local-file-name uri t))) 311 (let* ((f (x-dnd-get-local-file-name uri t)))
312 (when f 312 (if (and f (file-readable-p f))
313 (if (file-readable-p f) 313 (progn
314 (progn 314 (if x-dnd-open-file-other-window
315 (if x-dnd-open-file-other-window 315 (find-file-other-window f)
316 (find-file-other-window f) 316 (find-file f))
317 (find-file f)) 317 'private)
318 'private) 318 (error "Can not read %s" uri))))
319 (error "Can not read %s (%s)" f uri)))))
320 319
321(defun x-dnd-open-file (uri action) 320(defun x-dnd-open-file (uri action)
322 "Open a local or remote file. 321 "Open a local or remote file.
@@ -328,7 +327,8 @@ The last / in file://hostname/ is part of the file name."
328 ;; The hostname may be our hostname, in that case, convert to a local 327 ;; The hostname may be our hostname, in that case, convert to a local
329 ;; file. Otherwise return nil. 328 ;; file. Otherwise return nil.
330 (let ((local-file (x-dnd-get-local-file-uri uri))) 329 (let ((local-file (x-dnd-get-local-file-uri uri)))
331 (when local-file (x-dnd-open-local-file local-file action)))) 330 (if local-file (x-dnd-open-local-file local-file action)
331 (error "Remote files not supported"))))
332 332
333 333
334(defun x-dnd-handle-moz-url (window action data) 334(defun x-dnd-handle-moz-url (window action data)
diff --git a/lispintro/ChangeLog b/lispintro/ChangeLog
index 159bf98259e..728b4a3bb99 100644
--- a/lispintro/ChangeLog
+++ b/lispintro/ChangeLog
@@ -1,3 +1,7 @@
12004-04-23 Juanma Barranquero <lektu@terra.es>
2
3 * makefile.w32-in: Add "-*- makefile -*-" mode tag.
4
12004-02-29 Juanma Barranquero <lektu@terra.es> 52004-02-29 Juanma Barranquero <lektu@terra.es>
2 6
3 * makefile.w32-in (mostlyclean, clean, maintainer-clean): Use 7 * makefile.w32-in (mostlyclean, clean, maintainer-clean): Use
diff --git a/lispintro/makefile.w32-in b/lispintro/makefile.w32-in
index 7af64075bc2..a67f262bbc0 100644
--- a/lispintro/makefile.w32-in
+++ b/lispintro/makefile.w32-in
@@ -1,4 +1,4 @@
1#### Makefile for the Emacs Lisp Introduction manual 1#### -*- Makefile -*- for the Emacs Lisp Introduction manual.
2 2
3# Copyright (C) 2003 Free Software Foundation, Inc. 3# Copyright (C) 2003 Free Software Foundation, Inc.
4 4
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index 3050abb2c7b..db63d2adaa9 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,7 @@
12004-04-23 Juanma Barranquero <lektu@terra.es>
2
3 * makefile.w32-in: Add "-*- makefile -*-" mode tag.
4
12004-04-18 Jesper Harder <harder@ifa.au.dk> 52004-04-18 Jesper Harder <harder@ifa.au.dk>
2 6
3 * tips.texi (Coding Conventions): defopt -> defcustom. 7 * tips.texi (Coding Conventions): defopt -> defcustom.
diff --git a/lispref/makefile.w32-in b/lispref/makefile.w32-in
index 3ac9920fbd7..7d8dd179a56 100644
--- a/lispref/makefile.w32-in
+++ b/lispref/makefile.w32-in
@@ -1,4 +1,4 @@
1# Makefile for the GNU Emacs Lisp Reference Manual. 1# -*- Makefile -*- for the GNU Emacs Lisp Reference Manual.
2 2
3# Copyright (C) 2003 3# Copyright (C) 2003
4# Free Software Foundation, Inc. 4# Free Software Foundation, Inc.
diff --git a/man/ChangeLog b/man/ChangeLog
index 9ecdca06cad..b8bcd4129ac 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,3 +1,7 @@
12004-04-23 Juanma Barranquero <lektu@terra.es>
2
3 * makefile.w32-in: Add "-*- makefile -*-" mode tag.
4
12004-04-18 Juri Linkov <juri@jurta.org> 52004-04-18 Juri Linkov <juri@jurta.org>
2 6
3 * fixit.texi (Spelling): Remove file extension from ispell xref. 7 * fixit.texi (Spelling): Remove file extension from ispell xref.
diff --git a/man/makefile.w32-in b/man/makefile.w32-in
index c0f1a82abc1..4ca90f18dba 100644
--- a/man/makefile.w32-in
+++ b/man/makefile.w32-in
@@ -1,4 +1,4 @@
1#### Makefile for the Emacs Manual and other documentation. 1#### -*- Makefile -*- for the Emacs Manual and other documentation.
2 2
3# Copyright (C) 2003 3# Copyright (C) 2003
4# Free Software Foundation, Inc. 4# Free Software Foundation, Inc.
diff --git a/man/widget.texi b/man/widget.texi
index 290c56c6812..c919a394efe 100644
--- a/man/widget.texi
+++ b/man/widget.texi
@@ -680,7 +680,7 @@ image, with either a @file{.xpm} (if supported) or @file{.xbm} extension.
680@end deffn 680@end deffn
681 681
682@deffn{User Option} widget-glyph-enable 682@deffn{User Option} widget-glyph-enable
683If non-nil, allow glyphs to appear on displays where they are supported. 683If non-@code{nil}, allow glyphs to appear on displays where they are supported.
684@end deffn 684@end deffn
685 685
686 686
@@ -813,7 +813,7 @@ Face used for highlighting the editable field. Default is
813@item :secret 813@item :secret
814Character used to display the value. You can set this to e.g.@: @code{?*} 814Character used to display the value. You can set this to e.g.@: @code{?*}
815if the field contains a password or other secret information. By 815if the field contains a password or other secret information. By
816default, this is nil, and the value is not secret. 816default, this is @code{nil}, and the value is not secret.
817 817
818@vindex valid-regexp@r{ keyword} 818@vindex valid-regexp@r{ keyword}
819@item :valid-regexp 819@item :valid-regexp
@@ -865,12 +865,12 @@ specified @var{type} arguments.
865 865
866@vindex case-fold@r{ keyword} 866@vindex case-fold@r{ keyword}
867@item :case-fold 867@item :case-fold
868Set this to nil if you don't want to ignore case when prompting for a 868Set this to @code{nil} if you don't want to ignore case when prompting for a
869choice through the minibuffer. 869choice through the minibuffer.
870 870
871@vindex children@r{ keyword} 871@vindex children@r{ keyword}
872@item :children 872@item :children
873A list whose @code{car} is the widget representing the currently chosen 873A list whose @sc{car} is the widget representing the currently chosen
874type in the buffer. 874type in the buffer.
875 875
876@vindex choice@r{ keyword} 876@vindex choice@r{ keyword}
@@ -1064,9 +1064,9 @@ Insert a literal @samp{%}.
1064@item :greedy 1064@item :greedy
1065Usually a checklist will only match if the items are in the exact 1065Usually a checklist will only match if the items are in the exact
1066sequence given in the specification. By setting @code{:greedy} to 1066sequence given in the specification. By setting @code{:greedy} to
1067non-nil, it will allow the items to come in any sequence. However, if 1067non-@code{nil}, it will allow the items to come in any sequence.
1068you extract the value they will be in the sequence given in the 1068However, if you extract the value they will be in the sequence given
1069checklist, i.e.@: the original sequence is forgotten. 1069in the checklist, i.e.@: the original sequence is forgotten.
1070 1070
1071@vindex button-args@r{ keyword} 1071@vindex button-args@r{ keyword}
1072@item :button-args 1072@item :button-args
@@ -1141,7 +1141,7 @@ The widgets representing the elements of the list.
1141 1141
1142@vindex args@r{ keyword} 1142@vindex args@r{ keyword}
1143@item :args 1143@item :args
1144List whose @code{car} is the type of the list elements. 1144List whose @sc{car} is the type of the list elements.
1145@end table 1145@end table
1146 1146
1147@node group, , editable-list, Basic Types 1147@node group, , editable-list, Basic Types
@@ -1164,7 +1164,7 @@ The value is a list, with one member for each @var{type}.
1164@section Sexp Types 1164@section Sexp Types
1165@cindex sexp types 1165@cindex sexp types
1166 1166
1167A number of widgets for editing @dfn{s-expressions} (lisp types), sexp 1167A number of widgets for editing @dfn{s-expressions} (Lisp types), sexp
1168for short, are also available. These basically fall in several 1168for short, are also available. These basically fall in several
1169categories described in this section. 1169categories described in this section.
1170 1170
@@ -1180,7 +1180,7 @@ categories described in this section.
1180@subsection The Constant Widgets 1180@subsection The Constant Widgets
1181@cindex constant widgets 1181@cindex constant widgets
1182 1182
1183The @code{const} widget can contain any lisp expression, but the user is 1183The @code{const} widget can contain any Lisp expression, but the user is
1184prohibited from editing it, which is mainly useful as a component of one 1184prohibited from editing it, which is mainly useful as a component of one
1185of the composite widgets. 1185of the composite widgets.
1186 1186
@@ -1217,7 +1217,7 @@ An immutable symbol that is bound as a function.
1217@subsection Generic Sexp Widget 1217@subsection Generic Sexp Widget
1218@cindex generic sexp widget 1218@cindex generic sexp widget
1219 1219
1220The @code{sexp} widget can contain any lisp expression, and allows the 1220The @code{sexp} widget can contain any Lisp expression, and allows the
1221user to edit it inline in the buffer. 1221user to edit it inline in the buffer.
1222 1222
1223The syntax for the @code{sexp} widget is: 1223The syntax for the @code{sexp} widget is:
@@ -1278,8 +1278,8 @@ Keywords:
1278@table @code 1278@table @code
1279@vindex must-match@r{ keyword} 1279@vindex must-match@r{ keyword}
1280@item :must-match 1280@item :must-match
1281If this is set to non-nil, only existing file names will be allowed in 1281If this is set to non-@code{nil}, only existing file names will be
1282the minibuffer. 1282allowed in the minibuffer.
1283@end table 1283@end table
1284@end deffn 1284@end deffn
1285 1285
@@ -1289,7 +1289,7 @@ Similar to the @code{file} widget.
1289@end deffn 1289@end deffn
1290 1290
1291@deffn Widget symbol 1291@deffn Widget symbol
1292Allows you to edit a lisp symbol in an editable field. 1292Allows you to edit a Lisp symbol in an editable field.
1293@end deffn 1293@end deffn
1294 1294
1295@deffn Widget function 1295@deffn Widget function
@@ -1309,8 +1309,8 @@ Allows you to edit a number in an editable field.
1309@end deffn 1309@end deffn
1310 1310
1311@deffn Widget boolean 1311@deffn Widget boolean
1312Allows you to edit a boolean. In lisp this means a variable which is 1312Allows you to edit a boolean. In Lisp this means a variable which is
1313either nil meaning false, or non-nil meaning true. 1313either @code{nil} meaning false, or non-@code{nil} meaning true.
1314@end deffn 1314@end deffn
1315 1315
1316 1316
@@ -1330,8 +1330,8 @@ where each @var{component} must be a widget type. Each component widget
1330will be displayed in the buffer, and will be editable by the user. 1330will be displayed in the buffer, and will be editable by the user.
1331 1331
1332@deffn Widget cons 1332@deffn Widget cons
1333The value of a @code{cons} widget is a cons-cell where the @code{car} is 1333The value of a @code{cons} widget is a cons-cell where the @sc{car} is
1334the value of the first component and the @code{cdr} is the value of the 1334the value of the first component and the @sc{cdr} is the value of the
1335second component. There must be exactly two components. 1335second component. There must be exactly two components.
1336@end deffn 1336@end deffn
1337 1337
@@ -1432,7 +1432,8 @@ In @var{widget} return the value for @var{property}.
1432@end defun 1432@end defun
1433 1433
1434@defun widget-member widget property 1434@defun widget-member widget property
1435Non-nil if @var{widget} has a value (even nil) for property @var{property}. 1435Non-@code{nil} if @var{widget} has a value (even @code{nil}) for
1436property @var{property}.
1436@end defun 1437@end defun
1437 1438
1438Occasionally it can be useful to know which kind of widget you have, 1439Occasionally it can be useful to know which kind of widget you have,
@@ -1475,7 +1476,7 @@ all its ancestors.
1475@end lisp 1476@end lisp
1476 1477
1477You can check if a widget has been made inactive by examining the value 1478You can check if a widget has been made inactive by examining the value
1478of the @code{:inactive} keyword. If this is non-nil, the widget itself 1479of the @code{:inactive} keyword. If this is non-@code{nil}, the widget itself
1479has been deactivated. This is different from using the @code{:active} 1480has been deactivated. This is different from using the @code{:active}
1480keyword, in that the latter tells you if the widget @strong{or} any of 1481keyword, in that the latter tells you if the widget @strong{or} any of
1481its ancestors have been deactivated. Do not attempt to set the 1482its ancestors have been deactivated. Do not attempt to set the
@@ -1500,7 +1501,7 @@ Define a new widget type named @var{name} from @code{class}.
1500@var{name} and class should both be symbols, @code{class} should be one 1501@var{name} and class should both be symbols, @code{class} should be one
1501of the existing widget types. 1502of the existing widget types.
1502 1503
1503The third argument @var{DOC} is a documentation string for the widget. 1504The third argument @var{doc} is a documentation string for the widget.
1504 1505
1505After the new widget has been defined, the following two calls will 1506After the new widget has been defined, the following two calls will
1506create identical widgets: 1507create identical widgets:
@@ -1653,7 +1654,7 @@ Function to prompt for a value in the minibuffer. The function should
1653take four arguments, @var{widget}, @var{prompt}, @var{value}, and 1654take four arguments, @var{widget}, @var{prompt}, @var{value}, and
1654@var{unbound} and should return a value for widget entered by the user. 1655@var{unbound} and should return a value for widget entered by the user.
1655@var{prompt} is the prompt to use. @var{value} is the default value to 1656@var{prompt} is the prompt to use. @var{value} is the default value to
1656use, unless @var{unbound} is non-nil, in which case there is no default 1657use, unless @var{unbound} is non-@code{nil}, in which case there is no default
1657value. The function should read the value using the method most natural 1658value. The function should read the value using the method most natural
1658for this widget, and does not have to check that it matches. 1659for this widget, and does not have to check that it matches.
1659@end table 1660@end table
@@ -1719,7 +1720,7 @@ Keymap used in @code{widget-minor-mode}.
1719@defun widget-prompt-value widget prompt [ value unbound ] 1720@defun widget-prompt-value widget prompt [ value unbound ]
1720Prompt for a value matching @var{widget}, using @var{prompt}. 1721Prompt for a value matching @var{widget}, using @var{prompt}.
1721The current value is assumed to be @var{value}, unless @var{unbound} is 1722The current value is assumed to be @var{value}, unless @var{unbound} is
1722non-nil.@refill 1723non-@code{nil}.@refill
1723@end defun 1724@end defun
1724 1725
1725@defun widget-get-sibling widget 1726@defun widget-get-sibling widget
diff --git a/nt/ChangeLog b/nt/ChangeLog
index 0ad5e7b458f..ed3f154e5dd 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,11 @@
12004-04-23 Juanma Barranquero <lektu@terra.es>
2
3 * nmake.defs:
4 * gmake.defs:
5 * makefile.w32-in:
6 * makefile.def:
7 * makefile.nt: Add "-*- makefile -*-" mode tag.
8
12004-04-10 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de> 92004-04-10 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
2 10
3 * runemacs.c (WinMain): Let emacs environment default to parent. 11 * runemacs.c (WinMain): Let emacs environment default to parent.
diff --git a/nt/gmake.defs b/nt/gmake.defs
index 7fe580426a8..bd201cd3314 100644
--- a/nt/gmake.defs
+++ b/nt/gmake.defs
@@ -1,5 +1,4 @@
1# 1# -*- Makefile -*- definition file for building GNU Emacs on Windows NT.
2# Makefile definition file for building GNU Emacs on the Microsoft W32 API.
3# Copyright (c) 2000-2001 Free Software Foundation, Inc. 2# Copyright (c) 2000-2001 Free Software Foundation, Inc.
4# 3#
5# GNU Emacs is free software; you can redistribute it and/or modify 4# GNU Emacs is free software; you can redistribute it and/or modify
diff --git a/nt/makefile.def b/nt/makefile.def
index 224d4619b6b..e5ca430cc39 100644
--- a/nt/makefile.def
+++ b/nt/makefile.def
@@ -1,5 +1,4 @@
1# 1# -*- Makefile -*- definition file for building GNU Emacs on Windows NT
2# Makefile definition file for building GNU Emacs on Windows NT
3# Copyright (c) 1994-2001 Free Software Foundation, Inc. 2# Copyright (c) 1994-2001 Free Software Foundation, Inc.
4# 3#
5# GNU Emacs is free software; you can redistribute it and/or modify 4# GNU Emacs is free software; you can redistribute it and/or modify
diff --git a/nt/makefile.nt b/nt/makefile.nt
index 4a92f7f3e1f..43060e68fdd 100644
--- a/nt/makefile.nt
+++ b/nt/makefile.nt
@@ -1,5 +1,4 @@
1# 1# Top level -*- makefile -*- for building GNU Emacs on Windows NT
2# Top level makefile for building GNU Emacs on Windows NT
3# Copyright (c) 1993-2000 Free Software Foundation, Inc. 2# Copyright (c) 1993-2000 Free Software Foundation, Inc.
4# 3#
5# This file is part of GNU Emacs. 4# This file is part of GNU Emacs.
diff --git a/nt/makefile.w32-in b/nt/makefile.w32-in
index 915259ead65..52455a0a2d8 100644
--- a/nt/makefile.w32-in
+++ b/nt/makefile.w32-in
@@ -1,4 +1,4 @@
1# Makefile for GNU Emacs on the Microsoft W32 API. 1# -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.
2# Copyright (c) 2000-2001 Free Software Foundation, Inc. 2# Copyright (c) 2000-2001 Free Software Foundation, Inc.
3# 3#
4# Top level makefile for building GNU Emacs on Windows NT 4# Top level makefile for building GNU Emacs on Windows NT
diff --git a/nt/nmake.defs b/nt/nmake.defs
index aef2b6cf472..f4239e1a415 100644
--- a/nt/nmake.defs
+++ b/nt/nmake.defs
@@ -1,5 +1,4 @@
1# 1# -*- Makefile -*- definition file for building GNU Emacs on Windows NT.
2# Makefile definition file for building GNU Emacs on the Microsoft W32 API.
3# Copyright (c) 2000-2001 Free Software Foundation, Inc. 2# Copyright (c) 2000-2001 Free Software Foundation, Inc.
4# 3#
5# GNU Emacs is free software; you can redistribute it and/or modify 4# GNU Emacs is free software; you can redistribute it and/or modify
diff --git a/src/ChangeLog b/src/ChangeLog
index babc20c57c5..6bc622c8bff 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,110 @@
12004-04-23 Kenichi Handa <handa@m17n.org>
2
3 * fontset.c (Finternal_char_font): If POSITION is nil, return
4 font for displaying CH with the default face.
5
62004-04-23 Juanma Barranquero <lektu@terra.es>
7
8 * makefile.w32-in: Add "-*- makefile -*-" mode tag.
9
102004-04-21 Stefan Monnier <monnier@iro.umontreal.ca>
11
12 * lisp.h (XINT) [EXPLICIT_SIGN_EXTEND && !NO_UNION_TYPE]:
13 Don't make assumptions about the relative place of i and val.
14 (EQ) [!NO_UNION_TYPE]: Don't forget to check the type match as well.
15
162004-04-21 Kim F. Storm <storm@cua.dk>
17
18 * dispextern.h (struct glyph_slice): New struct.
19 (struct glyph): New member slice.
20 (GLYPH_SLICE_EQUAL_P): New macro.
21 (GLYPH_EQUAL_P): Use it.
22 (struct glyph_string): New member slice.
23 (struct it_slice): New struct.
24 (struct it): New member slice, add member to stack too.
25 New member constrain_row_ascent_descent_p.
26 (image_ascent): Add prototype.
27
28 * dispnew.c (buffer_posn_from_coords): Return full image width
29 and height even for image slices (posn is relative to full image).
30 (marginal_area_string): Adjust x0,y0 for image slice.
31
32 * image.c (image_ascent): Add slice arg; calculate ascent for
33 image slice (or full image).
34
35 * keyboard.c (Fposn_at_x_y, Fposn_at_point): New defuns.
36 (syms_of_keyboard): Defsubr them.
37
38 * lisp.h (pos_visible_p): Fix prototype.
39
40 * macterm.c (x_draw_relief_rect): Add top_p and bot_p args.
41 (x_draw_glyph_string_box): Fix call to x_draw_relief_rect.
42 (x_draw_image_foreground, x_draw_image_relief)
43 (x_draw_image_foreground_1, x_draw_image_glyph_string):
44 Draw sliced images.
45
46 * w32term.c (w32_draw_relief_rect): Add top_p and bot_p args.
47 (x_draw_glyph_string_box): Fix call to x_draw_relief_rect.
48 (x_draw_image_foreground, x_draw_image_relief)
49 (w32_draw_image_foreground_1, x_draw_image_glyph_string):
50 Draw sliced images.
51
52 * w32term.h (image_ascent): Remove prototype.
53
54 * window.c (Fpos_visible_in_window_p): Return pixel position if
55 PARTIALLY arg is non-nil. Simplify. Doc fix.
56 (Fwindow_vscroll, Fset_window_vscroll): Add optional PIXEL_P arg
57 to return/set vscroll in pixels.
58
59 * window.h (Fwindow_vscroll, Fset_window_vscroll): Fix EXFUN.
60
61 * xdisp.c (Qslice): New variable.
62 (syms_of_xdisp): Intern and staticpro it.
63 (pos_visible_p): Return pixel position in new x and y args.
64 (init_iterator): Reset it->slice info.
65 (handle_display_prop): Parse (slice ...) property.
66 (push_it, pop_it): Save/restore slice info.
67 (make_cursor_line_fully_visible): Fix 2004-04-14 change. Do not
68 force repositioning of tall row if window is vscrolled, as that
69 would reset vscroll.
70 (append_space): Set it->constrain_row_ascent_descent_p to avoid
71 increasing row height if row is non-empty.
72 (fill_image_glyph_string): Copy slice info.
73 (take_vertical_position_into_account): Simplify.
74 (produce_image_glyph): Handle iterator slice info, setup glyph
75 slice info. Do not force minimum line height.
76 (x_produce_glyphs): If it->constrain_row_ascent_descent_p is set,
77 do not increase height (ascent/descent) of non-empty row when
78 adding normal character glyph; instead reduce glyph ascent/descent
79 appropriately; if row is higher than current glyph, adjust glyph
80 descent/ascent to reposition glyph within the existing row.
81 Likewise, when char is newline, only set ascent/descent if row is
82 currently empty.
83 (note_mouse_highlight): Handle hotspots with sliced image.
84
85 * xterm.c (x_draw_relief_rect): Add top_p and bot_p args.
86 (x_draw_glyph_string_box): Fix call to x_draw_relief_rect.
87 (x_draw_image_foreground, x_draw_image_relief)
88 (x_draw_image_foreground_1, x_draw_image_glyph_string):
89 Draw sliced images.
90
91 * xterm.h (image_ascent): Remove prototype.
92
932004-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
94
95 * keymap.c (Fkey_description): Fix the usual int/Lisp_Object mixup.
96
972004-04-20 John Paul Wallington <jpw@gnu.org>
98
99 * fns.c (Fassoc, Feql): Fix indentation.
100
101 * fontset.c (regularize_fontname): Rename from regulalize_fontname.
102
1032004-04-19 John Paul Wallington <jpw@gnu.org>
104
105 * fns.c (Feql): New function.
106 (syms_of_fns): Defsubr it.
107
12004-04-18 Jason Rumney <jasonr@gnu.org> 1082004-04-18 Jason Rumney <jasonr@gnu.org>
2 109
3 * w32select.c (Fw32_set_clipboard_data): Get sequence number 110 * w32select.c (Fw32_set_clipboard_data): Get sequence number
@@ -8461,16 +8568,16 @@
84612002-07-11 Juanma Barranquero <lektu@terra.es> 85682002-07-11 Juanma Barranquero <lektu@terra.es>
8462 8569
8463 * alloc.c, buffer.c, bytecode.c, callint.c, callproc.c, coding.c, 8570 * alloc.c, buffer.c, bytecode.c, callint.c, callproc.c, coding.c,
8464 * composite.c, dired.c, dispnew.c, editfns.c, emacs.c, eval.c, 8571 composite.c, dired.c, dispnew.c, editfns.c, emacs.c, eval.c,
8465 * fileio.c, fns.c, insdel.c, keyboard.c, keymap.c, lread.c, macfns.c, 8572 fileio.c, fns.c, insdel.c, keyboard.c, keymap.c, lread.c, macfns.c,
8466 * macmenu.c, macros.c, minibuf.c, print.c, process.c, sound.c, 8573 macmenu.c, macros.c, minibuf.c, print.c, process.c, sound.c,
8467 * textprop.c, w32fns.c, w32menu.c, window.c, xfaces.c, xfns.c, 8574 textprop.c, w32fns.c, w32menu.c, window.c, xfaces.c, xfns.c,
8468 * xmenu.c, xselect.c, xterm.c: Use SPECPDL_INDEX wherever makes sense. 8575 xmenu.c, xselect.c, xterm.c: Use SPECPDL_INDEX wherever makes sense.
8469 8576
84702002-07-10 Juanma Barranquero <lektu@terra.es> 85772002-07-10 Juanma Barranquero <lektu@terra.es>
8471 8578
8472 * lisp.h (SPECPDL_INDEX): Rename from BINDING_STACK_SIZE. All callers 8579 * lisp.h (SPECPDL_INDEX): Rename from BINDING_STACK_SIZE.
8473 changed. 8580 All callers changed.
8474 8581
84752002-07-09 Stefan Monnier <monnier@cs.yale.edu> 85822002-07-09 Stefan Monnier <monnier@cs.yale.edu>
8476 8583
diff --git a/src/dispextern.h b/src/dispextern.h
index 3b71002a304..a3fc28e2491 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -274,6 +274,17 @@ enum glyph_type
274}; 274};
275 275
276 276
277/* Structure describing how to use partial glyphs (images slicing) */
278
279struct glyph_slice
280{
281 unsigned x : 16;
282 unsigned y : 16;
283 unsigned width : 16;
284 unsigned height : 16;
285};
286
287
277/* Glyphs. 288/* Glyphs.
278 289
279 Be extra careful when changing this structure! Esp. make sure that 290 Be extra careful when changing this structure! Esp. make sure that
@@ -352,6 +363,8 @@ struct glyph
352 w32_char_font_type. Otherwise it equals FONT_TYPE_UNKNOWN. */ 363 w32_char_font_type. Otherwise it equals FONT_TYPE_UNKNOWN. */
353 unsigned font_type : 3; 364 unsigned font_type : 3;
354 365
366 struct glyph_slice slice;
367
355 /* A union of sub-structures for different glyph types. */ 368 /* A union of sub-structures for different glyph types. */
356 union 369 union
357 { 370 {
@@ -390,11 +403,20 @@ struct glyph
390#define CHAR_GLYPH_SPACE_P(GLYPH) \ 403#define CHAR_GLYPH_SPACE_P(GLYPH) \
391 (GLYPH_FROM_CHAR_GLYPH ((GLYPH)) == SPACEGLYPH) 404 (GLYPH_FROM_CHAR_GLYPH ((GLYPH)) == SPACEGLYPH)
392 405
406/* Are glyph slices of glyphs *X and *Y equal */
407
408#define GLYPH_SLICE_EQUAL_P(X, Y) \
409 ((X)->slice.x == (Y)->slice.x \
410 && (X)->slice.y == (Y)->slice.y \
411 && (X)->slice.width == (Y)->slice.width \
412 && (X)->slice.height == (Y)->slice.height)
413
393/* Are glyphs *X and *Y displayed equal? */ 414/* Are glyphs *X and *Y displayed equal? */
394 415
395#define GLYPH_EQUAL_P(X, Y) \ 416#define GLYPH_EQUAL_P(X, Y) \
396 ((X)->type == (Y)->type \ 417 ((X)->type == (Y)->type \
397 && (X)->u.val == (Y)->u.val \ 418 && (X)->u.val == (Y)->u.val \
419 && GLYPH_SLICE_EQUAL_P (X, Y) \
398 && (X)->face_id == (Y)->face_id \ 420 && (X)->face_id == (Y)->face_id \
399 && (X)->padding_p == (Y)->padding_p \ 421 && (X)->padding_p == (Y)->padding_p \
400 && (X)->left_box_line_p == (Y)->left_box_line_p \ 422 && (X)->left_box_line_p == (Y)->left_box_line_p \
@@ -1139,6 +1161,9 @@ struct glyph_string
1139 /* Image, if any. */ 1161 /* Image, if any. */
1140 struct image *img; 1162 struct image *img;
1141 1163
1164 /* Slice */
1165 struct glyph_slice slice;
1166
1142 struct glyph_string *next, *prev; 1167 struct glyph_string *next, *prev;
1143}; 1168};
1144 1169
@@ -1607,7 +1632,7 @@ extern int face_change_count;
1607 width and height of the bitmap, DH is the height adjustment (if 1632 width and height of the bitmap, DH is the height adjustment (if
1608 bitmap is periodic). X and Y are frame coordinates of the area to 1633 bitmap is periodic). X and Y are frame coordinates of the area to
1609 display the bitmap, DY is relative offset of the bitmap into that 1634 display the bitmap, DY is relative offset of the bitmap into that
1610 area. BX, NX, BY, NY specifies the area to clear if the bitmap 1635 area. BX, NX, BY, NY specifies the area to clear if the bitmap
1611 does not fill the entire area. FACE is the fringe face. */ 1636 does not fill the entire area. FACE is the fringe face. */
1612 1637
1613struct draw_fringe_bitmap_params 1638struct draw_fringe_bitmap_params
@@ -1718,6 +1743,15 @@ enum prop_idx
1718}; 1743};
1719 1744
1720 1745
1746struct it_slice
1747{
1748 Lisp_Object x;
1749 Lisp_Object y;
1750 Lisp_Object width;
1751 Lisp_Object height;
1752};
1753
1754
1721struct it 1755struct it
1722{ 1756{
1723 /* The window in which we iterate over current_buffer (or a string). */ 1757 /* The window in which we iterate over current_buffer (or a string). */
@@ -1830,6 +1864,7 @@ struct it
1830 unsigned multibyte_p : 1; 1864 unsigned multibyte_p : 1;
1831 unsigned string_from_display_prop_p : 1; 1865 unsigned string_from_display_prop_p : 1;
1832 unsigned display_ellipsis_p : 1; 1866 unsigned display_ellipsis_p : 1;
1867 struct it_slice slice;
1833 Lisp_Object space_width; 1868 Lisp_Object space_width;
1834 short voffset; 1869 short voffset;
1835 Lisp_Object font_height; 1870 Lisp_Object font_height;
@@ -1884,6 +1919,10 @@ struct it
1884 skipped due to selective display. */ 1919 skipped due to selective display. */
1885 unsigned face_before_selective_p : 1; 1920 unsigned face_before_selective_p : 1;
1886 1921
1922 /* If 1, adjust current glyph so it does not increase current row
1923 descent/ascent. */
1924 unsigned constrain_row_ascent_descent_p : 1;
1925
1887 /* The ID of the default face to use. One of DEFAULT_FACE_ID, 1926 /* The ID of the default face to use. One of DEFAULT_FACE_ID,
1888 MODE_LINE_FACE_ID, etc, depending on what we are displaying. */ 1927 MODE_LINE_FACE_ID, etc, depending on what we are displaying. */
1889 int base_face_id; 1928 int base_face_id;
@@ -1909,6 +1948,9 @@ struct it
1909 /* If what == IT_IMAGE, the id of the image to display. */ 1948 /* If what == IT_IMAGE, the id of the image to display. */
1910 int image_id; 1949 int image_id;
1911 1950
1951 /* Values from `slice' property. */
1952 struct it_slice slice;
1953
1912 /* Value of the `space-width' property, if any; nil if none. */ 1954 /* Value of the `space-width' property, if any; nil if none. */
1913 Lisp_Object space_width; 1955 Lisp_Object space_width;
1914 1956
@@ -2176,7 +2218,7 @@ struct redisplay_interface
2176 int (*encode_char) P_ ((int c, XChar2b *char2b, 2218 int (*encode_char) P_ ((int c, XChar2b *char2b,
2177 struct font_info *font_into, int *two_byte_p)); 2219 struct font_info *font_into, int *two_byte_p));
2178 2220
2179/* Compute left and right overhang of glyph string S. 2221/* Compute left and right overhang of glyph string S.
2180 A NULL pointer if platform does not support this. */ 2222 A NULL pointer if platform does not support this. */
2181 void (*compute_glyph_string_overhangs) P_ ((struct glyph_string *s)); 2223 void (*compute_glyph_string_overhangs) P_ ((struct glyph_string *s));
2182 2224
@@ -2204,7 +2246,7 @@ struct redisplay_interface
2204 void (*draw_vertical_window_border) P_ ((struct window *w, 2246 void (*draw_vertical_window_border) P_ ((struct window *w,
2205 int x, int y0, int y1)); 2247 int x, int y0, int y1));
2206 2248
2207/* Shift display of frame F to make room for inserted glyphs. 2249/* Shift display of frame F to make room for inserted glyphs.
2208 The area at pixel (X,Y) of width WIDTH and height HEIGHT is 2250 The area at pixel (X,Y) of width WIDTH and height HEIGHT is
2209 shifted right by SHIFT_BY pixels. */ 2251 shifted right by SHIFT_BY pixels. */
2210 void (*shift_glyphs_for_insert) P_ ((struct frame *f, 2252 void (*shift_glyphs_for_insert) P_ ((struct frame *f,
@@ -2519,7 +2561,7 @@ extern void add_to_log P_ ((char *, Lisp_Object, Lisp_Object));
2519extern int help_echo_showing_p; 2561extern int help_echo_showing_p;
2520extern int current_mode_line_height, current_header_line_height; 2562extern int current_mode_line_height, current_header_line_height;
2521extern Lisp_Object help_echo_string, help_echo_window; 2563extern Lisp_Object help_echo_string, help_echo_window;
2522extern Lisp_Object help_echo_object, previous_help_echo_string; 2564extern Lisp_Object help_echo_object, previous_help_echo_string;
2523extern int help_echo_pos; 2565extern int help_echo_pos;
2524extern struct frame *last_mouse_frame; 2566extern struct frame *last_mouse_frame;
2525extern int last_tool_bar_item; 2567extern int last_tool_bar_item;
@@ -2629,6 +2671,8 @@ unsigned long image_background P_ ((struct image *, struct frame *,
2629int image_background_transparent P_ ((struct image *, struct frame *, 2671int image_background_transparent P_ ((struct image *, struct frame *,
2630 XImagePtr_or_DC mask)); 2672 XImagePtr_or_DC mask));
2631 2673
2674int image_ascent P_ ((struct image *, struct face *, struct glyph_slice *));
2675
2632#endif 2676#endif
2633 2677
2634/* Defined in sysdep.c */ 2678/* Defined in sysdep.c */
@@ -2733,7 +2777,7 @@ extern int required_matrix_height P_ ((struct window *));
2733extern Lisp_Object buffer_posn_from_coords P_ ((struct window *, 2777extern Lisp_Object buffer_posn_from_coords P_ ((struct window *,
2734 int *, int *, 2778 int *, int *,
2735 struct display_pos *, 2779 struct display_pos *,
2736 Lisp_Object *, 2780 Lisp_Object *,
2737 int *, int *, int *, int *)); 2781 int *, int *, int *, int *));
2738extern Lisp_Object mode_line_string P_ ((struct window *, enum window_part, 2782extern Lisp_Object mode_line_string P_ ((struct window *, enum window_part,
2739 int *, int *, int *, 2783 int *, int *, int *,
diff --git a/src/dispnew.c b/src/dispnew.c
index f65a81fc5ef..fb78aa9c275 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -5740,6 +5740,9 @@ buffer_posn_from_coords (w, x, y, pos, object, dx, dy, width, height)
5740 struct text_pos startp; 5740 struct text_pos startp;
5741 Lisp_Object string; 5741 Lisp_Object string;
5742 struct glyph_row *row; 5742 struct glyph_row *row;
5743#ifdef HAVE_WINDOW_SYSTEM
5744 struct image *img = 0;
5745#endif
5743 int x0, x1; 5746 int x0, x1;
5744 5747
5745 current_buffer = XBUFFER (w->buffer); 5748 current_buffer = XBUFFER (w->buffer);
@@ -5765,7 +5768,6 @@ buffer_posn_from_coords (w, x, y, pos, object, dx, dy, width, height)
5765#ifdef HAVE_WINDOW_SYSTEM 5768#ifdef HAVE_WINDOW_SYSTEM
5766 if (it.what == IT_IMAGE) 5769 if (it.what == IT_IMAGE)
5767 { 5770 {
5768 struct image *img;
5769 if ((img = IMAGE_FROM_ID (it.f, it.image_id)) != NULL 5771 if ((img = IMAGE_FROM_ID (it.f, it.image_id)) != NULL
5770 && !NILP (img->spec)) 5772 && !NILP (img->spec))
5771 *object = img->spec; 5773 *object = img->spec;
@@ -5778,12 +5780,22 @@ buffer_posn_from_coords (w, x, y, pos, object, dx, dy, width, height)
5778 if (it.hpos < row->used[TEXT_AREA]) 5780 if (it.hpos < row->used[TEXT_AREA])
5779 { 5781 {
5780 struct glyph *glyph = row->glyphs[TEXT_AREA] + it.hpos; 5782 struct glyph *glyph = row->glyphs[TEXT_AREA] + it.hpos;
5781 *width = glyph->pixel_width;
5782 *height = glyph->ascent + glyph->descent;
5783#ifdef HAVE_WINDOW_SYSTEM 5783#ifdef HAVE_WINDOW_SYSTEM
5784 if (glyph->type == IMAGE_GLYPH) 5784 if (img)
5785 *dy -= row->ascent - glyph->ascent; 5785 {
5786 *dy -= row->ascent - glyph->ascent;
5787 *dx += glyph->slice.x;
5788 *dy += glyph->slice.y;
5789 /* Image slices positions are still relative to the entire image */
5790 *width = img->width;
5791 *height = img->height;
5792 }
5793 else
5786#endif 5794#endif
5795 {
5796 *width = glyph->pixel_width;
5797 *height = glyph->ascent + glyph->descent;
5798 }
5787 } 5799 }
5788 else 5800 else
5789 { 5801 {
@@ -5949,6 +5961,8 @@ marginal_area_string (w, part, x, y, charpos, object, dx, dy, width, height)
5949 if (img != NULL) 5961 if (img != NULL)
5950 *object = img->spec; 5962 *object = img->spec;
5951 y0 -= row->ascent - glyph->ascent; 5963 y0 -= row->ascent - glyph->ascent;
5964 x0 += glyph->slice.x;
5965 y0 += glyph->slice.y;
5952 } 5966 }
5953#endif 5967#endif
5954 } 5968 }
diff --git a/src/fns.c b/src/fns.c
index adb262ee11d..bb215317864 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -1560,7 +1560,7 @@ assq_no_quit (key, list)
1560DEFUN ("assoc", Fassoc, Sassoc, 2, 2, 0, 1560DEFUN ("assoc", Fassoc, Sassoc, 2, 2, 0,
1561 doc: /* Return non-nil if KEY is `equal' to the car of an element of LIST. 1561 doc: /* Return non-nil if KEY is `equal' to the car of an element of LIST.
1562The value is actually the first element of LIST whose car equals KEY. */) 1562The value is actually the first element of LIST whose car equals KEY. */)
1563 (key, list) 1563 (key, list)
1564 Lisp_Object key, list; 1564 Lisp_Object key, list;
1565{ 1565{
1566 Lisp_Object result, car; 1566 Lisp_Object result, car;
@@ -2135,6 +2135,18 @@ The PLIST is modified by side effects. */)
2135 return plist; 2135 return plist;
2136} 2136}
2137 2137
2138DEFUN ("eql", Feql, Seql, 2, 2, 0,
2139 doc: /* Return t if the two args are the same Lisp object.
2140Floating-point numbers of equal value are `eql', but they may not be `eq'. */)
2141 (obj1, obj2)
2142 Lisp_Object obj1, obj2;
2143{
2144 if (FLOATP (obj1))
2145 return internal_equal (obj1, obj2, 0, 0) ? Qt : Qnil;
2146 else
2147 return EQ (obj1, obj2) ? Qt : Qnil;
2148}
2149
2138DEFUN ("equal", Fequal, Sequal, 2, 2, 0, 2150DEFUN ("equal", Fequal, Sequal, 2, 2, 0,
2139 doc: /* Return t if two Lisp objects have similar structure and contents. 2151 doc: /* Return t if two Lisp objects have similar structure and contents.
2140They must have the same data type. 2152They must have the same data type.
@@ -5740,6 +5752,7 @@ used if both `use-dialog-box' and this variable are non-nil. */);
5740 defsubr (&Sput); 5752 defsubr (&Sput);
5741 defsubr (&Slax_plist_get); 5753 defsubr (&Slax_plist_get);
5742 defsubr (&Slax_plist_put); 5754 defsubr (&Slax_plist_put);
5755 defsubr (&Seql);
5743 defsubr (&Sequal); 5756 defsubr (&Sequal);
5744 defsubr (&Sequal_including_properties); 5757 defsubr (&Sequal_including_properties);
5745 defsubr (&Sfillarray); 5758 defsubr (&Sfillarray);
diff --git a/src/fontset.c b/src/fontset.c
index ad9dd3ccd2f..aae6b9296ae 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -195,7 +195,7 @@ static Lisp_Object make_fontset P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
195static int fontset_id_valid_p P_ ((int)); 195static int fontset_id_valid_p P_ ((int));
196static Lisp_Object fontset_pattern_regexp P_ ((Lisp_Object)); 196static Lisp_Object fontset_pattern_regexp P_ ((Lisp_Object));
197static Lisp_Object font_family_registry P_ ((Lisp_Object, int)); 197static Lisp_Object font_family_registry P_ ((Lisp_Object, int));
198static Lisp_Object regulalize_fontname P_ ((Lisp_Object)); 198static Lisp_Object regularize_fontname P_ ((Lisp_Object));
199 199
200 200
201/********** MACROS AND FUNCTIONS TO HANDLE FONTSET **********/ 201/********** MACROS AND FUNCTIONS TO HANDLE FONTSET **********/
@@ -1043,7 +1043,7 @@ check_fontset_name (name)
1043 string, maybe change FONTNAME to (FAMILY . REGISTRY). */ 1043 string, maybe change FONTNAME to (FAMILY . REGISTRY). */
1044 1044
1045static Lisp_Object 1045static Lisp_Object
1046regulalize_fontname (Lisp_Object fontname) 1046regularize_fontname (Lisp_Object fontname)
1047{ 1047{
1048 Lisp_Object family, registry; 1048 Lisp_Object family, registry;
1049 1049
@@ -1133,7 +1133,7 @@ name of a font, REGISTRY is a registry name of a font. */)
1133 if (!NILP (frame)) 1133 if (!NILP (frame))
1134 CHECK_LIVE_FRAME (frame); 1134 CHECK_LIVE_FRAME (frame);
1135 1135
1136 elt = Fcons (make_number (from), regulalize_fontname (fontname)); 1136 elt = Fcons (make_number (from), regularize_fontname (fontname));
1137 for (; from <= to; from++) 1137 for (; from <= to; from++)
1138 FONTSET_SET (fontset, from, elt); 1138 FONTSET_SET (fontset, from, elt);
1139 Foptimize_char_table (fontset); 1139 Foptimize_char_table (fontset);
@@ -1212,7 +1212,10 @@ If the named font is not yet loaded, return nil. */)
1212/* Return a cons (FONT-NAME . GLYPH-CODE). 1212/* Return a cons (FONT-NAME . GLYPH-CODE).
1213 FONT-NAME is the font name for the character at POSITION in the current 1213 FONT-NAME is the font name for the character at POSITION in the current
1214 buffer. This is computed from all the text properties and overlays 1214 buffer. This is computed from all the text properties and overlays
1215 that apply to POSITION. 1215 that apply to POSITION. POSTION may be nil, in which case,
1216 FONT-NAME is the font name for display the character CH with the
1217 default face.
1218
1216 GLYPH-CODE is the glyph code in the font to use for the character. 1219 GLYPH-CODE is the glyph code in the font to use for the character.
1217 1220
1218 If the 2nd optional arg CH is non-nil, it is a character to check 1221 If the 2nd optional arg CH is non-nil, it is a character to check
@@ -1225,7 +1228,8 @@ If the named font is not yet loaded, return nil. */)
1225 1228
1226 (2) The character code is invalid. 1229 (2) The character code is invalid.
1227 1230
1228 (3) The current buffer is not displayed in any window. 1231 (3) If POSITION is not nil, and the current buffer is not displayed
1232 in any window.
1229 1233
1230 In addition, the returned font name may not take into account of 1234 In addition, the returned font name may not take into account of
1231 such redisplay engine hooks as what used in jit-lock-mode if 1235 such redisplay engine hooks as what used in jit-lock-mode if
@@ -1240,31 +1244,42 @@ DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 2, 0,
1240 int pos, pos_byte, dummy; 1244 int pos, pos_byte, dummy;
1241 int face_id; 1245 int face_id;
1242 int c, code; 1246 int c, code;
1243 Lisp_Object window;
1244 struct window *w;
1245 struct frame *f; 1247 struct frame *f;
1246 struct face *face; 1248 struct face *face;
1247 1249
1248 CHECK_NUMBER_COERCE_MARKER (position); 1250 if (NILP (position))
1249 pos = XINT (position);
1250 if (pos < BEGV || pos >= ZV)
1251 args_out_of_range_3 (position, make_number (BEGV), make_number (ZV));
1252 pos_byte = CHAR_TO_BYTE (pos);
1253 if (NILP (ch))
1254 c = FETCH_CHAR (pos_byte);
1255 else
1256 { 1251 {
1257 CHECK_NATNUM (ch); 1252 CHECK_NATNUM (ch);
1258 c = XINT (ch); 1253 c = XINT (ch);
1254 f = XFRAME (selected_frame);
1255 face_id = DEFAULT_FACE_ID;
1256 }
1257 else
1258 {
1259 Lisp_Object window;
1260 struct window *w;
1261
1262 CHECK_NUMBER_COERCE_MARKER (position);
1263 pos = XINT (position);
1264 if (pos < BEGV || pos >= ZV)
1265 args_out_of_range_3 (position, make_number (BEGV), make_number (ZV));
1266 pos_byte = CHAR_TO_BYTE (pos);
1267 if (NILP (ch))
1268 c = FETCH_CHAR (pos_byte);
1269 else
1270 {
1271 CHECK_NATNUM (ch);
1272 c = XINT (ch);
1273 }
1274 window = Fget_buffer_window (Fcurrent_buffer (), Qnil);
1275 if (NILP (window))
1276 return Qnil;
1277 w = XWINDOW (window);
1278 f = XFRAME (w->frame);
1279 face_id = face_at_buffer_position (w, pos, -1, -1, &dummy, pos + 100, 0);
1259 } 1280 }
1260 if (! CHAR_VALID_P (c, 0)) 1281 if (! CHAR_VALID_P (c, 0))
1261 return Qnil; 1282 return Qnil;
1262 window = Fget_buffer_window (Fcurrent_buffer (), Qnil);
1263 if (NILP (window))
1264 return Qnil;
1265 w = XWINDOW (window);
1266 f = XFRAME (w->frame);
1267 face_id = face_at_buffer_position (w, pos, -1, -1, &dummy, pos + 100, 0);
1268 face_id = FACE_FOR_CHAR (f, FACE_FROM_ID (f, face_id), c); 1283 face_id = FACE_FOR_CHAR (f, FACE_FROM_ID (f, face_id), c);
1269 face = FACE_FROM_ID (f, face_id); 1284 face = FACE_FROM_ID (f, face_id);
1270 if (! face->font || ! face->font_name) 1285 if (! face->font || ! face->font_name)
@@ -1540,7 +1555,7 @@ It is intended that this function is called only from
1540 1555
1541 elt = XCAR (tail); 1556 elt = XCAR (tail);
1542 target = Fcar (elt); 1557 target = Fcar (elt);
1543 elt = Fcons (Qnil, regulalize_fontname (Fcdr (elt))); 1558 elt = Fcons (Qnil, regularize_fontname (Fcdr (elt)));
1544 if (! CHAR_TABLE_P (target)) 1559 if (! CHAR_TABLE_P (target))
1545 { 1560 {
1546 int charset, c; 1561 int charset, c;
diff --git a/src/image.c b/src/image.c
index 66b004220d1..4c2bdb440e8 100644
--- a/src/image.c
+++ b/src/image.c
@@ -1076,13 +1076,21 @@ prepare_image_for_display (f, img)
1076 drawn in face FACE. */ 1076 drawn in face FACE. */
1077 1077
1078int 1078int
1079image_ascent (img, face) 1079image_ascent (img, face, slice)
1080 struct image *img; 1080 struct image *img;
1081 struct face *face; 1081 struct face *face;
1082 struct glyph_slice *slice;
1082{ 1083{
1083 int height = img->height + img->vmargin; 1084 int height;
1084 int ascent; 1085 int ascent;
1085 1086
1087 if (slice->height == img->height)
1088 height = img->height + img->vmargin;
1089 else if (slice->y == 0)
1090 height = slice->height + img->vmargin;
1091 else
1092 height = slice->height;
1093
1086 if (img->ascent == CENTERED_IMAGE_ASCENT) 1094 if (img->ascent == CENTERED_IMAGE_ASCENT)
1087 { 1095 {
1088 if (face->font) 1096 if (face->font)
diff --git a/src/keyboard.c b/src/keyboard.c
index 330eef60c1e..2a1c1c89e87 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -10618,6 +10618,61 @@ The elements of this list correspond to the arguments of
10618 return Flist (sizeof (val) / sizeof (val[0]), val); 10618 return Flist (sizeof (val) / sizeof (val[0]), val);
10619} 10619}
10620 10620
10621DEFUN ("posn-at-x-y", Fposn_at_x_y, Sposn_at_x_y, 2, 3, 0,
10622 doc: /* Return position information for pixel coordinates X and Y.
10623By default, X and Y are relative to text area of the selected window.
10624Optional third arg FRAME_OR_WINDOW non-nil specifies frame or window.
10625
10626The return value is similar to a mouse click position:
10627 (WINDOW AREA-OR-POS (X . Y) TIMESTAMP OBJECT POS (COL . ROW)
10628 IMAGE (DX . DY) (WIDTH . HEIGHT))
10629The `posn-' functions access elements of such lists. */)
10630 (x, y, frame_or_window)
10631 Lisp_Object x, y, frame_or_window;
10632{
10633 if (NILP (frame_or_window))
10634 frame_or_window = selected_window;
10635
10636 if (WINDOWP (frame_or_window))
10637 {
10638 struct window *w;
10639
10640 CHECK_LIVE_WINDOW (frame_or_window);
10641
10642 w = XWINDOW (frame_or_window);
10643 XSETINT (x, (WINDOW_TO_FRAME_PIXEL_X (w, XINT (x))
10644 + window_box_left_offset (w, TEXT_AREA)));
10645 XSETINT (y, WINDOW_TO_FRAME_PIXEL_Y (w, XINT (y)));
10646 frame_or_window = w->frame;
10647 }
10648
10649 CHECK_LIVE_FRAME (frame_or_window);
10650
10651 return make_lispy_position (XFRAME (frame_or_window), &x, &y, 0);
10652}
10653
10654DEFUN ("posn-at-point", Fposn_at_point, Sposn_at_point, 0, 2, 0,
10655 doc: /* Return position information for buffer POS in WINDOW.
10656POS defaults to point in WINDOW; WINDOW defaults to the selected window.
10657
10658Return nil if position is not visible in window. Otherwise,
10659the return value is similar to that returned by event-start for
10660a mouse click at the upper left corner of the glyph corresponding
10661to the given buffer position:
10662 (WINDOW AREA-OR-POS (X . Y) TIMESTAMP OBJECT POS (COL . ROW)
10663 IMAGE (DX . DY) (WIDTH . HEIGHT))
10664The `posn-' functions access elements of such lists. */*/)
10665 (pos, window)
10666 Lisp_Object pos, window;
10667{
10668 Lisp_Object tem;
10669
10670 tem = Fpos_visible_in_window_p (pos, window, Qt);
10671 if (!NILP (tem))
10672 tem = Fposn_at_x_y (XCAR (tem), XCAR (XCDR (tem)), window);
10673 return tem;
10674}
10675
10621 10676
10622/* 10677/*
10623 * Set up a new kboard object with reasonable initial values. 10678 * Set up a new kboard object with reasonable initial values.
@@ -11047,6 +11102,8 @@ syms_of_keyboard ()
11047 defsubr (&Sset_input_mode); 11102 defsubr (&Sset_input_mode);
11048 defsubr (&Scurrent_input_mode); 11103 defsubr (&Scurrent_input_mode);
11049 defsubr (&Sexecute_extended_command); 11104 defsubr (&Sexecute_extended_command);
11105 defsubr (&Sposn_at_point);
11106 defsubr (&Sposn_at_x_y);
11050 11107
11051 DEFVAR_LISP ("last-command-char", &last_command_char, 11108 DEFVAR_LISP ("last-command-char", &last_command_char,
11052 doc: /* Last input event that was part of a command. */); 11109 doc: /* Last input event that was part of a command. */);
diff --git a/src/keymap.c b/src/keymap.c
index 0e68c38d677..a4aeea8ae63 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1959,14 +1959,14 @@ spaces are put between sequence elements, etc. */)
1959 int len = 0; 1959 int len = 0;
1960 int i, i_byte; 1960 int i, i_byte;
1961 Lisp_Object *args; 1961 Lisp_Object *args;
1962 int size = Flength (keys); 1962 int size = XINT (Flength (keys));
1963 Lisp_Object list; 1963 Lisp_Object list;
1964 Lisp_Object sep = build_string (" "); 1964 Lisp_Object sep = build_string (" ");
1965 Lisp_Object key; 1965 Lisp_Object key;
1966 int add_meta = 0; 1966 int add_meta = 0;
1967 1967
1968 if (!NILP (prefix)) 1968 if (!NILP (prefix))
1969 size += Flength (prefix); 1969 size += XINT (Flength (prefix));
1970 1970
1971 /* This has one extra element at the end that we don't pass to Fconcat. */ 1971 /* This has one extra element at the end that we don't pass to Fconcat. */
1972 args = (Lisp_Object *) alloca (size * 4 * sizeof (Lisp_Object)); 1972 args = (Lisp_Object *) alloca (size * 4 * sizeof (Lisp_Object));
@@ -1997,7 +1997,7 @@ spaces are put between sequence elements, etc. */)
1997 else if (VECTORP (list)) 1997 else if (VECTORP (list))
1998 size = XVECTOR (list)->size; 1998 size = XVECTOR (list)->size;
1999 else if (CONSP (list)) 1999 else if (CONSP (list))
2000 size = Flength (list); 2000 size = XINT (Flength (list));
2001 else 2001 else
2002 wrong_type_argument (Qarrayp, list); 2002 wrong_type_argument (Qarrayp, list);
2003 2003
diff --git a/src/lisp.h b/src/lisp.h
index 48b9c0c7912..bc67f4dbe67 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -382,7 +382,7 @@ enum pvec_type
382 382
383#ifdef EXPLICIT_SIGN_EXTEND 383#ifdef EXPLICIT_SIGN_EXTEND
384/* Make sure we sign-extend; compilers have been known to fail to do so. */ 384/* Make sure we sign-extend; compilers have been known to fail to do so. */
385#define XINT(a) (((a).i << (BITS_PER_EMACS_INT - VALBITS)) \ 385#define XINT(a) (((a).s.val << (BITS_PER_EMACS_INT - VALBITS)) \
386 >> (BITS_PER_EMACS_INT - VALBITS)) 386 >> (BITS_PER_EMACS_INT - VALBITS))
387#else 387#else
388#define XINT(a) ((a).s.val) 388#define XINT(a) ((a).s.val)
@@ -400,7 +400,7 @@ enum pvec_type
400extern Lisp_Object make_number (); 400extern Lisp_Object make_number ();
401#endif 401#endif
402 402
403#define EQ(x, y) ((x).s.val == (y).s.val) 403#define EQ(x, y) ((x).s.val == (y).s.val && (x).s.type == (y).s.type)
404 404
405#endif /* NO_UNION_TYPE */ 405#endif /* NO_UNION_TYPE */
406 406
@@ -2391,7 +2391,8 @@ void set_frame_cursor_types P_ ((struct frame *, Lisp_Object));
2391extern void syms_of_xdisp P_ ((void)); 2391extern void syms_of_xdisp P_ ((void));
2392extern void init_xdisp P_ ((void)); 2392extern void init_xdisp P_ ((void));
2393extern Lisp_Object safe_eval P_ ((Lisp_Object)); 2393extern Lisp_Object safe_eval P_ ((Lisp_Object));
2394extern int pos_visible_p P_ ((struct window *, int, int *, int)); 2394extern int pos_visible_p P_ ((struct window *, int, int *,
2395 int *, int *, int));
2395 2396
2396/* Defined in vm-limit.c. */ 2397/* Defined in vm-limit.c. */
2397extern void memory_warnings P_ ((POINTER_TYPE *, void (*warnfun) ())); 2398extern void memory_warnings P_ ((POINTER_TYPE *, void (*warnfun) ()));
diff --git a/src/macterm.c b/src/macterm.c
index 93f3e734724..88f5fce468c 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -294,7 +294,6 @@ void deactivate_scroll_bars (FRAME_PTR);
294 294
295static int is_emacs_window (WindowPtr); 295static int is_emacs_window (WindowPtr);
296 296
297extern int image_ascent (struct image *, struct face *);
298int x_bitmap_icon (struct frame *, Lisp_Object); 297int x_bitmap_icon (struct frame *, Lisp_Object);
299void x_make_frame_visible (struct frame *); 298void x_make_frame_visible (struct frame *);
300 299
@@ -311,7 +310,7 @@ XFreePixmap (display, pixmap)
311 Display *display; /* not used */ 310 Display *display; /* not used */
312 Pixmap pixmap; 311 Pixmap pixmap;
313{ 312{
314 DisposeGWorld (pixmap); 313 DisposeGWorld (pixmap);
315} 314}
316 315
317 316
@@ -1283,7 +1282,7 @@ mac_draw_vertical_window_border (w, x, y0, y1)
1283 int x, y0, y1; 1282 int x, y0, y1;
1284{ 1283{
1285 struct frame *f = XFRAME (WINDOW_FRAME (w)); 1284 struct frame *f = XFRAME (WINDOW_FRAME (w));
1286 1285
1287 XDrawLine (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f), 1286 XDrawLine (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f),
1288 f->output_data.mac->normal_gc, x, y0, x, y1); 1287 f->output_data.mac->normal_gc, x, y0, x, y1);
1289} 1288}
@@ -1525,7 +1524,7 @@ x_draw_fringe_bitmap (w, row, p)
1525 : face->foreground); 1524 : face->foreground);
1526 gcv.background = face->background; 1525 gcv.background = face->background;
1527 1526
1528 mac_draw_bitmap (display, window, &gcv, p->x, p->y, 1527 mac_draw_bitmap (display, window, &gcv, p->x, p->y,
1529 p->wd, p->h, bits, p->overlay_p); 1528 p->wd, p->h, bits, p->overlay_p);
1530 } 1529 }
1531 1530
@@ -1759,7 +1758,8 @@ static void x_draw_image_foreground_1 P_ ((struct glyph_string *, Pixmap));
1759static void x_clear_glyph_string_rect P_ ((struct glyph_string *, int, 1758static void x_clear_glyph_string_rect P_ ((struct glyph_string *, int,
1760 int, int, int)); 1759 int, int, int));
1761static void x_draw_relief_rect P_ ((struct frame *, int, int, int, int, 1760static void x_draw_relief_rect P_ ((struct frame *, int, int, int, int,
1762 int, int, int, int, Rect *)); 1761 int, int, int, int, int, int,
1762 Rect *));
1763static void x_draw_box_rect P_ ((struct glyph_string *, int, int, int, int, 1763static void x_draw_box_rect P_ ((struct glyph_string *, int, int, int, int,
1764 int, int, int, Rect *)); 1764 int, int, int, Rect *));
1765 1765
@@ -2483,9 +2483,10 @@ x_setup_relief_colors (s)
2483 2483
2484static void 2484static void
2485x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width, 2485x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
2486 raised_p, left_p, right_p, clip_rect) 2486 raised_p, top_p, bot_p, left_p, right_p, clip_rect)
2487 struct frame *f; 2487 struct frame *f;
2488 int left_x, top_y, right_x, bottom_y, width, left_p, right_p, raised_p; 2488 int left_x, top_y, right_x, bottom_y, width;
2489 int top_p, bot_p, left_p, right_p, raised_p;
2489 Rect *clip_rect; 2490 Rect *clip_rect;
2490{ 2491{
2491 Display *dpy = FRAME_MAC_DISPLAY (f); 2492 Display *dpy = FRAME_MAC_DISPLAY (f);
@@ -2500,10 +2501,11 @@ x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
2500 mac_set_clip_rectangle (dpy, window, clip_rect); 2501 mac_set_clip_rectangle (dpy, window, clip_rect);
2501 2502
2502 /* Top. */ 2503 /* Top. */
2503 for (i = 0; i < width; ++i) 2504 if (top_p)
2504 XDrawLine (dpy, window, gc, 2505 for (i = 0; i < width; ++i)
2505 left_x + i * left_p, top_y + i, 2506 XDrawLine (dpy, window, gc,
2506 right_x - i * right_p, top_y + i); 2507 left_x + i * left_p, top_y + i,
2508 right_x - i * right_p, top_y + i);
2507 2509
2508 /* Left. */ 2510 /* Left. */
2509 if (left_p) 2511 if (left_p)
@@ -2520,10 +2522,11 @@ x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
2520 clip_rect); 2522 clip_rect);
2521 2523
2522 /* Bottom. */ 2524 /* Bottom. */
2523 for (i = 0; i < width; ++i) 2525 if (bot_p)
2524 XDrawLine (dpy, window, gc, 2526 for (i = 0; i < width; ++i)
2525 left_x + i * left_p, bottom_y - i, 2527 XDrawLine (dpy, window, gc,
2526 right_x - i * right_p, bottom_y - i); 2528 left_x + i * left_p, bottom_y - i,
2529 right_x - i * right_p, bottom_y - i);
2527 2530
2528 /* Right. */ 2531 /* Right. */
2529 if (right_p) 2532 if (right_p)
@@ -2629,7 +2632,7 @@ x_draw_glyph_string_box (s)
2629 { 2632 {
2630 x_setup_relief_colors (s); 2633 x_setup_relief_colors (s);
2631 x_draw_relief_rect (s->f, left_x, top_y, right_x, bottom_y, 2634 x_draw_relief_rect (s->f, left_x, top_y, right_x, bottom_y,
2632 width, raised_p, left_p, right_p, &clip_rect); 2635 width, raised_p, 1, 1, left_p, right_p, &clip_rect);
2633 } 2636 }
2634} 2637}
2635 2638
@@ -2640,21 +2643,22 @@ static void
2640x_draw_image_foreground (s) 2643x_draw_image_foreground (s)
2641 struct glyph_string *s; 2644 struct glyph_string *s;
2642{ 2645{
2643 int x; 2646 int x = s->x;
2644 int y = s->ybase - image_ascent (s->img, s->face); 2647 int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
2645 2648
2646 /* If first glyph of S has a left box line, start drawing it to the 2649 /* If first glyph of S has a left box line, start drawing it to the
2647 right of that line. */ 2650 right of that line. */
2648 if (s->face->box != FACE_NO_BOX 2651 if (s->face->box != FACE_NO_BOX
2649 && s->first_glyph->left_box_line_p) 2652 && s->first_glyph->left_box_line_p
2650 x = s->x + abs (s->face->box_line_width); 2653 && s->slice.x == 0)
2651 else 2654 x += abs (s->face->box_line_width);
2652 x = s->x;
2653 2655
2654 /* If there is a margin around the image, adjust x- and y-position 2656 /* If there is a margin around the image, adjust x- and y-position
2655 by that margin. */ 2657 by that margin. */
2656 x += s->img->hmargin; 2658 if (s->slice.x == 0)
2657 y += s->img->vmargin; 2659 x += s->img->hmargin;
2660 if (s->slice.y == 0)
2661 y += s->img->vmargin;
2658 2662
2659 if (s->img->pixmap) 2663 if (s->img->pixmap)
2660 { 2664 {
@@ -2667,11 +2671,12 @@ x_draw_image_foreground (s)
2667 CONVERT_TO_XRECT (clip_rect, nr); 2671 CONVERT_TO_XRECT (clip_rect, nr);
2668 image_rect.x = x; 2672 image_rect.x = x;
2669 image_rect.y = y; 2673 image_rect.y = y;
2670 image_rect.width = s->img->width; 2674 image_rect.width = s->slice.width;
2671 image_rect.height = s->img->height; 2675 image_rect.height = s->slice.height;
2672 if (x_intersect_rectangles (&clip_rect, &image_rect, &r)) 2676 if (x_intersect_rectangles (&clip_rect, &image_rect, &r))
2673 mac_copy_area_with_mask (s->display, s->img->pixmap, s->img->mask, 2677 mac_copy_area_with_mask (s->display, s->img->pixmap, s->img->mask,
2674 s->window, s->gc, r.x - x, r.y - y, 2678 s->window, s->gc,
2679 s->slice.x + r.x - x, s->slice.y + r.y - y,
2675 r.width, r.height, r.x, r.y); 2680 r.width, r.height, r.x, r.y);
2676 } 2681 }
2677 else 2682 else
@@ -2683,11 +2688,12 @@ x_draw_image_foreground (s)
2683 CONVERT_TO_XRECT (clip_rect, nr); 2688 CONVERT_TO_XRECT (clip_rect, nr);
2684 image_rect.x = x; 2689 image_rect.x = x;
2685 image_rect.y = y; 2690 image_rect.y = y;
2686 image_rect.width = s->img->width; 2691 image_rect.width = s->slice.width;
2687 image_rect.height = s->img->height; 2692 image_rect.height = s->slice.height;
2688 if (x_intersect_rectangles (&clip_rect, &image_rect, &r)) 2693 if (x_intersect_rectangles (&clip_rect, &image_rect, &r))
2689 mac_copy_area (s->display, s->img->pixmap, s->window, s->gc, 2694 mac_copy_area (s->display, s->img->pixmap, s->window, s->gc,
2690 r.x - x, r.y - y, r.width, r.height, r.x, r.y); 2695 s->slice.x + r.x - x, s->slice.y + r.y - y,
2696 r.width, r.height, r.x, r.y);
2691 2697
2692 /* When the image has a mask, we can expect that at 2698 /* When the image has a mask, we can expect that at
2693 least part of a mouse highlight or a block cursor will 2699 least part of a mouse highlight or a block cursor will
@@ -2699,15 +2705,17 @@ x_draw_image_foreground (s)
2699 { 2705 {
2700 int r = s->img->relief; 2706 int r = s->img->relief;
2701 if (r < 0) r = -r; 2707 if (r < 0) r = -r;
2702 mac_draw_rectangle (s->display, s->window, s->gc, x - r, y - r, 2708 mac_draw_rectangle (s->display, s->window, s->gc,
2703 s->img->width + r*2 - 1, s->img->height + r*2 - 1); 2709 x - r, y - r,
2710 s->slice.width + r*2 - 1,
2711 s->slice.height + r*2 - 1);
2704 } 2712 }
2705 } 2713 }
2706 } 2714 }
2707 else 2715 else
2708 /* Draw a rectangle if image could not be loaded. */ 2716 /* Draw a rectangle if image could not be loaded. */
2709 mac_draw_rectangle (s->display, s->window, s->gc, x, y, 2717 mac_draw_rectangle (s->display, s->window, s->gc, x, y,
2710 s->img->width - 1, s->img->height - 1); 2718 s->slice.width - 1, s->slice.height - 1);
2711} 2719}
2712 2720
2713 2721
@@ -2719,21 +2727,22 @@ x_draw_image_relief (s)
2719{ 2727{
2720 int x0, y0, x1, y1, thick, raised_p; 2728 int x0, y0, x1, y1, thick, raised_p;
2721 Rect r; 2729 Rect r;
2722 int x; 2730 int x = s->x;
2723 int y = s->ybase - image_ascent (s->img, s->face); 2731 int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
2724 2732
2725 /* If first glyph of S has a left box line, start drawing it to the 2733 /* If first glyph of S has a left box line, start drawing it to the
2726 right of that line. */ 2734 right of that line. */
2727 if (s->face->box != FACE_NO_BOX 2735 if (s->face->box != FACE_NO_BOX
2728 && s->first_glyph->left_box_line_p) 2736 && s->first_glyph->left_box_line_p
2729 x = s->x + abs (s->face->box_line_width); 2737 && s->slice.x == 0)
2730 else 2738 x += abs (s->face->box_line_width);
2731 x = s->x;
2732 2739
2733 /* If there is a margin around the image, adjust x- and y-position 2740 /* If there is a margin around the image, adjust x- and y-position
2734 by that margin. */ 2741 by that margin. */
2735 x += s->img->hmargin; 2742 if (s->slice.x == 0)
2736 y += s->img->vmargin; 2743 x += s->img->hmargin;
2744 if (s->slice.y == 0)
2745 y += s->img->vmargin;
2737 2746
2738 if (s->hl == DRAW_IMAGE_SUNKEN 2747 if (s->hl == DRAW_IMAGE_SUNKEN
2739 || s->hl == DRAW_IMAGE_RAISED) 2748 || s->hl == DRAW_IMAGE_RAISED)
@@ -2749,12 +2758,17 @@ x_draw_image_relief (s)
2749 2758
2750 x0 = x - thick; 2759 x0 = x - thick;
2751 y0 = y - thick; 2760 y0 = y - thick;
2752 x1 = x + s->img->width + thick - 1; 2761 x1 = x + s->slice.width + thick - 1;
2753 y1 = y + s->img->height + thick - 1; 2762 y1 = y + s->slice.height + thick - 1;
2754 2763
2755 x_setup_relief_colors (s); 2764 x_setup_relief_colors (s);
2756 get_glyph_string_clip_rect (s, &r); 2765 get_glyph_string_clip_rect (s, &r);
2757 x_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p, 1, 1, &r); 2766 x_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p,
2767 s->slice.y == 0,
2768 s->slice.y + s->slice.height == s->img->height,
2769 s->slice.x == 0,
2770 s->slice.x + s->slice.width == s->img->width,
2771 &r);
2758} 2772}
2759 2773
2760 2774
@@ -2765,33 +2779,37 @@ x_draw_image_foreground_1 (s, pixmap)
2765 struct glyph_string *s; 2779 struct glyph_string *s;
2766 Pixmap pixmap; 2780 Pixmap pixmap;
2767{ 2781{
2768 int x; 2782 int x = 0;
2769 int y = s->ybase - s->y - image_ascent (s->img, s->face); 2783 int y = s->ybase - s->y - image_ascent (s->img, s->face, &s->slice);
2770 2784
2771 /* If first glyph of S has a left box line, start drawing it to the 2785 /* If first glyph of S has a left box line, start drawing it to the
2772 right of that line. */ 2786 right of that line. */
2773 if (s->face->box != FACE_NO_BOX 2787 if (s->face->box != FACE_NO_BOX
2774 && s->first_glyph->left_box_line_p) 2788 && s->first_glyph->left_box_line_p
2775 x = abs (s->face->box_line_width); 2789 && s->slice.x == 0)
2776 else 2790 x += abs (s->face->box_line_width);
2777 x = 0;
2778 2791
2779 /* If there is a margin around the image, adjust x- and y-position 2792 /* If there is a margin around the image, adjust x- and y-position
2780 by that margin. */ 2793 by that margin. */
2781 x += s->img->hmargin; 2794 if (s->slice.x == 0)
2782 y += s->img->vmargin; 2795 x += s->img->hmargin;
2796 if (s->slice.y == 0)
2797 y += s->img->vmargin;
2783 2798
2784 if (s->img->pixmap) 2799 if (s->img->pixmap)
2785 { 2800 {
2786 if (s->img->mask) 2801 if (s->img->mask)
2787 mac_copy_area_with_mask_to_pixmap (s->display, s->img->pixmap, 2802 mac_copy_area_with_mask_to_pixmap (s->display, s->img->pixmap,
2788 s->img->mask, pixmap, s->gc, 2803 s->img->mask, pixmap, s->gc,
2789 0, 0, s->img->width, s->img->height, 2804 s->slice.x, s->slice.y,
2805 s->slice.width, s->slice.height,
2790 x, y); 2806 x, y);
2791 else 2807 else
2792 { 2808 {
2793 mac_copy_area_to_pixmap (s->display, s->img->pixmap, pixmap, s->gc, 2809 mac_copy_area_to_pixmap (s->display, s->img->pixmap, pixmap, s->gc,
2794 0, 0, s->img->width, s->img->height, x, y); 2810 s->slice.x, s->slice.y,
2811 s->slice.width, s->slice.height,
2812 x, y);
2795 2813
2796 /* When the image has a mask, we can expect that at 2814 /* When the image has a mask, we can expect that at
2797 least part of a mouse highlight or a block cursor will 2815 least part of a mouse highlight or a block cursor will
@@ -2804,15 +2822,15 @@ x_draw_image_foreground_1 (s, pixmap)
2804 int r = s->img->relief; 2822 int r = s->img->relief;
2805 if (r < 0) r = -r; 2823 if (r < 0) r = -r;
2806 mac_draw_rectangle (s->display, s->window, s->gc, x - r, y - r, 2824 mac_draw_rectangle (s->display, s->window, s->gc, x - r, y - r,
2807 s->img->width + r*2 - 1, 2825 s->slice.width + r*2 - 1,
2808 s->img->height + r*2 - 1); 2826 s->slice.height + r*2 - 1);
2809 } 2827 }
2810 } 2828 }
2811 } 2829 }
2812 else 2830 else
2813 /* Draw a rectangle if image could not be loaded. */ 2831 /* Draw a rectangle if image could not be loaded. */
2814 mac_draw_rectangle_to_pixmap (s->display, pixmap, s->gc, x, y, 2832 mac_draw_rectangle_to_pixmap (s->display, pixmap, s->gc, x, y,
2815 s->img->width - 1, s->img->height - 1); 2833 s->slice.width - 1, s->slice.height - 1);
2816} 2834}
2817 2835
2818 2836
@@ -2869,19 +2887,21 @@ x_draw_image_glyph_string (s)
2869 taller than image or if image has a clip mask to reduce 2887 taller than image or if image has a clip mask to reduce
2870 flickering. */ 2888 flickering. */
2871 s->stippled_p = s->face->stipple != 0; 2889 s->stippled_p = s->face->stipple != 0;
2872 if (height > s->img->height 2890 if (height > s->slice.height
2873 || s->img->hmargin 2891 || s->img->hmargin
2874 || s->img->vmargin 2892 || s->img->vmargin
2875 || s->img->mask 2893 || s->img->mask
2876 || s->img->pixmap == 0 2894 || s->img->pixmap == 0
2877 || s->width != s->background_width) 2895 || s->width != s->background_width)
2878 { 2896 {
2879 if (box_line_hwidth && s->first_glyph->left_box_line_p) 2897 x = s->x;
2880 x = s->x + box_line_hwidth; 2898 if (s->first_glyph->left_box_line_p
2881 else 2899 && s->slice.x == 0)
2882 x = s->x; 2900 x += box_line_hwidth;
2883 2901
2884 y = s->y + box_line_vwidth; 2902 y = s->y;
2903 if (s->slice.y == 0)
2904 y += box_line_vwidth;
2885 2905
2886 if (s->img->mask) 2906 if (s->img->mask)
2887 { 2907 {
@@ -3842,7 +3862,7 @@ glyph_rect (f, x, y, rect)
3842 3862
3843 /* x is to the right of the last glyph in the row. */ 3863 /* x is to the right of the last glyph in the row. */
3844 rect->left = WINDOW_TO_FRAME_PIXEL_X (w, gx); 3864 rect->left = WINDOW_TO_FRAME_PIXEL_X (w, gx);
3845 /* Shouldn't this be a pixel value? 3865 /* Shouldn't this be a pixel value?
3846 WINDOW_RIGHT_EDGE_X (w) seems to be the right value. 3866 WINDOW_RIGHT_EDGE_X (w) seems to be the right value.
3847 ++KFS */ 3867 ++KFS */
3848 rect->right = WINDOW_RIGHT_EDGE_COL (w); 3868 rect->right = WINDOW_RIGHT_EDGE_COL (w);
@@ -3984,7 +4004,7 @@ mac_handle_tool_bar_click (f, button_event)
3984 if (button_event->what == mouseDown) 4004 if (button_event->what == mouseDown)
3985 handle_tool_bar_click (f, x, y, 1, 0); 4005 handle_tool_bar_click (f, x, y, 1, 0);
3986 else 4006 else
3987 handle_tool_bar_click (f, x, y, 0, 4007 handle_tool_bar_click (f, x, y, 0,
3988 x_mac_to_emacs_modifiers (FRAME_MAC_DISPLAY_INFO (f), 4008 x_mac_to_emacs_modifiers (FRAME_MAC_DISPLAY_INFO (f),
3989 button_event->modifiers)); 4009 button_event->modifiers));
3990} 4010}
@@ -4933,7 +4953,7 @@ x_new_font (f, fontname)
4933 if (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0) 4953 if (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0)
4934 { 4954 {
4935 int wid = FRAME_COLUMN_WIDTH (f); 4955 int wid = FRAME_COLUMN_WIDTH (f);
4936 FRAME_CONFIG_SCROLL_BAR_COLS (f) 4956 FRAME_CONFIG_SCROLL_BAR_COLS (f)
4937 = (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) + wid-1) / wid; 4957 = (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) + wid-1) / wid;
4938 } 4958 }
4939 else 4959 else
@@ -5826,7 +5846,7 @@ decode_mac_font_name (char *name, int size, short scriptcode)
5826 break; 5846 break;
5827 case smKorean: 5847 case smKorean:
5828 coding_system = Qeuc_kr; 5848 coding_system = Qeuc_kr;
5829 break; 5849 break;
5830 default: 5850 default:
5831 return; 5851 return;
5832 } 5852 }
@@ -6277,7 +6297,7 @@ mac_do_list_fonts (pattern, maxnames)
6277 if (fast_string_match (pattern_regex, fontname) >= 0) 6297 if (fast_string_match (pattern_regex, fontname) >= 0)
6278 { 6298 {
6279 font_list = Fcons (fontname, font_list); 6299 font_list = Fcons (fontname, font_list);
6280 6300
6281 n_fonts++; 6301 n_fonts++;
6282 if (maxnames > 0 && n_fonts >= maxnames) 6302 if (maxnames > 0 && n_fonts >= maxnames)
6283 break; 6303 break;
@@ -6987,7 +7007,7 @@ mac_get_emulated_btn ( UInt32 modifiers )
6987 if (modifiers & controlKey) 7007 if (modifiers & controlKey)
6988 result = cmdIs3 ? 2 : 1; 7008 result = cmdIs3 ? 2 : 1;
6989 else if (modifiers & optionKey) 7009 else if (modifiers & optionKey)
6990 result = cmdIs3 ? 1 : 2; 7010 result = cmdIs3 ? 1 : 2;
6991 } 7011 }
6992 return result; 7012 return result;
6993} 7013}
@@ -7020,7 +7040,7 @@ mac_get_mouse_btn (EventRef ref)
7020 switch (result) 7040 switch (result)
7021 { 7041 {
7022 case kEventMouseButtonPrimary: 7042 case kEventMouseButtonPrimary:
7023 if (Vmac_emulate_three_button_mouse == Qnil) 7043 if (Vmac_emulate_three_button_mouse == Qnil)
7024 return 0; 7044 return 0;
7025 else { 7045 else {
7026 UInt32 mods = 0; 7046 UInt32 mods = 0;
@@ -8189,7 +8209,7 @@ XTread_socket (int sd, int expected, struct input_event *hold_quit)
8189 switch (part_code) 8209 switch (part_code)
8190 { 8210 {
8191 case inMenuBar: 8211 case inMenuBar:
8192 if (er.what == mouseDown) 8212 if (er.what == mouseDown)
8193 { 8213 {
8194 struct frame *f = ((mac_output *) 8214 struct frame *f = ((mac_output *)
8195 GetWRefCon (FrontWindow ()))->mFP; 8215 GetWRefCon (FrontWindow ()))->mFP;
@@ -8269,7 +8289,7 @@ XTread_socket (int sd, int expected, struct input_event *hold_quit)
8269 else 8289 else
8270 mouse_tracking_in_progress = mouse_tracking_none; 8290 mouse_tracking_in_progress = mouse_tracking_none;
8271 window = window_from_coordinates (mwp->mFP, inev.x, inev.y, 0, 0, 0, 1); 8291 window = window_from_coordinates (mwp->mFP, inev.x, inev.y, 0, 0, 0, 1);
8272 8292
8273 if (EQ (window, mwp->mFP->tool_bar_window)) 8293 if (EQ (window, mwp->mFP->tool_bar_window))
8274 { 8294 {
8275 if (er.what == mouseDown) 8295 if (er.what == mouseDown)
@@ -8308,10 +8328,10 @@ XTread_socket (int sd, int expected, struct input_event *hold_quit)
8308 8328
8309 case inDrag: 8329 case inDrag:
8310#if TARGET_API_MAC_CARBON 8330#if TARGET_API_MAC_CARBON
8311 if (er.what == mouseDown) 8331 if (er.what == mouseDown)
8312 { 8332 {
8313 BitMap bm; 8333 BitMap bm;
8314 8334
8315 GetQDGlobalsScreenBits (&bm); 8335 GetQDGlobalsScreenBits (&bm);
8316 DragWindow (window_ptr, er.where, &bm.bounds); 8336 DragWindow (window_ptr, er.where, &bm.bounds);
8317 } 8337 }
@@ -8331,7 +8351,7 @@ XTread_socket (int sd, int expected, struct input_event *hold_quit)
8331 8351
8332 /* window resize handling added --ben */ 8352 /* window resize handling added --ben */
8333 case inGrow: 8353 case inGrow:
8334 if (er.what == mouseDown) 8354 if (er.what == mouseDown)
8335 { 8355 {
8336 do_grow_window(window_ptr, &er); 8356 do_grow_window(window_ptr, &er);
8337 break; 8357 break;
@@ -9186,10 +9206,10 @@ Otherwise the option key is used. */);
9186 useful for non-standard keyboard layouts. */); 9206 useful for non-standard keyboard layouts. */);
9187 Vmac_reverse_ctrl_meta = Qnil; 9207 Vmac_reverse_ctrl_meta = Qnil;
9188 9208
9189 DEFVAR_LISP ("mac-emulate-three-button-mouse", 9209 DEFVAR_LISP ("mac-emulate-three-button-mouse",
9190 &Vmac_emulate_three_button_mouse, 9210 &Vmac_emulate_three_button_mouse,
9191 doc: /* t means that when the option-key is held down while pressing the 9211 doc: /* t means that when the option-key is held down while pressing the
9192 mouse button, the click will register as mouse-2 and while the 9212 mouse button, the click will register as mouse-2 and while the
9193 command-key is held down, the click will register as mouse-3. 9213 command-key is held down, the click will register as mouse-3.
9194 'reverse means that the the option-key will register for mouse-3 9214 'reverse means that the the option-key will register for mouse-3
9195 and the command-key will register for mouse-2. nil means that 9215 and the command-key will register for mouse-2. nil means that
diff --git a/src/makefile.w32-in b/src/makefile.w32-in
index c2a6e4a1eeb..7056d43af5f 100644
--- a/src/makefile.w32-in
+++ b/src/makefile.w32-in
@@ -1,4 +1,4 @@
1# Makefile for GNU Emacs on the Microsoft W32 API. 1# -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.
2# Copyright (c) 2000-2001 Free Software Foundation, Inc. 2# Copyright (c) 2000-2001 Free Software Foundation, Inc.
3# 3#
4# This file is part of GNU Emacs. 4# This file is part of GNU Emacs.
diff --git a/src/w32term.c b/src/w32term.c
index 7f3b6b626de..24eabfba567 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -1220,7 +1220,8 @@ static void w32_draw_image_foreground_1 P_ ((struct glyph_string *, HBITMAP));
1220static void x_clear_glyph_string_rect P_ ((struct glyph_string *, int, 1220static void x_clear_glyph_string_rect P_ ((struct glyph_string *, int,
1221 int, int, int)); 1221 int, int, int));
1222static void w32_draw_relief_rect P_ ((struct frame *, int, int, int, int, 1222static void w32_draw_relief_rect P_ ((struct frame *, int, int, int, int,
1223 int, int, int, int, RECT *)); 1223 int, int, int, int, int, int,
1224 RECT *));
1224static void w32_draw_box_rect P_ ((struct glyph_string *, int, int, int, int, 1225static void w32_draw_box_rect P_ ((struct glyph_string *, int, int, int, int,
1225 int, int, int, RECT *)); 1226 int, int, int, RECT *));
1226 1227
@@ -1801,9 +1802,10 @@ x_setup_relief_colors (s)
1801 1802
1802static void 1803static void
1803w32_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width, 1804w32_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
1804 raised_p, left_p, right_p, clip_rect) 1805 raised_p, top_p, bot_p, left_p, right_p, clip_rect)
1805 struct frame *f; 1806 struct frame *f;
1806 int left_x, top_y, right_x, bottom_y, width, left_p, right_p, raised_p; 1807 int left_x, top_y, right_x, bottom_y, width;
1808 int top_p, bot_p, left_p, right_p, raised_p;
1807 RECT *clip_rect; 1809 RECT *clip_rect;
1808{ 1810{
1809 int i; 1811 int i;
@@ -1818,10 +1820,11 @@ w32_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
1818 w32_set_clip_rectangle (hdc, clip_rect); 1820 w32_set_clip_rectangle (hdc, clip_rect);
1819 1821
1820 /* Top. */ 1822 /* Top. */
1821 for (i = 0; i < width; ++i) 1823 if (top_p)
1822 w32_fill_area (f, hdc, gc.foreground, 1824 for (i = 0; i < width; ++i)
1823 left_x + i * left_p, top_y + i, 1825 w32_fill_area (f, hdc, gc.foreground,
1824 right_x - left_x - i * (left_p + right_p ) + 1, 1); 1826 left_x + i * left_p, top_y + i,
1827 right_x - left_x - i * (left_p + right_p ) + 1, 1);
1825 1828
1826 /* Left. */ 1829 /* Left. */
1827 if (left_p) 1830 if (left_p)
@@ -1836,10 +1839,11 @@ w32_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
1836 gc.foreground = f->output_data.w32->white_relief.gc->foreground; 1839 gc.foreground = f->output_data.w32->white_relief.gc->foreground;
1837 1840
1838 /* Bottom. */ 1841 /* Bottom. */
1839 for (i = 0; i < width; ++i) 1842 if (bot_p)
1840 w32_fill_area (f, hdc, gc.foreground, 1843 for (i = 0; i < width; ++i)
1841 left_x + i * left_p, bottom_y - i, 1844 w32_fill_area (f, hdc, gc.foreground,
1842 right_x - left_x - i * (left_p + right_p) + 1, 1); 1845 left_x + i * left_p, bottom_y - i,
1846 right_x - left_x - i * (left_p + right_p) + 1, 1);
1843 1847
1844 /* Right. */ 1848 /* Right. */
1845 if (right_p) 1849 if (right_p)
@@ -1949,7 +1953,7 @@ x_draw_glyph_string_box (s)
1949 { 1953 {
1950 x_setup_relief_colors (s); 1954 x_setup_relief_colors (s);
1951 w32_draw_relief_rect (s->f, left_x, top_y, right_x, bottom_y, 1955 w32_draw_relief_rect (s->f, left_x, top_y, right_x, bottom_y,
1952 width, raised_p, left_p, right_p, &clip_rect); 1956 width, raised_p, 1, 1, left_p, right_p, &clip_rect);
1953 } 1957 }
1954} 1958}
1955 1959
@@ -1960,21 +1964,22 @@ static void
1960x_draw_image_foreground (s) 1964x_draw_image_foreground (s)
1961 struct glyph_string *s; 1965 struct glyph_string *s;
1962{ 1966{
1963 int x; 1967 int x = s->x;
1964 int y = s->ybase - image_ascent (s->img, s->face); 1968 int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
1965 1969
1966 /* If first glyph of S has a left box line, start drawing it to the 1970 /* If first glyph of S has a left box line, start drawing it to the
1967 right of that line. */ 1971 right of that line. */
1968 if (s->face->box != FACE_NO_BOX 1972 if (s->face->box != FACE_NO_BOX
1969 && s->first_glyph->left_box_line_p) 1973 && s->first_glyph->left_box_line_p
1970 x = s->x + abs (s->face->box_line_width); 1974 && s->slice.x == 0)
1971 else 1975 x += abs (s->face->box_line_width);
1972 x = s->x;
1973 1976
1974 /* If there is a margin around the image, adjust x- and y-position 1977 /* If there is a margin around the image, adjust x- and y-position
1975 by that margin. */ 1978 by that margin. */
1976 x += s->img->hmargin; 1979 if (s->slice.x == 0)
1977 y += s->img->vmargin; 1980 x += s->img->hmargin;
1981 if (s->slice.y == 0)
1982 y += s->img->vmargin;
1978 1983
1979 SaveDC (s->hdc); 1984 SaveDC (s->hdc);
1980 1985
@@ -1996,12 +2001,12 @@ x_draw_image_foreground (s)
1996 SetTextColor (s->hdc, RGB (255, 255, 255)); 2001 SetTextColor (s->hdc, RGB (255, 255, 255));
1997 SetBkColor (s->hdc, RGB (0, 0, 0)); 2002 SetBkColor (s->hdc, RGB (0, 0, 0));
1998 2003
1999 BitBlt (s->hdc, x, y, s->img->width, s->img->height, 2004 BitBlt (s->hdc, x, y, s->slice.width, s->slice.height,
2000 compat_hdc, 0, 0, SRCINVERT); 2005 compat_hdc, s->slice.x, s->slice.y, SRCINVERT);
2001 BitBlt (s->hdc, x, y, s->img->width, s->img->height, 2006 BitBlt (s->hdc, x, y, s->slice.width, s->slice.height,
2002 mask_dc, 0, 0, SRCAND); 2007 mask_dc, s->slice.x, s->slice.y, SRCAND);
2003 BitBlt (s->hdc, x, y, s->img->width, s->img->height, 2008 BitBlt (s->hdc, x, y, s->slice.width, s->slice.height,
2004 compat_hdc, 0, 0, SRCINVERT); 2009 compat_hdc, s->slice.x, s->slice.y, SRCINVERT);
2005 2010
2006 SelectObject (mask_dc, mask_orig_obj); 2011 SelectObject (mask_dc, mask_orig_obj);
2007 DeleteDC (mask_dc); 2012 DeleteDC (mask_dc);
@@ -2011,8 +2016,8 @@ x_draw_image_foreground (s)
2011 SetTextColor (s->hdc, s->gc->foreground); 2016 SetTextColor (s->hdc, s->gc->foreground);
2012 SetBkColor (s->hdc, s->gc->background); 2017 SetBkColor (s->hdc, s->gc->background);
2013 2018
2014 BitBlt (s->hdc, x, y, s->img->width, s->img->height, 2019 BitBlt (s->hdc, x, y, s->slice.width, s->slice.height,
2015 compat_hdc, 0, 0, SRCCOPY); 2020 compat_hdc, s->slice.x, s->slice.y, SRCCOPY);
2016 2021
2017 /* When the image has a mask, we can expect that at 2022 /* When the image has a mask, we can expect that at
2018 least part of a mouse highlight or a block cursor will 2023 least part of a mouse highlight or a block cursor will
@@ -2025,7 +2030,8 @@ x_draw_image_foreground (s)
2025 int r = s->img->relief; 2030 int r = s->img->relief;
2026 if (r < 0) r = -r; 2031 if (r < 0) r = -r;
2027 w32_draw_rectangle (s->hdc, s->gc, x - r, y - r , 2032 w32_draw_rectangle (s->hdc, s->gc, x - r, y - r ,
2028 s->img->width + r*2 - 1, s->img->height + r*2 - 1); 2033 s->slice.width + r*2 - 1,
2034 s->slice.height + r*2 - 1);
2029 } 2035 }
2030 } 2036 }
2031 2037
@@ -2036,8 +2042,8 @@ x_draw_image_foreground (s)
2036 DeleteDC (compat_hdc); 2042 DeleteDC (compat_hdc);
2037 } 2043 }
2038 else 2044 else
2039 w32_draw_rectangle (s->hdc, s->gc, x, y, s->img->width -1, 2045 w32_draw_rectangle (s->hdc, s->gc, x, y,
2040 s->img->height - 1); 2046 s->slice.width - 1, s->slice.height - 1);
2041 2047
2042 RestoreDC (s->hdc ,-1); 2048 RestoreDC (s->hdc ,-1);
2043} 2049}
@@ -2052,21 +2058,22 @@ x_draw_image_relief (s)
2052{ 2058{
2053 int x0, y0, x1, y1, thick, raised_p; 2059 int x0, y0, x1, y1, thick, raised_p;
2054 RECT r; 2060 RECT r;
2055 int x; 2061 int x = s->x;
2056 int y = s->ybase - image_ascent (s->img, s->face); 2062 int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
2057 2063
2058 /* If first glyph of S has a left box line, start drawing it to the 2064 /* If first glyph of S has a left box line, start drawing it to the
2059 right of that line. */ 2065 right of that line. */
2060 if (s->face->box != FACE_NO_BOX 2066 if (s->face->box != FACE_NO_BOX
2061 && s->first_glyph->left_box_line_p) 2067 && s->first_glyph->left_box_line_p
2062 x = s->x + abs (s->face->box_line_width); 2068 && s->slice.x == 0)
2063 else 2069 x += abs (s->face->box_line_width);
2064 x = s->x;
2065 2070
2066 /* If there is a margin around the image, adjust x- and y-position 2071 /* If there is a margin around the image, adjust x- and y-position
2067 by that margin. */ 2072 by that margin. */
2068 x += s->img->hmargin; 2073 if (s->slice.x == 0)
2069 y += s->img->vmargin; 2074 x += s->img->hmargin;
2075 if (s->slice.y == 0)
2076 y += s->img->vmargin;
2070 2077
2071 if (s->hl == DRAW_IMAGE_SUNKEN 2078 if (s->hl == DRAW_IMAGE_SUNKEN
2072 || s->hl == DRAW_IMAGE_RAISED) 2079 || s->hl == DRAW_IMAGE_RAISED)
@@ -2082,12 +2089,17 @@ x_draw_image_relief (s)
2082 2089
2083 x0 = x - thick; 2090 x0 = x - thick;
2084 y0 = y - thick; 2091 y0 = y - thick;
2085 x1 = x + s->img->width + thick - 1; 2092 x1 = x + s->slice.width + thick - 1;
2086 y1 = y + s->img->height + thick - 1; 2093 y1 = y + s->slice.height + thick - 1;
2087 2094
2088 x_setup_relief_colors (s); 2095 x_setup_relief_colors (s);
2089 get_glyph_string_clip_rect (s, &r); 2096 get_glyph_string_clip_rect (s, &r);
2090 w32_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p, 1, 1, &r); 2097 w32_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p,
2098 s->slice.y == 0,
2099 s->slice.y + s->slice.height == s->img->height,
2100 s->slice.x == 0,
2101 s->slice.x + s->slice.width == s->img->width,
2102 &r);
2091} 2103}
2092 2104
2093 2105
@@ -2100,21 +2112,22 @@ w32_draw_image_foreground_1 (s, pixmap)
2100{ 2112{
2101 HDC hdc = CreateCompatibleDC (s->hdc); 2113 HDC hdc = CreateCompatibleDC (s->hdc);
2102 HGDIOBJ orig_hdc_obj = SelectObject (hdc, pixmap); 2114 HGDIOBJ orig_hdc_obj = SelectObject (hdc, pixmap);
2103 int x; 2115 int x = 0;
2104 int y = s->ybase - s->y - image_ascent (s->img, s->face); 2116 int y = s->ybase - s->y - image_ascent (s->img, s->face, &s->slice);
2105 2117
2106 /* If first glyph of S has a left box line, start drawing it to the 2118 /* If first glyph of S has a left box line, start drawing it to the
2107 right of that line. */ 2119 right of that line. */
2108 if (s->face->box != FACE_NO_BOX 2120 if (s->face->box != FACE_NO_BOX
2109 && s->first_glyph->left_box_line_p) 2121 && s->first_glyph->left_box_line_p
2110 x = abs (s->face->box_line_width); 2122 && s->slice.x == 0)
2111 else 2123 x += abs (s->face->box_line_width);
2112 x = 0;
2113 2124
2114 /* If there is a margin around the image, adjust x- and y-position 2125 /* If there is a margin around the image, adjust x- and y-position
2115 by that margin. */ 2126 by that margin. */
2116 x += s->img->hmargin; 2127 if (s->slice.x == 0)
2117 y += s->img->vmargin; 2128 x += s->img->hmargin;
2129 if (s->slice.y == 0)
2130 y += s->img->vmargin;
2118 2131
2119 if (s->img->pixmap) 2132 if (s->img->pixmap)
2120 { 2133 {
@@ -2130,12 +2143,12 @@ w32_draw_image_foreground_1 (s, pixmap)
2130 2143
2131 SetTextColor (hdc, RGB (0, 0, 0)); 2144 SetTextColor (hdc, RGB (0, 0, 0));
2132 SetBkColor (hdc, RGB (255, 255, 255)); 2145 SetBkColor (hdc, RGB (255, 255, 255));
2133 BitBlt (hdc, x, y, s->img->width, s->img->height, 2146 BitBlt (hdc, x, y, s->slice.width, s->slice.height,
2134 compat_hdc, 0, 0, SRCINVERT); 2147 compat_hdc, s->slice.x, s->slice.y, SRCINVERT);
2135 BitBlt (hdc, x, y, s->img->width, s->img->height, 2148 BitBlt (hdc, x, y, s->slice.width, s->slice.height,
2136 mask_dc, 0, 0, SRCAND); 2149 mask_dc, s->slice.x, s->slice.y, SRCAND);
2137 BitBlt (hdc, x, y, s->img->width, s->img->height, 2150 BitBlt (hdc, x, y, s->slice.width, s->slice.height,
2138 compat_hdc, 0, 0, SRCINVERT); 2151 compat_hdc, s->slice.x, s->slice.y, SRCINVERT);
2139 2152
2140 SelectObject (mask_dc, mask_orig_obj); 2153 SelectObject (mask_dc, mask_orig_obj);
2141 DeleteDC (mask_dc); 2154 DeleteDC (mask_dc);
@@ -2145,8 +2158,8 @@ w32_draw_image_foreground_1 (s, pixmap)
2145 SetTextColor (hdc, s->gc->foreground); 2158 SetTextColor (hdc, s->gc->foreground);
2146 SetBkColor (hdc, s->gc->background); 2159 SetBkColor (hdc, s->gc->background);
2147 2160
2148 BitBlt (hdc, x, y, s->img->width, s->img->height, 2161 BitBlt (hdc, x, y, s->slice.width, s->slice.height,
2149 compat_hdc, 0, 0, SRCCOPY); 2162 compat_hdc, s->slice.x, s->slice.y, SRCCOPY);
2150 2163
2151 /* When the image has a mask, we can expect that at 2164 /* When the image has a mask, we can expect that at
2152 least part of a mouse highlight or a block cursor will 2165 least part of a mouse highlight or a block cursor will
@@ -2158,8 +2171,9 @@ w32_draw_image_foreground_1 (s, pixmap)
2158 { 2171 {
2159 int r = s->img->relief; 2172 int r = s->img->relief;
2160 if (r < 0) r = -r; 2173 if (r < 0) r = -r;
2161 w32_draw_rectangle (hdc, s->gc, x - r, y - r , 2174 w32_draw_rectangle (hdc, s->gc, x - r, y - r,
2162 s->img->width + r*2 - 1, s->img->height + r*2 - 1); 2175 s->slice.width + r*2 - 1,
2176 s->slice.height + r*2 - 1);
2163 } 2177 }
2164 } 2178 }
2165 2179
@@ -2169,8 +2183,8 @@ w32_draw_image_foreground_1 (s, pixmap)
2169 DeleteDC (compat_hdc); 2183 DeleteDC (compat_hdc);
2170 } 2184 }
2171 else 2185 else
2172 w32_draw_rectangle (hdc, s->gc, x, y, s->img->width - 1, 2186 w32_draw_rectangle (hdc, s->gc, x, y,
2173 s->img->height - 1); 2187 s->slice.width - 1, s->slice.height - 1);
2174 2188
2175 SelectObject (hdc, orig_hdc_obj); 2189 SelectObject (hdc, orig_hdc_obj);
2176 DeleteDC (hdc); 2190 DeleteDC (hdc);
@@ -2229,19 +2243,22 @@ x_draw_image_glyph_string (s)
2229 taller than image or if image has a clip mask to reduce 2243 taller than image or if image has a clip mask to reduce
2230 flickering. */ 2244 flickering. */
2231 s->stippled_p = s->face->stipple != 0; 2245 s->stippled_p = s->face->stipple != 0;
2232 if (height > s->img->height 2246 if (height > s->slice.height
2233 || s->img->hmargin 2247 || s->img->hmargin
2234 || s->img->vmargin 2248 || s->img->vmargin
2235 || s->img->mask 2249 || s->img->mask
2236 || s->img->pixmap == 0 2250 || s->img->pixmap == 0
2237 || s->width != s->background_width) 2251 || s->width != s->background_width)
2238 { 2252 {
2239 if (box_line_hwidth && s->first_glyph->left_box_line_p) 2253 x = s->x;
2240 x = s->x + box_line_hwidth; 2254 if (s->first_glyph->left_box_line_p
2241 else 2255 && s->slice.x == 0)
2242 x = s->x; 2256 x += box_line_hwidth;
2257
2258 y = s->y;
2259 if (s->slice.y == 0)
2260 y += box_line_vwidth;
2243 2261
2244 y = s->y + box_line_vwidth;
2245#if 0 /* TODO: figure out if we need to do this on Windows. */ 2262#if 0 /* TODO: figure out if we need to do this on Windows. */
2246 if (s->img->mask) 2263 if (s->img->mask)
2247 { 2264 {
diff --git a/src/w32term.h b/src/w32term.h
index 68967ad7d24..f7c4c30064e 100644
--- a/src/w32term.h
+++ b/src/w32term.h
@@ -719,7 +719,6 @@ XGCValues *XCreateGC (void *, Window, unsigned long, XGCValues *);
719struct frame * check_x_frame (Lisp_Object); 719struct frame * check_x_frame (Lisp_Object);
720EXFUN (Fx_display_color_p, 1); 720EXFUN (Fx_display_color_p, 1);
721EXFUN (Fx_display_grayscale_p, 1); 721EXFUN (Fx_display_grayscale_p, 1);
722int image_ascent P_ ((struct image *, struct face *));
723 722
724#define FONT_TYPE_FOR_UNIBYTE(font, ch) \ 723#define FONT_TYPE_FOR_UNIBYTE(font, ch) \
725 ((font)->bdf ? BDF_1D_FONT : ANSI_FONT) 724 ((font)->bdf ? BDF_1D_FONT : ANSI_FONT)
diff --git a/src/window.c b/src/window.c
index b6546eee698..221d8bbbaf2 100644
--- a/src/window.c
+++ b/src/window.c
@@ -324,7 +324,11 @@ DEFUN ("pos-visible-in-window-p", Fpos_visible_in_window_p,
324Return nil if that position is scrolled vertically out of view. 324Return nil if that position is scrolled vertically out of view.
325If a character is only partially visible, nil is returned, unless the 325If a character is only partially visible, nil is returned, unless the
326optional argument PARTIALLY is non-nil. 326optional argument PARTIALLY is non-nil.
327POS defaults to point in WINDOW; WINDOW defaults to the selected window. */) 327POS defaults to point in WINDOW; WINDOW defaults to the selected window.
328
329If POS is visible, return t if PARTIALLY is nil; if PARTIALLY is non-nil,
330return value is a list (X Y PARTIAL) where X and Y are the pixel relative
331coordinate */)
328 (pos, window, partially) 332 (pos, window, partially)
329 Lisp_Object pos, window, partially; 333 Lisp_Object pos, window, partially;
330{ 334{
@@ -332,8 +336,9 @@ POS defaults to point in WINDOW; WINDOW defaults to the selected window. */)
332 register int posint; 336 register int posint;
333 register struct buffer *buf; 337 register struct buffer *buf;
334 struct text_pos top; 338 struct text_pos top;
335 Lisp_Object in_window; 339 Lisp_Object in_window = Qnil;
336 int fully_p; 340 int fully_p = 1;
341 int x, y;
337 342
338 w = decode_window (window); 343 w = decode_window (window);
339 buf = XBUFFER (w->buffer); 344 buf = XBUFFER (w->buffer);
@@ -349,38 +354,20 @@ POS defaults to point in WINDOW; WINDOW defaults to the selected window. */)
349 else 354 else
350 posint = XMARKER (w->pointm)->charpos; 355 posint = XMARKER (w->pointm)->charpos;
351 356
352 /* If position is above window start, it's not visible. */ 357 /* If position is above window start or outside buffer boundaries,
353 if (posint < CHARPOS (top)) 358 or if window start is out of range, position is not visible. */
354 in_window = Qnil; 359 if (posint >= CHARPOS (top)
355 else if (XFASTINT (w->last_modified) >= BUF_MODIFF (buf) 360 && posint <= BUF_ZV (buf)
356 && XFASTINT (w->last_overlay_modified) >= BUF_OVERLAY_MODIFF (buf) 361 && CHARPOS (top) >= BUF_BEGV (buf)
357 && posint < BUF_Z (buf) - XFASTINT (w->window_end_pos)) 362 && CHARPOS (top) <= BUF_ZV (buf)
358 { 363 && pos_visible_p (w, posint, &fully_p, &x, &y, NILP (partially))
359 /* If frame is up-to-date, and POSINT is < window end pos, use 364 && (!NILP (partially) || fully_p))
360 that info. This doesn't work for POSINT == end pos, because 365 in_window = Qt;
361 the window end pos is actually the position _after_ the last 366
362 char in the window. */ 367 if (!NILP (in_window) && !NILP (partially))
363 if (NILP (partially)) 368 in_window = Fcons (make_number (x),
364 { 369 Fcons (make_number (y),
365 pos_visible_p (w, posint, &fully_p, NILP (partially)); 370 Fcons (fully_p ? Qt : Qnil, Qnil)));
366 in_window = fully_p ? Qt : Qnil;
367 }
368 else
369 in_window = Qt;
370 }
371 else if (posint > BUF_ZV (buf))
372 in_window = Qnil;
373 else if (CHARPOS (top) < BUF_BEGV (buf) || CHARPOS (top) > BUF_ZV (buf))
374 /* If window start is out of range, do something reasonable. */
375 in_window = Qnil;
376 else
377 {
378 if (pos_visible_p (w, posint, &fully_p, NILP (partially)))
379 in_window = !NILP (partially) || fully_p ? Qt : Qnil;
380 else
381 in_window = Qnil;
382 }
383
384 return in_window; 371 return in_window;
385} 372}
386 373
@@ -3462,7 +3449,7 @@ DEFUN ("force-window-update", Fforce_window_update, Sforce_window_update,
3462 0, 1, 0, 3449 0, 1, 0,
3463 doc: /* Force redisplay of all windows. 3450 doc: /* Force redisplay of all windows.
3464If optional arg OBJECT is a window, force redisplay of that window only. 3451If optional arg OBJECT is a window, force redisplay of that window only.
3465If OBJECT is a buffer or buffer name, force redisplay of all windows 3452If OBJECT is a buffer or buffer name, force redisplay of all windows
3466displaying that buffer. */) 3453displaying that buffer. */)
3467 (object) 3454 (object)
3468 Lisp_Object object; 3455 Lisp_Object object;
@@ -3484,7 +3471,7 @@ displaying that buffer. */)
3484 ++update_mode_lines; 3471 ++update_mode_lines;
3485 return Qt; 3472 return Qt;
3486 } 3473 }
3487 3474
3488 if (STRINGP (object)) 3475 if (STRINGP (object))
3489 object = Fget_buffer (object); 3476 object = Fget_buffer (object);
3490 if (BUFFERP (object) && !NILP (XBUFFER (object)->name)) 3477 if (BUFFERP (object) && !NILP (XBUFFER (object)->name))
@@ -3549,7 +3536,7 @@ temp_output_buffer_show (buf)
3549 Lisp_Object prev_window, prev_buffer; 3536 Lisp_Object prev_window, prev_buffer;
3550 prev_window = selected_window; 3537 prev_window = selected_window;
3551 XSETBUFFER (prev_buffer, old); 3538 XSETBUFFER (prev_buffer, old);
3552 3539
3553 /* Select the window that was chosen, for running the hook. 3540 /* Select the window that was chosen, for running the hook.
3554 Note: Both Fselect_window and select_window_norecord may 3541 Note: Both Fselect_window and select_window_norecord may
3555 set-buffer to the buffer displayed in the window, 3542 set-buffer to the buffer displayed in the window,
@@ -6069,7 +6056,7 @@ If TYPE is t, use the frame's scroll-bar type. */)
6069 vertical_type = Qnil; 6056 vertical_type = Qnil;
6070 6057
6071 if (!(EQ (vertical_type, Qnil) 6058 if (!(EQ (vertical_type, Qnil)
6072 || EQ (vertical_type, Qleft) 6059 || EQ (vertical_type, Qleft)
6073 || EQ (vertical_type, Qright) 6060 || EQ (vertical_type, Qright)
6074 || EQ (vertical_type, Qt))) 6061 || EQ (vertical_type, Qt)))
6075 error ("Invalid type of vertical scroll bar"); 6062 error ("Invalid type of vertical scroll bar");
@@ -6118,12 +6105,13 @@ value. */)
6118 Smooth scrolling 6105 Smooth scrolling
6119 ***********************************************************************/ 6106 ***********************************************************************/
6120 6107
6121DEFUN ("window-vscroll", Fwindow_vscroll, Swindow_vscroll, 0, 1, 0, 6108DEFUN ("window-vscroll", Fwindow_vscroll, Swindow_vscroll, 0, 2, 0,
6122 doc: /* Return the amount by which WINDOW is scrolled vertically. 6109 doc: /* Return the amount by which WINDOW is scrolled vertically.
6123Use the selected window if WINDOW is nil or omitted. 6110Use the selected window if WINDOW is nil or omitted.
6124Value is a multiple of the canonical character height of WINDOW. */) 6111Normally, value is a multiple of the canonical character height of WINDOW;
6125 (window) 6112optional second arg PIXELS_P means value is measured in pixels. */)
6126 Lisp_Object window; 6113 (window, pixels_p)
6114 Lisp_Object window, pixels_p;
6127{ 6115{
6128 Lisp_Object result; 6116 Lisp_Object result;
6129 struct frame *f; 6117 struct frame *f;
@@ -6137,7 +6125,9 @@ Value is a multiple of the canonical character height of WINDOW. */)
6137 f = XFRAME (w->frame); 6125 f = XFRAME (w->frame);
6138 6126
6139 if (FRAME_WINDOW_P (f)) 6127 if (FRAME_WINDOW_P (f))
6140 result = FRAME_CANON_Y_FROM_PIXEL_Y (f, -w->vscroll); 6128 result = (NILP (pixels_p)
6129 ? FRAME_CANON_Y_FROM_PIXEL_Y (f, -w->vscroll)
6130 : make_number (-w->vscroll));
6141 else 6131 else
6142 result = make_number (0); 6132 result = make_number (0);
6143 return result; 6133 return result;
@@ -6145,12 +6135,13 @@ Value is a multiple of the canonical character height of WINDOW. */)
6145 6135
6146 6136
6147DEFUN ("set-window-vscroll", Fset_window_vscroll, Sset_window_vscroll, 6137DEFUN ("set-window-vscroll", Fset_window_vscroll, Sset_window_vscroll,
6148 2, 2, 0, 6138 2, 3, 0,
6149 doc: /* Set amount by which WINDOW should be scrolled vertically to VSCROLL. 6139 doc: /* Set amount by which WINDOW should be scrolled vertically to VSCROLL.
6150WINDOW nil means use the selected window. VSCROLL is a non-negative 6140WINDOW nil means use the selected window. Normally, VSCROLL is a
6151multiple of the canonical character height of WINDOW. */) 6141non-negative multiple of the canonical character height of WINDOW;
6152 (window, vscroll) 6142optional third arg PIXELS_P non-nil means that VSCROLL is in pixels. */)
6153 Lisp_Object window, vscroll; 6143 (window, vscroll, pixels_p)
6144 Lisp_Object window, vscroll, pixels_p;
6154{ 6145{
6155 struct window *w; 6146 struct window *w;
6156 struct frame *f; 6147 struct frame *f;
@@ -6168,7 +6159,9 @@ multiple of the canonical character height of WINDOW. */)
6168 { 6159 {
6169 int old_dy = w->vscroll; 6160 int old_dy = w->vscroll;
6170 6161
6171 w->vscroll = - FRAME_LINE_HEIGHT (f) * XFLOATINT (vscroll); 6162 w->vscroll = - (NILP (pixels_p)
6163 ? FRAME_LINE_HEIGHT (f) * XFLOATINT (vscroll)
6164 : XFLOATINT (vscroll));
6172 w->vscroll = min (w->vscroll, 0); 6165 w->vscroll = min (w->vscroll, 0);
6173 6166
6174 /* Adjust glyph matrix of the frame if the virtual display 6167 /* Adjust glyph matrix of the frame if the virtual display
@@ -6180,7 +6173,7 @@ multiple of the canonical character height of WINDOW. */)
6180 XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1; 6173 XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1;
6181 } 6174 }
6182 6175
6183 return Fwindow_vscroll (window); 6176 return Fwindow_vscroll (window, pixels_p);
6184} 6177}
6185 6178
6186 6179
diff --git a/src/window.h b/src/window.h
index ef81da43b4d..59052af96a5 100644
--- a/src/window.h
+++ b/src/window.h
@@ -320,7 +320,7 @@ struct window
320 | | +--------------------------- LEFT_MARGIN_COLS 320 | | +--------------------------- LEFT_MARGIN_COLS
321 | +------------------------------- LEFT_FRINGE_WIDTH 321 | +------------------------------- LEFT_FRINGE_WIDTH
322 +---------------------------------- LEFT_SCROLL_BAR_COLS 322 +---------------------------------- LEFT_SCROLL_BAR_COLS
323 323
324*/ 324*/
325 325
326 326
@@ -767,8 +767,8 @@ EXFUN (Fdisplay_buffer, 3);
767EXFUN (Fset_window_buffer, 3); 767EXFUN (Fset_window_buffer, 3);
768EXFUN (Fset_window_hscroll, 2); 768EXFUN (Fset_window_hscroll, 2);
769EXFUN (Fwindow_hscroll, 1); 769EXFUN (Fwindow_hscroll, 1);
770EXFUN (Fset_window_vscroll, 2); 770EXFUN (Fset_window_vscroll, 3);
771EXFUN (Fwindow_vscroll, 1); 771EXFUN (Fwindow_vscroll, 2);
772EXFUN (Fset_window_margins, 3); 772EXFUN (Fset_window_margins, 3);
773EXFUN (Fwindow_live_p, 1); 773EXFUN (Fwindow_live_p, 1);
774EXFUN (Fset_window_point, 2); 774EXFUN (Fset_window_point, 2);
diff --git a/src/xdisp.c b/src/xdisp.c
index 3c144f4f5f4..fd621fe301b 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -301,6 +301,7 @@ extern Lisp_Object Qface, Qinvisible, Qwidth;
301Lisp_Object Vdisplay_pixels_per_inch; 301Lisp_Object Vdisplay_pixels_per_inch;
302Lisp_Object Qspace, QCalign_to, QCrelative_width, QCrelative_height; 302Lisp_Object Qspace, QCalign_to, QCrelative_width, QCrelative_height;
303Lisp_Object Qleft_margin, Qright_margin, Qspace_width, Qraise; 303Lisp_Object Qleft_margin, Qright_margin, Qspace_width, Qraise;
304Lisp_Object Qslice;
304Lisp_Object Qcenter; 305Lisp_Object Qcenter;
305Lisp_Object Qmargin, Qpointer; 306Lisp_Object Qmargin, Qpointer;
306extern Lisp_Object Qheight; 307extern Lisp_Object Qheight;
@@ -1231,9 +1232,9 @@ line_bottom_y (it)
1231 and header-lines heights. */ 1232 and header-lines heights. */
1232 1233
1233int 1234int
1234pos_visible_p (w, charpos, fully, exact_mode_line_heights_p) 1235pos_visible_p (w, charpos, fully, x, y, exact_mode_line_heights_p)
1235 struct window *w; 1236 struct window *w;
1236 int charpos, *fully, exact_mode_line_heights_p; 1237 int charpos, *fully, *x, *y, exact_mode_line_heights_p;
1237{ 1238{
1238 struct it it; 1239 struct it it;
1239 struct text_pos top; 1240 struct text_pos top;
@@ -1281,14 +1282,27 @@ pos_visible_p (w, charpos, fully, exact_mode_line_heights_p)
1281 visible_p = 1; 1282 visible_p = 1;
1282 *fully = bottom_y <= it.last_visible_y; 1283 *fully = bottom_y <= it.last_visible_y;
1283 } 1284 }
1285 if (visible_p && x)
1286 {
1287 *x = it.current_x;
1288 *y = max (top_y + it.max_ascent - it.ascent, window_top_y);
1289 }
1284 } 1290 }
1285 else if (it.current_y + it.max_ascent + it.max_descent > it.last_visible_y) 1291 else if (it.current_y + it.max_ascent + it.max_descent > it.last_visible_y)
1286 { 1292 {
1293 struct it it2;
1294
1295 it2 = it;
1287 move_it_by_lines (&it, 1, 0); 1296 move_it_by_lines (&it, 1, 0);
1288 if (charpos < IT_CHARPOS (it)) 1297 if (charpos < IT_CHARPOS (it))
1289 { 1298 {
1290 visible_p = 1; 1299 visible_p = 1;
1291 *fully = 0; 1300 if (x)
1301 {
1302 move_it_to (&it2, charpos, -1, -1, -1, MOVE_TO_POS);
1303 *x = it2.current_x;
1304 *y = it2.current_y + it2.max_ascent - it2.ascent;
1305 }
1292 } 1306 }
1293 } 1307 }
1294 1308
@@ -1296,6 +1310,7 @@ pos_visible_p (w, charpos, fully, exact_mode_line_heights_p)
1296 set_buffer_internal_1 (old_buffer); 1310 set_buffer_internal_1 (old_buffer);
1297 1311
1298 current_header_line_height = current_mode_line_height = -1; 1312 current_header_line_height = current_mode_line_height = -1;
1313
1299 return visible_p; 1314 return visible_p;
1300} 1315}
1301 1316
@@ -2063,7 +2078,8 @@ init_iterator (it, w, charpos, bytepos, row, base_face_id)
2063 if (FRAME_FACE_CACHE (it->f)->used == 0) 2078 if (FRAME_FACE_CACHE (it->f)->used == 0)
2064 recompute_basic_faces (it->f); 2079 recompute_basic_faces (it->f);
2065 2080
2066 /* Current value of the `space-width', and 'height' properties. */ 2081 /* Current value of the `slice', `space-width', and 'height' properties. */
2082 it->slice.x = it->slice.y = it->slice.width = it->slice.height = Qnil;
2067 it->space_width = Qnil; 2083 it->space_width = Qnil;
2068 it->font_height = Qnil; 2084 it->font_height = Qnil;
2069 2085
@@ -3271,8 +3287,9 @@ handle_display_prop (it)
3271 } 3287 }
3272 3288
3273 /* Reset those iterator values set from display property values. */ 3289 /* Reset those iterator values set from display property values. */
3274 it->font_height = Qnil; 3290 it->slice.x = it->slice.y = it->slice.width = it->slice.height = Qnil;
3275 it->space_width = Qnil; 3291 it->space_width = Qnil;
3292 it->font_height = Qnil;
3276 it->voffset = 0; 3293 it->voffset = 0;
3277 3294
3278 /* We don't support recursive `display' properties, i.e. string 3295 /* We don't support recursive `display' properties, i.e. string
@@ -3291,6 +3308,7 @@ handle_display_prop (it)
3291 && !EQ (XCAR (prop), Qimage) 3308 && !EQ (XCAR (prop), Qimage)
3292 && !EQ (XCAR (prop), Qspace) 3309 && !EQ (XCAR (prop), Qspace)
3293 && !EQ (XCAR (prop), Qwhen) 3310 && !EQ (XCAR (prop), Qwhen)
3311 && !EQ (XCAR (prop), Qslice)
3294 && !EQ (XCAR (prop), Qspace_width) 3312 && !EQ (XCAR (prop), Qspace_width)
3295 && !EQ (XCAR (prop), Qheight) 3313 && !EQ (XCAR (prop), Qheight)
3296 && !EQ (XCAR (prop), Qraise) 3314 && !EQ (XCAR (prop), Qraise)
@@ -3487,6 +3505,30 @@ handle_single_display_prop (it, prop, object, position,
3487 it->space_width = value; 3505 it->space_width = value;
3488 } 3506 }
3489 else if (CONSP (prop) 3507 else if (CONSP (prop)
3508 && EQ (XCAR (prop), Qslice))
3509 {
3510 /* `(slice X Y WIDTH HEIGHT)'. */
3511 Lisp_Object tem;
3512
3513 if (FRAME_TERMCAP_P (it->f) || FRAME_MSDOS_P (it->f))
3514 return 0;
3515
3516 if (tem = XCDR (prop), CONSP (tem))
3517 {
3518 it->slice.x = XCAR (tem);
3519 if (tem = XCDR (tem), CONSP (tem))
3520 {
3521 it->slice.y = XCAR (tem);
3522 if (tem = XCDR (tem), CONSP (tem))
3523 {
3524 it->slice.width = XCAR (tem);
3525 if (tem = XCDR (tem), CONSP (tem))
3526 it->slice.height = XCAR (tem);
3527 }
3528 }
3529 }
3530 }
3531 else if (CONSP (prop)
3490 && EQ (XCAR (prop), Qraise) 3532 && EQ (XCAR (prop), Qraise)
3491 && CONSP (XCDR (prop))) 3533 && CONSP (XCDR (prop)))
3492 { 3534 {
@@ -4327,6 +4369,7 @@ push_it (it)
4327 p->string_nchars = it->string_nchars; 4369 p->string_nchars = it->string_nchars;
4328 p->area = it->area; 4370 p->area = it->area;
4329 p->multibyte_p = it->multibyte_p; 4371 p->multibyte_p = it->multibyte_p;
4372 p->slice = it->slice;
4330 p->space_width = it->space_width; 4373 p->space_width = it->space_width;
4331 p->font_height = it->font_height; 4374 p->font_height = it->font_height;
4332 p->voffset = it->voffset; 4375 p->voffset = it->voffset;
@@ -4359,6 +4402,7 @@ pop_it (it)
4359 it->string_nchars = p->string_nchars; 4402 it->string_nchars = p->string_nchars;
4360 it->area = p->area; 4403 it->area = p->area;
4361 it->multibyte_p = p->multibyte_p; 4404 it->multibyte_p = p->multibyte_p;
4405 it->slice = p->slice;
4362 it->space_width = p->space_width; 4406 it->space_width = p->space_width;
4363 it->font_height = p->font_height; 4407 it->font_height = p->font_height;
4364 it->voffset = p->voffset; 4408 it->voffset = p->voffset;
@@ -10758,15 +10802,14 @@ make_cursor_line_fully_visible (w, force_p)
10758 if (!MATRIX_ROW_PARTIALLY_VISIBLE_P (row)) 10802 if (!MATRIX_ROW_PARTIALLY_VISIBLE_P (row))
10759 return 1; 10803 return 1;
10760 10804
10761 if (force_p)
10762 return 0;
10763
10764 /* If the row the cursor is in is taller than the window's height, 10805 /* If the row the cursor is in is taller than the window's height,
10765 it's not clear what to do, so do nothing. */ 10806 it's not clear what to do, so do nothing. */
10766 window_height = window_box_height (w); 10807 window_height = window_box_height (w);
10767 if (row->height >= window_height) 10808 if (row->height >= window_height)
10768 return 1; 10809 {
10769 10810 if (!force_p || w->vscroll)
10811 return 1;
10812 }
10770 return 0; 10813 return 0;
10771 10814
10772#if 0 10815#if 0
@@ -14153,8 +14196,12 @@ append_space (it, default_face_p)
14153 face = FACE_FROM_ID (it->f, it->face_id); 14196 face = FACE_FROM_ID (it->f, it->face_id);
14154 it->face_id = FACE_FOR_CHAR (it->f, face, 0); 14197 it->face_id = FACE_FOR_CHAR (it->f, face, 0);
14155 14198
14199 if (it->max_ascent > 0 || it->max_descent > 0)
14200 it->constrain_row_ascent_descent_p = 1;
14201
14156 PRODUCE_GLYPHS (it); 14202 PRODUCE_GLYPHS (it);
14157 14203
14204 it->constrain_row_ascent_descent_p = 0;
14158 it->current_x = saved_x; 14205 it->current_x = saved_x;
14159 it->object = saved_object; 14206 it->object = saved_object;
14160 it->position = saved_pos; 14207 it->position = saved_pos;
@@ -17301,6 +17348,7 @@ fill_image_glyph_string (s)
17301 xassert (s->first_glyph->type == IMAGE_GLYPH); 17348 xassert (s->first_glyph->type == IMAGE_GLYPH);
17302 s->img = IMAGE_FROM_ID (s->f, s->first_glyph->u.img_id); 17349 s->img = IMAGE_FROM_ID (s->f, s->first_glyph->u.img_id);
17303 xassert (s->img); 17350 xassert (s->img);
17351 s->slice = s->first_glyph->slice;
17304 s->face = FACE_FROM_ID (s->f, s->first_glyph->face_id); 17352 s->face = FACE_FROM_ID (s->f, s->first_glyph->face_id);
17305 s->font = s->face->font; 17353 s->font = s->face->font;
17306 s->width = s->first_glyph->pixel_width; 17354 s->width = s->first_glyph->pixel_width;
@@ -18099,7 +18147,7 @@ take_vertical_position_into_account (it)
18099 if (it->voffset < 0) 18147 if (it->voffset < 0)
18100 /* Increase the ascent so that we can display the text higher 18148 /* Increase the ascent so that we can display the text higher
18101 in the line. */ 18149 in the line. */
18102 it->ascent += abs (it->voffset); 18150 it->ascent -= it->voffset;
18103 else 18151 else
18104 /* Increase the descent so that we can display the text lower 18152 /* Increase the descent so that we can display the text lower
18105 in the line. */ 18153 in the line. */
@@ -18119,6 +18167,7 @@ produce_image_glyph (it)
18119 struct image *img; 18167 struct image *img;
18120 struct face *face; 18168 struct face *face;
18121 int face_ascent, glyph_ascent; 18169 int face_ascent, glyph_ascent;
18170 struct glyph_slice slice;
18122 18171
18123 xassert (it->what == IT_IMAGE); 18172 xassert (it->what == IT_IMAGE);
18124 18173
@@ -18142,19 +18191,68 @@ produce_image_glyph (it)
18142 /* Make sure X resources of the image is loaded. */ 18191 /* Make sure X resources of the image is loaded. */
18143 prepare_image_for_display (it->f, img); 18192 prepare_image_for_display (it->f, img);
18144 18193
18145 it->ascent = it->phys_ascent = glyph_ascent = image_ascent (img, face); 18194 slice.x = slice.y = 0;
18146 it->descent = it->phys_descent = img->height + 2 * img->vmargin - it->ascent; 18195 slice.width = img->width;
18147 it->pixel_width = img->width + 2 * img->hmargin; 18196 slice.height = img->height;
18197
18198 if (INTEGERP (it->slice.x))
18199 slice.x = XINT (it->slice.x);
18200 else if (FLOATP (it->slice.x))
18201 slice.x = XFLOAT_DATA (it->slice.x) * img->width;
18202
18203 if (INTEGERP (it->slice.y))
18204 slice.y = XINT (it->slice.y);
18205 else if (FLOATP (it->slice.y))
18206 slice.y = XFLOAT_DATA (it->slice.y) * img->height;
18207
18208 if (INTEGERP (it->slice.width))
18209 slice.width = XINT (it->slice.width);
18210 else if (FLOATP (it->slice.width))
18211 slice.width = XFLOAT_DATA (it->slice.width) * img->width;
18212
18213 if (INTEGERP (it->slice.height))
18214 slice.height = XINT (it->slice.height);
18215 else if (FLOATP (it->slice.height))
18216 slice.height = XFLOAT_DATA (it->slice.height) * img->height;
18217
18218 if (slice.x >= img->width)
18219 slice.x = img->width;
18220 if (slice.y >= img->height)
18221 slice.y = img->height;
18222 if (slice.x + slice.width >= img->width)
18223 slice.width = img->width - slice.x;
18224 if (slice.y + slice.height > img->height)
18225 slice.height = img->height - slice.y;
18226
18227 if (slice.width == 0 || slice.height == 0)
18228 return;
18229
18230 it->ascent = it->phys_ascent = glyph_ascent = image_ascent (img, face, &slice);
18231
18232 it->descent = slice.height - glyph_ascent;
18233 if (slice.y == 0)
18234 it->descent += img->vmargin;
18235 if (slice.y + slice.height == img->height)
18236 it->descent += img->vmargin;
18237 it->phys_descent = it->descent;
18238
18239 it->pixel_width = slice.width;
18240 if (slice.x == 0)
18241 it->pixel_width += img->hmargin;
18242 if (slice.x + slice.width == img->width)
18243 it->pixel_width += img->hmargin;
18148 18244
18149 /* It's quite possible for images to have an ascent greater than 18245 /* It's quite possible for images to have an ascent greater than
18150 their height, so don't get confused in that case. */ 18246 their height, so don't get confused in that case. */
18151 if (it->descent < 0) 18247 if (it->descent < 0)
18152 it->descent = 0; 18248 it->descent = 0;
18153 18249
18250#if 0 /* this breaks image tiling */
18154 /* If this glyph is alone on the last line, adjust it.ascent to minimum row ascent. */ 18251 /* If this glyph is alone on the last line, adjust it.ascent to minimum row ascent. */
18155 face_ascent = face->font ? FONT_BASE (face->font) : FRAME_BASELINE_OFFSET (it->f); 18252 face_ascent = face->font ? FONT_BASE (face->font) : FRAME_BASELINE_OFFSET (it->f);
18156 if (face_ascent > it->ascent) 18253 if (face_ascent > it->ascent)
18157 it->ascent = it->phys_ascent = face_ascent; 18254 it->ascent = it->phys_ascent = face_ascent;
18255#endif
18158 18256
18159 it->nglyphs = 1; 18257 it->nglyphs = 1;
18160 18258
@@ -18162,13 +18260,15 @@ produce_image_glyph (it)
18162 { 18260 {
18163 if (face->box_line_width > 0) 18261 if (face->box_line_width > 0)
18164 { 18262 {
18165 it->ascent += face->box_line_width; 18263 if (slice.y == 0)
18166 it->descent += face->box_line_width; 18264 it->ascent += face->box_line_width;
18265 if (slice.y + slice.height == img->height)
18266 it->descent += face->box_line_width;
18167 } 18267 }
18168 18268
18169 if (it->start_of_box_run_p) 18269 if (it->start_of_box_run_p && slice.x == 0)
18170 it->pixel_width += abs (face->box_line_width); 18270 it->pixel_width += abs (face->box_line_width);
18171 if (it->end_of_box_run_p) 18271 if (it->end_of_box_run_p && slice.x + slice.width == img->width)
18172 it->pixel_width += abs (face->box_line_width); 18272 it->pixel_width += abs (face->box_line_width);
18173 } 18273 }
18174 18274
@@ -18197,6 +18297,7 @@ produce_image_glyph (it)
18197 glyph->glyph_not_available_p = 0; 18297 glyph->glyph_not_available_p = 0;
18198 glyph->face_id = it->face_id; 18298 glyph->face_id = it->face_id;
18199 glyph->u.img_id = img->id; 18299 glyph->u.img_id = img->id;
18300 glyph->slice = slice;
18200 glyph->font_type = FONT_TYPE_UNKNOWN; 18301 glyph->font_type = FONT_TYPE_UNKNOWN;
18201 ++it->glyph_row->used[area]; 18302 ++it->glyph_row->used[area];
18202 } 18303 }
@@ -18488,8 +18589,9 @@ x_produce_glyphs (it)
18488 18589
18489 it->nglyphs = 1; 18590 it->nglyphs = 1;
18490 18591
18491 pcm = FRAME_RIF (it->f)->per_char_metric (font, &char2b, 18592 pcm = FRAME_RIF (it->f)->per_char_metric
18492 FONT_TYPE_FOR_UNIBYTE (font, it->char_to_display)); 18593 (font, &char2b, FONT_TYPE_FOR_UNIBYTE (font, it->char_to_display));
18594
18493 it->ascent = FONT_BASE (font) + boff; 18595 it->ascent = FONT_BASE (font) + boff;
18494 it->descent = FONT_DESCENT (font) - boff; 18596 it->descent = FONT_DESCENT (font) - boff;
18495 18597
@@ -18502,11 +18604,27 @@ x_produce_glyphs (it)
18502 else 18604 else
18503 { 18605 {
18504 it->glyph_not_available_p = 1; 18606 it->glyph_not_available_p = 1;
18505 it->phys_ascent = FONT_BASE (font) + boff; 18607 it->phys_ascent = it->ascent;
18506 it->phys_descent = FONT_DESCENT (font) - boff; 18608 it->phys_descent = it->descent;
18507 it->pixel_width = FONT_WIDTH (font); 18609 it->pixel_width = FONT_WIDTH (font);
18508 } 18610 }
18509 18611
18612 if (it->constrain_row_ascent_descent_p)
18613 {
18614 if (it->descent > it->max_descent)
18615 {
18616 it->ascent += it->descent - it->max_descent;
18617 it->descent = it->max_descent;
18618 }
18619 if (it->ascent> it->max_ascent)
18620 {
18621 it->descent = min (it->max_descent, it->descent + it->ascent - it->max_ascent);
18622 it->ascent = it->max_ascent;
18623 }
18624 it->phys_ascent = min (it->phys_ascent, it->ascent);
18625 it->phys_descent = min (it->phys_descent, it->descent);
18626 }
18627
18510 /* If this is a space inside a region of text with 18628 /* If this is a space inside a region of text with
18511 `space-width' property, change its width. */ 18629 `space-width' property, change its width. */
18512 stretched_p = it->char_to_display == ' ' && !NILP (it->space_width); 18630 stretched_p = it->char_to_display == ' ' && !NILP (it->space_width);
@@ -18539,6 +18657,14 @@ x_produce_glyphs (it)
18539 if (face->overline_p) 18657 if (face->overline_p)
18540 it->ascent += 2; 18658 it->ascent += 2;
18541 18659
18660 if (it->constrain_row_ascent_descent_p)
18661 {
18662 if (it->ascent > it->max_ascent)
18663 it->ascent = it->max_ascent;
18664 if (it->descent > it->max_descent)
18665 it->descent = it->max_descent;
18666 }
18667
18542 take_vertical_position_into_account (it); 18668 take_vertical_position_into_account (it);
18543 18669
18544 /* If we have to actually produce glyphs, do it. */ 18670 /* If we have to actually produce glyphs, do it. */
@@ -18565,13 +18691,31 @@ x_produce_glyphs (it)
18565 } 18691 }
18566 else if (it->char_to_display == '\n') 18692 else if (it->char_to_display == '\n')
18567 { 18693 {
18568 /* A newline has no width but we need the height of the line. */ 18694 /* A newline has no width but we need the height of the line.
18695 But if previous part of the line set a height, don't
18696 increase that height */
18697
18569 it->pixel_width = 0; 18698 it->pixel_width = 0;
18570 it->nglyphs = 0; 18699 it->nglyphs = 0;
18571 it->ascent = it->phys_ascent = FONT_BASE (font) + boff;
18572 it->descent = it->phys_descent = FONT_DESCENT (font) - boff;
18573 18700
18574 if (face->box != FACE_NO_BOX 18701 it->ascent = FONT_BASE (font) + boff;
18702 it->descent = FONT_DESCENT (font) - boff;
18703
18704 if (it->max_ascent > 0 || it->max_descent > 0)
18705 {
18706 it->ascent = it->descent = 0;
18707 }
18708 else
18709 {
18710 it->ascent = FONT_BASE (font) + boff;
18711 it->descent = FONT_DESCENT (font) - boff;
18712 }
18713
18714 it->phys_ascent = it->ascent;
18715 it->phys_descent = it->descent;
18716
18717 if ((it->max_ascent > 0 || it->max_descent > 0)
18718 && face->box != FACE_NO_BOX
18575 && face->box_line_width > 0) 18719 && face->box_line_width > 0)
18576 { 18720 {
18577 it->ascent += face->box_line_width; 18721 it->ascent += face->box_line_width;
@@ -20544,7 +20688,9 @@ note_mouse_highlight (f, x, y)
20544 Lisp_Object image_map, hotspot; 20688 Lisp_Object image_map, hotspot;
20545 if ((image_map = Fplist_get (XCDR (img->spec), QCmap), 20689 if ((image_map = Fplist_get (XCDR (img->spec), QCmap),
20546 !NILP (image_map)) 20690 !NILP (image_map))
20547 && (hotspot = find_hot_spot (image_map, dx, dy), 20691 && (hotspot = find_hot_spot (image_map,
20692 glyph->slice.x + dx,
20693 glyph->slice.y + dy),
20548 CONSP (hotspot)) 20694 CONSP (hotspot))
20549 && (hotspot = XCDR (hotspot), CONSP (hotspot))) 20695 && (hotspot = XCDR (hotspot), CONSP (hotspot)))
20550 { 20696 {
@@ -21583,6 +21729,8 @@ syms_of_xdisp ()
21583 staticpro (&Qspace_width); 21729 staticpro (&Qspace_width);
21584 Qraise = intern ("raise"); 21730 Qraise = intern ("raise");
21585 staticpro (&Qraise); 21731 staticpro (&Qraise);
21732 Qslice = intern ("slice");
21733 staticpro (&Qslice);
21586 Qspace = intern ("space"); 21734 Qspace = intern ("space");
21587 staticpro (&Qspace); 21735 staticpro (&Qspace);
21588 Qmargin = intern ("margin"); 21736 Qmargin = intern ("margin");
diff --git a/src/xterm.c b/src/xterm.c
index ea82a435b2b..838d4f2ad4b 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -982,7 +982,8 @@ static void x_draw_image_foreground_1 P_ ((struct glyph_string *, Pixmap));
982static void x_clear_glyph_string_rect P_ ((struct glyph_string *, int, 982static void x_clear_glyph_string_rect P_ ((struct glyph_string *, int,
983 int, int, int)); 983 int, int, int));
984static void x_draw_relief_rect P_ ((struct frame *, int, int, int, int, 984static void x_draw_relief_rect P_ ((struct frame *, int, int, int, int,
985 int, int, int, int, XRectangle *)); 985 int, int, int, int, int, int,
986 XRectangle *));
986static void x_draw_box_rect P_ ((struct glyph_string *, int, int, int, int, 987static void x_draw_box_rect P_ ((struct glyph_string *, int, int, int, int,
987 int, int, int, XRectangle *)); 988 int, int, int, XRectangle *));
988 989
@@ -2021,9 +2022,10 @@ x_setup_relief_colors (s)
2021 2022
2022static void 2023static void
2023x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width, 2024x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
2024 raised_p, left_p, right_p, clip_rect) 2025 raised_p, top_p, bot_p, left_p, right_p, clip_rect)
2025 struct frame *f; 2026 struct frame *f;
2026 int left_x, top_y, right_x, bottom_y, width, left_p, right_p, raised_p; 2027 int left_x, top_y, right_x, bottom_y, width;
2028 int top_p, bot_p, left_p, right_p, raised_p;
2027 XRectangle *clip_rect; 2029 XRectangle *clip_rect;
2028{ 2030{
2029 Display *dpy = FRAME_X_DISPLAY (f); 2031 Display *dpy = FRAME_X_DISPLAY (f);
@@ -2038,10 +2040,11 @@ x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
2038 XSetClipRectangles (dpy, gc, 0, 0, clip_rect, 1, Unsorted); 2040 XSetClipRectangles (dpy, gc, 0, 0, clip_rect, 1, Unsorted);
2039 2041
2040 /* Top. */ 2042 /* Top. */
2041 for (i = 0; i < width; ++i) 2043 if (top_p)
2042 XDrawLine (dpy, window, gc, 2044 for (i = 0; i < width; ++i)
2043 left_x + i * left_p, top_y + i, 2045 XDrawLine (dpy, window, gc,
2044 right_x + 1 - i * right_p, top_y + i); 2046 left_x + i * left_p, top_y + i,
2047 right_x + 1 - i * right_p, top_y + i);
2045 2048
2046 /* Left. */ 2049 /* Left. */
2047 if (left_p) 2050 if (left_p)
@@ -2057,10 +2060,11 @@ x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
2057 XSetClipRectangles (dpy, gc, 0, 0, clip_rect, 1, Unsorted); 2060 XSetClipRectangles (dpy, gc, 0, 0, clip_rect, 1, Unsorted);
2058 2061
2059 /* Bottom. */ 2062 /* Bottom. */
2060 for (i = 0; i < width; ++i) 2063 if (bot_p)
2061 XDrawLine (dpy, window, gc, 2064 for (i = 0; i < width; ++i)
2062 left_x + i * left_p, bottom_y - i, 2065 XDrawLine (dpy, window, gc,
2063 right_x + 1 - i * right_p, bottom_y - i); 2066 left_x + i * left_p, bottom_y - i,
2067 right_x + 1 - i * right_p, bottom_y - i);
2064 2068
2065 /* Right. */ 2069 /* Right. */
2066 if (right_p) 2070 if (right_p)
@@ -2168,7 +2172,7 @@ x_draw_glyph_string_box (s)
2168 { 2172 {
2169 x_setup_relief_colors (s); 2173 x_setup_relief_colors (s);
2170 x_draw_relief_rect (s->f, left_x, top_y, right_x, bottom_y, 2174 x_draw_relief_rect (s->f, left_x, top_y, right_x, bottom_y,
2171 width, raised_p, left_p, right_p, &clip_rect); 2175 width, raised_p, 1, 1, left_p, right_p, &clip_rect);
2172 } 2176 }
2173} 2177}
2174 2178
@@ -2179,21 +2183,22 @@ static void
2179x_draw_image_foreground (s) 2183x_draw_image_foreground (s)
2180 struct glyph_string *s; 2184 struct glyph_string *s;
2181{ 2185{
2182 int x; 2186 int x = s->x;
2183 int y = s->ybase - image_ascent (s->img, s->face); 2187 int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
2184 2188
2185 /* If first glyph of S has a left box line, start drawing it to the 2189 /* If first glyph of S has a left box line, start drawing it to the
2186 right of that line. */ 2190 right of that line. */
2187 if (s->face->box != FACE_NO_BOX 2191 if (s->face->box != FACE_NO_BOX
2188 && s->first_glyph->left_box_line_p) 2192 && s->first_glyph->left_box_line_p
2189 x = s->x + abs (s->face->box_line_width); 2193 && s->slice.x == 0)
2190 else 2194 x += abs (s->face->box_line_width);
2191 x = s->x;
2192 2195
2193 /* If there is a margin around the image, adjust x- and y-position 2196 /* If there is a margin around the image, adjust x- and y-position
2194 by that margin. */ 2197 by that margin. */
2195 x += s->img->hmargin; 2198 if (s->slice.x == 0)
2196 y += s->img->vmargin; 2199 x += s->img->hmargin;
2200 if (s->slice.y == 0)
2201 y += s->img->vmargin;
2197 2202
2198 if (s->img->pixmap) 2203 if (s->img->pixmap)
2199 { 2204 {
@@ -2218,11 +2223,12 @@ x_draw_image_foreground (s)
2218 get_glyph_string_clip_rect (s, &clip_rect); 2223 get_glyph_string_clip_rect (s, &clip_rect);
2219 image_rect.x = x; 2224 image_rect.x = x;
2220 image_rect.y = y; 2225 image_rect.y = y;
2221 image_rect.width = s->img->width; 2226 image_rect.width = s->slice.width;
2222 image_rect.height = s->img->height; 2227 image_rect.height = s->slice.height;
2223 if (x_intersect_rectangles (&clip_rect, &image_rect, &r)) 2228 if (x_intersect_rectangles (&clip_rect, &image_rect, &r))
2224 XCopyArea (s->display, s->img->pixmap, s->window, s->gc, 2229 XCopyArea (s->display, s->img->pixmap, s->window, s->gc,
2225 r.x - x, r.y - y, r.width, r.height, r.x, r.y); 2230 s->slice.x + r.x - x, s->slice.y + r.y - y,
2231 r.width, r.height, r.x, r.y);
2226 } 2232 }
2227 else 2233 else
2228 { 2234 {
@@ -2231,11 +2237,12 @@ x_draw_image_foreground (s)
2231 get_glyph_string_clip_rect (s, &clip_rect); 2237 get_glyph_string_clip_rect (s, &clip_rect);
2232 image_rect.x = x; 2238 image_rect.x = x;
2233 image_rect.y = y; 2239 image_rect.y = y;
2234 image_rect.width = s->img->width; 2240 image_rect.width = s->slice.width;
2235 image_rect.height = s->img->height; 2241 image_rect.height = s->slice.height;
2236 if (x_intersect_rectangles (&clip_rect, &image_rect, &r)) 2242 if (x_intersect_rectangles (&clip_rect, &image_rect, &r))
2237 XCopyArea (s->display, s->img->pixmap, s->window, s->gc, 2243 XCopyArea (s->display, s->img->pixmap, s->window, s->gc,
2238 r.x - x, r.y - y, r.width, r.height, r.x, r.y); 2244 s->slice.x + r.x - x, s->slice.y + r.y - y,
2245 r.width, r.height, r.x, r.y);
2239 2246
2240 /* When the image has a mask, we can expect that at 2247 /* When the image has a mask, we can expect that at
2241 least part of a mouse highlight or a block cursor will 2248 least part of a mouse highlight or a block cursor will
@@ -2247,15 +2254,17 @@ x_draw_image_foreground (s)
2247 { 2254 {
2248 int r = s->img->relief; 2255 int r = s->img->relief;
2249 if (r < 0) r = -r; 2256 if (r < 0) r = -r;
2250 XDrawRectangle (s->display, s->window, s->gc, x - r, y - r, 2257 XDrawRectangle (s->display, s->window, s->gc,
2251 s->img->width + r*2 - 1, s->img->height + r*2 - 1); 2258 x - r, y - r,
2259 s->slice.width + r*2 - 1,
2260 s->slice.height + r*2 - 1);
2252 } 2261 }
2253 } 2262 }
2254 } 2263 }
2255 else 2264 else
2256 /* Draw a rectangle if image could not be loaded. */ 2265 /* Draw a rectangle if image could not be loaded. */
2257 XDrawRectangle (s->display, s->window, s->gc, x, y, 2266 XDrawRectangle (s->display, s->window, s->gc, x, y,
2258 s->img->width - 1, s->img->height - 1); 2267 s->slice.width - 1, s->slice.height - 1);
2259} 2268}
2260 2269
2261 2270
@@ -2267,21 +2276,22 @@ x_draw_image_relief (s)
2267{ 2276{
2268 int x0, y0, x1, y1, thick, raised_p; 2277 int x0, y0, x1, y1, thick, raised_p;
2269 XRectangle r; 2278 XRectangle r;
2270 int x; 2279 int x = s->x;
2271 int y = s->ybase - image_ascent (s->img, s->face); 2280 int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
2272 2281
2273 /* If first glyph of S has a left box line, start drawing it to the 2282 /* If first glyph of S has a left box line, start drawing it to the
2274 right of that line. */ 2283 right of that line. */
2275 if (s->face->box != FACE_NO_BOX 2284 if (s->face->box != FACE_NO_BOX
2276 && s->first_glyph->left_box_line_p) 2285 && s->first_glyph->left_box_line_p
2277 x = s->x + abs (s->face->box_line_width); 2286 && s->slice.x == 0)
2278 else 2287 x += abs (s->face->box_line_width);
2279 x = s->x;
2280 2288
2281 /* If there is a margin around the image, adjust x- and y-position 2289 /* If there is a margin around the image, adjust x- and y-position
2282 by that margin. */ 2290 by that margin. */
2283 x += s->img->hmargin; 2291 if (s->slice.x == 0)
2284 y += s->img->vmargin; 2292 x += s->img->hmargin;
2293 if (s->slice.y == 0)
2294 y += s->img->vmargin;
2285 2295
2286 if (s->hl == DRAW_IMAGE_SUNKEN 2296 if (s->hl == DRAW_IMAGE_SUNKEN
2287 || s->hl == DRAW_IMAGE_RAISED) 2297 || s->hl == DRAW_IMAGE_RAISED)
@@ -2297,12 +2307,17 @@ x_draw_image_relief (s)
2297 2307
2298 x0 = x - thick; 2308 x0 = x - thick;
2299 y0 = y - thick; 2309 y0 = y - thick;
2300 x1 = x + s->img->width + thick - 1; 2310 x1 = x + s->slice.width + thick - 1;
2301 y1 = y + s->img->height + thick - 1; 2311 y1 = y + s->slice.height + thick - 1;
2302 2312
2303 x_setup_relief_colors (s); 2313 x_setup_relief_colors (s);
2304 get_glyph_string_clip_rect (s, &r); 2314 get_glyph_string_clip_rect (s, &r);
2305 x_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p, 1, 1, &r); 2315 x_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p,
2316 s->slice.y == 0,
2317 s->slice.y + s->slice.height == s->img->height,
2318 s->slice.x == 0,
2319 s->slice.x + s->slice.width == s->img->width,
2320 &r);
2306} 2321}
2307 2322
2308 2323
@@ -2313,21 +2328,22 @@ x_draw_image_foreground_1 (s, pixmap)
2313 struct glyph_string *s; 2328 struct glyph_string *s;
2314 Pixmap pixmap; 2329 Pixmap pixmap;
2315{ 2330{
2316 int x; 2331 int x = 0;
2317 int y = s->ybase - s->y - image_ascent (s->img, s->face); 2332 int y = s->ybase - s->y - image_ascent (s->img, s->face, &s->slice);
2318 2333
2319 /* If first glyph of S has a left box line, start drawing it to the 2334 /* If first glyph of S has a left box line, start drawing it to the
2320 right of that line. */ 2335 right of that line. */
2321 if (s->face->box != FACE_NO_BOX 2336 if (s->face->box != FACE_NO_BOX
2322 && s->first_glyph->left_box_line_p) 2337 && s->first_glyph->left_box_line_p
2323 x = abs (s->face->box_line_width); 2338 && s->slice.x == 0)
2324 else 2339 x += abs (s->face->box_line_width);
2325 x = 0;
2326 2340
2327 /* If there is a margin around the image, adjust x- and y-position 2341 /* If there is a margin around the image, adjust x- and y-position
2328 by that margin. */ 2342 by that margin. */
2329 x += s->img->hmargin; 2343 if (s->slice.x == 0)
2330 y += s->img->vmargin; 2344 x += s->img->hmargin;
2345 if (s->slice.y == 0)
2346 y += s->img->vmargin;
2331 2347
2332 if (s->img->pixmap) 2348 if (s->img->pixmap)
2333 { 2349 {
@@ -2349,13 +2365,15 @@ x_draw_image_foreground_1 (s, pixmap)
2349 XChangeGC (s->display, s->gc, mask, &xgcv); 2365 XChangeGC (s->display, s->gc, mask, &xgcv);
2350 2366
2351 XCopyArea (s->display, s->img->pixmap, pixmap, s->gc, 2367 XCopyArea (s->display, s->img->pixmap, pixmap, s->gc,
2352 0, 0, s->img->width, s->img->height, x, y); 2368 s->slice.x, s->slice.y,
2369 s->slice.width, s->slice.height, x, y);
2353 XSetClipMask (s->display, s->gc, None); 2370 XSetClipMask (s->display, s->gc, None);
2354 } 2371 }
2355 else 2372 else
2356 { 2373 {
2357 XCopyArea (s->display, s->img->pixmap, pixmap, s->gc, 2374 XCopyArea (s->display, s->img->pixmap, pixmap, s->gc,
2358 0, 0, s->img->width, s->img->height, x, y); 2375 s->slice.x, s->slice.y,
2376 s->slice.width, s->slice.height, x, y);
2359 2377
2360 /* When the image has a mask, we can expect that at 2378 /* When the image has a mask, we can expect that at
2361 least part of a mouse highlight or a block cursor will 2379 least part of a mouse highlight or a block cursor will
@@ -2368,14 +2386,15 @@ x_draw_image_foreground_1 (s, pixmap)
2368 int r = s->img->relief; 2386 int r = s->img->relief;
2369 if (r < 0) r = -r; 2387 if (r < 0) r = -r;
2370 XDrawRectangle (s->display, s->window, s->gc, x - r, y - r, 2388 XDrawRectangle (s->display, s->window, s->gc, x - r, y - r,
2371 s->img->width + r*2 - 1, s->img->height + r*2 - 1); 2389 s->slice.width + r*2 - 1,
2390 s->slice.height + r*2 - 1);
2372 } 2391 }
2373 } 2392 }
2374 } 2393 }
2375 else 2394 else
2376 /* Draw a rectangle if image could not be loaded. */ 2395 /* Draw a rectangle if image could not be loaded. */
2377 XDrawRectangle (s->display, pixmap, s->gc, x, y, 2396 XDrawRectangle (s->display, pixmap, s->gc, x, y,
2378 s->img->width - 1, s->img->height - 1); 2397 s->slice.width - 1, s->slice.height - 1);
2379} 2398}
2380 2399
2381 2400
@@ -2417,33 +2436,28 @@ static void
2417x_draw_image_glyph_string (s) 2436x_draw_image_glyph_string (s)
2418 struct glyph_string *s; 2437 struct glyph_string *s;
2419{ 2438{
2420 int x, y;
2421 int box_line_hwidth = abs (s->face->box_line_width); 2439 int box_line_hwidth = abs (s->face->box_line_width);
2422 int box_line_vwidth = max (s->face->box_line_width, 0); 2440 int box_line_vwidth = max (s->face->box_line_width, 0);
2423 int height; 2441 int height;
2424 Pixmap pixmap = None; 2442 Pixmap pixmap = None;
2425 2443
2426 height = s->height - 2 * box_line_vwidth; 2444 height = s->height;
2427 2445 if (s->slice.y == 0)
2446 height -= box_line_vwidth;
2447 if (s->slice.y + s->slice.height >= s->img->height)
2448 height -= box_line_vwidth;
2428 2449
2429 /* Fill background with face under the image. Do it only if row is 2450 /* Fill background with face under the image. Do it only if row is
2430 taller than image or if image has a clip mask to reduce 2451 taller than image or if image has a clip mask to reduce
2431 flickering. */ 2452 flickering. */
2432 s->stippled_p = s->face->stipple != 0; 2453 s->stippled_p = s->face->stipple != 0;
2433 if (height > s->img->height 2454 if (height > s->slice.height
2434 || s->img->hmargin 2455 || s->img->hmargin
2435 || s->img->vmargin 2456 || s->img->vmargin
2436 || s->img->mask 2457 || s->img->mask
2437 || s->img->pixmap == 0 2458 || s->img->pixmap == 0
2438 || s->width != s->background_width) 2459 || s->width != s->background_width)
2439 { 2460 {
2440 if (box_line_hwidth && s->first_glyph->left_box_line_p)
2441 x = s->x + box_line_hwidth;
2442 else
2443 x = s->x;
2444
2445 y = s->y + box_line_vwidth;
2446
2447 if (s->img->mask) 2461 if (s->img->mask)
2448 { 2462 {
2449 /* Create a pixmap as large as the glyph string. Fill it 2463 /* Create a pixmap as large as the glyph string. Fill it
@@ -2482,7 +2496,19 @@ x_draw_image_glyph_string (s)
2482 } 2496 }
2483 } 2497 }
2484 else 2498 else
2485 x_draw_glyph_string_bg_rect (s, x, y, s->background_width, height); 2499 {
2500 int x = s->x;
2501 int y = s->y;
2502
2503 if (s->first_glyph->left_box_line_p
2504 && s->slice.x == 0)
2505 x += box_line_hwidth;
2506
2507 if (s->slice.y == 0)
2508 y += box_line_vwidth;
2509
2510 x_draw_glyph_string_bg_rect (s, x, y, s->background_width, height);
2511 }
2486 2512
2487 s->background_filled_p = 1; 2513 s->background_filled_p = 1;
2488 } 2514 }
diff --git a/src/xterm.h b/src/xterm.h
index a350567cd46..56c1d059ac3 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -941,7 +941,6 @@ Lisp_Object display_x_get_resource P_ ((struct x_display_info *,
941struct frame *check_x_frame P_ ((Lisp_Object)); 941struct frame *check_x_frame P_ ((Lisp_Object));
942EXFUN (Fx_display_color_p, 1); 942EXFUN (Fx_display_color_p, 1);
943EXFUN (Fx_display_grayscale_p, 1); 943EXFUN (Fx_display_grayscale_p, 1);
944int image_ascent P_ ((struct image *, struct face *));
945extern void x_free_gcs P_ ((struct frame *)); 944extern void x_free_gcs P_ ((struct frame *));
946 945
947/* From xrdb.c. */ 946/* From xrdb.c. */