aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--admin/ChangeLog5
-rw-r--r--admin/nt/README-ftp-server34
-rw-r--r--doc/misc/ChangeLog12
-rw-r--r--doc/misc/cc-mode.texi108
-rw-r--r--lisp/ChangeLog85
-rw-r--r--lisp/emacs-lisp/cl.el2
-rw-r--r--lisp/mail/rmail.el1
-rw-r--r--lisp/net/rcirc.el1
-rw-r--r--lisp/progmodes/cc-cmds.el284
-rw-r--r--lisp/progmodes/cc-defs.el21
-rw-r--r--lisp/progmodes/cc-engine.el182
-rw-r--r--lisp/progmodes/cc-fonts.el8
-rw-r--r--lisp/progmodes/cc-langs.el72
-rw-r--r--lisp/progmodes/cc-mode.el3
-rw-r--r--lisp/progmodes/cc-vars.el62
-rw-r--r--lisp/progmodes/gdb-mi.el42
-rw-r--r--lisp/vc/log-edit.el14
-rw-r--r--nt/ChangeLog5
-rw-r--r--nt/README.W3221
-rw-r--r--src/ChangeLog54
-rw-r--r--src/emacs.c1
-rw-r--r--src/keyboard.c124
-rw-r--r--src/lisp.h20
-rw-r--r--src/w32.h1
-rw-r--r--src/w32font.c149
-rw-r--r--src/window.c41
-rw-r--r--src/xdisp.c13
27 files changed, 1053 insertions, 312 deletions
diff --git a/admin/ChangeLog b/admin/ChangeLog
index 7648b2a8455..7c2f1a743b2 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,3 +1,8 @@
12011-10-28 Eli Zaretskii <eliz@gnu.org>
2
3 * nt/README-ftp-server: Mention UNICOWS.DLL as prerequisite for
4 running Emacs on Windows 9X.
5
12011-09-26 Chong Yidong <cyd@stupidchicken.com> 62011-09-26 Chong Yidong <cyd@stupidchicken.com>
2 7
3 * admin.el (set-version): Fix regexps for config.nt and 8 * admin.el (set-version): Fix regexps for config.nt and
diff --git a/admin/nt/README-ftp-server b/admin/nt/README-ftp-server
index 4310ac13dd5..5dee94f28c5 100644
--- a/admin/nt/README-ftp-server
+++ b/admin/nt/README-ftp-server
@@ -4,9 +4,9 @@ See the end of the file for license conditions.
4 Precompiled Distributions of 4 Precompiled Distributions of
5 Emacs for Windows 5 Emacs for Windows
6 6
7 Version 23.1 7 Version 24.1
8 8
9 July 29, 2009 9 January 1, 2011
10 10
11 This directory contains precompiled distributions for GNU Emacs on 11 This directory contains precompiled distributions for GNU Emacs on
12 Windows (versions before Windows 95 and NT4 are not supported). 12 Windows (versions before Windows 95 and NT4 are not supported).
@@ -14,7 +14,7 @@ See the end of the file for license conditions.
14 Free Software Foundation; the precompiled distributions are provided 14 Free Software Foundation; the precompiled distributions are provided
15 here for convenience since the majority of Windows users are not 15 here for convenience since the majority of Windows users are not
16 accustomed to compiling programs themselves. Corresponding source 16 accustomed to compiling programs themselves. Corresponding source
17 can be found in the parent directory in emacs-23.1.tar.gz. 17 can be found in the parent directory in emacs-24.1.tar.gz.
18 18
19 If you have access to the World Wide Web, I would recommend pointing 19 If you have access to the World Wide Web, I would recommend pointing
20 your favorite web browser to the following document (if you haven't 20 your favorite web browser to the following document (if you haven't
@@ -26,9 +26,9 @@ See the end of the file for license conditions.
26 26
27 If you want to redistribute any of the precompiled distributions of 27 If you want to redistribute any of the precompiled distributions of
28 Emacs, be careful to check the implications of the GPL. For instance, 28 Emacs, be careful to check the implications of the GPL. For instance,
29 if you put the emacs-23.1-bin-i386.tar.gz file from this directory on 29 if you put the emacs-24.1-bin-i386.tar.gz file from this directory on
30 an Internet site, you must arrange to distribute the source files of 30 an Internet site, you must arrange to distribute the source files of
31 the SAME version (i.e. ../emacs-23.1.tar.gz). 31 the SAME version (i.e. ../emacs-24.1.tar.gz).
32 32
33 Making a link to our copy of the source is NOT sufficient, since we 33 Making a link to our copy of the source is NOT sufficient, since we
34 might upgrade to a new version while you are still distributing the 34 might upgrade to a new version while you are still distributing the
@@ -37,8 +37,8 @@ See the end of the file for license conditions.
37 37
38* Files in this directory 38* Files in this directory
39 39
40 + emacs-23.1-bin-i386.zip 40 + emacs-24.1-bin-i386.zip
41 Windows binaries of Emacs-23.1, with all lisp code and documentation 41 Windows binaries of Emacs-24.1, with all lisp code and documentation
42 included. 42 included.
43 43
44 Download this file if you want a single installation package, and 44 Download this file if you want a single installation package, and
@@ -49,8 +49,8 @@ See the end of the file for license conditions.
49 If you need the C source code at a later date, it will be safe to 49 If you need the C source code at a later date, it will be safe to
50 unpack the source distribution on top of this installation. 50 unpack the source distribution on top of this installation.
51 51
52 + emacs-23.1-barebin-i386.zip 52 + emacs-24.1-barebin-i386.zip
53 Windows binaries of Emacs-23.1, without lisp code or documentation. 53 Windows binaries of Emacs-24.1, without lisp code or documentation.
54 54
55 Download this file if you already have the source distribution. 55 Download this file if you already have the source distribution.
56 56
@@ -62,12 +62,18 @@ See the end of the file for license conditions.
62 a basic Makefile for compiling with mingw32 and a .def file for 62 a basic Makefile for compiling with mingw32 and a .def file for
63 generating a DLL with the appropriate exports in addition to the 63 generating a DLL with the appropriate exports in addition to the
64 source code to provide the subset of functionality Emacs uses from 64 source code to provide the subset of functionality Emacs uses from
65 libXpm. This corresponds to the libXpm.dll in emacs-23.1-bin-i386.zip 65 libXpm. This corresponds to the libXpm.dll in emacs-24.1-bin-i386.zip
66 and emacs-23.1-barebin-i386.zip. 66 and emacs-24.1-barebin-i386.zip.
67
68* Prerequisites for running Emacs on Windows 9X
69
70 Using Emacs in GUI mode on Windows 95/98/Me requires the UNICOWS.DLL
71 dynamic library, which provides MSLU, the Microsoft Unicode Layer
72 for Windows 9X. You can freely download it from the Microsoft site.
67 73
68* Image support 74* Image support
69 75
70 Emacs 23.1 contains support for images, however for most image formats 76 Emacs 24.1 contains support for images, however for most image formats
71 supporting libraries are required. This distribution has been tested 77 supporting libraries are required. This distribution has been tested
72 with the libraries that are distributed with GTK for Windows, and the 78 with the libraries that are distributed with GTK for Windows, and the
73 libraries found at http://gnuwin32.sourceforge.net/. The following image 79 libraries found at http://gnuwin32.sourceforge.net/. The following image
@@ -119,7 +125,7 @@ See the end of the file for license conditions.
119 Distributions for non-x86 platforms are no longer supplied. Older 125 Distributions for non-x86 platforms are no longer supplied. Older
120 platforms supported by Windows NT no longer seem to be in demand, 126 platforms supported by Windows NT no longer seem to be in demand,
121 and Emacs is yet to be ported to 64 bit Windows platforms. If you 127 and Emacs is yet to be ported to 64 bit Windows platforms. If you
122 are willing to help port Emacs 23 to 64 bit versions of Windows, 128 are willing to help port Emacs 24 to 64 bit versions of Windows,
123 your contribution will be welcome on the emacs-devel mailing list. 129 your contribution will be welcome on the emacs-devel mailing list.
124 130
125* Unpacking distributions 131* Unpacking distributions
@@ -227,7 +233,7 @@ See the end of the file for license conditions.
227 This document serves as an FAQ and a source for further information 233 This document serves as an FAQ and a source for further information
228 about the Windows port and related software packages. Note that as 234 about the Windows port and related software packages. Note that as
229 most of the information in that FAQ is for earlier versions, so some 235 most of the information in that FAQ is for earlier versions, so some
230 information may not be relevant to Emacs-23.1. 236 information may not be relevant to Emacs-24.1.
231 237
232 In addition to the FAQ, there is a mailing list for discussing issues 238 In addition to the FAQ, there is a mailing list for discussing issues
233 related to the Windows port of Emacs. For information about the 239 related to the Windows port of Emacs. For information about the
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 6b0ef9c5d8b..10a0d5e7a91 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,15 @@
12011-10-28 Alan Mackenzie <acm@muc.de>
2
3 * cc-mode.texi (Indentation Commands): Mention "macros with semicolons".
4 (Other Special Indentations): Add an xref to "Macros with ;".
5 (Customizing Macros): Add stuff about syntax in macros. Add an xref to
6 "Macros with ;".
7 (Macros with ;): New page.
8
9 * progmodes/cc-mode.texi (Movement Commands): Document
10 `c-defun-tactic'. Document the new handling of nested scopes for
11 movement by defuns.
12
12011-10-23 Michael Albinus <michael.albinus@gmx.de> 132011-10-23 Michael Albinus <michael.albinus@gmx.de>
2 14
3 Sync with Tramp 2.2.3. 15 Sync with Tramp 2.2.3.
diff --git a/doc/misc/cc-mode.texi b/doc/misc/cc-mode.texi
index a9339162666..887e3f3c808 100644
--- a/doc/misc/cc-mode.texi
+++ b/doc/misc/cc-mode.texi
@@ -341,6 +341,11 @@ Line-Up Functions
341* Comment Line-Up:: 341* Comment Line-Up::
342* Misc Line-Up:: 342* Misc Line-Up::
343 343
344Customizing Macros
345
346* Macro Backslashes::
347* Macros with ;::
348
344@end detailmenu 349@end detailmenu
345@end menu 350@end menu
346 351
@@ -655,6 +660,10 @@ expression, to some statements, or perhaps to whole functions, the
655syntactic recognition can be wrong. @ccmode{} manages to figure it 660syntactic recognition can be wrong. @ccmode{} manages to figure it
656out correctly most of the time, though. 661out correctly most of the time, though.
657 662
663Some macros, when invoked, ''have their own semicolon''. To get the
664next line indented correctly, rather than as a continuation line,
665@xref{Macros with ;}.
666
658Reindenting large sections of code can take a long time. When 667Reindenting large sections of code can take a long time. When
659@ccmode{} reindents a region of code, it is essentially equivalent to 668@ccmode{} reindents a region of code, it is essentially equivalent to
660hitting @key{TAB} on every line of the region. 669hitting @key{TAB} on every line of the region.
@@ -882,6 +891,8 @@ lines.
882@itemx @kbd{C-M-e} (@code{c-end-of-defun}) 891@itemx @kbd{C-M-e} (@code{c-end-of-defun})
883@findex c-beginning-of-defun 892@findex c-beginning-of-defun
884@findex c-end-of-defun 893@findex c-end-of-defun
894@vindex c-defun-tactic
895@vindex defun-tactic (c-)
885 896
886Move to the beginning or end of the current or next function. Other 897Move to the beginning or end of the current or next function. Other
887constructs (such as a structs or classes) which have a brace block 898constructs (such as a structs or classes) which have a brace block
@@ -895,6 +906,15 @@ commands try to leave point at the beginning of a line near the actual
895start or end of the function. This occasionally causes point not to 906start or end of the function. This occasionally causes point not to
896move at all. 907move at all.
897 908
909By default, these commands will recognize functions contained within a
910@dfn{declaration scope} such as a C++ @code{class} or @code{namespace}
911construct, should the point start inside it. If @ccmode fails to find
912function beginnings or ends inside the current declaration scope, it
913will search the enclosing scopes. If you want @ccmode to recognize
914functions only at the top level@footnote{this was @ccmode{}'s
915behaviour prior to version 5.32.}, set @code{c-defun-tatic} to
916@code{t}.
917
898These functions are analogous to the Emacs built-in commands 918These functions are analogous to the Emacs built-in commands
899@code{beginning-of-defun} and @code{end-of-defun}, except they 919@code{beginning-of-defun} and @code{end-of-defun}, except they
900eliminate the constraint that the top-level opening brace of the defun 920eliminate the constraint that the top-level opening brace of the defun
@@ -6550,6 +6570,9 @@ custom line-up function associated with it.
6550@section Other Special Indentations 6570@section Other Special Indentations
6551@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 6571@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
6552 6572
6573To configure macros which you invoke without a terminating @samp{;},
6574see @xref{Macros with ;}.
6575
6553Here are the remaining odds and ends regarding indentation: 6576Here are the remaining odds and ends regarding indentation:
6554 6577
6555@defopt c-label-minimum-indentation 6578@defopt c-label-minimum-indentation
@@ -6601,6 +6624,13 @@ functions to this hook, not remove them. @xref{Style Variables}.
6601@cindex preprocessor directives 6624@cindex preprocessor directives
6602@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 6625@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
6603 6626
6627Preprocessor macros in C, C++, and Objective C (introduced by
6628@code{#define}) have a syntax different from the main language---for
6629example, a macro declaration is not terminated by a semicolon, and if
6630it is more than a line long, line breaks in it must be escaped with
6631backslashes. @ccmode{} has some commands to manipulate these, see
6632@ref{Macro Backslashes}.
6633
6604Normally, the lines in a multi-line macro are indented relative to 6634Normally, the lines in a multi-line macro are indented relative to
6605each other as though they were code. You can suppress this behavior 6635each other as though they were code. You can suppress this behavior
6606by setting the following user option: 6636by setting the following user option:
@@ -6612,6 +6642,28 @@ is @code{nil}, all lines inside macro definitions are analyzed as
6612@code{cpp-macro-cont}. 6642@code{cpp-macro-cont}.
6613@end defopt 6643@end defopt
6614 6644
6645Because a macro can expand into anything at all, near where one is
6646invoked @ccmode{} can only indent and fontify code heuristically.
6647Sometimes it gets it wrong. Usually you should try to design your
6648macros so that they ''look like ordinary code'' when you invoke them.
6649However, one situation is so common that @ccmode{} handles it
6650specially: that is when certain macros needn't (or mustn't) be
6651followed by a @samp{;}. You need to configure @ccmode{} to handle
6652these macros properly, see @ref{Macros with ;}.
6653
6654@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
6655@menu
6656* Macro Backslashes::
6657* Macros with ;::
6658@end menu
6659
6660@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
6661@node Macro Backslashes, Macros with ;, Custom Macros, Custom Macros
6662@comment node-name, next, previous, up
6663@section Customizing Macro Backslashes
6664@cindex #define
6665@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
6666
6615@ccmode{} provides some tools to help keep the line continuation 6667@ccmode{} provides some tools to help keep the line continuation
6616backslashes in macros neat and tidy. Their precise action is 6668backslashes in macros neat and tidy. Their precise action is
6617customized with these variables: 6669customized with these variables:
@@ -6654,6 +6706,62 @@ get aligned only when you explicitly invoke the command
6654@end defopt 6706@end defopt
6655 6707
6656@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 6708@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
6709@node Macros with ;, , Macro Backslashes, Custom Macros
6710@comment node-name, next, previous, up
6711@section Macros with semicolons
6712@cindex macros with semicolons
6713@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
6714Macros which needn't (or mustn't) be followed by a semicolon when you
6715invoke them, @dfn{macros with semicolons}, are very common. These can
6716cause @ccmode{} to parse the next line wrongly as a
6717@code{statement-cont} (@pxref{Function Symbols}) and thus mis-indent
6718it.
6719
6720You can prevent this by specifying which macros have semicolons. It
6721doesn't matter whether or not such a macro has a parameter list:
6722
6723@defopt c-macro-names-with-semicolon
6724@vindex macro-names-with-semicolon (c-)
6725This buffer-local variable specifies which macros have semicolons.
6726After setting its value, you need to call
6727@code{c-make-macro-with-semi-re} for it to take effect. It should be
6728set to one of these values:
6729
6730@table @asis
6731@item nil
6732There are no macros with semicolons.
6733@item a list of strings
6734Each string is the name of a macro with a semicolon. Only valid
6735@code{#define} names are allowed here. For example, to set the
6736default value, you could write the following into your @file{.emacs}:
6737
6738@example
6739(setq c-macro-names-with-semicolon
6740 '("Q_OBJECT" "Q_PROPERTY" "Q_DECLARE" "Q_ENUMS"))
6741@end example
6742
6743@item a regular expression
6744This matches each symbol which is a macro with a semicolon. It must
6745not match any string which isn't a valid @code{#define} name. For
6746example:
6747
6748@example
6749(setq c-macro-names-with-semicolon
6750 "\\<\\(CLEAN_UP_AND_RETURN\\|Q_[[:upper:]]+\\)\\>")
6751@end example
6752@end table
6753@end defopt
6754
6755@defun c-make-macro-with-semi-re
6756@findex make-macro-with-semi-re (c-)
6757Call this (non-interactive) function, which sets internal variables,
6758each time you change the value of
6759@code{c-macro-names-with-semicolon}. It takes no arguments, and its
6760return value has no meaning. This function is called by @ccmode{}'s
6761initialization code.
6762@end defun
6763
6764@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
6657@node Odds and Ends, Sample .emacs File, Custom Macros, Top 6765@node Odds and Ends, Sample .emacs File, Custom Macros, Top
6658@comment node-name, next, previous, up 6766@comment node-name, next, previous, up
6659@chapter Odds and Ends 6767@chapter Odds and Ends
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6aa1bddb9f3..44f39383139 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,84 @@
12011-10-28 Alan Mackenzie <acm@muc.de>
2
3 * progmodes/cc-defs.el (c-version). -> 5.32.2.
4
52011-10-28 Alan Mackenzie <acm@muc.de>
6
7 Amend the handling of c-beginning/end-of-defun in nested declaration
8 scopes.
9
10 * progmodes/cc-vars.el (c-defun-tactic): Move here from
11 cc-langs.el. Change it to a defcustom.
12
13 * progmodes/cc-langs.el (c-defun-tactic): Move this variable to
14 cc-vars.el.
15 (c-nonlabel-token-2-key): New variable for change in cc-engine.el.
16
17 * progmodes/cc-engine.el (c-beginning-of-statement-1): Prevent
18 "class foo : bar" being spuriously recognized as a label.
19
20 * progmodes/cc-cmds.el (c-narrow-to-most-enclosing-decl-block):
21 Add parameter `inclusive' (to include enclosing braces in the
22 region).
23 (c-widen-to-enclosing-decl-scope): New function.
24 (c-while-widening-to-decl-block): New macro.
25 (c-beginning-of-defun, c-end-of-defun): Change algorithm to keep going
26 outward for defun boundaries, and correspondingly change symbol
27 `respect-enclosure' to `go-outward'.
28 (c-declaration-limits): Change algorithm to report only the "innermost"
29 defun's boundaries.
30
312011-10-28 Deniz Dogan <deniz@dogan.se>
32
33 * net/rcirc.el (rcirc-mode): Use hard newlines.
34
352011-10-28 Alan Mackenzie <acm@muc.de>
36
37 Amend to indent and fontify macros "which include their own semicolon"
38 correctly, using the "virtual semicolon" mechanism.
39
40 * progmodes/cc-defs.el: Update "virtual semicolon" comments.
41
42 * progmodes/cc-engine.el (c-crosses-statement-barrier-p): Recoded
43 to scan one line at at time rather than having \n and \r
44 explicitly in c-stmt-delim-chars
45 (for some modes, e.g. AWK).
46 (c-forward-label): Amend for virtual semicolons.
47 (c-at-macro-vsemi-p, c-macro-vsemi-status-unknown-p): New functions
48
49 * progmodes/cc-fonts.el (c-font-lock-declarations): Take account
50 of the new C macros.
51
52 * progmodes/cc-langs.el (c-at-vsemi-p-fn):
53 (c-vsemi-status-unknown-p-fn): move to earlier in the file.
54 (c-opt-cpp-symbol, c-line-comment-start-regexp): New language variables.
55 (c-opt-cpp-macro-define): Make into a full language variable.
56 (c-stmt-delim-chars, c-stmt-delim-chars-with-comma): Special value for
57 AWK Mode (including \n, \r) removed, no longer needed.
58
59 * progmodes/cc-mode.el (c-mode, c++-mode, objc-mode): Invoke
60 c-make-macro-with-semi-re.
61
62 * progmodes/cc-vars.el (c-macro-with-semi-re):
63 (c-macro-names-with-semicolon): New variables.
64 (c-make-macro-with-semi-re): New function
65
662011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
67
68 * vc/log-edit.el: Fill empty field rather than adding new one.
69 (log-edit-add-field): New function.
70 (log-edit-insert-changelog): Use it.
71
722011-10-28 Mark Lillibridge <mark.lillibridge@hp.com> (tiny change)
73
74 * mail/rmail.el (rmail-mode-map): Add M-C-f as in rmailsum (bug#9802).
75
762011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
77
78 * progmodes/gdb-mi.el: Warn the user when -i=mi is missing.
79 (gdb--check-interpreter): New function.
80 (gdb): Use it.
81
12011-10-27 Glenn Morris <rgm@gnu.org> 822011-10-27 Glenn Morris <rgm@gnu.org>
2 83
3 * emacs-lisp/cl-extra.el (most-positive-float, most-negative-float) 84 * emacs-lisp/cl-extra.el (most-positive-float, most-negative-float)
@@ -21,8 +102,8 @@
21 * subr.el (change-major-mode-after-body-hook): New hook. 102 * subr.el (change-major-mode-after-body-hook): New hook.
22 (run-mode-hooks): Run it. 103 (run-mode-hooks): Run it.
23 104
24 * emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Use 105 * emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
25 change-major-mode-before-body-hook. 106 Use change-major-mode-before-body-hook.
26 107
27 * simple.el (fundamental-mode): 108 * simple.el (fundamental-mode):
28 * emacs-lisp/derived.el (define-derived-mode): Revert 2010-04-28 109 * emacs-lisp/derived.el (define-derived-mode): Revert 2010-04-28
diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el
index 0b34e9f27f7..16eb31c1209 100644
--- a/lisp/emacs-lisp/cl.el
+++ b/lisp/emacs-lisp/cl.el
@@ -341,7 +341,7 @@ Call `cl-float-limits' to set this.")
341 341
342(defconst most-negative-float nil 342(defconst most-negative-float nil
343 "The largest negative value that a Lisp float can hold. 343 "The largest negative value that a Lisp float can hold.
344This is simply -`most-negative-float'. 344This is simply -`most-positive-float'.
345Call `cl-float-limits' to set this.") 345Call `cl-float-limits' to set this.")
346 346
347(defconst least-positive-float nil 347(defconst least-positive-float nil
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 770050efb08..603a615192a 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -1008,6 +1008,7 @@ The buffer is expected to be narrowed to just the header of the message."
1008 (define-key map "\e\C-l" 'rmail-summary-by-labels) 1008 (define-key map "\e\C-l" 'rmail-summary-by-labels)
1009 (define-key map "\e\C-r" 'rmail-summary-by-recipients) 1009 (define-key map "\e\C-r" 'rmail-summary-by-recipients)
1010 (define-key map "\e\C-s" 'rmail-summary-by-regexp) 1010 (define-key map "\e\C-s" 'rmail-summary-by-regexp)
1011 (define-key map "\e\C-f" 'rmail-summary-by-senders)
1011 (define-key map "\e\C-t" 'rmail-summary-by-topic) 1012 (define-key map "\e\C-t" 'rmail-summary-by-topic)
1012 (define-key map "m" 'rmail-mail) 1013 (define-key map "m" 'rmail-mail)
1013 (define-key map "\em" 'rmail-retry-failure) 1014 (define-key map "\em" 'rmail-retry-failure)
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index 6a912cd6273..f6981aeabd9 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -979,6 +979,7 @@ This number is independent of the number of lines in the buffer.")
979 (set (make-local-variable 'rcirc-recent-quit-alist) nil) 979 (set (make-local-variable 'rcirc-recent-quit-alist) nil)
980 (set (make-local-variable 'rcirc-current-line) 0) 980 (set (make-local-variable 'rcirc-current-line) 0)
981 981
982 (use-hard-newlines t)
982 (set (make-local-variable 'rcirc-short-buffer-name) nil) 983 (set (make-local-variable 'rcirc-short-buffer-name) nil)
983 (set (make-local-variable 'rcirc-urls) nil) 984 (set (make-local-variable 'rcirc-urls) nil)
984 985
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index 0f873e678c3..e59fdc16af7 100644
--- a/lisp/progmodes/cc-cmds.el
+++ b/lisp/progmodes/cc-cmds.el
@@ -1485,6 +1485,78 @@ No indentation or other \"electric\" behavior is performed."
1485 (setq n (1- n)))) 1485 (setq n (1- n))))
1486 n) 1486 n)
1487 1487
1488(defun c-narrow-to-most-enclosing-decl-block (&optional inclusive)
1489 ;; If we are inside a decl-block (in the sense of c-looking-at-decl-block),
1490 ;; i.e. something like namespace{} or extern{}, narrow to the insides of
1491 ;; that block (NOT including the enclosing braces) if INCLUSIVE is nil,
1492 ;; otherwise include the braces. If the closing brace is missing,
1493 ;; (point-max) is used instead.
1494 (let ((paren-state (c-parse-state))
1495 encl-decl)
1496 (setq encl-decl (and paren-state (c-most-enclosing-decl-block paren-state)))
1497 (if encl-decl
1498 (save-excursion
1499 (narrow-to-region
1500 (if inclusive
1501 (progn (goto-char encl-decl)
1502 (c-beginning-of-decl-1)
1503 (point))
1504 (1+ encl-decl))
1505 (progn
1506 (goto-char encl-decl)
1507 (or (c-safe (forward-list)
1508 (if inclusive
1509 (point)
1510 (1- (point))))
1511 (point-max))))))))
1512
1513(defun c-widen-to-enclosing-decl-scope (paren-state orig-point-min orig-point-max)
1514 ;; Narrow the buffer to the innermost declaration scope (e.g. a class, a
1515 ;; namespace or the "whole buffer") recorded in PAREN-STATE, the bounding
1516 ;; braces NOT being included in the resulting region. On no account may the
1517 ;; final region exceed that bounded by ORIG-POINT-MIN, ORIG-POINT-MAX.
1518 ;; PAREN-STATE is a list of buffer positions in the style of
1519 ;; (c-parse-state), one of which will be that of the desired opening brace,
1520 ;; if there is one.
1521 ;;
1522 ;; Return the position of the enclosing opening brace, or nil
1523 (let (encl-decl) ; putative position of decl-scope's opening brace.
1524 (save-restriction
1525 (narrow-to-region orig-point-min orig-point-max)
1526 (setq encl-decl (and paren-state
1527 (c-most-enclosing-decl-block paren-state))))
1528 (if encl-decl
1529 (progn
1530 (widen)
1531 (narrow-to-region (1+ encl-decl)
1532 (save-excursion
1533 (goto-char encl-decl)
1534 (or (c-safe (forward-list)
1535 (1- (point)))
1536 orig-point-max)))
1537 encl-decl)
1538 (narrow-to-region orig-point-min orig-point-max)
1539 nil)))
1540
1541(eval-and-compile
1542 (defmacro c-while-widening-to-decl-block (condition)
1543 ;; Repeatedly evaluate CONDITION until it returns nil. After each
1544 ;; evaluation, if `c-defun-tactic' is set appropriately, widen to innards
1545 ;; of the next enclosing declaration block (e.g. namespace, class), or the
1546 ;; buffer's original restriction.
1547 ;;
1548 ;; This is a very special purpose macro, which assumes the existence of
1549 ;; several variables. It is for use only in c-beginning-of-defun and
1550 ;; c-end-of-defun.
1551 `(while
1552 (and ,condition
1553 (eq c-defun-tactic 'go-outward)
1554 lim)
1555 (setq paren-state (c-whack-state-after lim paren-state))
1556 (setq lim (c-widen-to-enclosing-decl-scope
1557 paren-state orig-point-min orig-point-max))
1558 (setq where 'in-block))))
1559
1488(defun c-beginning-of-defun (&optional arg) 1560(defun c-beginning-of-defun (&optional arg)
1489 "Move backward to the beginning of a defun. 1561 "Move backward to the beginning of a defun.
1490Every top level declaration that contains a brace paren block is 1562Every top level declaration that contains a brace paren block is
@@ -1509,50 +1581,66 @@ defun."
1509 (c-save-buffer-state 1581 (c-save-buffer-state
1510 (beginning-of-defun-function end-of-defun-function 1582 (beginning-of-defun-function end-of-defun-function
1511 (start (point)) 1583 (start (point))
1512 where paren-state pos) 1584 (paren-state (copy-tree (c-parse-state))) ; This must not share list
1585 ; structure with other users of c-state-cache.
1586 (orig-point-min (point-min)) (orig-point-max (point-max))
1587 lim ; Position of { which has been widened to.
1588 where pos)
1513 1589
1514 ;; Move back out of any macro/comment/string we happen to be in. 1590 (save-restriction
1515 (c-beginning-of-macro) 1591 (if (eq c-defun-tactic 'go-outward)
1516 (setq pos (c-literal-limits)) 1592 (setq lim (c-widen-to-enclosing-decl-scope ; e.g. class, namespace.
1517 (if pos (goto-char (car pos))) 1593 paren-state orig-point-min orig-point-max)))
1518
1519 (setq where (c-where-wrt-brace-construct))
1520
1521 (if (< arg 0)
1522 ;; Move forward to the closing brace of a function.
1523 (progn
1524 (if (memq where '(at-function-end outwith-function))
1525 (setq arg (1+ arg)))
1526 (if (< arg 0)
1527 (setq arg (c-forward-to-nth-EOF-} (- arg) where)))
1528 ;; Move forward to the next opening brace....
1529 (when (and (= arg 0)
1530 (c-syntactic-re-search-forward "{" nil 'eob))
1531 (backward-char)
1532 ;; ... and backward to the function header.
1533 (c-beginning-of-decl-1)
1534 t))
1535
1536 ;; Move backward to the opening brace of a function.
1537 (when (and (> arg 0)
1538 (eq (setq arg (c-backward-to-nth-BOF-{ arg where)) 0))
1539 1594
1540 ;; Go backward to this function's header. 1595 ;; Move back out of any macro/comment/string we happen to be in.
1541 (c-beginning-of-decl-1) 1596 (c-beginning-of-macro)
1597 (setq pos (c-literal-limits))
1598 (if pos (goto-char (car pos)))
1542 1599
1543 (setq pos (point)) 1600 (setq where (c-where-wrt-brace-construct))
1544 ;; We're now there, modulo comments and whitespace.
1545 ;; Try to be line oriented; position point at the closest
1546 ;; preceding boi that isn't inside a comment, but if we hit
1547 ;; the previous declaration then we use the current point
1548 ;; instead.
1549 (while (and (/= (point) (c-point 'boi))
1550 (c-backward-single-comment)))
1551 (if (/= (point) (c-point 'boi))
1552 (goto-char pos)))
1553 1601
1554 (c-keep-region-active) 1602 (if (< arg 0)
1555 (= arg 0)))) 1603 ;; Move forward to the closing brace of a function.
1604 (progn
1605 (if (memq where '(at-function-end outwith-function))
1606 (setq arg (1+ arg)))
1607 (if (< arg 0)
1608 (c-while-widening-to-decl-block
1609 (< (setq arg (- (c-forward-to-nth-EOF-} (- arg) where))) 0)))
1610 ;; Move forward to the next opening brace....
1611 (when (and (= arg 0)
1612 (progn
1613 (c-while-widening-to-decl-block
1614 (not (c-syntactic-re-search-forward "{" nil 'eob)))
1615 (eq (char-before) ?{)))
1616 (backward-char)
1617 ;; ... and backward to the function header.
1618 (c-beginning-of-decl-1)
1619 t))
1620
1621 ;; Move backward to the opening brace of a function, making successively
1622 ;; larger portions of the buffer visible as necessary.
1623 (when (> arg 0)
1624 (c-while-widening-to-decl-block
1625 (> (setq arg (c-backward-to-nth-BOF-{ arg where)) 0)))
1626
1627 (when (eq arg 0)
1628 ;; Go backward to this function's header.
1629 (c-beginning-of-decl-1)
1630
1631 (setq pos (point))
1632 ;; We're now there, modulo comments and whitespace.
1633 ;; Try to be line oriented; position point at the closest
1634 ;; preceding boi that isn't inside a comment, but if we hit
1635 ;; the previous declaration then we use the current point
1636 ;; instead.
1637 (while (and (/= (point) (c-point 'boi))
1638 (c-backward-single-comment)))
1639 (if (/= (point) (c-point 'boi))
1640 (goto-char pos)))
1641
1642 (c-keep-region-active)
1643 (= arg 0)))))
1556 1644
1557(defun c-forward-to-nth-EOF-} (n where) 1645(defun c-forward-to-nth-EOF-} (n where)
1558 ;; Skip to the closing brace of the Nth function after point. If 1646 ;; Skip to the closing brace of the Nth function after point. If
@@ -1617,50 +1705,62 @@ the open-parenthesis that starts a defun; see `beginning-of-defun'."
1617 (c-save-buffer-state 1705 (c-save-buffer-state
1618 (beginning-of-defun-function end-of-defun-function 1706 (beginning-of-defun-function end-of-defun-function
1619 (start (point)) 1707 (start (point))
1620 where paren-state pos) 1708 (paren-state (copy-tree (c-parse-state))) ; This must not share list
1709 ; structure with other users of c-state-cache.
1710 (orig-point-min (point-min)) (orig-point-max (point-max))
1711 lim
1712 where pos)
1713 (save-restriction
1714 (if (eq c-defun-tactic 'go-outward)
1715 (setq lim (c-widen-to-enclosing-decl-scope ; e.g. class, namespace
1716 paren-state orig-point-min orig-point-max)))
1621 1717
1622 ;; Move back out of any macro/comment/string we happen to be in. 1718 ;; Move back out of any macro/comment/string we happen to be in.
1623 (c-beginning-of-macro) 1719 (c-beginning-of-macro)
1624 (setq pos (c-literal-limits)) 1720 (setq pos (c-literal-limits))
1625 (if pos (goto-char (car pos))) 1721 (if pos (goto-char (car pos)))
1626 1722
1627 (setq where (c-where-wrt-brace-construct)) 1723 (setq where (c-where-wrt-brace-construct))
1628 1724
1629 (if (< arg 0) 1725 (if (< arg 0)
1630 ;; Move backwards to the } of a function 1726 ;; Move backwards to the } of a function
1631 (progn 1727 (progn
1632 (if (memq where '(at-header outwith-function)) 1728 (if (memq where '(at-header outwith-function))
1633 (setq arg (1+ arg))) 1729 (setq arg (1+ arg)))
1634 (if (< arg 0) 1730 (if (< arg 0)
1635 (setq arg (c-backward-to-nth-BOF-{ (- arg) where))) 1731 (c-while-widening-to-decl-block
1636 (if (= arg 0) 1732 (< (setq arg (- (c-backward-to-nth-BOF-{ (- arg) where))) 0)))
1637 (c-syntactic-skip-backward "^}"))) 1733 (if (= arg 0)
1638 1734 (c-while-widening-to-decl-block
1639 ;; Move forward to the } of a function 1735 (progn (c-syntactic-skip-backward "^}")
1640 (if (> arg 0) 1736 (not (eq (char-before) ?}))))))
1641 (setq arg (c-forward-to-nth-EOF-} arg where)))) 1737
1642 1738 ;; Move forward to the } of a function
1643 ;; Do we need to move forward from the brace to the semicolon? 1739 (if (> arg 0)
1644 (when (eq arg 0) 1740 (c-while-widening-to-decl-block
1645 (if (c-in-function-trailer-p) ; after "}" of struct/enum, etc. 1741 (> (setq arg (c-forward-to-nth-EOF-} arg where)) 0))))
1646 (c-syntactic-re-search-forward ";")) 1742
1647 1743 ;; Do we need to move forward from the brace to the semicolon?
1648 (setq pos (point)) 1744 (when (eq arg 0)
1649 ;; We're there now, modulo comments and whitespace. 1745 (if (c-in-function-trailer-p) ; after "}" of struct/enum, etc.
1650 ;; Try to be line oriented; position point after the next 1746 (c-syntactic-re-search-forward ";"))
1651 ;; newline that isn't inside a comment, but if we hit the
1652 ;; next declaration then we use the current point instead.
1653 (while (and (not (bolp))
1654 (not (looking-at "\\s *$"))
1655 (c-forward-single-comment)))
1656 (cond ((bolp))
1657 ((looking-at "\\s *$")
1658 (forward-line 1))
1659 (t
1660 (goto-char pos))))
1661 1747
1662 (c-keep-region-active) 1748 (setq pos (point))
1663 (= arg 0))) 1749 ;; We're there now, modulo comments and whitespace.
1750 ;; Try to be line oriented; position point after the next
1751 ;; newline that isn't inside a comment, but if we hit the
1752 ;; next declaration then we use the current point instead.
1753 (while (and (not (bolp))
1754 (not (looking-at "\\s *$"))
1755 (c-forward-single-comment)))
1756 (cond ((bolp))
1757 ((looking-at "\\s *$")
1758 (forward-line 1))
1759 (t
1760 (goto-char pos))))
1761
1762 (c-keep-region-active)
1763 (= arg 0))))
1664 1764
1665(defun c-defun-name () 1765(defun c-defun-name ()
1666 "Return the name of the current defun, or NIL if there isn't one. 1766 "Return the name of the current defun, or NIL if there isn't one.
@@ -1746,6 +1846,11 @@ with a brace block."
1746 ;; 1846 ;;
1747 ;; This function might do hidden buffer changes. 1847 ;; This function might do hidden buffer changes.
1748 (save-excursion 1848 (save-excursion
1849 (save-restriction
1850 (when (eq c-defun-tactic 'go-outward)
1851 (c-narrow-to-most-enclosing-decl-block t) ; e.g. class, namespace
1852 (or (save-restriction
1853 (c-narrow-to-most-enclosing-decl-block nil)
1749 1854
1750 ;; Note: Some code duplication in `c-beginning-of-defun' and 1855 ;; Note: Some code duplication in `c-beginning-of-defun' and
1751 ;; `c-end-of-defun'. 1856 ;; `c-end-of-defun'.
@@ -1755,11 +1860,12 @@ with a brace block."
1755 lim pos end-pos) 1860 lim pos end-pos)
1756 (unless (c-safe 1861 (unless (c-safe
1757 (goto-char (c-least-enclosing-brace paren-state)) 1862 (goto-char (c-least-enclosing-brace paren-state))
1758 ;; If we moved to the outermost enclosing paren then we 1863 ;; If we moved to the outermost enclosing paren
1759 ;; can use c-safe-position to set the limit. Can't do 1864 ;; then we can use c-safe-position to set the
1760 ;; that otherwise since the earlier paren pair on 1865 ;; limit. Can't do that otherwise since the
1761 ;; paren-state might very well be part of the 1866 ;; earlier paren pair on paren-state might very
1762 ;; declaration we should go to. 1867 ;; well be part of the declaration we should go
1868 ;; to.
1763 (setq lim (c-safe-position (point) paren-state)) 1869 (setq lim (c-safe-position (point) paren-state))
1764 t) 1870 t)
1765 ;; At top level. Make sure we aren't inside a literal. 1871 ;; At top level. Make sure we aren't inside a literal.
@@ -1843,8 +1949,12 @@ with a brace block."
1843 (forward-line 1) 1949 (forward-line 1)
1844 (point)) 1950 (point))
1845 (t 1951 (t
1846 pos))))) 1952 pos))))))))
1847 )))) 1953 (and (not near)
1954 (goto-char (point-min))
1955 (c-forward-decl-or-cast-1 -1 nil nil)
1956 (eq (char-after) ?\{)
1957 (cons (point-min) (point-max))))))))
1848 1958
1849(defun c-mark-function () 1959(defun c-mark-function ()
1850 "Put mark at end of the current top-level declaration or macro, point at beginning. 1960 "Put mark at end of the current top-level declaration or macro, point at beginning.
diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el
index e5b4d7e35a4..8632807f2b8 100644
--- a/lisp/progmodes/cc-defs.el
+++ b/lisp/progmodes/cc-defs.el
@@ -93,7 +93,7 @@
93 93
94;;; Variables also used at compile time. 94;;; Variables also used at compile time.
95 95
96(defconst c-version "5.31.9" 96(defconst c-version "5.32.2"
97 "CC Mode version number.") 97 "CC Mode version number.")
98 98
99(defconst c-version-sym (intern c-version)) 99(defconst c-version-sym (intern c-version))
@@ -744,19 +744,20 @@ be after it."
744;; V i r t u a l S e m i c o l o n s 744;; V i r t u a l S e m i c o l o n s
745;; 745;;
746;; In most CC Mode languages, statements are terminated explicitly by 746;; In most CC Mode languages, statements are terminated explicitly by
747;; semicolons or closing braces. In some of the CC modes (currently only AWK 747;; semicolons or closing braces. In some of the CC modes (currently AWK Mode
748;; Mode (April 2004)), statements are (or can be) terminated by EOLs. Such a 748;; and certain user-specified #define macros in C, C++, etc. (November 2008)),
749;; statement is said to be terminated by a "virtual semicolon" (VS). A 749;; statements are (or can be) terminated by EOLs. Such a statement is said to
750;; statement terminated by an actual semicolon or brace is never considered to 750;; be terminated by a "virtual semicolon" (VS). A statement terminated by an
751;; have a VS. 751;; actual semicolon or brace is never considered to have a VS.
752;; 752;;
753;; The indentation engine (or whatever) tests for a VS at a specific position 753;; The indentation engine (or whatever) tests for a VS at a specific position
754;; by invoking the macro `c-at-vsemi-p', which in its turn calls the mode 754;; by invoking the macro `c-at-vsemi-p', which in its turn calls the mode
755;; specific function (if any) which is the value of the language variable 755;; specific function (if any) which is the value of the language variable
756;; `c-at-vsemi-p-fn'. The actual details of what constitutes a VS in a 756;; `c-at-vsemi-p-fn'. This function should only use "low-level" features of
757;; language are thus encapsulated in code specific to that language 757;; CC Mode, i.e. features which won't trigger infinite recursion. ;-) The
758;; (e.g. cc-awk.el). `c-at-vsemi-p' returns non-nil if point (or the optional 758;; actual details of what constitutes a VS in a language are thus encapsulated
759;; parameter POS) is at a VS, nil otherwise. 759;; in code specific to that language (e.g. cc-awk.el). `c-at-vsemi-p' returns
760;; non-nil if point (or the optional parameter POS) is at a VS, nil otherwise.
760;; 761;;
761;; The language specific function might well do extensive analysis of the 762;; The language specific function might well do extensive analysis of the
762;; source text, and may use a cacheing scheme to speed up repeated calls. 763;; source text, and may use a cacheing scheme to speed up repeated calls.
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index b2c548847c3..ea0a8f2d3b3 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -705,7 +705,7 @@ comment at the start of cc-engine.el for more info."
705 ;; The last position where a label is possible provided the 705 ;; The last position where a label is possible provided the
706 ;; statement started there. It's nil as long as no invalid 706 ;; statement started there. It's nil as long as no invalid
707 ;; label content has been found (according to 707 ;; label content has been found (according to
708 ;; `c-nonlabel-token-key'. It's `start' if no valid label 708 ;; `c-nonlabel-token-key'). It's `start' if no valid label
709 ;; content was found in the label. Note that we might still 709 ;; content was found in the label. Note that we might still
710 ;; regard it a label if it starts with `c-label-kwds'. 710 ;; regard it a label if it starts with `c-label-kwds'.
711 label-good-pos 711 label-good-pos
@@ -1035,7 +1035,12 @@ comment at the start of cc-engine.el for more info."
1035 ;; (including a case label) or something like C++'s "public:"? 1035 ;; (including a case label) or something like C++'s "public:"?
1036 ;; A case label might use an expression rather than a token. 1036 ;; A case label might use an expression rather than a token.
1037 (setq after-case:-pos (or tok start)) 1037 (setq after-case:-pos (or tok start))
1038 (if (looking-at c-nonlabel-token-key) ; e.g. "while" or "'a'" 1038 (if (or (looking-at c-nonlabel-token-key) ; e.g. "while" or "'a'"
1039 ;; Catch C++'s inheritance construct "class foo : bar".
1040 (save-excursion
1041 (and
1042 (c-safe (c-backward-sexp) t)
1043 (looking-at c-nonlabel-token-2-key))))
1039 (setq c-maybe-labelp nil) 1044 (setq c-maybe-labelp nil)
1040 (if after-labels-pos ; Have we already encountered a label? 1045 (if after-labels-pos ; Have we already encountered a label?
1041 (if (not last-label-pos) 1046 (if (not last-label-pos)
@@ -1149,42 +1154,65 @@ the line. If this virtual semicolon is _at_ from, the function recognizes it.
1149 1154
1150Note that this function might do hidden buffer changes. See the 1155Note that this function might do hidden buffer changes. See the
1151comment at the start of cc-engine.el for more info." 1156comment at the start of cc-engine.el for more info."
1152 (let ((skip-chars c-stmt-delim-chars) 1157 (let* ((skip-chars
1153 lit-range) 1158 ;; If the current language has CPP macros, insert # into skip-chars.
1154 (save-excursion 1159 (if c-opt-cpp-symbol
1155 (catch 'done 1160 (concat (substring c-stmt-delim-chars 0 1) ; "^"
1156 (goto-char from) 1161 c-opt-cpp-symbol ; usually "#"
1157 (while (progn (skip-chars-forward skip-chars to) 1162 (substring c-stmt-delim-chars 1)) ; e.g. ";{}?:"
1158 (< (point) to)) 1163 c-stmt-delim-chars))
1159 (cond 1164 (non-skip-list
1160 ((setq lit-range (c-literal-limits from)) ; Have we landed in a string/comment? 1165 (append (substring skip-chars 1) nil)) ; e.g. (?# ?\; ?{ ?} ?? ?:)
1161 (goto-char (cdr lit-range))) 1166 lit-range vsemi-pos)
1162 ((eq (char-after) ?:) 1167 (save-restriction
1163 (forward-char) 1168 (widen)
1164 (if (and (eq (char-after) ?:) 1169 (save-excursion
1165 (< (point) to)) 1170 (catch 'done
1166 ;; Ignore scope operators. 1171 (goto-char from)
1167 (forward-char) 1172 (while (progn (skip-chars-forward
1168 (setq c-maybe-labelp (1- (point))))) 1173 skip-chars
1169 ((eq (char-after) ??) 1174 (min to (c-point 'bonl)))
1170 ;; A question mark. Can't be a label, so stop 1175 (< (point) to))
1171 ;; looking for more : and ?. 1176 (cond
1172 (setq c-maybe-labelp nil 1177 ;; Virtual semicolon?
1173 skip-chars (substring c-stmt-delim-chars 0 -2))) 1178 ((and (bolp)
1174 ((memq (char-after) '(?# ?\n ?\r)) ; A virtual semicolon? 1179 (save-excursion
1175 (if (and (eq (char-before) ?\\) (memq (char-after) '(?\n ?\r))) 1180 (progn
1176 (backward-char)) 1181 (if (setq lit-range (c-literal-limits from)) ; Have we landed in a string/comment?
1177 (skip-chars-backward " \t" from) 1182 (goto-char (car lit-range)))
1178 (if (c-at-vsemi-p) 1183 (c-backward-syntactic-ws) ; ? put a limit here, maybe?
1179 (throw 'done (point)) 1184 (setq vsemi-pos (point))
1180 (forward-line))) 1185 (c-at-vsemi-p))))
1181 (t (throw 'done (point))))) 1186 (throw 'done vsemi-pos))
1182 ;; In trailing space after an as yet undetected virtual semicolon? 1187 ;; In a string/comment?
1183 (c-backward-syntactic-ws from) 1188 ((setq lit-range (c-literal-limits))
1184 (if (and (< (point) to) 1189 (goto-char (cdr lit-range)))
1185 (c-at-vsemi-p)) 1190 ((eq (char-after) ?:)
1186 (point) 1191 (forward-char)
1187 nil))))) 1192 (if (and (eq (char-after) ?:)
1193 (< (point) to))
1194 ;; Ignore scope operators.
1195 (forward-char)
1196 (setq c-maybe-labelp (1- (point)))))
1197 ((eq (char-after) ??)
1198 ;; A question mark. Can't be a label, so stop
1199 ;; looking for more : and ?.
1200 (setq c-maybe-labelp nil
1201 skip-chars (substring c-stmt-delim-chars 0 -2)))
1202 ;; At a CPP construct?
1203 ((and c-opt-cpp-symbol (looking-at c-opt-cpp-symbol)
1204 (save-excursion
1205 (forward-line 0)
1206 (looking-at c-opt-cpp-prefix)))
1207 (c-end-of-macro))
1208 ((memq (char-after) non-skip-list)
1209 (throw 'done (point)))))
1210 ;; In trailing space after an as yet undetected virtual semicolon?
1211 (c-backward-syntactic-ws from)
1212 (if (and (< (point) to)
1213 (c-at-vsemi-p))
1214 (point)
1215 nil))))))
1188 1216
1189(defun c-at-statement-start-p () 1217(defun c-at-statement-start-p ()
1190 "Return non-nil if the point is at the first token in a statement 1218 "Return non-nil if the point is at the first token in a statement
@@ -7158,12 +7186,14 @@ comment at the start of cc-engine.el for more info."
7158 ;; Check that we're not after a token that can't precede a label. 7186 ;; Check that we're not after a token that can't precede a label.
7159 (or 7187 (or
7160 ;; Trivially succeeds when there's no preceding token. 7188 ;; Trivially succeeds when there's no preceding token.
7189 ;; Succeeds when we're at a virtual semicolon.
7161 (if preceding-token-end 7190 (if preceding-token-end
7162 (<= preceding-token-end (point-min)) 7191 (<= preceding-token-end (point-min))
7163 (save-excursion 7192 (save-excursion
7164 (c-backward-syntactic-ws) 7193 (c-backward-syntactic-ws)
7165 (setq preceding-token-end (point)) 7194 (setq preceding-token-end (point))
7166 (bobp))) 7195 (or (bobp)
7196 (c-at-vsemi-p))))
7167 7197
7168 ;; Check if we're after a label, if we're after a closing 7198 ;; Check if we're after a label, if we're after a closing
7169 ;; paren that belong to statement, and with 7199 ;; paren that belong to statement, and with
@@ -8037,6 +8067,29 @@ comment at the start of cc-engine.el for more info."
8037 (back-to-indentation) 8067 (back-to-indentation)
8038 (vector (point) open-paren-pos)))))) 8068 (vector (point) open-paren-pos))))))
8039 8069
8070(defmacro c-pull-open-brace (ps)
8071 ;; Pull the next open brace from PS (which has the form of paren-state),
8072 ;; skipping over any brace pairs. Returns NIL when PS is exhausted.
8073 `(progn
8074 (while (consp (car ,ps))
8075 (setq ,ps (cdr ,ps)))
8076 (prog1 (car ,ps)
8077 (setq ,ps (cdr ,ps)))))
8078
8079(defun c-most-enclosing-decl-block (paren-state)
8080 ;; Return the buffer position of the most enclosing decl-block brace (in the
8081 ;; sense of c-looking-at-decl-block) in the PAREN-STATE structure, or nil if
8082 ;; none was found.
8083 (let* ((open-brace (c-pull-open-brace paren-state))
8084 (next-open-brace (c-pull-open-brace paren-state)))
8085 (while (and open-brace
8086 (save-excursion
8087 (goto-char open-brace)
8088 (not (c-looking-at-decl-block next-open-brace nil))))
8089 (setq open-brace next-open-brace
8090 next-open-brace (c-pull-open-brace paren-state)))
8091 open-brace))
8092
8040(defun c-inside-bracelist-p (containing-sexp paren-state) 8093(defun c-inside-bracelist-p (containing-sexp paren-state)
8041 ;; return the buffer position of the beginning of the brace list 8094 ;; return the buffer position of the beginning of the brace list
8042 ;; statement if we're inside a brace list, otherwise return nil. 8095 ;; statement if we're inside a brace list, otherwise return nil.
@@ -8372,6 +8425,57 @@ comment at the start of cc-engine.el for more info."
8372 paren-state) 8425 paren-state)
8373 containing-sexp))))) 8426 containing-sexp)))))
8374 8427
8428(defun c-at-macro-vsemi-p (&optional pos)
8429 ;; Is there a "virtual semicolon" at POS or point?
8430 ;; (See cc-defs.el for full details of "virtual semicolons".)
8431 ;;
8432 ;; This is true when point is at the last non syntactic WS position on the
8433 ;; line, there is a macro call last on the line, and this particular macro's
8434 ;; name is defined by the regexp `c-vs-macro-regexp' as not needing a
8435 ;; semicolon.
8436 (save-excursion
8437 (save-restriction
8438 (widen)
8439 (if pos
8440 (goto-char pos)
8441 (setq pos (point)))
8442 (and
8443 c-macro-with-semi-re
8444 (not (c-in-literal))
8445 (eq (skip-chars-backward " \t") 0)
8446
8447 ;; Check we've got nothing after this except comments and empty lines
8448 ;; joined by escaped EOLs.
8449 (skip-chars-forward " \t") ; always returns non-nil.
8450 (progn
8451 (while ; go over 1 block comment per iteration.
8452 (and
8453 (looking-at "\\(\\\\[\n\r][ \t]*\\)*")
8454 (goto-char (match-end 0))
8455 (cond
8456 ((looking-at c-block-comment-start-regexp)
8457 (and (forward-comment 1)
8458 (skip-chars-forward " \t"))) ; always returns non-nil
8459 ((looking-at c-line-comment-start-regexp)
8460 (end-of-line)
8461 nil)
8462 (t nil))))
8463 (eolp))
8464
8465 (goto-char pos)
8466 (progn (c-backward-syntactic-ws)
8467 (eq (point) pos))
8468
8469 ;; Check for one of the listed macros being before point.
8470 (or (not (eq (char-before) ?\)))
8471 (when (c-go-list-backward)
8472 (c-backward-syntactic-ws)
8473 t))
8474 (c-simple-skip-symbol-backward)
8475 (looking-at c-macro-with-semi-re)))))
8476
8477(defun c-macro-vsemi-status-unknown-p () t) ; See cc-defs.el.
8478
8375 8479
8376;; `c-guess-basic-syntax' and the functions that precedes it below 8480;; `c-guess-basic-syntax' and the functions that precedes it below
8377;; implements the main decision tree for determining the syntactic 8481;; implements the main decision tree for determining the syntactic
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el
index fd817e3b4f4..9a83d5196db 100644
--- a/lisp/progmodes/cc-fonts.el
+++ b/lisp/progmodes/cc-fonts.el
@@ -1277,9 +1277,11 @@ casts and declarations are fontified. Used on level 2 and higher."
1277 (when 1277 (when
1278 ;; The result of the form below is true when we don't recognize a 1278 ;; The result of the form below is true when we don't recognize a
1279 ;; declaration or cast. 1279 ;; declaration or cast.
1280 (if (and (eq (get-text-property (point) 'face) 1280 (if (or (and (eq (get-text-property (point) 'face)
1281 'font-lock-keyword-face) 1281 'font-lock-keyword-face)
1282 (looking-at c-not-decl-init-keywords)) 1282 (looking-at c-not-decl-init-keywords))
1283 (and c-macro-with-semi-re
1284 (looking-at c-macro-with-semi-re))) ; 2008-11-04
1283 ;; Don't do anything more if we're looking at a keyword that 1285 ;; Don't do anything more if we're looking at a keyword that
1284 ;; can't start a declaration. 1286 ;; can't start a declaration.
1285 t 1287 t
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
index 279c5e46c46..09f8b318378 100644
--- a/lisp/progmodes/cc-langs.el
+++ b/lisp/progmodes/cc-langs.el
@@ -509,6 +509,31 @@ parameters \(point-min), \(point-max) and <buffer size>."
509 (c-lang-const c-before-font-lock-function)) 509 (c-lang-const c-before-font-lock-function))
510 510
511 511
512;;; Syntactic analysis ("virtual semicolons") for line-oriented languages (AWK).
513(c-lang-defconst c-at-vsemi-p-fn
514 "Contains a function \"Is there a virtual semicolon at POS or point?\".
515Such a function takes one optional parameter, a buffer position (defaults to
516point), and returns nil or t. This variable contains nil for languages which
517don't have EOL terminated statements. "
518 t nil
519 (c c++ objc) 'c-at-macro-vsemi-p
520 awk 'c-awk-at-vsemi-p)
521(c-lang-defvar c-at-vsemi-p-fn (c-lang-const c-at-vsemi-p-fn))
522
523(c-lang-defconst c-vsemi-status-unknown-p-fn
524 "Contains a function \"are we unsure whether there is a virtual semicolon on this line?\".
525The (admittedly kludgey) purpose of such a function is to prevent an infinite
526recursion in c-beginning-of-statement-1 when point starts at a `while' token.
527The function MUST NOT UNDER ANY CIRCUMSTANCES call c-beginning-of-statement-1,
528even indirectly. This variable contains nil for languages which don't have
529EOL terminated statements."
530 t nil
531 (c c++ objc) 'c-macro-vsemi-status-unknown-p
532 awk 'c-awk-vsemi-status-unknown-p)
533(c-lang-defvar c-vsemi-status-unknown-p-fn
534 (c-lang-const c-vsemi-status-unknown-p-fn))
535
536
512;;; Lexer-level syntax (identifiers, tokens etc). 537;;; Lexer-level syntax (identifiers, tokens etc).
513 538
514(c-lang-defconst c-has-bitfields 539(c-lang-defconst c-has-bitfields
@@ -737,6 +762,12 @@ literal are multiline."
737(c-lang-defvar c-multiline-string-start-char 762(c-lang-defvar c-multiline-string-start-char
738 (c-lang-const c-multiline-string-start-char)) 763 (c-lang-const c-multiline-string-start-char))
739 764
765(c-lang-defconst c-opt-cpp-symbol
766 "The symbol which starts preprocessor constructs when in the margin."
767 t "#"
768 (java awk) nil)
769(c-lang-defvar c-opt-cpp-symbol (c-lang-const c-opt-cpp-symbol))
770
740(c-lang-defconst c-opt-cpp-prefix 771(c-lang-defconst c-opt-cpp-prefix
741 "Regexp matching the prefix of a cpp directive in the languages that 772 "Regexp matching the prefix of a cpp directive in the languages that
742normally use that macro preprocessor. Tested at bol or at boi. 773normally use that macro preprocessor. Tested at bol or at boi.
@@ -785,6 +816,8 @@ file name in angle brackets or quotes."
785definition, or nil if the language doesn't have any." 816definition, or nil if the language doesn't have any."
786 t (if (c-lang-const c-opt-cpp-prefix) 817 t (if (c-lang-const c-opt-cpp-prefix)
787 "define")) 818 "define"))
819(c-lang-defvar c-opt-cpp-macro-define
820 (c-lang-const c-opt-cpp-macro-define))
788 821
789(c-lang-defconst c-opt-cpp-macro-define-start 822(c-lang-defconst c-opt-cpp-macro-define-start
790 ;; Regexp matching everything up to the macro body of a cpp define, or the 823 ;; Regexp matching everything up to the macro body of a cpp define, or the
@@ -1171,14 +1204,12 @@ operators."
1171 ;; optimize `c-crosses-statement-barrier-p' somewhat, it's assumed to 1204 ;; optimize `c-crosses-statement-barrier-p' somewhat, it's assumed to
1172 ;; begin with "^" to negate the set. If ? : operators should be 1205 ;; begin with "^" to negate the set. If ? : operators should be
1173 ;; detected then the string must end with "?:". 1206 ;; detected then the string must end with "?:".
1174 t "^;{}?:" 1207 t "^;{}?:")
1175 awk "^;{}#\n\r?:") ; The newline chars gets special treatment.
1176(c-lang-defvar c-stmt-delim-chars (c-lang-const c-stmt-delim-chars)) 1208(c-lang-defvar c-stmt-delim-chars (c-lang-const c-stmt-delim-chars))
1177 1209
1178(c-lang-defconst c-stmt-delim-chars-with-comma 1210(c-lang-defconst c-stmt-delim-chars-with-comma
1179 ;; Variant of `c-stmt-delim-chars' that additionally contains ','. 1211 ;; Variant of `c-stmt-delim-chars' that additionally contains ','.
1180 t "^;,{}?:" 1212 t "^;,{}?:")
1181 awk "^;,{}\n\r?:") ; The newline chars gets special treatment.
1182(c-lang-defvar c-stmt-delim-chars-with-comma 1213(c-lang-defvar c-stmt-delim-chars-with-comma
1183 (c-lang-const c-stmt-delim-chars-with-comma)) 1214 (c-lang-const c-stmt-delim-chars-with-comma))
1184 1215
@@ -1238,7 +1269,6 @@ properly."
1238 re))) 1269 re)))
1239(c-lang-defvar c-comment-start-regexp (c-lang-const c-comment-start-regexp)) 1270(c-lang-defvar c-comment-start-regexp (c-lang-const c-comment-start-regexp))
1240 1271
1241;;;; Added by ACM, 2003/9/18.
1242(c-lang-defconst c-block-comment-start-regexp 1272(c-lang-defconst c-block-comment-start-regexp
1243 ;; Regexp which matches the start of a block comment (if such exists in the 1273 ;; Regexp which matches the start of a block comment (if such exists in the
1244 ;; language) 1274 ;; language)
@@ -1248,6 +1278,15 @@ properly."
1248(c-lang-defvar c-block-comment-start-regexp 1278(c-lang-defvar c-block-comment-start-regexp
1249 (c-lang-const c-block-comment-start-regexp)) 1279 (c-lang-const c-block-comment-start-regexp))
1250 1280
1281(c-lang-defconst c-line-comment-start-regexp
1282 ;; Regexp which matches the start of a line comment (if such exists in the
1283 ;; language; it does in all 7 CC Mode languages).
1284 t (if (c-lang-const c-line-comment-starter)
1285 (regexp-quote (c-lang-const c-line-comment-starter))
1286 "\\<\\>"))
1287(c-lang-defvar c-line-comment-start-regexp
1288 (c-lang-const c-line-comment-start-regexp))
1289
1251(c-lang-defconst c-literal-start-regexp 1290(c-lang-defconst c-literal-start-regexp
1252 ;; Regexp to match the start of comments and string literals. 1291 ;; Regexp to match the start of comments and string literals.
1253 t (concat (c-lang-const c-comment-start-regexp) 1292 t (concat (c-lang-const c-comment-start-regexp)
@@ -1475,29 +1514,6 @@ properly."
1475(c-lang-defvar c-syntactic-eol (c-lang-const c-syntactic-eol)) 1514(c-lang-defvar c-syntactic-eol (c-lang-const c-syntactic-eol))
1476 1515
1477 1516
1478;;; Syntactic analysis ("virtual semicolons") for line-oriented languages (AWK).
1479(c-lang-defconst c-at-vsemi-p-fn
1480 "Contains a function \"Is there a virtual semicolon at POS or point?\".
1481Such a function takes one optional parameter, a buffer position (defaults to
1482point), and returns nil or t. This variable contains nil for languages which
1483don't have EOL terminated statements. "
1484 t nil
1485 awk 'c-awk-at-vsemi-p)
1486(c-lang-defvar c-at-vsemi-p-fn (c-lang-const c-at-vsemi-p-fn))
1487
1488(c-lang-defconst c-vsemi-status-unknown-p-fn
1489 "Contains a function \"are we unsure whether there is a virtual semicolon on this line?\".
1490The (admittedly kludgey) purpose of such a function is to prevent an infinite
1491recursion in c-beginning-of-statement-1 when point starts at a `while' token.
1492The function MUST NOT UNDER ANY CIRCUMSTANCES call c-beginning-of-statement-1,
1493even indirectly. This variable contains nil for languages which don't have
1494EOL terminated statements."
1495 t nil
1496 awk 'c-awk-vsemi-status-unknown-p)
1497(c-lang-defvar c-vsemi-status-unknown-p-fn
1498 (c-lang-const c-vsemi-status-unknown-p-fn))
1499
1500
1501;;; Defun functions 1517;;; Defun functions
1502 1518
1503;; The Emacs variables beginning-of-defun-function and 1519;; The Emacs variables beginning-of-defun-function and
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index eec63b4fa3b..a6bf241f0db 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -1187,6 +1187,7 @@ Key bindings:
1187 abbrev-mode t) 1187 abbrev-mode t)
1188 (use-local-map c-mode-map) 1188 (use-local-map c-mode-map)
1189 (c-init-language-vars-for 'c-mode) 1189 (c-init-language-vars-for 'c-mode)
1190 (c-make-macro-with-semi-re) ; matches macro names whose expansion ends with ;
1190 (c-common-init 'c-mode) 1191 (c-common-init 'c-mode)
1191 (easy-menu-add c-c-menu) 1192 (easy-menu-add c-c-menu)
1192 (cc-imenu-init cc-imenu-c-generic-expression) 1193 (cc-imenu-init cc-imenu-c-generic-expression)
@@ -1246,6 +1247,7 @@ Key bindings:
1246 abbrev-mode t) 1247 abbrev-mode t)
1247 (use-local-map c++-mode-map) 1248 (use-local-map c++-mode-map)
1248 (c-init-language-vars-for 'c++-mode) 1249 (c-init-language-vars-for 'c++-mode)
1250 (c-make-macro-with-semi-re) ; matches macro names whose expansion ends with ;
1249 (c-common-init 'c++-mode) 1251 (c-common-init 'c++-mode)
1250 (easy-menu-add c-c++-menu) 1252 (easy-menu-add c-c++-menu)
1251 (cc-imenu-init cc-imenu-c++-generic-expression) 1253 (cc-imenu-init cc-imenu-c++-generic-expression)
@@ -1303,6 +1305,7 @@ Key bindings:
1303 abbrev-mode t) 1305 abbrev-mode t)
1304 (use-local-map objc-mode-map) 1306 (use-local-map objc-mode-map)
1305 (c-init-language-vars-for 'objc-mode) 1307 (c-init-language-vars-for 'objc-mode)
1308 (c-make-macro-with-semi-re) ; matches macro names whose expansion ends with ;
1306 (c-common-init 'objc-mode) 1309 (c-common-init 'objc-mode)
1307 (easy-menu-add c-objc-menu) 1310 (easy-menu-add c-objc-menu)
1308 (cc-imenu-init nil 'cc-imenu-objc-function) 1311 (cc-imenu-init nil 'cc-imenu-objc-function)
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el
index 58dc1737c5a..24361e3667a 100644
--- a/lisp/progmodes/cc-vars.el
+++ b/lisp/progmodes/cc-vars.el
@@ -340,6 +340,20 @@ better with the \"do { ... } while \(0)\" trick)."
340 :group 'c) 340 :group 'c)
341(put 'c-syntactic-indentation-in-macros 'safe-local-variable 'booleanp) 341(put 'c-syntactic-indentation-in-macros 'safe-local-variable 'booleanp)
342 342
343(defcustom c-defun-tactic 'go-outward
344 "*Whether functions are recognized inside, e.g., a class.
345This is used by `c-beginning-of-defun' and like functions.
346
347Its value is one of:
348 t -- Functions are recognized only at the top level.
349 go-outward -- Nested functions are also recognized. Should a function
350 command hit the beginning/end of a nested scope, it will
351 carry on at the less nested level."
352 :type '(radio
353 (const :tag "Functions are at the top-level" t)
354 (const :tag "Functions are also recognized inside declaration scopes" go-outward))
355 :group 'c)
356
343(defcustom-c-stylevar c-comment-only-line-offset 0 357(defcustom-c-stylevar c-comment-only-line-offset 0
344 "*Extra offset for line which contains only the start of a comment. 358 "*Extra offset for line which contains only the start of a comment.
345Can contain an integer or a cons cell of the form: 359Can contain an integer or a cons cell of the form:
@@ -1608,6 +1622,54 @@ names)."))
1608 1622
1609 1623
1610;; Non-customizable variables, still part of the interface to CC Mode 1624;; Non-customizable variables, still part of the interface to CC Mode
1625(defvar c-macro-with-semi-re nil
1626 ;; Regular expression which matches a (#define'd) symbol whose expansion
1627 ;; ends with a semicolon.
1628 ;;
1629 ;; This variable should be set by `c-make-macros-with-semi-re' rather than
1630 ;; directly.
1631)
1632(make-variable-buffer-local 'c-macro-with-semi-re)
1633
1634(defun c-make-macro-with-semi-re ()
1635 ;; Convert `c-macro-names-with-semicolon' into the regexp
1636 ;; `c-macro-with-semi-re' (or just copy it if it's already a re).
1637 (setq c-macro-with-semi-re
1638 (and
1639 c-opt-cpp-macro-define
1640 (cond
1641 ((stringp c-macro-names-with-semicolon)
1642 (copy-sequence c-macro-names-with-semicolon))
1643 ((consp c-macro-names-with-semicolon)
1644 (concat
1645 "\\<"
1646 (regexp-opt c-macro-names-with-semicolon)
1647 "\\>")) ; N.B. the PAREN param of regexp-opt isn't supported by
1648 ; all XEmacsen.
1649 ((null c-macro-names-with-semicolon)
1650 nil)
1651 (t (error "c-make-macro-with-semi-re: invalid \
1652c-macro-names-with-semicolon: %s"
1653 c-macro-names-with-semicolon))))))
1654
1655(defvar c-macro-names-with-semicolon
1656 '("Q_OBJECT" "Q_PROPERTY" "Q_DECLARE" "Q_ENUMS")
1657 "List of #defined symbols whose expansion ends with a semicolon.
1658Alternatively it can be a string, a regular expression which
1659matches all such symbols.
1660
1661The \"symbols\" must be syntactically valid identifiers in the
1662target language \(C, C++, Objective C), or \(as the case may be)
1663the regular expression must match only valid identifiers.
1664
1665If you change this variable's value, call the function
1666`c-make-macros-with-semi-re' to set the necessary internal
1667variables.
1668
1669Note that currently \(2008-11-04) this variable is a prototype,
1670and is likely to disappear or change its form soon.")
1671(make-variable-buffer-local 'c-macro-names-with-semicolon)
1672
1611(defvar c-file-style nil 1673(defvar c-file-style nil
1612 "Variable interface for setting style via File Local Variables. 1674 "Variable interface for setting style via File Local Variables.
1613In a file's Local Variable section, you can set this variable to a 1675In a file's Local Variable section, you can set this variable to a
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index 22db7b2e5f4..dde00d753ac 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -43,21 +43,10 @@
43 43
44;; M-x gdb will start the debugger. 44;; M-x gdb will start the debugger.
45 45
46;; This file uses GDB/MI as the primary interface to GDB. It is still under 46;; This file uses GDB/MI as the primary interface to GDB. It runs gdb with
47;; development and is part of a process to migrate Emacs from annotations (as 47;; GDB/MI (-interp=mi) and access CLI using "-interpreter-exec console
48;; used in gdb-ui.el) to GDB/MI. It runs gdb with GDB/MI (-interp=mi) and 48;; cli-command". This code works without gdb-ui.el and uses MI tokens instead
49;; access CLI using "-interpreter-exec console cli-command". This code works 49;; of queues. Eventually MI should be asynchronous.
50;; without gdb-ui.el and uses MI tokens instead of queues. Eventually MI
51;; should be asynchronous.
52
53;; This mode will PARTLY WORK WITH RECENT GDB RELEASES (status in modeline
54;; doesn't update properly when execution commands are issued from GUD buffer)
55;; and WORKS BEST when GDB runs asynchronously: maint set linux-async on.
56;;
57;; You need development version of GDB 7.0 for the thread buffer to work.
58
59;; This file replaces gdb-ui.el and is for development with GDB. Use the
60;; release branch of Emacs 22 for the latest version of gdb-ui.el.
61 50
62;; Windows Platforms: 51;; Windows Platforms:
63 52
@@ -599,6 +588,22 @@ NOARG must be t when this macro is used outside `gud-def'"
599 (concat (gdb-gud-context-command ,cmd1 ,noall) " " ,cmd2) 588 (concat (gdb-gud-context-command ,cmd1 ,noall) " " ,cmd2)
600 ,(when (not noarg) 'arg))) 589 ,(when (not noarg) 'arg)))
601 590
591(defun gdb--check-interpreter (proc string)
592 (unless (zerop (length string))
593 (let ((filter (process-get proc 'gud-normal-filter)))
594 (set-process-filter proc filter)
595 (unless (memq (aref string 0) '(?^ ?~ ?@ ?& ?* ?=))
596 ;; Apparently we're not running with -i=mi.
597 (let ((msg "Error: you did not specify -i=mi on GDB's command line!"))
598 (message msg)
599 (setq string (concat (propertize msg 'font-lock-face 'error)
600 "\n" string)))
601 ;; Use the old gud-gbd filter, not because it works, but because it
602 ;; will properly display GDB's answers rather than hanging waiting for
603 ;; answers that aren't coming.
604 (set (make-local-variable 'gud-marker-filter) #'gud-gdb-marker-filter))
605 (funcall filter proc string))))
606
602;;;###autoload 607;;;###autoload
603(defun gdb (command-line) 608(defun gdb (command-line)
604 "Run gdb on program FILE in buffer *gud-FILE*. 609 "Run gdb on program FILE in buffer *gud-FILE*.
@@ -665,6 +670,13 @@ detailed description of this mode.
665 "Multiple debugging requires restarting in text command mode")) 670 "Multiple debugging requires restarting in text command mode"))
666 ;; 671 ;;
667 (gud-common-init command-line nil 'gud-gdbmi-marker-filter) 672 (gud-common-init command-line nil 'gud-gdbmi-marker-filter)
673
674 ;; Setup a temporary process filter to warn when GDB was not started
675 ;; with -i=mi.
676 (let ((proc (get-buffer-process gud-comint-buffer)))
677 (process-put proc 'gud-normal-filter (process-filter proc))
678 (set-process-filter proc #'gdb--check-interpreter))
679
668 (set (make-local-variable 'gud-minor-mode) 'gdbmi) 680 (set (make-local-variable 'gud-minor-mode) 'gdbmi)
669 (setq comint-input-sender 'gdb-send) 681 (setq comint-input-sender 'gdb-send)
670 (when (ring-empty-p comint-input-ring) ; cf shell-mode 682 (when (ring-empty-p comint-input-ring) ; cf shell-mode
diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el
index c421304442f..f57429c76c7 100644
--- a/lisp/vc/log-edit.el
+++ b/lisp/vc/log-edit.el
@@ -593,6 +593,13 @@ to build the Fixes: header.")
593(put 'log-edit-rewrite-fixes 'safe-local-variable 593(put 'log-edit-rewrite-fixes 'safe-local-variable
594 (lambda (v) (and (stringp (car-safe v)) (stringp (cdr v))))) 594 (lambda (v) (and (stringp (car-safe v)) (stringp (cdr v)))))
595 595
596(defun log-edit-add-field (field value)
597 (rfc822-goto-eoh)
598 (if (save-excursion (re-search-backward (concat "^" field ":\\([ \t]*\\)$")
599 nil t))
600 (replace-match (concat " " value) t t nil 1)
601 (insert field ": " value "\n" (if (looking-at "\n") "" "\n"))))
602
596(defun log-edit-insert-changelog (&optional use-first) 603(defun log-edit-insert-changelog (&optional use-first)
597 "Insert a log message by looking at the ChangeLog. 604 "Insert a log message by looking at the ChangeLog.
598The idea is to write your ChangeLog entries first, and then use this 605The idea is to write your ChangeLog entries first, and then use this
@@ -620,9 +627,7 @@ regardless of user name or time."
620 (log-edit-insert-changelog-entries (log-edit-files))))) 627 (log-edit-insert-changelog-entries (log-edit-files)))))
621 (log-edit-set-common-indentation) 628 (log-edit-set-common-indentation)
622 ;; Add an Author: field if appropriate. 629 ;; Add an Author: field if appropriate.
623 (when author 630 (when author (log-edit-add-field "Author" author))
624 (rfc822-goto-eoh)
625 (insert "Author: " author "\n" (if (looking-at "\n") "" "\n")))
626 ;; Add a Fixes: field if applicable. 631 ;; Add a Fixes: field if applicable.
627 (when (consp log-edit-rewrite-fixes) 632 (when (consp log-edit-rewrite-fixes)
628 (rfc822-goto-eoh) 633 (rfc822-goto-eoh)
@@ -632,8 +637,7 @@ regardless of user name or time."
632 (fixes (match-substitute-replacement 637 (fixes (match-substitute-replacement
633 (cdr log-edit-rewrite-fixes)))) 638 (cdr log-edit-rewrite-fixes))))
634 (delete-region start end) 639 (delete-region start end)
635 (rfc822-goto-eoh) 640 (log-edit-add-field "Fixes" fixes))))
636 (insert "Fixes: " fixes "\n" (if (looking-at "\n") "" "\n")))))
637 (and log-edit-strip-single-file-name 641 (and log-edit-strip-single-file-name
638 (progn (rfc822-goto-eoh) 642 (progn (rfc822-goto-eoh)
639 (if (looking-at "\n") (forward-char 1)) 643 (if (looking-at "\n") (forward-char 1))
diff --git a/nt/ChangeLog b/nt/ChangeLog
index 08fd7677077..64b9577e362 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,8 @@
12011-10-28 Eli Zaretskii <eliz@gnu.org>
2
3 * README.W32: Mention UNICOWS.DLL as prerequisite for running
4 Emacs on Windows 9X.
5
12011-10-25 Eli Zaretskii <eliz@gnu.org> 62011-10-25 Eli Zaretskii <eliz@gnu.org>
2 7
3 * makefile.w32-in (dist): Don't put the top-level INSTALL into the 8 * makefile.w32-in (dist): Don't put the top-level INSTALL into the
diff --git a/nt/README.W32 b/nt/README.W32
index 4a3f7c41e9e..e4044e409d4 100644
--- a/nt/README.W32
+++ b/nt/README.W32
@@ -50,6 +50,17 @@ See the end of the file for license conditions.
50 directly from a CD or USB flash drive without copying or installing 50 directly from a CD or USB flash drive without copying or installing
51 anything on the machine itself. 51 anything on the machine itself.
52 52
53* Prerequisites for Windows 9X
54
55 To run Emacs on Windows 9X (Windows 95/98/Me), you will need to have
56 the Microsoft Layer for Unicode (MSLU) installed. It can be
57 downloaded from the Microsoft site, and comes in a form of a single
58 dynamic library called UNICOWS.DLL. If this library is not
59 accessible to Emacs, it will pop up a dialog saying that it cannot
60 find the library, and will refuse to start up a GUI session.
61 (However, it is still possible to use Emacs in text mode, even
62 without UNICOWS.DLL, by invoking it as "emacs -nw", see below.)
63
53* Starting Emacs 64* Starting Emacs
54 65
55 To run Emacs, simply select Emacs from the Start Menu, or invoke 66 To run Emacs, simply select Emacs from the Start Menu, or invoke
@@ -75,7 +86,9 @@ See the end of the file for license conditions.
75 it will pop up a command prompt window if run directly from Explorer. 86 it will pop up a command prompt window if run directly from Explorer.
76 87
77 + runemacs.exe - A wrapper for running Emacs as a GUI application 88 + runemacs.exe - A wrapper for running Emacs as a GUI application
78 without popping up a command prompt window. 89 without popping up a command prompt window. If you create a
90 desktop shortcut for invoking Emacs, make it point to this
91 executable, not to emacs.exe.
79 92
80 + emacsclient.exe - A command-line client program that can 93 + emacsclient.exe - A command-line client program that can
81 communicate with a running Emacs process. See the `Emacs Server' 94 communicate with a running Emacs process. See the `Emacs Server'
@@ -98,7 +111,7 @@ See the end of the file for license conditions.
98 111
99 + ddeclient.exe - A tool for interacting with DDE servers. 112 + ddeclient.exe - A tool for interacting with DDE servers.
100 113
101 + hexl.exe - A tool for converting files to hex dumps. See the 114 + hexl.exe - A tool for producing hex dumps of binary files. See the
102 `Editing Binary Files' node of the Emacs manual. 115 `Editing Binary Files' node of the Emacs manual.
103 116
104 + movemail.exe - A helper application for safely moving mail from 117 + movemail.exe - A helper application for safely moving mail from
@@ -194,6 +207,10 @@ See the end of the file for license conditions.
194 truncated to abbrevli.elc, your distribution has been corrupted 207 truncated to abbrevli.elc, your distribution has been corrupted
195 while unpacking and Emacs will not start. 208 while unpacking and Emacs will not start.
196 209
210 * On Windows 9X, make sure you have the UNICOWS.DLL library either
211 in the same directory where you have emacs.exe or in the
212 directory where system-wide DLLs are kept.
213
197 If you believe you have unpacked the distributions correctly and are 214 If you believe you have unpacked the distributions correctly and are
198 still encountering problems, see the section on Further Information 215 still encountering problems, see the section on Further Information
199 below. 216 below.
diff --git a/src/ChangeLog b/src/ChangeLog
index c3926f6024b..fad9b4f9e46 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,53 @@
12011-10-28 Eli Zaretskii <eliz@gnu.org>
2
3 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
4 possible random value that matches one of those tested as
5 condition to clear the mouse face.
6
72011-10-28 Chong Yidong <cyd@gnu.org>
8
9 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
10
112011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
12
13 * window.c (make_window): Initialize phys_cursor_on_p.
14
152011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
16
17 * lisp.h (struct Lisp_Symbol): Update comments.
18
192011-10-28 Juanma Barranquero <lekktu@gmail.com>
20
21 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
22
232011-10-28 Eli Zaretskii <eliz@gnu.org>
24
25 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
26 <oslsachem@gmail.com> for helping to debug this.
27
28 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
29 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
30 (g_b_init_get_glyph_outline_w): New static variables.
31 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
32 (GetGlyphOutlineW_Proc): New typedefs.
33 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
34 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
35 New functions.
36 (w32font_open_internal, compute_metrics):
37 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
38 instead of calling the "wide" APIs directly.
39
40 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
41
42 * w32.h (syms_of_w32font): Add prototype.
43
442011-10-27 Juanma Barranquero <lekktu@gmail.com>
45
46 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
47 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
48 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
49 (Fmove_to_window_line): Doc fix.
50
12011-10-27 Chong Yidong <cyd@gnu.org> 512011-10-27 Chong Yidong <cyd@gnu.org>
2 52
3 * process.c (make_process): Set gnutls_state to NULL. 53 * process.c (make_process): Set gnutls_state to NULL.
@@ -11,8 +61,8 @@
11 61
122011-10-27 Chong Yidong <cyd@gnu.org> 622011-10-27 Chong Yidong <cyd@gnu.org>
13 63
14 * gnutls.c (emacs_gnutls_deinit): New function. Deallocate 64 * gnutls.c (emacs_gnutls_deinit): New function.
15 credentials structures as well as calling gnutls_deinit. 65 Deallocate credentials structures as well as calling gnutls_deinit.
16 (Fgnutls_deinit, Fgnutls_boot): Use it. 66 (Fgnutls_deinit, Fgnutls_boot): Use it.
17 67
18 * process.c (make_process): Initialize GnuTLS credentials to NULL. 68 * process.c (make_process): Initialize GnuTLS credentials to NULL.
diff --git a/src/emacs.c b/src/emacs.c
index a96ad1ae1cb..197158e18e4 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -1597,6 +1597,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
1597 /* Initialization that must be done even if the global variable 1597 /* Initialization that must be done even if the global variable
1598 initialized is non zero. */ 1598 initialized is non zero. */
1599#ifdef HAVE_NTGUI 1599#ifdef HAVE_NTGUI
1600 globals_of_w32font ();
1600 globals_of_w32fns (); 1601 globals_of_w32fns ();
1601 globals_of_w32menu (); 1602 globals_of_w32menu ();
1602 globals_of_w32select (); 1603 globals_of_w32select ();
diff --git a/src/keyboard.c b/src/keyboard.c
index f06c8794a54..bda8a1d82f3 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -73,7 +73,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
73#include "nsterm.h" 73#include "nsterm.h"
74#endif 74#endif
75 75
76/* Variables for blockinput.h: */ 76/* Variables for blockinput.h: */
77 77
78/* Non-zero if interrupt input is blocked right now. */ 78/* Non-zero if interrupt input is blocked right now. */
79volatile int interrupt_input_blocked; 79volatile int interrupt_input_blocked;
@@ -341,7 +341,7 @@ static Lisp_Object Qconfig_changed_event;
341Lisp_Object Qevent_kind; 341Lisp_Object Qevent_kind;
342static Lisp_Object Qevent_symbol_elements; 342static Lisp_Object Qevent_symbol_elements;
343 343
344/* menu and tool bar item parts */ 344/* Menu and tool bar item parts. */
345static Lisp_Object Qmenu_enable; 345static Lisp_Object Qmenu_enable;
346static Lisp_Object QCenable, QCvisible, QChelp, QCkeys, QCkey_sequence; 346static Lisp_Object QCenable, QCvisible, QChelp, QCkeys, QCkey_sequence;
347Lisp_Object QCfilter; 347Lisp_Object QCfilter;
@@ -838,7 +838,7 @@ recursive_edit_unwind (Lisp_Object buffer)
838 838
839 839
840#if 0 /* These two functions are now replaced with 840#if 0 /* These two functions are now replaced with
841 temporarily_switch_to_single_kboard. */ 841 temporarily_switch_to_single_kboard. */
842static void 842static void
843any_kboard_state () 843any_kboard_state ()
844{ 844{
@@ -1041,7 +1041,7 @@ cmd_error (Lisp_Object data)
1041 Vquit_flag = Qnil; 1041 Vquit_flag = Qnil;
1042 1042
1043 Vinhibit_quit = Qnil; 1043 Vinhibit_quit = Qnil;
1044#if 0 /* This shouldn't be necessary anymore. --lorentey */ 1044#if 0 /* This shouldn't be necessary anymore. --lorentey */
1045 if (command_loop_level == 0 && minibuf_level == 0) 1045 if (command_loop_level == 0 && minibuf_level == 0)
1046 any_kboard_state (); 1046 any_kboard_state ();
1047#endif 1047#endif
@@ -1134,7 +1134,7 @@ command_loop (void)
1134#if 0 /* This shouldn't be necessary anymore. --lorentey */ 1134#if 0 /* This shouldn't be necessary anymore. --lorentey */
1135 /* Reset single_kboard in case top-level set it while 1135 /* Reset single_kboard in case top-level set it while
1136 evaluating an -f option, or we are stuck there for some 1136 evaluating an -f option, or we are stuck there for some
1137 other reason. */ 1137 other reason. */
1138 any_kboard_state (); 1138 any_kboard_state ();
1139#endif 1139#endif
1140 internal_catch (Qtop_level, command_loop_2, Qnil); 1140 internal_catch (Qtop_level, command_loop_2, Qnil);
@@ -1495,8 +1495,8 @@ command_loop_1 (void)
1495 if (!NILP (Vquit_flag)) 1495 if (!NILP (Vquit_flag))
1496 { 1496 {
1497 Vexecuting_kbd_macro = Qt; 1497 Vexecuting_kbd_macro = Qt;
1498 QUIT; /* Make some noise. */ 1498 QUIT; /* Make some noise. */
1499 /* Will return since macro now empty. */ 1499 /* Will return since macro now empty. */
1500 } 1500 }
1501 } 1501 }
1502 1502
@@ -1515,7 +1515,7 @@ command_loop_1 (void)
1515 Vdisable_point_adjustment = Qnil; 1515 Vdisable_point_adjustment = Qnil;
1516 1516
1517 /* Process filters and timers may have messed with deactivate-mark. 1517 /* Process filters and timers may have messed with deactivate-mark.
1518 reset it before we execute the command. */ 1518 reset it before we execute the command. */
1519 Vdeactivate_mark = Qnil; 1519 Vdeactivate_mark = Qnil;
1520 1520
1521 /* Remap command through active keymaps. */ 1521 /* Remap command through active keymaps. */
@@ -1555,7 +1555,7 @@ command_loop_1 (void)
1555 } 1555 }
1556 else 1556 else
1557 { 1557 {
1558 /* Here for a command that isn't executed directly */ 1558 /* Here for a command that isn't executed directly. */
1559 1559
1560#ifdef HAVE_WINDOW_SYSTEM 1560#ifdef HAVE_WINDOW_SYSTEM
1561 int scount = SPECPDL_INDEX (); 1561 int scount = SPECPDL_INDEX ();
@@ -1963,7 +1963,7 @@ void
1963poll_for_input_1 (void) 1963poll_for_input_1 (void)
1964{ 1964{
1965/* Tell ns_read_socket() it is being called asynchronously so it can avoid 1965/* Tell ns_read_socket() it is being called asynchronously so it can avoid
1966 doing anything dangerous. */ 1966 doing anything dangerous. */
1967#ifdef HAVE_NS 1967#ifdef HAVE_NS
1968 ++handling_signal; 1968 ++handling_signal;
1969#endif 1969#endif
@@ -2003,7 +2003,7 @@ start_polling (void)
2003#ifdef POLL_FOR_INPUT 2003#ifdef POLL_FOR_INPUT
2004 /* XXX This condition was (read_socket_hook && !interrupt_input), 2004 /* XXX This condition was (read_socket_hook && !interrupt_input),
2005 but read_socket_hook is not global anymore. Let's pretend that 2005 but read_socket_hook is not global anymore. Let's pretend that
2006 it's always set. */ 2006 it's always set. */
2007 if (!interrupt_input) 2007 if (!interrupt_input)
2008 { 2008 {
2009 /* Turn alarm handling on unconditionally. It might have 2009 /* Turn alarm handling on unconditionally. It might have
@@ -2040,7 +2040,7 @@ input_polling_used (void)
2040#ifdef POLL_FOR_INPUT 2040#ifdef POLL_FOR_INPUT
2041 /* XXX This condition was (read_socket_hook && !interrupt_input), 2041 /* XXX This condition was (read_socket_hook && !interrupt_input),
2042 but read_socket_hook is not global anymore. Let's pretend that 2042 but read_socket_hook is not global anymore. Let's pretend that
2043 it's always set. */ 2043 it's always set. */
2044 return !interrupt_input; 2044 return !interrupt_input;
2045#else 2045#else
2046 return 0; 2046 return 0;
@@ -2055,7 +2055,7 @@ stop_polling (void)
2055#ifdef POLL_FOR_INPUT 2055#ifdef POLL_FOR_INPUT
2056 /* XXX This condition was (read_socket_hook && !interrupt_input), 2056 /* XXX This condition was (read_socket_hook && !interrupt_input),
2057 but read_socket_hook is not global anymore. Let's pretend that 2057 but read_socket_hook is not global anymore. Let's pretend that
2058 it's always set. */ 2058 it's always set. */
2059 if (!interrupt_input) 2059 if (!interrupt_input)
2060 ++poll_suppress_count; 2060 ++poll_suppress_count;
2061#endif 2061#endif
@@ -2393,7 +2393,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
2393 real event came from. Normally, a switch-frame event selects 2393 real event came from. Normally, a switch-frame event selects
2394 internal_last_event_frame after each command is read, but 2394 internal_last_event_frame after each command is read, but
2395 events read from a macro should never cause a new frame to be 2395 events read from a macro should never cause a new frame to be
2396 selected. */ 2396 selected. */
2397 Vlast_event_frame = internal_last_event_frame = Qmacro; 2397 Vlast_event_frame = internal_last_event_frame = Qmacro;
2398 2398
2399 /* Exit the macro if we are at the end. 2399 /* Exit the macro if we are at the end.
@@ -2503,7 +2503,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
2503 Try this before the sit-for, because the sit-for 2503 Try this before the sit-for, because the sit-for
2504 would do the wrong thing if we are supposed to do 2504 would do the wrong thing if we are supposed to do
2505 menu prompting. If EVENT_HAS_PARAMETERS then we are reading 2505 menu prompting. If EVENT_HAS_PARAMETERS then we are reading
2506 after a mouse event so don't try a minibuf menu. */ 2506 after a mouse event so don't try a minibuf menu. */
2507 c = Qnil; 2507 c = Qnil;
2508 if (nmaps > 0 && INTERACTIVE 2508 if (nmaps > 0 && INTERACTIVE
2509 && !NILP (prev_event) && ! EVENT_HAS_PARAMETERS (prev_event) 2509 && !NILP (prev_event) && ! EVENT_HAS_PARAMETERS (prev_event)
@@ -4990,8 +4990,8 @@ static const char *const lispy_function_keys[] =
4990 "break", /* 0xff6b */ 4990 "break", /* 0xff6b */
4991 4991
4992 0, 0, 0, 0, 4992 0, 0, 0, 0,
4993 0, 0, 0, 0, "backtab", 0, 0, 0, /* 0xff70... */ 4993 0, 0, 0, 0, "backtab", 0, 0, 0, /* 0xff70... */
4994 0, 0, 0, 0, 0, 0, 0, "kp-numlock", /* 0xff78... */ 4994 0, 0, 0, 0, 0, 0, 0, "kp-numlock", /* 0xff78... */
4995 "kp-space", /* 0xff80 */ /* IsKeypadKey */ 4995 "kp-space", /* 0xff80 */ /* IsKeypadKey */
4996 0, 0, 0, 0, 0, 0, 0, 0, 4996 0, 0, 0, 0, 0, 0, 0, 0,
4997 "kp-tab", /* 0xff89 */ 4997 "kp-tab", /* 0xff89 */
@@ -5103,14 +5103,14 @@ static Lisp_Object *const scroll_bar_parts[] = {
5103static Lisp_Object button_down_location; 5103static Lisp_Object button_down_location;
5104 5104
5105/* Information about the most recent up-going button event: Which 5105/* Information about the most recent up-going button event: Which
5106 button, what location, and what time. */ 5106 button, what location, and what time. */
5107 5107
5108static int last_mouse_button; 5108static int last_mouse_button;
5109static int last_mouse_x; 5109static int last_mouse_x;
5110static int last_mouse_y; 5110static int last_mouse_y;
5111static Time button_down_time; 5111static Time button_down_time;
5112 5112
5113/* The number of clicks in this multiple-click. */ 5113/* The number of clicks in this multiple-click. */
5114 5114
5115static int double_click_count; 5115static int double_click_count;
5116 5116
@@ -5354,7 +5354,7 @@ make_lispy_event (struct input_event *event)
5354 5354
5355#ifdef HAVE_NS 5355#ifdef HAVE_NS
5356 /* NS_NONKEY_EVENTs are just like NON_ASCII_KEYSTROKE_EVENTs, 5356 /* NS_NONKEY_EVENTs are just like NON_ASCII_KEYSTROKE_EVENTs,
5357 except that they are non-key events (last-nonmenu-event is nil). */ 5357 except that they are non-key events (last-nonmenu-event is nil). */
5358 case NS_NONKEY_EVENT: 5358 case NS_NONKEY_EVENT:
5359#endif 5359#endif
5360 5360
@@ -5840,7 +5840,7 @@ make_lispy_event (struct input_event *event)
5840 Fcons (make_number (event->timestamp), 5840 Fcons (make_number (event->timestamp),
5841 Fcons (part, Qnil))))); 5841 Fcons (part, Qnil)))));
5842 5842
5843 /* Always treat scroll bar events as clicks. */ 5843 /* Always treat scroll bar events as clicks. */
5844 event->modifiers |= click_modifier; 5844 event->modifiers |= click_modifier;
5845 event->modifiers &= ~up_modifier; 5845 event->modifiers &= ~up_modifier;
5846 5846
@@ -6710,7 +6710,7 @@ lucid_event_type_list_p (Lisp_Object object)
6710 If READABLE_EVENTS_FILTER_EVENTS is set in FLAGS, ignore internal 6710 If READABLE_EVENTS_FILTER_EVENTS is set in FLAGS, ignore internal
6711 events (FOCUS_IN_EVENT). 6711 events (FOCUS_IN_EVENT).
6712 If READABLE_EVENTS_IGNORE_SQUEEZABLES is set in FLAGS, ignore mouse 6712 If READABLE_EVENTS_IGNORE_SQUEEZABLES is set in FLAGS, ignore mouse
6713 movements and toolkit scroll bar thumb drags. */ 6713 movements and toolkit scroll bar thumb drags. */
6714 6714
6715static void 6715static void
6716get_input_pending (int *addr, int flags) 6716get_input_pending (int *addr, int flags)
@@ -6744,7 +6744,7 @@ gobble_input (int expected)
6744#ifdef POLL_FOR_INPUT 6744#ifdef POLL_FOR_INPUT
6745 /* XXX This condition was (read_socket_hook && !interrupt_input), 6745 /* XXX This condition was (read_socket_hook && !interrupt_input),
6746 but read_socket_hook is not global anymore. Let's pretend that 6746 but read_socket_hook is not global anymore. Let's pretend that
6747 it's always set. */ 6747 it's always set. */
6748 if (!interrupt_input && poll_suppress_count == 0) 6748 if (!interrupt_input && poll_suppress_count == 0)
6749 { 6749 {
6750 SIGMASKTYPE mask; 6750 SIGMASKTYPE mask;
@@ -6819,7 +6819,7 @@ read_avail_input (int expected)
6819 if (store_user_signal_events ()) 6819 if (store_user_signal_events ())
6820 expected = 0; 6820 expected = 0;
6821 6821
6822 /* Loop through the available terminals, and call their input hooks. */ 6822 /* Loop through the available terminals, and call their input hooks. */
6823 t = terminal_list; 6823 t = terminal_list;
6824 while (t) 6824 while (t)
6825 { 6825 {
@@ -6840,15 +6840,15 @@ read_avail_input (int expected)
6840 expected = 0; 6840 expected = 0;
6841 } 6841 }
6842 6842
6843 if (nr == -1) /* Not OK to read input now. */ 6843 if (nr == -1) /* Not OK to read input now. */
6844 { 6844 {
6845 err = 1; 6845 err = 1;
6846 } 6846 }
6847 else if (nr == -2) /* Non-transient error. */ 6847 else if (nr == -2) /* Non-transient error. */
6848 { 6848 {
6849 /* The terminal device terminated; it should be closed. */ 6849 /* The terminal device terminated; it should be closed. */
6850 6850
6851 /* Kill Emacs if this was our last terminal. */ 6851 /* Kill Emacs if this was our last terminal. */
6852 if (!terminal_list->next_terminal) 6852 if (!terminal_list->next_terminal)
6853 /* Formerly simply reported no input, but that 6853 /* Formerly simply reported no input, but that
6854 sometimes led to a failure of Emacs to terminate. 6854 sometimes led to a failure of Emacs to terminate.
@@ -6860,7 +6860,7 @@ read_avail_input (int expected)
6860 alone in its group. */ 6860 alone in its group. */
6861 kill (getpid (), SIGHUP); 6861 kill (getpid (), SIGHUP);
6862 6862
6863 /* XXX Is calling delete_terminal safe here? It calls delete_frame. */ 6863 /* XXX Is calling delete_terminal safe here? It calls delete_frame. */
6864 { 6864 {
6865 Lisp_Object tmp; 6865 Lisp_Object tmp;
6866 XSETTERMINAL (tmp, t); 6866 XSETTERMINAL (tmp, t);
@@ -6950,7 +6950,7 @@ tty_read_avail_input (struct terminal *terminal,
6950 return 0; 6950 return 0;
6951#endif /* subprocesses */ 6951#endif /* subprocesses */
6952 6952
6953 if (!terminal->name) /* Don't read from a dead terminal. */ 6953 if (!terminal->name) /* Don't read from a dead terminal. */
6954 return 0; 6954 return 0;
6955 6955
6956 if (terminal->type != output_termcap 6956 if (terminal->type != output_termcap
@@ -6958,15 +6958,15 @@ tty_read_avail_input (struct terminal *terminal,
6958 abort (); 6958 abort ();
6959 6959
6960 /* XXX I think the following code should be moved to separate hook 6960 /* XXX I think the following code should be moved to separate hook
6961 functions in system-dependent files. */ 6961 functions in system-dependent files. */
6962#ifdef WINDOWSNT 6962#ifdef WINDOWSNT
6963 return 0; 6963 return 0;
6964#else /* not WINDOWSNT */ 6964#else /* not WINDOWSNT */
6965 if (! tty->term_initted) /* In case we get called during bootstrap. */ 6965 if (! tty->term_initted) /* In case we get called during bootstrap. */
6966 return 0; 6966 return 0;
6967 6967
6968 if (! tty->input) 6968 if (! tty->input)
6969 return 0; /* The terminal is suspended. */ 6969 return 0; /* The terminal is suspended. */
6970 6970
6971#ifdef MSDOS 6971#ifdef MSDOS
6972 n_to_read = dos_keysns (); 6972 n_to_read = dos_keysns ();
@@ -6992,7 +6992,7 @@ tty_read_avail_input (struct terminal *terminal,
6992 Gpm_GetEvent closes gpm_fd and clears it to -1, which is why 6992 Gpm_GetEvent closes gpm_fd and clears it to -1, which is why
6993 we save it in `fd' so close_gpm can remove it from the 6993 we save it in `fd' so close_gpm can remove it from the
6994 select masks. 6994 select masks.
6995 gpm==-1 if a protocol error or EWOULDBLOCK; the latter is normal. */ 6995 gpm==-1 if a protocol error or EWOULDBLOCK; the latter is normal. */
6996 while (gpm = Gpm_GetEvent (&event), gpm == 1) { 6996 while (gpm = Gpm_GetEvent (&event), gpm == 1) {
6997 nread += handle_one_term_event (tty, &event, &gpm_hold_quit); 6997 nread += handle_one_term_event (tty, &event, &gpm_hold_quit);
6998 } 6998 }
@@ -7012,7 +7012,7 @@ tty_read_avail_input (struct terminal *terminal,
7012 if (ioctl (fileno (tty->input), FIONREAD, &n_to_read) < 0) 7012 if (ioctl (fileno (tty->input), FIONREAD, &n_to_read) < 0)
7013 { 7013 {
7014 if (! noninteractive) 7014 if (! noninteractive)
7015 return -2; /* Close this terminal. */ 7015 return -2; /* Close this terminal. */
7016 else 7016 else
7017 n_to_read = 0; 7017 n_to_read = 0;
7018 } 7018 }
@@ -7045,16 +7045,16 @@ tty_read_avail_input (struct terminal *terminal,
7045 process group won't get SIGHUP's at logout time. BSDI adheres to 7045 process group won't get SIGHUP's at logout time. BSDI adheres to
7046 this part standard and returns -1 from read (0) with errno==EIO 7046 this part standard and returns -1 from read (0) with errno==EIO
7047 when the control tty is taken away. 7047 when the control tty is taken away.
7048 Jeffrey Honig <jch@bsdi.com> says this is generally safe. */ 7048 Jeffrey Honig <jch@bsdi.com> says this is generally safe. */
7049 if (nread == -1 && errno == EIO) 7049 if (nread == -1 && errno == EIO)
7050 return -2; /* Close this terminal. */ 7050 return -2; /* Close this terminal. */
7051#if defined (AIX) && defined (_BSD) 7051#if defined (AIX) && defined (_BSD)
7052 /* The kernel sometimes fails to deliver SIGHUP for ptys. 7052 /* The kernel sometimes fails to deliver SIGHUP for ptys.
7053 This looks incorrect, but it isn't, because _BSD causes 7053 This looks incorrect, but it isn't, because _BSD causes
7054 O_NDELAY to be defined in fcntl.h as O_NONBLOCK, 7054 O_NDELAY to be defined in fcntl.h as O_NONBLOCK,
7055 and that causes a value other than 0 when there is no input. */ 7055 and that causes a value other than 0 when there is no input. */
7056 if (nread == 0) 7056 if (nread == 0)
7057 return -2; /* Close this terminal. */ 7057 return -2; /* Close this terminal. */
7058#endif 7058#endif
7059 } 7059 }
7060 while ( 7060 while (
@@ -7132,7 +7132,7 @@ tty_read_avail_input (struct terminal *terminal,
7132 buf.code = cbuf[i]; 7132 buf.code = cbuf[i];
7133 /* Set the frame corresponding to the active tty. Note that the 7133 /* Set the frame corresponding to the active tty. Note that the
7134 value of selected_frame is not reliable here, redisplay tends 7134 value of selected_frame is not reliable here, redisplay tends
7135 to temporarily change it. */ 7135 to temporarily change it. */
7136 buf.frame_or_window = tty->top_frame; 7136 buf.frame_or_window = tty->top_frame;
7137 buf.arg = Qnil; 7137 buf.arg = Qnil;
7138 7138
@@ -7155,7 +7155,7 @@ handle_async_input (void)
7155 pending_signals = pending_atimers; 7155 pending_signals = pending_atimers;
7156#endif 7156#endif
7157/* Tell ns_read_socket() it is being called asynchronously so it can avoid 7157/* Tell ns_read_socket() it is being called asynchronously so it can avoid
7158 doing anything dangerous. */ 7158 doing anything dangerous. */
7159#ifdef HAVE_NS 7159#ifdef HAVE_NS
7160 ++handling_signal; 7160 ++handling_signal;
7161#endif 7161#endif
@@ -7213,7 +7213,7 @@ input_available_signal (int signo)
7213 This function exists so that the UNBLOCK_INPUT macro in 7213 This function exists so that the UNBLOCK_INPUT macro in
7214 blockinput.h can have some way to take care of input we put off 7214 blockinput.h can have some way to take care of input we put off
7215 dealing with, without assuming that every file which uses 7215 dealing with, without assuming that every file which uses
7216 UNBLOCK_INPUT also has #included the files necessary to get SIGIO. */ 7216 UNBLOCK_INPUT also has #included the files necessary to get SIGIO. */
7217void 7217void
7218reinvoke_input_signal (void) 7218reinvoke_input_signal (void)
7219{ 7219{
@@ -7240,7 +7240,7 @@ struct user_signal_info
7240 struct user_signal_info *next; 7240 struct user_signal_info *next;
7241}; 7241};
7242 7242
7243/* List of user signals. */ 7243/* List of user signals. */
7244static struct user_signal_info *user_signals = NULL; 7244static struct user_signal_info *user_signals = NULL;
7245 7245
7246void 7246void
@@ -7777,7 +7777,7 @@ parse_menu_item (Lisp_Object item, int inmenubar)
7777 { 7777 {
7778 tem = XCAR (item); 7778 tem = XCAR (item);
7779 if (SYMBOLP (tem) || STRINGP (tem) || VECTORP (tem)) 7779 if (SYMBOLP (tem) || STRINGP (tem) || VECTORP (tem))
7780 /* Be GC protected. Set keyhint to item instead of tem. */ 7780 /* Be GC protected. Set keyhint to item instead of tem. */
7781 keyhint = item; 7781 keyhint = item;
7782 } 7782 }
7783 else if (EQ (tem, QCkeys)) 7783 else if (EQ (tem, QCkeys))
@@ -7860,7 +7860,7 @@ parse_menu_item (Lisp_Object item, int inmenubar)
7860 if (inmenubar > 0) 7860 if (inmenubar > 0)
7861 return 1; 7861 return 1;
7862 7862
7863 { /* This is a command. See if there is an equivalent key binding. */ 7863 { /* This is a command. See if there is an equivalent key binding. */
7864 Lisp_Object keyeq = AREF (item_properties, ITEM_PROPERTY_KEYEQ); 7864 Lisp_Object keyeq = AREF (item_properties, ITEM_PROPERTY_KEYEQ);
7865 7865
7866 /* The previous code preferred :key-sequence to :keys, so we 7866 /* The previous code preferred :key-sequence to :keys, so we
@@ -8416,7 +8416,7 @@ append_tool_bar_item (void)
8416 These are done in different ways, depending on how the input will be read. 8416 These are done in different ways, depending on how the input will be read.
8417 Menus using X are done after auto-saving in read-char, getting the input 8417 Menus using X are done after auto-saving in read-char, getting the input
8418 event from Fx_popup_menu; menus using the minibuf use read_char recursively 8418 event from Fx_popup_menu; menus using the minibuf use read_char recursively
8419 and do auto-saving in the inner call of read_char. */ 8419 and do auto-saving in the inner call of read_char. */
8420 8420
8421static Lisp_Object 8421static Lisp_Object
8422read_char_x_menu_prompt (ptrdiff_t nmaps, Lisp_Object *maps, 8422read_char_x_menu_prompt (ptrdiff_t nmaps, Lisp_Object *maps,
@@ -8636,14 +8636,14 @@ read_char_minibuf_menu_prompt (int commandflag,
8636 tem 8636 tem
8637 = XVECTOR (item_properties)->contents[ITEM_PROPERTY_KEYEQ]; 8637 = XVECTOR (item_properties)->contents[ITEM_PROPERTY_KEYEQ];
8638 if (!NILP (tem)) 8638 if (!NILP (tem))
8639 /* Insert equivalent keybinding. */ 8639 /* Insert equivalent keybinding. */
8640 s = concat2 (s, tem); 8640 s = concat2 (s, tem);
8641#endif 8641#endif
8642 tem 8642 tem
8643 = XVECTOR (item_properties)->contents[ITEM_PROPERTY_TYPE]; 8643 = XVECTOR (item_properties)->contents[ITEM_PROPERTY_TYPE];
8644 if (EQ (tem, QCradio) || EQ (tem, QCtoggle)) 8644 if (EQ (tem, QCradio) || EQ (tem, QCtoggle))
8645 { 8645 {
8646 /* Insert button prefix. */ 8646 /* Insert button prefix. */
8647 Lisp_Object selected 8647 Lisp_Object selected
8648 = XVECTOR (item_properties)->contents[ITEM_PROPERTY_SELECTED]; 8648 = XVECTOR (item_properties)->contents[ITEM_PROPERTY_SELECTED];
8649 if (EQ (tem, QCradio)) 8649 if (EQ (tem, QCradio))
@@ -8877,7 +8877,7 @@ keyremap_step (Lisp_Object *keybuf, int bufsize, volatile keyremap *fkey,
8877 8877
8878 /* If keybuf[fkey->start..fkey->end] is bound in the 8878 /* If keybuf[fkey->start..fkey->end] is bound in the
8879 map and we're in a position to do the key remapping, replace it with 8879 map and we're in a position to do the key remapping, replace it with
8880 the binding and restart with fkey->start at the end. */ 8880 the binding and restart with fkey->start at the end. */
8881 if ((VECTORP (next) || STRINGP (next)) && doit) 8881 if ((VECTORP (next) || STRINGP (next)) && doit)
8882 { 8882 {
8883 int len = XFASTINT (Flength (next)); 8883 int len = XFASTINT (Flength (next));
@@ -9041,7 +9041,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9041 9041
9042 /* Non-zero if we are trying to map a key by changing an upper-case 9042 /* Non-zero if we are trying to map a key by changing an upper-case
9043 letter to lower case, or a shifted function key to an unshifted 9043 letter to lower case, or a shifted function key to an unshifted
9044 one. */ 9044 one. */
9045 int shift_translated = 0; 9045 int shift_translated = 0;
9046 9046
9047 /* If we receive a `switch-frame' or `select-window' event in the middle of 9047 /* If we receive a `switch-frame' or `select-window' event in the middle of
@@ -9049,7 +9049,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9049 While we're reading, we keep the event here. */ 9049 While we're reading, we keep the event here. */
9050 Lisp_Object delayed_switch_frame; 9050 Lisp_Object delayed_switch_frame;
9051 9051
9052 /* See the comment below... */ 9052 /* See the comment below... */
9053#if defined (GOBBLE_FIRST_EVENT) 9053#if defined (GOBBLE_FIRST_EVENT)
9054 Lisp_Object first_event; 9054 Lisp_Object first_event;
9055#endif 9055#endif
@@ -9324,7 +9324,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9324 if (!found) 9324 if (!found)
9325 { 9325 {
9326 /* Don't touch interrupted_kboard when it's been 9326 /* Don't touch interrupted_kboard when it's been
9327 deleted. */ 9327 deleted. */
9328 delayed_switch_frame = Qnil; 9328 delayed_switch_frame = Qnil;
9329 goto replay_entire_sequence; 9329 goto replay_entire_sequence;
9330 } 9330 }
@@ -9432,7 +9432,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9432 { 9432 {
9433 /* If we're at the beginning of a key sequence, and the caller 9433 /* If we're at the beginning of a key sequence, and the caller
9434 says it's okay, go ahead and return this event. If we're 9434 says it's okay, go ahead and return this event. If we're
9435 in the midst of a key sequence, delay it until the end. */ 9435 in the midst of a key sequence, delay it until the end. */
9436 if (t > 0 || !can_return_switch_frame) 9436 if (t > 0 || !can_return_switch_frame)
9437 { 9437 {
9438 delayed_switch_frame = key; 9438 delayed_switch_frame = key;
@@ -9729,7 +9729,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9729 Down-clicks are eliminated. 9729 Down-clicks are eliminated.
9730 Double-downs reduce to downs, then are eliminated. 9730 Double-downs reduce to downs, then are eliminated.
9731 Triple-downs reduce to double-downs, then to downs, 9731 Triple-downs reduce to double-downs, then to downs,
9732 then are eliminated. */ 9732 then are eliminated. */
9733 if (modifiers & (down_modifier | drag_modifier 9733 if (modifiers & (down_modifier | drag_modifier
9734 | double_modifier | triple_modifier)) 9734 | double_modifier | triple_modifier))
9735 { 9735 {
@@ -10838,7 +10838,7 @@ set_waiting_for_input (struct timeval *time_to_clear)
10838 waiting_for_input = 1; 10838 waiting_for_input = 1;
10839 10839
10840 /* If handle_interrupt was called before and buffered a C-g, 10840 /* If handle_interrupt was called before and buffered a C-g,
10841 make it run again now, to avoid timing error. */ 10841 make it run again now, to avoid timing error. */
10842 if (!NILP (Vquit_flag)) 10842 if (!NILP (Vquit_flag))
10843 quit_throw_to_read_char (); 10843 quit_throw_to_read_char ();
10844} 10844}
@@ -10859,7 +10859,7 @@ clear_waiting_for_input (void)
10859 10859
10860static void 10860static void
10861interrupt_signal (int signalnum) /* If we don't have an argument, some */ 10861interrupt_signal (int signalnum) /* If we don't have an argument, some */
10862 /* compilers complain in signal calls. */ 10862 /* compilers complain in signal calls. */
10863{ 10863{
10864 /* Must preserve main program's value of errno. */ 10864 /* Must preserve main program's value of errno. */
10865 int old_errno = errno; 10865 int old_errno = errno;
@@ -10867,12 +10867,12 @@ interrupt_signal (int signalnum) /* If we don't have an argument, some */
10867 10867
10868 SIGNAL_THREAD_CHECK (signalnum); 10868 SIGNAL_THREAD_CHECK (signalnum);
10869 10869
10870 /* See if we have an active terminal on our controlling tty. */ 10870 /* See if we have an active terminal on our controlling tty. */
10871 terminal = get_named_tty ("/dev/tty"); 10871 terminal = get_named_tty ("/dev/tty");
10872 if (!terminal) 10872 if (!terminal)
10873 { 10873 {
10874 /* If there are no frames there, let's pretend that we are a 10874 /* If there are no frames there, let's pretend that we are a
10875 well-behaving UN*X program and quit. */ 10875 well-behaving UN*X program and quit. */
10876 Fkill_emacs (Qnil); 10876 Fkill_emacs (Qnil);
10877 } 10877 }
10878 else 10878 else
@@ -10900,7 +10900,7 @@ interrupt_signal (int signalnum) /* If we don't have an argument, some */
10900 10900
10901 Otherwise it sets the Lisp variable quit-flag not-nil. This causes 10901 Otherwise it sets the Lisp variable quit-flag not-nil. This causes
10902 eval to throw, when it gets a chance. If quit-flag is already 10902 eval to throw, when it gets a chance. If quit-flag is already
10903 non-nil, it stops the job right away. */ 10903 non-nil, it stops the job right away. */
10904 10904
10905static void 10905static void
10906handle_interrupt (void) 10906handle_interrupt (void)
@@ -10909,7 +10909,7 @@ handle_interrupt (void)
10909 10909
10910 cancel_echoing (); 10910 cancel_echoing ();
10911 10911
10912 /* XXX This code needs to be revised for multi-tty support. */ 10912 /* XXX This code needs to be revised for multi-tty support. */
10913 if (!NILP (Vquit_flag) && get_named_tty ("/dev/tty")) 10913 if (!NILP (Vquit_flag) && get_named_tty ("/dev/tty"))
10914 { 10914 {
10915 /* If SIGINT isn't blocked, don't let us be interrupted by 10915 /* If SIGINT isn't blocked, don't let us be interrupted by
@@ -11019,7 +11019,7 @@ handle_interrupt (void)
11019 wait_reading_process_output() under HAVE_NS because of the call 11019 wait_reading_process_output() under HAVE_NS because of the call
11020 to ns_select there (needed because otherwise events aren't picked up 11020 to ns_select there (needed because otherwise events aren't picked up
11021 outside of polling since we don't get SIGIO like X and we don't have a 11021 outside of polling since we don't get SIGIO like X and we don't have a
11022 separate event loop thread like W32. */ 11022 separate event loop thread like W32. */
11023#ifndef HAVE_NS 11023#ifndef HAVE_NS
11024 if (waiting_for_input && !echoing) 11024 if (waiting_for_input && !echoing)
11025 quit_throw_to_read_char (); 11025 quit_throw_to_read_char ();
@@ -11468,7 +11468,7 @@ init_keyboard (void)
11468 session may have multiple display types, so we always handle 11468 session may have multiple display types, so we always handle
11469 SIGINT. There is special code in interrupt_signal to exit 11469 SIGINT. There is special code in interrupt_signal to exit
11470 Emacs on SIGINT when there are no termcap frames on the 11470 Emacs on SIGINT when there are no termcap frames on the
11471 controlling terminal. */ 11471 controlling terminal. */
11472 signal (SIGINT, interrupt_signal); 11472 signal (SIGINT, interrupt_signal);
11473#ifndef DOS_NT 11473#ifndef DOS_NT
11474 /* For systems with SysV TERMIO, C-g is set up for both SIGINT and 11474 /* For systems with SysV TERMIO, C-g is set up for both SIGINT and
@@ -12269,7 +12269,7 @@ Currently, the only supported values for this
12269variable are `sigusr1' and `sigusr2'. */); 12269variable are `sigusr1' and `sigusr2'. */);
12270 Vdebug_on_event = intern_c_string ("sigusr2"); 12270 Vdebug_on_event = intern_c_string ("sigusr2");
12271 12271
12272 /* Create the initial keyboard. */ 12272 /* Create the initial keyboard. */
12273 initial_kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); 12273 initial_kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
12274 init_kboard (initial_kboard); 12274 init_kboard (initial_kboard);
12275 /* Vwindow_system is left at t for now. */ 12275 /* Vwindow_system is left at t for now. */
diff --git a/src/lisp.h b/src/lisp.h
index bc48b790a14..c0ddb7f2b02 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -162,7 +162,7 @@ extern int suppress_checking EXTERNALLY_VISIBLE;
162 162
163/* First, try and define DECL_ALIGN(type,var) which declares a static 163/* First, try and define DECL_ALIGN(type,var) which declares a static
164 variable VAR of type TYPE with the added requirement that it be 164 variable VAR of type TYPE with the added requirement that it be
165 TYPEBITS-aligned. */ 165 TYPEBITS-aligned. */
166#ifndef NO_DECL_ALIGN 166#ifndef NO_DECL_ALIGN
167# ifndef DECL_ALIGN 167# ifndef DECL_ALIGN
168# if HAVE_ATTRIBUTE_ALIGNED 168# if HAVE_ATTRIBUTE_ALIGNED
@@ -1088,11 +1088,9 @@ enum symbol_redirect
1088 SYMBOL_PLAINVAL = 4, 1088 SYMBOL_PLAINVAL = 4,
1089 SYMBOL_VARALIAS = 1, 1089 SYMBOL_VARALIAS = 1,
1090 SYMBOL_LOCALIZED = 2, 1090 SYMBOL_LOCALIZED = 2,
1091 SYMBOL_FORWARDED = 3 1091 SYMBOL_FORWARDED = 3
1092}; 1092};
1093 1093
1094/* In a symbol, the markbit of the plist is used as the gc mark bit */
1095
1096struct Lisp_Symbol 1094struct Lisp_Symbol
1097{ 1095{
1098 unsigned gcmarkbit : 1; 1096 unsigned gcmarkbit : 1;
@@ -1101,8 +1099,7 @@ struct Lisp_Symbol
1101 0 : it's a plain var, the value is in the `value' field. 1099 0 : it's a plain var, the value is in the `value' field.
1102 1 : it's a varalias, the value is really in the `alias' symbol. 1100 1 : it's a varalias, the value is really in the `alias' symbol.
1103 2 : it's a localized var, the value is in the `blv' object. 1101 2 : it's a localized var, the value is in the `blv' object.
1104 3 : it's a forwarding variable, the value is in `forward'. 1102 3 : it's a forwarding variable, the value is in `forward'. */
1105 */
1106 enum symbol_redirect redirect : 3; 1103 enum symbol_redirect redirect : 3;
1107 1104
1108 /* Non-zero means symbol is constant, i.e. changing its value 1105 /* Non-zero means symbol is constant, i.e. changing its value
@@ -1119,15 +1116,12 @@ struct Lisp_Symbol
1119 unsigned declared_special : 1; 1116 unsigned declared_special : 1;
1120 1117
1121 /* The symbol's name, as a Lisp string. 1118 /* The symbol's name, as a Lisp string.
1122
1123 The name "xname" is used to intentionally break code referring to 1119 The name "xname" is used to intentionally break code referring to
1124 the old field "name" of type pointer to struct Lisp_String. */ 1120 the old field "name" of type pointer to struct Lisp_String. */
1125 Lisp_Object xname; 1121 Lisp_Object xname;
1126 1122
1127 /* Value of the symbol or Qunbound if unbound. If this symbol is a 1123 /* Value of the symbol or Qunbound if unbound. Which alternative of the
1128 defvaralias, `alias' contains the symbol for which it is an 1124 union is used depends on the `redirect' field above. */
1129 alias. Use the SYMBOL_VALUE and SET_SYMBOL_VALUE macros to get
1130 and set a symbol's value, to take defvaralias into account. */
1131 union { 1125 union {
1132 Lisp_Object value; 1126 Lisp_Object value;
1133 struct Lisp_Symbol *alias; 1127 struct Lisp_Symbol *alias;
@@ -1322,7 +1316,7 @@ struct Lisp_Misc_Any /* Supertype of all Misc types. */
1322 enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_??? */ 1316 enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_??? */
1323 unsigned gcmarkbit : 1; 1317 unsigned gcmarkbit : 1;
1324 int spacer : 15; 1318 int spacer : 15;
1325 /* Make it as long as "Lisp_Free without padding". */ 1319 /* Make it as long as "Lisp_Free without padding". */
1326 void *fill; 1320 void *fill;
1327}; 1321};
1328 1322
@@ -3607,7 +3601,7 @@ extern void init_system_name (void);
3607 3601
3608#define SWITCH_ENUM_CAST(x) (x) 3602#define SWITCH_ENUM_CAST(x) (x)
3609 3603
3610/* Use this to suppress gcc's warnings. */ 3604/* Use this to suppress gcc's warnings. */
3611#ifdef lint 3605#ifdef lint
3612 3606
3613/* Use CODE only if lint checking is in effect. */ 3607/* Use CODE only if lint checking is in effect. */
diff --git a/src/w32.h b/src/w32.h
index f1915125c90..a3ca1130ce6 100644
--- a/src/w32.h
+++ b/src/w32.h
@@ -139,6 +139,7 @@ extern void term_w32select (void);
139extern void syms_of_w32menu (void); 139extern void syms_of_w32menu (void);
140extern void globals_of_w32menu (void); 140extern void globals_of_w32menu (void);
141extern void syms_of_fontset (void); 141extern void syms_of_fontset (void);
142extern void syms_of_w32font (void);
142 143
143extern int _sys_read_ahead (int fd); 144extern int _sys_read_ahead (int fd);
144extern int _sys_wait_accept (int fd); 145extern int _sys_wait_accept (int fd);
diff --git a/src/w32font.c b/src/w32font.c
index f47b7a46b1e..6c1b4d0bc20 100644
--- a/src/w32font.c
+++ b/src/w32font.c
@@ -145,6 +145,138 @@ struct font_callback_data
145 style variations if the font name is not specified. */ 145 style variations if the font name is not specified. */
146static void list_all_matching_fonts (struct font_callback_data *); 146static void list_all_matching_fonts (struct font_callback_data *);
147 147
148static BOOL g_b_init_is_w9x;
149static BOOL g_b_init_get_outline_metrics_w;
150static BOOL g_b_init_get_text_metrics_w;
151static BOOL g_b_init_get_glyph_outline_w;
152static BOOL g_b_init_get_glyph_outline_w;
153
154typedef UINT (WINAPI * GetOutlineTextMetricsW_Proc) (
155 HDC hdc,
156 UINT cbData,
157 LPOUTLINETEXTMETRICW lpotmw);
158typedef BOOL (WINAPI * GetTextMetricsW_Proc) (
159 HDC hdc,
160 LPTEXTMETRICW lptmw);
161typedef DWORD (WINAPI * GetGlyphOutlineW_Proc) (
162 HDC hdc,
163 UINT uChar,
164 UINT uFormat,
165 LPGLYPHMETRICS lpgm,
166 DWORD cbBuffer,
167 LPVOID lpvBuffer,
168 const MAT2 *lpmat2);
169
170/* Several "wide" functions we use to support the font backends are
171 unavailable on Windows 9X, unless UNICOWS.DLL is installed (their
172 versions in the default libraries are non-functional stubs). On NT
173 and later systems, these functions are in GDI32.DLL. The following
174 helper function attempts to load UNICOWS.DLL on Windows 9X, and
175 refuses to let Emacs start up if that library is not found. On NT
176 and later versions, it simply loads GDI32.DLL, which should always
177 be available. */
178static HMODULE
179w32_load_unicows_or_gdi32 (void)
180{
181 static BOOL is_9x = 0;
182 OSVERSIONINFO os_ver;
183 HMODULE ret;
184 if (g_b_init_is_w9x == 0)
185 {
186 g_b_init_is_w9x = 1;
187 ZeroMemory (&os_ver, sizeof (OSVERSIONINFO));
188 os_ver.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
189 if (GetVersionEx (&os_ver))
190 is_9x = (os_ver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS);
191 }
192 if (is_9x)
193 {
194 ret = LoadLibrary ("Unicows.dll");
195 if (!ret)
196 {
197 int button;
198
199 button = MessageBox (NULL,
200 "Emacs cannot load the UNICOWS.DLL library.\n"
201 "This library is essential for using Emacs\n"
202 "on this system. You need to install it.\n\n"
203 "However, you can still use Emacs by invoking\n"
204 "it with the '-nw' command-line option.\n\n"
205 "Emacs will exit when you click OK.",
206 "Emacs cannot load UNICOWS.DLL",
207 MB_ICONERROR | MB_TASKMODAL
208 | MB_SETFOREGROUND | MB_OK);
209 switch (button)
210 {
211 case IDOK:
212 default:
213 exit (1);
214 }
215 }
216 }
217 else
218 ret = LoadLibrary ("Gdi32.dll");
219 return ret;
220}
221
222/* The following 3 functions call the problematic "wide" APIs via
223 function pointers, to avoid linking against the non-standard
224 libunicows on W9X. */
225static UINT WINAPI
226get_outline_metrics_w(HDC hdc, UINT cbData, LPOUTLINETEXTMETRICW lpotmw)
227{
228 static GetOutlineTextMetricsW_Proc s_pfn_Get_Outline_Text_MetricsW = NULL;
229 HMODULE hm_unicows = NULL;
230 if (g_b_init_get_outline_metrics_w == 0)
231 {
232 g_b_init_get_outline_metrics_w = 1;
233 hm_unicows = w32_load_unicows_or_gdi32 ();
234 if (hm_unicows)
235 s_pfn_Get_Outline_Text_MetricsW = (GetOutlineTextMetricsW_Proc)
236 GetProcAddress (hm_unicows, "GetOutlineTextMetricsW");
237 }
238 if (s_pfn_Get_Outline_Text_MetricsW == NULL)
239 abort (); /* cannot happen */
240 return s_pfn_Get_Outline_Text_MetricsW (hdc, cbData, lpotmw);
241}
242
243static BOOL WINAPI
244get_text_metrics_w(HDC hdc, LPTEXTMETRICW lptmw)
245{
246 static GetTextMetricsW_Proc s_pfn_Get_Text_MetricsW = NULL;
247 HMODULE hm_unicows = NULL;
248 if (g_b_init_get_text_metrics_w == 0)
249 {
250 g_b_init_get_text_metrics_w = 1;
251 hm_unicows = w32_load_unicows_or_gdi32 ();
252 if (hm_unicows)
253 s_pfn_Get_Text_MetricsW = (GetTextMetricsW_Proc)
254 GetProcAddress (hm_unicows, "GetTextMetricsW");
255 }
256 if (s_pfn_Get_Text_MetricsW == NULL)
257 abort (); /* cannot happen */
258 return s_pfn_Get_Text_MetricsW (hdc, lptmw);
259}
260
261static DWORD WINAPI
262get_glyph_outline_w (HDC hdc, UINT uChar, UINT uFormat, LPGLYPHMETRICS lpgm,
263 DWORD cbBuffer, LPVOID lpvBuffer, const MAT2 *lpmat2)
264{
265 static GetGlyphOutlineW_Proc s_pfn_Get_Glyph_OutlineW = NULL;
266 HMODULE hm_unicows = NULL;
267 if (g_b_init_get_glyph_outline_w == 0)
268 {
269 g_b_init_get_glyph_outline_w = 1;
270 hm_unicows = w32_load_unicows_or_gdi32 ();
271 if (hm_unicows)
272 s_pfn_Get_Glyph_OutlineW = (GetGlyphOutlineW_Proc)
273 GetProcAddress (hm_unicows, "GetGlyphOutlineW");
274 }
275 if (s_pfn_Get_Glyph_OutlineW == NULL)
276 abort (); /* cannot happen */
277 return s_pfn_Get_Glyph_OutlineW (hdc, uChar, uFormat, lpgm, cbBuffer,
278 lpvBuffer, lpmat2);
279}
148 280
149static int 281static int
150memq_no_quit (Lisp_Object elt, Lisp_Object list) 282memq_no_quit (Lisp_Object elt, Lisp_Object list)
@@ -816,11 +948,11 @@ w32font_open_internal (FRAME_PTR f, Lisp_Object font_entity,
816 old_font = SelectObject (dc, hfont); 948 old_font = SelectObject (dc, hfont);
817 949
818 /* Try getting the outline metrics (only works for truetype fonts). */ 950 /* Try getting the outline metrics (only works for truetype fonts). */
819 len = GetOutlineTextMetricsW (dc, 0, NULL); 951 len = get_outline_metrics_w (dc, 0, NULL);
820 if (len) 952 if (len)
821 { 953 {
822 metrics = (OUTLINETEXTMETRICW *) alloca (len); 954 metrics = (OUTLINETEXTMETRICW *) alloca (len);
823 if (GetOutlineTextMetricsW (dc, len, metrics)) 955 if (get_outline_metrics_w (dc, len, metrics))
824 memcpy (&w32_font->metrics, &metrics->otmTextMetrics, 956 memcpy (&w32_font->metrics, &metrics->otmTextMetrics,
825 sizeof (TEXTMETRICW)); 957 sizeof (TEXTMETRICW));
826 else 958 else
@@ -828,7 +960,7 @@ w32font_open_internal (FRAME_PTR f, Lisp_Object font_entity,
828 } 960 }
829 961
830 if (!metrics) 962 if (!metrics)
831 GetTextMetricsW (dc, &w32_font->metrics); 963 get_text_metrics_w (dc, &w32_font->metrics);
832 964
833 w32_font->cached_metrics = NULL; 965 w32_font->cached_metrics = NULL;
834 w32_font->n_cache_blocks = 0; 966 w32_font->n_cache_blocks = 0;
@@ -2306,7 +2438,7 @@ compute_metrics (HDC dc, struct w32font_info *w32_font, unsigned int code,
2306 transform.eM11.value = 1; 2438 transform.eM11.value = 1;
2307 transform.eM22.value = 1; 2439 transform.eM22.value = 1;
2308 2440
2309 if (GetGlyphOutlineW (dc, code, options, &gm, 0, NULL, &transform) 2441 if (get_glyph_outline_w (dc, code, options, &gm, 0, NULL, &transform)
2310 != GDI_ERROR) 2442 != GDI_ERROR)
2311 { 2443 {
2312 metrics->lbearing = gm.gmptGlyphOrigin.x; 2444 metrics->lbearing = gm.gmptGlyphOrigin.x;
@@ -2581,3 +2713,12 @@ versions of Windows) characters. */);
2581 w32font_driver.type = Qgdi; 2713 w32font_driver.type = Qgdi;
2582 register_font_driver (&w32font_driver, NULL); 2714 register_font_driver (&w32font_driver, NULL);
2583} 2715}
2716
2717void
2718globals_of_w32font (void)
2719{
2720 g_b_init_is_w9x = 0;
2721 g_b_init_get_outline_metrics_w = 0;
2722 g_b_init_get_text_metrics_w = 0;
2723 g_b_init_get_glyph_outline_w = 0;
2724}
diff --git a/src/window.c b/src/window.c
index 7f4714ba17e..e6840a0ebe7 100644
--- a/src/window.c
+++ b/src/window.c
@@ -177,10 +177,10 @@ WINDOW can be any window and defaults to the selected one. */)
177} 177}
178 178
179DEFUN ("frame-root-window", Fframe_root_window, Sframe_root_window, 0, 1, 0, 179DEFUN ("frame-root-window", Fframe_root_window, Sframe_root_window, 0, 1, 0,
180 doc: /* Return the root window of FRAME_OR_WINDOW. 180 doc: /* Return the root window of FRAME-OR-WINDOW.
181If omitted, FRAME_OR_WINDOW defaults to the currently selected frame. 181If omitted, FRAME-OR-WINDOW defaults to the currently selected frame.
182Else if FRAME_OR_WINDOW denotes any window, return the root window of 182Else if FRAME-OR-WINDOW denotes any window, return the root window of
183that window's frame. If FRAME_OR_WINDOW denotes a live frame, return 183that window's frame. If FRAME-OR-WINDOW denotes a live frame, return
184the root window of that frame. */) 184the root window of that frame. */)
185 (Lisp_Object frame_or_window) 185 (Lisp_Object frame_or_window)
186{ 186{
@@ -222,10 +222,10 @@ WINDOW can be any window and defaults to the selected one. */)
222 222
223/* Don't move this to window.el - this must be a safe routine. */ 223/* Don't move this to window.el - this must be a safe routine. */
224DEFUN ("frame-first-window", Fframe_first_window, Sframe_first_window, 0, 1, 0, 224DEFUN ("frame-first-window", Fframe_first_window, Sframe_first_window, 0, 1, 0,
225 doc: /* Return the topmost, leftmost live window on FRAME_OR_WINDOW. 225 doc: /* Return the topmost, leftmost live window on FRAME-OR-WINDOW.
226If omitted, FRAME_OR_WINDOW defaults to the currently selected frame. 226If omitted, FRAME-OR-WINDOW defaults to the currently selected frame.
227Else if FRAME_OR_WINDOW denotes any window, return the first window of 227Else if FRAME-OR-WINDOW denotes any window, return the first window of
228that window's frame. If FRAME_OR_WINDOW denotes a live frame, return 228that window's frame. If FRAME-OR-WINDOW denotes a live frame, return
229the first window of that frame. */) 229the first window of that frame. */)
230 (Lisp_Object frame_or_window) 230 (Lisp_Object frame_or_window)
231{ 231{
@@ -256,10 +256,10 @@ the first window of that frame. */)
256 256
257DEFUN ("frame-selected-window", Fframe_selected_window, 257DEFUN ("frame-selected-window", Fframe_selected_window,
258 Sframe_selected_window, 0, 1, 0, 258 Sframe_selected_window, 0, 1, 0,
259 doc: /* Return the selected window of FRAME_OR_WINDOW. 259 doc: /* Return the selected window of FRAME-OR-WINDOW.
260If omitted, FRAME_OR_WINDOW defaults to the currently selected frame. 260If omitted, FRAME-OR-WINDOW defaults to the currently selected frame.
261Else if FRAME_OR_WINDOW denotes any window, return the selected window 261Else if FRAME-OR-WINDOW denotes any window, return the selected window
262of that window's frame. If FRAME_OR_WINDOW denotes a live frame, return 262of that window's frame. If FRAME-OR-WINDOW denotes a live frame, return
263the selected window of that frame. */) 263the selected window of that frame. */)
264 (Lisp_Object frame_or_window) 264 (Lisp_Object frame_or_window)
265{ 265{
@@ -1299,7 +1299,7 @@ WINDOW must be a live window and defaults to the selected one.
1299This is updated by redisplay, when it runs to completion. 1299This is updated by redisplay, when it runs to completion.
1300Simply changing the buffer text or setting `window-start' 1300Simply changing the buffer text or setting `window-start'
1301does not update this value. 1301does not update this value.
1302Return nil if there is no recorded value. \(This can happen if the 1302Return nil if there is no recorded value. (This can happen if the
1303last redisplay of WINDOW was preempted, and did not finish.) 1303last redisplay of WINDOW was preempted, and did not finish.)
1304If UPDATE is non-nil, compute the up-to-date position 1304If UPDATE is non-nil, compute the up-to-date position
1305if it isn't already recorded. */) 1305if it isn't already recorded. */)
@@ -1690,7 +1690,7 @@ DEFUN ("window-parameters", Fwindow_parameters, Swindow_parameters,
1690 0, 1, 0, 1690 0, 1, 0,
1691 doc: /* Return the parameters of WINDOW and their values. 1691 doc: /* Return the parameters of WINDOW and their values.
1692WINDOW defaults to the selected window. The return value is a list of 1692WINDOW defaults to the selected window. The return value is a list of
1693elements of the form (PARAMETER . VALUE). */) 1693elements of the form (PARAMETER . VALUE). */)
1694 (Lisp_Object window) 1694 (Lisp_Object window)
1695{ 1695{
1696 return Fcopy_alist (decode_any_window (window)->window_parameters); 1696 return Fcopy_alist (decode_any_window (window)->window_parameters);
@@ -2195,7 +2195,7 @@ next_window (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames, in
2195 2195
2196DEFUN ("next-window", Fnext_window, Snext_window, 0, 3, 0, 2196DEFUN ("next-window", Fnext_window, Snext_window, 0, 3, 0,
2197 doc: /* Return window following WINDOW in cyclic ordering of windows. 2197 doc: /* Return window following WINDOW in cyclic ordering of windows.
2198WINDOW must be a live window and defaults to the selected one. The 2198WINDOW must be a live window and defaults to the selected one. The
2199optional arguments MINIBUF and ALL-FRAMES specify the set of windows to 2199optional arguments MINIBUF and ALL-FRAMES specify the set of windows to
2200consider. 2200consider.
2201 2201
@@ -3226,7 +3226,7 @@ temp_output_buffer_show (register Lisp_Object buf)
3226DEFUN ("internal-temp-output-buffer-show", 3226DEFUN ("internal-temp-output-buffer-show",
3227 Ftemp_output_buffer_show, Stemp_output_buffer_show, 3227 Ftemp_output_buffer_show, Stemp_output_buffer_show,
3228 1, 1, 0, 3228 1, 1, 0,
3229 doc: /* Internal function for `with-output-to-temp-buffer''. */) 3229 doc: /* Internal function for `with-output-to-temp-buffer'. */)
3230 (Lisp_Object buf) 3230 (Lisp_Object buf)
3231{ 3231{
3232 temp_output_buffer_show (buf); 3232 temp_output_buffer_show (buf);
@@ -3322,6 +3322,7 @@ make_window (void)
3322 memset (&w->phys_cursor, 0, sizeof (w->phys_cursor)); 3322 memset (&w->phys_cursor, 0, sizeof (w->phys_cursor));
3323 w->phys_cursor_type = -1; 3323 w->phys_cursor_type = -1;
3324 w->phys_cursor_width = -1; 3324 w->phys_cursor_width = -1;
3325 w->phys_cursor_on_p = 0;
3325 w->last_cursor_off_p = w->cursor_off_p = 0; 3326 w->last_cursor_off_p = w->cursor_off_p = 0;
3326 w->must_be_updated_p = 0; 3327 w->must_be_updated_p = 0;
3327 w->pseudo_window_p = 0; 3328 w->pseudo_window_p = 0;
@@ -3847,8 +3848,8 @@ set correctly. See the code of `split-window' for how this is done. */)
3847 3848
3848DEFUN ("delete-window-internal", Fdelete_window_internal, Sdelete_window_internal, 1, 1, 0, 3849DEFUN ("delete-window-internal", Fdelete_window_internal, Sdelete_window_internal, 1, 1, 0,
3849 doc: /* Remove WINDOW from its frame. 3850 doc: /* Remove WINDOW from its frame.
3850WINDOW defaults to the selected window. Return nil. Signal an error 3851WINDOW defaults to the selected window. Return nil.
3851when WINDOW is the only window on its frame. */) 3852Signal an error when WINDOW is the only window on its frame. */)
3852 (register Lisp_Object window) 3853 (register Lisp_Object window)
3853{ 3854{
3854 register Lisp_Object parent, sibling, frame, root; 3855 register Lisp_Object parent, sibling, frame, root;
@@ -5230,8 +5231,8 @@ any partial-height lines in the text display area. */)
5230DEFUN ("move-to-window-line", Fmove_to_window_line, Smove_to_window_line, 5231DEFUN ("move-to-window-line", Fmove_to_window_line, Smove_to_window_line,
5231 1, 1, "P", 5232 1, 1, "P",
5232 doc: /* Position point relative to window. 5233 doc: /* Position point relative to window.
5233With no argument, position point at center of window. 5234ARG nil means position point at center of window.
5234An argument specifies vertical position within the window; 5235Else, ARG specifies vertical position within the window;
5235zero means top of window, negative means relative to bottom of window. */) 5236zero means top of window, negative means relative to bottom of window. */)
5236 (Lisp_Object arg) 5237 (Lisp_Object arg)
5237{ 5238{
diff --git a/src/xdisp.c b/src/xdisp.c
index e0b36dbe100..c3a924d10d4 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -27039,7 +27039,7 @@ void
27039note_mouse_highlight (struct frame *f, int x, int y) 27039note_mouse_highlight (struct frame *f, int x, int y)
27040{ 27040{
27041 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); 27041 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
27042 enum window_part part; 27042 enum window_part part = ON_NOTHING;
27043 Lisp_Object window; 27043 Lisp_Object window;
27044 struct window *w; 27044 struct window *w;
27045 Cursor cursor = No_Cursor; 27045 Cursor cursor = No_Cursor;
@@ -27073,11 +27073,14 @@ note_mouse_highlight (struct frame *f, int x, int y)
27073 /* Which window is that in? */ 27073 /* Which window is that in? */
27074 window = window_from_coordinates (f, x, y, &part, 1); 27074 window = window_from_coordinates (f, x, y, &part, 1);
27075 27075
27076 /* If we were displaying active text in another window, clear that. 27076 /* If displaying active text in another window, clear that. */
27077 Also clear if we move out of text area in same window. */
27078 if (! EQ (window, hlinfo->mouse_face_window) 27077 if (! EQ (window, hlinfo->mouse_face_window)
27079 || (part != ON_TEXT && part != ON_MODE_LINE && part != ON_HEADER_LINE 27078 /* Also clear if we move out of text area in same window. */
27080 && !NILP (hlinfo->mouse_face_window))) 27079 || (!NILP (hlinfo->mouse_face_window)
27080 && !NILP (window)
27081 && part != ON_TEXT
27082 && part != ON_MODE_LINE
27083 && part != ON_HEADER_LINE))
27081 clear_mouse_face (hlinfo); 27084 clear_mouse_face (hlinfo);
27082 27085
27083 /* Not on a window -> return. */ 27086 /* Not on a window -> return. */