diff options
| author | Paul Eggert | 2011-10-29 10:33:13 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-10-29 10:33:13 -0700 |
| commit | 8d0eb4c275581847990b85dbb350caa3df9e653f (patch) | |
| tree | c161f977d59ac3103b04dc0f4aea57c83436a456 | |
| parent | 929bb973dd3faf1655f03ac758942d5b009354ad (diff) | |
| parent | 196e41e4aec1a44ec5b6e9bed485185ba872ae67 (diff) | |
| download | emacs-8d0eb4c275581847990b85dbb350caa3df9e653f.tar.gz emacs-8d0eb4c275581847990b85dbb350caa3df9e653f.zip | |
Merge from trunk.
42 files changed, 1257 insertions, 369 deletions
diff --git a/admin/ChangeLog b/admin/ChangeLog index 7648b2a8455..7c2f1a743b2 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-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 | |||
| 1 | 2011-09-26 Chong Yidong <cyd@stupidchicken.com> | 6 | 2011-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 @@ | |||
| 1 | 2011-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 | |||
| 1 | 2011-10-23 Michael Albinus <michael.albinus@gmx.de> | 13 | 2011-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 | ||
| 344 | Customizing 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 | |||
| 655 | syntactic recognition can be wrong. @ccmode{} manages to figure it | 660 | syntactic recognition can be wrong. @ccmode{} manages to figure it |
| 656 | out correctly most of the time, though. | 661 | out correctly most of the time, though. |
| 657 | 662 | ||
| 663 | Some macros, when invoked, ''have their own semicolon''. To get the | ||
| 664 | next line indented correctly, rather than as a continuation line, | ||
| 665 | @xref{Macros with ;}. | ||
| 666 | |||
| 658 | Reindenting large sections of code can take a long time. When | 667 | Reindenting 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 |
| 660 | hitting @key{TAB} on every line of the region. | 669 | hitting @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 | ||
| 886 | Move to the beginning or end of the current or next function. Other | 897 | Move to the beginning or end of the current or next function. Other |
| 887 | constructs (such as a structs or classes) which have a brace block | 898 | constructs (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 | |||
| 895 | start or end of the function. This occasionally causes point not to | 906 | start or end of the function. This occasionally causes point not to |
| 896 | move at all. | 907 | move at all. |
| 897 | 908 | ||
| 909 | By default, these commands will recognize functions contained within a | ||
| 910 | @dfn{declaration scope} such as a C++ @code{class} or @code{namespace} | ||
| 911 | construct, should the point start inside it. If @ccmode fails to find | ||
| 912 | function beginnings or ends inside the current declaration scope, it | ||
| 913 | will search the enclosing scopes. If you want @ccmode to recognize | ||
| 914 | functions only at the top level@footnote{this was @ccmode{}'s | ||
| 915 | behaviour prior to version 5.32.}, set @code{c-defun-tatic} to | ||
| 916 | @code{t}. | ||
| 917 | |||
| 898 | These functions are analogous to the Emacs built-in commands | 918 | These 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 |
| 900 | eliminate the constraint that the top-level opening brace of the defun | 920 | eliminate 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 | ||
| 6573 | To configure macros which you invoke without a terminating @samp{;}, | ||
| 6574 | see @xref{Macros with ;}. | ||
| 6575 | |||
| 6553 | Here are the remaining odds and ends regarding indentation: | 6576 | Here 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 | ||
| 6627 | Preprocessor macros in C, C++, and Objective C (introduced by | ||
| 6628 | @code{#define}) have a syntax different from the main language---for | ||
| 6629 | example, a macro declaration is not terminated by a semicolon, and if | ||
| 6630 | it is more than a line long, line breaks in it must be escaped with | ||
| 6631 | backslashes. @ccmode{} has some commands to manipulate these, see | ||
| 6632 | @ref{Macro Backslashes}. | ||
| 6633 | |||
| 6604 | Normally, the lines in a multi-line macro are indented relative to | 6634 | Normally, the lines in a multi-line macro are indented relative to |
| 6605 | each other as though they were code. You can suppress this behavior | 6635 | each other as though they were code. You can suppress this behavior |
| 6606 | by setting the following user option: | 6636 | by 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 | ||
| 6645 | Because a macro can expand into anything at all, near where one is | ||
| 6646 | invoked @ccmode{} can only indent and fontify code heuristically. | ||
| 6647 | Sometimes it gets it wrong. Usually you should try to design your | ||
| 6648 | macros so that they ''look like ordinary code'' when you invoke them. | ||
| 6649 | However, one situation is so common that @ccmode{} handles it | ||
| 6650 | specially: that is when certain macros needn't (or mustn't) be | ||
| 6651 | followed by a @samp{;}. You need to configure @ccmode{} to handle | ||
| 6652 | these 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 |
| 6616 | backslashes in macros neat and tidy. Their precise action is | 6668 | backslashes in macros neat and tidy. Their precise action is |
| 6617 | customized with these variables: | 6669 | customized 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 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
| 6714 | Macros which needn't (or mustn't) be followed by a semicolon when you | ||
| 6715 | invoke them, @dfn{macros with semicolons}, are very common. These can | ||
| 6716 | cause @ccmode{} to parse the next line wrongly as a | ||
| 6717 | @code{statement-cont} (@pxref{Function Symbols}) and thus mis-indent | ||
| 6718 | it. | ||
| 6719 | |||
| 6720 | You can prevent this by specifying which macros have semicolons. It | ||
| 6721 | doesn'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-) | ||
| 6725 | This buffer-local variable specifies which macros have semicolons. | ||
| 6726 | After setting its value, you need to call | ||
| 6727 | @code{c-make-macro-with-semi-re} for it to take effect. It should be | ||
| 6728 | set to one of these values: | ||
| 6729 | |||
| 6730 | @table @asis | ||
| 6731 | @item nil | ||
| 6732 | There are no macros with semicolons. | ||
| 6733 | @item a list of strings | ||
| 6734 | Each string is the name of a macro with a semicolon. Only valid | ||
| 6735 | @code{#define} names are allowed here. For example, to set the | ||
| 6736 | default 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 | ||
| 6744 | This matches each symbol which is a macro with a semicolon. It must | ||
| 6745 | not match any string which isn't a valid @code{#define} name. For | ||
| 6746 | example: | ||
| 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-) | ||
| 6757 | Call this (non-interactive) function, which sets internal variables, | ||
| 6758 | each time you change the value of | ||
| 6759 | @code{c-macro-names-with-semicolon}. It takes no arguments, and its | ||
| 6760 | return value has no meaning. This function is called by @ccmode{}'s | ||
| 6761 | initialization 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/etc/ChangeLog b/etc/ChangeLog index bbb765ef58f..b494c8e3c96 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2011-10-29 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * themes/wombat-theme.el: Add a coding cookie. (Bug#9905) | ||
| 4 | |||
| 5 | 2011-10-29 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 6 | |||
| 7 | * NEWS: Document the disappearance of binding caches (bug#9899). | ||
| 8 | |||
| 1 | 2011-10-01 Juanma Barranquero <lekktu@gmail.com> | 9 | 2011-10-01 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 10 | ||
| 3 | * NEWS: Fix typo. Remove duplicate info. | 11 | * NEWS: Fix typo. Remove duplicate info. |
| @@ -967,6 +967,9 @@ has now been removed. | |||
| 967 | 967 | ||
| 968 | ** cl.el no longer provides `cl-19'. | 968 | ** cl.el no longer provides `cl-19'. |
| 969 | 969 | ||
| 970 | ** The menu bar bindings's caches are not used any more. | ||
| 971 | Use (where-is-internal <def> nil t) instead. | ||
| 972 | |||
| 970 | ** The following obsolete functions and aliases were removed: | 973 | ** The following obsolete functions and aliases were removed: |
| 971 | comint-kill-output, decompose-composite-char, outline-visible, | 974 | comint-kill-output, decompose-composite-char, outline-visible, |
| 972 | internal-find-face, internal-get-face, frame-update-faces, | 975 | internal-find-face, internal-get-face, frame-update-faces, |
diff --git a/etc/themes/wombat-theme.el b/etc/themes/wombat-theme.el index 6691b4a4016..894a2444ab5 100644 --- a/etc/themes/wombat-theme.el +++ b/etc/themes/wombat-theme.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; wombat-theme.el --- Custom face theme for Emacs | 1 | ;;; wombat-theme.el --- Custom face theme for Emacs -*-coding: utf-8 -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2011 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2011 Free Software Foundation, Inc. |
| 4 | 4 | ||
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6aa1bddb9f3..8309d3256bf 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,104 @@ | |||
| 1 | 2011-10-29 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * subr.el (y-or-n-p): Add code for batch mode (Bug#9818). | ||
| 4 | |||
| 5 | * mouse.el (mouse-yank-primary): Push the mark (Bug#9894). | ||
| 6 | |||
| 7 | * textmodes/flyspell.el (flyspell-word): Fix char offset for | ||
| 8 | forged Ispell output (Bug#7904). | ||
| 9 | |||
| 10 | * emacs-lisp/package.el (package-refresh-contents): Add autoload. | ||
| 11 | |||
| 12 | 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 13 | |||
| 14 | * doc-view.el: Avoid ugly errors about not finding nil. | ||
| 15 | (doc-view-ghostscript-program, doc-view-dvipdfm-program) | ||
| 16 | (doc-view-dvipdf-program, doc-view-unoconv-program) | ||
| 17 | (doc-view-ps2pdf-program, doc-view-pdftotext-program): | ||
| 18 | Avoid nil or absolute file name as default value. | ||
| 19 | (doc-view-pdf->txt, doc-view-ps->pdf): Use executable-find here. | ||
| 20 | |||
| 21 | 2011-10-28 Alan Mackenzie <acm@muc.de> | ||
| 22 | |||
| 23 | * progmodes/cc-defs.el (c-version). -> 5.32.2. | ||
| 24 | |||
| 25 | 2011-10-28 Alan Mackenzie <acm@muc.de> | ||
| 26 | |||
| 27 | Amend the handling of c-beginning/end-of-defun in nested declaration | ||
| 28 | scopes. | ||
| 29 | |||
| 30 | * progmodes/cc-vars.el (c-defun-tactic): Move here from | ||
| 31 | cc-langs.el. Change it to a defcustom. | ||
| 32 | |||
| 33 | * progmodes/cc-langs.el (c-defun-tactic): Move this variable to | ||
| 34 | cc-vars.el. | ||
| 35 | (c-nonlabel-token-2-key): New variable for change in cc-engine.el. | ||
| 36 | |||
| 37 | * progmodes/cc-engine.el (c-beginning-of-statement-1): | ||
| 38 | Prevent "class foo : bar" being spuriously recognized as a label. | ||
| 39 | |||
| 40 | * progmodes/cc-cmds.el (c-narrow-to-most-enclosing-decl-block): | ||
| 41 | Add parameter `inclusive' (to include enclosing braces in the | ||
| 42 | region). | ||
| 43 | (c-widen-to-enclosing-decl-scope): New function. | ||
| 44 | (c-while-widening-to-decl-block): New macro. | ||
| 45 | (c-beginning-of-defun, c-end-of-defun): Change algorithm to keep going | ||
| 46 | outward for defun boundaries, and correspondingly change symbol | ||
| 47 | `respect-enclosure' to `go-outward'. | ||
| 48 | (c-declaration-limits): Change algorithm to report only the "innermost" | ||
| 49 | defun's boundaries. | ||
| 50 | |||
| 51 | 2011-10-28 Deniz Dogan <deniz@dogan.se> | ||
| 52 | |||
| 53 | * net/rcirc.el (rcirc-mode): Use hard newlines. | ||
| 54 | |||
| 55 | 2011-10-28 Alan Mackenzie <acm@muc.de> | ||
| 56 | |||
| 57 | Amend to indent and fontify macros "which include their own semicolon" | ||
| 58 | correctly, using the "virtual semicolon" mechanism. | ||
| 59 | |||
| 60 | * progmodes/cc-defs.el: Update "virtual semicolon" comments. | ||
| 61 | |||
| 62 | * progmodes/cc-engine.el (c-crosses-statement-barrier-p): | ||
| 63 | Recoded to scan one line at at time rather than having \n and \r | ||
| 64 | explicitly in c-stmt-delim-chars | ||
| 65 | (for some modes, e.g. AWK). | ||
| 66 | (c-forward-label): Amend for virtual semicolons. | ||
| 67 | (c-at-macro-vsemi-p, c-macro-vsemi-status-unknown-p): New functions | ||
| 68 | |||
| 69 | * progmodes/cc-fonts.el (c-font-lock-declarations): Take account | ||
| 70 | of the new C macros. | ||
| 71 | |||
| 72 | * progmodes/cc-langs.el (c-at-vsemi-p-fn): | ||
| 73 | (c-vsemi-status-unknown-p-fn): move to earlier in the file. | ||
| 74 | (c-opt-cpp-symbol, c-line-comment-start-regexp): New language variables. | ||
| 75 | (c-opt-cpp-macro-define): Make into a full language variable. | ||
| 76 | (c-stmt-delim-chars, c-stmt-delim-chars-with-comma): Special value for | ||
| 77 | AWK Mode (including \n, \r) removed, no longer needed. | ||
| 78 | |||
| 79 | * progmodes/cc-mode.el (c-mode, c++-mode, objc-mode): | ||
| 80 | Invoke c-make-macro-with-semi-re. | ||
| 81 | |||
| 82 | * progmodes/cc-vars.el (c-macro-with-semi-re): | ||
| 83 | (c-macro-names-with-semicolon): New variables. | ||
| 84 | (c-make-macro-with-semi-re): New function | ||
| 85 | |||
| 86 | 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 87 | |||
| 88 | * vc/log-edit.el: Fill empty field rather than adding new one. | ||
| 89 | (log-edit-add-field): New function. | ||
| 90 | (log-edit-insert-changelog): Use it. | ||
| 91 | |||
| 92 | 2011-10-28 Mark Lillibridge <mark.lillibridge@hp.com> (tiny change) | ||
| 93 | |||
| 94 | * mail/rmail.el (rmail-mode-map): Add M-C-f as in rmailsum (bug#9802). | ||
| 95 | |||
| 96 | 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 97 | |||
| 98 | * progmodes/gdb-mi.el: Warn the user when -i=mi is missing. | ||
| 99 | (gdb--check-interpreter): New function. | ||
| 100 | (gdb): Use it. | ||
| 101 | |||
| 1 | 2011-10-27 Glenn Morris <rgm@gnu.org> | 102 | 2011-10-27 Glenn Morris <rgm@gnu.org> |
| 2 | 103 | ||
| 3 | * emacs-lisp/cl-extra.el (most-positive-float, most-negative-float) | 104 | * emacs-lisp/cl-extra.el (most-positive-float, most-negative-float) |
| @@ -21,8 +122,8 @@ | |||
| 21 | * subr.el (change-major-mode-after-body-hook): New hook. | 122 | * subr.el (change-major-mode-after-body-hook): New hook. |
| 22 | (run-mode-hooks): Run it. | 123 | (run-mode-hooks): Run it. |
| 23 | 124 | ||
| 24 | * emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Use | 125 | * emacs-lisp/easy-mmode.el (define-globalized-minor-mode): |
| 25 | change-major-mode-before-body-hook. | 126 | Use change-major-mode-before-body-hook. |
| 26 | 127 | ||
| 27 | * simple.el (fundamental-mode): | 128 | * simple.el (fundamental-mode): |
| 28 | * emacs-lisp/derived.el (define-derived-mode): Revert 2010-04-28 | 129 | * emacs-lisp/derived.el (define-derived-mode): Revert 2010-04-28 |
diff --git a/lisp/doc-view.el b/lisp/doc-view.el index ceaad83cd7c..d16d8c6f62d 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el | |||
| @@ -149,7 +149,7 @@ | |||
| 149 | :group 'multimedia | 149 | :group 'multimedia |
| 150 | :prefix "doc-view-") | 150 | :prefix "doc-view-") |
| 151 | 151 | ||
| 152 | (defcustom doc-view-ghostscript-program (executable-find "gs") | 152 | (defcustom doc-view-ghostscript-program "gs" |
| 153 | "Program to convert PS and PDF files to PNG." | 153 | "Program to convert PS and PDF files to PNG." |
| 154 | :type 'file | 154 | :type 'file |
| 155 | :group 'doc-view) | 155 | :group 'doc-view) |
| @@ -175,7 +175,7 @@ Has only an effect if imagemagick support is compiled into emacs." | |||
| 175 | :type 'number | 175 | :type 'number |
| 176 | :group 'doc-view) | 176 | :group 'doc-view) |
| 177 | 177 | ||
| 178 | (defcustom doc-view-dvipdfm-program (executable-find "dvipdfm") | 178 | (defcustom doc-view-dvipdfm-program "dvipdfm" |
| 179 | "Program to convert DVI files to PDF. | 179 | "Program to convert DVI files to PDF. |
| 180 | 180 | ||
| 181 | DVI file will be converted to PDF before the resulting PDF is | 181 | DVI file will be converted to PDF before the resulting PDF is |
| @@ -186,7 +186,7 @@ If this and `doc-view-dvipdf-program' are set, | |||
| 186 | :type 'file | 186 | :type 'file |
| 187 | :group 'doc-view) | 187 | :group 'doc-view) |
| 188 | 188 | ||
| 189 | (defcustom doc-view-dvipdf-program (executable-find "dvipdf") | 189 | (defcustom doc-view-dvipdf-program "dvipdf" |
| 190 | "Program to convert DVI files to PDF. | 190 | "Program to convert DVI files to PDF. |
| 191 | 191 | ||
| 192 | DVI file will be converted to PDF before the resulting PDF is | 192 | DVI file will be converted to PDF before the resulting PDF is |
| @@ -197,21 +197,21 @@ If this and `doc-view-dvipdfm-program' are set, | |||
| 197 | :type 'file | 197 | :type 'file |
| 198 | :group 'doc-view) | 198 | :group 'doc-view) |
| 199 | 199 | ||
| 200 | (defcustom doc-view-unoconv-program (executable-find "unoconv") | 200 | (defcustom doc-view-unoconv-program "unoconv" |
| 201 | "Program to convert any file type readable by OpenOffice.org to PDF. | 201 | "Program to convert any file type readable by OpenOffice.org to PDF. |
| 202 | 202 | ||
| 203 | Needed for viewing OpenOffice.org (and MS Office) files." | 203 | Needed for viewing OpenOffice.org (and MS Office) files." |
| 204 | :type 'file | 204 | :type 'file |
| 205 | :group 'doc-view) | 205 | :group 'doc-view) |
| 206 | 206 | ||
| 207 | (defcustom doc-view-ps2pdf-program (executable-find "ps2pdf") | 207 | (defcustom doc-view-ps2pdf-program "ps2pdf" |
| 208 | "Program to convert PS files to PDF. | 208 | "Program to convert PS files to PDF. |
| 209 | 209 | ||
| 210 | PS files will be converted to PDF before searching is possible." | 210 | PS files will be converted to PDF before searching is possible." |
| 211 | :type 'file | 211 | :type 'file |
| 212 | :group 'doc-view) | 212 | :group 'doc-view) |
| 213 | 213 | ||
| 214 | (defcustom doc-view-pdftotext-program (executable-find "pdftotext") | 214 | (defcustom doc-view-pdftotext-program "pdftotext" |
| 215 | "Program to convert PDF files to plain text. | 215 | "Program to convert PDF files to plain text. |
| 216 | 216 | ||
| 217 | Needed for searching." | 217 | Needed for searching." |
| @@ -881,7 +881,7 @@ Start by converting PAGES, and then the rest." | |||
| 881 | 881 | ||
| 882 | (defun doc-view-pdf->txt (pdf txt callback) | 882 | (defun doc-view-pdf->txt (pdf txt callback) |
| 883 | "Convert PDF to TXT asynchronously and call CALLBACK when finished." | 883 | "Convert PDF to TXT asynchronously and call CALLBACK when finished." |
| 884 | (or doc-view-pdftotext-program | 884 | (or (executable-find doc-view-pdftotext-program) |
| 885 | (error "You need the `pdftotext' program to convert a PDF to text")) | 885 | (error "You need the `pdftotext' program to convert a PDF to text")) |
| 886 | (doc-view-start-process "pdf->txt" doc-view-pdftotext-program | 886 | (doc-view-start-process "pdf->txt" doc-view-pdftotext-program |
| 887 | (list "-raw" pdf txt) | 887 | (list "-raw" pdf txt) |
| @@ -917,7 +917,7 @@ Start by converting PAGES, and then the rest." | |||
| 917 | 917 | ||
| 918 | (defun doc-view-ps->pdf (ps pdf callback) | 918 | (defun doc-view-ps->pdf (ps pdf callback) |
| 919 | "Convert PS to PDF asynchronously and call CALLBACK when finished." | 919 | "Convert PS to PDF asynchronously and call CALLBACK when finished." |
| 920 | (or doc-view-ps2pdf-program | 920 | (or (executable-find doc-view-ps2pdf-program) |
| 921 | (error "You need the `ps2pdf' program to convert PS to PDF")) | 921 | (error "You need the `ps2pdf' program to convert PS to PDF")) |
| 922 | (doc-view-start-process "ps->pdf" doc-view-ps2pdf-program | 922 | (doc-view-start-process "ps->pdf" doc-view-ps2pdf-program |
| 923 | (list | 923 | (list |
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. |
| 344 | This is simply -`most-negative-float'. | 344 | This is simply -`most-positive-float'. |
| 345 | Call `cl-float-limits' to set this.") | 345 | Call `cl-float-limits' to set this.") |
| 346 | 346 | ||
| 347 | (defconst least-positive-float nil | 347 | (defconst least-positive-float nil |
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 2e340a442a6..0bd37ce1d49 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el | |||
| @@ -1076,6 +1076,7 @@ similar to an entry in `package-alist'. Save the cached copy to | |||
| 1076 | (let ((version-control 'never)) | 1076 | (let ((version-control 'never)) |
| 1077 | (save-buffer)))))) | 1077 | (save-buffer)))))) |
| 1078 | 1078 | ||
| 1079 | ;;;###autoload | ||
| 1079 | (defun package-refresh-contents () | 1080 | (defun package-refresh-contents () |
| 1080 | "Download the ELPA archive description if needed. | 1081 | "Download the ELPA archive description if needed. |
| 1081 | This informs Emacs about the latest versions of all packages, and | 1082 | This informs Emacs about the latest versions of all packages, and |
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/mouse.el b/lisp/mouse.el index 9b1cf48ccdc..615062dc031 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el | |||
| @@ -1133,8 +1133,8 @@ regardless of where you click." | |||
| 1133 | 1133 | ||
| 1134 | (defun mouse-yank-primary (click) | 1134 | (defun mouse-yank-primary (click) |
| 1135 | "Insert the primary selection at the position clicked on. | 1135 | "Insert the primary selection at the position clicked on. |
| 1136 | Move point to the end of the inserted text. | 1136 | Move point to the end of the inserted text, and set mark at |
| 1137 | If `mouse-yank-at-point' is non-nil, insert at point | 1137 | beginning. If `mouse-yank-at-point' is non-nil, insert at point |
| 1138 | regardless of where you click." | 1138 | regardless of where you click." |
| 1139 | (interactive "e") | 1139 | (interactive "e") |
| 1140 | ;; Give temporary modes such as isearch a chance to turn off. | 1140 | ;; Give temporary modes such as isearch a chance to turn off. |
| @@ -1162,9 +1162,10 @@ regardless of where you click." | |||
| 1162 | ;; FIXME: What about xterm-mouse-mode etc.? | 1162 | ;; FIXME: What about xterm-mouse-mode etc.? |
| 1163 | (t | 1163 | (t |
| 1164 | (x-get-selection 'PRIMARY))))) | 1164 | (x-get-selection 'PRIMARY))))) |
| 1165 | (if primary | 1165 | (unless primary |
| 1166 | (insert primary) | 1166 | (error "No selection is available")) |
| 1167 | (error "No selection is available")))) | 1167 | (push-mark (point)) |
| 1168 | (insert primary))) | ||
| 1168 | 1169 | ||
| 1169 | (defun mouse-kill-ring-save (click) | 1170 | (defun mouse-kill-ring-save (click) |
| 1170 | "Copy the region between point and the mouse click in the kill ring. | 1171 | "Copy the region between point and the mouse click in the kill ring. |
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. |
| 1490 | Every top level declaration that contains a brace paren block is | 1562 | Every 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 | ||
| 1150 | Note that this function might do hidden buffer changes. See the | 1155 | Note that this function might do hidden buffer changes. See the |
| 1151 | comment at the start of cc-engine.el for more info." | 1156 | comment 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?\". | ||
| 515 | Such a function takes one optional parameter, a buffer position (defaults to | ||
| 516 | point), and returns nil or t. This variable contains nil for languages which | ||
| 517 | don'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?\". | ||
| 525 | The (admittedly kludgey) purpose of such a function is to prevent an infinite | ||
| 526 | recursion in c-beginning-of-statement-1 when point starts at a `while' token. | ||
| 527 | The function MUST NOT UNDER ANY CIRCUMSTANCES call c-beginning-of-statement-1, | ||
| 528 | even indirectly. This variable contains nil for languages which don't have | ||
| 529 | EOL 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 |
| 742 | normally use that macro preprocessor. Tested at bol or at boi. | 773 | normally use that macro preprocessor. Tested at bol or at boi. |
| @@ -785,6 +816,8 @@ file name in angle brackets or quotes." | |||
| 785 | definition, or nil if the language doesn't have any." | 816 | definition, 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?\". | ||
| 1481 | Such a function takes one optional parameter, a buffer position (defaults to | ||
| 1482 | point), and returns nil or t. This variable contains nil for languages which | ||
| 1483 | don'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?\". | ||
| 1490 | The (admittedly kludgey) purpose of such a function is to prevent an infinite | ||
| 1491 | recursion in c-beginning-of-statement-1 when point starts at a `while' token. | ||
| 1492 | The function MUST NOT UNDER ANY CIRCUMSTANCES call c-beginning-of-statement-1, | ||
| 1493 | even indirectly. This variable contains nil for languages which don't have | ||
| 1494 | EOL 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. | ||
| 345 | This is used by `c-beginning-of-defun' and like functions. | ||
| 346 | |||
| 347 | Its 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. |
| 345 | Can contain an integer or a cons cell of the form: | 359 | Can 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 \ | ||
| 1652 | c-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. | ||
| 1658 | Alternatively it can be a string, a regular expression which | ||
| 1659 | matches all such symbols. | ||
| 1660 | |||
| 1661 | The \"symbols\" must be syntactically valid identifiers in the | ||
| 1662 | target language \(C, C++, Objective C), or \(as the case may be) | ||
| 1663 | the regular expression must match only valid identifiers. | ||
| 1664 | |||
| 1665 | If you change this variable's value, call the function | ||
| 1666 | `c-make-macros-with-semi-re' to set the necessary internal | ||
| 1667 | variables. | ||
| 1668 | |||
| 1669 | Note that currently \(2008-11-04) this variable is a prototype, | ||
| 1670 | and 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. |
| 1613 | In a file's Local Variable section, you can set this variable to a | 1675 | In 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/subr.el b/lisp/subr.el index f3cd4dabe20..50ea49bd8c9 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -2262,11 +2262,25 @@ is nil and `use-dialog-box' is non-nil." | |||
| 2262 | ;; where all the keys were unbound (i.e. it somehow got triggered | 2262 | ;; where all the keys were unbound (i.e. it somehow got triggered |
| 2263 | ;; within read-key, apparently). I had to kill it. | 2263 | ;; within read-key, apparently). I had to kill it. |
| 2264 | (let ((answer 'recenter)) | 2264 | (let ((answer 'recenter)) |
| 2265 | (if (and (display-popup-menus-p) | 2265 | (cond |
| 2266 | (listp last-nonmenu-event) | 2266 | (noninteractive |
| 2267 | use-dialog-box) | 2267 | (setq prompt (concat prompt |
| 2268 | (setq answer | 2268 | (if (eq ?\s (aref prompt (1- (length prompt)))) |
| 2269 | (x-popup-dialog t `(,prompt ("Yes" . act) ("No" . skip)))) | 2269 | "" " ") |
| 2270 | "(y or n) ")) | ||
| 2271 | (let ((temp-prompt prompt)) | ||
| 2272 | (while (not (memq answer '(act skip))) | ||
| 2273 | (let ((str (read-string temp-prompt))) | ||
| 2274 | (cond ((member str '("y" "Y")) (setq answer 'act)) | ||
| 2275 | ((member str '("n" "N")) (setq answer 'skip)) | ||
| 2276 | (t (setq temp-prompt (concat "Please answer y or n. " | ||
| 2277 | prompt)))))))) | ||
| 2278 | ((and (display-popup-menus-p) | ||
| 2279 | (listp last-nonmenu-event) | ||
| 2280 | use-dialog-box) | ||
| 2281 | (setq answer | ||
| 2282 | (x-popup-dialog t `(,prompt ("Yes" . act) ("No" . skip))))) | ||
| 2283 | (t | ||
| 2270 | (setq prompt (concat prompt | 2284 | (setq prompt (concat prompt |
| 2271 | (if (eq ?\s (aref prompt (1- (length prompt)))) | 2285 | (if (eq ?\s (aref prompt (1- (length prompt)))) |
| 2272 | "" " ") | 2286 | "" " ") |
| @@ -2288,7 +2302,7 @@ is nil and `use-dialog-box' is non-nil." | |||
| 2288 | ((memq answer '(exit-prefix quit)) (signal 'quit nil) t) | 2302 | ((memq answer '(exit-prefix quit)) (signal 'quit nil) t) |
| 2289 | (t t))) | 2303 | (t t))) |
| 2290 | (ding) | 2304 | (ding) |
| 2291 | (discard-input))) | 2305 | (discard-input)))) |
| 2292 | (let ((ret (eq answer 'act))) | 2306 | (let ((ret (eq answer 'act))) |
| 2293 | (unless noninteractive | 2307 | (unless noninteractive |
| 2294 | (message "%s %s" prompt (if ret "y" "n"))) | 2308 | (message "%s %s" prompt (if ret "y" "n"))) |
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index 4a57d00d702..a5099311307 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el | |||
| @@ -1121,7 +1121,7 @@ misspelling and skips redundant spell-checking step." | |||
| 1121 | (setq poss (ispell-parse-output (car ispell-filter))))) | 1121 | (setq poss (ispell-parse-output (car ispell-filter))))) |
| 1122 | ;; Else, this was a known misspelling to begin with, and | 1122 | ;; Else, this was a known misspelling to begin with, and |
| 1123 | ;; we should forge an ispell return value. | 1123 | ;; we should forge an ispell return value. |
| 1124 | (setq poss (list word 0 '() '()))) | 1124 | (setq poss (list word 1 nil nil))) |
| 1125 | (let ((res (cond ((eq poss t) | 1125 | (let ((res (cond ((eq poss t) |
| 1126 | ;; correct | 1126 | ;; correct |
| 1127 | (setq flyspell-word-cache-result t) | 1127 | (setq flyspell-word-cache-result t) |
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. |
| 598 | The idea is to write your ChangeLog entries first, and then use this | 605 | The 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 @@ | |||
| 1 | 2011-10-28 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * README.W32: Mention UNICOWS.DLL as prerequisite for running | ||
| 4 | Emacs on Windows 9X. | ||
| 5 | |||
| 1 | 2011-10-25 Eli Zaretskii <eliz@gnu.org> | 6 | 2011-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/.gdbinit b/src/.gdbinit index b908ef005d6..80415abe40d 100644 --- a/src/.gdbinit +++ b/src/.gdbinit | |||
| @@ -1245,20 +1245,36 @@ document xbacktrace | |||
| 1245 | an error was signaled. | 1245 | an error was signaled. |
| 1246 | end | 1246 | end |
| 1247 | 1247 | ||
| 1248 | define which | 1248 | define xprintbytestr |
| 1249 | set debug_print (which_symbols ($arg0)) | 1249 | set $data = (char *) $arg0->data |
| 1250 | printf "Bytecode: " | ||
| 1251 | output/u ($arg0->size > 1000) ? 0 : ($data[0])@($arg0->size_byte < 0 ? $arg0->size & ~gdb_array_mark_flag : $arg0->size_byte) | ||
| 1252 | end | ||
| 1253 | document xprintbytestr | ||
| 1254 | Print a string of byte code. | ||
| 1255 | end | ||
| 1256 | |||
| 1257 | define xwhichsymbols | ||
| 1258 | set $output_debug = print_output_debug_flag | ||
| 1259 | set print_output_debug_flag = 0 | ||
| 1260 | set safe_debug_print (which_symbols ($arg0, $arg1)) | ||
| 1261 | set print_output_debug_flag = $output_debug | ||
| 1250 | end | 1262 | end |
| 1251 | document which | 1263 | document xwhichsymbols |
| 1252 | Print symbols which references a given lisp object | 1264 | Print symbols which references a given lisp object |
| 1253 | either as its symbol value or symbol function. | 1265 | either as its symbol value or symbol function. |
| 1266 | Call with two arguments: the lisp object and the | ||
| 1267 | maximum number of symbols referencing it to produce. | ||
| 1254 | end | 1268 | end |
| 1255 | 1269 | ||
| 1256 | define xbytecode | 1270 | define xbytecode |
| 1257 | set $bt = byte_stack_list | 1271 | set $bt = byte_stack_list |
| 1258 | while $bt | 1272 | while $bt |
| 1259 | xgettype ($bt->byte_string) | 1273 | xgetptr $bt->byte_string |
| 1260 | printf "0x%x => ", $bt->byte_string | 1274 | set $ptr = (struct Lisp_String *) $ptr |
| 1261 | which $bt->byte_string | 1275 | xprintbytestr $ptr |
| 1276 | printf "\n0x%x => ", $bt->byte_string | ||
| 1277 | xwhichsymbols $bt->byte_string 5 | ||
| 1262 | set $bt = $bt->next | 1278 | set $bt = $bt->next |
| 1263 | end | 1279 | end |
| 1264 | end | 1280 | end |
diff --git a/src/ChangeLog b/src/ChangeLog index a13039896dd..272354c48d1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | 2011-10-27 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2011-10-29 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | Fix integer width and related bugs (Bug#9874). | 3 | Fix integer width and related bugs (Bug#9874). |
| 4 | * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp): | 4 | * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp): |
| @@ -786,6 +786,80 @@ | |||
| 786 | rather than rolling our own approximation. | 786 | rather than rolling our own approximation. |
| 787 | (SCROLL_BAR_VEC_SIZE): Remove; not used. | 787 | (SCROLL_BAR_VEC_SIZE): Remove; not used. |
| 788 | 788 | ||
| 789 | 2011-10-29 Paul Eggert <eggert@cs.ucla.edu> | ||
| 790 | |||
| 791 | * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE, | ||
| 792 | so that this new function doesn't get optimized away by a | ||
| 793 | whole-program optimizer. Make the 2nd arg EMACS_INT, not int. | ||
| 794 | |||
| 795 | 2011-10-29 Andreas Schwab <schwab@linux-m68k.org> | ||
| 796 | |||
| 797 | * frame.h (MOUSE_HL_INFO): Remove excess parens. | ||
| 798 | |||
| 799 | 2011-10-29 Eli Zaretskii <eliz@gnu.org> | ||
| 800 | |||
| 801 | Fix the `xbytecode' command. | ||
| 802 | * .gdbinit (xprintbytestr): New command. | ||
| 803 | (xwhichsymbols): Renamed from `which'; all callers changed. | ||
| 804 | (xbytecode): Print the byte-code string as well. | ||
| 805 | |||
| 806 | 2011-10-29 Kim Storm <storm@cua.dk> | ||
| 807 | |||
| 808 | * alloc.c (which_symbols): New function. | ||
| 809 | |||
| 810 | 2011-10-29 Andreas Schwab <schwab@linux-m68k.org> | ||
| 811 | |||
| 812 | * minibuf.c (read_minibuf_noninteractive): Allow reading empty | ||
| 813 | line. (Bug#9903) | ||
| 814 | |||
| 815 | 2011-10-29 Glenn Morris <rgm@gnu.org> | ||
| 816 | |||
| 817 | * process.c (wait_reading_process_output): Revert 2009-08-30 change. | ||
| 818 | Not clear what it was for, and it causes various bugs. (Bug#9839) | ||
| 819 | |||
| 820 | 2011-10-28 Eli Zaretskii <eliz@gnu.org> | ||
| 821 | |||
| 822 | * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a | ||
| 823 | possible random value that matches one of those tested as | ||
| 824 | condition to clear the mouse face. | ||
| 825 | |||
| 826 | 2011-10-28 Chong Yidong <cyd@gnu.org> | ||
| 827 | |||
| 828 | * xdisp.c (note_mouse_highlight): Fix use of uninitialized var. | ||
| 829 | |||
| 830 | 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 831 | |||
| 832 | * window.c (make_window): Initialize phys_cursor_on_p. | ||
| 833 | |||
| 834 | 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 835 | |||
| 836 | * lisp.h (struct Lisp_Symbol): Update comments. | ||
| 837 | |||
| 838 | 2011-10-28 Juanma Barranquero <lekktu@gmail.com> | ||
| 839 | |||
| 840 | * w32font.c (w32_load_unicows_or_gdi32): Add missing return. | ||
| 841 | |||
| 842 | 2011-10-28 Eli Zaretskii <eliz@gnu.org> | ||
| 843 | |||
| 844 | Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem | ||
| 845 | <oslsachem@gmail.com> for helping to debug this. | ||
| 846 | |||
| 847 | * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w) | ||
| 848 | (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w) | ||
| 849 | (g_b_init_get_glyph_outline_w): New static variables. | ||
| 850 | (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc) | ||
| 851 | (GetGlyphOutlineW_Proc): New typedefs. | ||
| 852 | (w32_load_unicows_or_gdi32, get_outline_metrics_w) | ||
| 853 | (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font): | ||
| 854 | New functions. | ||
| 855 | (w32font_open_internal, compute_metrics): | ||
| 856 | Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w | ||
| 857 | instead of calling the "wide" APIs directly. | ||
| 858 | |||
| 859 | * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font. | ||
| 860 | |||
| 861 | * w32.h (syms_of_w32font): Add prototype. | ||
| 862 | |||
| 789 | 2011-10-27 Juanma Barranquero <lekktu@gmail.com> | 863 | 2011-10-27 Juanma Barranquero <lekktu@gmail.com> |
| 790 | 864 | ||
| 791 | * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end) | 865 | * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end) |
| @@ -806,8 +880,8 @@ | |||
| 806 | 880 | ||
| 807 | 2011-10-27 Chong Yidong <cyd@gnu.org> | 881 | 2011-10-27 Chong Yidong <cyd@gnu.org> |
| 808 | 882 | ||
| 809 | * gnutls.c (emacs_gnutls_deinit): New function. Deallocate | 883 | * gnutls.c (emacs_gnutls_deinit): New function. |
| 810 | credentials structures as well as calling gnutls_deinit. | 884 | Deallocate credentials structures as well as calling gnutls_deinit. |
| 811 | (Fgnutls_deinit, Fgnutls_boot): Use it. | 885 | (Fgnutls_deinit, Fgnutls_boot): Use it. |
| 812 | 886 | ||
| 813 | * process.c (make_process): Initialize GnuTLS credentials to NULL. | 887 | * process.c (make_process): Initialize GnuTLS credentials to NULL. |
diff --git a/src/alloc.c b/src/alloc.c index ee49a2dfb2e..86127dd5197 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -279,6 +279,7 @@ static void compact_small_strings (void); | |||
| 279 | static void free_large_strings (void); | 279 | static void free_large_strings (void); |
| 280 | static void sweep_strings (void); | 280 | static void sweep_strings (void); |
| 281 | static void free_misc (Lisp_Object); | 281 | static void free_misc (Lisp_Object); |
| 282 | extern Lisp_Object which_symbols (Lisp_Object, EMACS_INT) EXTERNALLY_VISIBLE; | ||
| 282 | 283 | ||
| 283 | /* When scanning the C stack for live Lisp objects, Emacs keeps track | 284 | /* When scanning the C stack for live Lisp objects, Emacs keeps track |
| 284 | of what memory allocated via lisp_malloc is intended for what | 285 | of what memory allocated via lisp_malloc is intended for what |
| @@ -6251,6 +6252,55 @@ Frames, windows, buffers, and subprocesses count as vectors | |||
| 6251 | return Flist (8, consed); | 6252 | return Flist (8, consed); |
| 6252 | } | 6253 | } |
| 6253 | 6254 | ||
| 6255 | /* Find at most FIND_MAX symbols which have OBJ as their value or | ||
| 6256 | function. This is used in gdbinit's `xwhichsymbols' command. */ | ||
| 6257 | |||
| 6258 | Lisp_Object | ||
| 6259 | which_symbols (Lisp_Object obj, EMACS_INT find_max) | ||
| 6260 | { | ||
| 6261 | struct symbol_block *sblk; | ||
| 6262 | ptrdiff_t gc_count = inhibit_garbage_collection (); | ||
| 6263 | Lisp_Object found = Qnil; | ||
| 6264 | |||
| 6265 | if (!EQ (obj, Vdead)) | ||
| 6266 | { | ||
| 6267 | for (sblk = symbol_block; sblk; sblk = sblk->next) | ||
| 6268 | { | ||
| 6269 | struct Lisp_Symbol *sym = sblk->symbols; | ||
| 6270 | int bn; | ||
| 6271 | |||
| 6272 | for (bn = 0; bn < SYMBOL_BLOCK_SIZE; bn++, sym++) | ||
| 6273 | { | ||
| 6274 | Lisp_Object val; | ||
| 6275 | Lisp_Object tem; | ||
| 6276 | |||
| 6277 | if (sblk == symbol_block && bn >= symbol_block_index) | ||
| 6278 | break; | ||
| 6279 | |||
| 6280 | XSETSYMBOL (tem, sym); | ||
| 6281 | val = find_symbol_value (tem); | ||
| 6282 | if (EQ (val, obj) | ||
| 6283 | || EQ (sym->function, obj) | ||
| 6284 | || (!NILP (sym->function) | ||
| 6285 | && COMPILEDP (sym->function) | ||
| 6286 | && EQ (AREF (sym->function, COMPILED_BYTECODE), obj)) | ||
| 6287 | || (!NILP (val) | ||
| 6288 | && COMPILEDP (val) | ||
| 6289 | && EQ (AREF (val, COMPILED_BYTECODE), obj))) | ||
| 6290 | { | ||
| 6291 | found = Fcons (tem, found); | ||
| 6292 | if (--find_max == 0) | ||
| 6293 | goto out; | ||
| 6294 | } | ||
| 6295 | } | ||
| 6296 | } | ||
| 6297 | } | ||
| 6298 | |||
| 6299 | out: | ||
| 6300 | unbind_to (gc_count, Qnil); | ||
| 6301 | return found; | ||
| 6302 | } | ||
| 6303 | |||
| 6254 | #ifdef ENABLE_CHECKING | 6304 | #ifdef ENABLE_CHECKING |
| 6255 | int suppress_checking; | 6305 | int suppress_checking; |
| 6256 | 6306 | ||
diff --git a/src/emacs.c b/src/emacs.c index 0f7aa94c24f..5f3d126e13e 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -1591,6 +1591,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem | |||
| 1591 | /* Initialization that must be done even if the global variable | 1591 | /* Initialization that must be done even if the global variable |
| 1592 | initialized is non zero. */ | 1592 | initialized is non zero. */ |
| 1593 | #ifdef HAVE_NTGUI | 1593 | #ifdef HAVE_NTGUI |
| 1594 | globals_of_w32font (); | ||
| 1594 | globals_of_w32fns (); | 1595 | globals_of_w32fns (); |
| 1595 | globals_of_w32menu (); | 1596 | globals_of_w32menu (); |
| 1596 | globals_of_w32select (); | 1597 | globals_of_w32select (); |
diff --git a/src/frame.h b/src/frame.h index 3d2b8208ddd..574da5c3b52 100644 --- a/src/frame.h +++ b/src/frame.h | |||
| @@ -538,12 +538,12 @@ typedef struct frame *FRAME_PTR; | |||
| 538 | does not have FRAME_X_DISPLAY_INFO. */ | 538 | does not have FRAME_X_DISPLAY_INFO. */ |
| 539 | #ifdef HAVE_WINDOW_SYSTEM | 539 | #ifdef HAVE_WINDOW_SYSTEM |
| 540 | # define MOUSE_HL_INFO(F) \ | 540 | # define MOUSE_HL_INFO(F) \ |
| 541 | (FRAME_WINDOW_P(F) \ | 541 | (FRAME_WINDOW_P(F) \ |
| 542 | ? &(FRAME_X_DISPLAY_INFO(F)->mouse_highlight) \ | 542 | ? &FRAME_X_DISPLAY_INFO(F)->mouse_highlight \ |
| 543 | : &(((F)->output_data.tty->display_info)->mouse_highlight)) | 543 | : &(F)->output_data.tty->display_info->mouse_highlight) |
| 544 | #else | 544 | #else |
| 545 | # define MOUSE_HL_INFO(F) \ | 545 | # define MOUSE_HL_INFO(F) \ |
| 546 | (&(((F)->output_data.tty->display_info)->mouse_highlight)) | 546 | (&(F)->output_data.tty->display_info->mouse_highlight) |
| 547 | #endif | 547 | #endif |
| 548 | 548 | ||
| 549 | /* Nonzero if frame F is still alive (not deleted). */ | 549 | /* Nonzero if frame F is still alive (not deleted). */ |
| @@ -594,7 +594,7 @@ typedef struct frame *FRAME_PTR; | |||
| 594 | /* Lines above the top-most window in frame F. */ | 594 | /* Lines above the top-most window in frame F. */ |
| 595 | 595 | ||
| 596 | #define FRAME_TOP_MARGIN(F) \ | 596 | #define FRAME_TOP_MARGIN(F) \ |
| 597 | (FRAME_MENU_BAR_LINES (F) + FRAME_TOOL_BAR_LINES (F)) | 597 | (FRAME_MENU_BAR_LINES (F) + FRAME_TOOL_BAR_LINES (F)) |
| 598 | 598 | ||
| 599 | /* Pixel height of the top margin above. */ | 599 | /* Pixel height of the top margin above. */ |
| 600 | 600 | ||
| @@ -659,11 +659,11 @@ typedef struct frame *FRAME_PTR; | |||
| 659 | and which side they are on. */ | 659 | and which side they are on. */ |
| 660 | #define FRAME_VERTICAL_SCROLL_BAR_TYPE(f) ((f)->vertical_scroll_bar_type) | 660 | #define FRAME_VERTICAL_SCROLL_BAR_TYPE(f) ((f)->vertical_scroll_bar_type) |
| 661 | #define FRAME_HAS_VERTICAL_SCROLL_BARS(f) \ | 661 | #define FRAME_HAS_VERTICAL_SCROLL_BARS(f) \ |
| 662 | ((f)->vertical_scroll_bar_type != vertical_scroll_bar_none) | 662 | ((f)->vertical_scroll_bar_type != vertical_scroll_bar_none) |
| 663 | #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT(f) \ | 663 | #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT(f) \ |
| 664 | ((f)->vertical_scroll_bar_type == vertical_scroll_bar_left) | 664 | ((f)->vertical_scroll_bar_type == vertical_scroll_bar_left) |
| 665 | #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT(f) \ | 665 | #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT(f) \ |
| 666 | ((f)->vertical_scroll_bar_type == vertical_scroll_bar_right) | 666 | ((f)->vertical_scroll_bar_type == vertical_scroll_bar_right) |
| 667 | 667 | ||
| 668 | /* Width that a scroll bar in frame F should have, if there is one. | 668 | /* Width that a scroll bar in frame F should have, if there is one. |
| 669 | Measured in pixels. | 669 | Measured in pixels. |
| @@ -680,13 +680,13 @@ typedef struct frame *FRAME_PTR; | |||
| 680 | the right in this frame, or there are no scroll bars, value is 0. */ | 680 | the right in this frame, or there are no scroll bars, value is 0. */ |
| 681 | 681 | ||
| 682 | #define FRAME_LEFT_SCROLL_BAR_COLS(f) \ | 682 | #define FRAME_LEFT_SCROLL_BAR_COLS(f) \ |
| 683 | (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f) \ | 683 | (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f) \ |
| 684 | ? FRAME_CONFIG_SCROLL_BAR_COLS (f) \ | 684 | ? FRAME_CONFIG_SCROLL_BAR_COLS (f) \ |
| 685 | : 0) | 685 | : 0) |
| 686 | 686 | ||
| 687 | /* Width of a left scroll bar in frame F, measured in pixels */ | 687 | /* Width of a left scroll bar in frame F, measured in pixels */ |
| 688 | 688 | ||
| 689 | #define FRAME_LEFT_SCROLL_BAR_AREA_WIDTH(f) \ | 689 | #define FRAME_LEFT_SCROLL_BAR_AREA_WIDTH(f) \ |
| 690 | (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f) \ | 690 | (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f) \ |
| 691 | ? (FRAME_CONFIG_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f)) \ | 691 | ? (FRAME_CONFIG_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f)) \ |
| 692 | : 0) | 692 | : 0) |
| @@ -696,13 +696,13 @@ typedef struct frame *FRAME_PTR; | |||
| 696 | the left in this frame, or there are no scroll bars, value is 0. */ | 696 | the left in this frame, or there are no scroll bars, value is 0. */ |
| 697 | 697 | ||
| 698 | #define FRAME_RIGHT_SCROLL_BAR_COLS(f) \ | 698 | #define FRAME_RIGHT_SCROLL_BAR_COLS(f) \ |
| 699 | (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f) \ | 699 | (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f) \ |
| 700 | ? FRAME_CONFIG_SCROLL_BAR_COLS (f) \ | 700 | ? FRAME_CONFIG_SCROLL_BAR_COLS (f) \ |
| 701 | : 0) | 701 | : 0) |
| 702 | 702 | ||
| 703 | /* Width of a right scroll bar area in frame F, measured in pixels */ | 703 | /* Width of a right scroll bar area in frame F, measured in pixels */ |
| 704 | 704 | ||
| 705 | #define FRAME_RIGHT_SCROLL_BAR_AREA_WIDTH(f) \ | 705 | #define FRAME_RIGHT_SCROLL_BAR_AREA_WIDTH(f) \ |
| 706 | (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f) \ | 706 | (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f) \ |
| 707 | ? (FRAME_CONFIG_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f)) \ | 707 | ? (FRAME_CONFIG_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f)) \ |
| 708 | : 0) | 708 | : 0) |
| @@ -710,9 +710,9 @@ typedef struct frame *FRAME_PTR; | |||
| 710 | /* Actual width of a scroll bar in frame F, measured in columns. */ | 710 | /* Actual width of a scroll bar in frame F, measured in columns. */ |
| 711 | 711 | ||
| 712 | #define FRAME_SCROLL_BAR_COLS(f) \ | 712 | #define FRAME_SCROLL_BAR_COLS(f) \ |
| 713 | (FRAME_HAS_VERTICAL_SCROLL_BARS (f) \ | 713 | (FRAME_HAS_VERTICAL_SCROLL_BARS (f) \ |
| 714 | ? FRAME_CONFIG_SCROLL_BAR_COLS (f) \ | 714 | ? FRAME_CONFIG_SCROLL_BAR_COLS (f) \ |
| 715 | : 0) | 715 | : 0) |
| 716 | 716 | ||
| 717 | /* Actual width of a scroll bar area in frame F, measured in pixels. */ | 717 | /* Actual width of a scroll bar area in frame F, measured in pixels. */ |
| 718 | 718 | ||
| @@ -731,21 +731,21 @@ typedef struct frame *FRAME_PTR; | |||
| 731 | not including scroll bars and fringes. */ | 731 | not including scroll bars and fringes. */ |
| 732 | 732 | ||
| 733 | #define SET_FRAME_COLS(f, val) \ | 733 | #define SET_FRAME_COLS(f, val) \ |
| 734 | (FRAME_COLS (f) = (val), \ | 734 | (FRAME_COLS (f) = (val), \ |
| 735 | (f)->total_cols = FRAME_TOTAL_COLS_ARG (f, FRAME_COLS (f))) | 735 | (f)->total_cols = FRAME_TOTAL_COLS_ARG (f, FRAME_COLS (f))) |
| 736 | 736 | ||
| 737 | /* Given a value WIDTH for frame F's nominal width, | 737 | /* Given a value WIDTH for frame F's nominal width, |
| 738 | return the value that FRAME_TOTAL_COLS should have. */ | 738 | return the value that FRAME_TOTAL_COLS should have. */ |
| 739 | 739 | ||
| 740 | #define FRAME_TOTAL_COLS_ARG(f, width) \ | 740 | #define FRAME_TOTAL_COLS_ARG(f, width) \ |
| 741 | ((width) \ | 741 | ((width) \ |
| 742 | + FRAME_SCROLL_BAR_COLS (f) \ | 742 | + FRAME_SCROLL_BAR_COLS (f) \ |
| 743 | + FRAME_FRINGE_COLS (f)) | 743 | + FRAME_FRINGE_COLS (f)) |
| 744 | 744 | ||
| 745 | /* Maximum + 1 legitimate value for FRAME_CURSOR_X. */ | 745 | /* Maximum + 1 legitimate value for FRAME_CURSOR_X. */ |
| 746 | 746 | ||
| 747 | #define FRAME_CURSOR_X_LIMIT(f) \ | 747 | #define FRAME_CURSOR_X_LIMIT(f) \ |
| 748 | (FRAME_COLS (f) + FRAME_LEFT_SCROLL_BAR_COLS (f)) | 748 | (FRAME_COLS (f) + FRAME_LEFT_SCROLL_BAR_COLS (f)) |
| 749 | 749 | ||
| 750 | /* Nonzero if frame F has scroll bars. */ | 750 | /* Nonzero if frame F has scroll bars. */ |
| 751 | 751 | ||
| @@ -938,18 +938,18 @@ extern Lisp_Object selected_frame; | |||
| 938 | float. Value is a C integer. */ | 938 | float. Value is a C integer. */ |
| 939 | 939 | ||
| 940 | #define FRAME_PIXEL_X_FROM_CANON_X(F, X) \ | 940 | #define FRAME_PIXEL_X_FROM_CANON_X(F, X) \ |
| 941 | (INTEGERP (X) \ | 941 | (INTEGERP (X) \ |
| 942 | ? XINT (X) * FRAME_COLUMN_WIDTH (F) \ | 942 | ? XINT (X) * FRAME_COLUMN_WIDTH (F) \ |
| 943 | : (int) (XFLOAT_DATA (X) * FRAME_COLUMN_WIDTH (F))) | 943 | : (int) (XFLOAT_DATA (X) * FRAME_COLUMN_WIDTH (F))) |
| 944 | 944 | ||
| 945 | /* Convert canonical value Y to pixels. F is the frame whose | 945 | /* Convert canonical value Y to pixels. F is the frame whose |
| 946 | canonical character height is to be used. X must be a Lisp integer | 946 | canonical character height is to be used. X must be a Lisp integer |
| 947 | or float. Value is a C integer. */ | 947 | or float. Value is a C integer. */ |
| 948 | 948 | ||
| 949 | #define FRAME_PIXEL_Y_FROM_CANON_Y(F, Y) \ | 949 | #define FRAME_PIXEL_Y_FROM_CANON_Y(F, Y) \ |
| 950 | (INTEGERP (Y) \ | 950 | (INTEGERP (Y) \ |
| 951 | ? XINT (Y) * FRAME_LINE_HEIGHT (F) \ | 951 | ? XINT (Y) * FRAME_LINE_HEIGHT (F) \ |
| 952 | : (int) (XFLOAT_DATA (Y) * FRAME_LINE_HEIGHT (F))) | 952 | : (int) (XFLOAT_DATA (Y) * FRAME_LINE_HEIGHT (F))) |
| 953 | 953 | ||
| 954 | /* Convert pixel-value X to canonical units. F is the frame whose | 954 | /* Convert pixel-value X to canonical units. F is the frame whose |
| 955 | canonical character width is to be used. X is a C integer. Result | 955 | canonical character width is to be used. X is a C integer. Result |
| @@ -957,9 +957,9 @@ extern Lisp_Object selected_frame; | |||
| 957 | otherwise it's a Lisp integer. */ | 957 | otherwise it's a Lisp integer. */ |
| 958 | 958 | ||
| 959 | #define FRAME_CANON_X_FROM_PIXEL_X(F, X) \ | 959 | #define FRAME_CANON_X_FROM_PIXEL_X(F, X) \ |
| 960 | ((X) % FRAME_COLUMN_WIDTH (F) != 0 \ | 960 | ((X) % FRAME_COLUMN_WIDTH (F) != 0 \ |
| 961 | ? make_float ((double) (X) / FRAME_COLUMN_WIDTH (F)) \ | 961 | ? make_float ((double) (X) / FRAME_COLUMN_WIDTH (F)) \ |
| 962 | : make_number ((X) / FRAME_COLUMN_WIDTH (F))) | 962 | : make_number ((X) / FRAME_COLUMN_WIDTH (F))) |
| 963 | 963 | ||
| 964 | /* Convert pixel-value Y to canonical units. F is the frame whose | 964 | /* Convert pixel-value Y to canonical units. F is the frame whose |
| 965 | canonical character height is to be used. Y is a C integer. | 965 | canonical character height is to be used. Y is a C integer. |
| @@ -967,9 +967,9 @@ extern Lisp_Object selected_frame; | |||
| 967 | otherwise it's a Lisp integer. */ | 967 | otherwise it's a Lisp integer. */ |
| 968 | 968 | ||
| 969 | #define FRAME_CANON_Y_FROM_PIXEL_Y(F, Y) \ | 969 | #define FRAME_CANON_Y_FROM_PIXEL_Y(F, Y) \ |
| 970 | ((Y) % FRAME_LINE_HEIGHT (F) \ | 970 | ((Y) % FRAME_LINE_HEIGHT (F) \ |
| 971 | ? make_float ((double) (Y) / FRAME_LINE_HEIGHT (F)) \ | 971 | ? make_float ((double) (Y) / FRAME_LINE_HEIGHT (F)) \ |
| 972 | : make_number ((Y) / FRAME_LINE_HEIGHT (F))) | 972 | : make_number ((Y) / FRAME_LINE_HEIGHT (F))) |
| 973 | 973 | ||
| 974 | 974 | ||
| 975 | 975 | ||
diff --git a/src/keyboard.c b/src/keyboard.c index f5a3ef07829..239028c8bad 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. */ |
| 79 | volatile int interrupt_input_blocked; | 79 | volatile int interrupt_input_blocked; |
| @@ -338,7 +338,7 @@ static Lisp_Object Qconfig_changed_event; | |||
| 338 | Lisp_Object Qevent_kind; | 338 | Lisp_Object Qevent_kind; |
| 339 | static Lisp_Object Qevent_symbol_elements; | 339 | static Lisp_Object Qevent_symbol_elements; |
| 340 | 340 | ||
| 341 | /* menu and tool bar item parts */ | 341 | /* Menu and tool bar item parts. */ |
| 342 | static Lisp_Object Qmenu_enable; | 342 | static Lisp_Object Qmenu_enable; |
| 343 | static Lisp_Object QCenable, QCvisible, QChelp, QCkeys, QCkey_sequence; | 343 | static Lisp_Object QCenable, QCvisible, QChelp, QCkeys, QCkey_sequence; |
| 344 | Lisp_Object QCfilter; | 344 | Lisp_Object QCfilter; |
| @@ -833,7 +833,7 @@ recursive_edit_unwind (Lisp_Object buffer) | |||
| 833 | 833 | ||
| 834 | 834 | ||
| 835 | #if 0 /* These two functions are now replaced with | 835 | #if 0 /* These two functions are now replaced with |
| 836 | temporarily_switch_to_single_kboard. */ | 836 | temporarily_switch_to_single_kboard. */ |
| 837 | static void | 837 | static void |
| 838 | any_kboard_state () | 838 | any_kboard_state () |
| 839 | { | 839 | { |
| @@ -1036,7 +1036,7 @@ cmd_error (Lisp_Object data) | |||
| 1036 | Vquit_flag = Qnil; | 1036 | Vquit_flag = Qnil; |
| 1037 | 1037 | ||
| 1038 | Vinhibit_quit = Qnil; | 1038 | Vinhibit_quit = Qnil; |
| 1039 | #if 0 /* This shouldn't be necessary anymore. --lorentey */ | 1039 | #if 0 /* This shouldn't be necessary anymore. --lorentey */ |
| 1040 | if (command_loop_level == 0 && minibuf_level == 0) | 1040 | if (command_loop_level == 0 && minibuf_level == 0) |
| 1041 | any_kboard_state (); | 1041 | any_kboard_state (); |
| 1042 | #endif | 1042 | #endif |
| @@ -1129,7 +1129,7 @@ command_loop (void) | |||
| 1129 | #if 0 /* This shouldn't be necessary anymore. --lorentey */ | 1129 | #if 0 /* This shouldn't be necessary anymore. --lorentey */ |
| 1130 | /* Reset single_kboard in case top-level set it while | 1130 | /* Reset single_kboard in case top-level set it while |
| 1131 | evaluating an -f option, or we are stuck there for some | 1131 | evaluating an -f option, or we are stuck there for some |
| 1132 | other reason. */ | 1132 | other reason. */ |
| 1133 | any_kboard_state (); | 1133 | any_kboard_state (); |
| 1134 | #endif | 1134 | #endif |
| 1135 | internal_catch (Qtop_level, command_loop_2, Qnil); | 1135 | internal_catch (Qtop_level, command_loop_2, Qnil); |
| @@ -1490,8 +1490,8 @@ command_loop_1 (void) | |||
| 1490 | if (!NILP (Vquit_flag)) | 1490 | if (!NILP (Vquit_flag)) |
| 1491 | { | 1491 | { |
| 1492 | Vexecuting_kbd_macro = Qt; | 1492 | Vexecuting_kbd_macro = Qt; |
| 1493 | QUIT; /* Make some noise. */ | 1493 | QUIT; /* Make some noise. */ |
| 1494 | /* Will return since macro now empty. */ | 1494 | /* Will return since macro now empty. */ |
| 1495 | } | 1495 | } |
| 1496 | } | 1496 | } |
| 1497 | 1497 | ||
| @@ -1510,7 +1510,7 @@ command_loop_1 (void) | |||
| 1510 | Vdisable_point_adjustment = Qnil; | 1510 | Vdisable_point_adjustment = Qnil; |
| 1511 | 1511 | ||
| 1512 | /* Process filters and timers may have messed with deactivate-mark. | 1512 | /* Process filters and timers may have messed with deactivate-mark. |
| 1513 | reset it before we execute the command. */ | 1513 | reset it before we execute the command. */ |
| 1514 | Vdeactivate_mark = Qnil; | 1514 | Vdeactivate_mark = Qnil; |
| 1515 | 1515 | ||
| 1516 | /* Remap command through active keymaps. */ | 1516 | /* Remap command through active keymaps. */ |
| @@ -1550,7 +1550,7 @@ command_loop_1 (void) | |||
| 1550 | } | 1550 | } |
| 1551 | else | 1551 | else |
| 1552 | { | 1552 | { |
| 1553 | /* Here for a command that isn't executed directly */ | 1553 | /* Here for a command that isn't executed directly. */ |
| 1554 | 1554 | ||
| 1555 | #ifdef HAVE_WINDOW_SYSTEM | 1555 | #ifdef HAVE_WINDOW_SYSTEM |
| 1556 | ptrdiff_t scount = SPECPDL_INDEX (); | 1556 | ptrdiff_t scount = SPECPDL_INDEX (); |
| @@ -1958,7 +1958,7 @@ void | |||
| 1958 | poll_for_input_1 (void) | 1958 | poll_for_input_1 (void) |
| 1959 | { | 1959 | { |
| 1960 | /* Tell ns_read_socket() it is being called asynchronously so it can avoid | 1960 | /* Tell ns_read_socket() it is being called asynchronously so it can avoid |
| 1961 | doing anything dangerous. */ | 1961 | doing anything dangerous. */ |
| 1962 | #ifdef HAVE_NS | 1962 | #ifdef HAVE_NS |
| 1963 | ++handling_signal; | 1963 | ++handling_signal; |
| 1964 | #endif | 1964 | #endif |
| @@ -1998,7 +1998,7 @@ start_polling (void) | |||
| 1998 | #ifdef POLL_FOR_INPUT | 1998 | #ifdef POLL_FOR_INPUT |
| 1999 | /* XXX This condition was (read_socket_hook && !interrupt_input), | 1999 | /* XXX This condition was (read_socket_hook && !interrupt_input), |
| 2000 | but read_socket_hook is not global anymore. Let's pretend that | 2000 | but read_socket_hook is not global anymore. Let's pretend that |
| 2001 | it's always set. */ | 2001 | it's always set. */ |
| 2002 | if (!interrupt_input) | 2002 | if (!interrupt_input) |
| 2003 | { | 2003 | { |
| 2004 | /* Turn alarm handling on unconditionally. It might have | 2004 | /* Turn alarm handling on unconditionally. It might have |
| @@ -2035,7 +2035,7 @@ input_polling_used (void) | |||
| 2035 | #ifdef POLL_FOR_INPUT | 2035 | #ifdef POLL_FOR_INPUT |
| 2036 | /* XXX This condition was (read_socket_hook && !interrupt_input), | 2036 | /* XXX This condition was (read_socket_hook && !interrupt_input), |
| 2037 | but read_socket_hook is not global anymore. Let's pretend that | 2037 | but read_socket_hook is not global anymore. Let's pretend that |
| 2038 | it's always set. */ | 2038 | it's always set. */ |
| 2039 | return !interrupt_input; | 2039 | return !interrupt_input; |
| 2040 | #else | 2040 | #else |
| 2041 | return 0; | 2041 | return 0; |
| @@ -2050,7 +2050,7 @@ stop_polling (void) | |||
| 2050 | #ifdef POLL_FOR_INPUT | 2050 | #ifdef POLL_FOR_INPUT |
| 2051 | /* XXX This condition was (read_socket_hook && !interrupt_input), | 2051 | /* XXX This condition was (read_socket_hook && !interrupt_input), |
| 2052 | but read_socket_hook is not global anymore. Let's pretend that | 2052 | but read_socket_hook is not global anymore. Let's pretend that |
| 2053 | it's always set. */ | 2053 | it's always set. */ |
| 2054 | if (!interrupt_input) | 2054 | if (!interrupt_input) |
| 2055 | ++poll_suppress_count; | 2055 | ++poll_suppress_count; |
| 2056 | #endif | 2056 | #endif |
| @@ -2388,7 +2388,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps, | |||
| 2388 | real event came from. Normally, a switch-frame event selects | 2388 | real event came from. Normally, a switch-frame event selects |
| 2389 | internal_last_event_frame after each command is read, but | 2389 | internal_last_event_frame after each command is read, but |
| 2390 | events read from a macro should never cause a new frame to be | 2390 | events read from a macro should never cause a new frame to be |
| 2391 | selected. */ | 2391 | selected. */ |
| 2392 | Vlast_event_frame = internal_last_event_frame = Qmacro; | 2392 | Vlast_event_frame = internal_last_event_frame = Qmacro; |
| 2393 | 2393 | ||
| 2394 | /* Exit the macro if we are at the end. | 2394 | /* Exit the macro if we are at the end. |
| @@ -2498,7 +2498,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps, | |||
| 2498 | Try this before the sit-for, because the sit-for | 2498 | Try this before the sit-for, because the sit-for |
| 2499 | would do the wrong thing if we are supposed to do | 2499 | would do the wrong thing if we are supposed to do |
| 2500 | menu prompting. If EVENT_HAS_PARAMETERS then we are reading | 2500 | menu prompting. If EVENT_HAS_PARAMETERS then we are reading |
| 2501 | after a mouse event so don't try a minibuf menu. */ | 2501 | after a mouse event so don't try a minibuf menu. */ |
| 2502 | c = Qnil; | 2502 | c = Qnil; |
| 2503 | if (nmaps > 0 && INTERACTIVE | 2503 | if (nmaps > 0 && INTERACTIVE |
| 2504 | && !NILP (prev_event) && ! EVENT_HAS_PARAMETERS (prev_event) | 2504 | && !NILP (prev_event) && ! EVENT_HAS_PARAMETERS (prev_event) |
| @@ -4980,8 +4980,8 @@ static const char *const lispy_function_keys[] = | |||
| 4980 | "break", /* 0xff6b */ | 4980 | "break", /* 0xff6b */ |
| 4981 | 4981 | ||
| 4982 | 0, 0, 0, 0, | 4982 | 0, 0, 0, 0, |
| 4983 | 0, 0, 0, 0, "backtab", 0, 0, 0, /* 0xff70... */ | 4983 | 0, 0, 0, 0, "backtab", 0, 0, 0, /* 0xff70... */ |
| 4984 | 0, 0, 0, 0, 0, 0, 0, "kp-numlock", /* 0xff78... */ | 4984 | 0, 0, 0, 0, 0, 0, 0, "kp-numlock", /* 0xff78... */ |
| 4985 | "kp-space", /* 0xff80 */ /* IsKeypadKey */ | 4985 | "kp-space", /* 0xff80 */ /* IsKeypadKey */ |
| 4986 | 0, 0, 0, 0, 0, 0, 0, 0, | 4986 | 0, 0, 0, 0, 0, 0, 0, 0, |
| 4987 | "kp-tab", /* 0xff89 */ | 4987 | "kp-tab", /* 0xff89 */ |
| @@ -5093,14 +5093,14 @@ static Lisp_Object *const scroll_bar_parts[] = { | |||
| 5093 | static Lisp_Object button_down_location; | 5093 | static Lisp_Object button_down_location; |
| 5094 | 5094 | ||
| 5095 | /* Information about the most recent up-going button event: Which | 5095 | /* Information about the most recent up-going button event: Which |
| 5096 | button, what location, and what time. */ | 5096 | button, what location, and what time. */ |
| 5097 | 5097 | ||
| 5098 | static int last_mouse_button; | 5098 | static int last_mouse_button; |
| 5099 | static int last_mouse_x; | 5099 | static int last_mouse_x; |
| 5100 | static int last_mouse_y; | 5100 | static int last_mouse_y; |
| 5101 | static Time button_down_time; | 5101 | static Time button_down_time; |
| 5102 | 5102 | ||
| 5103 | /* The number of clicks in this multiple-click. */ | 5103 | /* The number of clicks in this multiple-click. */ |
| 5104 | 5104 | ||
| 5105 | static int double_click_count; | 5105 | static int double_click_count; |
| 5106 | 5106 | ||
| @@ -5344,7 +5344,7 @@ make_lispy_event (struct input_event *event) | |||
| 5344 | 5344 | ||
| 5345 | #ifdef HAVE_NS | 5345 | #ifdef HAVE_NS |
| 5346 | /* NS_NONKEY_EVENTs are just like NON_ASCII_KEYSTROKE_EVENTs, | 5346 | /* NS_NONKEY_EVENTs are just like NON_ASCII_KEYSTROKE_EVENTs, |
| 5347 | except that they are non-key events (last-nonmenu-event is nil). */ | 5347 | except that they are non-key events (last-nonmenu-event is nil). */ |
| 5348 | case NS_NONKEY_EVENT: | 5348 | case NS_NONKEY_EVENT: |
| 5349 | #endif | 5349 | #endif |
| 5350 | 5350 | ||
| @@ -5831,7 +5831,7 @@ make_lispy_event (struct input_event *event) | |||
| 5831 | Fcons (make_number (event->timestamp), | 5831 | Fcons (make_number (event->timestamp), |
| 5832 | Fcons (part, Qnil))))); | 5832 | Fcons (part, Qnil))))); |
| 5833 | 5833 | ||
| 5834 | /* Always treat scroll bar events as clicks. */ | 5834 | /* Always treat scroll bar events as clicks. */ |
| 5835 | event->modifiers |= click_modifier; | 5835 | event->modifiers |= click_modifier; |
| 5836 | event->modifiers &= ~up_modifier; | 5836 | event->modifiers &= ~up_modifier; |
| 5837 | 5837 | ||
| @@ -6698,7 +6698,7 @@ lucid_event_type_list_p (Lisp_Object object) | |||
| 6698 | If READABLE_EVENTS_FILTER_EVENTS is set in FLAGS, ignore internal | 6698 | If READABLE_EVENTS_FILTER_EVENTS is set in FLAGS, ignore internal |
| 6699 | events (FOCUS_IN_EVENT). | 6699 | events (FOCUS_IN_EVENT). |
| 6700 | If READABLE_EVENTS_IGNORE_SQUEEZABLES is set in FLAGS, ignore mouse | 6700 | If READABLE_EVENTS_IGNORE_SQUEEZABLES is set in FLAGS, ignore mouse |
| 6701 | movements and toolkit scroll bar thumb drags. */ | 6701 | movements and toolkit scroll bar thumb drags. */ |
| 6702 | 6702 | ||
| 6703 | static void | 6703 | static void |
| 6704 | get_input_pending (int *addr, int flags) | 6704 | get_input_pending (int *addr, int flags) |
| @@ -6732,7 +6732,7 @@ gobble_input (int expected) | |||
| 6732 | #ifdef POLL_FOR_INPUT | 6732 | #ifdef POLL_FOR_INPUT |
| 6733 | /* XXX This condition was (read_socket_hook && !interrupt_input), | 6733 | /* XXX This condition was (read_socket_hook && !interrupt_input), |
| 6734 | but read_socket_hook is not global anymore. Let's pretend that | 6734 | but read_socket_hook is not global anymore. Let's pretend that |
| 6735 | it's always set. */ | 6735 | it's always set. */ |
| 6736 | if (!interrupt_input && poll_suppress_count == 0) | 6736 | if (!interrupt_input && poll_suppress_count == 0) |
| 6737 | { | 6737 | { |
| 6738 | SIGMASKTYPE mask; | 6738 | SIGMASKTYPE mask; |
| @@ -6807,7 +6807,7 @@ read_avail_input (int expected) | |||
| 6807 | if (store_user_signal_events ()) | 6807 | if (store_user_signal_events ()) |
| 6808 | expected = 0; | 6808 | expected = 0; |
| 6809 | 6809 | ||
| 6810 | /* Loop through the available terminals, and call their input hooks. */ | 6810 | /* Loop through the available terminals, and call their input hooks. */ |
| 6811 | t = terminal_list; | 6811 | t = terminal_list; |
| 6812 | while (t) | 6812 | while (t) |
| 6813 | { | 6813 | { |
| @@ -6828,15 +6828,15 @@ read_avail_input (int expected) | |||
| 6828 | expected = 0; | 6828 | expected = 0; |
| 6829 | } | 6829 | } |
| 6830 | 6830 | ||
| 6831 | if (nr == -1) /* Not OK to read input now. */ | 6831 | if (nr == -1) /* Not OK to read input now. */ |
| 6832 | { | 6832 | { |
| 6833 | err = 1; | 6833 | err = 1; |
| 6834 | } | 6834 | } |
| 6835 | else if (nr == -2) /* Non-transient error. */ | 6835 | else if (nr == -2) /* Non-transient error. */ |
| 6836 | { | 6836 | { |
| 6837 | /* The terminal device terminated; it should be closed. */ | 6837 | /* The terminal device terminated; it should be closed. */ |
| 6838 | 6838 | ||
| 6839 | /* Kill Emacs if this was our last terminal. */ | 6839 | /* Kill Emacs if this was our last terminal. */ |
| 6840 | if (!terminal_list->next_terminal) | 6840 | if (!terminal_list->next_terminal) |
| 6841 | /* Formerly simply reported no input, but that | 6841 | /* Formerly simply reported no input, but that |
| 6842 | sometimes led to a failure of Emacs to terminate. | 6842 | sometimes led to a failure of Emacs to terminate. |
| @@ -6848,7 +6848,7 @@ read_avail_input (int expected) | |||
| 6848 | alone in its group. */ | 6848 | alone in its group. */ |
| 6849 | kill (getpid (), SIGHUP); | 6849 | kill (getpid (), SIGHUP); |
| 6850 | 6850 | ||
| 6851 | /* XXX Is calling delete_terminal safe here? It calls delete_frame. */ | 6851 | /* XXX Is calling delete_terminal safe here? It calls delete_frame. */ |
| 6852 | { | 6852 | { |
| 6853 | Lisp_Object tmp; | 6853 | Lisp_Object tmp; |
| 6854 | XSETTERMINAL (tmp, t); | 6854 | XSETTERMINAL (tmp, t); |
| @@ -6938,7 +6938,7 @@ tty_read_avail_input (struct terminal *terminal, | |||
| 6938 | return 0; | 6938 | return 0; |
| 6939 | #endif /* subprocesses */ | 6939 | #endif /* subprocesses */ |
| 6940 | 6940 | ||
| 6941 | if (!terminal->name) /* Don't read from a dead terminal. */ | 6941 | if (!terminal->name) /* Don't read from a dead terminal. */ |
| 6942 | return 0; | 6942 | return 0; |
| 6943 | 6943 | ||
| 6944 | if (terminal->type != output_termcap | 6944 | if (terminal->type != output_termcap |
| @@ -6946,15 +6946,15 @@ tty_read_avail_input (struct terminal *terminal, | |||
| 6946 | abort (); | 6946 | abort (); |
| 6947 | 6947 | ||
| 6948 | /* XXX I think the following code should be moved to separate hook | 6948 | /* XXX I think the following code should be moved to separate hook |
| 6949 | functions in system-dependent files. */ | 6949 | functions in system-dependent files. */ |
| 6950 | #ifdef WINDOWSNT | 6950 | #ifdef WINDOWSNT |
| 6951 | return 0; | 6951 | return 0; |
| 6952 | #else /* not WINDOWSNT */ | 6952 | #else /* not WINDOWSNT */ |
| 6953 | if (! tty->term_initted) /* In case we get called during bootstrap. */ | 6953 | if (! tty->term_initted) /* In case we get called during bootstrap. */ |
| 6954 | return 0; | 6954 | return 0; |
| 6955 | 6955 | ||
| 6956 | if (! tty->input) | 6956 | if (! tty->input) |
| 6957 | return 0; /* The terminal is suspended. */ | 6957 | return 0; /* The terminal is suspended. */ |
| 6958 | 6958 | ||
| 6959 | #ifdef MSDOS | 6959 | #ifdef MSDOS |
| 6960 | n_to_read = dos_keysns (); | 6960 | n_to_read = dos_keysns (); |
| @@ -6980,7 +6980,7 @@ tty_read_avail_input (struct terminal *terminal, | |||
| 6980 | Gpm_GetEvent closes gpm_fd and clears it to -1, which is why | 6980 | Gpm_GetEvent closes gpm_fd and clears it to -1, which is why |
| 6981 | we save it in `fd' so close_gpm can remove it from the | 6981 | we save it in `fd' so close_gpm can remove it from the |
| 6982 | select masks. | 6982 | select masks. |
| 6983 | gpm==-1 if a protocol error or EWOULDBLOCK; the latter is normal. */ | 6983 | gpm==-1 if a protocol error or EWOULDBLOCK; the latter is normal. */ |
| 6984 | while (gpm = Gpm_GetEvent (&event), gpm == 1) { | 6984 | while (gpm = Gpm_GetEvent (&event), gpm == 1) { |
| 6985 | nread += handle_one_term_event (tty, &event, &gpm_hold_quit); | 6985 | nread += handle_one_term_event (tty, &event, &gpm_hold_quit); |
| 6986 | } | 6986 | } |
| @@ -7000,7 +7000,7 @@ tty_read_avail_input (struct terminal *terminal, | |||
| 7000 | if (ioctl (fileno (tty->input), FIONREAD, &n_to_read) < 0) | 7000 | if (ioctl (fileno (tty->input), FIONREAD, &n_to_read) < 0) |
| 7001 | { | 7001 | { |
| 7002 | if (! noninteractive) | 7002 | if (! noninteractive) |
| 7003 | return -2; /* Close this terminal. */ | 7003 | return -2; /* Close this terminal. */ |
| 7004 | else | 7004 | else |
| 7005 | n_to_read = 0; | 7005 | n_to_read = 0; |
| 7006 | } | 7006 | } |
| @@ -7033,16 +7033,16 @@ tty_read_avail_input (struct terminal *terminal, | |||
| 7033 | process group won't get SIGHUP's at logout time. BSDI adheres to | 7033 | process group won't get SIGHUP's at logout time. BSDI adheres to |
| 7034 | this part standard and returns -1 from read (0) with errno==EIO | 7034 | this part standard and returns -1 from read (0) with errno==EIO |
| 7035 | when the control tty is taken away. | 7035 | when the control tty is taken away. |
| 7036 | Jeffrey Honig <jch@bsdi.com> says this is generally safe. */ | 7036 | Jeffrey Honig <jch@bsdi.com> says this is generally safe. */ |
| 7037 | if (nread == -1 && errno == EIO) | 7037 | if (nread == -1 && errno == EIO) |
| 7038 | return -2; /* Close this terminal. */ | 7038 | return -2; /* Close this terminal. */ |
| 7039 | #if defined (AIX) && defined (_BSD) | 7039 | #if defined (AIX) && defined (_BSD) |
| 7040 | /* The kernel sometimes fails to deliver SIGHUP for ptys. | 7040 | /* The kernel sometimes fails to deliver SIGHUP for ptys. |
| 7041 | This looks incorrect, but it isn't, because _BSD causes | 7041 | This looks incorrect, but it isn't, because _BSD causes |
| 7042 | O_NDELAY to be defined in fcntl.h as O_NONBLOCK, | 7042 | O_NDELAY to be defined in fcntl.h as O_NONBLOCK, |
| 7043 | and that causes a value other than 0 when there is no input. */ | 7043 | and that causes a value other than 0 when there is no input. */ |
| 7044 | if (nread == 0) | 7044 | if (nread == 0) |
| 7045 | return -2; /* Close this terminal. */ | 7045 | return -2; /* Close this terminal. */ |
| 7046 | #endif | 7046 | #endif |
| 7047 | } | 7047 | } |
| 7048 | while ( | 7048 | while ( |
| @@ -7120,7 +7120,7 @@ tty_read_avail_input (struct terminal *terminal, | |||
| 7120 | buf.code = cbuf[i]; | 7120 | buf.code = cbuf[i]; |
| 7121 | /* Set the frame corresponding to the active tty. Note that the | 7121 | /* Set the frame corresponding to the active tty. Note that the |
| 7122 | value of selected_frame is not reliable here, redisplay tends | 7122 | value of selected_frame is not reliable here, redisplay tends |
| 7123 | to temporarily change it. */ | 7123 | to temporarily change it. */ |
| 7124 | buf.frame_or_window = tty->top_frame; | 7124 | buf.frame_or_window = tty->top_frame; |
| 7125 | buf.arg = Qnil; | 7125 | buf.arg = Qnil; |
| 7126 | 7126 | ||
| @@ -7143,7 +7143,7 @@ handle_async_input (void) | |||
| 7143 | pending_signals = pending_atimers; | 7143 | pending_signals = pending_atimers; |
| 7144 | #endif | 7144 | #endif |
| 7145 | /* Tell ns_read_socket() it is being called asynchronously so it can avoid | 7145 | /* Tell ns_read_socket() it is being called asynchronously so it can avoid |
| 7146 | doing anything dangerous. */ | 7146 | doing anything dangerous. */ |
| 7147 | #ifdef HAVE_NS | 7147 | #ifdef HAVE_NS |
| 7148 | ++handling_signal; | 7148 | ++handling_signal; |
| 7149 | #endif | 7149 | #endif |
| @@ -7201,7 +7201,7 @@ input_available_signal (int signo) | |||
| 7201 | This function exists so that the UNBLOCK_INPUT macro in | 7201 | This function exists so that the UNBLOCK_INPUT macro in |
| 7202 | blockinput.h can have some way to take care of input we put off | 7202 | blockinput.h can have some way to take care of input we put off |
| 7203 | dealing with, without assuming that every file which uses | 7203 | dealing with, without assuming that every file which uses |
| 7204 | UNBLOCK_INPUT also has #included the files necessary to get SIGIO. */ | 7204 | UNBLOCK_INPUT also has #included the files necessary to get SIGIO. */ |
| 7205 | void | 7205 | void |
| 7206 | reinvoke_input_signal (void) | 7206 | reinvoke_input_signal (void) |
| 7207 | { | 7207 | { |
| @@ -7228,7 +7228,7 @@ struct user_signal_info | |||
| 7228 | struct user_signal_info *next; | 7228 | struct user_signal_info *next; |
| 7229 | }; | 7229 | }; |
| 7230 | 7230 | ||
| 7231 | /* List of user signals. */ | 7231 | /* List of user signals. */ |
| 7232 | static struct user_signal_info *user_signals = NULL; | 7232 | static struct user_signal_info *user_signals = NULL; |
| 7233 | 7233 | ||
| 7234 | void | 7234 | void |
| @@ -7765,7 +7765,7 @@ parse_menu_item (Lisp_Object item, int inmenubar) | |||
| 7765 | { | 7765 | { |
| 7766 | tem = XCAR (item); | 7766 | tem = XCAR (item); |
| 7767 | if (SYMBOLP (tem) || STRINGP (tem) || VECTORP (tem)) | 7767 | if (SYMBOLP (tem) || STRINGP (tem) || VECTORP (tem)) |
| 7768 | /* Be GC protected. Set keyhint to item instead of tem. */ | 7768 | /* Be GC protected. Set keyhint to item instead of tem. */ |
| 7769 | keyhint = item; | 7769 | keyhint = item; |
| 7770 | } | 7770 | } |
| 7771 | else if (EQ (tem, QCkeys)) | 7771 | else if (EQ (tem, QCkeys)) |
| @@ -7848,7 +7848,7 @@ parse_menu_item (Lisp_Object item, int inmenubar) | |||
| 7848 | if (inmenubar > 0) | 7848 | if (inmenubar > 0) |
| 7849 | return 1; | 7849 | return 1; |
| 7850 | 7850 | ||
| 7851 | { /* This is a command. See if there is an equivalent key binding. */ | 7851 | { /* This is a command. See if there is an equivalent key binding. */ |
| 7852 | Lisp_Object keyeq = AREF (item_properties, ITEM_PROPERTY_KEYEQ); | 7852 | Lisp_Object keyeq = AREF (item_properties, ITEM_PROPERTY_KEYEQ); |
| 7853 | 7853 | ||
| 7854 | /* The previous code preferred :key-sequence to :keys, so we | 7854 | /* The previous code preferred :key-sequence to :keys, so we |
| @@ -8405,7 +8405,7 @@ append_tool_bar_item (void) | |||
| 8405 | These are done in different ways, depending on how the input will be read. | 8405 | These are done in different ways, depending on how the input will be read. |
| 8406 | Menus using X are done after auto-saving in read-char, getting the input | 8406 | Menus using X are done after auto-saving in read-char, getting the input |
| 8407 | event from Fx_popup_menu; menus using the minibuf use read_char recursively | 8407 | event from Fx_popup_menu; menus using the minibuf use read_char recursively |
| 8408 | and do auto-saving in the inner call of read_char. */ | 8408 | and do auto-saving in the inner call of read_char. */ |
| 8409 | 8409 | ||
| 8410 | static Lisp_Object | 8410 | static Lisp_Object |
| 8411 | read_char_x_menu_prompt (ptrdiff_t nmaps, Lisp_Object *maps, | 8411 | read_char_x_menu_prompt (ptrdiff_t nmaps, Lisp_Object *maps, |
| @@ -8625,14 +8625,14 @@ read_char_minibuf_menu_prompt (int commandflag, | |||
| 8625 | tem | 8625 | tem |
| 8626 | = XVECTOR (item_properties)->contents[ITEM_PROPERTY_KEYEQ]; | 8626 | = XVECTOR (item_properties)->contents[ITEM_PROPERTY_KEYEQ]; |
| 8627 | if (!NILP (tem)) | 8627 | if (!NILP (tem)) |
| 8628 | /* Insert equivalent keybinding. */ | 8628 | /* Insert equivalent keybinding. */ |
| 8629 | s = concat2 (s, tem); | 8629 | s = concat2 (s, tem); |
| 8630 | #endif | 8630 | #endif |
| 8631 | tem | 8631 | tem |
| 8632 | = XVECTOR (item_properties)->contents[ITEM_PROPERTY_TYPE]; | 8632 | = XVECTOR (item_properties)->contents[ITEM_PROPERTY_TYPE]; |
| 8633 | if (EQ (tem, QCradio) || EQ (tem, QCtoggle)) | 8633 | if (EQ (tem, QCradio) || EQ (tem, QCtoggle)) |
| 8634 | { | 8634 | { |
| 8635 | /* Insert button prefix. */ | 8635 | /* Insert button prefix. */ |
| 8636 | Lisp_Object selected | 8636 | Lisp_Object selected |
| 8637 | = XVECTOR (item_properties)->contents[ITEM_PROPERTY_SELECTED]; | 8637 | = XVECTOR (item_properties)->contents[ITEM_PROPERTY_SELECTED]; |
| 8638 | if (EQ (tem, QCradio)) | 8638 | if (EQ (tem, QCradio)) |
| @@ -8866,7 +8866,7 @@ keyremap_step (Lisp_Object *keybuf, int bufsize, volatile keyremap *fkey, | |||
| 8866 | 8866 | ||
| 8867 | /* If keybuf[fkey->start..fkey->end] is bound in the | 8867 | /* If keybuf[fkey->start..fkey->end] is bound in the |
| 8868 | map and we're in a position to do the key remapping, replace it with | 8868 | map and we're in a position to do the key remapping, replace it with |
| 8869 | the binding and restart with fkey->start at the end. */ | 8869 | the binding and restart with fkey->start at the end. */ |
| 8870 | if ((VECTORP (next) || STRINGP (next)) && doit) | 8870 | if ((VECTORP (next) || STRINGP (next)) && doit) |
| 8871 | { | 8871 | { |
| 8872 | int len = XFASTINT (Flength (next)); | 8872 | int len = XFASTINT (Flength (next)); |
| @@ -9030,7 +9030,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, | |||
| 9030 | 9030 | ||
| 9031 | /* Non-zero if we are trying to map a key by changing an upper-case | 9031 | /* Non-zero if we are trying to map a key by changing an upper-case |
| 9032 | letter to lower case, or a shifted function key to an unshifted | 9032 | letter to lower case, or a shifted function key to an unshifted |
| 9033 | one. */ | 9033 | one. */ |
| 9034 | int shift_translated = 0; | 9034 | int shift_translated = 0; |
| 9035 | 9035 | ||
| 9036 | /* If we receive a `switch-frame' or `select-window' event in the middle of | 9036 | /* If we receive a `switch-frame' or `select-window' event in the middle of |
| @@ -9038,7 +9038,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, | |||
| 9038 | While we're reading, we keep the event here. */ | 9038 | While we're reading, we keep the event here. */ |
| 9039 | Lisp_Object delayed_switch_frame; | 9039 | Lisp_Object delayed_switch_frame; |
| 9040 | 9040 | ||
| 9041 | /* See the comment below... */ | 9041 | /* See the comment below... */ |
| 9042 | #if defined (GOBBLE_FIRST_EVENT) | 9042 | #if defined (GOBBLE_FIRST_EVENT) |
| 9043 | Lisp_Object first_event; | 9043 | Lisp_Object first_event; |
| 9044 | #endif | 9044 | #endif |
| @@ -9313,7 +9313,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, | |||
| 9313 | if (!found) | 9313 | if (!found) |
| 9314 | { | 9314 | { |
| 9315 | /* Don't touch interrupted_kboard when it's been | 9315 | /* Don't touch interrupted_kboard when it's been |
| 9316 | deleted. */ | 9316 | deleted. */ |
| 9317 | delayed_switch_frame = Qnil; | 9317 | delayed_switch_frame = Qnil; |
| 9318 | goto replay_entire_sequence; | 9318 | goto replay_entire_sequence; |
| 9319 | } | 9319 | } |
| @@ -9421,7 +9421,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, | |||
| 9421 | { | 9421 | { |
| 9422 | /* If we're at the beginning of a key sequence, and the caller | 9422 | /* If we're at the beginning of a key sequence, and the caller |
| 9423 | says it's okay, go ahead and return this event. If we're | 9423 | says it's okay, go ahead and return this event. If we're |
| 9424 | in the midst of a key sequence, delay it until the end. */ | 9424 | in the midst of a key sequence, delay it until the end. */ |
| 9425 | if (t > 0 || !can_return_switch_frame) | 9425 | if (t > 0 || !can_return_switch_frame) |
| 9426 | { | 9426 | { |
| 9427 | delayed_switch_frame = key; | 9427 | delayed_switch_frame = key; |
| @@ -9718,7 +9718,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, | |||
| 9718 | Down-clicks are eliminated. | 9718 | Down-clicks are eliminated. |
| 9719 | Double-downs reduce to downs, then are eliminated. | 9719 | Double-downs reduce to downs, then are eliminated. |
| 9720 | Triple-downs reduce to double-downs, then to downs, | 9720 | Triple-downs reduce to double-downs, then to downs, |
| 9721 | then are eliminated. */ | 9721 | then are eliminated. */ |
| 9722 | if (modifiers & (down_modifier | drag_modifier | 9722 | if (modifiers & (down_modifier | drag_modifier |
| 9723 | | double_modifier | triple_modifier)) | 9723 | | double_modifier | triple_modifier)) |
| 9724 | { | 9724 | { |
| @@ -10827,7 +10827,7 @@ set_waiting_for_input (struct timeval *time_to_clear) | |||
| 10827 | waiting_for_input = 1; | 10827 | waiting_for_input = 1; |
| 10828 | 10828 | ||
| 10829 | /* If handle_interrupt was called before and buffered a C-g, | 10829 | /* If handle_interrupt was called before and buffered a C-g, |
| 10830 | make it run again now, to avoid timing error. */ | 10830 | make it run again now, to avoid timing error. */ |
| 10831 | if (!NILP (Vquit_flag)) | 10831 | if (!NILP (Vquit_flag)) |
| 10832 | quit_throw_to_read_char (); | 10832 | quit_throw_to_read_char (); |
| 10833 | } | 10833 | } |
| @@ -10848,7 +10848,7 @@ clear_waiting_for_input (void) | |||
| 10848 | 10848 | ||
| 10849 | static void | 10849 | static void |
| 10850 | interrupt_signal (int signalnum) /* If we don't have an argument, some */ | 10850 | interrupt_signal (int signalnum) /* If we don't have an argument, some */ |
| 10851 | /* compilers complain in signal calls. */ | 10851 | /* compilers complain in signal calls. */ |
| 10852 | { | 10852 | { |
| 10853 | /* Must preserve main program's value of errno. */ | 10853 | /* Must preserve main program's value of errno. */ |
| 10854 | int old_errno = errno; | 10854 | int old_errno = errno; |
| @@ -10856,12 +10856,12 @@ interrupt_signal (int signalnum) /* If we don't have an argument, some */ | |||
| 10856 | 10856 | ||
| 10857 | SIGNAL_THREAD_CHECK (signalnum); | 10857 | SIGNAL_THREAD_CHECK (signalnum); |
| 10858 | 10858 | ||
| 10859 | /* See if we have an active terminal on our controlling tty. */ | 10859 | /* See if we have an active terminal on our controlling tty. */ |
| 10860 | terminal = get_named_tty ("/dev/tty"); | 10860 | terminal = get_named_tty ("/dev/tty"); |
| 10861 | if (!terminal) | 10861 | if (!terminal) |
| 10862 | { | 10862 | { |
| 10863 | /* If there are no frames there, let's pretend that we are a | 10863 | /* If there are no frames there, let's pretend that we are a |
| 10864 | well-behaving UN*X program and quit. */ | 10864 | well-behaving UN*X program and quit. */ |
| 10865 | Fkill_emacs (Qnil); | 10865 | Fkill_emacs (Qnil); |
| 10866 | } | 10866 | } |
| 10867 | else | 10867 | else |
| @@ -10889,7 +10889,7 @@ interrupt_signal (int signalnum) /* If we don't have an argument, some */ | |||
| 10889 | 10889 | ||
| 10890 | Otherwise it sets the Lisp variable quit-flag not-nil. This causes | 10890 | Otherwise it sets the Lisp variable quit-flag not-nil. This causes |
| 10891 | eval to throw, when it gets a chance. If quit-flag is already | 10891 | eval to throw, when it gets a chance. If quit-flag is already |
| 10892 | non-nil, it stops the job right away. */ | 10892 | non-nil, it stops the job right away. */ |
| 10893 | 10893 | ||
| 10894 | static void | 10894 | static void |
| 10895 | handle_interrupt (void) | 10895 | handle_interrupt (void) |
| @@ -10898,7 +10898,7 @@ handle_interrupt (void) | |||
| 10898 | 10898 | ||
| 10899 | cancel_echoing (); | 10899 | cancel_echoing (); |
| 10900 | 10900 | ||
| 10901 | /* XXX This code needs to be revised for multi-tty support. */ | 10901 | /* XXX This code needs to be revised for multi-tty support. */ |
| 10902 | if (!NILP (Vquit_flag) && get_named_tty ("/dev/tty")) | 10902 | if (!NILP (Vquit_flag) && get_named_tty ("/dev/tty")) |
| 10903 | { | 10903 | { |
| 10904 | /* If SIGINT isn't blocked, don't let us be interrupted by | 10904 | /* If SIGINT isn't blocked, don't let us be interrupted by |
| @@ -11008,7 +11008,7 @@ handle_interrupt (void) | |||
| 11008 | wait_reading_process_output() under HAVE_NS because of the call | 11008 | wait_reading_process_output() under HAVE_NS because of the call |
| 11009 | to ns_select there (needed because otherwise events aren't picked up | 11009 | to ns_select there (needed because otherwise events aren't picked up |
| 11010 | outside of polling since we don't get SIGIO like X and we don't have a | 11010 | outside of polling since we don't get SIGIO like X and we don't have a |
| 11011 | separate event loop thread like W32. */ | 11011 | separate event loop thread like W32. */ |
| 11012 | #ifndef HAVE_NS | 11012 | #ifndef HAVE_NS |
| 11013 | if (waiting_for_input && !echoing) | 11013 | if (waiting_for_input && !echoing) |
| 11014 | quit_throw_to_read_char (); | 11014 | quit_throw_to_read_char (); |
| @@ -11457,7 +11457,7 @@ init_keyboard (void) | |||
| 11457 | session may have multiple display types, so we always handle | 11457 | session may have multiple display types, so we always handle |
| 11458 | SIGINT. There is special code in interrupt_signal to exit | 11458 | SIGINT. There is special code in interrupt_signal to exit |
| 11459 | Emacs on SIGINT when there are no termcap frames on the | 11459 | Emacs on SIGINT when there are no termcap frames on the |
| 11460 | controlling terminal. */ | 11460 | controlling terminal. */ |
| 11461 | signal (SIGINT, interrupt_signal); | 11461 | signal (SIGINT, interrupt_signal); |
| 11462 | #ifndef DOS_NT | 11462 | #ifndef DOS_NT |
| 11463 | /* For systems with SysV TERMIO, C-g is set up for both SIGINT and | 11463 | /* For systems with SysV TERMIO, C-g is set up for both SIGINT and |
| @@ -12254,7 +12254,7 @@ Currently, the only supported values for this | |||
| 12254 | variable are `sigusr1' and `sigusr2'. */); | 12254 | variable are `sigusr1' and `sigusr2'. */); |
| 12255 | Vdebug_on_event = intern_c_string ("sigusr2"); | 12255 | Vdebug_on_event = intern_c_string ("sigusr2"); |
| 12256 | 12256 | ||
| 12257 | /* Create the initial keyboard. */ | 12257 | /* Create the initial keyboard. */ |
| 12258 | initial_kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); | 12258 | initial_kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); |
| 12259 | init_kboard (initial_kboard); | 12259 | init_kboard (initial_kboard); |
| 12260 | /* Vwindow_system is left at t for now. */ | 12260 | /* Vwindow_system is left at t for now. */ |
diff --git a/src/lisp.h b/src/lisp.h index 17f1705675e..7b1be98bd22 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 |
| @@ -1089,11 +1089,9 @@ enum symbol_redirect | |||
| 1089 | SYMBOL_PLAINVAL = 4, | 1089 | SYMBOL_PLAINVAL = 4, |
| 1090 | SYMBOL_VARALIAS = 1, | 1090 | SYMBOL_VARALIAS = 1, |
| 1091 | SYMBOL_LOCALIZED = 2, | 1091 | SYMBOL_LOCALIZED = 2, |
| 1092 | SYMBOL_FORWARDED = 3 | 1092 | SYMBOL_FORWARDED = 3 |
| 1093 | }; | 1093 | }; |
| 1094 | 1094 | ||
| 1095 | /* In a symbol, the markbit of the plist is used as the gc mark bit */ | ||
| 1096 | |||
| 1097 | struct Lisp_Symbol | 1095 | struct Lisp_Symbol |
| 1098 | { | 1096 | { |
| 1099 | unsigned gcmarkbit : 1; | 1097 | unsigned gcmarkbit : 1; |
| @@ -1102,8 +1100,7 @@ struct Lisp_Symbol | |||
| 1102 | 0 : it's a plain var, the value is in the `value' field. | 1100 | 0 : it's a plain var, the value is in the `value' field. |
| 1103 | 1 : it's a varalias, the value is really in the `alias' symbol. | 1101 | 1 : it's a varalias, the value is really in the `alias' symbol. |
| 1104 | 2 : it's a localized var, the value is in the `blv' object. | 1102 | 2 : it's a localized var, the value is in the `blv' object. |
| 1105 | 3 : it's a forwarding variable, the value is in `forward'. | 1103 | 3 : it's a forwarding variable, the value is in `forward'. */ |
| 1106 | */ | ||
| 1107 | enum symbol_redirect redirect : 3; | 1104 | enum symbol_redirect redirect : 3; |
| 1108 | 1105 | ||
| 1109 | /* Non-zero means symbol is constant, i.e. changing its value | 1106 | /* Non-zero means symbol is constant, i.e. changing its value |
| @@ -1120,15 +1117,12 @@ struct Lisp_Symbol | |||
| 1120 | unsigned declared_special : 1; | 1117 | unsigned declared_special : 1; |
| 1121 | 1118 | ||
| 1122 | /* The symbol's name, as a Lisp string. | 1119 | /* The symbol's name, as a Lisp string. |
| 1123 | |||
| 1124 | The name "xname" is used to intentionally break code referring to | 1120 | The name "xname" is used to intentionally break code referring to |
| 1125 | the old field "name" of type pointer to struct Lisp_String. */ | 1121 | the old field "name" of type pointer to struct Lisp_String. */ |
| 1126 | Lisp_Object xname; | 1122 | Lisp_Object xname; |
| 1127 | 1123 | ||
| 1128 | /* Value of the symbol or Qunbound if unbound. If this symbol is a | 1124 | /* Value of the symbol or Qunbound if unbound. Which alternative of the |
| 1129 | defvaralias, `alias' contains the symbol for which it is an | 1125 | union is used depends on the `redirect' field above. */ |
| 1130 | alias. Use the SYMBOL_VALUE and SET_SYMBOL_VALUE macros to get | ||
| 1131 | and set a symbol's value, to take defvaralias into account. */ | ||
| 1132 | union { | 1126 | union { |
| 1133 | Lisp_Object value; | 1127 | Lisp_Object value; |
| 1134 | struct Lisp_Symbol *alias; | 1128 | struct Lisp_Symbol *alias; |
| @@ -1323,7 +1317,7 @@ struct Lisp_Misc_Any /* Supertype of all Misc types. */ | |||
| 1323 | enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_??? */ | 1317 | enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_??? */ |
| 1324 | unsigned gcmarkbit : 1; | 1318 | unsigned gcmarkbit : 1; |
| 1325 | int spacer : 15; | 1319 | int spacer : 15; |
| 1326 | /* Make it as long as "Lisp_Free without padding". */ | 1320 | /* Make it as long as "Lisp_Free without padding". */ |
| 1327 | void *fill; | 1321 | void *fill; |
| 1328 | }; | 1322 | }; |
| 1329 | 1323 | ||
| @@ -3635,7 +3629,7 @@ extern void init_system_name (void); | |||
| 3635 | 3629 | ||
| 3636 | #define SWITCH_ENUM_CAST(x) (x) | 3630 | #define SWITCH_ENUM_CAST(x) (x) |
| 3637 | 3631 | ||
| 3638 | /* Use this to suppress gcc's warnings. */ | 3632 | /* Use this to suppress gcc's warnings. */ |
| 3639 | #ifdef lint | 3633 | #ifdef lint |
| 3640 | 3634 | ||
| 3641 | /* Use CODE only if lint checking is in effect. */ | 3635 | /* Use CODE only if lint checking is in effect. */ |
diff --git a/src/minibuf.c b/src/minibuf.c index 0d2bc7234eb..7dd189c325b 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -251,7 +251,7 @@ read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial, | |||
| 251 | 251 | ||
| 252 | while ((c = getchar ()) != '\n') | 252 | while ((c = getchar ()) != '\n') |
| 253 | { | 253 | { |
| 254 | if (c < 0) | 254 | if (c == EOF) |
| 255 | { | 255 | { |
| 256 | if (errno != EINTR) | 256 | if (errno != EINTR) |
| 257 | break; | 257 | break; |
| @@ -269,7 +269,7 @@ read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial, | |||
| 269 | } | 269 | } |
| 270 | } | 270 | } |
| 271 | 271 | ||
| 272 | if (len) | 272 | if (len || c == '\n') |
| 273 | { | 273 | { |
| 274 | val = make_string (line, len); | 274 | val = make_string (line, len); |
| 275 | xfree (line); | 275 | xfree (line); |
diff --git a/src/process.c b/src/process.c index 716e74758c4..de2edad07bd 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -4842,16 +4842,11 @@ wait_reading_process_output (int time_limit, int microsecs, int read_kbd, | |||
| 4842 | It can't hurt. */ | 4842 | It can't hurt. */ |
| 4843 | else if (nread == -1 && errno == EIO) | 4843 | else if (nread == -1 && errno == EIO) |
| 4844 | { | 4844 | { |
| 4845 | /* Clear the descriptor now, so we only raise the | 4845 | /* Clear the descriptor now, so we only raise the signal once. */ |
| 4846 | signal once. Don't do this if `process' is only | 4846 | FD_CLR (channel, &input_wait_mask); |
| 4847 | a pty. */ | 4847 | FD_CLR (channel, &non_keyboard_wait_mask); |
| 4848 | if (XPROCESS (proc)->pid != -2) | ||
| 4849 | { | ||
| 4850 | FD_CLR (channel, &input_wait_mask); | ||
| 4851 | FD_CLR (channel, &non_keyboard_wait_mask); | ||
| 4852 | 4848 | ||
| 4853 | kill (getpid (), SIGCHLD); | 4849 | kill (getpid (), SIGCHLD); |
| 4854 | } | ||
| 4855 | } | 4850 | } |
| 4856 | #endif /* HAVE_PTYS */ | 4851 | #endif /* HAVE_PTYS */ |
| 4857 | /* If we can detect process termination, don't consider the process | 4852 | /* If we can detect process termination, don't consider the process |
| @@ -139,6 +139,7 @@ extern void term_w32select (void); | |||
| 139 | extern void syms_of_w32menu (void); | 139 | extern void syms_of_w32menu (void); |
| 140 | extern void globals_of_w32menu (void); | 140 | extern void globals_of_w32menu (void); |
| 141 | extern void syms_of_fontset (void); | 141 | extern void syms_of_fontset (void); |
| 142 | extern void syms_of_w32font (void); | ||
| 142 | 143 | ||
| 143 | extern int _sys_read_ahead (int fd); | 144 | extern int _sys_read_ahead (int fd); |
| 144 | extern int _sys_wait_accept (int fd); | 145 | extern 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. */ |
| 146 | static void list_all_matching_fonts (struct font_callback_data *); | 146 | static void list_all_matching_fonts (struct font_callback_data *); |
| 147 | 147 | ||
| 148 | static BOOL g_b_init_is_w9x; | ||
| 149 | static BOOL g_b_init_get_outline_metrics_w; | ||
| 150 | static BOOL g_b_init_get_text_metrics_w; | ||
| 151 | static BOOL g_b_init_get_glyph_outline_w; | ||
| 152 | static BOOL g_b_init_get_glyph_outline_w; | ||
| 153 | |||
| 154 | typedef UINT (WINAPI * GetOutlineTextMetricsW_Proc) ( | ||
| 155 | HDC hdc, | ||
| 156 | UINT cbData, | ||
| 157 | LPOUTLINETEXTMETRICW lpotmw); | ||
| 158 | typedef BOOL (WINAPI * GetTextMetricsW_Proc) ( | ||
| 159 | HDC hdc, | ||
| 160 | LPTEXTMETRICW lptmw); | ||
| 161 | typedef 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. */ | ||
| 178 | static HMODULE | ||
| 179 | w32_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. */ | ||
| 225 | static UINT WINAPI | ||
| 226 | get_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 | |||
| 243 | static BOOL WINAPI | ||
| 244 | get_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 | |||
| 261 | static DWORD WINAPI | ||
| 262 | get_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 | ||
| 149 | static int | 281 | static int |
| 150 | memq_no_quit (Lisp_Object elt, Lisp_Object list) | 282 | memq_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 | |||
| 2717 | void | ||
| 2718 | globals_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 dfaef1854a4..d9ef9d090ae 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -3321,6 +3321,7 @@ make_window (void) | |||
| 3321 | memset (&w->phys_cursor, 0, sizeof (w->phys_cursor)); | 3321 | memset (&w->phys_cursor, 0, sizeof (w->phys_cursor)); |
| 3322 | w->phys_cursor_type = -1; | 3322 | w->phys_cursor_type = -1; |
| 3323 | w->phys_cursor_width = -1; | 3323 | w->phys_cursor_width = -1; |
| 3324 | w->phys_cursor_on_p = 0; | ||
| 3324 | w->last_cursor_off_p = w->cursor_off_p = 0; | 3325 | w->last_cursor_off_p = w->cursor_off_p = 0; |
| 3325 | w->must_be_updated_p = 0; | 3326 | w->must_be_updated_p = 0; |
| 3326 | w->pseudo_window_p = 0; | 3327 | w->pseudo_window_p = 0; |
diff --git a/src/xdisp.c b/src/xdisp.c index cb68969ae2d..53e56e0bd7c 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -26808,7 +26808,7 @@ void | |||
| 26808 | note_mouse_highlight (struct frame *f, int x, int y) | 26808 | note_mouse_highlight (struct frame *f, int x, int y) |
| 26809 | { | 26809 | { |
| 26810 | Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); | 26810 | Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); |
| 26811 | enum window_part part; | 26811 | enum window_part part = ON_NOTHING; |
| 26812 | Lisp_Object window; | 26812 | Lisp_Object window; |
| 26813 | struct window *w; | 26813 | struct window *w; |
| 26814 | Cursor cursor = No_Cursor; | 26814 | Cursor cursor = No_Cursor; |
| @@ -26842,11 +26842,14 @@ note_mouse_highlight (struct frame *f, int x, int y) | |||
| 26842 | /* Which window is that in? */ | 26842 | /* Which window is that in? */ |
| 26843 | window = window_from_coordinates (f, x, y, &part, 1); | 26843 | window = window_from_coordinates (f, x, y, &part, 1); |
| 26844 | 26844 | ||
| 26845 | /* If we were displaying active text in another window, clear that. | 26845 | /* If displaying active text in another window, clear that. */ |
| 26846 | Also clear if we move out of text area in same window. */ | ||
| 26847 | if (! EQ (window, hlinfo->mouse_face_window) | 26846 | if (! EQ (window, hlinfo->mouse_face_window) |
| 26848 | || (part != ON_TEXT && part != ON_MODE_LINE && part != ON_HEADER_LINE | 26847 | /* Also clear if we move out of text area in same window. */ |
| 26849 | && !NILP (hlinfo->mouse_face_window))) | 26848 | || (!NILP (hlinfo->mouse_face_window) |
| 26849 | && !NILP (window) | ||
| 26850 | && part != ON_TEXT | ||
| 26851 | && part != ON_MODE_LINE | ||
| 26852 | && part != ON_HEADER_LINE)) | ||
| 26850 | clear_mouse_face (hlinfo); | 26853 | clear_mouse_face (hlinfo); |
| 26851 | 26854 | ||
| 26852 | /* Not on a window -> return. */ | 26855 | /* Not on a window -> return. */ |
diff --git a/test/ChangeLog b/test/ChangeLog index 396273bab37..dcdef6399e4 100644 --- a/test/ChangeLog +++ b/test/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2011-10-29 Ulf Jasper <ulf.jasper@web.de> | ||
| 2 | |||
| 3 | * automated/newsticker-tests.el | ||
| 4 | (newsticker--group-manage-orphan-feeds): Use fset instead of flet. | ||
| 5 | |||
| 6 | * trunk/test/automated/newsticker-tests.el | ||
| 7 | (newsticker--group-manage-orphan-feeds): Prevent updating | ||
| 8 | newsticker treeview. Fixed bug#9763. | ||
| 9 | |||
| 1 | 2011-10-20 Glenn Morris <rgm@gnu.org> | 10 | 2011-10-20 Glenn Morris <rgm@gnu.org> |
| 2 | 11 | ||
| 3 | * automated/vc-bzr.el (vc-bzr-test-bug9781): New test. | 12 | * automated/vc-bzr.el (vc-bzr-test-bug9781): New test. |
diff --git a/test/automated/newsticker-tests.el b/test/automated/newsticker-tests.el index 76f4345da55..ba7fe20786b 100644 --- a/test/automated/newsticker-tests.el +++ b/test/automated/newsticker-tests.el | |||
| @@ -138,8 +138,14 @@ Apply to INPUT and compare with EXPECTED." | |||
| 138 | Signals an error if something goes wrong." | 138 | Signals an error if something goes wrong." |
| 139 | (let ((newsticker-groups '("Feeds")) | 139 | (let ((newsticker-groups '("Feeds")) |
| 140 | (newsticker-url-list-defaults nil) | 140 | (newsticker-url-list-defaults nil) |
| 141 | (newsticker-url-list '(("feed1") ("feed2") ("feed3")))) | 141 | (newsticker-url-list '(("feed1") ("feed2") ("feed3"))) |
| 142 | t-nttvtu) | ||
| 143 | ;; prevent updating the treeview as it does not exist during fully | ||
| 144 | ;; automated tests | ||
| 145 | (fset 't-nttvtu (symbol-function 'newsticker--treeview-tree-update)) | ||
| 146 | (fset 'newsticker--treeview-tree-update (lambda() nil)) | ||
| 142 | (newsticker--group-manage-orphan-feeds) | 147 | (newsticker--group-manage-orphan-feeds) |
| 148 | (fset 'newsticker--treeview-tree-update (symbol-function 't-nttvtu)) | ||
| 143 | (should (equal '("Feeds" "feed3" "feed2" "feed1") | 149 | (should (equal '("Feeds" "feed3" "feed2" "feed1") |
| 144 | newsticker-groups)))) | 150 | newsticker-groups)))) |
| 145 | 151 | ||