diff options
| author | Karoly Lorentey | 2007-01-06 15:25:16 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2007-01-06 15:25:16 +0000 |
| commit | 191ae1cf7cd2571277635b3b8e488e773ca5c9b9 (patch) | |
| tree | e0b26e3040767dae38fb39a03b757da05088c58f | |
| parent | 382707ecfb50f8c7794a7ba3d8cd9db9b6cd29d0 (diff) | |
| parent | f85c5e3b72855951b071eacb7b6e2d002c5fc4be (diff) | |
| download | emacs-191ae1cf7cd2571277635b3b8e488e773ca5c9b9.tar.gz emacs-191ae1cf7cd2571277635b3b8e488e773ca5c9b9.zip | |
Merged from emacs@sv.gnu.org
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-585
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-586
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-587
Update from erc--emacs--22
* emacs@sv.gnu.org/emacs--devo--0--patch-588
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-589
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-590
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-591
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-592
80 files changed, 2222 insertions, 833 deletions
| @@ -1,3 +1,9 @@ | |||
| 1 | 2007-01-02 Stephen C. Gilardi <scgilardi@gmail.com> (tiny change) | ||
| 2 | |||
| 3 | * configure.in: Detect and use fink-installed in intel-based Mac | ||
| 4 | builds; change Apple Darwin section to support both PowerPC and | ||
| 5 | Intel-based Macs. | ||
| 6 | |||
| 1 | 2006-12-26 Andreas Schwab <schwab@suse.de> | 7 | 2006-12-26 Andreas Schwab <schwab@suse.de> |
| 2 | 8 | ||
| 3 | * Makefile.in (datarootdir): Define. | 9 | * Makefile.in (datarootdir): Define. |
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index 3b7eb8c4560..428b2589886 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | Tasks needed before the next release. | 1 | Tasks needed before the next release. |
| 2 | 2 | ||
| 3 | * UPDATE COPYRIGHTS (Happy New Year :-) | ||
| 4 | |||
| 5 | |||
| 3 | * TO BE DONE SHORTLY BEFORE RELEASE | 6 | * TO BE DONE SHORTLY BEFORE RELEASE |
| 4 | 7 | ||
| 5 | ** Check for widow and orphan lines in manuals; | 8 | ** Check for widow and orphan lines in manuals; |
| @@ -8,7 +11,6 @@ make sure all the pages really look ok in the manual as formatted. | |||
| 8 | ** Check for text in manuals that assumes current version is 21. | 11 | ** Check for text in manuals that assumes current version is 21. |
| 9 | 12 | ||
| 10 | ** Update AUTHORS. | 13 | ** Update AUTHORS. |
| 11 | [Done 2006-10-03] | ||
| 12 | 14 | ||
| 13 | ** Regenerate the postscript files of the reference cards in etc. | 15 | ** Regenerate the postscript files of the reference cards in etc. |
| 14 | 16 | ||
| @@ -48,8 +50,6 @@ to the hack introduced on 2005-07-01 to fix some other Cleartype problem. | |||
| 48 | 50 | ||
| 49 | * BUGS | 51 | * BUGS |
| 50 | 52 | ||
| 51 | ** document gpg-agent. | ||
| 52 | |||
| 53 | ** Need papers from Rubini for his code in t-mouse.el | 53 | ** Need papers from Rubini for his code in t-mouse.el |
| 54 | Sent instructions. | 54 | Sent instructions. |
| 55 | 55 | ||
| @@ -63,8 +63,6 @@ to the hack introduced on 2005-07-01 to fix some other Cleartype problem. | |||
| 63 | ** lennart.borgman.073@student.lu.se, Dec 16: | 63 | ** lennart.borgman.073@student.lu.se, Dec 16: |
| 64 | compilation-previous-error fails if first error is at start of buffer | 64 | compilation-previous-error fails if first error is at start of buffer |
| 65 | 65 | ||
| 66 | ** CC mode fixes to be installed. | ||
| 67 | |||
| 68 | ** W3 status with latest url package. | 66 | ** W3 status with latest url package. |
| 69 | 67 | ||
| 70 | ** Fix up the notices in oldXMenu properly. | 68 | ** Fix up the notices in oldXMenu properly. |
| @@ -74,9 +72,7 @@ to the hack introduced on 2005-07-01 to fix some other Cleartype problem. | |||
| 74 | ** disumu@x3y2z1.net, Nov 22: | 72 | ** disumu@x3y2z1.net, Nov 22: |
| 75 | URL not following some 302 redirects after recent changes | 73 | URL not following some 302 redirects after recent changes |
| 76 | 74 | ||
| 77 | ** Give recommendations for redefining window manager keys | 75 | ** storm@cua.dk, Jan 2: Bug in incremental undrawing of mouseover highlighting |
| 78 | to avoid interference with Emacs. | ||
| 79 | |||
| 80 | ** lennart.borgman.073@student.lu.se, Dec 29: | 76 | ** lennart.borgman.073@student.lu.se, Dec 29: |
| 81 | How global is a define-global-minor-mode mode | 77 | How global is a define-global-minor-mode mode |
| 82 | He says that customizing such a mode simply does not work. | 78 | He says that customizing such a mode simply does not work. |
| @@ -92,6 +88,13 @@ through the custom mechanism. | |||
| 92 | 88 | ||
| 93 | ** pgg bugs reported by rms. | 89 | ** pgg bugs reported by rms. |
| 94 | 90 | ||
| 91 | ** (global-set-key "\M-k" 'bury-buffer) confuses tutorial warnings. | ||
| 92 | |||
| 93 | ** jpff@cs.bath.ac.uk, Jan 5: Failure to submit second netnews message | ||
| 94 | |||
| 95 | ** KSNetz@UseNet.ArcorNews.DE, Jan 5: | ||
| 96 | url-http.el: calling the callback function for proxy connections | ||
| 97 | |||
| 95 | * DOCUMENTATION | 98 | * DOCUMENTATION |
| 96 | 99 | ||
| 97 | ** Check the Emacs Tutorial. | 100 | ** Check the Emacs Tutorial. |
diff --git a/configure.in b/configure.in index fa2ded7309e..f5b3c68b6ba 100644 --- a/configure.in +++ b/configure.in | |||
| @@ -378,6 +378,24 @@ dnl see the `changequote' comment above. | |||
| 378 | machine=apollo opsys=bsd4-3 | 378 | machine=apollo opsys=bsd4-3 |
| 379 | ;; | 379 | ;; |
| 380 | 380 | ||
| 381 | ## Apple Darwin / Mac OS X | ||
| 382 | *-apple-darwin* ) | ||
| 383 | case "${canonical}" in | ||
| 384 | i[3456]86-* ) machine=intel386 ;; | ||
| 385 | powerpc-* ) machine=powermac ;; | ||
| 386 | * ) unported=yes ;; | ||
| 387 | esac | ||
| 388 | opsys=darwin | ||
| 389 | # Define CPP as follows to make autoconf work correctly. | ||
| 390 | CPP="${CC-cc} -E -no-cpp-precomp" | ||
| 391 | # Use fink packages if available. | ||
| 392 | if test -d /sw/include && test -d /sw/lib; then | ||
| 393 | GCC_TEST_OPTIONS="-I/sw/include -L/sw/lib" | ||
| 394 | CPP="${CPP} ${GCC_TEST_OPTIONS}" | ||
| 395 | NON_GCC_TEST_OPTIONS=${GCC_TEST_OPTIONS} | ||
| 396 | fi | ||
| 397 | ;; | ||
| 398 | |||
| 381 | ## AT&T 3b2, 3b5, 3b15, 3b20 | 399 | ## AT&T 3b2, 3b5, 3b15, 3b20 |
| 382 | we32k-att-sysv* ) | 400 | we32k-att-sysv* ) |
| 383 | machine=att3b opsys=usg5-2-2 | 401 | machine=att3b opsys=usg5-2-2 |
| @@ -1154,19 +1172,6 @@ dnl see the `changequote' comment above. | |||
| 1154 | machine=f301 opsys=uxpv | 1172 | machine=f301 opsys=uxpv |
| 1155 | ;; | 1173 | ;; |
| 1156 | 1174 | ||
| 1157 | ## Darwin / Mac OS X | ||
| 1158 | powerpc-apple-darwin* ) | ||
| 1159 | machine=powermac opsys=darwin | ||
| 1160 | # Define CPP as follows to make autoconf work correctly. | ||
| 1161 | CPP="${CC-cc} -E -no-cpp-precomp" | ||
| 1162 | # Use fink packages if available. | ||
| 1163 | if test -d /sw/include && test -d /sw/lib; then | ||
| 1164 | GCC_TEST_OPTIONS="-I/sw/include -L/sw/lib" | ||
| 1165 | CPP="${CPP} ${GCC_TEST_OPTIONS}" | ||
| 1166 | NON_GCC_TEST_OPTIONS=${GCC_TEST_OPTIONS} | ||
| 1167 | fi | ||
| 1168 | ;; | ||
| 1169 | |||
| 1170 | ## AMD x86-64 Linux-based GNU system | 1175 | ## AMD x86-64 Linux-based GNU system |
| 1171 | x86_64-*-linux-gnu* ) | 1176 | x86_64-*-linux-gnu* ) |
| 1172 | machine=amdx86-64 opsys=gnu-linux | 1177 | machine=amdx86-64 opsys=gnu-linux |
diff --git a/etc/ChangeLog b/etc/ChangeLog index 735198a497b..a4fcc77a887 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2006-06-30 Francesco Potort,Al(B <pot@gnu.org> | ||
| 2 | |||
| 3 | * etags.1: Undocument the --no-warn option. | ||
| 4 | |||
| 1 | 2006-12-17 Richard Stallman <rms@gnu.org> | 5 | 2006-12-17 Richard Stallman <rms@gnu.org> |
| 2 | 6 | ||
| 3 | * TUTORIAL: Say that C-d and DEL with arg do killing. | 7 | * TUTORIAL: Say that C-d and DEL with arg do killing. |
diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS index 5b0cd6f260f..a927419c8c7 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS | |||
| @@ -8,6 +8,20 @@ an alias of `erc'. Likewise, `erc-select-ssl' has been renamed to | |||
| 8 | `erc-ssl' with `erc-select-ssl' as its alias. The function that was | 8 | `erc-ssl' with `erc-select-ssl' as its alias. The function that was |
| 9 | known as `erc' is now `erc-open'. | 9 | known as `erc' is now `erc-open'. |
| 10 | 10 | ||
| 11 | ** New command: /RECONNECT | ||
| 12 | This command tries to reconnect to the current IRC server exactly | ||
| 13 | once. It does not work in server buffers (throws an error before the | ||
| 14 | command is run), but works in query and channel buffers. | ||
| 15 | |||
| 16 | ** New options | ||
| 17 | |||
| 18 | *** erc-server-reconnect-attempts: Determines the number of | ||
| 19 | reconnection attempts that ERC will make per server. | ||
| 20 | |||
| 21 | *** erc-server-reconnect-timeout: New option that determines the | ||
| 22 | amount of time, in seconds, that ERC will wait between successive | ||
| 23 | reconnect attempts. | ||
| 24 | |||
| 11 | ** Changes and additions to modules | 25 | ** Changes and additions to modules |
| 12 | 26 | ||
| 13 | *** Channel lists (erc-list.el) | 27 | *** Channel lists (erc-list.el) |
| @@ -79,6 +79,8 @@ current buffer. | |||
| 79 | 79 | ||
| 80 | ** The toolbar should show keyboard equivalents in its tooltips. | 80 | ** The toolbar should show keyboard equivalents in its tooltips. |
| 81 | 81 | ||
| 82 | ** Add function to redraw the tool bar. | ||
| 83 | |||
| 82 | ** Modify allout.el to use overlays, like outline.el. | 84 | ** Modify allout.el to use overlays, like outline.el. |
| 83 | 85 | ||
| 84 | ** M-! M-n should fetch the buffer-file-name as the default. | 86 | ** M-! M-n should fetch the buffer-file-name as the default. |
diff --git a/etc/etags.1 b/etc/etags.1 index 80fe2843b91..c6bdc7e8ffd 100644 --- a/etc/etags.1 +++ b/etc/etags.1 | |||
| @@ -37,7 +37,7 @@ etags, ctags \- generate tag file for Emacs, vi | |||
| 37 | [\|\-\-language=\fIlanguage\fP\|] [\|\-\-members\|] | 37 | [\|\-\-language=\fIlanguage\fP\|] [\|\-\-members\|] |
| 38 | [\|\-\-output=\fItagfile\fP\|] [\|\-\-regex=\fIregexp\fP\|] | 38 | [\|\-\-output=\fItagfile\fP\|] [\|\-\-regex=\fIregexp\fP\|] |
| 39 | [\|\-\-typedefs\|] [\|\-\-typedefs\-and\-c++\|] | 39 | [\|\-\-typedefs\|] [\|\-\-typedefs\-and\-c++\|] |
| 40 | [\|\-\-update\|] [\|\-\-no\-warn\|] | 40 | [\|\-\-update\|] |
| 41 | [\|\-\-help\|] [\|\-\-version\|] | 41 | [\|\-\-help\|] [\|\-\-version\|] |
| 42 | \fIfile\fP .\|.\|. | 42 | \fIfile\fP .\|.\|. |
| 43 | .ad b | 43 | .ad b |
| @@ -262,11 +262,6 @@ Only \fBctags\fP accepts this option. | |||
| 262 | Instead of generating a tag file, write index (in \fBvgrind\fP format) | 262 | Instead of generating a tag file, write index (in \fBvgrind\fP format) |
| 263 | to standard output. Only \fBctags\fP accepts this option. | 263 | to standard output. Only \fBctags\fP accepts this option. |
| 264 | .TP | 264 | .TP |
| 265 | .B \-w, \-\-no\-warn | ||
| 266 | Suppress warning messages about duplicate entries. The \fBetags\fP | ||
| 267 | program does not check for duplicate entries, so this option is not | ||
| 268 | allowed with it. | ||
| 269 | .TP | ||
| 270 | .B \-x, \-\-cxref | 265 | .B \-x, \-\-cxref |
| 271 | Instead of generating a tag file, write a cross reference (in | 266 | Instead of generating a tag file, write a cross reference (in |
| 272 | \fBcxref\fP format) to standard output. Only \fBctags\fP accepts this option. | 267 | \fBcxref\fP format) to standard output. Only \fBctags\fP accepts this option. |
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 76a0dcf1b9e..fd0f61a6eff 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2007-01-02 Francesco Potort,Al(B <pot@gnu.org> | ||
| 2 | |||
| 3 | * etags.c: (longopts): New undocumented option --no-duplicates. | ||
| 4 | (no_duplicates): Static variables for the above option. | ||
| 5 | (print_help): Do not print help for --no-warn, now undocumented. | ||
| 6 | (add_node): Allow duplicate tags in ctags mode unless --no-duplicates. | ||
| 7 | (main): Pass the -u option to sort in ctags mode. | ||
| 8 | |||
| 1 | 2006-12-28 Francesco Potort,Al(B <pot@gnu.org> | 9 | 2006-12-28 Francesco Potort,Al(B <pot@gnu.org> |
| 2 | 10 | ||
| 3 | * etags.c (readline): When creating a relative file name from a | 11 | * etags.c (readline): When creating a relative file name from a |
diff --git a/lib-src/etags.c b/lib-src/etags.c index c4f7fdc4d69..43ce2fdf3eb 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c | |||
| @@ -41,7 +41,7 @@ | |||
| 41 | * configuration file containing regexp definitions for etags. | 41 | * configuration file containing regexp definitions for etags. |
| 42 | */ | 42 | */ |
| 43 | 43 | ||
| 44 | char pot_etags_version[] = "@(#) pot revision number is 17.25"; | 44 | char pot_etags_version[] = "@(#) pot revision number is 17.26"; |
| 45 | 45 | ||
| 46 | #define TRUE 1 | 46 | #define TRUE 1 |
| 47 | #define FALSE 0 | 47 | #define FALSE 0 |
| @@ -456,9 +456,10 @@ static bool globals; /* create tags for global variables */ | |||
| 456 | static bool declarations; /* --declarations: tag them and extern in C&Co*/ | 456 | static bool declarations; /* --declarations: tag them and extern in C&Co*/ |
| 457 | static bool members; /* create tags for C member variables */ | 457 | static bool members; /* create tags for C member variables */ |
| 458 | static bool no_line_directive; /* ignore #line directives (undocumented) */ | 458 | static bool no_line_directive; /* ignore #line directives (undocumented) */ |
| 459 | static bool no_duplicates; /* no duplicate tags for ctags (undocumented) */ | ||
| 459 | static bool update; /* -u: update tags */ | 460 | static bool update; /* -u: update tags */ |
| 460 | static bool vgrind_style; /* -v: create vgrind style index output */ | 461 | static bool vgrind_style; /* -v: create vgrind style index output */ |
| 461 | static bool no_warnings; /* -w: suppress warnings */ | 462 | static bool no_warnings; /* -w: suppress warnings (undocumented) */ |
| 462 | static bool cxref_style; /* -x: create cxref style output */ | 463 | static bool cxref_style; /* -x: create cxref style output */ |
| 463 | static bool cplusplus; /* .[hc] means C++, not C */ | 464 | static bool cplusplus; /* .[hc] means C++, not C */ |
| 464 | static bool ignoreindent; /* -I: ignore indentation in C */ | 465 | static bool ignoreindent; /* -I: ignore indentation in C */ |
| @@ -477,39 +478,40 @@ static bool need_filebuf; /* some regexes are multi-line */ | |||
| 477 | 478 | ||
| 478 | static struct option longopts[] = | 479 | static struct option longopts[] = |
| 479 | { | 480 | { |
| 480 | { "append", no_argument, NULL, 'a' }, | 481 | { "append", no_argument, NULL, 'a' }, |
| 481 | { "packages-only", no_argument, &packages_only, TRUE }, | 482 | { "packages-only", no_argument, &packages_only, TRUE }, |
| 482 | { "c++", no_argument, NULL, 'C' }, | 483 | { "c++", no_argument, NULL, 'C' }, |
| 483 | { "declarations", no_argument, &declarations, TRUE }, | 484 | { "declarations", no_argument, &declarations, TRUE }, |
| 484 | { "no-line-directive", no_argument, &no_line_directive, TRUE }, | 485 | { "no-line-directive", no_argument, &no_line_directive, TRUE }, |
| 485 | { "help", no_argument, NULL, 'h' }, | 486 | { "no-duplicates", no_argument, &no_duplicates, TRUE }, |
| 486 | { "help", no_argument, NULL, 'H' }, | 487 | { "help", no_argument, NULL, 'h' }, |
| 487 | { "ignore-indentation", no_argument, NULL, 'I' }, | 488 | { "help", no_argument, NULL, 'H' }, |
| 488 | { "language", required_argument, NULL, 'l' }, | 489 | { "ignore-indentation", no_argument, NULL, 'I' }, |
| 489 | { "members", no_argument, &members, TRUE }, | 490 | { "language", required_argument, NULL, 'l' }, |
| 490 | { "no-members", no_argument, &members, FALSE }, | 491 | { "members", no_argument, &members, TRUE }, |
| 491 | { "output", required_argument, NULL, 'o' }, | 492 | { "no-members", no_argument, &members, FALSE }, |
| 492 | { "regex", required_argument, NULL, 'r' }, | 493 | { "output", required_argument, NULL, 'o' }, |
| 493 | { "no-regex", no_argument, NULL, 'R' }, | 494 | { "regex", required_argument, NULL, 'r' }, |
| 494 | { "ignore-case-regex", required_argument, NULL, 'c' }, | 495 | { "no-regex", no_argument, NULL, 'R' }, |
| 496 | { "ignore-case-regex", required_argument, NULL, 'c' }, | ||
| 495 | { "parse-stdin", required_argument, NULL, STDIN }, | 497 | { "parse-stdin", required_argument, NULL, STDIN }, |
| 496 | { "version", no_argument, NULL, 'V' }, | 498 | { "version", no_argument, NULL, 'V' }, |
| 497 | 499 | ||
| 498 | #if CTAGS /* Ctags options */ | 500 | #if CTAGS /* Ctags options */ |
| 499 | { "backward-search", no_argument, NULL, 'B' }, | 501 | { "backward-search", no_argument, NULL, 'B' }, |
| 500 | { "cxref", no_argument, NULL, 'x' }, | 502 | { "cxref", no_argument, NULL, 'x' }, |
| 501 | { "defines", no_argument, NULL, 'd' }, | 503 | { "defines", no_argument, NULL, 'd' }, |
| 502 | { "globals", no_argument, &globals, TRUE }, | 504 | { "globals", no_argument, &globals, TRUE }, |
| 503 | { "typedefs", no_argument, NULL, 't' }, | 505 | { "typedefs", no_argument, NULL, 't' }, |
| 504 | { "typedefs-and-c++", no_argument, NULL, 'T' }, | 506 | { "typedefs-and-c++", no_argument, NULL, 'T' }, |
| 505 | { "update", no_argument, NULL, 'u' }, | 507 | { "update", no_argument, NULL, 'u' }, |
| 506 | { "vgrind", no_argument, NULL, 'v' }, | 508 | { "vgrind", no_argument, NULL, 'v' }, |
| 507 | { "no-warn", no_argument, NULL, 'w' }, | 509 | { "no-warn", no_argument, NULL, 'w' }, |
| 508 | 510 | ||
| 509 | #else /* Etags options */ | 511 | #else /* Etags options */ |
| 510 | { "no-defines", no_argument, NULL, 'D' }, | 512 | { "no-defines", no_argument, NULL, 'D' }, |
| 511 | { "no-globals", no_argument, &globals, FALSE }, | 513 | { "no-globals", no_argument, &globals, FALSE }, |
| 512 | { "include", required_argument, NULL, 'i' }, | 514 | { "include", required_argument, NULL, 'i' }, |
| 513 | #endif | 515 | #endif |
| 514 | { NULL } | 516 | { NULL } |
| 515 | }; | 517 | }; |
| @@ -976,9 +978,13 @@ Relative ones are stored relative to the output file's directory.\n"); | |||
| 976 | Print on the standard output an index of items intended for\n\ | 978 | Print on the standard output an index of items intended for\n\ |
| 977 | human consumption, similar to the output of vgrind. The index\n\ | 979 | human consumption, similar to the output of vgrind. The index\n\ |
| 978 | is sorted, and gives the page number of each item."); | 980 | is sorted, and gives the page number of each item."); |
| 981 | # if PRINT_UNDOCUMENTED_OPTIONS_HELP | ||
| 982 | puts ("-w, --no-duplicates\n\ | ||
| 983 | Do not create duplicate tag entries, for compatibility with\n\ | ||
| 984 | traditional ctags."); | ||
| 979 | puts ("-w, --no-warn\n\ | 985 | puts ("-w, --no-warn\n\ |
| 980 | Suppress warning messages about entries defined in multiple\n\ | 986 | Suppress warning messages about duplicate tag entries."); |
| 981 | files."); | 987 | # endif /* PRINT_UNDOCUMENTED_OPTIONS_HELP */ |
| 982 | puts ("-x, --cxref\n\ | 988 | puts ("-x, --cxref\n\ |
| 983 | Like --vgrind, but in the style of cxref, rather than vgrind.\n\ | 989 | Like --vgrind, but in the style of cxref, rather than vgrind.\n\ |
| 984 | The output uses line numbers instead of page numbers, but\n\ | 990 | The output uses line numbers instead of page numbers, but\n\ |
| @@ -1454,8 +1460,11 @@ main (argc, argv) | |||
| 1454 | if (CTAGS) | 1460 | if (CTAGS) |
| 1455 | if (append_to_tagfile || update) | 1461 | if (append_to_tagfile || update) |
| 1456 | { | 1462 | { |
| 1457 | char cmd[2*BUFSIZ+10]; | 1463 | char cmd[2*BUFSIZ+20]; |
| 1458 | sprintf (cmd, "sort -o %.*s %.*s", BUFSIZ, tagfile, BUFSIZ, tagfile); | 1464 | /* Maybe these should be used: |
| 1465 | setenv ("LC_COLLATE", "C", 1); | ||
| 1466 | setenv ("LC_ALL", "C", 1); */ | ||
| 1467 | sprintf (cmd, "sort -u -o %.*s %.*s", BUFSIZ, tagfile, BUFSIZ, tagfile); | ||
| 1459 | exit (system (cmd)); | 1468 | exit (system (cmd)); |
| 1460 | } | 1469 | } |
| 1461 | return EXIT_SUCCESS; | 1470 | return EXIT_SUCCESS; |
| @@ -2168,7 +2177,7 @@ add_node (np, cur_node_p) | |||
| 2168 | * If this tag name matches an existing one, then | 2177 | * If this tag name matches an existing one, then |
| 2169 | * do not add the node, but maybe print a warning. | 2178 | * do not add the node, but maybe print a warning. |
| 2170 | */ | 2179 | */ |
| 2171 | if (!dif) | 2180 | if (no_duplicates && !dif) |
| 2172 | { | 2181 | { |
| 2173 | if (np->fdp == cur_node->fdp) | 2182 | if (np->fdp == cur_node->fdp) |
| 2174 | { | 2183 | { |
| @@ -6885,6 +6894,7 @@ xrealloc (ptr, size) | |||
| 6885 | * tab-width: 8 | 6894 | * tab-width: 8 |
| 6886 | * fill-column: 79 | 6895 | * fill-column: 79 |
| 6887 | * c-font-lock-extra-types: ("FILE" "bool" "language" "linebuffer" "fdesc" "node" "regexp") | 6896 | * c-font-lock-extra-types: ("FILE" "bool" "language" "linebuffer" "fdesc" "node" "regexp") |
| 6897 | * c-file-style: gnu | ||
| 6888 | * End: | 6898 | * End: |
| 6889 | */ | 6899 | */ |
| 6890 | 6900 | ||
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1cd2f794e5f..d1825190c1a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,173 @@ | |||
| 1 | 2007-01-05 Takaaki Ota <Takaaki.Ota@am.sony.com> | ||
| 2 | |||
| 3 | * textmodes/table.el (table--warn-incompatibility): | ||
| 4 | Use display-warning instead of momentary-string-display. | ||
| 5 | |||
| 6 | 2007-01-05 Richard Stallman <rms@gnu.org> | ||
| 7 | |||
| 8 | * image.el (image-type-header-regexps): Recognize xbm more strictly. | ||
| 9 | |||
| 10 | * simple.el (backward-kill-word): Doc fix. | ||
| 11 | |||
| 12 | 2007-01-05 Romain Francoise <romain@orebokech.com> | ||
| 13 | |||
| 14 | * international/mule.el (sgml-html-meta-auto-coding-function): | ||
| 15 | Ensure that the buffer contains a HTML document. | ||
| 16 | |||
| 17 | 2007-01-05 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 18 | |||
| 19 | * faces.el (momentary): Move here ... | ||
| 20 | * subr.el (momentary): ... from here. | ||
| 21 | |||
| 22 | 2007-01-05 Nick Roberts <nickrob@snap.net.nz> | ||
| 23 | |||
| 24 | * progmodes/gdb-ui.el (gdb-max-children): New customizable variable. | ||
| 25 | (gdb-speedbar-expand-node): Ask user for confirmation before expanding | ||
| 26 | large structures/arrays. | ||
| 27 | |||
| 28 | 2007-01-04 Juanma Barranquero <lekktu@gmail.com> | ||
| 29 | |||
| 30 | * files.el (find-file-noselect-1, set-visited-file-name): | ||
| 31 | Allow backup-enable-predicate to be nil. | ||
| 32 | |||
| 33 | 2007-01-04 Kevin Rodgers <kevin.d.rodgers@gmail.com> | ||
| 34 | |||
| 35 | * subr.el (momentary): New face. | ||
| 36 | (momentary-string-display): Display the string via a temporary | ||
| 37 | overlay using the new face, instead of inserting it in the buffer. | ||
| 38 | |||
| 39 | 2007-01-04 Andreas Schwab <schwab@suse.de> | ||
| 40 | |||
| 41 | * progmodes/ebrowse.el (ebrowse-global-prefix-key): Fix typo in | ||
| 42 | last change. | ||
| 43 | |||
| 44 | 2007-01-03 Richard Stallman <rms@gnu.org> | ||
| 45 | |||
| 46 | * woman.el (woman-decode-buffer): Clarify error message. | ||
| 47 | |||
| 48 | 2007-01-03 Alan Mackenzie <acm@muc.de> | ||
| 49 | |||
| 50 | * progmode/cc-cmds.el (c-mask-paragraph): Fix yesterday's buggy | ||
| 51 | patch. | ||
| 52 | |||
| 53 | 2007-01-03 Chris Moore <christopher.ian.moore@gmail.com> (tiny change) | ||
| 54 | |||
| 55 | * tutorial.el (tutorial--describe-nonstandard-key): Fix typo. | ||
| 56 | |||
| 57 | 2007-01-03 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 58 | |||
| 59 | * iswitchb.el (iswitchb-global-map): Use command-remapping if available. | ||
| 60 | |||
| 61 | 2007-01-02 Juanma Barranquero <lekktu@gmail.com> | ||
| 62 | |||
| 63 | * emulation/viper.el (viper-custom-file-name, viper-mode): | ||
| 64 | Fix typos in docstrings. | ||
| 65 | |||
| 66 | * subr.el (momentary-string-display): After moving point, set POS | ||
| 67 | variable to it to avoid later errors once the buffer is modified. | ||
| 68 | Doc fix. | ||
| 69 | |||
| 70 | 2007-01-02 Alan Mackenzie <acm@muc.de> | ||
| 71 | |||
| 72 | * progmodes/cc-cmds.el (c-mask-paragraph): In a block comment, | ||
| 73 | check that the "*/" is present before trying to manipulate it. | ||
| 74 | |||
| 75 | 2007-01-02 Richard Stallman <rms@gnu.org> | ||
| 76 | |||
| 77 | * wid-edit.el (widget-choose): Avoid ugly error for function keys. | ||
| 78 | |||
| 79 | * progmodes/cfengine.el (cfengine-font-lock-syntactic-keywords): | ||
| 80 | Fix format of value. | ||
| 81 | |||
| 82 | * cus-edit.el (customize-unsaved): Rename from customize-customized. | ||
| 83 | Change messages accordingly. | ||
| 84 | (customize-customized): Now alias. | ||
| 85 | |||
| 86 | 2007-01-02 Juanma Barranquero <lekktu@gmail.com> | ||
| 87 | |||
| 88 | * files.el (version-control): Doc fix. | ||
| 89 | |||
| 90 | 2007-01-01 Alan Mackenzie <acm@muc.de> | ||
| 91 | |||
| 92 | * progmodes/cc-engine.el (c-guess-basic-syntax, case 5N): | ||
| 93 | Check the format of c-state-cache is valid for an optimisation before | ||
| 94 | using it. | ||
| 95 | |||
| 96 | * progmodes/cc-engine.el (c-guess-basic-syntax): New case 5Q "we | ||
| 97 | are at a statement within a macro". Other changes so that only | ||
| 98 | the first continuation line in a macro gets the symbol | ||
| 99 | `cpp-define-intro', the others getting `statement', or whatever. | ||
| 100 | |||
| 101 | * progmodes/cc-cmds.el (c-context-line-break): When invoked within | ||
| 102 | a string, preserve whitespace. Add a backslash only when also in | ||
| 103 | a macro. | ||
| 104 | |||
| 105 | * progmodes/cc-defs.el: Correct typos. | ||
| 106 | |||
| 107 | * progmodes/cc-cmds.el (c-context-line-break): Don't indent the | ||
| 108 | new line after an escaped EOL in a string. | ||
| 109 | |||
| 110 | * progmodes/cc-engine.el (c-forward-label): Recognise "foo:" as a | ||
| 111 | label when it directly follows "else", "do", .... | ||
| 112 | |||
| 113 | * progmodes/cc-engine.el (c-backward-<>-arglist): Tolerate empty | ||
| 114 | angle brackets (as seen in "explicit specialisations" of C++ | ||
| 115 | templates). | ||
| 116 | |||
| 117 | * progmodes/cc-vars.el (c-indentation-style): Mention c-file-style | ||
| 118 | in the doc-string. | ||
| 119 | |||
| 120 | * progmodes/cc-cmds.el (c-mask-paragraph): Fix for C comments, | ||
| 121 | when the comment ender looks like "=========*/" and is alone on | ||
| 122 | its line. | ||
| 123 | |||
| 124 | * progmodes/cc-langs.el, progmodes/cc-engine.el: Correct the | ||
| 125 | spelling of c-opt-op-identiTier-prefix, t -> f. Leave an alias | ||
| 126 | for the old name. | ||
| 127 | |||
| 128 | * progmodes/cc-mode.el: Bind C-M-a and C-M-e to | ||
| 129 | c-\(beginning\|end\)-of-defun by default. | ||
| 130 | |||
| 131 | * progmodes/cc-align.el (c-lineup-gnu-DEFUN-intro-cont): | ||
| 132 | New line-up function, for the DEFUN macro in the Emacs C sources. | ||
| 133 | Only used in "gnu" style. | ||
| 134 | |||
| 135 | * progmodes/cc-styles.el (c-style-alist): Use this new function in | ||
| 136 | the "gnu" style. | ||
| 137 | |||
| 138 | * progmodes/cc-cmds.el (c-electric-slash): Extend the handling of | ||
| 139 | clean-up comment-close-slash also to work when there's a comment | ||
| 140 | terminator on the line. | ||
| 141 | (c-beginning-of-defun, c-end-of-defun): Refactor and optimise | ||
| 142 | these for large arg - only take account of top level {..}, except | ||
| 143 | for initial and final adjustments. M-- C-M-[ae] now go to the | ||
| 144 | right defuns when the starting point is between defuns. They use | ||
| 145 | the four new functions: | ||
| 146 | (c-in-function-trailer-p, c-where-wrt-brace-construct) | ||
| 147 | (c-backward-to-nth-BOF-{, c-forward-to-nth-EOF-}): New functions to | ||
| 148 | support c-\(beginning\|end\)-of-defun. | ||
| 149 | |||
| 150 | * progmodes/cc-engine.el (c-forward-label): Analyze ":" | ||
| 151 | expressions more rigorously, to exclude bit-field specifiers from | ||
| 152 | being classed as labels. | ||
| 153 | (c-forward-label): When analyzing a ":" within a macro, be careful | ||
| 154 | about using c-forward-syntactic-ws at the macro beginning. | ||
| 155 | (c-beginning-of-decl-1): Whilst searching for "=" as evidence of a | ||
| 156 | stmt boundary, check for "operator=", etc. | ||
| 157 | |||
| 158 | * progmodes/cc-mode.el (c-postprocess-file-styles): | ||
| 159 | Bind inhibit-read-only to t, around the call to | ||
| 160 | c-remove-any-local-eval-or-mode-variables, so that it works on a | ||
| 161 | RO file. | ||
| 162 | |||
| 163 | * progmodes/cc-defs.el (c-version): Update the version number to | ||
| 164 | "5.31.4". | ||
| 165 | |||
| 166 | 2007-01-01 Richard Stallman <rms@gnu.org> | ||
| 167 | |||
| 168 | * isearch.el (isearch-done): Use FOUND-POINT or FOUND-START | ||
| 169 | only if we restored isearch-window-configuration. | ||
| 170 | |||
| 1 | 2006-12-31 Romain Francoise <romain@orebokech.com> | 171 | 2006-12-31 Romain Francoise <romain@orebokech.com> |
| 2 | 172 | ||
| 3 | * net/tramp.el (tramp-default-method): Don't use `symbol-function'. | 173 | * net/tramp.el (tramp-default-method): Don't use `symbol-function'. |
| @@ -165,9 +335,9 @@ | |||
| 165 | 335 | ||
| 166 | 2006-12-25 Michael R. Mauger <mmaug@yahoo.com> | 336 | 2006-12-25 Michael R. Mauger <mmaug@yahoo.com> |
| 167 | 337 | ||
| 168 | * progmodes/sql.el (sql-mode-abbrev-table): Corrected initialization. | 338 | * progmodes/sql.el (sql-mode-abbrev-table): Correct initialization. |
| 169 | (sql-mode-syntax-table): Disable double quoted strings. | 339 | (sql-mode-syntax-table): Disable double quoted strings. |
| 170 | (sql-mode-font-lock-object-name): Added TYPE and TYPE BODY. | 340 | (sql-mode-font-lock-object-name): Add TYPE and TYPE BODY. |
| 171 | 341 | ||
| 172 | 2006-12-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 342 | 2006-12-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
| 173 | 343 | ||
| @@ -2216,8 +2386,8 @@ | |||
| 2216 | 2386 | ||
| 2217 | 2006-10-19 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | 2387 | 2006-10-19 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> |
| 2218 | 2388 | ||
| 2219 | * select.el (ccl-check-utf-8, string-utf-8-p): New functions | 2389 | * select.el (ccl-check-utf-8, string-utf-8-p): New functions (by |
| 2220 | (by Kenichi Handa). | 2390 | Kenichi Handa). |
| 2221 | (xselect-convert-to-string): Decline requests for UTF8_STRING if | 2391 | (xselect-convert-to-string): Decline requests for UTF8_STRING if |
| 2222 | the selection is not UTF-8. | 2392 | the selection is not UTF-8. |
| 2223 | 2393 | ||
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 59026942281..27ce163157b 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el | |||
| @@ -1320,9 +1320,11 @@ suggest to customize that face, if it's customizable." | |||
| 1320 | (format "*Customize Face: %s*" | 1320 | (format "*Customize Face: %s*" |
| 1321 | (custom-unlispify-tag-name face))))) | 1321 | (custom-unlispify-tag-name face))))) |
| 1322 | 1322 | ||
| 1323 | (defalias 'customize-customized 'customize-unsaved) | ||
| 1324 | |||
| 1323 | ;;;###autoload | 1325 | ;;;###autoload |
| 1324 | (defun customize-customized () | 1326 | (defun customize-unsaved () |
| 1325 | "Customize all user options set since the last save in this session." | 1327 | "Customize all user options set in this session but not saved." |
| 1326 | (interactive) | 1328 | (interactive) |
| 1327 | (let ((found nil)) | 1329 | (let ((found nil)) |
| 1328 | (mapatoms (lambda (symbol) | 1330 | (mapatoms (lambda (symbol) |
| @@ -1335,9 +1337,9 @@ suggest to customize that face, if it's customizable." | |||
| 1335 | (boundp symbol) | 1337 | (boundp symbol) |
| 1336 | (push (list symbol 'custom-variable) found)))) | 1338 | (push (list symbol 'custom-variable) found)))) |
| 1337 | (if (not found) | 1339 | (if (not found) |
| 1338 | (error "No customized user options") | 1340 | (error "No user options are set but unsaved") |
| 1339 | (custom-buffer-create (custom-sort-items found t nil) | 1341 | (custom-buffer-create (custom-sort-items found t nil) |
| 1340 | "*Customize Customized*")))) | 1342 | "*Customize Unsaved*")))) |
| 1341 | 1343 | ||
| 1342 | ;;;###autoload | 1344 | ;;;###autoload |
| 1343 | (defun customize-rogue () | 1345 | (defun customize-rogue () |
diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el index fd1a8aa92ea..4173856fdd1 100644 --- a/lisp/emulation/viper.el +++ b/lisp/emulation/viper.el | |||
| @@ -325,7 +325,7 @@ | |||
| 325 | 325 | ||
| 326 | ;; better be defined before Viper custom group. | 326 | ;; better be defined before Viper custom group. |
| 327 | (defvar viper-custom-file-name (convert-standard-filename "~/.viper") | 327 | (defvar viper-custom-file-name (convert-standard-filename "~/.viper") |
| 328 | "Viper customisation file. | 328 | "Viper customization file. |
| 329 | If set by the user, this must be done _before_ Viper is loaded in `~/.emacs'.") | 329 | If set by the user, this must be done _before_ Viper is loaded in `~/.emacs'.") |
| 330 | 330 | ||
| 331 | (defgroup viper nil | 331 | (defgroup viper nil |
| @@ -360,7 +360,7 @@ user decide when to invoke Viper in a major mode." | |||
| 360 | (t 'ask)) | 360 | (t 'ask)) |
| 361 | "To Viperize or not to Viperize. | 361 | "To Viperize or not to Viperize. |
| 362 | If t, viperize Emacs. If nil -- don't. If `ask', ask the user. | 362 | If t, viperize Emacs. If nil -- don't. If `ask', ask the user. |
| 363 | This variable is used primatily when Viper is being loaded. | 363 | This variable is used primarily when Viper is being loaded. |
| 364 | 364 | ||
| 365 | Must be set in `~/.emacs' before Viper is loaded. | 365 | Must be set in `~/.emacs' before Viper is loaded. |
| 366 | DO NOT set this variable interactively, unless you are using the customization | 366 | DO NOT set this variable interactively, unless you are using the customization |
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index b356f83b0b2..fa087fb513f 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog | |||
| @@ -1,3 +1,56 @@ | |||
| 1 | 2006-12-28 Michael Olson <mwolson@gnu.org> | ||
| 2 | |||
| 3 | * erc-list.el: Change header to mention that this is part of ERC, | ||
| 4 | rather than GNU Emacs. | ||
| 5 | |||
| 6 | * erc-networks.el (erc-server-alist): Add Ars OpenIRC and | ||
| 7 | LinuxChix networks. Thanks to Angelina Carlton for mentioning | ||
| 8 | them. Properly escape periods in Konfido.Net and Kewl.Org. | ||
| 9 | (erc-networks-alist): Add entries for Ars and LinuxChix, though | ||
| 10 | the latter does not actually provide an announced network name. | ||
| 11 | |||
| 12 | * erc-services.el (erc-nickserv-identify-mode): Add 'both method, | ||
| 13 | which waits for a NickServ message if the network supports it, | ||
| 14 | otherwise sends the password after connecting. | ||
| 15 | (erc-nickserv-identify-mode): Default to 'both. | ||
| 16 | (erc-nickserv-passwords): Add OFTC and Azzurra to custom options. | ||
| 17 | (erc-nickserv-alist): Indentation fix. | ||
| 18 | (erc-nickserv-identify-on-connect) | ||
| 19 | (erc-nickserv-identify-on-nick-change): Handle 'both method. | ||
| 20 | |||
| 21 | 2006-12-28 Leo <sdl.web@gmail.com> (tiny change) | ||
| 22 | |||
| 23 | * erc.el (erc-iswitchb): Wrap body in unwind-protect so that | ||
| 24 | hitting C-g does not leave iswitchb-mode on. | ||
| 25 | |||
| 26 | 2006-12-27 Michael Olson <mwolson@gnu.org> | ||
| 27 | |||
| 28 | * erc.el (erc-cmd-RECONNECT): New command that calls | ||
| 29 | erc-server-reconnect. | ||
| 30 | |||
| 31 | * erc-backend.el (erc-server-reconnect-count): New server variable | ||
| 32 | that keeps track of reconnection attempts. | ||
| 33 | (erc-server-reconnect-attempts): New option that determines the | ||
| 34 | number of reconnection attempts that ERC will make per server. | ||
| 35 | (erc-server-reconnect-timeout): New option that determines the | ||
| 36 | amount of time, in seconds, that ERC will wait between successive | ||
| 37 | reconnect attempts. | ||
| 38 | (erc-server-reconnect): New function that reestablishes the | ||
| 39 | current IRC connection. Move some commands from | ||
| 40 | erc-process-sentinel-1 here. | ||
| 41 | (erc-process-sentinel-1): If we have been disconnected, loop until | ||
| 42 | we either reconnect or run out of attempts. | ||
| 43 | (erc-server-reconnect-p): Move higher and make this a defsubst, | ||
| 44 | since I'm worried about the current buffer changing from | ||
| 45 | underneath us. Implement limit of number of reconnect attempts.. | ||
| 46 | |||
| 47 | * erc.texi (Getting Started): Update for /RECONNECT command. | ||
| 48 | |||
| 49 | 2006-12-26 Michael Olson <mwolson@gnu.org> | ||
| 50 | |||
| 51 | * erc.el (erc-open): Restore old point correctly, or at least get | ||
| 52 | closer to doing so than before. | ||
| 53 | |||
| 1 | 2006-12-13 Leo <sdl.web@gmail.com> (tiny change) | 54 | 2006-12-13 Leo <sdl.web@gmail.com> (tiny change) |
| 2 | 55 | ||
| 3 | * erc.el (erc-iswitchb): Temporarily enable iswitchb mode if it | 56 | * erc.el (erc-iswitchb): Temporarily enable iswitchb mode if it |
| @@ -38,7 +91,7 @@ | |||
| 38 | (erc-update-current-channel-member, erc-load-script): | 91 | (erc-update-current-channel-member, erc-load-script): |
| 39 | (erc-mode-line-away-status-format): Doc fixes. | 92 | (erc-mode-line-away-status-format): Doc fixes. |
| 40 | 93 | ||
| 41 | 2006-11-20 Andrea Russo <rastandy@inventati.org> | 94 | 2006-11-20 Andrea Russo <rastandy@inventati.org> (tiny change) |
| 42 | 95 | ||
| 43 | * erc-dcc.el (erc-dcc-chat-setup): Initialize `erc-input-marker' | 96 | * erc-dcc.el (erc-dcc-chat-setup): Initialize `erc-input-marker' |
| 44 | before calling `erc-display-prompt'. | 97 | before calling `erc-display-prompt'. |
| @@ -111,7 +164,7 @@ | |||
| 111 | `erc-show-my-nick' is non-nil. | 164 | `erc-show-my-nick' is non-nil. |
| 112 | (erc-compute-server): Doc fix. | 165 | (erc-compute-server): Doc fix. |
| 113 | 166 | ||
| 114 | 2006-10-01 John J Foerch <jjfoerch@earthlink.net> | 167 | 2006-10-01 John J Foerch <jjfoerch@earthlink.net> (tiny change) |
| 115 | 168 | ||
| 116 | * erc-stamp.el (erc-insert-timestamp-right): Exclude the newline | 169 | * erc-stamp.el (erc-insert-timestamp-right): Exclude the newline |
| 117 | from the erc-timestamp field. | 170 | from the erc-timestamp field. |
| @@ -121,7 +174,7 @@ | |||
| 121 | * erc-nicklist.el (erc-nicklist-insert-contents): Add missing | 174 | * erc-nicklist.el (erc-nicklist-insert-contents): Add missing |
| 122 | parenthesis. Thanks to Stephan Stahl for the report. | 175 | parenthesis. Thanks to Stephan Stahl for the report. |
| 123 | 176 | ||
| 124 | 2006-09-10 Eric Hanchrow <offby1@blarg.net> | 177 | 2006-09-10 Eric Hanchrow <offby1@blarg.net> (tiny change) |
| 125 | 178 | ||
| 126 | * erc.el (erc-cmd-IGNORE): Prompt user if this might be a regexp | 179 | * erc.el (erc-cmd-IGNORE): Prompt user if this might be a regexp |
| 127 | instead of a single user. | 180 | instead of a single user. |
| @@ -230,6 +283,13 @@ | |||
| 230 | 283 | ||
| 231 | * NEWS: Added note about these changes. | 284 | * NEWS: Added note about these changes. |
| 232 | 285 | ||
| 286 | 2006-08-20 Diane Murray <disumu@x3y2z1.net> | ||
| 287 | |||
| 288 | * erc-backend.el (erc-process-sentinel-1): Doc fix. Let | ||
| 289 | `erc-server-reconnect-p' check all condition cases. | ||
| 290 | (erc-server-reconnect-p): Moved rest of checks from | ||
| 291 | `erc-process-sentinel-1' to here. Now takes an argument, EVENT. | ||
| 292 | |||
| 233 | 2006-08-21 Diane Murray <disumu@x3y2z1.net> | 293 | 2006-08-21 Diane Murray <disumu@x3y2z1.net> |
| 234 | 294 | ||
| 235 | * erc-track.el (erc-track-mode-line-mouse-face): New variable. | 295 | * erc-track.el (erc-track-mode-line-mouse-face): New variable. |
| @@ -242,6 +302,18 @@ | |||
| 242 | (erc-menu-definition): Name the menu "ERC" instead of "IRC" to | 302 | (erc-menu-definition): Name the menu "ERC" instead of "IRC" to |
| 243 | avoid confusion with rcirc and other clients. | 303 | avoid confusion with rcirc and other clients. |
| 244 | 304 | ||
| 305 | * erc-backend.el (erc-server-banned): New variable. | ||
| 306 | (erc-server-connect): Set `erc-server-banned' to nil. | ||
| 307 | (erc-process-sentinel-1): Use `erc-server-reconnect-p'. | ||
| 308 | (erc-server-reconnect-p): New function. Return non-nil if the | ||
| 309 | user wants automatic reconnects and if the user has not been | ||
| 310 | banned from the server. This should fix a bug where ERC gets into | ||
| 311 | a loop trying to reconnect with no way to stop it when the user is | ||
| 312 | denied access to the server due to a server ban. It might also | ||
| 313 | help when Tor users are blocked from freenode if freenode servers | ||
| 314 | send the 465 message before disconnecting. | ||
| 315 | (465): Handle "banned from server" error notices. | ||
| 316 | |||
| 245 | 2006-08-13 Romain Francoise <romain@orebokech.com> | 317 | 2006-08-13 Romain Francoise <romain@orebokech.com> |
| 246 | 318 | ||
| 247 | * erc-match.el (erc-log-matches-make-buffer): End `y-or-n-p' | 319 | * erc-match.el (erc-log-matches-make-buffer): End `y-or-n-p' |
diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 82934f92218..c589ae282a6 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el | |||
| @@ -179,10 +179,18 @@ WALLCHOPS - supports sending messages to all operators in a channel") | |||
| 179 | This variable is buffer-local.") | 179 | This variable is buffer-local.") |
| 180 | (make-variable-buffer-local 'erc-server-connected) | 180 | (make-variable-buffer-local 'erc-server-connected) |
| 181 | 181 | ||
| 182 | (defvar erc-server-reconnect-count 0 | ||
| 183 | "Number of times we have failed to reconnect to the current server.") | ||
| 184 | (make-variable-buffer-local 'erc-server-reconnect-count) | ||
| 185 | |||
| 182 | (defvar erc-server-quitting nil | 186 | (defvar erc-server-quitting nil |
| 183 | "Non-nil if the user requests a quit.") | 187 | "Non-nil if the user requests a quit.") |
| 184 | (make-variable-buffer-local 'erc-server-quitting) | 188 | (make-variable-buffer-local 'erc-server-quitting) |
| 185 | 189 | ||
| 190 | (defvar erc-server-banned nil | ||
| 191 | "Non-nil if the user is denied access because of a server ban.") | ||
| 192 | (make-variable-buffer-local 'erc-server-banned) | ||
| 193 | |||
| 186 | (defvar erc-server-lines-sent nil | 194 | (defvar erc-server-lines-sent nil |
| 187 | "Line counter.") | 195 | "Line counter.") |
| 188 | (make-variable-buffer-local 'erc-server-lines-sent) | 196 | (make-variable-buffer-local 'erc-server-lines-sent) |
| @@ -259,6 +267,23 @@ Reconnection will happen automatically for any unexpected disconnection." | |||
| 259 | :group 'erc-server | 267 | :group 'erc-server |
| 260 | :type 'boolean) | 268 | :type 'boolean) |
| 261 | 269 | ||
| 270 | (defcustom erc-server-reconnect-attempts 2 | ||
| 271 | "The number of times that ERC will attempt to reestablish a | ||
| 272 | broken connection, or t to always attempt to reconnect. | ||
| 273 | |||
| 274 | This only has an effect if `erc-server-auto-reconnect' is non-nil." | ||
| 275 | :group 'erc-server | ||
| 276 | :type '(choice (const :tag "Always reconnect" t) | ||
| 277 | integer)) | ||
| 278 | |||
| 279 | (defcustom erc-server-reconnect-timeout 1 | ||
| 280 | "The amount of time, in seconds, that ERC will wait between | ||
| 281 | successive reconnect attempts. | ||
| 282 | |||
| 283 | If a key is pressed while ERC is waiting, it will stop waiting." | ||
| 284 | :group 'erc-server | ||
| 285 | :type 'number) | ||
| 286 | |||
| 262 | (defcustom erc-split-line-length 440 | 287 | (defcustom erc-split-line-length 440 |
| 263 | "*The maximum length of a single message. | 288 | "*The maximum length of a single message. |
| 264 | If a message exceeds this size, it is broken into multiple ones. | 289 | If a message exceeds this size, it is broken into multiple ones. |
| @@ -434,6 +459,7 @@ We will store server variables in the current buffer." | |||
| 434 | (message "%s...done" msg)) | 459 | (message "%s...done" msg)) |
| 435 | ;; Misc server variables | 460 | ;; Misc server variables |
| 436 | (setq erc-server-quitting nil) | 461 | (setq erc-server-quitting nil) |
| 462 | (setq erc-server-banned nil) | ||
| 437 | (setq erc-server-last-sent-time (erc-current-time)) | 463 | (setq erc-server-last-sent-time (erc-current-time)) |
| 438 | (setq erc-server-last-ping-time (erc-current-time)) | 464 | (setq erc-server-last-ping-time (erc-current-time)) |
| 439 | (setq erc-server-lines-sent 0) | 465 | (setq erc-server-lines-sent 0) |
| @@ -457,6 +483,21 @@ We will store server variables in the current buffer." | |||
| 457 | "Opening connection..\n") | 483 | "Opening connection..\n") |
| 458 | (erc-login))) | 484 | (erc-login))) |
| 459 | 485 | ||
| 486 | (defun erc-server-reconnect () | ||
| 487 | "Reestablish the current IRC connection. | ||
| 488 | Make sure you are in an ERC buffer when running this." | ||
| 489 | (let ((server (erc-server-buffer))) | ||
| 490 | (unless (and server | ||
| 491 | (buffer-live-p server)) | ||
| 492 | (error "Couldn't switch to server buffer")) | ||
| 493 | (with-current-buffer server | ||
| 494 | (erc-update-mode-line) | ||
| 495 | (erc-set-active-buffer (current-buffer)) | ||
| 496 | (setq erc-server-last-sent-time 0) | ||
| 497 | (setq erc-server-lines-sent 0) | ||
| 498 | (erc-open erc-session-server erc-session-port erc-server-current-nick | ||
| 499 | erc-session-user-full-name t erc-session-password)))) | ||
| 500 | |||
| 460 | (defun erc-server-filter-function (process string) | 501 | (defun erc-server-filter-function (process string) |
| 461 | "The process filter for the ERC server." | 502 | "The process filter for the ERC server." |
| 462 | (with-current-buffer (process-buffer process) | 503 | (with-current-buffer (process-buffer process) |
| @@ -485,11 +526,24 @@ We will store server variables in the current buffer." | |||
| 485 | (match-end 0)))) | 526 | (match-end 0)))) |
| 486 | (erc-parse-server-response process line))))))) | 527 | (erc-parse-server-response process line))))))) |
| 487 | 528 | ||
| 529 | (defsubst erc-server-reconnect-p (event) | ||
| 530 | "Return non-nil if ERC should attempt to reconnect automatically. | ||
| 531 | EVENT is the message received from the closed connection process." | ||
| 532 | (and erc-server-auto-reconnect | ||
| 533 | (not erc-server-banned) | ||
| 534 | ;; make sure we don't infinitely try to reconnect, unless the | ||
| 535 | ;; user wants that | ||
| 536 | (or (eq erc-server-reconnect-attempts t) | ||
| 537 | (and (integerp erc-server-reconnect-attempts) | ||
| 538 | (< erc-server-reconnect-count erc-server-reconnect-attempts))) | ||
| 539 | (not (string-match "^deleted" event)) | ||
| 540 | ;; open-network-stream-nowait error for connection refused | ||
| 541 | (not (string-match "^failed with code 111" event)))) | ||
| 542 | |||
| 488 | (defun erc-process-sentinel-1 (event) | 543 | (defun erc-process-sentinel-1 (event) |
| 489 | "This will be called when erc-process-sentinel has decided that we | 544 | "Called when `erc-process-sentinel' has decided that we're disconnecting. |
| 490 | are going to quit. Determine whether user has quit or whether erc has | 545 | Determine whether user has quit or whether erc has been terminated. |
| 491 | been terminated. Conditionally try to reconnect and take appropriate | 546 | Conditionally try to reconnect and take appropriate action." |
| 492 | action." | ||
| 493 | (if erc-server-quitting | 547 | (if erc-server-quitting |
| 494 | ;; normal quit | 548 | ;; normal quit |
| 495 | (progn | 549 | (progn |
| @@ -498,25 +552,26 @@ action." | |||
| 498 | (set-buffer-modified-p nil) | 552 | (set-buffer-modified-p nil) |
| 499 | (kill-buffer (current-buffer)))) | 553 | (kill-buffer (current-buffer)))) |
| 500 | ;; unexpected disconnect | 554 | ;; unexpected disconnect |
| 501 | (erc-display-message nil 'error (current-buffer) | 555 | (let ((again t)) |
| 502 | (if erc-server-auto-reconnect | 556 | (while again |
| 503 | 'disconnected | 557 | (setq again nil) |
| 504 | 'disconnected-noreconnect)) | 558 | (erc-display-message nil 'error (current-buffer) |
| 505 | (erc-update-mode-line) | 559 | (if (erc-server-reconnect-p event) |
| 506 | (erc-set-active-buffer (current-buffer)) | 560 | 'disconnected |
| 507 | (setq erc-server-last-sent-time 0) | 561 | 'disconnected-noreconnect)) |
| 508 | (setq erc-server-lines-sent 0) | 562 | (if (erc-server-reconnect-p event) |
| 509 | (if (and erc-server-auto-reconnect | 563 | (condition-case err |
| 510 | (not (string-match "^deleted" event)) | 564 | (progn |
| 511 | ;; open-network-stream-nowait error for connection refused | 565 | (erc-server-reconnect) |
| 512 | (not (string-match "^failed with code 111" event))) | 566 | (setq erc-server-reconnect-count 0)) |
| 513 | ;; Yuck, this should perhaps funcall | 567 | (error (when (integerp erc-server-reconnect-attempts) |
| 514 | ;; erc-server-reconnect-function with no args | 568 | (setq erc-server-reconnect-count |
| 515 | (erc-open erc-session-server erc-session-port erc-server-current-nick | 569 | (1+ erc-server-reconnect-count)) |
| 516 | erc-session-user-full-name t erc-session-password) | 570 | (sit-for erc-server-reconnect-timeout) |
| 517 | ;; terminate, do not reconnect | 571 | (setq again t)))) |
| 518 | (erc-display-message nil 'error (current-buffer) | 572 | ;; terminate, do not reconnect |
| 519 | 'terminated ?e event)))) | 573 | (erc-display-message nil 'error (current-buffer) |
| 574 | 'terminated ?e event)))))) | ||
| 520 | 575 | ||
| 521 | (defun erc-process-sentinel (cproc event) | 576 | (defun erc-process-sentinel (cproc event) |
| 522 | "Sentinel function for ERC process." | 577 | "Sentinel function for ERC process." |
| @@ -1708,6 +1763,14 @@ See `erc-display-server-message'." nil | |||
| 1708 | ?c (second (erc-response.command-args parsed)) | 1763 | ?c (second (erc-response.command-args parsed)) |
| 1709 | ?m (erc-response.contents parsed))) | 1764 | ?m (erc-response.contents parsed))) |
| 1710 | 1765 | ||
| 1766 | (define-erc-response-handler (465) | ||
| 1767 | "You are banned from this server." nil | ||
| 1768 | (setq erc-server-banned t) | ||
| 1769 | ;; show the server's message, as a reason might be provided | ||
| 1770 | (erc-display-error-notice | ||
| 1771 | parsed | ||
| 1772 | (erc-response.contents parsed))) | ||
| 1773 | |||
| 1711 | (define-erc-response-handler (474) | 1774 | (define-erc-response-handler (474) |
| 1712 | "Banned from channel errors" nil | 1775 | "Banned from channel errors" nil |
| 1713 | (erc-display-message parsed '(notice error) nil | 1776 | (erc-display-message parsed '(notice error) nil |
| @@ -1741,7 +1804,7 @@ See `erc-display-server-message'." nil | |||
| 1741 | (erc-display-message parsed '(error notice) 'active 's482 | 1804 | (erc-display-message parsed '(error notice) 'active 's482 |
| 1742 | ?c channel ?m message))) | 1805 | ?c channel ?m message))) |
| 1743 | 1806 | ||
| 1744 | (define-erc-response-handler (431 445 446 451 462 463 464 465 481 483 484 485 | 1807 | (define-erc-response-handler (431 445 446 451 462 463 464 481 483 484 485 |
| 1745 | 491 501 502) | 1808 | 491 501 502) |
| 1746 | ;; 431 - No nickname given | 1809 | ;; 431 - No nickname given |
| 1747 | ;; 445 - SUMMON has been disabled | 1810 | ;; 445 - SUMMON has been disabled |
| @@ -1750,7 +1813,6 @@ See `erc-display-server-message'." nil | |||
| 1750 | ;; 462 - Unauthorized command (already registered) | 1813 | ;; 462 - Unauthorized command (already registered) |
| 1751 | ;; 463 - Your host isn't among the privileged | 1814 | ;; 463 - Your host isn't among the privileged |
| 1752 | ;; 464 - Password incorrect | 1815 | ;; 464 - Password incorrect |
| 1753 | ;; 465 - You are banned from this server | ||
| 1754 | ;; 481 - Need IRCop privileges | 1816 | ;; 481 - Need IRCop privileges |
| 1755 | ;; 483 - You can't kill a server! | 1817 | ;; 483 - You can't kill a server! |
| 1756 | ;; 484 - Your connection is restricted! | 1818 | ;; 484 - Your connection is restricted! |
diff --git a/lisp/erc/erc-networks.el b/lisp/erc/erc-networks.el index 99aba31c3d4..034950e665f 100644 --- a/lisp/erc/erc-networks.el +++ b/lisp/erc/erc-networks.el | |||
| @@ -64,6 +64,7 @@ | |||
| 64 | ("AngelEyez: Random server" AngelEyez "irc.angeleyez.net" ((6666 7000))) | 64 | ("AngelEyez: Random server" AngelEyez "irc.angeleyez.net" ((6666 7000))) |
| 65 | ("AnotherNet: Random server" Anothernet "irc.another.net" (6667 7000 )) | 65 | ("AnotherNet: Random server" Anothernet "irc.another.net" (6667 7000 )) |
| 66 | ("ArabChat: Random server" ArabChat "irc.arabchat.org" ((6660 6667))) | 66 | ("ArabChat: Random server" ArabChat "irc.arabchat.org" ((6660 6667))) |
| 67 | ("Ars-OpenIRC: Random server" Ars "irc.arstechnica.com" 6667) | ||
| 67 | ("AsiaTalk: Random server" AsiaTalk "irc.asiatalk.org" ((6667 6669) 7000 )) | 68 | ("AsiaTalk: Random server" AsiaTalk "irc.asiatalk.org" ((6667 6669) 7000 )) |
| 68 | ("AstroLink: Random server" AstroLink "irc.astrolink.org" ((6660 6667))) | 69 | ("AstroLink: Random server" AstroLink "irc.astrolink.org" ((6660 6667))) |
| 69 | ("Asylumnet: Random server" Asylumnet "irc.asylum-net.org" ((6661 6669) 7000 7777 )) | 70 | ("Asylumnet: Random server" Asylumnet "irc.asylum-net.org" ((6661 6669) 7000 7777 )) |
| @@ -280,12 +281,12 @@ | |||
| 280 | ("K0wNet: Random server" K0wNet "irc.k0w.net" ((6660 6669))) | 281 | ("K0wNet: Random server" K0wNet "irc.k0w.net" ((6660 6669))) |
| 281 | ("KDFSnet: Random server" KDFSnet "irc.kdfs.net" ((6667 6669))) | 282 | ("KDFSnet: Random server" KDFSnet "irc.kdfs.net" ((6667 6669))) |
| 282 | ("Kemik: Random server" Kemik "irc.kemik.net" 6667) | 283 | ("Kemik: Random server" Kemik "irc.kemik.net" 6667) |
| 283 | ("Kewl.Org: Random server" Kewl.Org "irc.kewl.org" (6667 7000 )) | 284 | ("Kewl.Org: Random server" Kewl\.Org "irc.kewl.org" (6667 7000 )) |
| 284 | ("Kickchat: Random server" Kickchat "irc.kickchat.com" ((6660 6669) 7000 )) | 285 | ("Kickchat: Random server" Kickchat "irc.kickchat.com" ((6660 6669) 7000 )) |
| 285 | ("Kidsworld: Random server" KidsWorld "irc.kidsworld.org" ((6666 6669))) | 286 | ("Kidsworld: Random server" KidsWorld "irc.kidsworld.org" ((6666 6669))) |
| 286 | ("Knightnet: AF, ZA, Durban" Knightnet "orc.dbn.za.knightnet.net" (6667 5555 )) | 287 | ("Knightnet: AF, ZA, Durban" Knightnet "orc.dbn.za.knightnet.net" (6667 5555 )) |
| 287 | ("Knightnet: US, CA, Goldengate" Knightnet "goldengate.ca.us.knightnet.net" (6667 5555 )) | 288 | ("Knightnet: US, CA, Goldengate" Knightnet "goldengate.ca.us.knightnet.net" (6667 5555 )) |
| 288 | ("Konfido.Net: Random server" Konfido.Net "irc.konfido.net" 6667) | 289 | ("Konfido.Net: Random server" Konfido\.Net "irc.konfido.net" 6667) |
| 289 | ("KreyNet: Random server" Kreynet "irc.krey.net" 6667) | 290 | ("KreyNet: Random server" Kreynet "irc.krey.net" 6667) |
| 290 | ("Krono: Random server" Krono "irc.krono.net" ((6660 6669) 7000 )) | 291 | ("Krono: Random server" Krono "irc.krono.net" ((6660 6669) 7000 )) |
| 291 | ("Krushnet: Random server" Krushnet "irc.krushnet.org" 6667) | 292 | ("Krushnet: Random server" Krushnet "irc.krushnet.org" 6667) |
| @@ -294,6 +295,7 @@ | |||
| 294 | ("LagNet: AF, ZA, Johannesburg" LagNet "mystery.lagnet.org.za" 6667) | 295 | ("LagNet: AF, ZA, Johannesburg" LagNet "mystery.lagnet.org.za" 6667) |
| 295 | ("Librenet: Random server" Librenet "irc.librenet.net" 6667) | 296 | ("Librenet: Random server" Librenet "irc.librenet.net" 6667) |
| 296 | ("LinkNet: Random server" LinkNet "irc.link-net.org" ((6667 6669))) | 297 | ("LinkNet: Random server" LinkNet "irc.link-net.org" ((6667 6669))) |
| 298 | ("LinuxChix: Random server" LinuxChix "irc.linuxchix.org" 6667) | ||
| 297 | ("Liquidized: Random server" Liquidized "irc.liquidized.net" (6667 7000 )) | 299 | ("Liquidized: Random server" Liquidized "irc.liquidized.net" (6667 7000 )) |
| 298 | ("M-IRC: Random server" M-IRC "irc.m-sys.org" ((6667 6669))) | 300 | ("M-IRC: Random server" M-IRC "irc.m-sys.org" ((6667 6669))) |
| 299 | ("MagicStar: Random server" MagicStar "irc.magicstar.net" 6667) | 301 | ("MagicStar: Random server" MagicStar "irc.magicstar.net" 6667) |
| @@ -457,6 +459,7 @@ PORTS is either a number, a list of numbers, or a list of port ranges." | |||
| 457 | (AngelEyez "angeleyez.net") | 459 | (AngelEyez "angeleyez.net") |
| 458 | (Anothernet "another.net") | 460 | (Anothernet "another.net") |
| 459 | (ArabChat "arabchat.org") | 461 | (ArabChat "arabchat.org") |
| 462 | (Ars "arstechnica.com") | ||
| 460 | (AsiaTalk "asiatalk.org") | 463 | (AsiaTalk "asiatalk.org") |
| 461 | (AstroLink "astrolink.org") | 464 | (AstroLink "astrolink.org") |
| 462 | (Asylumnet "asylumnet.org") | 465 | (Asylumnet "asylumnet.org") |
| @@ -586,6 +589,7 @@ PORTS is either a number, a list of numbers, or a list of port ranges." | |||
| 586 | (LagNet "lagnet.org.za") | 589 | (LagNet "lagnet.org.za") |
| 587 | (Librenet "librenet.net") | 590 | (Librenet "librenet.net") |
| 588 | (LinkNet "link-net.org") | 591 | (LinkNet "link-net.org") |
| 592 | (LinuxChix "cats\.meow\.at\\|linuxchix\.org") | ||
| 589 | (Liquidized "liquidized.net") | 593 | (Liquidized "liquidized.net") |
| 590 | (M-IRC "m-sys.org") | 594 | (M-IRC "m-sys.org") |
| 591 | (MagicStar "magicstar.net") | 595 | (MagicStar "magicstar.net") |
diff --git a/lisp/erc/erc-services.el b/lisp/erc/erc-services.el index c8bac7fe45c..b93317e6124 100644 --- a/lisp/erc/erc-services.el +++ b/lisp/erc/erc-services.el | |||
| @@ -94,7 +94,7 @@ communication with those Services." | |||
| 94 | (interactive | 94 | (interactive |
| 95 | (list (intern (completing-read | 95 | (list (intern (completing-read |
| 96 | "Choose Nickserv identify mode (RET to disable): " | 96 | "Choose Nickserv identify mode (RET to disable): " |
| 97 | '(("autodetect") ("nick-change")) nil t)))) | 97 | '(("autodetect") ("nick-change") ("both")) nil t)))) |
| 98 | (cond ((eq mode 'autodetect) | 98 | (cond ((eq mode 'autodetect) |
| 99 | (setq erc-nickserv-identify-mode 'autodetect) | 99 | (setq erc-nickserv-identify-mode 'autodetect) |
| 100 | (add-hook 'erc-server-NOTICE-functions | 100 | (add-hook 'erc-server-NOTICE-functions |
| @@ -111,6 +111,14 @@ communication with those Services." | |||
| 111 | 'erc-nickserv-identify-on-nick-change) | 111 | 'erc-nickserv-identify-on-nick-change) |
| 112 | (remove-hook 'erc-server-NOTICE-functions | 112 | (remove-hook 'erc-server-NOTICE-functions |
| 113 | 'erc-nickserv-identify-autodetect)) | 113 | 'erc-nickserv-identify-autodetect)) |
| 114 | ((eq mode 'both) | ||
| 115 | (setq erc-nickserv-identify-mode 'both) | ||
| 116 | (add-hook 'erc-server-NOTICE-functions | ||
| 117 | 'erc-nickserv-identify-autodetect) | ||
| 118 | (add-hook 'erc-after-connect | ||
| 119 | 'erc-nickserv-identify-on-connect) | ||
| 120 | (add-hook 'erc-nick-changed-functions | ||
| 121 | 'erc-nickserv-identify-on-nick-change)) | ||
| 114 | (t | 122 | (t |
| 115 | (setq erc-nickserv-identify-mode nil) | 123 | (setq erc-nickserv-identify-mode nil) |
| 116 | (remove-hook 'erc-server-NOTICE-functions | 124 | (remove-hook 'erc-server-NOTICE-functions |
| @@ -120,22 +128,25 @@ communication with those Services." | |||
| 120 | (remove-hook 'erc-nick-changed-functions | 128 | (remove-hook 'erc-nick-changed-functions |
| 121 | 'erc-nickserv-identify-on-nick-change)))) | 129 | 'erc-nickserv-identify-on-nick-change)))) |
| 122 | 130 | ||
| 123 | (defcustom erc-nickserv-identify-mode 'autodetect | 131 | (defcustom erc-nickserv-identify-mode 'both |
| 124 | "The mode which is used when identifying to Nickserv. | 132 | "The mode which is used when identifying to Nickserv. |
| 125 | 133 | ||
| 126 | Possible settings are:. | 134 | Possible settings are:. |
| 127 | 135 | ||
| 128 | 'autodetect - Identify when the real Nickserv sends an identify request. | 136 | 'autodetect - Identify when the real Nickserv sends an identify request. |
| 129 | 'nick-change - Identify when you change your nickname. | 137 | 'nick-change - Identify when you change your nickname. |
| 138 | 'both - Do the former if the network supports it, otherwise do the | ||
| 139 | latter. | ||
| 130 | nil - Disables automatic Nickserv identification. | 140 | nil - Disables automatic Nickserv identification. |
| 131 | 141 | ||
| 132 | You can also use M-x erc-nickserv-identify-mode to change modes." | 142 | You can also use M-x erc-nickserv-identify-mode to change modes." |
| 133 | :group 'erc-services | 143 | :group 'erc-services |
| 134 | :type '(choice (const autodetect) | 144 | :type '(choice (const autodetect) |
| 135 | (const nick-change) | 145 | (const nick-change) |
| 146 | (const both) | ||
| 136 | (const nil)) | 147 | (const nil)) |
| 137 | :set (lambda (sym val) | 148 | :set (lambda (sym val) |
| 138 | (set-default sym val) | 149 | (set sym val) |
| 139 | (erc-nickserv-identify-mode val))) | 150 | (erc-nickserv-identify-mode val))) |
| 140 | 151 | ||
| 141 | (defcustom erc-prompt-for-nickserv-password t | 152 | (defcustom erc-prompt-for-nickserv-password t |
| @@ -156,12 +167,14 @@ Example of use: | |||
| 156 | (list :tag "Network" | 167 | (list :tag "Network" |
| 157 | (choice :tag "Network name" | 168 | (choice :tag "Network name" |
| 158 | (const freenode) | 169 | (const freenode) |
| 170 | (const OFTC) | ||
| 159 | (const DALnet) | 171 | (const DALnet) |
| 160 | (const GalaxyNet) | 172 | (const GalaxyNet) |
| 161 | (const SlashNET) | 173 | (const SlashNET) |
| 162 | (const BRASnet) | 174 | (const BRASnet) |
| 163 | (const iip) | 175 | (const iip) |
| 164 | (const Austnet) | 176 | (const Austnet) |
| 177 | (const Azzurra) | ||
| 165 | (symbol :tag "Network name")) | 178 | (symbol :tag "Network name")) |
| 166 | (repeat :tag "Nickname and password" | 179 | (repeat :tag "Nickname and password" |
| 167 | (cons :tag "Identity" | 180 | (cons :tag "Identity" |
| @@ -209,24 +222,24 @@ Example of use: | |||
| 209 | "IDENTIFY" | 222 | "IDENTIFY" |
| 210 | nil | 223 | nil |
| 211 | "") | 224 | "") |
| 212 | (Austnet | 225 | (Austnet |
| 213 | "NickOP!service@austnet.org" | 226 | "NickOP!service@austnet.org" |
| 214 | "/msg\\s-NickOP@austnet.org\\s-identify\\s-<password>" | 227 | "/msg\\s-NickOP@austnet.org\\s-identify\\s-<password>" |
| 215 | "nickop@austnet.org" | 228 | "nickop@austnet.org" |
| 216 | "identify" | 229 | "identify" |
| 217 | nil) | 230 | nil) |
| 218 | (Azzurra | 231 | (Azzurra |
| 219 | "NickServ!service@azzurra.org" | 232 | "NickServ!service@azzurra.org" |
| 220 | "/ns\\s-IDENTIFY\\s-password" | 233 | "/ns\\s-IDENTIFY\\s-password" |
| 221 | "NickServ" | 234 | "NickServ" |
| 222 | "IDENTIFY" | 235 | "IDENTIFY" |
| 223 | nil) | 236 | nil) |
| 224 | (OFTC | 237 | (OFTC |
| 225 | "NickServ!services@services.oftc.net" | 238 | "NickServ!services@services.oftc.net" |
| 226 | "/msg\\s-NickServ\\s-IDENTIFY\\s-\^_password" | 239 | "/msg\\s-NickServ\\s-IDENTIFY\\s-\^_password" |
| 227 | "NickServ" | 240 | "NickServ" |
| 228 | "IDENTIFY" | 241 | "IDENTIFY" |
| 229 | nil)) | 242 | nil)) |
| 230 | "Alist of NickServer details, sorted by network. | 243 | "Alist of NickServer details, sorted by network. |
| 231 | Every element in the list has the form | 244 | Every element in the list has the form |
| 232 | \(SYMBOL NICKSERV REGEXP NICK KEYWORD USE-CURRENT ANSWER) | 245 | \(SYMBOL NICKSERV REGEXP NICK KEYWORD USE-CURRENT ANSWER) |
| @@ -279,14 +292,18 @@ password for this nickname, otherwise try to send it automatically." | |||
| 279 | 292 | ||
| 280 | (defun erc-nickserv-identify-on-connect (server nick) | 293 | (defun erc-nickserv-identify-on-connect (server nick) |
| 281 | "Identify to Nickserv after the connection to the server is established." | 294 | "Identify to Nickserv after the connection to the server is established." |
| 282 | (unless (and (null erc-nickserv-passwords) | 295 | (unless (or (and (null erc-nickserv-passwords) |
| 283 | (null erc-prompt-for-nickserv-password)) | 296 | (null erc-prompt-for-nickserv-password)) |
| 297 | (and (eq erc-nickserv-identify-mode 'both) | ||
| 298 | (nth 2 (assoc (erc-network) erc-nickserv-alist)))) | ||
| 284 | (erc-nickserv-call-identify-function nick))) | 299 | (erc-nickserv-call-identify-function nick))) |
| 285 | 300 | ||
| 286 | (defun erc-nickserv-identify-on-nick-change (nick old-nick) | 301 | (defun erc-nickserv-identify-on-nick-change (nick old-nick) |
| 287 | "Identify to Nickserv whenever your nick changes." | 302 | "Identify to Nickserv whenever your nick changes." |
| 288 | (unless (and (null erc-nickserv-passwords) | 303 | (unless (or (and (null erc-nickserv-passwords) |
| 289 | (null erc-prompt-for-nickserv-password)) | 304 | (null erc-prompt-for-nickserv-password)) |
| 305 | (and (eq erc-nickserv-identify-mode 'both) | ||
| 306 | (nth 2 (assoc (erc-network) erc-nickserv-alist)))) | ||
| 290 | (erc-nickserv-call-identify-function nick))) | 307 | (erc-nickserv-call-identify-function nick))) |
| 291 | 308 | ||
| 292 | (defun erc-nickserv-call-identify-function (nickname) | 309 | (defun erc-nickserv-call-identify-function (nickname) |
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 7de2828b86d..427dd178383 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el | |||
| @@ -1672,21 +1672,22 @@ needs to be active for this function to work." | |||
| 1672 | (require 'iswitchb)) | 1672 | (require 'iswitchb)) |
| 1673 | (let ((enabled iswitchb-mode)) | 1673 | (let ((enabled iswitchb-mode)) |
| 1674 | (or enabled (iswitchb-mode 1)) | 1674 | (or enabled (iswitchb-mode 1)) |
| 1675 | (let ((iswitchb-make-buflist-hook | 1675 | (unwind-protect |
| 1676 | (lambda () | 1676 | (let ((iswitchb-make-buflist-hook |
| 1677 | (setq iswitchb-temp-buflist | 1677 | (lambda () |
| 1678 | (mapcar 'buffer-name | 1678 | (setq iswitchb-temp-buflist |
| 1679 | (erc-buffer-list | 1679 | (mapcar 'buffer-name |
| 1680 | nil | 1680 | (erc-buffer-list |
| 1681 | (when arg erc-server-process))))))) | 1681 | nil |
| 1682 | (switch-to-buffer | 1682 | (when arg erc-server-process))))))) |
| 1683 | (iswitchb-read-buffer | 1683 | (switch-to-buffer |
| 1684 | "Switch-to: " | 1684 | (iswitchb-read-buffer |
| 1685 | (if (boundp 'erc-modified-channels-alist) | 1685 | "Switch-to: " |
| 1686 | (buffer-name (caar (last erc-modified-channels-alist))) | 1686 | (if (boundp 'erc-modified-channels-alist) |
| 1687 | nil) | 1687 | (buffer-name (caar (last erc-modified-channels-alist))) |
| 1688 | t))) | 1688 | nil) |
| 1689 | (or enabled (iswitchb-mode -1)))) | 1689 | t))) |
| 1690 | (or enabled (iswitchb-mode -1))))) | ||
| 1690 | 1691 | ||
| 1691 | (defun erc-channel-list (proc) | 1692 | (defun erc-channel-list (proc) |
| 1692 | "Return a list of channel buffers. | 1693 | "Return a list of channel buffers. |
| @@ -1888,10 +1889,11 @@ Returns the buffer for the given server or channel." | |||
| 1888 | (connected-p (unless connect erc-server-connected)) | 1889 | (connected-p (unless connect erc-server-connected)) |
| 1889 | (buffer (erc-get-buffer-create server port channel)) | 1890 | (buffer (erc-get-buffer-create server port channel)) |
| 1890 | (old-buffer (current-buffer)) | 1891 | (old-buffer (current-buffer)) |
| 1891 | (old-point (point)) | 1892 | old-point |
| 1892 | continued-session) | 1893 | continued-session) |
| 1893 | (erc-update-modules) | 1894 | (erc-update-modules) |
| 1894 | (set-buffer buffer) | 1895 | (set-buffer buffer) |
| 1896 | (setq old-point (point)) | ||
| 1895 | (erc-mode) | 1897 | (erc-mode) |
| 1896 | (setq erc-server-announced-name server-announced-name) | 1898 | (setq erc-server-announced-name server-announced-name) |
| 1897 | (setq erc-server-connected connected-p) | 1899 | (setq erc-server-connected connected-p) |
| @@ -3165,6 +3167,12 @@ the message given by REASON." | |||
| 3165 | (defalias 'erc-cmd-GQ 'erc-cmd-GQUIT) | 3167 | (defalias 'erc-cmd-GQ 'erc-cmd-GQUIT) |
| 3166 | (put 'erc-cmd-GQUIT 'do-not-parse-args t) | 3168 | (put 'erc-cmd-GQUIT 'do-not-parse-args t) |
| 3167 | 3169 | ||
| 3170 | (defun erc-cmd-RECONNECT () | ||
| 3171 | "Try to reconnect to the current IRC server." | ||
| 3172 | (setq erc-server-reconnect-count 0) | ||
| 3173 | (erc-server-reconnect) | ||
| 3174 | t) | ||
| 3175 | |||
| 3168 | (defun erc-cmd-SERVER (server) | 3176 | (defun erc-cmd-SERVER (server) |
| 3169 | "Connect to SERVER, leaving existing connection intact." | 3177 | "Connect to SERVER, leaving existing connection intact." |
| 3170 | (erc-log (format "cmd: SERVER: %s" server)) | 3178 | (erc-log (format "cmd: SERVER: %s" server)) |
diff --git a/lisp/faces.el b/lisp/faces.el index a681c893f26..a3d0e8b6de6 100644 --- a/lisp/faces.el +++ b/lisp/faces.el | |||
| @@ -2179,6 +2179,11 @@ terminal type to a different value." | |||
| 2179 | :version "21.1" | 2179 | :version "21.1" |
| 2180 | :group 'basic-faces) | 2180 | :group 'basic-faces) |
| 2181 | 2181 | ||
| 2182 | (defface momentary | ||
| 2183 | '((t (:inherit mode-line))) | ||
| 2184 | "Face for momentarily displaying text in the current buffer." | ||
| 2185 | :group 'display) | ||
| 2186 | |||
| 2182 | (defface vertical-border | 2187 | (defface vertical-border |
| 2183 | '((((type tty)) :inherit mode-line-inactive)) | 2188 | '((((type tty)) :inherit mode-line-inactive)) |
| 2184 | "Face used for vertical window dividers on ttys." | 2189 | "Face used for vertical window dividers on ttys." |
diff --git a/lisp/files.el b/lisp/files.el index 0ce07562505..3834424ed4e 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -242,9 +242,9 @@ breaks any hard links between it and other files." | |||
| 242 | 242 | ||
| 243 | (defcustom version-control nil | 243 | (defcustom version-control nil |
| 244 | "Control use of version numbers for backup files. | 244 | "Control use of version numbers for backup files. |
| 245 | t means make numeric backup versions unconditionally. | 245 | When t, make numeric backup versions unconditionally. |
| 246 | nil means make them for files that have some already. | 246 | When nil, make them for files that have some already. |
| 247 | `never' means do not make them." | 247 | The value `never' means do not make them." |
| 248 | :type '(choice (const :tag "Never" never) | 248 | :type '(choice (const :tag "Never" never) |
| 249 | (const :tag "If existing" nil) | 249 | (const :tag "If existing" nil) |
| 250 | (other :tag "Always" t)) | 250 | (other :tag "Always" t)) |
| @@ -1650,7 +1650,8 @@ Do you want to revisit the file normally now? ") | |||
| 1650 | (setq default-directory (file-name-directory buffer-file-name)) | 1650 | (setq default-directory (file-name-directory buffer-file-name)) |
| 1651 | ;; Turn off backup files for certain file names. Since | 1651 | ;; Turn off backup files for certain file names. Since |
| 1652 | ;; this is a permanent local, the major mode won't eliminate it. | 1652 | ;; this is a permanent local, the major mode won't eliminate it. |
| 1653 | (and (not (funcall backup-enable-predicate buffer-file-name)) | 1653 | (and backup-enable-predicate |
| 1654 | (not (funcall backup-enable-predicate buffer-file-name)) | ||
| 1654 | (progn | 1655 | (progn |
| 1655 | (make-local-variable 'backup-inhibited) | 1656 | (make-local-variable 'backup-inhibited) |
| 1656 | (setq backup-inhibited t))) | 1657 | (setq backup-inhibited t))) |
| @@ -2905,6 +2906,7 @@ the old visited file has been renamed to the new name FILENAME." | |||
| 2905 | ;; Turn off backup files for certain file names. | 2906 | ;; Turn off backup files for certain file names. |
| 2906 | ;; Since this is a permanent local, the major mode won't eliminate it. | 2907 | ;; Since this is a permanent local, the major mode won't eliminate it. |
| 2907 | (and buffer-file-name | 2908 | (and buffer-file-name |
| 2909 | backup-enable-predicate | ||
| 2908 | (not (funcall backup-enable-predicate buffer-file-name)) | 2910 | (not (funcall backup-enable-predicate buffer-file-name)) |
| 2909 | (progn | 2911 | (progn |
| 2910 | (make-local-variable 'backup-inhibited) | 2912 | (make-local-variable 'backup-inhibited) |
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index b6b8b1b9bac..ec7476b8758 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2007-01-05 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 2 | |||
| 3 | * gnus-soup.el (gnus-soup): New custom group. Make user variables | ||
| 4 | customizable. | ||
| 5 | |||
| 1 | 2006-12-30 Andreas Seltenreich <uwi7@rz.uni-karlsruhe.de> | 6 | 2006-12-30 Andreas Seltenreich <uwi7@rz.uni-karlsruhe.de> |
| 2 | 7 | ||
| 3 | * gnus-sum.el (gnus-summary-insert-dormant-articles): Fix typo in | 8 | * gnus-sum.el (gnus-summary-insert-dormant-articles): Fix typo in |
diff --git a/lisp/gnus/gnus-soup.el b/lisp/gnus/gnus-soup.el index 31c721d9f1f..31074cb8c77 100644 --- a/lisp/gnus/gnus-soup.el +++ b/lisp/gnus/gnus-soup.el | |||
| @@ -36,36 +36,56 @@ | |||
| 36 | (require 'gnus-start) | 36 | (require 'gnus-start) |
| 37 | (require 'gnus-range) | 37 | (require 'gnus-range) |
| 38 | 38 | ||
| 39 | (defgroup gnus-soup nil | ||
| 40 | "SOUP packet writing support for Gnus." | ||
| 41 | :group 'gnus) | ||
| 42 | |||
| 39 | ;;; User Variables: | 43 | ;;; User Variables: |
| 40 | 44 | ||
| 41 | (defvar gnus-soup-directory (nnheader-concat gnus-home-directory "SoupBrew/") | 45 | (defcustom gnus-soup-directory (nnheader-concat gnus-home-directory "SoupBrew/") |
| 42 | "*Directory containing an unpacked SOUP packet.") | 46 | "Directory containing an unpacked SOUP packet." |
| 47 | :version "22.1" ;; Gnus 5.10.9 | ||
| 48 | :type 'directory) | ||
| 43 | 49 | ||
| 44 | (defvar gnus-soup-replies-directory | 50 | (defcustom gnus-soup-replies-directory |
| 45 | (nnheader-concat gnus-soup-directory "SoupReplies/") | 51 | (nnheader-concat gnus-soup-directory "SoupReplies/") |
| 46 | "*Directory where Gnus will do processing of replies.") | 52 | "Directory where Gnus will do processing of replies." |
| 53 | :version "22.1" ;; Gnus 5.10.9 | ||
| 54 | :type 'directory) | ||
| 47 | 55 | ||
| 48 | (defvar gnus-soup-prefix-file "gnus-prefix" | 56 | (defcustom gnus-soup-prefix-file "gnus-prefix" |
| 49 | "*Name of the file where Gnus stores the last used prefix.") | 57 | "Name of the file where Gnus stores the last used prefix." |
| 58 | :version "22.1" ;; Gnus 5.10.9 | ||
| 59 | :type 'file) | ||
| 50 | 60 | ||
| 51 | (defvar gnus-soup-packer "tar cf - %s | gzip > $HOME/Soupout%d.tgz" | 61 | (defcustom gnus-soup-packer "tar cf - %s | gzip > $HOME/Soupout%d.tgz" |
| 52 | "Format string command for packing a SOUP packet. | 62 | "Format string command for packing a SOUP packet. |
| 53 | The SOUP files will be inserted where the %s is in the string. | 63 | The SOUP files will be inserted where the %s is in the string. |
| 54 | This string MUST contain both %s and %d. The file number will be | 64 | This string MUST contain both %s and %d. The file number will be |
| 55 | inserted where %d appears.") | 65 | inserted where %d appears." |
| 56 | 66 | :version "22.1" ;; Gnus 5.10.9 | |
| 57 | (defvar gnus-soup-unpacker "gunzip -c %s | tar xvf -" | 67 | :type 'string) |
| 58 | "*Format string command for unpacking a SOUP packet. | 68 | |
| 59 | The SOUP packet file name will be inserted at the %s.") | 69 | (defcustom gnus-soup-unpacker "gunzip -c %s | tar xvf -" |
| 60 | 70 | "Format string command for unpacking a SOUP packet. | |
| 61 | (defvar gnus-soup-packet-directory gnus-home-directory | 71 | The SOUP packet file name will be inserted at the %s." |
| 62 | "*Where gnus-soup will look for REPLIES packets.") | 72 | :version "22.1" ;; Gnus 5.10.9 |
| 63 | 73 | :type 'string) | |
| 64 | (defvar gnus-soup-packet-regexp "Soupin" | 74 | |
| 65 | "*Regular expression matching SOUP REPLIES packets in `gnus-soup-packet-directory'.") | 75 | (defcustom gnus-soup-packet-directory gnus-home-directory |
| 66 | 76 | "Where gnus-soup will look for REPLIES packets." | |
| 67 | (defvar gnus-soup-ignored-headers "^Xref:" | 77 | :version "22.1" ;; Gnus 5.10.9 |
| 68 | "*Regexp to match headers to be removed when brewing SOUP packets.") | 78 | :type 'directory) |
| 79 | |||
| 80 | (defcustom gnus-soup-packet-regexp "Soupin" | ||
| 81 | "Regular expression matching SOUP REPLIES packets in `gnus-soup-packet-directory'." | ||
| 82 | :version "22.1" ;; Gnus 5.10.9 | ||
| 83 | :type 'regexp) | ||
| 84 | |||
| 85 | (defcustom gnus-soup-ignored-headers "^Xref:" | ||
| 86 | "Regexp to match headers to be removed when brewing SOUP packets." | ||
| 87 | :version "22.1" ;; Gnus 5.10.9 | ||
| 88 | :type 'regexp) | ||
| 69 | 89 | ||
| 70 | ;;; Internal Variables: | 90 | ;;; Internal Variables: |
| 71 | 91 | ||
diff --git a/lisp/image.el b/lisp/image.el index e70b9ec539e..a98ca87f728 100644 --- a/lisp/image.el +++ b/lisp/image.el | |||
| @@ -38,7 +38,9 @@ | |||
| 38 | ("\\`P[1-6][[:space:]]+\\(?:#.*[[:space:]]+\\)*[0-9]+[[:space:]]+[0-9]+" . pbm) | 38 | ("\\`P[1-6][[:space:]]+\\(?:#.*[[:space:]]+\\)*[0-9]+[[:space:]]+[0-9]+" . pbm) |
| 39 | ("\\`GIF8" . gif) | 39 | ("\\`GIF8" . gif) |
| 40 | ("\\`\x89PNG\r\n\x1a\n" . png) | 40 | ("\\`\x89PNG\r\n\x1a\n" . png) |
| 41 | ("\\`[\t\n\r ]*#define" . xbm) | 41 | ("\\`[\t\n\r ]*#define \\([a-z0-9]+\\)_width [0-9]+\n\ |
| 42 | #define \\1_height [0-9]+\n\ | ||
| 43 | static char \\1_bits" . xbm) | ||
| 42 | ("\\`\\(?:MM\0\\*\\|II\\*\0\\)" . tiff) | 44 | ("\\`\\(?:MM\0\\*\\|II\\*\0\\)" . tiff) |
| 43 | ("\\`[\t\n\r ]*%!PS" . postscript) | 45 | ("\\`[\t\n\r ]*%!PS" . postscript) |
| 44 | ("\\`\xff\xd8" . (image-jpeg-p . jpeg))) | 46 | ("\\`\xff\xd8" . (image-jpeg-p . jpeg))) |
diff --git a/lisp/international/mule.el b/lisp/international/mule.el index f9de9ecdf91..0a2c7cbe9ad 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el | |||
| @@ -2299,7 +2299,12 @@ This function is intended to be added to `auto-coding-functions'." | |||
| 2299 | ;; In case of no header, search only 10 lines. | 2299 | ;; In case of no header, search only 10 lines. |
| 2300 | (forward-line 10)) | 2300 | (forward-line 10)) |
| 2301 | (point)))) | 2301 | (point)))) |
| 2302 | (when (re-search-forward "<meta\\s-+http-equiv=[\"']?content-type[\"']?\\s-+content=[\"']text/\\sw+;\\s-*charset=\\(.+?\\)[\"']" size t) | 2302 | ;; Make sure that the buffer really contains an HTML document, by |
| 2303 | ;; checking that it starts with a doctype or a <HTML> start tag | ||
| 2304 | ;; (allowing for whitespace at bob). Note: 'DOCTYPE NETSCAPE' is | ||
| 2305 | ;; useful for Mozilla bookmark files. | ||
| 2306 | (when (and (re-search-forward "\\`[[:space:]\n]*\\(<!doctype[[:space:]\n]+\\(html\\|netscape\\)\\|<html\\)" size t) | ||
| 2307 | (re-search-forward "<meta\\s-+http-equiv=[\"']?content-type[\"']?\\s-+content=[\"']text/\\sw+;\\s-*charset=\\(.+?\\)[\"']" size t)) | ||
| 2303 | (let* ((match (match-string 1)) | 2308 | (let* ((match (match-string 1)) |
| 2304 | (sym (intern (downcase match)))) | 2309 | (sym (intern (downcase match)))) |
| 2305 | (if (coding-system-p sym) | 2310 | (if (coding-system-p sym) |
diff --git a/lisp/isearch.el b/lisp/isearch.el index 85e0bb6763f..6ef83c68fd8 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -784,13 +784,15 @@ NOPUSH is t and EDIT is t." | |||
| 784 | (lazy-highlight-cleanup lazy-highlight-cleanup) | 784 | (lazy-highlight-cleanup lazy-highlight-cleanup) |
| 785 | (let ((found-start (window-start (selected-window))) | 785 | (let ((found-start (window-start (selected-window))) |
| 786 | (found-point (point))) | 786 | (found-point (point))) |
| 787 | (if isearch-window-configuration | 787 | (when isearch-window-configuration |
| 788 | (set-window-configuration isearch-window-configuration)) | 788 | (set-window-configuration isearch-window-configuration) |
| 789 | 789 | (if isearch-small-window | |
| 790 | (if isearch-small-window | 790 | (goto-char found-point) |
| 791 | (goto-char found-point) | 791 | ;; set-window-configuration clobbers window-start; restore it. |
| 792 | ;; Exiting the save-window-excursion clobbers window-start; restore it. | 792 | ;; This has an annoying side effect of clearing the last_modiff |
| 793 | (set-window-start (selected-window) found-start t))) | 793 | ;; field of the window, which can cause unwanted scrolling, |
| 794 | ;; so don't do it unless truly necessary. | ||
| 795 | (set-window-start (selected-window) found-start t)))) | ||
| 794 | 796 | ||
| 795 | (setq isearch-mode nil) | 797 | (setq isearch-mode nil) |
| 796 | (if isearch-input-method-local-p | 798 | (if isearch-input-method-local-p |
diff --git a/lisp/iswitchb.el b/lisp/iswitchb.el index 93d4755cf3a..98fad7bf824 100644 --- a/lisp/iswitchb.el +++ b/lisp/iswitchb.el | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | ;;; iswitchb.el --- switch between buffers using substrings | 1 | ;;; iswitchb.el --- switch between buffers using substrings |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, | 3 | ;; Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, |
| 4 | ;; 2005, 2006 Free Software Foundation, Inc. | 4 | ;; 2005, 2006, 2007 Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: Stephen Eglen <stephen@gnu.org> | 6 | ;; Author: Stephen Eglen <stephen@gnu.org> |
| 7 | ;; Maintainer: Stephen Eglen <stephen@gnu.org> | 7 | ;; Maintainer: Stephen Eglen <stephen@gnu.org> |
| @@ -495,14 +495,13 @@ interfere with other minibuffer usage.") | |||
| 495 | 495 | ||
| 496 | (defvar iswitchb-global-map | 496 | (defvar iswitchb-global-map |
| 497 | (let ((map (make-sparse-keymap))) | 497 | (let ((map (make-sparse-keymap))) |
| 498 | (substitute-key-definition 'switch-to-buffer ; normally C-x b | 498 | (dolist (b '((switch-to-buffer . iswitchb-buffer) |
| 499 | 'iswitchb-buffer map global-map) | 499 | (switch-to-buffer-other-window . iswitchb-buffer-other-window) |
| 500 | (substitute-key-definition 'switch-to-buffer-other-window ; C-x 4 b | 500 | (switch-to-buffer-other-frame . iswitchb-buffer-other-frame) |
| 501 | 'iswitchb-buffer-other-window map global-map) | 501 | (display-buffer . iswitchb-display-buffer))) |
| 502 | (substitute-key-definition 'switch-to-buffer-other-frame ; C-x 5 b | 502 | (if (fboundp 'command-remapping) |
| 503 | 'iswitchb-buffer-other-frame map global-map) | 503 | (define-key map (vector 'remap (car b)) (cdr b)) |
| 504 | (substitute-key-definition 'display-buffer ; C-x 4 C-o | 504 | (substitute-key-definition (car b) (cdr b) map global-map))) |
| 505 | 'iswitchb-display-buffer map global-map) | ||
| 506 | map) | 505 | map) |
| 507 | "Global keymap for `iswitchb-mode'.") | 506 | "Global keymap for `iswitchb-mode'.") |
| 508 | 507 | ||
diff --git a/lisp/progmodes/cc-align.el b/lisp/progmodes/cc-align.el index 9c2427a71af..847e43a46b7 100644 --- a/lisp/progmodes/cc-align.el +++ b/lisp/progmodes/cc-align.el | |||
| @@ -90,6 +90,29 @@ Works with: topmost-intro-cont." | |||
| 90 | (c-after-special-operator-id)))) | 90 | (c-after-special-operator-id)))) |
| 91 | c-basic-offset))) | 91 | c-basic-offset))) |
| 92 | 92 | ||
| 93 | (defun c-lineup-gnu-DEFUN-intro-cont (langelem) | ||
| 94 | "Line up the continuation lines of a DEFUN macro in the Emacs C source. | ||
| 95 | These lines are indented as though they were `knr-argdecl-intro' lines. | ||
| 96 | Return nil when we're not in such a construct. | ||
| 97 | |||
| 98 | This function is for historical compatibility with how previous CC Modes (5.28 | ||
| 99 | and earlier) indented such lines. | ||
| 100 | |||
| 101 | Here is an example: | ||
| 102 | |||
| 103 | DEFUN (\"forward-char\", Fforward_char, Sforward_char, 0, 1, \"p\", | ||
| 104 | doc: /* Move point right N characters (left if N is negative). | ||
| 105 | On reaching end of buffer, stop and signal error. */) | ||
| 106 | (n) <- c-lineup-gnu-DEFUN-into-cont | ||
| 107 | Lisp_Object n; <- c-lineup-gnu-DEFUN-into-cont | ||
| 108 | |||
| 109 | Works with: topmost-intro-cont." | ||
| 110 | (save-excursion | ||
| 111 | (let (case-fold-search) | ||
| 112 | (goto-char (c-langelem-pos langelem)) | ||
| 113 | (if (looking-at "\\<DEFUN\\>") | ||
| 114 | (c-calc-offset '(knr-argdecl-intro)))))) | ||
| 115 | |||
| 93 | (defun c-block-in-arglist-dwim (arglist-start) | 116 | (defun c-block-in-arglist-dwim (arglist-start) |
| 94 | ;; This function implements the DWIM to avoid far indentation of | 117 | ;; This function implements the DWIM to avoid far indentation of |
| 95 | ;; brace block constructs in arguments in `c-lineup-arglist' etc. | 118 | ;; brace block constructs in arguments in `c-lineup-arglist' etc. |
diff --git a/lisp/progmodes/cc-awk.el b/lisp/progmodes/cc-awk.el index e2fcbd8d06b..bc745873638 100644 --- a/lisp/progmodes/cc-awk.el +++ b/lisp/progmodes/cc-awk.el | |||
| @@ -720,7 +720,7 @@ | |||
| 720 | (not (search-forward-regexp c-awk-regexp-sign-re (1+ /point) t)) | 720 | (not (search-forward-regexp c-awk-regexp-sign-re (1+ /point) t)) |
| 721 | (search-forward-regexp c-awk-div-sign-re (1+ /point) t)) | 721 | (search-forward-regexp c-awk-div-sign-re (1+ /point) t)) |
| 722 | ;; A division sign. | 722 | ;; A division sign. |
| 723 | (progn (goto-char (1+ /point)) nil) | 723 | (progn (goto-char (1+ /point)) nil) |
| 724 | ;; A regexp opener | 724 | ;; A regexp opener |
| 725 | ;; Jump over the regexp innards, setting the match data. | 725 | ;; Jump over the regexp innards, setting the match data. |
| 726 | (goto-char /point) | 726 | (goto-char /point) |
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index 1c266e8a5de..e7bea0e0b29 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el | |||
| @@ -53,6 +53,7 @@ | |||
| 53 | (cc-bytecomp-defun c-forward-subword) | 53 | (cc-bytecomp-defun c-forward-subword) |
| 54 | (cc-bytecomp-defun c-backward-subword) | 54 | (cc-bytecomp-defun c-backward-subword) |
| 55 | 55 | ||
| 56 | ;; Indentation / Display syntax functions | ||
| 56 | (defvar c-fix-backslashes t) | 57 | (defvar c-fix-backslashes t) |
| 57 | 58 | ||
| 58 | (defun c-indent-line (&optional syntax quiet ignore-point-pos) | 59 | (defun c-indent-line (&optional syntax quiet ignore-point-pos) |
| @@ -252,6 +253,7 @@ With universal argument, inserts the analysis as a comment on that line." | |||
| 252 | (forward-line))))) | 253 | (forward-line))))) |
| 253 | 254 | ||
| 254 | 255 | ||
| 256 | ;; Minor mode functions. | ||
| 255 | (defun c-update-modeline () | 257 | (defun c-update-modeline () |
| 256 | (let ((fmt (format "/%s%s%s%s" | 258 | (let ((fmt (format "/%s%s%s%s" |
| 257 | (if c-electric-flag "l" "") | 259 | (if c-electric-flag "l" "") |
| @@ -843,13 +845,17 @@ is inhibited." | |||
| 843 | (eq literal 'c) | 845 | (eq literal 'c) |
| 844 | (memq 'comment-close-slash c-cleanup-list) | 846 | (memq 'comment-close-slash c-cleanup-list) |
| 845 | (eq last-command-char ?/) | 847 | (eq last-command-char ?/) |
| 848 | (looking-at (concat "[ \t]*\\(" | ||
| 849 | (regexp-quote comment-end) "\\)?$")) | ||
| 846 | ; (eq c-block-comment-ender "*/") ; C-style comments ALWAYS end in */ | 850 | ; (eq c-block-comment-ender "*/") ; C-style comments ALWAYS end in */ |
| 847 | (save-excursion | 851 | (save-excursion |
| 848 | (back-to-indentation) | 852 | (save-restriction |
| 849 | (looking-at (concat c-current-comment-prefix "[ \t]*$")))) | 853 | (narrow-to-region (point-min) (point)) |
| 850 | (end-of-line) | 854 | (back-to-indentation) |
| 851 | (delete-horizontal-space) | 855 | (looking-at (concat c-current-comment-prefix "[ \t]*$"))))) |
| 852 | (or (eq (char-before) ?*) (insert-char ?* 1))) ; Do I need a t (retain sticky properties) here? | 856 | (kill-region (progn (forward-line 0) (point)) |
| 857 | (progn (end-of-line) (point))) | ||
| 858 | (insert-char ?* 1)) ; the / comes later. ; Do I need a t (retain sticky properties) here? | ||
| 853 | 859 | ||
| 854 | (setq indentp (and (not arg) | 860 | (setq indentp (and (not arg) |
| 855 | c-syntactic-indentation | 861 | c-syntactic-indentation |
| @@ -1253,7 +1259,11 @@ newline cleanups are done if appropriate; see the variable `c-cleanup-list'." | |||
| 1253 | (backward-char) | 1259 | (backward-char) |
| 1254 | (skip-chars-backward " \t") | 1260 | (skip-chars-backward " \t") |
| 1255 | (setq beg (point)) | 1261 | (setq beg (point)) |
| 1256 | (c-save-buffer-state () (c-on-identifier)))) | 1262 | (c-save-buffer-state () (c-on-identifier)) |
| 1263 | ;; Don't add a space into #define FOO().... | ||
| 1264 | (not (and (c-beginning-of-macro) | ||
| 1265 | (c-forward-over-cpp-define-id) | ||
| 1266 | (eq (point) beg))))) | ||
| 1257 | (save-excursion | 1267 | (save-excursion |
| 1258 | (delete-region beg end) | 1268 | (delete-region beg end) |
| 1259 | (goto-char beg) | 1269 | (goto-char beg) |
| @@ -1308,6 +1318,7 @@ keyword on the line, the keyword is not inserted inside a literal, and | |||
| 1308 | (delete-char -2))))) | 1318 | (delete-char -2))))) |
| 1309 | 1319 | ||
| 1310 | 1320 | ||
| 1321 | ;; "nomenclature" functions + c-scope-operator. | ||
| 1311 | (defun c-forward-into-nomenclature (&optional arg) | 1322 | (defun c-forward-into-nomenclature (&optional arg) |
| 1312 | "Compatibility alias for `c-forward-subword'." | 1323 | "Compatibility alias for `c-forward-subword'." |
| 1313 | (interactive "p") | 1324 | (interactive "p") |
| @@ -1328,6 +1339,160 @@ No indentation or other \"electric\" behavior is performed." | |||
| 1328 | (interactive "*") | 1339 | (interactive "*") |
| 1329 | (insert-and-inherit "::")) | 1340 | (insert-and-inherit "::")) |
| 1330 | 1341 | ||
| 1342 | |||
| 1343 | ;; Movement (etc.) by defuns. | ||
| 1344 | (defun c-in-function-trailer-p (&optional lim) | ||
| 1345 | ;; Return non-nil if point is between the closing brace and the semicolon of | ||
| 1346 | ;; a brace construct which needs a semicolon, e.g. within the "variables" | ||
| 1347 | ;; portion of a declaration like "struct foo {...} bar ;". | ||
| 1348 | ;; | ||
| 1349 | ;; Return the position of the main declaration. Otherwise, return nil. | ||
| 1350 | ;; Point is assumed to be at the top level and outside of any macro or | ||
| 1351 | ;; literal. | ||
| 1352 | ;; | ||
| 1353 | ;; If LIM is non-nil, it is the bound on a the backward search for the | ||
| 1354 | ;; beginning of the declaration. | ||
| 1355 | ;; | ||
| 1356 | ;; This function might do hidden buffer changes. | ||
| 1357 | (and c-opt-block-decls-with-vars-key | ||
| 1358 | (save-excursion | ||
| 1359 | (c-syntactic-skip-backward "^;}" lim) | ||
| 1360 | (and (eq (char-before) ?\}) | ||
| 1361 | (eq (car (c-beginning-of-decl-1 lim)) 'previous) | ||
| 1362 | (looking-at c-opt-block-decls-with-vars-key) | ||
| 1363 | (point))))) | ||
| 1364 | |||
| 1365 | (defun c-where-wrt-brace-construct () | ||
| 1366 | ;; Determine where we are with respect to functions (or other brace | ||
| 1367 | ;; constructs, included in the term "function" in the rest of this comment). | ||
| 1368 | ;; Point is assumed to be outside any macro or literal. | ||
| 1369 | ;; This is used by c-\(begining\|end\)-of-defun. | ||
| 1370 | ;; | ||
| 1371 | ;; Return one of these symbols: | ||
| 1372 | ;; at-header : we're at the start of a function's header. | ||
| 1373 | ;; in-header : we're inside a function's header, this extending right | ||
| 1374 | ;; up to the brace. This bit includes any k&r declarations. | ||
| 1375 | ;; in-block : we're inside a function's brace block. | ||
| 1376 | ;; in-trailer : we're in the area between the "}" and ";" of something | ||
| 1377 | ;; like "struct foo {...} bar, baz;". | ||
| 1378 | ;; at-function-end : we're just after the closing brace (or semicolon) that | ||
| 1379 | ;; terminates the function. | ||
| 1380 | ;; outwith-function: we're not at or in any function. Being inside a | ||
| 1381 | ;; non-brace construct also counts as 'outwith-function'. | ||
| 1382 | ;; | ||
| 1383 | ;; This function might do hidden buffer changes. | ||
| 1384 | (save-excursion | ||
| 1385 | (let* (pos | ||
| 1386 | kluge-start | ||
| 1387 | decl-result brace-decl-p | ||
| 1388 | (start (point)) | ||
| 1389 | (paren-state (c-parse-state)) | ||
| 1390 | (least-enclosing (c-least-enclosing-brace paren-state))) | ||
| 1391 | |||
| 1392 | (cond | ||
| 1393 | ((and least-enclosing | ||
| 1394 | (eq (char-after least-enclosing) ?\{)) | ||
| 1395 | 'in-block) | ||
| 1396 | ((c-in-function-trailer-p) | ||
| 1397 | 'in-trailer) | ||
| 1398 | ((and (not least-enclosing) | ||
| 1399 | (consp paren-state) | ||
| 1400 | (consp (car paren-state)) | ||
| 1401 | (eq start (cdar paren-state))) | ||
| 1402 | 'at-function-end) | ||
| 1403 | (t | ||
| 1404 | ;; Find the start of the current declaration. NOTE: If we're in the | ||
| 1405 | ;; variables after a "struct/eval" type block, we don't get to the | ||
| 1406 | ;; real declaration here - we detect and correct for this later. | ||
| 1407 | |||
| 1408 | ;;If we're in the parameters' parens, move back out of them. | ||
| 1409 | (if least-enclosing (goto-char least-enclosing)) | ||
| 1410 | ;; Kluge so that c-beginning-of-decl-1 won't go back if we're already | ||
| 1411 | ;; at a declaration. | ||
| 1412 | (if (or (and (eolp) (not (eobp))) ; EOL is matched by "\\s>" | ||
| 1413 | (not (looking-at | ||
| 1414 | "\\([;#]\\|\\'\\|\\s(\\|\\s)\\|\\s\"\\|\\s\\\\|\\s$\\|\\s<\\|\\s>\\|\\s!\\)"))) | ||
| 1415 | (forward-char)) | ||
| 1416 | (setq kluge-start (point)) | ||
| 1417 | (setq decl-result | ||
| 1418 | (car (c-beginning-of-decl-1 | ||
| 1419 | (and least-enclosing ; LIMIT for c-b-of-decl-1 | ||
| 1420 | (c-safe-position least-enclosing paren-state))))) | ||
| 1421 | |||
| 1422 | ;; Has the declaration we've gone back to got braces? | ||
| 1423 | (setq pos (point)) ; the search limit for c-recognize-knr-p | ||
| 1424 | (setq brace-decl-p | ||
| 1425 | (save-excursion | ||
| 1426 | (and (c-syntactic-re-search-forward "[;{]" nil t t) | ||
| 1427 | (or (eq (char-before) ?\{) | ||
| 1428 | (and c-recognize-knr-p | ||
| 1429 | ;; Might have stopped on the | ||
| 1430 | ;; ';' in a K&R argdecl. In | ||
| 1431 | ;; that case the declaration | ||
| 1432 | ;; should contain a block. | ||
| 1433 | (c-in-knr-argdecl pos)))))) | ||
| 1434 | |||
| 1435 | (cond | ||
| 1436 | ((= (point) kluge-start) ; might be BOB or unbalanced parens. | ||
| 1437 | 'outwith-function) | ||
| 1438 | ((eq decl-result 'same) | ||
| 1439 | (if brace-decl-p | ||
| 1440 | (if (eq (point) start) | ||
| 1441 | 'at-header | ||
| 1442 | 'in-header) | ||
| 1443 | 'outwith-function)) | ||
| 1444 | ((eq decl-result 'previous) | ||
| 1445 | (if (and (not brace-decl-p) | ||
| 1446 | (c-in-function-trailer-p)) | ||
| 1447 | 'at-function-end | ||
| 1448 | 'outwith-function)) | ||
| 1449 | (t (error | ||
| 1450 | "c-where-wrt-brace-construct: c-beginning-of-decl-1 returned %s" | ||
| 1451 | decl-result)))))))) | ||
| 1452 | |||
| 1453 | (defun c-backward-to-nth-BOF-{ (n where) | ||
| 1454 | ;; Skip to the opening brace of the Nth function before point. If | ||
| 1455 | ;; point is inside a function, this counts as the first. Point must be | ||
| 1456 | ;; outside any comment/string or macro. | ||
| 1457 | ;; | ||
| 1458 | ;; N must be strictly positive. | ||
| 1459 | ;; WHERE describes the position of point, one of the symbols `at-header', | ||
| 1460 | ;; `in-header', `in-block', `in-trailer', `at-function-end', | ||
| 1461 | ;; `outwith-function' as returned by c-where-wrt-brace-construct. | ||
| 1462 | ;; | ||
| 1463 | ;; If we run out of functions, leave point at BOB. Return zero on success, | ||
| 1464 | ;; otherwise the number of {s still to go. | ||
| 1465 | ;; | ||
| 1466 | ;; This function may do hidden buffer changes | ||
| 1467 | (cond | ||
| 1468 | ;; What we do to go back the first defun depends on where we start. | ||
| 1469 | ((bobp)) | ||
| 1470 | ((eq where 'in-block) | ||
| 1471 | (goto-char (c-least-enclosing-brace (c-parse-state))) | ||
| 1472 | (setq n (1- n))) | ||
| 1473 | ((eq where 'in-header) | ||
| 1474 | (c-syntactic-re-search-forward "{") | ||
| 1475 | (backward-char) | ||
| 1476 | (setq n (1- n))) | ||
| 1477 | (;; (or (eq where 'at-header) (eq where 'outwith-function) | ||
| 1478 | ;; (eq where 'at-function-end) (eq where 'in-trailer)) | ||
| 1479 | (memq where '(at-header outwith-function at-function-end in-trailer)) | ||
| 1480 | (c-syntactic-skip-backward "^}") | ||
| 1481 | (when (eq (char-before) ?\}) | ||
| 1482 | (backward-sexp) | ||
| 1483 | (setq n (1- n)))) | ||
| 1484 | (t (error "Unknown `where' %s in c-backward-to-nth-EOF-{" where))) | ||
| 1485 | |||
| 1486 | ;; Each time round the loop, go back to a "{" at the outermost level. | ||
| 1487 | (while (and (> n 0) (not (bobp))) | ||
| 1488 | (c-parse-state) ; This call speeds up the following one | ||
| 1489 | ; by a factor of ~6. Hmmm. 2006/4/5. | ||
| 1490 | (c-syntactic-skip-backward "^}") | ||
| 1491 | (when (eq (char-before) ?\}) | ||
| 1492 | (backward-sexp) | ||
| 1493 | (setq n (1- n)))) | ||
| 1494 | n) | ||
| 1495 | |||
| 1331 | (defun c-beginning-of-defun (&optional arg) | 1496 | (defun c-beginning-of-defun (&optional arg) |
| 1332 | "Move backward to the beginning of a defun. | 1497 | "Move backward to the beginning of a defun. |
| 1333 | Every top level declaration that contains a brace paren block is | 1498 | Every top level declaration that contains a brace paren block is |
| @@ -1344,88 +1509,99 @@ defun." | |||
| 1344 | (interactive "p") | 1509 | (interactive "p") |
| 1345 | (or arg (setq arg 1)) | 1510 | (or arg (setq arg 1)) |
| 1346 | 1511 | ||
| 1347 | (if (< arg 0) | 1512 | (c-save-buffer-state |
| 1348 | (when (c-end-of-defun (- arg)) | 1513 | ((start (point)) |
| 1349 | (c-save-buffer-state nil (c-forward-syntactic-ws)) | 1514 | where paren-state pos) |
| 1350 | t) | ||
| 1351 | |||
| 1352 | (c-save-buffer-state (paren-state lim pos) | ||
| 1353 | (catch 'exit | ||
| 1354 | (while (> arg 0) | ||
| 1355 | ;; Note: Partial code duplication in `c-end-of-defun' and | ||
| 1356 | ;; `c-declaration-limits'. | ||
| 1357 | |||
| 1358 | (setq paren-state (c-parse-state)) | ||
| 1359 | (unless (c-safe | ||
| 1360 | (goto-char (c-least-enclosing-brace paren-state)) | ||
| 1361 | ;; If we moved to the outermost enclosing paren | ||
| 1362 | ;; then we can use c-safe-position to set the | ||
| 1363 | ;; limit. Can't do that otherwise since the | ||
| 1364 | ;; earlier paren pair on paren-state might very | ||
| 1365 | ;; well be part of the declaration we should go | ||
| 1366 | ;; to. | ||
| 1367 | (setq lim (c-safe-position (point) paren-state)) | ||
| 1368 | t) | ||
| 1369 | ;; At top level. Make sure we aren't inside a literal. | ||
| 1370 | (setq pos (c-literal-limits | ||
| 1371 | (c-safe-position (point) paren-state))) | ||
| 1372 | (if pos (goto-char (car pos)))) | ||
| 1373 | |||
| 1374 | (while (let ((start (point))) | ||
| 1375 | (c-beginning-of-decl-1 lim) | ||
| 1376 | (if (= (point) start) | ||
| 1377 | ;; Didn't move. Might be due to bob or unbalanced | ||
| 1378 | ;; parens. Try to continue if it's the latter. | ||
| 1379 | (unless (c-safe (goto-char | ||
| 1380 | (c-down-list-backward (point)))) | ||
| 1381 | ;; Didn't work, so it's bob then. | ||
| 1382 | (goto-char (point-min)) | ||
| 1383 | (throw 'exit nil))) | ||
| 1384 | 1515 | ||
| 1385 | (save-excursion | 1516 | ;; Move back out of any macro/comment/string we happen to be in. |
| 1386 | ;; Check if the declaration contains a brace | 1517 | (c-beginning-of-macro) |
| 1387 | ;; block. If not, we try another one. | 1518 | (setq pos (c-literal-limits)) |
| 1388 | (setq pos (point)) | 1519 | (if pos (goto-char (car pos))) |
| 1389 | (not (and (c-syntactic-re-search-forward "[;{]" nil t t) | 1520 | |
| 1390 | (or (eq (char-before) ?{) | 1521 | (setq where (c-where-wrt-brace-construct)) |
| 1391 | (and c-recognize-knr-p | 1522 | |
| 1392 | ;; Might have stopped on the | 1523 | (if (< arg 0) |
| 1393 | ;; ';' in a K&R argdecl. In | 1524 | ;; Move forward to the closing brace of a function. |
| 1394 | ;; that case the declaration | 1525 | (progn |
| 1395 | ;; should contain a block. | 1526 | (if ;; (or (eq where 'at-function-end) (eq where 'outwith-function)) |
| 1396 | (c-in-knr-argdecl pos))))))) | 1527 | (memq where '(at-function-end outwith-function)) |
| 1397 | (setq lim nil)) | 1528 | (setq arg (1+ arg))) |
| 1398 | 1529 | (if (< arg 0) | |
| 1399 | ;; Check if `c-beginning-of-decl-1' put us after the block | 1530 | (setq arg (c-forward-to-nth-EOF-} (- arg) where))) |
| 1400 | ;; in a declaration that doesn't end there. We're searching | 1531 | ;; Move forward to the next opening brace.... |
| 1401 | ;; back and forth over the block here, which can be | 1532 | (when (and (= arg 0) |
| 1402 | ;; expensive. | 1533 | (c-syntactic-re-search-forward "{" nil t)) |
| 1403 | (setq pos (point)) | 1534 | (backward-char) |
| 1404 | (if (and c-opt-block-decls-with-vars-key | 1535 | ;; ... and backward to the function header. |
| 1405 | (progn | 1536 | (c-beginning-of-decl-1) |
| 1406 | (c-backward-syntactic-ws) | 1537 | t)) |
| 1407 | (eq (char-before) ?})) | 1538 | |
| 1408 | (eq (car (c-beginning-of-decl-1)) | 1539 | ;; Move backward to the opening brace of a function. |
| 1409 | 'previous) | 1540 | (when (and (> arg 0) |
| 1410 | (save-excursion | 1541 | (eq (setq arg (c-backward-to-nth-BOF-{ arg where)) 0)) |
| 1411 | (c-end-of-decl-1) | 1542 | |
| 1412 | (> (point) pos))) | 1543 | ;; Go backward to this function's header. |
| 1413 | nil | 1544 | (c-beginning-of-decl-1) |
| 1414 | (goto-char pos)) | 1545 | |
| 1415 | 1546 | (setq pos (point)) | |
| 1416 | (setq pos (point)) | 1547 | ;; We're now there, modulo comments and whitespace. |
| 1417 | ;; Try to be line oriented; position point at the closest | 1548 | ;; Try to be line oriented; position point at the closest |
| 1418 | ;; preceding boi that isn't inside a comment, but if we hit | 1549 | ;; preceding boi that isn't inside a comment, but if we hit |
| 1419 | ;; the previous declaration then we use the current point | 1550 | ;; the previous declaration then we use the current point |
| 1420 | ;; instead. | 1551 | ;; instead. |
| 1421 | (while (and (/= (point) (c-point 'boi)) | 1552 | (while (and (/= (point) (c-point 'boi)) |
| 1422 | (c-backward-single-comment))) | 1553 | (c-backward-single-comment))) |
| 1423 | (if (/= (point) (c-point 'boi)) | 1554 | (if (/= (point) (c-point 'boi)) |
| 1424 | (goto-char pos)) | 1555 | (goto-char pos))) |
| 1425 | 1556 | ||
| 1426 | (setq arg (1- arg))))) | 1557 | (c-keep-region-active) |
| 1427 | (c-keep-region-active) | 1558 | (= arg 0)))) |
| 1428 | (= arg 0))) | 1559 | |
| 1560 | (defun c-forward-to-nth-EOF-} (n where) | ||
| 1561 | ;; Skip to the closing brace of the Nth function after point. If | ||
| 1562 | ;; point is inside a function, this counts as the first. Point must be | ||
| 1563 | ;; outside any comment/string or macro. | ||
| 1564 | ;; | ||
| 1565 | ;; N must be strictly positive. | ||
| 1566 | ;; WHERE describes the position of point, one of the symbols `at-header', | ||
| 1567 | ;; `in-header', `in-block', `in-trailer', `at-function-end', | ||
| 1568 | ;; `outwith-function' as returned by c-where-wrt-brace-construct. | ||
| 1569 | ;; | ||
| 1570 | ;; If we run out of functions, leave point at EOB. Return zero on success, | ||
| 1571 | ;; otherwise the number of }s still to go. | ||
| 1572 | ;; | ||
| 1573 | ;; This function may do hidden buffer changes. | ||
| 1574 | |||
| 1575 | (cond | ||
| 1576 | ;; What we do to go forward over the first defun depends on where we | ||
| 1577 | ;; start. We go to the closing brace of that defun, even when we go | ||
| 1578 | ;; backwards to it (in a "struct foo {...} bar ;"). | ||
| 1579 | ((eobp)) | ||
| 1580 | ((eq where 'in-block) | ||
| 1581 | (goto-char (c-least-enclosing-brace (c-parse-state))) | ||
| 1582 | (forward-sexp) | ||
| 1583 | (setq n (1- n))) | ||
| 1584 | ((eq where 'in-trailer) | ||
| 1585 | (c-syntactic-skip-backward "^}") | ||
| 1586 | (setq n (1- n))) | ||
| 1587 | (;; (or (eq where 'at-function-end) (eq where 'outwith-function) | ||
| 1588 | ;; (eq where 'at-header) (eq where 'in-header)) | ||
| 1589 | (memq where '(at-function-end outwith-function at-header in-header)) | ||
| 1590 | (c-syntactic-re-search-forward "{") | ||
| 1591 | (backward-char) | ||
| 1592 | (forward-sexp) | ||
| 1593 | (setq n (1- n))) | ||
| 1594 | (t (error "c-forward-to-nth-EOF-}: `where' is %s" where))) | ||
| 1595 | |||
| 1596 | ;; Each time round the loop, go forward to a "}" at the outermost level. | ||
| 1597 | (while (and (> n 0) (not (eobp))) | ||
| 1598 | ;(c-parse-state) ; This call speeds up the following one by a factor | ||
| 1599 | ; of ~6. Hmmm. 2006/4/5. | ||
| 1600 | (when (c-syntactic-re-search-forward "{" nil 'eob) | ||
| 1601 | (backward-char) | ||
| 1602 | (forward-sexp)) | ||
| 1603 | (setq n (1- n))) | ||
| 1604 | n) | ||
| 1429 | 1605 | ||
| 1430 | (defun c-end-of-defun (&optional arg) | 1606 | (defun c-end-of-defun (&optional arg) |
| 1431 | "Move forward to the end of a top level declaration. | 1607 | "Move forward to the end of a top level declaration. |
| @@ -1435,82 +1611,56 @@ beginning or end of buffer. | |||
| 1435 | 1611 | ||
| 1436 | An end of a defun occurs right after the close-parenthesis that matches | 1612 | An end of a defun occurs right after the close-parenthesis that matches |
| 1437 | the open-parenthesis that starts a defun; see `beginning-of-defun'." | 1613 | the open-parenthesis that starts a defun; see `beginning-of-defun'." |
| 1438 | |||
| 1439 | (interactive "p") | 1614 | (interactive "p") |
| 1440 | (or arg (setq arg 1)) | 1615 | (or arg (setq arg 1)) |
| 1441 | 1616 | ||
| 1442 | (if (< arg 0) | 1617 | (c-save-buffer-state |
| 1443 | (when (c-beginning-of-defun (- arg)) | 1618 | ((start (point)) |
| 1444 | (c-save-buffer-state nil (c-backward-syntactic-ws)) | 1619 | where paren-state pos) |
| 1445 | t) | 1620 | |
| 1446 | 1621 | ;; Move back out of any macro/comment/string we happen to be in. | |
| 1447 | (c-save-buffer-state (paren-state lim pos) | 1622 | (c-beginning-of-macro) |
| 1448 | (catch 'exit | 1623 | (setq pos (c-literal-limits)) |
| 1449 | (while (> arg 0) | 1624 | (if pos (goto-char (car pos))) |
| 1450 | ;; Note: Partial code duplication in `c-beginning-of-defun' | 1625 | |
| 1451 | ;; and `c-declaration-limits'. | 1626 | (setq where (c-where-wrt-brace-construct)) |
| 1452 | 1627 | ||
| 1453 | (setq paren-state (c-parse-state)) | 1628 | (if (< arg 0) |
| 1454 | (unless (c-safe | 1629 | ;; Move backwards to the } of a function |
| 1455 | (goto-char (c-least-enclosing-brace paren-state)) | 1630 | (progn |
| 1456 | ;; If we moved to the outermost enclosing paren | 1631 | (if ;; (or (eq where 'at-header) (eq where 'outwith-function)) |
| 1457 | ;; then we can use c-safe-position to set the | 1632 | (memq where '(at-header outwith-function)) |
| 1458 | ;; limit. Can't do that otherwise since the | 1633 | (setq arg (1+ arg))) |
| 1459 | ;; earlier paren pair on paren-state might very | 1634 | (if (< arg 0) |
| 1460 | ;; well be part of the declaration we should go | 1635 | (setq arg (c-backward-to-nth-BOF-{ (- arg) where))) |
| 1461 | ;; to. | 1636 | (when (and (= arg 0) |
| 1462 | (setq lim (c-safe-position (point) paren-state)) | 1637 | (c-syntactic-skip-backward "^}") |
| 1463 | t) | 1638 | (eq (char-before) ?\})) |
| 1464 | ;; At top level. Make sure we aren't inside a literal. | 1639 | t)) |
| 1465 | (setq pos (car-safe (c-literal-limits | 1640 | |
| 1466 | (c-safe-position (point) paren-state)))) | 1641 | ;; Move forward to the } of a function |
| 1467 | (if pos (goto-char pos))) | 1642 | (if (> arg 0) |
| 1468 | 1643 | (setq arg (c-forward-to-nth-EOF-} arg where)))) | |
| 1469 | ;; Have to move to the start first so that `c-end-of-decl-1' | 1644 | |
| 1470 | ;; has the correct start position. | 1645 | ;; Do we need to move forward from the brace to the semicolon? |
| 1471 | (setq pos (point)) | 1646 | (when (eq arg 0) |
| 1472 | (when (memq (car (c-beginning-of-decl-1 lim)) | 1647 | (if (c-in-function-trailer-p) ; after "}" of struct/enum, etc. |
| 1473 | '(previous macro)) | 1648 | (c-syntactic-re-search-forward ";")) |
| 1474 | ;; We moved back over the previous defun or a macro. Move | 1649 | |
| 1475 | ;; to the next token; it's the start of the next | 1650 | (setq pos (point)) |
| 1476 | ;; declaration. We can also be directly after the block | 1651 | ;; We're there now, modulo comments and whitespace. |
| 1477 | ;; in a `c-opt-block-decls-with-vars-key' declaration, but | 1652 | ;; Try to be line oriented; position point after the next |
| 1478 | ;; then we won't move significantly far here. | 1653 | ;; newline that isn't inside a comment, but if we hit the |
| 1479 | (goto-char pos) | 1654 | ;; next declaration then we use the current point instead. |
| 1480 | (c-forward-token-2 0)) | 1655 | (while (and (not (bolp)) |
| 1481 | 1656 | (not (looking-at "\\s *$")) | |
| 1482 | (while (let ((start (point))) | 1657 | (c-forward-single-comment))) |
| 1483 | (c-end-of-decl-1) | 1658 | (cond ((bolp)) |
| 1484 | (if (= (point) start) | 1659 | ((looking-at "\\s *$") |
| 1485 | ;; Didn't move. Might be due to eob or unbalanced | 1660 | (forward-line 1)) |
| 1486 | ;; parens. Try to continue if it's the latter. | 1661 | (t |
| 1487 | (if (c-safe (goto-char (c-up-list-forward (point)))) | 1662 | (goto-char pos)))) |
| 1488 | t | ||
| 1489 | ;; Didn't work, so it's eob then. | ||
| 1490 | (goto-char (point-max)) | ||
| 1491 | (throw 'exit nil)) | ||
| 1492 | |||
| 1493 | (save-excursion | ||
| 1494 | ;; Check if the declaration contains a brace | ||
| 1495 | ;; block. If not, we try another one. | ||
| 1496 | (setq pos (point)) | ||
| 1497 | (goto-char start) | ||
| 1498 | (not (c-syntactic-re-search-forward "{" pos t t)))))) | ||
| 1499 | |||
| 1500 | (setq pos (point)) | ||
| 1501 | ;; Try to be line oriented; position point after the next | ||
| 1502 | ;; newline that isn't inside a comment, but if we hit the | ||
| 1503 | ;; next declaration then we use the current point instead. | ||
| 1504 | (while (and (not (bolp)) | ||
| 1505 | (not (looking-at "\\s *$")) | ||
| 1506 | (c-forward-single-comment))) | ||
| 1507 | (cond ((bolp)) | ||
| 1508 | ((looking-at "\\s *$") | ||
| 1509 | (forward-line 1)) | ||
| 1510 | (t | ||
| 1511 | (goto-char pos))) | ||
| 1512 | 1663 | ||
| 1513 | (setq arg (1- arg))))) | ||
| 1514 | (c-keep-region-active) | 1664 | (c-keep-region-active) |
| 1515 | (= arg 0))) | 1665 | (= arg 0))) |
| 1516 | 1666 | ||
| @@ -1646,6 +1796,7 @@ function does not require the declaration to contain a brace block." | |||
| 1646 | (push-mark (cdr decl-limits) nil t)))) | 1796 | (push-mark (cdr decl-limits) nil t)))) |
| 1647 | 1797 | ||
| 1648 | 1798 | ||
| 1799 | ;; Movement by statements. | ||
| 1649 | (defun c-in-comment-line-prefix-p () | 1800 | (defun c-in-comment-line-prefix-p () |
| 1650 | ;; Point is within a comment. Is it also within a comment-prefix? | 1801 | ;; Point is within a comment. Is it also within a comment-prefix? |
| 1651 | ;; Space at BOL which precedes a comment-prefix counts as part of it. | 1802 | ;; Space at BOL which precedes a comment-prefix counts as part of it. |
| @@ -2429,7 +2580,6 @@ sentence motion in or near comments and multiline strings." | |||
| 2429 | (if (/= count 0) (setq count (1- count)))) | 2580 | (if (/= count 0) (setq count (1- count)))) |
| 2430 | (c-keep-region-active)))) | 2581 | (c-keep-region-active)))) |
| 2431 | 2582 | ||
| 2432 | |||
| 2433 | 2583 | ||
| 2434 | ;; set up electric character functions to work with pending-del, | 2584 | ;; set up electric character functions to work with pending-del, |
| 2435 | ;; (a.k.a. delsel) mode. All symbols get the t value except | 2585 | ;; (a.k.a. delsel) mode. All symbols get the t value except |
| @@ -2455,6 +2605,7 @@ sentence motion in or near comments and multiline strings." | |||
| 2455 | (put 'c-electric-delete-forward 'pending-delete 'supersede) ; pending-del | 2605 | (put 'c-electric-delete-forward 'pending-delete 'supersede) ; pending-del |
| 2456 | 2606 | ||
| 2457 | 2607 | ||
| 2608 | ;; Inserting/indenting comments | ||
| 2458 | (defun c-calc-comment-indent (entry) | 2609 | (defun c-calc-comment-indent (entry) |
| 2459 | ;; This function might do hidden buffer changes. | 2610 | ;; This function might do hidden buffer changes. |
| 2460 | (if (symbolp entry) | 2611 | (if (symbolp entry) |
| @@ -2550,6 +2701,7 @@ See `c-indent-comment-alist' for a description." | |||
| 2550 | (current-column)))) | 2701 | (current-column)))) |
| 2551 | 2702 | ||
| 2552 | 2703 | ||
| 2704 | ;; Movement by CPP conditionals. | ||
| 2553 | (defun c-up-conditional (count) | 2705 | (defun c-up-conditional (count) |
| 2554 | "Move back to the containing preprocessor conditional, leaving mark behind. | 2706 | "Move back to the containing preprocessor conditional, leaving mark behind. |
| 2555 | A prefix argument acts as a repeat count. With a negative argument, | 2707 | A prefix argument acts as a repeat count. With a negative argument, |
| @@ -3598,7 +3750,7 @@ command to conveniently insert and align the necessary backslashes." | |||
| 3598 | ;; Note that this function does not do any hidden buffer changes. | 3750 | ;; Note that this function does not do any hidden buffer changes. |
| 3599 | 3751 | ||
| 3600 | (let (fill | 3752 | (let (fill |
| 3601 | ;; beg and end limits the region to narrow. end is a marker. | 3753 | ;; beg and end limit the region to narrow. end is a marker. |
| 3602 | beg end | 3754 | beg end |
| 3603 | ;; tmp-pre and tmp-post mark strings that are temporarily | 3755 | ;; tmp-pre and tmp-post mark strings that are temporarily |
| 3604 | ;; inserted at the start and end of the region. tmp-pre is a | 3756 | ;; inserted at the start and end of the region. tmp-pre is a |
| @@ -3621,9 +3773,12 @@ command to conveniently insert and align the necessary backslashes." | |||
| 3621 | ;; Restore point on undo. It's necessary since we do a lot of | 3773 | ;; Restore point on undo. It's necessary since we do a lot of |
| 3622 | ;; hidden inserts and deletes below that should be as transparent | 3774 | ;; hidden inserts and deletes below that should be as transparent |
| 3623 | ;; as possible. | 3775 | ;; as possible. |
| 3624 | (if (and buffer-undo-list (not (eq buffer-undo-list t))) | 3776 | (if (and buffer-undo-list (not (eq buffer-undo-list t))) |
| 3625 | (setq buffer-undo-list (cons (point) buffer-undo-list))) | 3777 | (setq buffer-undo-list (cons (point) buffer-undo-list))) |
| 3626 | 3778 | ||
| 3779 | ;; Determine the limits and type of the containing literal (if any): | ||
| 3780 | ;; C-LIT-LIMITS, C-LIT-TYPE; and the limits of the current paragraph: | ||
| 3781 | ;; BEG and END. | ||
| 3627 | (c-save-buffer-state () | 3782 | (c-save-buffer-state () |
| 3628 | (save-restriction | 3783 | (save-restriction |
| 3629 | ;; Widen to catch comment limits correctly. | 3784 | ;; Widen to catch comment limits correctly. |
| @@ -3651,6 +3806,13 @@ command to conveniently insert and align the necessary backslashes." | |||
| 3651 | 3806 | ||
| 3652 | (unwind-protect | 3807 | (unwind-protect |
| 3653 | (progn | 3808 | (progn |
| 3809 | ;; For each of the possible types of text (string, C comment ...) | ||
| 3810 | ;; determine BEG and END, the region we will narrow to. If we're in | ||
| 3811 | ;; a literal, constrain BEG and END to the limits of this literal. | ||
| 3812 | ;; | ||
| 3813 | ;; For some of these text types, particularly a block comment, we | ||
| 3814 | ;; may need to massage whitespace near literal delimiters, so that | ||
| 3815 | ;; these don't get filled inappropriately. | ||
| 3654 | (cond | 3816 | (cond |
| 3655 | 3817 | ||
| 3656 | ((eq c-lit-type 'c++) ; Line comment. | 3818 | ((eq c-lit-type 'c++) ; Line comment. |
| @@ -3674,22 +3836,34 @@ command to conveniently insert and align the necessary backslashes." | |||
| 3674 | (setq apply-outside-literal t)) | 3836 | (setq apply-outside-literal t)) |
| 3675 | 3837 | ||
| 3676 | ((eq c-lit-type 'c) ; Block comment. | 3838 | ((eq c-lit-type 'c) ; Block comment. |
| 3677 | (when (>= end (cdr c-lit-limits)) | 3839 | (when |
| 3678 | ;; The region includes the comment ender which we might | 3840 | (or (> end (cdr c-lit-limits)) |
| 3679 | ;; want to keep together with the last word. | 3841 | (and (= end (cdr c-lit-limits)) |
| 3680 | (unless (save-excursion | 3842 | (eq (char-before end) ?/) |
| 3681 | (goto-char (cdr c-lit-limits)) | 3843 | (eq (char-before (1- end)) ?*) |
| 3682 | (beginning-of-line) | 3844 | ;; disallow "/*/" |
| 3683 | (and (looking-at (concat "[ \t]*\\(" | 3845 | (> (- (cdr c-lit-limits) (car c-lit-limits)) 3))) |
| 3684 | c-current-comment-prefix | 3846 | ;; There is a comment ender, and the region includes it. If |
| 3685 | "\\)\\*/")) | 3847 | ;; it's on its own line, it stays on its own line. If it's got |
| 3686 | (eq (cdr c-lit-limits) (match-end 0)) | 3848 | ;; company on the line, it keeps (at least one word of) it. |
| 3687 | ;; The comment ender is on a line of its | 3849 | ;; "=====*/" counts as a comment ender here, but "===== */" |
| 3688 | ;; own. Keep it that way. | 3850 | ;; doesn't and "foo*/" doesn't. |
| 3689 | (set-marker end (point)))) | 3851 | (unless |
| 3690 | 3852 | (save-excursion | |
| 3691 | ;; The comment ender should hang. Replace all space between | 3853 | (goto-char (cdr c-lit-limits)) |
| 3692 | ;; it and the last word either by one or two 'x's (when | 3854 | (beginning-of-line) |
| 3855 | (and (search-forward-regexp | ||
| 3856 | (concat "\\=[ \t]*\\(" c-current-comment-prefix "\\)") | ||
| 3857 | (- (cdr c-lit-limits) 2) t) | ||
| 3858 | (not (search-forward-regexp | ||
| 3859 | "\\(\\s \\|\\sw\\)" | ||
| 3860 | (- (cdr c-lit-limits) 2) 'limit)) | ||
| 3861 | ;; The comment ender IS on its own line. Exclude | ||
| 3862 | ;; this line from the filling. | ||
| 3863 | (set-marker end (c-point 'bol)))) | ||
| 3864 | |||
| 3865 | ;; The comment ender is hanging. Replace all space between it | ||
| 3866 | ;; and the last word either by one or two 'x's (when | ||
| 3693 | ;; FILL-PARAGRAPH is non-nil), or a row of x's the same width | 3867 | ;; FILL-PARAGRAPH is non-nil), or a row of x's the same width |
| 3694 | ;; as the whitespace (when auto filling), and include it in | 3868 | ;; as the whitespace (when auto filling), and include it in |
| 3695 | ;; the region. We'll change them back to whitespace | 3869 | ;; the region. We'll change them back to whitespace |
| @@ -3706,23 +3880,26 @@ command to conveniently insert and align the necessary backslashes." | |||
| 3706 | spaces) | 3880 | spaces) |
| 3707 | 3881 | ||
| 3708 | (save-excursion | 3882 | (save-excursion |
| 3883 | ;; Insert a CR after the "*/", adjust END | ||
| 3709 | (goto-char (cdr c-lit-limits)) | 3884 | (goto-char (cdr c-lit-limits)) |
| 3710 | (setq tmp-post (point-marker)) | 3885 | (setq tmp-post (point-marker)) |
| 3711 | (insert ?\n) | 3886 | (insert ?\n) |
| 3712 | (set-marker end (point)) | 3887 | (set-marker end (point)) |
| 3888 | |||
| 3713 | (forward-line -1) ; last line of the comment | 3889 | (forward-line -1) ; last line of the comment |
| 3714 | (if (and (looking-at (concat "[ \t]*\\(\\(" | 3890 | (if (and (looking-at (concat "[ \t]*\\(\\(" |
| 3715 | c-current-comment-prefix | 3891 | c-current-comment-prefix |
| 3716 | "\\)[ \t]*\\)")) | 3892 | "\\)[ \t]*\\)")) |
| 3717 | (eq ender-start (match-end 0))) | 3893 | (eq ender-start (match-end 0))) |
| 3718 | ;; The comment ender is prefixed by nothing | 3894 | ;; The comment ender is prefixed by nothing but a |
| 3719 | ;; but a comment line prefix. Remove it | 3895 | ;; comment line prefix. IS THIS POSSIBLE? (ACM, |
| 3720 | ;; along with surrounding ws. | 3896 | ;; 2006/4/28). Remove it along with surrounding ws. |
| 3721 | (setq spaces (- (match-end 1) (match-end 2))) | 3897 | (setq spaces (- (match-end 1) (match-end 2))) |
| 3722 | (goto-char ender-start)) | 3898 | (goto-char ender-start)) |
| 3723 | (skip-chars-backward " \t\r\n") ; Surely this can be | 3899 | (skip-chars-backward " \t\r\n") ; Surely this can be |
| 3724 | ; " \t"? "*/" is NOT alone on the line (ACM, 2005/8/18) | 3900 | ; " \t"? "*/" is NOT alone on the line (ACM, 2005/8/18) |
| 3725 | 3901 | ||
| 3902 | ;; What's being tested here? 2006/4/20. FIXME!!! | ||
| 3726 | (if (/= (point) ender-start) | 3903 | (if (/= (point) ender-start) |
| 3727 | (progn | 3904 | (progn |
| 3728 | (if (<= here (point)) | 3905 | (if (<= here (point)) |
| @@ -4172,49 +4349,63 @@ it. | |||
| 4172 | When point is inside a comment, continue it with the appropriate | 4349 | When point is inside a comment, continue it with the appropriate |
| 4173 | comment prefix (see the `c-comment-prefix-regexp' and | 4350 | comment prefix (see the `c-comment-prefix-regexp' and |
| 4174 | `c-block-comment-prefix' variables for details). The end of a | 4351 | `c-block-comment-prefix' variables for details). The end of a |
| 4175 | C++-style line comment doesn't count as inside it." | 4352 | C++-style line comment doesn't count as inside it. |
| 4353 | |||
| 4354 | When point is inside a string, only insert a backslash when it is also | ||
| 4355 | inside a preprocessor directive." | ||
| 4176 | 4356 | ||
| 4177 | (interactive "*") | 4357 | (interactive "*") |
| 4178 | (let* (c-lit-limits c-lit-type | 4358 | (let* (c-lit-limits c-lit-type |
| 4179 | (c-macro-start c-macro-start)) | 4359 | (c-macro-start c-macro-start)) |
| 4180 | 4360 | ||
| 4181 | (if (c-save-buffer-state () | 4361 | (c-save-buffer-state () |
| 4182 | (setq c-lit-limits (c-literal-limits nil nil t) | 4362 | (setq c-lit-limits (c-literal-limits nil nil t) |
| 4183 | c-lit-type (c-literal-type c-lit-limits)) | 4363 | c-lit-type (c-literal-type c-lit-limits)) |
| 4184 | (or (eq c-lit-type 'c) | 4364 | (when (eq c-lit-type 'c++) |
| 4185 | (and (eq c-lit-type 'c++) | 4365 | (setq c-lit-limits (c-collect-line-comments c-lit-limits))) |
| 4186 | (< (save-excursion | 4366 | (c-query-and-set-macro-start)) |
| 4187 | (skip-chars-forward " \t") | ||
| 4188 | (point)) | ||
| 4189 | (1- (cdr (setq c-lit-limits (c-collect-line-comments | ||
| 4190 | c-lit-limits)))))) | ||
| 4191 | (and (or (not (looking-at "\\s *$")) | ||
| 4192 | (eq (char-before) ?\\)) | ||
| 4193 | (c-query-and-set-macro-start) | ||
| 4194 | (<= (save-excursion | ||
| 4195 | (goto-char c-macro-start) | ||
| 4196 | (if (looking-at c-opt-cpp-start) | ||
| 4197 | (goto-char (match-end 0))) | ||
| 4198 | (point)) | ||
| 4199 | (point))))) | ||
| 4200 | |||
| 4201 | (let ((comment-multi-line t) | ||
| 4202 | (fill-prefix nil)) | ||
| 4203 | (c-indent-new-comment-line nil t)) | ||
| 4204 | |||
| 4205 | (delete-horizontal-space) | ||
| 4206 | (newline) | ||
| 4207 | 4367 | ||
| 4368 | (cond | ||
| 4369 | ((or (eq c-lit-type 'c) | ||
| 4370 | (and (eq c-lit-type 'c++) ; C++ comment, but not at the very end of it. | ||
| 4371 | (< (save-excursion | ||
| 4372 | (skip-chars-forward " \t") | ||
| 4373 | (point)) | ||
| 4374 | (1- (cdr c-lit-limits)))) | ||
| 4375 | (and (numberp c-macro-start) ; Macro, but not at the very end of | ||
| 4376 | ; it, not in a string, and not in the | ||
| 4377 | ; cpp keyword. | ||
| 4378 | (not (eq c-lit-type 'string)) | ||
| 4379 | (or (not (looking-at "\\s *$")) | ||
| 4380 | (eq (char-before) ?\\)) | ||
| 4381 | (<= (save-excursion | ||
| 4382 | (goto-char c-macro-start) | ||
| 4383 | (if (looking-at c-opt-cpp-start) | ||
| 4384 | (goto-char (match-end 0))) | ||
| 4385 | (point)) | ||
| 4386 | (point)))) | ||
| 4387 | (let ((comment-multi-line t) | ||
| 4388 | (fill-prefix nil)) | ||
| 4389 | (c-indent-new-comment-line nil t))) | ||
| 4390 | |||
| 4391 | ((eq c-lit-type 'string) | ||
| 4392 | (if (and (numberp c-macro-start) | ||
| 4393 | (not (eq (char-before) ?\\))) | ||
| 4394 | (insert ?\\)) | ||
| 4395 | (newline)) | ||
| 4396 | |||
| 4397 | (t (delete-horizontal-space) | ||
| 4398 | (newline) | ||
| 4208 | ;; c-indent-line may look at the current indentation, so let's | 4399 | ;; c-indent-line may look at the current indentation, so let's |
| 4209 | ;; start out with the same indentation as the previous line. | 4400 | ;; start out with the same indentation as the previous line. |
| 4210 | (let ((col (save-excursion | 4401 | (let ((col (save-excursion |
| 4211 | (forward-line -1) | 4402 | (backward-char) |
| 4212 | (while (and (looking-at "[ \t]*\\\\?$") | 4403 | (forward-line 0) |
| 4213 | (= (forward-line -1) 0))) | 4404 | (while (and (looking-at "[ \t]*\\\\?$") |
| 4214 | (current-indentation)))) | 4405 | (= (forward-line -1) 0))) |
| 4215 | (indent-to col)) | 4406 | (current-indentation)))) |
| 4216 | 4407 | (indent-to col)) | |
| 4217 | (indent-according-to-mode)))) | 4408 | (indent-according-to-mode))))) |
| 4218 | 4409 | ||
| 4219 | (defun c-context-open-line () | 4410 | (defun c-context-open-line () |
| 4220 | "Insert a line break suitable to the context and leave point before it. | 4411 | "Insert a line break suitable to the context and leave point before it. |
diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el index df2f247f048..b4063554384 100644 --- a/lisp/progmodes/cc-defs.el +++ b/lisp/progmodes/cc-defs.el | |||
| @@ -95,7 +95,7 @@ | |||
| 95 | 95 | ||
| 96 | ;;; Variables also used at compile time. | 96 | ;;; Variables also used at compile time. |
| 97 | 97 | ||
| 98 | (defconst c-version "5.31.3" | 98 | (defconst c-version "5.31.4" |
| 99 | "CC Mode version number.") | 99 | "CC Mode version number.") |
| 100 | 100 | ||
| 101 | (defconst c-version-sym (intern c-version)) | 101 | (defconst c-version-sym (intern c-version)) |
| @@ -764,7 +764,7 @@ be after it." | |||
| 764 | ;; call `c-beginning-of-statement-1'. | 764 | ;; call `c-beginning-of-statement-1'. |
| 765 | ;; | 765 | ;; |
| 766 | ;; The macro `c-vsemi-status-unknown-p' will typically check the cacheing | 766 | ;; The macro `c-vsemi-status-unknown-p' will typically check the cacheing |
| 767 | ;; scheme used by the `c-at-vsemp-p-fn', hence the name - the status is | 767 | ;; scheme used by the `c-at-vsemi-p-fn', hence the name - the status is |
| 768 | ;; "unknown" if there is no cache entry current for the line. | 768 | ;; "unknown" if there is no cache entry current for the line. |
| 769 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 769 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 770 | 770 | ||
| @@ -1620,7 +1620,7 @@ itself is evaluated." | |||
| 1620 | 1620 | ||
| 1621 | (defmacro c-lang-defconst (name &rest args) | 1621 | (defmacro c-lang-defconst (name &rest args) |
| 1622 | "Set the language specific values of the language constant NAME. | 1622 | "Set the language specific values of the language constant NAME. |
| 1623 | The second argument can be an optional docstring. The rest of the | 1623 | The second argument can optionally be a docstring. The rest of the |
| 1624 | arguments are one or more repetitions of LANG VAL where LANG specifies | 1624 | arguments are one or more repetitions of LANG VAL where LANG specifies |
| 1625 | the language(s) that VAL applies to. LANG is the name of the | 1625 | the language(s) that VAL applies to. LANG is the name of the |
| 1626 | language, i.e. the mode name without the \"-mode\" suffix, or a list | 1626 | language, i.e. the mode name without the \"-mode\" suffix, or a list |
| @@ -1717,7 +1717,7 @@ constant. A file is identified by its base name." | |||
| 1717 | ;; Emacs has a weird bug where it seems to fail to read | 1717 | ;; Emacs has a weird bug where it seems to fail to read |
| 1718 | ;; backquote lists from byte compiled files correctly (,@ | 1718 | ;; backquote lists from byte compiled files correctly (,@ |
| 1719 | ;; forms, to be specific), so make sure the bindings in the | 1719 | ;; forms, to be specific), so make sure the bindings in the |
| 1720 | ;; expansion below doesn't contain any backquote stuff. | 1720 | ;; expansion below don't contain any backquote stuff. |
| 1721 | ;; (XEmacs handles it correctly and doesn't need this for that | 1721 | ;; (XEmacs handles it correctly and doesn't need this for that |
| 1722 | ;; reason, but we also use this expansion handle | 1722 | ;; reason, but we also use this expansion handle |
| 1723 | ;; `c-lang-defconst-eval-immediately' and to register | 1723 | ;; `c-lang-defconst-eval-immediately' and to register |
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 5cb00929007..bacb4670ea0 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el | |||
| @@ -255,6 +255,18 @@ comment at the start of cc-engine.el for more info." | |||
| 255 | (forward-char) | 255 | (forward-char) |
| 256 | t)))) | 256 | t)))) |
| 257 | 257 | ||
| 258 | (defun c-forward-over-cpp-define-id () | ||
| 259 | ;; Assuming point is at the "#" that introduces a preprocessor | ||
| 260 | ;; directive, it's moved forward to the end of the identifier which is | ||
| 261 | ;; "#define"d (or whatever c-opt-cpp-macro-define specifies). Non-nil | ||
| 262 | ;; is returned in this case, in all other cases nil is returned and | ||
| 263 | ;; point isn't moved. | ||
| 264 | ;; | ||
| 265 | ;; This function might do hidden buffer changes. | ||
| 266 | (when (and c-opt-cpp-macro-define-id | ||
| 267 | (looking-at c-opt-cpp-macro-define-id)) | ||
| 268 | (goto-char (match-end 0)))) | ||
| 269 | |||
| 258 | (defun c-forward-to-cpp-define-body () | 270 | (defun c-forward-to-cpp-define-body () |
| 259 | ;; Assuming point is at the "#" that introduces a preprocessor | 271 | ;; Assuming point is at the "#" that introduces a preprocessor |
| 260 | ;; directive, it's moved forward to the start of the definition body | 272 | ;; directive, it's moved forward to the start of the definition body |
| @@ -2442,14 +2454,14 @@ comment at the start of cc-engine.el for more info." | |||
| 2442 | (= (c-backward-token-2 0) 0)) | 2454 | (= (c-backward-token-2 0) 0)) |
| 2443 | 2455 | ||
| 2444 | (cond ((and (looking-at c-overloadable-operators-regexp) | 2456 | (cond ((and (looking-at c-overloadable-operators-regexp) |
| 2445 | (or (not c-opt-op-identitier-prefix) | 2457 | (or (not c-opt-op-identifier-prefix) |
| 2446 | (and (= (c-backward-token-2 1) 0) | 2458 | (and (= (c-backward-token-2 1) 0) |
| 2447 | (looking-at c-opt-op-identitier-prefix)))) | 2459 | (looking-at c-opt-op-identifier-prefix)))) |
| 2448 | (point)) | 2460 | (point)) |
| 2449 | 2461 | ||
| 2450 | ((save-excursion | 2462 | ((save-excursion |
| 2451 | (and c-opt-op-identitier-prefix | 2463 | (and c-opt-op-identifier-prefix |
| 2452 | (looking-at c-opt-op-identitier-prefix) | 2464 | (looking-at c-opt-op-identifier-prefix) |
| 2453 | (= (c-forward-token-2 1) 0) | 2465 | (= (c-forward-token-2 1) 0) |
| 2454 | (looking-at c-overloadable-operators-regexp))) | 2466 | (looking-at c-overloadable-operators-regexp))) |
| 2455 | (point)))) | 2467 | (point)))) |
| @@ -3843,7 +3855,7 @@ comment at the start of cc-engine.el for more info." | |||
| 3843 | ;; good start position for the search, so do it. | 3855 | ;; good start position for the search, so do it. |
| 3844 | (c-find-decl-prefix-search))) | 3856 | (c-find-decl-prefix-search))) |
| 3845 | 3857 | ||
| 3846 | ;; Now loop. We already got the first match. | 3858 | ;; Now loop. Round what? (ACM, 2006/7/5). We already got the first match. |
| 3847 | 3859 | ||
| 3848 | (while (progn | 3860 | (while (progn |
| 3849 | (while (and | 3861 | (while (and |
| @@ -4534,41 +4546,42 @@ comment at the start of cc-engine.el for more info." | |||
| 4534 | (goto-char start) | 4546 | (goto-char start) |
| 4535 | nil) | 4547 | nil) |
| 4536 | 4548 | ||
| 4537 | (while (and | 4549 | (while (progn |
| 4538 | (c-syntactic-skip-backward "^<;{}" limit t) | 4550 | (c-syntactic-skip-backward "^<;{}" limit t) |
| 4539 | 4551 | ||
| 4540 | (if (eq (char-before) ?<) | 4552 | (and |
| 4541 | t | 4553 | (if (eq (char-before) ?<) |
| 4542 | ;; Stopped at bob or a char that isn't allowed in an | 4554 | t |
| 4543 | ;; arglist, so we've failed. | 4555 | ;; Stopped at bob or a char that isn't allowed in an |
| 4544 | (goto-char start) | 4556 | ;; arglist, so we've failed. |
| 4545 | nil) | 4557 | (goto-char start) |
| 4558 | nil) | ||
| 4546 | 4559 | ||
| 4547 | (if (> (point) | 4560 | (if (> (point) |
| 4548 | (progn (c-beginning-of-current-token) | 4561 | (progn (c-beginning-of-current-token) |
| 4549 | (point))) | 4562 | (point))) |
| 4550 | ;; If we moved then the "<" was part of some | 4563 | ;; If we moved then the "<" was part of some |
| 4551 | ;; multicharacter token. | 4564 | ;; multicharacter token. |
| 4552 | t | 4565 | t |
| 4553 | 4566 | ||
| 4554 | (backward-char) | 4567 | (backward-char) |
| 4555 | (let ((beg-pos (point))) | 4568 | (let ((beg-pos (point))) |
| 4556 | (if (c-forward-<>-arglist all-types) | 4569 | (if (c-forward-<>-arglist all-types) |
| 4557 | (cond ((= (point) start) | 4570 | (cond ((= (point) start) |
| 4558 | ;; Matched the arglist. Break the while. | 4571 | ;; Matched the arglist. Break the while. |
| 4559 | (goto-char beg-pos) | 4572 | (goto-char beg-pos) |
| 4560 | nil) | 4573 | nil) |
| 4561 | ((> (point) start) | 4574 | ((> (point) start) |
| 4562 | ;; We started from a non-paren ">" inside an | 4575 | ;; We started from a non-paren ">" inside an |
| 4563 | ;; arglist. | 4576 | ;; arglist. |
| 4564 | (goto-char start) | 4577 | (goto-char start) |
| 4565 | nil) | 4578 | nil) |
| 4566 | (t | 4579 | (t |
| 4567 | ;; Matched a shorter arglist. Can be a nested | 4580 | ;; Matched a shorter arglist. Can be a nested |
| 4568 | ;; one so continue looking. | 4581 | ;; one so continue looking. |
| 4569 | (goto-char beg-pos) | 4582 | (goto-char beg-pos) |
| 4570 | t)) | 4583 | t)) |
| 4571 | t))))) | 4584 | t)))))) |
| 4572 | 4585 | ||
| 4573 | (/= (point) start)))) | 4586 | (/= (point) start)))) |
| 4574 | 4587 | ||
| @@ -5793,17 +5806,32 @@ y ;; True if there's a suffix match outside the outermost | |||
| 5793 | nil)))) | 5806 | nil)))) |
| 5794 | 5807 | ||
| 5795 | (defun c-forward-label (&optional assume-markup preceding-token-end limit) | 5808 | (defun c-forward-label (&optional assume-markup preceding-token-end limit) |
| 5796 | ;; Assuming the point is at the beginning of a token, check if it | 5809 | ;; Assuming that point is at the beginning of a token, check if it starts a |
| 5797 | ;; starts a label and if so move over it and return t, otherwise | 5810 | ;; label and if so move over it and return t, otherwise don't move and |
| 5798 | ;; don't move and return nil. The end of the label is taken to be | 5811 | ;; return nil. "Label" here means "most things with a colon". |
| 5799 | ;; the end of the first submatch in `c-opt-extra-label-key' if it | 5812 | ;; |
| 5800 | ;; matched, otherwise it's the colon. The point is directly after | 5813 | ;; More precisely, a "label" is regarded as one of: |
| 5801 | ;; the end on return. The terminating char is marked with | 5814 | ;; (i) a goto target like "foo:"; |
| 5802 | ;; `c-decl-end' to improve recognition of the following declaration | 5815 | ;; (ii) A case label - either the entire construct "case FOO:" or just the |
| 5803 | ;; or statement. | 5816 | ;; bare "case", should the colon be missing; |
| 5817 | ;; (iii) a keyword which needs a colon, like "default:" or "private:"; | ||
| 5818 | ;; (iv) One of QT's "extended" C++ variants of | ||
| 5819 | ;; "private:"/"protected:"/"public:"/"more:" looking like "public slots:". | ||
| 5820 | ;; (v) One of the keywords matched by `c-opt-extra-label-key' (without any | ||
| 5821 | ;; colon). Currently (2006-03), this applies only to Objective C's | ||
| 5822 | ;; keywords "@private", "@protected", and "@public". | ||
| 5823 | ;; | ||
| 5824 | ;; One of the things which will NOT be recognised as a label is a bit-field | ||
| 5825 | ;; element of a struct, something like "int foo:5". | ||
| 5826 | ;; | ||
| 5827 | ;; The end of the label is taken to be just after the colon, or the end of | ||
| 5828 | ;; the first submatch in `c-opt-extra-label-key'. The point is directly | ||
| 5829 | ;; after the end on return. The terminating char gets marked with | ||
| 5830 | ;; `c-decl-end' to improve recognition of the following declaration or | ||
| 5831 | ;; statement. | ||
| 5804 | ;; | 5832 | ;; |
| 5805 | ;; If ASSUME-MARKUP is non-nil, it's assumed that the preceding | 5833 | ;; If ASSUME-MARKUP is non-nil, it's assumed that the preceding |
| 5806 | ;; label, if any, has been marked up like that. | 5834 | ;; label, if any, has already been marked up like that. |
| 5807 | ;; | 5835 | ;; |
| 5808 | ;; If PRECEDING-TOKEN-END is given, it should be the first position | 5836 | ;; If PRECEDING-TOKEN-END is given, it should be the first position |
| 5809 | ;; after the preceding token, i.e. on the other side of the | 5837 | ;; after the preceding token, i.e. on the other side of the |
| @@ -5819,8 +5847,11 @@ y ;; True if there's a suffix match outside the outermost | |||
| 5819 | ;; | 5847 | ;; |
| 5820 | ;; This function might do hidden buffer changes. | 5848 | ;; This function might do hidden buffer changes. |
| 5821 | 5849 | ||
| 5822 | (let ((start (point))) | 5850 | (let ((start (point)) |
| 5851 | qt-symbol-idx | ||
| 5852 | macro-start) ; if we're in one. | ||
| 5823 | (cond | 5853 | (cond |
| 5854 | ;; "case" or "default" (Doesn't apply to AWK). | ||
| 5824 | ((looking-at c-label-kwds-regexp) | 5855 | ((looking-at c-label-kwds-regexp) |
| 5825 | (let ((kwd-end (match-end 1))) | 5856 | (let ((kwd-end (match-end 1))) |
| 5826 | ;; Record only the keyword itself for fontification, since in | 5857 | ;; Record only the keyword itself for fontification, since in |
| @@ -5840,7 +5871,7 @@ y ;; True if there's a suffix match outside the outermost | |||
| 5840 | (match-beginning 2)) | 5871 | (match-beginning 2)) |
| 5841 | 5872 | ||
| 5842 | (progn | 5873 | (progn |
| 5843 | (goto-char (match-beginning 2)) | 5874 | (goto-char (match-beginning 2)) ; just after the : |
| 5844 | (c-put-c-type-property (1- (point)) 'c-decl-end) | 5875 | (c-put-c-type-property (1- (point)) 'c-decl-end) |
| 5845 | t) | 5876 | t) |
| 5846 | 5877 | ||
| @@ -5851,6 +5882,7 @@ y ;; True if there's a suffix match outside the outermost | |||
| 5851 | (goto-char kwd-end) | 5882 | (goto-char kwd-end) |
| 5852 | t))) | 5883 | t))) |
| 5853 | 5884 | ||
| 5885 | ;; @private, @protected, @public, in Objective C, or similar. | ||
| 5854 | ((and c-opt-extra-label-key | 5886 | ((and c-opt-extra-label-key |
| 5855 | (looking-at c-opt-extra-label-key)) | 5887 | (looking-at c-opt-extra-label-key)) |
| 5856 | ;; For a `c-opt-extra-label-key' match, we record the whole | 5888 | ;; For a `c-opt-extra-label-key' match, we record the whole |
| @@ -5862,7 +5894,8 @@ y ;; True if there's a suffix match outside the outermost | |||
| 5862 | (c-put-c-type-property (1- (point)) 'c-decl-end) | 5894 | (c-put-c-type-property (1- (point)) 'c-decl-end) |
| 5863 | t) | 5895 | t) |
| 5864 | 5896 | ||
| 5865 | ((and c-recognize-colon-labels | 5897 | ;; All other cases of labels. |
| 5898 | ((and c-recognize-colon-labels ; nil for AWK and IDL, otherwise t. | ||
| 5866 | 5899 | ||
| 5867 | ;; A colon label must have something before the colon. | 5900 | ;; A colon label must have something before the colon. |
| 5868 | (not (eq (char-after) ?:)) | 5901 | (not (eq (char-after) ?:)) |
| @@ -5890,7 +5923,8 @@ y ;; True if there's a suffix match outside the outermost | |||
| 5890 | (save-excursion | 5923 | (save-excursion |
| 5891 | (goto-char (1- preceding-token-end)) | 5924 | (goto-char (1- preceding-token-end)) |
| 5892 | (c-beginning-of-current-token) | 5925 | (c-beginning-of-current-token) |
| 5893 | (looking-at c-label-prefix-re)) | 5926 | (or (looking-at c-label-prefix-re) |
| 5927 | (looking-at c-block-stmt-1-key))) | ||
| 5894 | 5928 | ||
| 5895 | (and (eq (char-before preceding-token-end) ?\)) | 5929 | (and (eq (char-before preceding-token-end) ?\)) |
| 5896 | (c-after-conditional))) | 5930 | (c-after-conditional))) |
| @@ -5899,7 +5933,8 @@ y ;; True if there's a suffix match outside the outermost | |||
| 5899 | (save-excursion | 5933 | (save-excursion |
| 5900 | (goto-char (1- preceding-token-end)) | 5934 | (goto-char (1- preceding-token-end)) |
| 5901 | (c-beginning-of-current-token) | 5935 | (c-beginning-of-current-token) |
| 5902 | (looking-at c-label-prefix-re)) | 5936 | (or (looking-at c-label-prefix-re) |
| 5937 | (looking-at c-block-stmt-1-key))) | ||
| 5903 | 5938 | ||
| 5904 | (cond | 5939 | (cond |
| 5905 | ((eq (char-before preceding-token-end) ?\)) | 5940 | ((eq (char-before preceding-token-end) ?\)) |
| @@ -5907,26 +5942,52 @@ y ;; True if there's a suffix match outside the outermost | |||
| 5907 | 5942 | ||
| 5908 | ((eq (char-before preceding-token-end) ?:) | 5943 | ((eq (char-before preceding-token-end) ?:) |
| 5909 | ;; Might be after another label, so check it recursively. | 5944 | ;; Might be after another label, so check it recursively. |
| 5910 | (save-excursion | 5945 | (save-restriction |
| 5911 | (goto-char (1- preceding-token-end)) | 5946 | (save-excursion |
| 5912 | ;; Essentially the same as the | 5947 | (goto-char (1- preceding-token-end)) |
| 5913 | ;; `c-syntactic-re-search-forward' regexp below. | 5948 | ;; Essentially the same as the |
| 5914 | (c-syntactic-skip-backward "^-]:?;}=*/%&|,<>!@+" nil t) | 5949 | ;; `c-syntactic-re-search-forward' regexp below. |
| 5915 | (let ((pte (point)) | 5950 | (setq macro-start |
| 5916 | ;; If the caller turned on recording for us, | 5951 | (save-excursion (and (c-beginning-of-macro) |
| 5917 | ;; it shouldn't apply when we check the | 5952 | (point)))) |
| 5918 | ;; preceding label. | 5953 | (if macro-start (narrow-to-region macro-start (point-max))) |
| 5919 | c-record-type-identifiers) | 5954 | (c-syntactic-skip-backward "^-]:?;}=*/%&|,<>!@+" nil t) |
| 5920 | (c-forward-syntactic-ws) | 5955 | ;; Note: the following should work instead of the |
| 5921 | (c-forward-label nil pte start)))))))) | 5956 | ;; narrow-to-region above. Investigate why not, |
| 5922 | 5957 | ;; sometime. ACM, 2006-03-31. | |
| 5923 | ;; Check that the next nonsymbol token is ":". Allow '(' | 5958 | ;; (c-syntactic-skip-backward "^-]:?;}=*/%&|,<>!@+" |
| 5924 | ;; for the sake of macro arguments. FIXME: Should build | 5959 | ;; macro-start t) |
| 5925 | ;; this regexp from the language constants. | 5960 | (let ((pte (point)) |
| 5926 | (c-syntactic-re-search-forward | 5961 | ;; If the caller turned on recording for us, |
| 5927 | "[[:?;{=*/%&|,<>!@+-]" limit t t) | 5962 | ;; it shouldn't apply when we check the |
| 5928 | (eq (char-before) ?:) | 5963 | ;; preceding label. |
| 5929 | (not (eq (char-after) ?:))) | 5964 | c-record-type-identifiers) |
| 5965 | ;; A label can't start at a cpp directive. Check for | ||
| 5966 | ;; this, since c-forward-syntactic-ws would foul up on it. | ||
| 5967 | (unless (and c-opt-cpp-prefix (looking-at c-opt-cpp-prefix)) | ||
| 5968 | (c-forward-syntactic-ws) | ||
| 5969 | (c-forward-label nil pte start)))))))))) | ||
| 5970 | |||
| 5971 | ;; Check that the next nonsymbol token is ":", or that we're in one | ||
| 5972 | ;; of QT's "slots" declarations. Allow '(' for the sake of macro | ||
| 5973 | ;; arguments. FIXME: Should build this regexp from the language | ||
| 5974 | ;; constants. | ||
| 5975 | (when (c-syntactic-re-search-forward | ||
| 5976 | "[ \t[:?;{=*/%&|,<>!@+-]" limit t t) ; not at EOB | ||
| 5977 | (backward-char) | ||
| 5978 | (setq qt-symbol-idx | ||
| 5979 | (and (c-major-mode-is 'c++-mode) | ||
| 5980 | (string-match | ||
| 5981 | "\\(p\\(r\\(ivate\\|otected\\)\\|ublic\\)\\|more\\)\\>" | ||
| 5982 | (buffer-substring start (point))))) | ||
| 5983 | (c-forward-syntactic-ws limit) | ||
| 5984 | (when (or (looking-at ":\\([^:]\\|\\'\\)") ; A single colon. | ||
| 5985 | (and qt-symbol-idx | ||
| 5986 | (search-forward-regexp "\\=slots\\>" limit t) | ||
| 5987 | (progn (c-forward-syntactic-ws limit) | ||
| 5988 | (looking-at ":\\([^:]\\|\\'\\)")))) ; A single colon | ||
| 5989 | (forward-char) ; to after the colon. | ||
| 5990 | t))) | ||
| 5930 | 5991 | ||
| 5931 | (save-restriction | 5992 | (save-restriction |
| 5932 | (narrow-to-region start (point)) | 5993 | (narrow-to-region start (point)) |
| @@ -6145,8 +6206,8 @@ comment at the start of cc-engine.el for more info." | |||
| 6145 | ;; so that we don't get stuck on that instead of the | 6206 | ;; so that we don't get stuck on that instead of the |
| 6146 | ;; function arglist. | 6207 | ;; function arglist. |
| 6147 | (c-forward-sexp)) | 6208 | (c-forward-sexp)) |
| 6148 | ((and c-opt-op-identitier-prefix | 6209 | ((and c-opt-op-identifier-prefix |
| 6149 | (looking-at c-opt-op-identitier-prefix)) | 6210 | (looking-at c-opt-op-identifier-prefix)) |
| 6150 | ;; Don't trip up on "operator ()". | 6211 | ;; Don't trip up on "operator ()". |
| 6151 | (c-forward-token-2 2 t))) | 6212 | (c-forward-token-2 2 t))) |
| 6152 | (and (< (point) beg) | 6213 | (and (< (point) beg) |
| @@ -6263,10 +6324,10 @@ comment at the start of cc-engine.el for more info." | |||
| 6263 | (and c-overloadable-operators-regexp | 6324 | (and c-overloadable-operators-regexp |
| 6264 | (zerop (c-backward-token-2 1 nil lim)) | 6325 | (zerop (c-backward-token-2 1 nil lim)) |
| 6265 | (looking-at c-overloadable-operators-regexp) | 6326 | (looking-at c-overloadable-operators-regexp) |
| 6266 | (or (not c-opt-op-identitier-prefix) | 6327 | (or (not c-opt-op-identifier-prefix) |
| 6267 | (and | 6328 | (and |
| 6268 | (zerop (c-backward-token-2 1 nil lim)) | 6329 | (zerop (c-backward-token-2 1 nil lim)) |
| 6269 | (looking-at c-opt-op-identitier-prefix))) | 6330 | (looking-at c-opt-op-identifier-prefix))) |
| 6270 | (point)))) | 6331 | (point)))) |
| 6271 | 6332 | ||
| 6272 | (defsubst c-backward-to-block-anchor (&optional lim) | 6333 | (defsubst c-backward-to-block-anchor (&optional lim) |
| @@ -6314,7 +6375,7 @@ comment at the start of cc-engine.el for more info." | |||
| 6314 | ;; operator token preceded by "operator". | 6375 | ;; operator token preceded by "operator". |
| 6315 | (save-excursion | 6376 | (save-excursion |
| 6316 | (and (c-safe (c-backward-sexp) t) | 6377 | (and (c-safe (c-backward-sexp) t) |
| 6317 | (looking-at c-opt-op-identitier-prefix))) | 6378 | (looking-at c-opt-op-identifier-prefix))) |
| 6318 | (and (eq (char-before) ?<) | 6379 | (and (eq (char-before) ?<) |
| 6319 | (c-with-syntax-table c++-template-syntax-table | 6380 | (c-with-syntax-table c++-template-syntax-table |
| 6320 | (if (c-safe (goto-char (c-up-list-forward (point)))) | 6381 | (if (c-safe (goto-char (c-up-list-forward (point)))) |
| @@ -6354,6 +6415,10 @@ comment at the start of cc-engine.el for more info." | |||
| 6354 | ;; construct, i.e. if it isn't preceded by ';', '}', ':', bob, | 6415 | ;; construct, i.e. if it isn't preceded by ';', '}', ':', bob, |
| 6355 | ;; or an open paren. | 6416 | ;; or an open paren. |
| 6356 | (let ((beg (point)) tentative-move) | 6417 | (let ((beg (point)) tentative-move) |
| 6418 | ;; Go back one "statement" each time round the loop until we're just | ||
| 6419 | ;; after a ;, }, or :, or at BOB or the start of a macro or start of | ||
| 6420 | ;; an ObjC method. This will move over a multiple declaration whose | ||
| 6421 | ;; components are comma separated. | ||
| 6357 | (while (and | 6422 | (while (and |
| 6358 | ;; Must check with c-opt-method-key in ObjC mode. | 6423 | ;; Must check with c-opt-method-key in ObjC mode. |
| 6359 | (not (and c-opt-method-key | 6424 | (not (and c-opt-method-key |
| @@ -6397,25 +6462,39 @@ comment at the start of cc-engine.el for more info." | |||
| 6397 | knr-argdecl-start)) | 6462 | knr-argdecl-start)) |
| 6398 | (goto-char fallback-pos)))) | 6463 | (goto-char fallback-pos)))) |
| 6399 | 6464 | ||
| 6400 | ;; `c-beginning-of-statement-1' counts each brace block as a | 6465 | ;; `c-beginning-of-statement-1' counts each brace block as a separate |
| 6401 | ;; separate statement, so the result will be 'previous if we've | 6466 | ;; statement, so the result will be 'previous if we've moved over any. |
| 6402 | ;; moved over any. If they were brace list initializers we might | 6467 | ;; So change our result back to 'same if necessary. |
| 6403 | ;; not have moved over a declaration boundary though, so change it | 6468 | ;; |
| 6404 | ;; to 'same if we've moved past a '=' before '{', but not ';'. | 6469 | ;; If they were brace list initializers we might not have moved over a |
| 6405 | ;; (This ought to be integrated into `c-beginning-of-statement-1', | 6470 | ;; declaration boundary though, so change it to 'same if we've moved |
| 6406 | ;; so we avoid this extra pass which potentially can search over a | 6471 | ;; past a '=' before '{', but not ';'. (This ought to be integrated |
| 6407 | ;; large amount of text.) | 6472 | ;; into `c-beginning-of-statement-1', so we avoid this extra pass which |
| 6473 | ;; potentially can search over a large amount of text.). Take special | ||
| 6474 | ;; pains not to get mislead by C++'s "operator=", and the like. | ||
| 6408 | (if (and (eq move 'previous) | 6475 | (if (and (eq move 'previous) |
| 6409 | (c-with-syntax-table (if (c-major-mode-is 'c++-mode) | 6476 | (c-with-syntax-table (if (c-major-mode-is 'c++-mode) |
| 6410 | c++-template-syntax-table | 6477 | c++-template-syntax-table |
| 6411 | (syntax-table)) | 6478 | (syntax-table)) |
| 6412 | (save-excursion | 6479 | (save-excursion |
| 6413 | (and (c-syntactic-re-search-forward "[;={]" start t t t) | 6480 | (and |
| 6414 | (eq (char-before) ?=) | 6481 | (progn |
| 6415 | (c-syntactic-re-search-forward "[;{]" start t t) | 6482 | (while ; keep going back to "[;={"s until we either find |
| 6416 | (eq (char-before) ?{) | 6483 | ; no more, or get to one which isn't an "operator =" |
| 6417 | (c-safe (goto-char (c-up-list-forward (point))) t) | 6484 | (and (c-syntactic-re-search-forward "[;={]" start t t t) |
| 6418 | (not (c-syntactic-re-search-forward ";" start t t)))))) | 6485 | (eq (char-before) ?=) |
| 6486 | c-overloadable-operators-regexp | ||
| 6487 | c-opt-op-identifier-prefix | ||
| 6488 | (save-excursion | ||
| 6489 | (eq (c-backward-token-2) 0) | ||
| 6490 | (looking-at c-overloadable-operators-regexp) | ||
| 6491 | (eq (c-backward-token-2) 0) | ||
| 6492 | (looking-at c-opt-op-identifier-prefix)))) | ||
| 6493 | (eq (char-before) ?=)) | ||
| 6494 | (c-syntactic-re-search-forward "[;{]" start t t) | ||
| 6495 | (eq (char-before) ?{) | ||
| 6496 | (c-safe (goto-char (c-up-list-forward (point))) t) | ||
| 6497 | (not (c-syntactic-re-search-forward ";" start t t)))))) | ||
| 6419 | (cons 'same nil) | 6498 | (cons 'same nil) |
| 6420 | (cons move nil))))) | 6499 | (cons move nil))))) |
| 6421 | 6500 | ||
| @@ -6725,8 +6804,8 @@ comment at the start of cc-engine.el for more info." | |||
| 6725 | (setq braceassignp | 6804 | (setq braceassignp |
| 6726 | (cond | 6805 | (cond |
| 6727 | ;; Check for operator = | 6806 | ;; Check for operator = |
| 6728 | ((and c-opt-op-identitier-prefix | 6807 | ((and c-opt-op-identifier-prefix |
| 6729 | (looking-at c-opt-op-identitier-prefix)) | 6808 | (looking-at c-opt-op-identifier-prefix)) |
| 6730 | nil) | 6809 | nil) |
| 6731 | ;; Check for `<opchar>= in Pike. | 6810 | ;; Check for `<opchar>= in Pike. |
| 6732 | ((and (c-major-mode-is 'pike-mode) | 6811 | ((and (c-major-mode-is 'pike-mode) |
| @@ -7000,6 +7079,11 @@ comment at the start of cc-engine.el for more info." | |||
| 7000 | stop-at-boi-only | 7079 | stop-at-boi-only |
| 7001 | containing-sexp | 7080 | containing-sexp |
| 7002 | paren-state) | 7081 | paren-state) |
| 7082 | ;; Add the indicated SYNTAX-SYMBOL to `c-syntactic-context', extending it as | ||
| 7083 | ;; needed with further syntax elements of the types `substatement', | ||
| 7084 | ;; `inexpr-statement', `arglist-cont-nonempty', `statement-block-intro', and | ||
| 7085 | ;; `defun-block-intro'. | ||
| 7086 | ;; | ||
| 7003 | ;; Do the generic processing to anchor the given syntax symbol on | 7087 | ;; Do the generic processing to anchor the given syntax symbol on |
| 7004 | ;; the preceding statement: Skip over any labels and containing | 7088 | ;; the preceding statement: Skip over any labels and containing |
| 7005 | ;; statements on the same line, and then search backward until we | 7089 | ;; statements on the same line, and then search backward until we |
| @@ -8085,7 +8169,9 @@ comment at the start of cc-engine.el for more info." | |||
| 8085 | (and (eq (char-before) ?}) | 8169 | (and (eq (char-before) ?}) |
| 8086 | (save-excursion | 8170 | (save-excursion |
| 8087 | (let ((start (point))) | 8171 | (let ((start (point))) |
| 8088 | (if c-state-cache | 8172 | (if (and c-state-cache |
| 8173 | (consp (car c-state-cache)) | ||
| 8174 | (eq (cdar c-state-cache) (point))) | ||
| 8089 | ;; Speed up the backward search a bit. | 8175 | ;; Speed up the backward search a bit. |
| 8090 | (goto-char (caar c-state-cache))) | 8176 | (goto-char (caar c-state-cache))) |
| 8091 | (c-beginning-of-decl-1 containing-sexp) | 8177 | (c-beginning-of-decl-1 containing-sexp) |
| @@ -8103,26 +8189,30 @@ comment at the start of cc-engine.el for more info." | |||
| 8103 | 8189 | ||
| 8104 | ;; CASE 5J: we are at the topmost level, make | 8190 | ;; CASE 5J: we are at the topmost level, make |
| 8105 | ;; sure we skip back past any access specifiers | 8191 | ;; sure we skip back past any access specifiers |
| 8106 | ((save-excursion | 8192 | ((and |
| 8107 | (setq placeholder (point)) | 8193 | ;; A macro continuation line is never at top level. |
| 8108 | (or (memq char-before-ip '(?\; ?{ ?} nil)) | 8194 | (not (and macro-start |
| 8109 | (c-at-vsemi-p before-ws-ip) | 8195 | (> indent-point macro-start))) |
| 8110 | (when (and (eq char-before-ip ?:) | 8196 | (save-excursion |
| 8111 | (eq (c-beginning-of-statement-1 lim) | 8197 | (setq placeholder (point)) |
| 8112 | 'label)) | 8198 | (or (memq char-before-ip '(?\; ?{ ?} nil)) |
| 8113 | (c-backward-syntactic-ws lim) | 8199 | (c-at-vsemi-p before-ws-ip) |
| 8114 | (setq placeholder (point))) | 8200 | (when (and (eq char-before-ip ?:) |
| 8115 | (and (c-major-mode-is 'objc-mode) | 8201 | (eq (c-beginning-of-statement-1 lim) |
| 8116 | (catch 'not-in-directive | 8202 | 'label)) |
| 8117 | (c-beginning-of-statement-1 lim) | 8203 | (c-backward-syntactic-ws lim) |
| 8118 | (setq placeholder (point)) | 8204 | (setq placeholder (point))) |
| 8119 | (while (and (c-forward-objc-directive) | 8205 | (and (c-major-mode-is 'objc-mode) |
| 8120 | (< (point) indent-point)) | 8206 | (catch 'not-in-directive |
| 8121 | (c-forward-syntactic-ws) | 8207 | (c-beginning-of-statement-1 lim) |
| 8122 | (if (>= (point) indent-point) | 8208 | (setq placeholder (point)) |
| 8123 | (throw 'not-in-directive t)) | 8209 | (while (and (c-forward-objc-directive) |
| 8124 | (setq placeholder (point))) | 8210 | (< (point) indent-point)) |
| 8125 | nil)))) | 8211 | (c-forward-syntactic-ws) |
| 8212 | (if (>= (point) indent-point) | ||
| 8213 | (throw 'not-in-directive t)) | ||
| 8214 | (setq placeholder (point))) | ||
| 8215 | nil))))) | ||
| 8126 | ;; For historic reasons we anchor at bol of the last | 8216 | ;; For historic reasons we anchor at bol of the last |
| 8127 | ;; line of the previous declaration. That's clearly | 8217 | ;; line of the previous declaration. That's clearly |
| 8128 | ;; highly bogus and useless, and it makes our lives hard | 8218 | ;; highly bogus and useless, and it makes our lives hard |
| @@ -8177,6 +8267,11 @@ comment at the start of cc-engine.el for more info." | |||
| 8177 | (c-beginning-of-statement-1 (c-safe-position (point) paren-state)) | 8267 | (c-beginning-of-statement-1 (c-safe-position (point) paren-state)) |
| 8178 | (c-add-syntax 'template-args-cont (c-point 'boi))) | 8268 | (c-add-syntax 'template-args-cont (c-point 'boi))) |
| 8179 | 8269 | ||
| 8270 | ;; CASE 5Q: we are at a statement within a macro. | ||
| 8271 | (macro-start | ||
| 8272 | (c-beginning-of-statement-1 containing-sexp) | ||
| 8273 | (c-add-stmt-syntax 'statement nil t containing-sexp paren-state)) | ||
| 8274 | |||
| 8180 | ;; CASE 5M: we are at a topmost continuation line | 8275 | ;; CASE 5M: we are at a topmost continuation line |
| 8181 | (t | 8276 | (t |
| 8182 | (c-beginning-of-statement-1 (c-safe-position (point) paren-state)) | 8277 | (c-beginning-of-statement-1 (c-safe-position (point) paren-state)) |
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index bd9af00d9c6..b3c0a578649 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el | |||
| @@ -685,6 +685,16 @@ definition, or nil if the language doesn't have any." | |||
| 685 | (c-lang-defvar c-opt-cpp-macro-define-start | 685 | (c-lang-defvar c-opt-cpp-macro-define-start |
| 686 | (c-lang-const c-opt-cpp-macro-define-start)) | 686 | (c-lang-const c-opt-cpp-macro-define-start)) |
| 687 | 687 | ||
| 688 | (c-lang-defconst c-opt-cpp-macro-define-id | ||
| 689 | ;; Regexp matching everything up to the end of the identifier defined | ||
| 690 | ;; by a cpp define. | ||
| 691 | t (if (c-lang-const c-opt-cpp-macro-define) | ||
| 692 | (concat (c-lang-const c-opt-cpp-prefix) ; # | ||
| 693 | (c-lang-const c-opt-cpp-macro-define) ; define | ||
| 694 | "[ \t]+\\(\\sw\\|_\\)+"))) | ||
| 695 | (c-lang-defvar c-opt-cpp-macro-define-id | ||
| 696 | (c-lang-const c-opt-cpp-macro-define-id)) | ||
| 697 | |||
| 688 | (c-lang-defconst c-cpp-expr-directives | 698 | (c-lang-defconst c-cpp-expr-directives |
| 689 | "List if cpp directives (without the prefix) that are followed by an | 699 | "List if cpp directives (without the prefix) that are followed by an |
| 690 | expression." | 700 | expression." |
| @@ -882,7 +892,7 @@ since CC Mode treats every identifier as an expression." | |||
| 882 | 892 | ||
| 883 | (c-lang-defconst c-overloadable-operators | 893 | (c-lang-defconst c-overloadable-operators |
| 884 | "List of the operators that are overloadable, in their \"identifier | 894 | "List of the operators that are overloadable, in their \"identifier |
| 885 | form\". See also `c-op-identitier-prefix'." | 895 | form\". See also `c-op-identifier-prefix'." |
| 886 | t nil | 896 | t nil |
| 887 | c++ '("new" "delete" ;; Can be followed by "[]" but we ignore that. | 897 | c++ '("new" "delete" ;; Can be followed by "[]" but we ignore that. |
| 888 | "+" "-" "*" "/" "%" | 898 | "+" "-" "*" "/" "%" |
| @@ -905,7 +915,7 @@ form\". See also `c-op-identitier-prefix'." | |||
| 905 | (c-lang-defvar c-overloadable-operators-regexp | 915 | (c-lang-defvar c-overloadable-operators-regexp |
| 906 | (c-lang-const c-overloadable-operators-regexp)) | 916 | (c-lang-const c-overloadable-operators-regexp)) |
| 907 | 917 | ||
| 908 | (c-lang-defconst c-opt-op-identitier-prefix | 918 | (c-lang-defconst c-opt-op-identifier-prefix |
| 909 | "Regexp matching the token before the ones in | 919 | "Regexp matching the token before the ones in |
| 910 | `c-overloadable-operators' when operators are specified in their | 920 | `c-overloadable-operators' when operators are specified in their |
| 911 | \"identifier form\". This typically matches \"operator\" in C++ where | 921 | \"identifier form\". This typically matches \"operator\" in C++ where |
| @@ -916,8 +926,15 @@ identifier is listed in `c-overloadable-operators'. | |||
| 916 | This regexp is assumed to not match any non-operator identifier." | 926 | This regexp is assumed to not match any non-operator identifier." |
| 917 | t nil | 927 | t nil |
| 918 | c++ (c-make-keywords-re t '("operator"))) | 928 | c++ (c-make-keywords-re t '("operator"))) |
| 919 | (c-lang-defvar c-opt-op-identitier-prefix | 929 | (c-lang-defvar c-opt-op-identifier-prefix |
| 920 | (c-lang-const c-opt-op-identitier-prefix)) | 930 | (c-lang-const c-opt-op-identifier-prefix)) |
| 931 | |||
| 932 | ;; Note: the following alias is an old name which was a mis-spelling. It has | ||
| 933 | ;; been corrected above and throughout cc-engine.el. It will be removed at | ||
| 934 | ;; some release very shortly in the future. ACM, 2006-04-14. | ||
| 935 | (defalias 'c-opt-op-identitier-prefix 'c-opt-op-identifier-prefix) | ||
| 936 | (make-obsolete-variable 'c-opt-op-identitier-prefix 'c-opt-op-identifier-prefix | ||
| 937 | "CC Mode 5.31.4, 2006-04-14") | ||
| 921 | 938 | ||
| 922 | (c-lang-defconst c-other-op-syntax-tokens | 939 | (c-lang-defconst c-other-op-syntax-tokens |
| 923 | "List of the tokens made up of characters in the punctuation or | 940 | "List of the tokens made up of characters in the punctuation or |
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 40407f3819a..993fd102951 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el | |||
| @@ -288,8 +288,9 @@ control). See \"cc-mode.el\" for more info." | |||
| 288 | c-mode-base-map global-map)) | 288 | c-mode-base-map global-map)) |
| 289 | 289 | ||
| 290 | ;; RMS says don't make these the default. | 290 | ;; RMS says don't make these the default. |
| 291 | ;; (define-key c-mode-base-map "\e\C-a" 'c-beginning-of-defun) | 291 | ;; (April 2006): RMS has now approved these commands as defaults. |
| 292 | ;; (define-key c-mode-base-map "\e\C-e" 'c-end-of-defun) | 292 | (define-key c-mode-base-map "\e\C-a" 'c-beginning-of-defun) |
| 293 | (define-key c-mode-base-map "\e\C-e" 'c-end-of-defun) | ||
| 293 | 294 | ||
| 294 | (define-key c-mode-base-map "\C-c\C-n" 'c-forward-conditional) | 295 | (define-key c-mode-base-map "\C-c\C-n" 'c-forward-conditional) |
| 295 | (define-key c-mode-base-map "\C-c\C-p" 'c-backward-conditional) | 296 | (define-key c-mode-base-map "\C-c\C-p" 'c-backward-conditional) |
| @@ -728,8 +729,8 @@ Note that the style variables are always made local to the buffer." | |||
| 728 | ;; We prevent this by temporarily removing `mode' from the Local Variables | 729 | ;; We prevent this by temporarily removing `mode' from the Local Variables |
| 729 | ;; section. | 730 | ;; section. |
| 730 | (if (or c-file-style c-file-offsets) | 731 | (if (or c-file-style c-file-offsets) |
| 731 | (c-tentative-buffer-changes | 732 | (let ((hack-local-variables-hook nil) (inhibit-read-only t)) |
| 732 | (let ((hack-local-variables-hook nil)) | 733 | (c-tentative-buffer-changes |
| 733 | (c-remove-any-local-eval-or-mode-variables) | 734 | (c-remove-any-local-eval-or-mode-variables) |
| 734 | (hack-local-variables)) | 735 | (hack-local-variables)) |
| 735 | nil)))) | 736 | nil)))) |
diff --git a/lisp/progmodes/cc-styles.el b/lisp/progmodes/cc-styles.el index 81048d52072..98bc4e1f801 100644 --- a/lisp/progmodes/cc-styles.el +++ b/lisp/progmodes/cc-styles.el | |||
| @@ -68,7 +68,10 @@ | |||
| 68 | (arglist-intro . c-lineup-arglist-intro-after-paren) | 68 | (arglist-intro . c-lineup-arglist-intro-after-paren) |
| 69 | (arglist-close . c-lineup-arglist) | 69 | (arglist-close . c-lineup-arglist) |
| 70 | (inline-open . 0) | 70 | (inline-open . 0) |
| 71 | (brace-list-open . +))) | 71 | (brace-list-open . +) |
| 72 | (topmost-intro-cont | ||
| 73 | . (first c-lineup-topmost-intro-cont | ||
| 74 | c-lineup-gnu-DEFUN-intro-cont)))) | ||
| 72 | (c-special-indent-hook . c-gnu-impose-minimum) | 75 | (c-special-indent-hook . c-gnu-impose-minimum) |
| 73 | (c-block-comment-prefix . "")) | 76 | (c-block-comment-prefix . "")) |
| 74 | 77 | ||
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el index 0f0da939230..2f3e83886d2 100644 --- a/lisp/progmodes/cc-vars.el +++ b/lisp/progmodes/cc-vars.el | |||
| @@ -622,10 +622,10 @@ name: | |||
| 622 | empty-defun-braces -- Clean up empty defun braces by placing the | 622 | empty-defun-braces -- Clean up empty defun braces by placing the |
| 623 | braces on the same line. Clean up occurs when | 623 | braces on the same line. Clean up occurs when |
| 624 | the defun closing brace is typed. | 624 | the defun closing brace is typed. |
| 625 | one-liner-defun -- If the code inside a function body is a single | 625 | one-liner-defun -- If the code inside a function body can fit in |
| 626 | line then remove any newlines between that | 626 | a single line, then remove any newlines |
| 627 | line and the defun braces so that the whole | 627 | between that line and the defun braces so that |
| 628 | body becomes a single line. | 628 | the whole body becomes a single line. |
| 629 | `c-max-one-liner-length' gives the maximum | 629 | `c-max-one-liner-length' gives the maximum |
| 630 | length allowed for the resulting line. Clean | 630 | length allowed for the resulting line. Clean |
| 631 | up occurs when the closing brace is typed. | 631 | up occurs when the closing brace is typed. |
| @@ -1604,7 +1604,8 @@ statically (e.g. with `setq').") | |||
| 1604 | 1604 | ||
| 1605 | (defvar c-indentation-style nil | 1605 | (defvar c-indentation-style nil |
| 1606 | "Name of the currently installed style. | 1606 | "Name of the currently installed style. |
| 1607 | Don't change this directly; call `c-set-style' instead.") | 1607 | Don't change this directly; call `c-set-style' instead, or set the variable |
| 1608 | `c-file-style' in the file's Local Variable list.") | ||
| 1608 | 1609 | ||
| 1609 | (defvar c-current-comment-prefix nil | 1610 | (defvar c-current-comment-prefix nil |
| 1610 | "The current comment prefix regexp. | 1611 | "The current comment prefix regexp. |
diff --git a/lisp/progmodes/cfengine.el b/lisp/progmodes/cfengine.el index b70fe58b543..fd10bf3a9c2 100644 --- a/lisp/progmodes/cfengine.el +++ b/lisp/progmodes/cfengine.el | |||
| @@ -89,7 +89,7 @@ This includes those for cfservd as well as cfagent.")) | |||
| 89 | ;; In the main syntax-table, backslash is marked as a punctuation, because | 89 | ;; In the main syntax-table, backslash is marked as a punctuation, because |
| 90 | ;; of its use in DOS-style directory separators. Here we try to recognize | 90 | ;; of its use in DOS-style directory separators. Here we try to recognize |
| 91 | ;; the cases where backslash is used as an escape inside strings. | 91 | ;; the cases where backslash is used as an escape inside strings. |
| 92 | '(("\\(\\(?:\\\\\\)+\\)\"" . "\\"))) | 92 | '(("\\(\\(?:\\\\\\)+\\)\"" 1 "\\"))) |
| 93 | 93 | ||
| 94 | (defvar cfengine-imenu-expression | 94 | (defvar cfengine-imenu-expression |
| 95 | `((nil ,(concat "^[ \t]*" (eval-when-compile | 95 | `((nil ,(concat "^[ \t]*" (eval-when-compile |
diff --git a/lisp/progmodes/ebrowse.el b/lisp/progmodes/ebrowse.el index f624ac5cf28..cc808adda39 100644 --- a/lisp/progmodes/ebrowse.el +++ b/lisp/progmodes/ebrowse.el | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | ;;; ebrowse.el --- Emacs C++ class browser & tags facility | 1 | ;;; ebrowse.el --- Emacs C++ class browser & tags facility |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, | 3 | ;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, |
| 4 | ;; 2002, 2003, 2004, 2005, 2006 | 4 | ;; 2002, 2003, 2004, 2005, 2006, 2007 |
| 5 | ;; Free Software Foundation Inc. | 5 | ;; Free Software Foundation Inc. |
| 6 | 6 | ||
| 7 | ;; Author: Gerd Moellmann <gerd@gnu.org> | 7 | ;; Author: Gerd Moellmann <gerd@gnu.org> |
| @@ -4230,13 +4230,13 @@ NUMBER-OF-STATIC-VARIABLES:" | |||
| 4230 | ;;; Global key bindings | 4230 | ;;; Global key bindings |
| 4231 | 4231 | ||
| 4232 | ;;; The following can be used to bind key sequences starting with | 4232 | ;;; The following can be used to bind key sequences starting with |
| 4233 | ;;; prefix `\C-cb' to browse commands. | 4233 | ;;; prefix `\C-c\C-m' to browse commands. |
| 4234 | 4234 | ||
| 4235 | (defvar ebrowse-global-map nil | 4235 | (defvar ebrowse-global-map nil |
| 4236 | "*Keymap for Ebrowse commands.") | 4236 | "*Keymap for Ebrowse commands.") |
| 4237 | 4237 | ||
| 4238 | 4238 | ||
| 4239 | (defvar ebrowse-global-prefix-key "\C-cC-m" | 4239 | (defvar ebrowse-global-prefix-key "\C-c\C-m" |
| 4240 | "Prefix key for Ebrowse commands.") | 4240 | "Prefix key for Ebrowse commands.") |
| 4241 | 4241 | ||
| 4242 | 4242 | ||
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index 3a253796f28..980c6b3f07b 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el | |||
| @@ -896,6 +896,12 @@ Changed values are highlighted with the face `font-lock-warning-face'." | |||
| 896 | :group 'gud | 896 | :group 'gud |
| 897 | :version "22.1") | 897 | :version "22.1") |
| 898 | 898 | ||
| 899 | (defcustom gdb-max-children 40 | ||
| 900 | "Maximum number of children allowed before Emacs asks" | ||
| 901 | :type 'integer | ||
| 902 | :group 'gud | ||
| 903 | :version "22.1") | ||
| 904 | |||
| 899 | (defun gdb-speedbar-expand-node (text token indent) | 905 | (defun gdb-speedbar-expand-node (text token indent) |
| 900 | "Expand the node the user clicked on. | 906 | "Expand the node the user clicked on. |
| 901 | TEXT is the text of the button we clicked on, a + or - item. | 907 | TEXT is the text of the button we clicked on, a + or - item. |
| @@ -904,11 +910,17 @@ INDENT is the current indentation depth." | |||
| 904 | (if (and gud-comint-buffer (buffer-name gud-comint-buffer)) | 910 | (if (and gud-comint-buffer (buffer-name gud-comint-buffer)) |
| 905 | (progn | 911 | (progn |
| 906 | (cond ((string-match "+" text) ;expand this node | 912 | (cond ((string-match "+" text) ;expand this node |
| 907 | (if (and (eq (buffer-local-value | 913 | (let* ((var (assoc token gdb-var-list)) |
| 908 | 'gud-minor-mode gud-comint-buffer) 'gdba) | 914 | (expr (nth 1 var)) (children (nth 2 var))) |
| 909 | (string-equal gdb-version "pre-6.4")) | 915 | (if (or (<= (string-to-number children) gdb-max-children) |
| 910 | (gdb-var-list-children token) | 916 | (y-or-n-p |
| 911 | (gdb-var-list-children-1 token))) | 917 | (format |
| 918 | "%s has %s children. Continue? " expr children))) | ||
| 919 | (if (and (eq (buffer-local-value | ||
| 920 | 'gud-minor-mode gud-comint-buffer) 'gdba) | ||
| 921 | (string-equal gdb-version "pre-6.4")) | ||
| 922 | (gdb-var-list-children token) | ||
| 923 | (gdb-var-list-children-1 token))))) | ||
| 912 | ((string-match "-" text) ;contract this node | 924 | ((string-match "-" text) ;contract this node |
| 913 | (dolist (var gdb-var-list) | 925 | (dolist (var gdb-var-list) |
| 914 | (if (string-match (concat token "\\.") (car var)) | 926 | (if (string-match (concat token "\\.") (car var)) |
diff --git a/lisp/simple.el b/lisp/simple.el index a78f152cbcd..38302f32233 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -4088,7 +4088,7 @@ With argument, do this that many times." | |||
| 4088 | (kill-region (point) (progn (forward-word arg) (point)))) | 4088 | (kill-region (point) (progn (forward-word arg) (point)))) |
| 4089 | 4089 | ||
| 4090 | (defun backward-kill-word (arg) | 4090 | (defun backward-kill-word (arg) |
| 4091 | "Kill characters backward until encountering the end of a word. | 4091 | "Kill characters backward until encountering the beginning of a word. |
| 4092 | With argument, do this that many times." | 4092 | With argument, do this that many times." |
| 4093 | (interactive "p") | 4093 | (interactive "p") |
| 4094 | (kill-word (- arg))) | 4094 | (kill-word (- arg))) |
diff --git a/lisp/subr.el b/lisp/subr.el index 6f9042f50b3..b48fa1a9f35 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -1887,6 +1887,7 @@ menu bar menus and the frame title." | |||
| 1887 | (defun momentary-string-display (string pos &optional exit-char message) | 1887 | (defun momentary-string-display (string pos &optional exit-char message) |
| 1888 | "Momentarily display STRING in the buffer at POS. | 1888 | "Momentarily display STRING in the buffer at POS. |
| 1889 | Display remains until next event is input. | 1889 | Display remains until next event is input. |
| 1890 | If POS is a marker, only its position is used; its buffer is ignored. | ||
| 1890 | Optional third arg EXIT-CHAR can be a character, event or event | 1891 | Optional third arg EXIT-CHAR can be a character, event or event |
| 1891 | description list. EXIT-CHAR defaults to SPC. If the input is | 1892 | description list. EXIT-CHAR defaults to SPC. If the input is |
| 1892 | EXIT-CHAR it is swallowed; otherwise it is then available as | 1893 | EXIT-CHAR it is swallowed; otherwise it is then available as |
| @@ -1894,30 +1895,21 @@ input (as a command if nothing else). | |||
| 1894 | Display MESSAGE (optional fourth arg) in the echo area. | 1895 | Display MESSAGE (optional fourth arg) in the echo area. |
| 1895 | If MESSAGE is nil, instructions to type EXIT-CHAR are displayed there." | 1896 | If MESSAGE is nil, instructions to type EXIT-CHAR are displayed there." |
| 1896 | (or exit-char (setq exit-char ?\s)) | 1897 | (or exit-char (setq exit-char ?\s)) |
| 1897 | (let ((inhibit-read-only t) | 1898 | (let ((momentary-overlay (make-overlay pos pos nil t))) |
| 1898 | ;; Don't modify the undo list at all. | 1899 | (overlay-put momentary-overlay 'before-string |
| 1899 | (buffer-undo-list t) | 1900 | (propertize string 'face 'momentary)) |
| 1900 | (modified (buffer-modified-p)) | ||
| 1901 | (name buffer-file-name) | ||
| 1902 | insert-end) | ||
| 1903 | (unwind-protect | 1901 | (unwind-protect |
| 1904 | (progn | 1902 | (progn |
| 1905 | (save-excursion | 1903 | ;; If the message end is off screen, recenter now. |
| 1906 | (goto-char pos) | 1904 | (if (< (window-end nil t) (+ pos (length string))) |
| 1907 | ;; defeat file locking... don't try this at home, kids! | 1905 | (recenter (/ (window-height) 2))) |
| 1908 | (setq buffer-file-name nil) | 1906 | ;; If that pushed message start off the screen, |
| 1909 | (insert-before-markers string) | 1907 | ;; scroll to start it at the top of the screen. |
| 1910 | (setq insert-end (point)) | 1908 | (move-to-window-line 0) |
| 1911 | ;; If the message end is off screen, recenter now. | 1909 | (if (> (point) pos) |
| 1912 | (if (< (window-end nil t) insert-end) | 1910 | (progn |
| 1913 | (recenter (/ (window-height) 2))) | 1911 | (goto-char pos) |
| 1914 | ;; If that pushed message start off the screen, | 1912 | (recenter 0))) |
| 1915 | ;; scroll to start it at the top of the screen. | ||
| 1916 | (move-to-window-line 0) | ||
| 1917 | (if (> (point) pos) | ||
| 1918 | (progn | ||
| 1919 | (goto-char pos) | ||
| 1920 | (recenter 0)))) | ||
| 1921 | (message (or message "Type %s to continue editing.") | 1913 | (message (or message "Type %s to continue editing.") |
| 1922 | (single-key-description exit-char)) | 1914 | (single-key-description exit-char)) |
| 1923 | (let (char) | 1915 | (let (char) |
| @@ -1937,11 +1929,7 @@ If MESSAGE is nil, instructions to type EXIT-CHAR are displayed there." | |||
| 1937 | (or (eq char exit-char) | 1929 | (or (eq char exit-char) |
| 1938 | (eq char (event-convert-list exit-char)) | 1930 | (eq char (event-convert-list exit-char)) |
| 1939 | (setq unread-command-events (list char)))))) | 1931 | (setq unread-command-events (list char)))))) |
| 1940 | (if insert-end | 1932 | (delete-overlay momentary-overlay)))) |
| 1941 | (save-excursion | ||
| 1942 | (delete-region pos insert-end))) | ||
| 1943 | (setq buffer-file-name name) | ||
| 1944 | (set-buffer-modified-p modified)))) | ||
| 1945 | 1933 | ||
| 1946 | 1934 | ||
| 1947 | ;;;; Overlay operations | 1935 | ;;;; Overlay operations |
diff --git a/lisp/textmodes/table.el b/lisp/textmodes/table.el index 70bd3a07a9f..c712524396f 100644 --- a/lisp/textmodes/table.el +++ b/lisp/textmodes/table.el | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | ;; Keywords: wp, convenience | 6 | ;; Keywords: wp, convenience |
| 7 | ;; Author: Takaaki Ota <Takaaki.Ota@am.sony.com> | 7 | ;; Author: Takaaki Ota <Takaaki.Ota@am.sony.com> |
| 8 | ;; Created: Sat Jul 08 2000 13:28:45 (PST) | 8 | ;; Created: Sat Jul 08 2000 13:28:45 (PST) |
| 9 | ;; Revised: Thu Jul 20 2006 17:30:09 (PDT) | 9 | ;; Revised: Wed Jan 03 2007 13:23:46 (PST) |
| 10 | 10 | ||
| 11 | ;; This file is part of GNU Emacs. | 11 | ;; This file is part of GNU Emacs. |
| 12 | 12 | ||
| @@ -5358,7 +5358,7 @@ is non-nil. The warning is done only once per session for each item." | |||
| 5358 | (cond ((and (featurep 'xemacs) | 5358 | (cond ((and (featurep 'xemacs) |
| 5359 | (not (get 'table-disable-incompatibility-warning 'xemacs))) | 5359 | (not (get 'table-disable-incompatibility-warning 'xemacs))) |
| 5360 | (put 'table-disable-incompatibility-warning 'xemacs t) | 5360 | (put 'table-disable-incompatibility-warning 'xemacs t) |
| 5361 | (momentary-string-display | 5361 | (display-warning 'table |
| 5362 | " | 5362 | " |
| 5363 | *** Warning *** | 5363 | *** Warning *** |
| 5364 | 5364 | ||
| @@ -5369,12 +5369,12 @@ such that a border characters dissolve into adjacent cells. Please be | |||
| 5369 | aware of this. | 5369 | aware of this. |
| 5370 | 5370 | ||
| 5371 | " | 5371 | " |
| 5372 | (save-excursion (forward-line 1) (point)))) | 5372 | :warning)) |
| 5373 | ((and (boundp 'flyspell-mode) | 5373 | ((and (boundp 'flyspell-mode) |
| 5374 | flyspell-mode | 5374 | flyspell-mode |
| 5375 | (not (get 'table-disable-incompatibility-warning 'flyspell))) | 5375 | (not (get 'table-disable-incompatibility-warning 'flyspell))) |
| 5376 | (put 'table-disable-incompatibility-warning 'flyspell t) | 5376 | (put 'table-disable-incompatibility-warning 'flyspell t) |
| 5377 | (momentary-string-display | 5377 | (display-warning 'table |
| 5378 | " | 5378 | " |
| 5379 | *** Warning *** | 5379 | *** Warning *** |
| 5380 | 5380 | ||
| @@ -5383,7 +5383,7 @@ package. The flyspell version 1.5d at http://kaolin.unice.fr/~serrano | |||
| 5383 | works better than the previous versions however not fully compatible. | 5383 | works better than the previous versions however not fully compatible. |
| 5384 | 5384 | ||
| 5385 | " | 5385 | " |
| 5386 | (save-excursion (forward-line 1) (point)))) | 5386 | :warning)) |
| 5387 | ))) | 5387 | ))) |
| 5388 | 5388 | ||
| 5389 | (defun table--cell-blank-str (&optional n) | 5389 | (defun table--cell-blank-str (&optional n) |
diff --git a/lisp/tutorial.el b/lisp/tutorial.el index be50d793f0f..cf9a391e5a6 100644 --- a/lisp/tutorial.el +++ b/lisp/tutorial.el | |||
| @@ -153,7 +153,7 @@ options: | |||
| 153 | (insert "\n\nYou can use M-x " | 153 | (insert "\n\nYou can use M-x " |
| 154 | (format "%s" db) | 154 | (format "%s" db) |
| 155 | " RET instead.")) | 155 | " RET instead.")) |
| 156 | (insert "\n\nWith you current key bindings" | 156 | (insert "\n\nWith your current key bindings" |
| 157 | " you can use the key " | 157 | " you can use the key " |
| 158 | where | 158 | where |
| 159 | " to get the function `" | 159 | " to get the function `" |
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 7d572363e0f..935d2b7719d 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el | |||
| @@ -275,14 +275,15 @@ minibuffer." | |||
| 275 | keys | 275 | keys |
| 276 | (char 0) | 276 | (char 0) |
| 277 | (arg 1)) | 277 | (arg 1)) |
| 278 | (while (not (or (and (>= char ?0) (< char next-digit)) | 278 | (while (not (or (and (integerp char) |
| 279 | (>= char ?0) (< char next-digit)) | ||
| 279 | (eq value 'keyboard-quit))) | 280 | (eq value 'keyboard-quit))) |
| 280 | ;; Unread a SPC to lead to our new menu. | 281 | ;; Unread a SPC to lead to our new menu. |
| 281 | (setq unread-command-events (cons ?\s unread-command-events)) | 282 | (setq unread-command-events (cons ?\s unread-command-events)) |
| 282 | (setq keys (read-key-sequence title)) | 283 | (setq keys (read-key-sequence title)) |
| 283 | (setq value | 284 | (setq value |
| 284 | (lookup-key overriding-terminal-local-map keys t) | 285 | (lookup-key overriding-terminal-local-map keys t) |
| 285 | char (string-to-char (substring keys 1))) | 286 | char (aref keys 1)) |
| 286 | (cond ((eq value 'scroll-other-window) | 287 | (cond ((eq value 'scroll-other-window) |
| 287 | (let ((minibuffer-scroll-window | 288 | (let ((minibuffer-scroll-window |
| 288 | (get-buffer-window buf))) | 289 | (get-buffer-window buf))) |
diff --git a/lisp/woman.el b/lisp/woman.el index 2d3513f0097..f880c6810f9 100644 --- a/lisp/woman.el +++ b/lisp/woman.el | |||
| @@ -2112,7 +2112,7 @@ No external programs are used." | |||
| 2112 | (progn (goto-char (point-min)) | 2112 | (progn (goto-char (point-min)) |
| 2113 | (not (re-search-forward "^\\.\\([pnil]p\\|sh\\)[ \n]" | 2113 | (not (re-search-forward "^\\.\\([pnil]p\\|sh\\)[ \n]" |
| 2114 | (point-max) t)))) | 2114 | (point-max) t)))) |
| 2115 | (error "WoMan can only format manpages written in the an format"))) | 2115 | (error "WoMan can only format man pages written with the usual `-man' macros"))) |
| 2116 | 2116 | ||
| 2117 | (and (boundp 'font-lock-mode) font-lock-mode (font-lock-mode -1)) | 2117 | (and (boundp 'font-lock-mode) font-lock-mode (font-lock-mode -1)) |
| 2118 | ;; (fundamental-mode) | 2118 | ;; (fundamental-mode) |
diff --git a/lispref/ChangeLog b/lispref/ChangeLog index 7cf5f461079..3f62d3e545b 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog | |||
| @@ -1,3 +1,22 @@ | |||
| 1 | 2007-01-05 Richard Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * modes.texi (Defining Minor Modes): Fix previous change. | ||
| 4 | |||
| 5 | 2007-01-03 Richard Stallman <rms@gnu.org> | ||
| 6 | |||
| 7 | * customize.texi (Variable Definitions, Customization Types): | ||
| 8 | Don't use * in doc string for defcustom. | ||
| 9 | |||
| 10 | 2007-01-02 Richard Stallman <rms@gnu.org> | ||
| 11 | |||
| 12 | * variables.texi (Variable Aliases): Clarify that aliases vars | ||
| 13 | always have the same value. | ||
| 14 | |||
| 15 | * processes.texi (Bindat Spec): Fix Texinfo usage. | ||
| 16 | |||
| 17 | * modes.texi (Defining Minor Modes): Explain effect of command | ||
| 18 | defined with define-global-minor-mode on new buffers. | ||
| 19 | |||
| 1 | 2006-12-30 Kim F. Storm <storm@cua.dk> | 20 | 2006-12-30 Kim F. Storm <storm@cua.dk> |
| 2 | 21 | ||
| 3 | * keymaps.texi (Tool Bar): Describe `grow-only' value of | 22 | * keymaps.texi (Tool Bar): Describe `grow-only' value of |
diff --git a/lispref/customize.texi b/lispref/customize.texi index ee188c76c79..621124acb97 100644 --- a/lispref/customize.texi +++ b/lispref/customize.texi | |||
| @@ -409,7 +409,7 @@ Keywords}. Here is an example, from the library @file{saveplace.el}: | |||
| 409 | 409 | ||
| 410 | @example | 410 | @example |
| 411 | (defcustom save-place nil | 411 | (defcustom save-place nil |
| 412 | "*Non-nil means automatically save place in each file..." | 412 | "Non-nil means automatically save place in each file..." |
| 413 | :type 'boolean | 413 | :type 'boolean |
| 414 | :require 'saveplace | 414 | :require 'saveplace |
| 415 | :group 'save-place) | 415 | :group 'save-place) |
| @@ -461,7 +461,7 @@ example: | |||
| 461 | 461 | ||
| 462 | @example | 462 | @example |
| 463 | (defcustom diff-command "diff" | 463 | (defcustom diff-command "diff" |
| 464 | "*The command to use to run diff." | 464 | "The command to use to run diff." |
| 465 | :type '(string) | 465 | :type '(string) |
| 466 | :group 'diff) | 466 | :group 'diff) |
| 467 | @end example | 467 | @end example |
diff --git a/lispref/modes.texi b/lispref/modes.texi index 29c316d625d..b46c0c0e1a5 100644 --- a/lispref/modes.texi +++ b/lispref/modes.texi | |||
| @@ -1480,12 +1480,17 @@ See the command \\[hungry-electric-delete]." | |||
| 1480 | @end smallexample | 1480 | @end smallexample |
| 1481 | 1481 | ||
| 1482 | @defmac define-global-minor-mode global-mode mode turn-on keyword-args@dots{} | 1482 | @defmac define-global-minor-mode global-mode mode turn-on keyword-args@dots{} |
| 1483 | This defines a global minor mode named @var{global-mode} whose meaning | 1483 | This defines a global toggle named @var{global-mode} whose meaning is |
| 1484 | is to enable the buffer-local minor mode @var{mode} in every buffer. | 1484 | to enable or disable the buffer-local minor mode @var{mode} in all |
| 1485 | To turn on the minor mode in a buffer, it uses the function | 1485 | buffers. To turn on the minor mode in a buffer, it uses the function |
| 1486 | @var{turn-on}; to turn off the minor mode, it calls @code{mode} with | 1486 | @var{turn-on}; to turn off the minor mode, it calls @code{mode} with |
| 1487 | @minus{}1 as argument. | 1487 | @minus{}1 as argument. |
| 1488 | 1488 | ||
| 1489 | Globally enabling the mode also affects buffers subsequently created | ||
| 1490 | by visiting files, and buffers that use a major mode other than | ||
| 1491 | Fundamental mode; but it does not detect the creation of a new buffer | ||
| 1492 | in Fundamental mode. | ||
| 1493 | |||
| 1489 | Use @code{:group @var{group}} in @var{keyword-args} to specify the | 1494 | Use @code{:group @var{group}} in @var{keyword-args} to specify the |
| 1490 | custom group for the mode variable of the global minor mode. | 1495 | custom group for the mode variable of the global minor mode. |
| 1491 | @end defmac | 1496 | @end defmac |
diff --git a/lispref/processes.texi b/lispref/processes.texi index 2fd1f5ec963..f4c3d495764 100644 --- a/lispref/processes.texi +++ b/lispref/processes.texi | |||
| @@ -2247,7 +2247,7 @@ Value of the last field processed. | |||
| 2247 | The data as a byte array. | 2247 | The data as a byte array. |
| 2248 | 2248 | ||
| 2249 | @item bindat-idx | 2249 | @item bindat-idx |
| 2250 | Current index into bindat-raw of the unpacking or packing operation. | 2250 | Current index (within @code{bindat-raw}) for unpacking or packing. |
| 2251 | 2251 | ||
| 2252 | @item struct | 2252 | @item struct |
| 2253 | The alist containing the structured data that have been unpacked so | 2253 | The alist containing the structured data that have been unpacked so |
diff --git a/lispref/variables.texi b/lispref/variables.texi index a2fe4df4da1..a10a157af1b 100644 --- a/lispref/variables.texi +++ b/lispref/variables.texi | |||
| @@ -1777,9 +1777,11 @@ compatibility. You can do this with @code{defvaralias}. | |||
| 1777 | 1777 | ||
| 1778 | @defun defvaralias new-alias base-variable &optional docstring | 1778 | @defun defvaralias new-alias base-variable &optional docstring |
| 1779 | This function defines the symbol @var{new-alias} as a variable alias | 1779 | This function defines the symbol @var{new-alias} as a variable alias |
| 1780 | for symbol @var{base-variable}. This means that retrieving the value of | 1780 | for symbol @var{base-variable}. This means that retrieving the value |
| 1781 | @var{new-alias} returns the value of @var{base-variable}, and changing the | 1781 | of @var{new-alias} returns the value of @var{base-variable}, and |
| 1782 | value of @var{new-alias} changes the value of @var{base-variable}. | 1782 | changing the value of @var{new-alias} changes the value of |
| 1783 | @var{base-variable}. The two aliased variable names always share the | ||
| 1784 | same value and the same bindings. | ||
| 1783 | 1785 | ||
| 1784 | If the @var{docstring} argument is non-@code{nil}, it specifies the | 1786 | If the @var{docstring} argument is non-@code{nil}, it specifies the |
| 1785 | documentation for @var{new-alias}; otherwise, the alias gets the same | 1787 | documentation for @var{new-alias}; otherwise, the alias gets the same |
diff --git a/lwlib/ChangeLog b/lwlib/ChangeLog index 904d8eadf05..d3e8c2eb4c3 100644 --- a/lwlib/ChangeLog +++ b/lwlib/ChangeLog | |||
| @@ -1,3 +1,19 @@ | |||
| 1 | 2007-01-01 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 2 | |||
| 3 | * xlwmenu.c (xlwMenuResources): Add XtNleaveCallback, XtNenterCallback. | ||
| 4 | (display_menu, map_event_to_widget_value): Generate enter and | ||
| 5 | leave callbacks. | ||
| 6 | (pop_up_menu): Initialize mw->menu.inside_entry. | ||
| 7 | |||
| 8 | * xlwmenu.h (XtNleaveCallback, XtNenterCallback): New strings. | ||
| 9 | |||
| 10 | * xlwmenuP.h (_XlwMenu_part): Add enter/leave callbacks and | ||
| 11 | inside_entry. | ||
| 12 | |||
| 13 | * lwlib-Xlw.c (enter_hook, leave_hook): New functions | ||
| 14 | (xlw_create_menubar, xlw_create_popup_menu): Connect XtNenter/leave | ||
| 15 | to enter/leave_hook. | ||
| 16 | |||
| 1 | 2006-10-30 Chong Yidong <cyd@stupidchicken.com> | 17 | 2006-10-30 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 18 | ||
| 3 | * Makefile.in (lwlib-utils.o): Use CPPFLAGS. | 19 | * Makefile.in (lwlib-utils.o): Use CPPFLAGS. |
diff --git a/lwlib/lwlib-Xlw.c b/lwlib/lwlib-Xlw.c index 4799b1dbd9d..dd366e4cca1 100644 --- a/lwlib/lwlib-Xlw.c +++ b/lwlib/lwlib-Xlw.c | |||
| @@ -84,6 +84,25 @@ highlight_hook (w, client_data, call_data) | |||
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | static void | 86 | static void |
| 87 | enter_hook (w, client_data, call_data) | ||
| 88 | Widget w; | ||
| 89 | XtPointer client_data; | ||
| 90 | XtPointer call_data; | ||
| 91 | { | ||
| 92 | highlight_hook (w, client_data, call_data); | ||
| 93 | } | ||
| 94 | |||
| 95 | static void | ||
| 96 | leave_hook (w, client_data, call_data) | ||
| 97 | Widget w; | ||
| 98 | XtPointer client_data; | ||
| 99 | XtPointer call_data; | ||
| 100 | { | ||
| 101 | highlight_hook (w, client_data, NULL); | ||
| 102 | } | ||
| 103 | |||
| 104 | |||
| 105 | static void | ||
| 87 | pre_hook (w, client_data, call_data) | 106 | pre_hook (w, client_data, call_data) |
| 88 | Widget w; | 107 | Widget w; |
| 89 | XtPointer client_data; | 108 | XtPointer client_data; |
| @@ -152,8 +171,8 @@ xlw_create_menubar (instance) | |||
| 152 | 171 | ||
| 153 | XtAddCallback (widget, XtNopen, pre_hook, (XtPointer)instance); | 172 | XtAddCallback (widget, XtNopen, pre_hook, (XtPointer)instance); |
| 154 | XtAddCallback (widget, XtNselect, pick_hook, (XtPointer)instance); | 173 | XtAddCallback (widget, XtNselect, pick_hook, (XtPointer)instance); |
| 155 | XtAddCallback (widget, XtNhighlightCallback, highlight_hook, | 174 | XtAddCallback (widget, XtNleaveCallback, leave_hook, (XtPointer)instance); |
| 156 | (XtPointer)instance); | 175 | XtAddCallback (widget, XtNenterCallback, enter_hook, (XtPointer)instance); |
| 157 | return widget; | 176 | return widget; |
| 158 | } | 177 | } |
| 159 | 178 | ||
| @@ -179,8 +198,8 @@ xlw_create_popup_menu (instance) | |||
| 179 | popup_shell, al, ac); | 198 | popup_shell, al, ac); |
| 180 | 199 | ||
| 181 | XtAddCallback (widget, XtNselect, pick_hook, (XtPointer)instance); | 200 | XtAddCallback (widget, XtNselect, pick_hook, (XtPointer)instance); |
| 182 | XtAddCallback (widget, XtNhighlightCallback, highlight_hook, | 201 | XtAddCallback (widget, XtNleaveCallback, leave_hook, (XtPointer)instance); |
| 183 | (XtPointer)instance); | 202 | XtAddCallback (widget, XtNenterCallback, enter_hook, (XtPointer)instance); |
| 184 | 203 | ||
| 185 | return popup_shell; | 204 | return popup_shell; |
| 186 | } | 205 | } |
diff --git a/lwlib/xlwmenu.c b/lwlib/xlwmenu.c index b01569ca5ab..65b9685038e 100644 --- a/lwlib/xlwmenu.c +++ b/lwlib/xlwmenu.c | |||
| @@ -161,6 +161,10 @@ xlwMenuResources[] = | |||
| 161 | offset(menu.select), XtRCallback, (XtPointer)NULL}, | 161 | offset(menu.select), XtRCallback, (XtPointer)NULL}, |
| 162 | {XtNhighlightCallback, XtCCallback, XtRCallback, sizeof(XtPointer), | 162 | {XtNhighlightCallback, XtCCallback, XtRCallback, sizeof(XtPointer), |
| 163 | offset(menu.highlight), XtRCallback, (XtPointer)NULL}, | 163 | offset(menu.highlight), XtRCallback, (XtPointer)NULL}, |
| 164 | {XtNenterCallback, XtCCallback, XtRCallback, sizeof(XtPointer), | ||
| 165 | offset(menu.enter), XtRCallback, (XtPointer)NULL}, | ||
| 166 | {XtNleaveCallback, XtCCallback, XtRCallback, sizeof(XtPointer), | ||
| 167 | offset(menu.leave), XtRCallback, (XtPointer)NULL}, | ||
| 164 | {XtNmenu, XtCMenu, XtRPointer, sizeof(XtPointer), | 168 | {XtNmenu, XtCMenu, XtRPointer, sizeof(XtPointer), |
| 165 | offset(menu.contents), XtRImmediate, (XtPointer)NULL}, | 169 | offset(menu.contents), XtRImmediate, (XtPointer)NULL}, |
| 166 | {XtNcursor, XtCCursor, XtRCursor, sizeof(Cursor), | 170 | {XtNcursor, XtCCursor, XtRCursor, sizeof(Cursor), |
| @@ -1186,8 +1190,17 @@ display_menu (mw, level, just_compute_p, highlighted_pos, hit, hit_return, | |||
| 1186 | { | 1190 | { |
| 1187 | if (val->enabled) | 1191 | if (val->enabled) |
| 1188 | *hit_return = val; | 1192 | *hit_return = val; |
| 1189 | else | 1193 | else |
| 1190 | no_return = 1; | 1194 | no_return = 1; |
| 1195 | if (mw->menu.inside_entry != val) | ||
| 1196 | { | ||
| 1197 | if (mw->menu.inside_entry) | ||
| 1198 | XtCallCallbackList ((Widget)mw, mw->menu.leave, | ||
| 1199 | (XtPointer) mw->menu.inside_entry); | ||
| 1200 | mw->menu.inside_entry = val; | ||
| 1201 | XtCallCallbackList ((Widget)mw, mw->menu.enter, | ||
| 1202 | (XtPointer) mw->menu.inside_entry); | ||
| 1203 | } | ||
| 1191 | } | 1204 | } |
| 1192 | 1205 | ||
| 1193 | if (horizontal_p) | 1206 | if (horizontal_p) |
| @@ -1452,7 +1465,7 @@ motion_event_is_in_menu (mw, ev, level, relative_pos) | |||
| 1452 | relative_pos->x = ev->x_root - x; | 1465 | relative_pos->x = ev->x_root - x; |
| 1453 | relative_pos->y = ev->y_root - y; | 1466 | relative_pos->y = ev->y_root - y; |
| 1454 | return (x - shadow < ev->x_root && ev->x_root < x + ws->width | 1467 | return (x - shadow < ev->x_root && ev->x_root < x + ws->width |
| 1455 | && y - shadow < ev->y_root && ev->y_root < y + ws->height); | 1468 | && y - shadow < ev->y_root && ev->y_root < y + ws->height); |
| 1456 | } | 1469 | } |
| 1457 | 1470 | ||
| 1458 | static Boolean | 1471 | static Boolean |
| @@ -1465,6 +1478,7 @@ map_event_to_widget_value (mw, ev, val, level) | |||
| 1465 | int i; | 1478 | int i; |
| 1466 | XPoint relative_pos; | 1479 | XPoint relative_pos; |
| 1467 | window_state* ws; | 1480 | window_state* ws; |
| 1481 | int inside = 0; | ||
| 1468 | 1482 | ||
| 1469 | *val = NULL; | 1483 | *val = NULL; |
| 1470 | 1484 | ||
| @@ -1474,6 +1488,7 @@ map_event_to_widget_value (mw, ev, val, level) | |||
| 1474 | ws = &mw->menu.windows [i]; | 1488 | ws = &mw->menu.windows [i]; |
| 1475 | if (ws && motion_event_is_in_menu (mw, ev, i, &relative_pos)) | 1489 | if (ws && motion_event_is_in_menu (mw, ev, i, &relative_pos)) |
| 1476 | { | 1490 | { |
| 1491 | inside = 1; | ||
| 1477 | display_menu (mw, i, True, NULL, &relative_pos, val, NULL, NULL); | 1492 | display_menu (mw, i, True, NULL, &relative_pos, val, NULL, NULL); |
| 1478 | 1493 | ||
| 1479 | if (*val) | 1494 | if (*val) |
| @@ -1483,6 +1498,15 @@ map_event_to_widget_value (mw, ev, val, level) | |||
| 1483 | } | 1498 | } |
| 1484 | } | 1499 | } |
| 1485 | } | 1500 | } |
| 1501 | |||
| 1502 | if (!inside) | ||
| 1503 | { | ||
| 1504 | if (mw->menu.inside_entry != NULL) | ||
| 1505 | XtCallCallbackList ((Widget)mw, mw->menu.leave, | ||
| 1506 | (XtPointer) mw->menu.inside_entry); | ||
| 1507 | mw->menu.inside_entry = NULL; | ||
| 1508 | } | ||
| 1509 | |||
| 1486 | return False; | 1510 | return False; |
| 1487 | } | 1511 | } |
| 1488 | 1512 | ||
| @@ -2426,6 +2450,7 @@ pop_up_menu (mw, event) | |||
| 2426 | 2450 | ||
| 2427 | next_release_must_exit = 0; | 2451 | next_release_must_exit = 0; |
| 2428 | 2452 | ||
| 2453 | mw->menu.inside_entry = NULL; | ||
| 2429 | XtCallCallbackList ((Widget)mw, mw->menu.open, NULL); | 2454 | XtCallCallbackList ((Widget)mw, mw->menu.open, NULL); |
| 2430 | 2455 | ||
| 2431 | if (XtIsShell (XtParent ((Widget)mw))) | 2456 | if (XtIsShell (XtParent ((Widget)mw))) |
diff --git a/lwlib/xlwmenu.h b/lwlib/xlwmenu.h index fa5dc887330..9b7a6b099db 100644 --- a/lwlib/xlwmenu.h +++ b/lwlib/xlwmenu.h | |||
| @@ -44,6 +44,8 @@ Boston, MA 02110-1301, USA. */ | |||
| 44 | #define XtNopen "open" | 44 | #define XtNopen "open" |
| 45 | #define XtNselect "select" | 45 | #define XtNselect "select" |
| 46 | #define XtNhighlightCallback "highlightCallback" | 46 | #define XtNhighlightCallback "highlightCallback" |
| 47 | #define XtNenterCallback "enterCallback" | ||
| 48 | #define XtNleaveCallback "leaveCallback" | ||
| 47 | #define XtNmenuBorderWidth "menuBorderWidth" | 49 | #define XtNmenuBorderWidth "menuBorderWidth" |
| 48 | #define XtNhorizontal "horizontal" | 50 | #define XtNhorizontal "horizontal" |
| 49 | #define XtCHorizontal "Horizontal" | 51 | #define XtCHorizontal "Horizontal" |
diff --git a/lwlib/xlwmenuP.h b/lwlib/xlwmenuP.h index ce170d7bfe4..b90bc3da827 100644 --- a/lwlib/xlwmenuP.h +++ b/lwlib/xlwmenuP.h | |||
| @@ -64,6 +64,7 @@ typedef struct _XlwMenu_part | |||
| 64 | Cursor cursor_shape; | 64 | Cursor cursor_shape; |
| 65 | XtCallbackList open; | 65 | XtCallbackList open; |
| 66 | XtCallbackList select, highlight; | 66 | XtCallbackList select, highlight; |
| 67 | XtCallbackList enter, leave; | ||
| 67 | widget_value* contents; | 68 | widget_value* contents; |
| 68 | int horizontal; | 69 | int horizontal; |
| 69 | 70 | ||
| @@ -76,6 +77,7 @@ typedef struct _XlwMenu_part | |||
| 76 | int old_depth; | 77 | int old_depth; |
| 77 | widget_value** old_stack; | 78 | widget_value** old_stack; |
| 78 | int old_stack_length; | 79 | int old_stack_length; |
| 80 | widget_value* inside_entry; | ||
| 79 | 81 | ||
| 80 | /* New state after the user moved */ | 82 | /* New state after the user moved */ |
| 81 | int new_depth; | 83 | int new_depth; |
diff --git a/man/ChangeLog b/man/ChangeLog index 1404658209e..8bed7ae1672 100644 --- a/man/ChangeLog +++ b/man/ChangeLog | |||
| @@ -1,3 +1,85 @@ | |||
| 1 | 2007-01-05 Richard Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * anti.texi (Antinews): Mention M-x shell scrolling. | ||
| 4 | |||
| 5 | 2007-01-05 Nick Roberts <nickrob@snap.net.nz> | ||
| 6 | |||
| 7 | * building.texi (Watch Expressions): Describe gdb-max-children. | ||
| 8 | |||
| 9 | 2007-01-05 Michael Olson <mwolson@gnu.org> | ||
| 10 | |||
| 11 | * erc.texi (Getting Started): Update for /RECONNECT command. | ||
| 12 | |||
| 13 | 2007-01-04 Richard Stallman <rms@gnu.org> | ||
| 14 | |||
| 15 | * ebrowse.texi: Change C-c b to C-c C-m. | ||
| 16 | |||
| 17 | * msdog.texi (Windows Keyboard): Clarify previous change. | ||
| 18 | |||
| 19 | 2007-01-03 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 20 | |||
| 21 | * gnus.texi (Customizing Articles): Use index entries for gnus-treat-* | ||
| 22 | variables only in info to avoid redundant entries in the printed | ||
| 23 | manual. | ||
| 24 | |||
| 25 | 2007-01-02 Richard Stallman <rms@gnu.org> | ||
| 26 | |||
| 27 | * custom.texi (Changing a Variable): Minor clarification. | ||
| 28 | (Specific Customization): customize-customized => customize-unsaved. | ||
| 29 | |||
| 30 | * entering.texi (Entering Emacs): Clean up text about restarting | ||
| 31 | Emacs for each file. | ||
| 32 | |||
| 33 | * misc.texi (Shell Options): Minor cleanup. | ||
| 34 | |||
| 35 | * msdog.texi (Windows Keyboard): Explain that Windows was incompatible | ||
| 36 | with Emacs, not vice versa. | ||
| 37 | |||
| 38 | * programs.texi (Symbol Completion): Recommend customizing window | ||
| 39 | manager. | ||
| 40 | |||
| 41 | * xresources.texi (Resources): Minor fix. | ||
| 42 | |||
| 43 | 2007-01-02 Daiki Ueno <ueno@unixuser.org> | ||
| 44 | |||
| 45 | * message.texi (Using PGP/MIME): Document gpg-agent usage. | ||
| 46 | |||
| 47 | 2007-01-02 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 48 | |||
| 49 | * message.texi (Security): Split into sub-nodes. | ||
| 50 | |||
| 51 | 2007-01-01 Alan Mackenzie <acm@muc.de> | ||
| 52 | |||
| 53 | * cc-mode.texi ("Limitations and Known Bugs"): Document problems with | ||
| 54 | eval-after-load in Emacs <=21 and a workaround. Document that | ||
| 55 | trigraphs are not supported. | ||
| 56 | |||
| 57 | 2007-01-01 Alan Mackenzie <acm@muc.de> | ||
| 58 | |||
| 59 | * cc-mode.texi ("Filling and Breaking"): Amend the doc for | ||
| 60 | c-context-line-break. When invoked within a string, preserve | ||
| 61 | whitespace. Add a backslash only when also in a macro. | ||
| 62 | |||
| 63 | 2007-01-01 Alan Mackenzie <acm@muc.de> | ||
| 64 | |||
| 65 | * cc-mode.texi ("Choosing a Style"): Mention c-file-style. | ||
| 66 | |||
| 67 | 2007-01-01 Alan Mackenzie <acm@muc.de> | ||
| 68 | |||
| 69 | * cc-mode.texi ("Movement Commands", "Sample .emacs File"): C-M-[ae] | ||
| 70 | are now bound by default to c-\(beginning\|end\)-of-defun by default. | ||
| 71 | |||
| 72 | 2007-01-01 Alan Mackenzie <acm@muc.de> | ||
| 73 | |||
| 74 | * cc-mode.texi ("Other Commands"): Move c-set-style (C-c .) here from | ||
| 75 | "Choosing a Style". | ||
| 76 | |||
| 77 | * cc-mode.texi ("Styles"): Add @dfn{style}. | ||
| 78 | |||
| 79 | 2007-01-01 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 80 | |||
| 81 | * xresources.texi (Table of Resources): Add scrollBarWidth resource. | ||
| 82 | |||
| 1 | 2007-01-01 Richard Stallman <rms@gnu.org> | 83 | 2007-01-01 Richard Stallman <rms@gnu.org> |
| 2 | 84 | ||
| 3 | * commands.texi (User Input): Document keys stolen by window mangers. | 85 | * commands.texi (User Input): Document keys stolen by window mangers. |
| @@ -53,7 +135,6 @@ | |||
| 53 | (IMAP): Document nnimap-search-uids-not-since-is-evil and | 135 | (IMAP): Document nnimap-search-uids-not-since-is-evil and |
| 54 | nnimap-nov-is-evil. | 136 | nnimap-nov-is-evil. |
| 55 | 137 | ||
| 56 | >>>>>>> 1.1170 | ||
| 57 | 2006-12-27 Eli Zaretskii <eliz@gnu.org> | 138 | 2006-12-27 Eli Zaretskii <eliz@gnu.org> |
| 58 | 139 | ||
| 59 | * msdog.texi (Windows Keyboard): Mention widespread Windows bindings, | 140 | * msdog.texi (Windows Keyboard): Mention widespread Windows bindings, |
diff --git a/man/anti.texi b/man/anti.texi index a6746312dea..f5d1e420d5f 100644 --- a/man/anti.texi +++ b/man/anti.texi | |||
| @@ -173,6 +173,11 @@ nothing to do with it. To control fontification in Info mode, use the | |||
| 173 | variable @code{Info-fontify}. | 173 | variable @code{Info-fontify}. |
| 174 | 174 | ||
| 175 | @item | 175 | @item |
| 176 | @samp{M-x shell} is now completely standard in regard to scrolling | ||
| 177 | behavior. It no longer has the option of scrolling the input line to | ||
| 178 | the bottom of the window the way a text terminal running a shell does. | ||
| 179 | |||
| 180 | @item | ||
| 176 | The Grep package has been merged with Compilation mode. Many | 181 | The Grep package has been merged with Compilation mode. Many |
| 177 | grep-specific commands and user options have thus been eliminated. | 182 | grep-specific commands and user options have thus been eliminated. |
| 178 | Also, @kbd{M-x grep} never tries the GNU grep @samp{-H} option, | 183 | Also, @kbd{M-x grep} never tries the GNU grep @samp{-H} option, |
diff --git a/man/building.texi b/man/building.texi index bee9462a7f0..67f21dd9c23 100644 --- a/man/building.texi +++ b/man/building.texi | |||
| @@ -1099,8 +1099,11 @@ value for pointers and just the name and type otherwise. Root expressions | |||
| 1099 | also display the frame address as a tooltip to help identify the frame | 1099 | also display the frame address as a tooltip to help identify the frame |
| 1100 | in which they were defined. | 1100 | in which they were defined. |
| 1101 | 1101 | ||
| 1102 | To expand or contract a complex data type, click @kbd{Mouse-2} | 1102 | To expand or contract a complex data type, click @kbd{Mouse-2} or |
| 1103 | or press @key{SPC} on the tag to the left of the expression. | 1103 | press @key{SPC} on the tag to the left of the expression. Emacs asks |
| 1104 | for confirmation before expanding the expression if its number of | ||
| 1105 | immediate children exceeds the value of the variable | ||
| 1106 | @code{gdb-max-children}. | ||
| 1104 | 1107 | ||
| 1105 | @kindex D @r{(GDB speedbar)} | 1108 | @kindex D @r{(GDB speedbar)} |
| 1106 | @findex gdb-var-delete | 1109 | @findex gdb-var-delete |
diff --git a/man/cc-mode.texi b/man/cc-mode.texi index 801f098b9ce..e9a7d46d7fe 100644 --- a/man/cc-mode.texi +++ b/man/cc-mode.texi | |||
| @@ -486,7 +486,7 @@ work just fine right out of the box. Note however that you might not | |||
| 486 | have the latest @ccmode{} release and might want to upgrade your copy | 486 | have the latest @ccmode{} release and might want to upgrade your copy |
| 487 | (see below). | 487 | (see below). |
| 488 | 488 | ||
| 489 | You should probably start by reading the entire chapter | 489 | You should probably start by skimming through the entire chapter |
| 490 | @ref{Commands} to get an overview of @ccmode{}'s capabilities. | 490 | @ref{Commands} to get an overview of @ccmode{}'s capabilities. |
| 491 | 491 | ||
| 492 | After trying out some commands, you may dislike some aspects of | 492 | After trying out some commands, you may dislike some aspects of |
| @@ -687,7 +687,7 @@ that begins at the line's left margin. | |||
| 687 | @item | 687 | @item |
| 688 | When it's @code{nil}, the command indents the line by an extra | 688 | When it's @code{nil}, the command indents the line by an extra |
| 689 | @code{c-basic-offset} columns. A prefix argument acts as a | 689 | @code{c-basic-offset} columns. A prefix argument acts as a |
| 690 | multiplier. A bare prefix (@kbd{C-u @key{TAB}} is equivalent to -1, | 690 | multiplier. A bare prefix (@kbd{C-u @key{TAB}}) is equivalent to -1, |
| 691 | removing @code{c-basic-offset} columns from the indentation. | 691 | removing @code{c-basic-offset} columns from the indentation. |
| 692 | @end itemize | 692 | @end itemize |
| 693 | 693 | ||
| @@ -880,30 +880,29 @@ lines. | |||
| 880 | @ccmode{} contains some useful commands for moving around in C code. | 880 | @ccmode{} contains some useful commands for moving around in C code. |
| 881 | 881 | ||
| 882 | @table @asis | 882 | @table @asis |
| 883 | @item @kbd{M-x c-beginning-of-defun} | 883 | @item @kbd{C-M-a} |
| 884 | @itemx @kbd{M-x c-end-of-defun} | 884 | @itemx @kbd{C-M-e} |
| 885 | @findex c-beginning-of-defun | 885 | @findex c-beginning-of-defun |
| 886 | @findex c-end-of-defun | 886 | @findex c-end-of-defun |
| 887 | @findex beginning-of-defun (c-) | 887 | |
| 888 | @findex end-of-defun (c-) | 888 | Move to the beginning or end of the current or next function. Other |
| 889 | @findex beginning-of-defun | 889 | constructs (such as a structs or classes) which have a brace block |
| 890 | @findex end-of-defun | 890 | also count as ``functions'' here. To move over several functions, you |
| 891 | Move to the start or end of the current top-level definition. This is | 891 | can give these commands a repeat count. |
| 892 | the outermost brace pair which encloses point, together with the | 892 | |
| 893 | function header or similar preamble which precedes the opening brace. | 893 | The start of a function is at its header. The end of the function is |
| 894 | after its closing brace, or after the semicolon of a construct (such | ||
| 895 | as a @code{struct}) which doesn't end at the brace. These two | ||
| 896 | commands try to leave point at the beginning of a line near the actual | ||
| 897 | start or end of the function. This occasionally causes point not to | ||
| 898 | move at all. | ||
| 899 | |||
| 894 | These functions are analogous to the Emacs built-in commands | 900 | These functions are analogous to the Emacs built-in commands |
| 895 | @code{beginning-of-defun} and @code{end-of-defun}, except they | 901 | @code{beginning-of-defun} and @code{end-of-defun}, except they |
| 896 | eliminate the constraint that the top-level opening brace of the defun | 902 | eliminate the constraint that the top-level opening brace of the defun |
| 897 | must be in column zero. See @ref{Defuns,,,@emacsman{}, | 903 | must be in column zero. See @ref{Defuns,,,@emacsman{}, |
| 898 | @emacsmantitle{}}, for more information. | 904 | @emacsmantitle{}}, for more information. |
| 899 | 905 | ||
| 900 | Depending on the coding style you're using, you might prefer these two | ||
| 901 | commands to the standard Emacs ones. If so, consider binding them to | ||
| 902 | @kbd{C-M-a} and @kbd{C-M-e}. @xref{Sample .emacs File}. This | ||
| 903 | customization won't affect the special bindings for these key | ||
| 904 | sequences in force in AWK Mode. For backwards compatibility reasons, | ||
| 905 | the default bindings for @kbd{C-M-a} and @kbd{C-M-e} remain in effect. | ||
| 906 | |||
| 907 | @item @kbd{C-M-a} (AWK Mode) (@code{c-awk-beginning-of-defun}) | 906 | @item @kbd{C-M-a} (AWK Mode) (@code{c-awk-beginning-of-defun}) |
| 908 | @itemx @kbd{C-M-e} (AWK Mode) (@code{c-awk-end-of-defun}) | 907 | @itemx @kbd{C-M-e} (AWK Mode) (@code{c-awk-end-of-defun}) |
| 909 | @kindex C-M-a (AWK Mode) | 908 | @kindex C-M-a (AWK Mode) |
| @@ -912,11 +911,9 @@ the default bindings for @kbd{C-M-a} and @kbd{C-M-e} remain in effect. | |||
| 912 | @findex awk-beginning-of-defun (c-) | 911 | @findex awk-beginning-of-defun (c-) |
| 913 | @findex c-awk-end-of-defun | 912 | @findex c-awk-end-of-defun |
| 914 | @findex awk-end-of-defun (c-) | 913 | @findex awk-end-of-defun (c-) |
| 915 | Move back to the beginning or forward to the end of the current AWK | 914 | Move to the beginning or end of the current or next AWK defun. These |
| 916 | defun. These functions are bound to @kbd{C-M-a} and @kbd{C-M-e} by | 915 | commands can take prefix-arguments, their functionality being entirely |
| 917 | default in AWK Mode. They can take prefix-arguments, their | 916 | equivalent to @code{beginning-of-defun} and @code{end-of-defun}. |
| 918 | functionality being entirely equivalent to @code{beginning-of-defun} | ||
| 919 | and @code{end-of-defun}. | ||
| 920 | 917 | ||
| 921 | AWK Mode @dfn{defuns} are either pattern/action pairs (either of which | 918 | AWK Mode @dfn{defuns} are either pattern/action pairs (either of which |
| 922 | might be implicit) or user defined functions. Having the @samp{@{} and | 919 | might be implicit) or user defined functions. Having the @samp{@{} and |
| @@ -1094,7 +1091,10 @@ prefix like @code{c-indent-new-comment-line}. In normal code it's | |||
| 1094 | indented like @code{newline-and-indent} would do. In macros it acts | 1091 | indented like @code{newline-and-indent} would do. In macros it acts |
| 1095 | like @code{newline-and-indent} but additionally inserts and optionally | 1092 | like @code{newline-and-indent} but additionally inserts and optionally |
| 1096 | aligns the line ending backslash so that the macro remains unbroken. | 1093 | aligns the line ending backslash so that the macro remains unbroken. |
| 1097 | @xref{Custom Macros}, for details about the backslash alignment. | 1094 | @xref{Custom Macros}, for details about the backslash alignment. In a |
| 1095 | string, a backslash is inserted only if the string is within a | ||
| 1096 | macro@footnote{In GCC, unescaped line breaks within strings are | ||
| 1097 | valid.}. | ||
| 1098 | 1098 | ||
| 1099 | This function is not bound to a key by default, but it's intended to be | 1099 | This function is not bound to a key by default, but it's intended to be |
| 1100 | used on the @kbd{RET} key. If you like the behavior of | 1100 | used on the @kbd{RET} key. If you like the behavior of |
| @@ -1710,6 +1710,25 @@ buffers by typing @kbd{M-x c-subword-mode}. | |||
| 1710 | Here are the various other commands that didn't fit anywhere else: | 1710 | Here are the various other commands that didn't fit anywhere else: |
| 1711 | 1711 | ||
| 1712 | @table @asis | 1712 | @table @asis |
| 1713 | @item @kbd{C-c .} (@code{c-set-style}) | ||
| 1714 | @kindex C-c . | ||
| 1715 | @findex c-set-style | ||
| 1716 | @findex set-style (c-) | ||
| 1717 | Switch to the specified style in the current buffer. Use like this: | ||
| 1718 | |||
| 1719 | @example | ||
| 1720 | @kbd{C-c . @var{style-name} @key{RET}} | ||
| 1721 | @end example | ||
| 1722 | |||
| 1723 | You can use the @key{TAB} in the normal way to do completion on the | ||
| 1724 | style name. Note that all style names are case insensitive, even the | ||
| 1725 | ones you define yourself. | ||
| 1726 | |||
| 1727 | Setting a style in this way does @emph{not} automatically reindent your | ||
| 1728 | file. For commands that you can use to view the effect of your changes, | ||
| 1729 | see @ref{Indentation Commands} and @ref{Filling and Breaking}. | ||
| 1730 | |||
| 1731 | For details of the @ccmode{} style system, see @ref{Styles}. | ||
| 1713 | @item @kbd{C-c :} (@code{c-scope-operator}) | 1732 | @item @kbd{C-c :} (@code{c-scope-operator}) |
| 1714 | @kindex C-c : | 1733 | @kindex C-c : |
| 1715 | @findex c-scope-operator | 1734 | @findex c-scope-operator |
| @@ -2363,7 +2382,7 @@ last thing when you enter that language mode. | |||
| 2363 | @end defvar | 2382 | @end defvar |
| 2364 | 2383 | ||
| 2365 | Although these hooks are variables defined in @ccmode{}, you can give | 2384 | Although these hooks are variables defined in @ccmode{}, you can give |
| 2366 | them values before @ccmode{}'s code is loaded - indeed, this is the | 2385 | them values before @ccmode{}'s code is loaded---indeed, this is the |
| 2367 | only way to use @code{c-initialization-hook}. Their values aren't | 2386 | only way to use @code{c-initialization-hook}. Their values aren't |
| 2368 | overwritten when @ccmode{} gets loaded. | 2387 | overwritten when @ccmode{} gets loaded. |
| 2369 | 2388 | ||
| @@ -2476,6 +2495,11 @@ Commas});@* | |||
| 2476 | @cindex styles | 2495 | @cindex styles |
| 2477 | @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 2496 | @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 2478 | 2497 | ||
| 2498 | By @dfn{style} we mean the layout of the code---things like how many | ||
| 2499 | columns to indent a block of code, whether an opening brace gets | ||
| 2500 | indented to the level of the code it encloses, or of the construct | ||
| 2501 | that introduces it, or ``hangs'' at the end of a line. | ||
| 2502 | |||
| 2479 | Most people only need to edit code formatted in just a few well-defined | 2503 | Most people only need to edit code formatted in just a few well-defined |
| 2480 | and consistent styles. For example, their organization might impose a | 2504 | and consistent styles. For example, their organization might impose a |
| 2481 | ``blessed'' style that all its programmers must conform to. Similarly, | 2505 | ``blessed'' style that all its programmers must conform to. Similarly, |
| @@ -2577,35 +2601,19 @@ afterwards. | |||
| 2577 | @subsection Choosing a Style | 2601 | @subsection Choosing a Style |
| 2578 | @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 2602 | @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 2579 | 2603 | ||
| 2580 | Use @kbd{C-c .} to choose a style interactively: | 2604 | When you create a new buffer, its style will be set from |
| 2581 | 2605 | @code{c-default-style}. The factory default is the style @code{gnu}, | |
| 2582 | @deffn Command c-set-style style-name | 2606 | except in Java and AWK modes where it's @code{java} and @code{awk}. |
| 2583 | @findex set-style (c-) | ||
| 2584 | @kindex C-c . | ||
| 2585 | Switch to the specified style in the current buffer. Use | ||
| 2586 | interactively like this: | ||
| 2587 | |||
| 2588 | @example | ||
| 2589 | @kbd{C-c . @var{style-name} @key{RET}} | ||
| 2590 | @end example | ||
| 2591 | |||
| 2592 | You can use the @key{TAB} in the normal way to do completion on the | ||
| 2593 | style name. Note that all style names are case insensitive, even the | ||
| 2594 | ones you define yourself. | ||
| 2595 | |||
| 2596 | Setting a style in this way does @emph{not} automatically reindent your | ||
| 2597 | file. For commands that you can use to view the effect of your changes, | ||
| 2598 | see @ref{Indentation Commands} and @ref{Filling and Breaking}. | ||
| 2599 | @end deffn | ||
| 2600 | |||
| 2601 | The default style in all newly created buffers is @code{gnu}, except | ||
| 2602 | in Java and AWK modes where it's @code{java} and @code{awk}. | ||
| 2603 | 2607 | ||
| 2604 | Remember that if you set a style variable with the Customization | 2608 | Remember that if you set a style variable with the Customization |
| 2605 | interface or at the top level of your @file{.emacs} file before the | 2609 | interface or at the top level of your @file{.emacs} file before the |
| 2606 | style system is initialised (@pxref{Config Basics}), this setting will | 2610 | style system is initialised (@pxref{Config Basics}), this setting will |
| 2607 | override the one that the style system would have given the variable. | 2611 | override the one that the style system would have given the variable. |
| 2608 | 2612 | ||
| 2613 | To set a buffer's style interactively, use the command @kbd{C-c .} | ||
| 2614 | (@pxref{Other Commands}). To set it from a file's local variable | ||
| 2615 | list, @ref{File Styles}. | ||
| 2616 | |||
| 2609 | @defopt c-default-style | 2617 | @defopt c-default-style |
| 2610 | @vindex default-style (c-) | 2618 | @vindex default-style (c-) |
| 2611 | This variable specifies which style to install by default in new | 2619 | This variable specifies which style to install by default in new |
| @@ -3247,8 +3255,8 @@ the proper functioning of @ccmode{}. | |||
| 3247 | 3255 | ||
| 3248 | This variable is also bound in three other circumstances: | 3256 | This variable is also bound in three other circumstances: |
| 3249 | (i)@w{ }when calling a c-hanging-semi&comma-criteria function | 3257 | (i)@w{ }when calling a c-hanging-semi&comma-criteria function |
| 3250 | (@pxref{Hanging Semicolons and Commas}; (ii)@w{ }when calling a | 3258 | (@pxref{Hanging Semicolons and Commas}); (ii)@w{ }when calling a |
| 3251 | line-up function (@pxref{Custom Line-Up}; (iii)@w{ }when calling a | 3259 | line-up function (@pxref{Custom Line-Up}); (iii)@w{ }when calling a |
| 3252 | c-special-indent-hook function (@pxref{Other Indentation}). | 3260 | c-special-indent-hook function (@pxref{Other Indentation}). |
| 3253 | @end defvar | 3261 | @end defvar |
| 3254 | 3262 | ||
| @@ -3430,7 +3438,11 @@ newlines after semicolons inside one-line inline method definitions | |||
| 3430 | @dfn{Clean-ups} are mechanisms which remove (or exceptionally, add) | 3438 | @dfn{Clean-ups} are mechanisms which remove (or exceptionally, add) |
| 3431 | whitespace in specific circumstances and are complementary to colon | 3439 | whitespace in specific circumstances and are complementary to colon |
| 3432 | and brace hanging. You enable a clean-up by adding its symbol into | 3440 | and brace hanging. You enable a clean-up by adding its symbol into |
| 3433 | @code{c-cleanup-list}. | 3441 | @code{c-cleanup-list}, e.g. like this: |
| 3442 | |||
| 3443 | @example | ||
| 3444 | (add-to-list 'c-cleanup-list 'space-before-funcall) | ||
| 3445 | @end example | ||
| 3434 | 3446 | ||
| 3435 | On the surface, it would seem that clean-ups overlap the functionality | 3447 | On the surface, it would seem that clean-ups overlap the functionality |
| 3436 | provided by the @code{c-hanging-*-alist} variables. Clean-ups, | 3448 | provided by the @code{c-hanging-*-alist} variables. Clean-ups, |
| @@ -3661,10 +3673,11 @@ it's only an empty parenthesis pair. I.e. you will get @samp{signal | |||
| 3661 | closing parenthesis is typed. | 3673 | closing parenthesis is typed. |
| 3662 | 3674 | ||
| 3663 | @item comment-close-slash | 3675 | @item comment-close-slash |
| 3664 | When inside a block comment, terminate the comment when you type a | 3676 | When inside a block comment, terminate the comment when you type a slash |
| 3665 | slash at the beginning of a line (i.e. immediately after the comment | 3677 | at the beginning of a line (i.e. immediately after the comment prefix). |
| 3666 | prefix). This clean-up removes whitespace preceding the slash and if | 3678 | This clean-up removes whitespace preceding the slash and if needed, |
| 3667 | needed, inserts a star to complete the token @samp{*/}. | 3679 | inserts a star to complete the token @samp{*/}. Type @kbd{C-q /} in this |
| 3680 | situation if you just want a literal @samp{/} inserted. | ||
| 3668 | @end table | 3681 | @end table |
| 3669 | 3682 | ||
| 3670 | 3683 | ||
| @@ -5182,7 +5195,7 @@ If an offset specification evaluates to @code{nil}, then a relative | |||
| 5182 | offset of 0 (zero) is used@footnote{There is however a variable | 5195 | offset of 0 (zero) is used@footnote{There is however a variable |
| 5183 | @code{c-strict-syntax-p} that when set to non-@code{nil} will cause an | 5196 | @code{c-strict-syntax-p} that when set to non-@code{nil} will cause an |
| 5184 | error to be signaled in that case. It's now considered obsolete since | 5197 | error to be signaled in that case. It's now considered obsolete since |
| 5185 | it doesn't work well with some of the alignment functions that returns | 5198 | it doesn't work well with some of the alignment functions that return |
| 5186 | @code{nil} instead of zero. You should therefore leave | 5199 | @code{nil} instead of zero. You should therefore leave |
| 5187 | @code{c-strict-syntax-p} set to @code{nil}.}. | 5200 | @code{c-strict-syntax-p} set to @code{nil}.}. |
| 5188 | 5201 | ||
| @@ -6549,18 +6562,16 @@ anchoring position to indent the line in that case. | |||
| 6549 | @appendix Sample .emacs File | 6562 | @appendix Sample .emacs File |
| 6550 | @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 6563 | @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 6551 | 6564 | ||
| 6552 | @verbatim | 6565 | Here's a sample .emacs file fragment that might help you along the way. |
| 6553 | ;; Here's a sample .emacs file fragment that might help you along the | 6566 | Just copy this region and paste it into your .emacs file. You might want |
| 6554 | ;; way. Just copy this region and paste it into your .emacs file. | 6567 | to change some of the actual values. |
| 6555 | ;; You might want to change some of the actual values. | ||
| 6556 | 6568 | ||
| 6557 | ;; Make some non-standard key bindings. We can put these in | 6569 | @verbatim |
| 6570 | ;; Make a non-standard key binding. We can put this in | ||
| 6558 | ;; c-mode-base-map because c-mode-map, c++-mode-map, and so on, | 6571 | ;; c-mode-base-map because c-mode-map, c++-mode-map, and so on, |
| 6559 | ;; inherit from it. | 6572 | ;; inherit from it. |
| 6560 | (defun my-c-initialization-hook () | 6573 | (defun my-c-initialization-hook () |
| 6561 | (define-key c-mode-base-map "\C-m" 'c-context-line-break) | 6574 | (define-key c-mode-base-map "\C-m" 'c-context-line-break)) |
| 6562 | (define-key c-mode-base-map [?\C-\M-a] 'c-beginning-of-defun) | ||
| 6563 | (define-key c-mode-base-map [?\C-\M-e] 'c-end-of-defun)) | ||
| 6564 | (add-hook 'c-initialization-hook 'my-c-initialization-hook) | 6575 | (add-hook 'c-initialization-hook 'my-c-initialization-hook) |
| 6565 | 6576 | ||
| 6566 | ;; offset customizations not in my-c-style | 6577 | ;; offset customizations not in my-c-style |
| @@ -6647,9 +6658,6 @@ embodied in the @code{beginning-of-defun} function. @ccmode now | |||
| 6647 | caches syntactic information much better, so that the delay caused by | 6658 | caches syntactic information much better, so that the delay caused by |
| 6648 | searching for such a brace when it's not in column 0 is minimal, | 6659 | searching for such a brace when it's not in column 0 is minimal, |
| 6649 | except perhaps when you've just moved a long way inside the file. | 6660 | except perhaps when you've just moved a long way inside the file. |
| 6650 | Don't forget to rebind @kbd{C-M-a} and @kbd{C-M-e} to the @ccmode{} | ||
| 6651 | functions @code{beginning-of-defun} and @code{end-of-defun} if you're | ||
| 6652 | going to be hanging your braces! @xref{Sample .emacs File}. | ||
| 6653 | 6661 | ||
| 6654 | @findex defun-prompt-regexp | 6662 | @findex defun-prompt-regexp |
| 6655 | @vindex c-Java-defun-prompt-regexp | 6663 | @vindex c-Java-defun-prompt-regexp |
| @@ -6726,6 +6734,12 @@ more info. | |||
| 6726 | 6734 | ||
| 6727 | @itemize @bullet | 6735 | @itemize @bullet |
| 6728 | @item | 6736 | @item |
| 6737 | @ccmode{} doesn't support trigraphs. (These are character sequences | ||
| 6738 | such as @samp{??(}, which represents @samp{[}. They date from a time | ||
| 6739 | when some character sets didn't have all the characters that C needs, | ||
| 6740 | and are now utterly obsolete.) | ||
| 6741 | |||
| 6742 | @item | ||
| 6729 | There is no way to apply auto newline settings (@pxref{Auto-newlines}) | 6743 | There is no way to apply auto newline settings (@pxref{Auto-newlines}) |
| 6730 | on already typed lines. That's only a feature to ease interactive | 6744 | on already typed lines. That's only a feature to ease interactive |
| 6731 | editing. | 6745 | editing. |
| @@ -6747,6 +6761,25 @@ When a non-nested template is used in a declaration, @ccmode{} indents | |||
| 6747 | it and font-locks it OK. Templates used in expressions, and nested | 6761 | it and font-locks it OK. Templates used in expressions, and nested |
| 6748 | templates do not fare so well. Sometimes a workaround is to refontify | 6762 | templates do not fare so well. Sometimes a workaround is to refontify |
| 6749 | the expression after typing the closing @samp{>}. | 6763 | the expression after typing the closing @samp{>}. |
| 6764 | |||
| 6765 | @item | ||
| 6766 | On loading @ccmode{}, sometimes this error message appears: | ||
| 6767 | |||
| 6768 | @example | ||
| 6769 | File mode specification error: (void-variable c-font-lock-keywords-3) | ||
| 6770 | @end example | ||
| 6771 | |||
| 6772 | This is due to a bug in the function @code{eval-after-load} in some | ||
| 6773 | versions of (X)Emacs. It can manifest itself when there is a symbolic | ||
| 6774 | link in the path of the directory which contains (X)Emacs. As a | ||
| 6775 | workaround, put the following into your @file{.emacs} file, fairly | ||
| 6776 | early on: | ||
| 6777 | |||
| 6778 | @example | ||
| 6779 | (defun my-load-cc-fonts () | ||
| 6780 | (require "cc-fonts")) | ||
| 6781 | (add-hook 'c-initialization-hook 'my-load-cc-fonts) | ||
| 6782 | @end example | ||
| 6750 | @end itemize | 6783 | @end itemize |
| 6751 | 6784 | ||
| 6752 | @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 6785 | @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
diff --git a/man/custom.texi b/man/custom.texi index 49c7e6215ea..d14ea2fcd46 100644 --- a/man/custom.texi +++ b/man/custom.texi | |||
| @@ -475,7 +475,7 @@ so that you will get the standard value in future Emacs sessions. | |||
| 475 | This sets the variable to a previous value that was set in the | 475 | This sets the variable to a previous value that was set in the |
| 476 | customization buffer in this session. If you customize a variable | 476 | customization buffer in this session. If you customize a variable |
| 477 | and then reset it, which discards the customized value, | 477 | and then reset it, which discards the customized value, |
| 478 | you can get the customized value back again with this operation. | 478 | you can get the discarded value back again with this operation. |
| 479 | @end table | 479 | @end table |
| 480 | 480 | ||
| 481 | @cindex comments on customized settings | 481 | @cindex comments on customized settings |
| @@ -641,9 +641,9 @@ whose meaning has changed since Emacs version @var{version}. | |||
| 641 | @item M-x customize-saved | 641 | @item M-x customize-saved |
| 642 | Set up a customization buffer containing all settings that you | 642 | Set up a customization buffer containing all settings that you |
| 643 | have saved with customization buffers. | 643 | have saved with customization buffers. |
| 644 | @item M-x customize-customized | 644 | @item M-x customize-unsaved |
| 645 | Set up a customization buffer containing all settings that you have | 645 | Set up a customization buffer containing all settings that you have |
| 646 | customized but not saved. | 646 | set but not saved. |
| 647 | @end table | 647 | @end table |
| 648 | 648 | ||
| 649 | @findex customize-option | 649 | @findex customize-option |
| @@ -687,11 +687,11 @@ whose definitions have been changed since the specified version, | |||
| 687 | loading them if necessary. | 687 | loading them if necessary. |
| 688 | 688 | ||
| 689 | @findex customize-saved | 689 | @findex customize-saved |
| 690 | @findex customize-customized | 690 | @findex customize-unsaved |
| 691 | If you change settings and then decide the change was a mistake, you | 691 | If you change settings and then decide the change was a mistake, you |
| 692 | can use two special commands to revisit your previous changes. Use | 692 | can use two special commands to revisit your previous changes. Use |
| 693 | @kbd{M-x customize-saved} to look at the settings that you have saved. | 693 | @kbd{M-x customize-saved} to look at the settings that you have saved. |
| 694 | Use @kbd{M-x customize-customized} to look at the settings that you | 694 | Use @kbd{M-x customize-unsaved} to look at the settings that you |
| 695 | have set but not saved. | 695 | have set but not saved. |
| 696 | 696 | ||
| 697 | @node Custom Themes | 697 | @node Custom Themes |
diff --git a/man/ebrowse.texi b/man/ebrowse.texi index 200b2fe6075..1f4943645c9 100644 --- a/man/ebrowse.texi +++ b/man/ebrowse.texi | |||
| @@ -1275,7 +1275,7 @@ they work in a C++ source buffer, not in member and tree buffers created | |||
| 1275 | by Ebrowse. | 1275 | by Ebrowse. |
| 1276 | 1276 | ||
| 1277 | @table @kbd | 1277 | @table @kbd |
| 1278 | @item C-c b f | 1278 | @item C-c C-m f |
| 1279 | Find the definition of the member around point. If you invoke this | 1279 | Find the definition of the member around point. If you invoke this |
| 1280 | function with a prefix argument, the declaration is searched. | 1280 | function with a prefix argument, the declaration is searched. |
| 1281 | 1281 | ||
| @@ -1284,37 +1284,37 @@ select the class with completion. If there is a scope declaration in | |||
| 1284 | front of the member name, this class name is used as initial input for | 1284 | front of the member name, this class name is used as initial input for |
| 1285 | the completion. | 1285 | the completion. |
| 1286 | 1286 | ||
| 1287 | @item C-c b F | 1287 | @item C-c C-m F |
| 1288 | Find the declaration of the member around point. | 1288 | Find the declaration of the member around point. |
| 1289 | 1289 | ||
| 1290 | @item C-c b v | 1290 | @item C-c C-m v |
| 1291 | View the definition of the member around point. | 1291 | View the definition of the member around point. |
| 1292 | 1292 | ||
| 1293 | @item C-c b V | 1293 | @item C-c C-m V |
| 1294 | View the declaration of the member around point. | 1294 | View the declaration of the member around point. |
| 1295 | 1295 | ||
| 1296 | @item C-c b 4 f | 1296 | @item C-c C-m 4 f |
| 1297 | Find a member's definition in another window. | 1297 | Find a member's definition in another window. |
| 1298 | 1298 | ||
| 1299 | @item C-c b 4 F | 1299 | @item C-c C-m 4 F |
| 1300 | Find a member's declaration in another window. | 1300 | Find a member's declaration in another window. |
| 1301 | 1301 | ||
| 1302 | @item C-c b 4 v | 1302 | @item C-c C-m 4 v |
| 1303 | View a member's definition in another window. | 1303 | View a member's definition in another window. |
| 1304 | 1304 | ||
| 1305 | @item C-c b 4 V | 1305 | @item C-c C-m 4 V |
| 1306 | View a member's declaration in another window. | 1306 | View a member's declaration in another window. |
| 1307 | 1307 | ||
| 1308 | @item C-c b 5 f | 1308 | @item C-c C-m 5 f |
| 1309 | Find a member's definition in another frame. | 1309 | Find a member's definition in another frame. |
| 1310 | 1310 | ||
| 1311 | @item C-c b 5 F | 1311 | @item C-c C-m 5 F |
| 1312 | Find a member's declaration in another frame. | 1312 | Find a member's declaration in another frame. |
| 1313 | 1313 | ||
| 1314 | @item C-c b 5 v | 1314 | @item C-c C-m 5 v |
| 1315 | View a member's definition in another frame. | 1315 | View a member's definition in another frame. |
| 1316 | 1316 | ||
| 1317 | @item C-c b 5 V | 1317 | @item C-c C-m 5 V |
| 1318 | View a member's declaration in another frame. | 1318 | View a member's declaration in another frame. |
| 1319 | @end table | 1319 | @end table |
| 1320 | 1320 | ||
| @@ -1333,7 +1333,7 @@ move to positions in the stack:@refill | |||
| 1333 | 1333 | ||
| 1334 | @table @kbd | 1334 | @table @kbd |
| 1335 | @cindex return to original position | 1335 | @cindex return to original position |
| 1336 | @item C-c b - | 1336 | @item C-c C-m - |
| 1337 | This command sets point to the previous position in the position stack. | 1337 | This command sets point to the previous position in the position stack. |
| 1338 | Directly after you performed a jump, this will put you back to the | 1338 | Directly after you performed a jump, this will put you back to the |
| 1339 | position where you came from. | 1339 | position where you came from. |
| @@ -1344,11 +1344,11 @@ infinite size there is a maximum number of positions defined. When this | |||
| 1344 | number is reached, older positions are discarded when new positions are | 1344 | number is reached, older positions are discarded when new positions are |
| 1345 | pushed on the stack. | 1345 | pushed on the stack. |
| 1346 | 1346 | ||
| 1347 | @item C-c b + | 1347 | @item C-c C-m + |
| 1348 | This command moves forward in the position stack, setting point to | 1348 | This command moves forward in the position stack, setting point to |
| 1349 | the next position stored in the position stack. | 1349 | the next position stored in the position stack. |
| 1350 | 1350 | ||
| 1351 | @item C-c b p | 1351 | @item C-c C-m p |
| 1352 | Displays an electric buffer showing all positions saved in the stack. | 1352 | Displays an electric buffer showing all positions saved in the stack. |
| 1353 | You can select a position by pressing @kbd{SPC} in a line. You can | 1353 | You can select a position by pressing @kbd{SPC} in a line. You can |
| 1354 | view a position with @kbd{v}. | 1354 | view a position with @kbd{v}. |
| @@ -1373,22 +1373,22 @@ mentioned in the marked classes only. Otherwise all files in the class | |||
| 1373 | tree are used. | 1373 | tree are used. |
| 1374 | 1374 | ||
| 1375 | @table @kbd | 1375 | @table @kbd |
| 1376 | @item C-c b s | 1376 | @item C-c C-m s |
| 1377 | This function performs a regular expression search in the chosen set of | 1377 | This function performs a regular expression search in the chosen set of |
| 1378 | files. | 1378 | files. |
| 1379 | 1379 | ||
| 1380 | @item C-c b u | 1380 | @item C-c C-m u |
| 1381 | This command performs a search for calls of a given member which is | 1381 | This command performs a search for calls of a given member which is |
| 1382 | selected in the usual way with completion. | 1382 | selected in the usual way with completion. |
| 1383 | 1383 | ||
| 1384 | @item C-c b % | 1384 | @item C-c C-m % |
| 1385 | Perform a query replace over the set of files. | 1385 | Perform a query replace over the set of files. |
| 1386 | 1386 | ||
| 1387 | @item C-c b , | 1387 | @item C-c C-m , |
| 1388 | All three operations above stop when finding a match. You can restart | 1388 | All three operations above stop when finding a match. You can restart |
| 1389 | the operation with this command. | 1389 | the operation with this command. |
| 1390 | 1390 | ||
| 1391 | @item C-c b n | 1391 | @item C-c C-m n |
| 1392 | This restarts the last tags operation with the next file in the list. | 1392 | This restarts the last tags operation with the next file in the list. |
| 1393 | @end table | 1393 | @end table |
| 1394 | 1394 | ||
| @@ -1403,7 +1403,7 @@ This restarts the last tags operation with the next file in the list. | |||
| 1403 | @cindex list class members in a file | 1403 | @cindex list class members in a file |
| 1404 | @cindex file, members | 1404 | @cindex file, members |
| 1405 | 1405 | ||
| 1406 | The command @kbd{C-c b l}, lists all members in a given file. The file | 1406 | The command @kbd{C-c C-m l}, lists all members in a given file. The file |
| 1407 | name is read from the minibuffer with completion. | 1407 | name is read from the minibuffer with completion. |
| 1408 | 1408 | ||
| 1409 | 1409 | ||
| @@ -1415,14 +1415,14 @@ name is read from the minibuffer with completion. | |||
| 1415 | @cindex apropos on class members | 1415 | @cindex apropos on class members |
| 1416 | @cindex members, matching regexp | 1416 | @cindex members, matching regexp |
| 1417 | 1417 | ||
| 1418 | The command @kbd{C-c b a} can be used to display all members matching a | 1418 | The command @kbd{C-c C-m a} can be used to display all members matching a |
| 1419 | given regular expression. This command can be very useful if you | 1419 | given regular expression. This command can be very useful if you |
| 1420 | remember only part of a member name, and not its beginning. | 1420 | remember only part of a member name, and not its beginning. |
| 1421 | 1421 | ||
| 1422 | A special buffer is popped up containing all identifiers matching the | 1422 | A special buffer is popped up containing all identifiers matching the |
| 1423 | regular expression, and what kind of symbol it is (e.g.@: a member | 1423 | regular expression, and what kind of symbol it is (e.g.@: a member |
| 1424 | function, or a type). You can then switch to this buffer, and use the | 1424 | function, or a type). You can then switch to this buffer, and use the |
| 1425 | command @kbd{C-c b f}, for example, to jump to a specific member. | 1425 | command @kbd{C-c C-m f}, for example, to jump to a specific member. |
| 1426 | 1426 | ||
| 1427 | 1427 | ||
| 1428 | 1428 | ||
| @@ -1433,7 +1433,7 @@ command @kbd{C-c b f}, for example, to jump to a specific member. | |||
| 1433 | @cindex completion | 1433 | @cindex completion |
| 1434 | @cindex symbol completion | 1434 | @cindex symbol completion |
| 1435 | 1435 | ||
| 1436 | The command @kbd{C-c b @key{TAB}} completes the symbol in front of point. | 1436 | The command @kbd{C-c C-m @key{TAB}} completes the symbol in front of point. |
| 1437 | 1437 | ||
| 1438 | 1438 | ||
| 1439 | 1439 | ||
| @@ -1443,7 +1443,7 @@ The command @kbd{C-c b @key{TAB}} completes the symbol in front of point. | |||
| 1443 | @cindex member buffer, for member at point | 1443 | @cindex member buffer, for member at point |
| 1444 | 1444 | ||
| 1445 | You can quickly display a member buffer containing the member the cursor | 1445 | You can quickly display a member buffer containing the member the cursor |
| 1446 | in on with the command @kbd{C-c b m}. | 1446 | in on with the command @kbd{C-c C-m m}. |
| 1447 | 1447 | ||
| 1448 | 1448 | ||
| 1449 | @node Concept Index, , Tags-like Functions, Top | 1449 | @node Concept Index, , Tags-like Functions, Top |
diff --git a/man/entering.texi b/man/entering.texi index dca85d44812..3be5e6a19dd 100644 --- a/man/entering.texi +++ b/man/entering.texi | |||
| @@ -39,12 +39,15 @@ file, you exit the editor. The next time you want to edit a file, you | |||
| 39 | must start the editor again. Working this way, it is convenient to | 39 | must start the editor again. Working this way, it is convenient to |
| 40 | use a command-line argument to say which file to edit. | 40 | use a command-line argument to say which file to edit. |
| 41 | 41 | ||
| 42 | It's not smart to start Emacs afresh for every file you edit. Emacs | 42 | However, killing Emacs after editing one each and starting it afresh |
| 43 | can visit more than one file in a single editing session, and upon | 43 | for the next file is both unnecessary and harmful, since it denies you |
| 44 | exit Emacs loses valuable accumulated context, such as the kill ring, | 44 | the full power of Emacs. Emacs can visit more than one file in a |
| 45 | registers, undo history, and mark ring. These features are useful for | 45 | single editing session, and that is the right way to use it. Exiting |
| 46 | operating on multiple files, or even one. If you kill Emacs after | 46 | the Emacs session loses valuable accumulated context, such as the kill |
| 47 | each file, you don't take advantage of them. | 47 | ring, registers, undo history, and mark ring. These features are |
| 48 | useful for operating on multiple files, or even continuing to edit one | ||
| 49 | file. If you kill Emacs after each file, you don't take advantage of | ||
| 50 | them. | ||
| 48 | 51 | ||
| 49 | The recommended way to use GNU Emacs is to start it only once, just | 52 | The recommended way to use GNU Emacs is to start it only once, just |
| 50 | after you log in, and do all your editing in the same Emacs session. | 53 | after you log in, and do all your editing in the same Emacs session. |
diff --git a/man/erc.texi b/man/erc.texi index d8ae4157a47..da18618ecda 100644 --- a/man/erc.texi +++ b/man/erc.texi | |||
| @@ -274,6 +274,11 @@ itself. An example follows. | |||
| 274 | Once ERC is loaded, the command @kbd{M-x erc} will start ERC and | 274 | Once ERC is loaded, the command @kbd{M-x erc} will start ERC and |
| 275 | prompt for the server to connect to. | 275 | prompt for the server to connect to. |
| 276 | 276 | ||
| 277 | If the connection goes away at some point, ERC will try to reconnect | ||
| 278 | automatically. If it fails to reconnect, and you want to try to | ||
| 279 | manually reestablish the connection at some later point, switch to an | ||
| 280 | ERC buffer and run the /RECONNECT command. | ||
| 281 | |||
| 277 | @c PRE5_2: Sample session, including: | 282 | @c PRE5_2: Sample session, including: |
| 278 | @c - connect to Freenode | 283 | @c - connect to Freenode |
| 279 | @c - /join #emacs | 284 | @c - /join #emacs |
diff --git a/man/gnus.texi b/man/gnus.texi index ea959671c06..b7e453e83cf 100644 --- a/man/gnus.texi +++ b/man/gnus.texi | |||
| @@ -11217,72 +11217,100 @@ variable, which is a list of regular expressions that are matched to the | |||
| 11217 | type of the part. This variable is ignored if the value of the | 11217 | type of the part. This variable is ignored if the value of the |
| 11218 | controlling variable is a predicate list, as described above. | 11218 | controlling variable is a predicate list, as described above. |
| 11219 | 11219 | ||
| 11220 | @ifinfo | ||
| 11221 | @c Avoid sort of redundant entries in the same section for the printed | ||
| 11222 | @c manual, but add them in info to allow `i gnus-treat-foo-bar RET' or | ||
| 11223 | @c `i foo-bar'. | ||
| 11224 | @vindex gnus-treat-buttonize | ||
| 11225 | @vindex gnus-treat-buttonize-head | ||
| 11226 | @vindex gnus-treat-capitalize-sentences | ||
| 11227 | @vindex gnus-treat-overstrike | ||
| 11228 | @vindex gnus-treat-strip-cr | ||
| 11229 | @vindex gnus-treat-strip-headers-in-body | ||
| 11230 | @vindex gnus-treat-strip-leading-blank-lines | ||
| 11231 | @vindex gnus-treat-strip-multiple-blank-lines | ||
| 11232 | @vindex gnus-treat-strip-pem | ||
| 11233 | @vindex gnus-treat-strip-trailing-blank-lines | ||
| 11234 | @vindex gnus-treat-unsplit-urls | ||
| 11235 | @vindex gnus-treat-wash-html | ||
| 11236 | @vindex gnus-treat-date-english | ||
| 11237 | @vindex gnus-treat-date-iso8601 | ||
| 11238 | @vindex gnus-treat-date-lapsed | ||
| 11239 | @vindex gnus-treat-date-local | ||
| 11240 | @vindex gnus-treat-date-original | ||
| 11241 | @vindex gnus-treat-date-user-defined | ||
| 11242 | @vindex gnus-treat-date-ut | ||
| 11243 | @vindex gnus-treat-from-picon | ||
| 11244 | @vindex gnus-treat-mail-picon | ||
| 11245 | @vindex gnus-treat-newsgroups-picon | ||
| 11246 | @vindex gnus-treat-display-smileys | ||
| 11247 | @vindex gnus-treat-body-boundary | ||
| 11248 | @vindex gnus-treat-display-x-face | ||
| 11249 | @vindex gnus-treat-display-face | ||
| 11250 | @vindex gnus-treat-emphasize | ||
| 11251 | @vindex gnus-treat-fill-article | ||
| 11252 | @vindex gnus-treat-fill-long-lines | ||
| 11253 | @vindex gnus-treat-hide-boring-headers | ||
| 11254 | @vindex gnus-treat-hide-citation | ||
| 11255 | @vindex gnus-treat-hide-citation-maybe | ||
| 11256 | @vindex gnus-treat-hide-headers | ||
| 11257 | @vindex gnus-treat-hide-signature | ||
| 11258 | @vindex gnus-treat-strip-banner | ||
| 11259 | @vindex gnus-treat-strip-list-identifiers | ||
| 11260 | @vindex gnus-treat-highlight-citation | ||
| 11261 | @vindex gnus-treat-highlight-headers | ||
| 11262 | @vindex gnus-treat-highlight-signature | ||
| 11263 | @vindex gnus-treat-play-sounds | ||
| 11264 | @vindex gnus-treat-translate | ||
| 11265 | @vindex gnus-treat-x-pgp-sig | ||
| 11266 | @vindex gnus-treat-unfold-headers | ||
| 11267 | @vindex gnus-treat-fold-headers | ||
| 11268 | @vindex gnus-treat-fold-newsgroups | ||
| 11269 | @vindex gnus-treat-leading-whitespace | ||
| 11270 | @end ifinfo | ||
| 11271 | |||
| 11220 | The following treatment options are available. The easiest way to | 11272 | The following treatment options are available. The easiest way to |
| 11221 | customize this is to examine the @code{gnus-article-treat} customization | 11273 | customize this is to examine the @code{gnus-article-treat} customization |
| 11222 | group. Values in parenthesis are suggested sensible values. Others are | 11274 | group. Values in parenthesis are suggested sensible values. Others are |
| 11223 | possible but those listed are probably sufficient for most people. | 11275 | possible but those listed are probably sufficient for most people. |
| 11224 | 11276 | ||
| 11225 | @table @code | 11277 | @table @code |
| 11226 | @vindex gnus-treat-buttonize | ||
| 11227 | @item gnus-treat-buttonize (t, integer) | 11278 | @item gnus-treat-buttonize (t, integer) |
| 11228 | @vindex gnus-treat-buttonize-head | ||
| 11229 | @item gnus-treat-buttonize-head (head) | 11279 | @item gnus-treat-buttonize-head (head) |
| 11230 | 11280 | ||
| 11231 | @xref{Article Buttons}. | 11281 | @xref{Article Buttons}. |
| 11232 | 11282 | ||
| 11233 | @vindex gnus-treat-capitalize-sentences | ||
| 11234 | @item gnus-treat-capitalize-sentences (t, integer) | 11283 | @item gnus-treat-capitalize-sentences (t, integer) |
| 11235 | @vindex gnus-treat-overstrike | ||
| 11236 | @item gnus-treat-overstrike (t, integer) | 11284 | @item gnus-treat-overstrike (t, integer) |
| 11237 | @vindex gnus-treat-strip-cr | ||
| 11238 | @item gnus-treat-strip-cr (t, integer) | 11285 | @item gnus-treat-strip-cr (t, integer) |
| 11239 | @vindex gnus-treat-strip-headers-in-body | ||
| 11240 | @item gnus-treat-strip-headers-in-body (t, integer) | 11286 | @item gnus-treat-strip-headers-in-body (t, integer) |
| 11241 | @vindex gnus-treat-strip-leading-blank-lines | ||
| 11242 | @item gnus-treat-strip-leading-blank-lines (t, integer) | 11287 | @item gnus-treat-strip-leading-blank-lines (t, integer) |
| 11243 | @vindex gnus-treat-strip-multiple-blank-lines | ||
| 11244 | @item gnus-treat-strip-multiple-blank-lines (t, integer) | 11288 | @item gnus-treat-strip-multiple-blank-lines (t, integer) |
| 11245 | @vindex gnus-treat-strip-pem | ||
| 11246 | @item gnus-treat-strip-pem (t, last, integer) | 11289 | @item gnus-treat-strip-pem (t, last, integer) |
| 11247 | @vindex gnus-treat-strip-trailing-blank-lines | ||
| 11248 | @item gnus-treat-strip-trailing-blank-lines (t, last, integer) | 11290 | @item gnus-treat-strip-trailing-blank-lines (t, last, integer) |
| 11249 | @vindex gnus-treat-unsplit-urls | ||
| 11250 | @item gnus-treat-unsplit-urls (t, integer) | 11291 | @item gnus-treat-unsplit-urls (t, integer) |
| 11251 | @vindex gnus-treat-wash-html | ||
| 11252 | @item gnus-treat-wash-html (t, integer) | 11292 | @item gnus-treat-wash-html (t, integer) |
| 11253 | 11293 | ||
| 11254 | @xref{Article Washing}. | 11294 | @xref{Article Washing}. |
| 11255 | 11295 | ||
| 11256 | @vindex gnus-treat-date-english | ||
| 11257 | @item gnus-treat-date-english (head) | 11296 | @item gnus-treat-date-english (head) |
| 11258 | @vindex gnus-treat-date-iso8601 | ||
| 11259 | @item gnus-treat-date-iso8601 (head) | 11297 | @item gnus-treat-date-iso8601 (head) |
| 11260 | @vindex gnus-treat-date-lapsed | ||
| 11261 | @item gnus-treat-date-lapsed (head) | 11298 | @item gnus-treat-date-lapsed (head) |
| 11262 | @vindex gnus-treat-date-local | ||
| 11263 | @item gnus-treat-date-local (head) | 11299 | @item gnus-treat-date-local (head) |
| 11264 | @vindex gnus-treat-date-original | ||
| 11265 | @item gnus-treat-date-original (head) | 11300 | @item gnus-treat-date-original (head) |
| 11266 | @vindex gnus-treat-date-user-defined | ||
| 11267 | @item gnus-treat-date-user-defined (head) | 11301 | @item gnus-treat-date-user-defined (head) |
| 11268 | @vindex gnus-treat-date-ut | ||
| 11269 | @item gnus-treat-date-ut (head) | 11302 | @item gnus-treat-date-ut (head) |
| 11270 | 11303 | ||
| 11271 | @xref{Article Date}. | 11304 | @xref{Article Date}. |
| 11272 | 11305 | ||
| 11273 | @vindex gnus-treat-from-picon | ||
| 11274 | @item gnus-treat-from-picon (head) | 11306 | @item gnus-treat-from-picon (head) |
| 11275 | @vindex gnus-treat-mail-picon | ||
| 11276 | @item gnus-treat-mail-picon (head) | 11307 | @item gnus-treat-mail-picon (head) |
| 11277 | @vindex gnus-treat-newsgroups-picon | ||
| 11278 | @item gnus-treat-newsgroups-picon (head) | 11308 | @item gnus-treat-newsgroups-picon (head) |
| 11279 | 11309 | ||
| 11280 | @xref{Picons}. | 11310 | @xref{Picons}. |
| 11281 | 11311 | ||
| 11282 | @vindex gnus-treat-display-smileys | ||
| 11283 | @item gnus-treat-display-smileys (t, integer) | 11312 | @item gnus-treat-display-smileys (t, integer) |
| 11284 | 11313 | ||
| 11285 | @vindex gnus-treat-body-boundary | ||
| 11286 | @item gnus-treat-body-boundary (head) | 11314 | @item gnus-treat-body-boundary (head) |
| 11287 | 11315 | ||
| 11288 | @vindex gnus-body-boundary-delimiter | 11316 | @vindex gnus-body-boundary-delimiter |
diff --git a/man/message.texi b/man/message.texi index 023a7e8cd4a..86137c84d56 100644 --- a/man/message.texi +++ b/man/message.texi | |||
| @@ -889,11 +889,21 @@ Libidn} installed in order to use this functionality. | |||
| 889 | Using the @acronym{MML} language, Message is able to create digitally | 889 | Using the @acronym{MML} language, Message is able to create digitally |
| 890 | signed and digitally encrypted messages. Message (or rather | 890 | signed and digitally encrypted messages. Message (or rather |
| 891 | @acronym{MML}) currently support @acronym{PGP} (RFC 1991), | 891 | @acronym{MML}) currently support @acronym{PGP} (RFC 1991), |
| 892 | @acronym{PGP/MIME} (RFC 2015/3156) and @acronym{S/MIME}. Instructing | 892 | @acronym{PGP/MIME} (RFC 2015/3156) and @acronym{S/MIME}. |
| 893 | @acronym{MML} to perform security operations on a @acronym{MIME} part is | ||
| 894 | done using the @kbd{C-c C-m s} key map for signing and the @kbd{C-c C-m | ||
| 895 | c} key map for encryption, as follows. | ||
| 896 | 893 | ||
| 894 | @menu | ||
| 895 | * Signing and encryption:: Signing and encrypting commands. | ||
| 896 | * Using S/MIME:: Using S/MIME | ||
| 897 | * Using PGP/MIME:: Using PGP/MIME | ||
| 898 | * PGP Compatibility:: Compatibility with older implementations | ||
| 899 | @end menu | ||
| 900 | |||
| 901 | @node Signing and encryption | ||
| 902 | @subsection Signing and encrypting commands | ||
| 903 | |||
| 904 | Instructing @acronym{MML} to perform security operations on a | ||
| 905 | @acronym{MIME} part is done using the @kbd{C-c C-m s} key map for | ||
| 906 | signing and the @kbd{C-c C-m c} key map for encryption, as follows. | ||
| 897 | @table @kbd | 907 | @table @kbd |
| 898 | 908 | ||
| 899 | @item C-c C-m s s | 909 | @item C-c C-m s s |
| @@ -976,6 +986,7 @@ least not compared with making sure all involved programs talk with each | |||
| 976 | other properly. Thus, we now describe what external libraries or | 986 | other properly. Thus, we now describe what external libraries or |
| 977 | programs are required to make things work, and some small general hints. | 987 | programs are required to make things work, and some small general hints. |
| 978 | 988 | ||
| 989 | @node Using S/MIME | ||
| 979 | @subsection Using S/MIME | 990 | @subsection Using S/MIME |
| 980 | 991 | ||
| 981 | @emph{Note!} This section assume you have a basic familiarity with | 992 | @emph{Note!} This section assume you have a basic familiarity with |
| @@ -1038,6 +1049,7 @@ you use unencrypted keys (e.g., if they are on a secure storage, or if | |||
| 1038 | you are on a secure single user machine) simply press @code{RET} at | 1049 | you are on a secure single user machine) simply press @code{RET} at |
| 1039 | the passphrase prompt. | 1050 | the passphrase prompt. |
| 1040 | 1051 | ||
| 1052 | @node Using PGP/MIME | ||
| 1041 | @subsection Using PGP/MIME | 1053 | @subsection Using PGP/MIME |
| 1042 | 1054 | ||
| 1043 | @acronym{PGP/MIME} requires an external OpenPGP implementation, such | 1055 | @acronym{PGP/MIME} requires an external OpenPGP implementation, such |
| @@ -1045,7 +1057,48 @@ as @uref{http://www.gnupg.org/, GNU Privacy Guard}. Pre-OpenPGP | |||
| 1045 | implementations such as PGP 2.x and PGP 5.x are also supported. One | 1057 | implementations such as PGP 2.x and PGP 5.x are also supported. One |
| 1046 | Emacs interface to the PGP implementations, PGG (@pxref{Top, ,PGG, | 1058 | Emacs interface to the PGP implementations, PGG (@pxref{Top, ,PGG, |
| 1047 | pgg, PGG Manual}), is included, but Mailcrypt and Florian Weimer's | 1059 | pgg, PGG Manual}), is included, but Mailcrypt and Florian Weimer's |
| 1048 | @code{gpg.el} are also supported. | 1060 | @code{gpg.el} are also supported. @xref{PGP Compatibility}. |
| 1061 | |||
| 1062 | @cindex gpg-agent | ||
| 1063 | Message internally calls GnuPG (the @command{gpg} command) to perform | ||
| 1064 | data encryption, and in certain cases (decrypting or signing for | ||
| 1065 | example), @command{gpg} requires user's passphrase. Currently the | ||
| 1066 | recommended way to supply your passphrase to @command{gpg} is to use the | ||
| 1067 | @command{gpg-agent} program. | ||
| 1068 | |||
| 1069 | To use @command{gpg-agent} in Emacs, you need to run the following | ||
| 1070 | command from the shell before starting Emacs. | ||
| 1071 | |||
| 1072 | @example | ||
| 1073 | eval `gpg-agent --daemon` | ||
| 1074 | @end example | ||
| 1075 | |||
| 1076 | This will invoke @command{gpg-agent} and set the environment variable | ||
| 1077 | @code{GPG_AGENT_INFO} to allow @command{gpg} to communicate with it. | ||
| 1078 | It might be good idea to put this command in your @file{.xsession} or | ||
| 1079 | @file{.bash_profile}. @xref{Invoking GPG-AGENT, , , gnupg, Using the | ||
| 1080 | GNU Privacy Guard}. | ||
| 1081 | |||
| 1082 | Once your @command{gpg-agent} is set up, it will ask you for a | ||
| 1083 | passphrase as needed for @command{gpg}. Under the X Window System, | ||
| 1084 | you will see a new passphrase input dialog appear. The dialog is | ||
| 1085 | provided by PIN Entry (the @command{pinentry} command), and as of | ||
| 1086 | version 0.7.2, @command{pinentry} cannot cooperate with Emacs on a | ||
| 1087 | single tty. So, if you are using a text console, you may need to put | ||
| 1088 | a passphrase into gpg-agent's cache beforehand. The following command | ||
| 1089 | does the trick. | ||
| 1090 | |||
| 1091 | @example | ||
| 1092 | gpg --use-agent --sign < /dev/null > /dev/null | ||
| 1093 | @end example | ||
| 1094 | |||
| 1095 | The Lisp variable @code{pgg-gpg-use-agent} controls whether to use | ||
| 1096 | @command{gpg-agent}. See also @xref{Caching passphrase, , , pgg, The | ||
| 1097 | PGG Manual}. | ||
| 1098 | |||
| 1099 | |||
| 1100 | @node PGP Compatibility | ||
| 1101 | @subsection Compatibility with older implementations | ||
| 1049 | 1102 | ||
| 1050 | @vindex gpg-temp-directory | 1103 | @vindex gpg-temp-directory |
| 1051 | Note, if you are using the @code{gpg.el} you must make sure that the | 1104 | Note, if you are using the @code{gpg.el} you must make sure that the |
diff --git a/man/misc.texi b/man/misc.texi index 72ddd96534a..76e2693cded 100644 --- a/man/misc.texi +++ b/man/misc.texi | |||
| @@ -983,8 +983,8 @@ to the bottom before inserting. The default is @code{nil}. | |||
| 983 | 983 | ||
| 984 | @vindex comint-scroll-show-maximum-output | 984 | @vindex comint-scroll-show-maximum-output |
| 985 | If @code{comint-scroll-show-maximum-output} is non-@code{nil}, then | 985 | If @code{comint-scroll-show-maximum-output} is non-@code{nil}, then |
| 986 | arrival of output when point is at the end tries to place the last line of | 986 | arrival of output when point is at the end tries to scroll the last |
| 987 | text at the bottom line of the window, so as to show as much useful | 987 | line of text to the bottom line of the window, showing as much useful |
| 988 | text as possible. (This mimics the scrolling behavior of most | 988 | text as possible. (This mimics the scrolling behavior of most |
| 989 | terminals.) The default is @code{t}. | 989 | terminals.) The default is @code{t}. |
| 990 | 990 | ||
diff --git a/man/msdog.texi b/man/msdog.texi index 69126dca207..8aecd513591 100644 --- a/man/msdog.texi +++ b/man/msdog.texi | |||
| @@ -334,11 +334,14 @@ directory, whereas @file{.emacs} does not. | |||
| 334 | keyboard input in Emacs. | 334 | keyboard input in Emacs. |
| 335 | 335 | ||
| 336 | @cindex MS-Windows keyboard shortcuts | 336 | @cindex MS-Windows keyboard shortcuts |
| 337 | Many key combinations (known as ``keyboard shortcuts'') that are in | 337 | Many key combinations (known as ``keyboard shortcuts'') that have |
| 338 | widespread use in MS-Windows programs are taken by various Emacs | 338 | conventional uses in MS-Windows programs conflict with traditional |
| 339 | features. Examples include @kbd{C-C}, @kbd{C-X}, @kbd{C-Z}, | 339 | Emacs commands. This conflict arose because the designers of the CUA |
| 340 | @kbd{C-A}, and @kbd{W-SPC}. You can get some of them back by turning | 340 | interface implemented by MS-Windows did not try to avoid conflict with |
| 341 | on CUA Mode (@pxref{CUA Bindings}). | 341 | Emacs. Examples of conflicts include @kbd{C-c}, @kbd{C-x}, @kbd{C-z}, |
| 342 | @kbd{C-a}, and @kbd{W-@key{SPC}}. You can redefine some of them with | ||
| 343 | meanings more like the MS-Windows meanings by enabling CUA Mode | ||
| 344 | (@pxref{CUA Bindings}). | ||
| 342 | 345 | ||
| 343 | @kindex F10 @r{(MS-Windows)} | 346 | @kindex F10 @r{(MS-Windows)} |
| 344 | @cindex menu bar access using keyboard @r{(MS-Windows)} | 347 | @cindex menu bar access using keyboard @r{(MS-Windows)} |
diff --git a/man/programs.texi b/man/programs.texi index 200c787cf08..1aa8a65be0a 100644 --- a/man/programs.texi +++ b/man/programs.texi | |||
| @@ -1330,9 +1330,12 @@ symbol names. | |||
| 1330 | The character @kbd{M-@key{TAB}} runs a command to complete the | 1330 | The character @kbd{M-@key{TAB}} runs a command to complete the |
| 1331 | partial symbol before point against the set of meaningful symbol | 1331 | partial symbol before point against the set of meaningful symbol |
| 1332 | names. This command inserts at point any additional characters that | 1332 | names. This command inserts at point any additional characters that |
| 1333 | it can determine from the partial name. (If your window manager | 1333 | it can determine from the partial name. |
| 1334 | defines @kbd{M-@key{TAB}} to switch windows, you can type | 1334 | |
| 1335 | @kbd{@key{ESC} @key{TAB}} or @kbd{C-M-i}.) | 1335 | If your window manager defines @kbd{M-@key{TAB}} to switch windows, |
| 1336 | you can type @kbd{@key{ESC} @key{TAB}} or @kbd{C-M-i} instead. | ||
| 1337 | However, most window managers let you customize these shortcuts, and | ||
| 1338 | we recommend that you change any that get in the way of use of Emacs. | ||
| 1336 | 1339 | ||
| 1337 | If the partial name in the buffer has multiple possible completions | 1340 | If the partial name in the buffer has multiple possible completions |
| 1338 | that differ in the very next character, so that it is impossible to | 1341 | that differ in the very next character, so that it is impossible to |
diff --git a/man/xresources.texi b/man/xresources.texi index 142b1bc70a0..941b61f9b85 100644 --- a/man/xresources.texi +++ b/man/xresources.texi | |||
| @@ -62,7 +62,7 @@ collection of related options, for one program or for several programs | |||
| 62 | Emacs compiled for Windows looks for X resources in the Windows | 62 | Emacs compiled for Windows looks for X resources in the Windows |
| 63 | Registry, under the key @samp{HKEY_CURRENT_USER\SOFTWARE\GNU\Emacs} | 63 | Registry, under the key @samp{HKEY_CURRENT_USER\SOFTWARE\GNU\Emacs} |
| 64 | and then under the key @samp{HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Emacs}. | 64 | and then under the key @samp{HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Emacs}. |
| 65 | The menu and scrollbars are native widgets on MS-Windows, so they are | 65 | The menu and scroll bars are native widgets on MS-Windows, so they are |
| 66 | only customizable via the system-wide settings in the Display Control | 66 | only customizable via the system-wide settings in the Display Control |
| 67 | Panel. You can also set resources using the @samp{-xrm} command line | 67 | Panel. You can also set resources using the @samp{-xrm} command line |
| 68 | option (see below.) | 68 | option (see below.) |
| @@ -294,6 +294,11 @@ specified if @samp{off}. | |||
| 294 | Gamma correction for colors, equivalent to the frame parameter | 294 | Gamma correction for colors, equivalent to the frame parameter |
| 295 | @code{screen-gamma}. | 295 | @code{screen-gamma}. |
| 296 | 296 | ||
| 297 | @item @code{scrollBarWidth} (class @code{ScrollBarWidth}) | ||
| 298 | @cindex scrollbar width | ||
| 299 | The scroll bar width in pixels, equivalent to the frame parameter | ||
| 300 | @code{scroll-bar-width}. | ||
| 301 | |||
| 297 | @ifnottex | 302 | @ifnottex |
| 298 | @item @code{selectionFont} (class @code{SelectionFont}) | 303 | @item @code{selectionFont} (class @code{SelectionFont}) |
| 299 | Font name for pop-up menu items, in non-toolkit versions of Emacs. (For | 304 | Font name for pop-up menu items, in non-toolkit versions of Emacs. (For |
diff --git a/oldXMenu/insque.c b/oldXMenu/insque.c index a9d5c5b456d..2ee8556cdb6 100644 --- a/oldXMenu/insque.c +++ b/oldXMenu/insque.c | |||
| @@ -1,8 +1,23 @@ | |||
| 1 | /* Copyright (C) 2001, 2002, 2003, 2004, 2005, | 1 | /* Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 2001, 2002, 2003, |
| 2 | 2006 Free Software Foundation, Inc. */ | 2 | 2004, 2005, 2006 Free Software Foundation, Inc. |
| 3 | |||
| 4 | This program is free software; you can redistribute it and/or modify | ||
| 5 | it under the terms of the GNU General Public License as published by | ||
| 6 | the Free Software Foundation; either version 2, or (at your option) | ||
| 7 | any later version. | ||
| 8 | |||
| 9 | This program is distributed in the hope that it will be useful, | ||
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | GNU General Public License for more details. | ||
| 13 | |||
| 14 | You should have received a copy of the GNU General Public License | ||
| 15 | along with this program; see the file COPYING. If not, write to | ||
| 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
| 17 | Boston, MA 02110-1301, USA. */ | ||
| 3 | 18 | ||
| 4 | /* This file implements the emacs_insque and emacs_remque functions, | 19 | /* This file implements the emacs_insque and emacs_remque functions, |
| 5 | copies of the insque and remque functions of BSD. They and all | 20 | clones of the insque and remque functions of BSD. They and all |
| 6 | their callers have been renamed to emacs_mumble to allow us to | 21 | their callers have been renamed to emacs_mumble to allow us to |
| 7 | include this file in the menu library on all systems. */ | 22 | include this file in the menu library on all systems. */ |
| 8 | 23 | ||
diff --git a/src/ChangeLog b/src/ChangeLog index 3dc5a094d4a..97c9d4cbeb9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,76 @@ | |||
| 1 | 2007-01-05 Kim F. Storm <storm@cua.dk> | ||
| 2 | |||
| 3 | * indent.c (Fvertical_motion): Fix it overshoot check for overlay | ||
| 4 | strings without embedded newlines immediately followed by newline. | ||
| 5 | |||
| 6 | 2007-01-05 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 7 | |||
| 8 | * editfns.c (Fformat_time_string, Fdecode_time, Fencode_time) | ||
| 9 | (Fcurrent_time_string, Fcurrent_time_zone): Add BLOCK_INPUT around | ||
| 10 | gmtime/localtime/emacs_memftimeu/mktime. | ||
| 11 | |||
| 12 | * mac.c (Fmac_set_file_creator): Use MAC_EMACS_CREATOR_CODE | ||
| 13 | instead of 'EMAx'. | ||
| 14 | [!MAC_OSX] (sys_open, sys_creat, sys_fopen): Likewise. | ||
| 15 | |||
| 16 | * macgui.h (struct _XGC) [USE_CG_DRAWING | ||
| 17 | && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: New members cg_fore_color | ||
| 18 | and cg_back_color. | ||
| 19 | |||
| 20 | * macmenu.c (Vshow_help_function) [TARGET_API_MAC_CARBON]: Add extern. | ||
| 21 | (restore_show_help_function, menu_target_item_handler) | ||
| 22 | [TARGET_API_MAC_CARBON]: New functions. | ||
| 23 | (install_menu_target_item_handler): New function. | ||
| 24 | (add_menu_item) [TARGET_API_MAC_CARBON]: Set help string as menu | ||
| 25 | item property. | ||
| 26 | |||
| 27 | * macterm.c (CG_SET_FILL_COLOR_MAYBE_WITH_CGCOLOR) | ||
| 28 | (CG_SET_FILL_COLOR_WITH_GC_FOREGROUND) | ||
| 29 | (CG_SET_FILL_COLOR_WITH_GC_BACKGROUND) | ||
| 30 | (CG_SET_STROKE_COLOR_MAYBE_WITH_CGCOLOR) | ||
| 31 | (CG_SET_STROKE_COLOR_WITH_GC_FOREGROUND): New macros. | ||
| 32 | (mac_cg_color_space_rgb) [USE_CG_DRAWING]: New variable. | ||
| 33 | (mac_cg_color_black) [USE_CG_DRAWING | ||
| 34 | && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: New variable. | ||
| 35 | (init_cg_color) [USE_CG_DRAWING]: New function. | ||
| 36 | (mac_draw_line, mac_draw_rectangle) [USE_CG_DRAWING]: Use | ||
| 37 | CG_SET_STROKE_COLOR_WITH_GC_FOREGROUND instead of CG_SET_STROKE_COLOR. | ||
| 38 | (mac_erase_rectangle, mac_clear_window, mac_draw_cg_image) | ||
| 39 | (mac_fill_rectangle, mac_draw_image_string_cg) [USE_CG_DRAWING]: | ||
| 40 | Use CG_SET_FILL_COLOR_WITH_GC_FOREGROUND or | ||
| 41 | CG_SET_FILL_COLOR_WITH_GC_BACKGROUND instead of CG_SET_FILL_COLOR. | ||
| 42 | (mac_draw_string_common) [MAC_OSX && USE_ATSUI]: Likewise. | ||
| 43 | (XCreateGC, XFreeGC, XSetForeground, XSetBackground) [USE_CG_DRAWING | ||
| 44 | && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: Use gc->cg_fore_color and/or | ||
| 45 | gc->cg_back_color. | ||
| 46 | (install_drag_handler, remove_drag_handler): Make extern. | ||
| 47 | (install_menu_target_item_handler): Add extern. | ||
| 48 | (install_window_handler): Call install_menu_target_item_handler. | ||
| 49 | [MAC_OS8] (main): Use MAC_EMACS_CREATOR_CODE instead of 'EMAx'. | ||
| 50 | (mac_initialize) [USE_CG_DRAWING]: Call init_cg_color. | ||
| 51 | |||
| 52 | * macterm.h (MAC_EMACS_CREATOR_CODE): New enumerator. | ||
| 53 | |||
| 54 | 2007-01-04 Juanma Barranquero <lekktu@gmail.com> | ||
| 55 | |||
| 56 | * window.c (Fwindow_end): Fix use of >= operator. | ||
| 57 | |||
| 58 | 2007-01-03 Richard Stallman <rms@gnu.org> | ||
| 59 | |||
| 60 | * window.c (Fwindow_end): Check BUF_OVERLAY_MODIFF like BUF_MODIFF. | ||
| 61 | |||
| 62 | 2007-01-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 63 | |||
| 64 | * gtkutil.h (xg_menu_item_cb_data_): Remove highlight_id and | ||
| 65 | unhighlight_id. | ||
| 66 | |||
| 67 | * gtkutil.c (menuitem_highlight_callback): Invoked widget is the | ||
| 68 | parent of the menu item. Get menu item widget from event. | ||
| 69 | (xg_create_one_menuitem, xg_update_menu_item): highlight_id and | ||
| 70 | unhighlight_id has been removed. | ||
| 71 | (create_menus): Connect enter/leave-notify-event to the menu instead | ||
| 72 | of individual items. | ||
| 73 | |||
| 1 | 2006-12-31 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | 74 | 2006-12-31 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> |
| 2 | 75 | ||
| 3 | * gtkutil.c (update_frame_tool_bar): Connect create-menu-proxy with | 76 | * gtkutil.c (update_frame_tool_bar): Connect create-menu-proxy with |
diff --git a/src/editfns.c b/src/editfns.c index 39f8f87c673..6089ee9a2e2 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -1678,7 +1678,9 @@ For example, to produce full ISO 8601 format, use "%Y-%m-%dT%T%z". */) | |||
| 1678 | /* This is probably enough. */ | 1678 | /* This is probably enough. */ |
| 1679 | size = SBYTES (format_string) * 6 + 50; | 1679 | size = SBYTES (format_string) * 6 + 50; |
| 1680 | 1680 | ||
| 1681 | BLOCK_INPUT; | ||
| 1681 | tm = ut ? gmtime (&value) : localtime (&value); | 1682 | tm = ut ? gmtime (&value) : localtime (&value); |
| 1683 | UNBLOCK_INPUT; | ||
| 1682 | if (! tm) | 1684 | if (! tm) |
| 1683 | error ("Specified time is not representable"); | 1685 | error ("Specified time is not representable"); |
| 1684 | 1686 | ||
| @@ -1690,18 +1692,22 @@ For example, to produce full ISO 8601 format, use "%Y-%m-%dT%T%z". */) | |||
| 1690 | int result; | 1692 | int result; |
| 1691 | 1693 | ||
| 1692 | buf[0] = '\1'; | 1694 | buf[0] = '\1'; |
| 1695 | BLOCK_INPUT; | ||
| 1693 | result = emacs_memftimeu (buf, size, SDATA (format_string), | 1696 | result = emacs_memftimeu (buf, size, SDATA (format_string), |
| 1694 | SBYTES (format_string), | 1697 | SBYTES (format_string), |
| 1695 | tm, ut); | 1698 | tm, ut); |
| 1699 | UNBLOCK_INPUT; | ||
| 1696 | if ((result > 0 && result < size) || (result == 0 && buf[0] == '\0')) | 1700 | if ((result > 0 && result < size) || (result == 0 && buf[0] == '\0')) |
| 1697 | return code_convert_string_norecord (make_unibyte_string (buf, result), | 1701 | return code_convert_string_norecord (make_unibyte_string (buf, result), |
| 1698 | Vlocale_coding_system, 0); | 1702 | Vlocale_coding_system, 0); |
| 1699 | 1703 | ||
| 1700 | /* If buffer was too small, make it bigger and try again. */ | 1704 | /* If buffer was too small, make it bigger and try again. */ |
| 1705 | BLOCK_INPUT; | ||
| 1701 | result = emacs_memftimeu (NULL, (size_t) -1, | 1706 | result = emacs_memftimeu (NULL, (size_t) -1, |
| 1702 | SDATA (format_string), | 1707 | SDATA (format_string), |
| 1703 | SBYTES (format_string), | 1708 | SBYTES (format_string), |
| 1704 | tm, ut); | 1709 | tm, ut); |
| 1710 | UNBLOCK_INPUT; | ||
| 1705 | size = result + 1; | 1711 | size = result + 1; |
| 1706 | } | 1712 | } |
| 1707 | } | 1713 | } |
| @@ -1732,7 +1738,9 @@ DOW and ZONE.) */) | |||
| 1732 | if (! lisp_time_argument (specified_time, &time_spec, NULL)) | 1738 | if (! lisp_time_argument (specified_time, &time_spec, NULL)) |
| 1733 | error ("Invalid time specification"); | 1739 | error ("Invalid time specification"); |
| 1734 | 1740 | ||
| 1741 | BLOCK_INPUT; | ||
| 1735 | decoded_time = localtime (&time_spec); | 1742 | decoded_time = localtime (&time_spec); |
| 1743 | UNBLOCK_INPUT; | ||
| 1736 | if (! decoded_time) | 1744 | if (! decoded_time) |
| 1737 | error ("Specified time is not representable"); | 1745 | error ("Specified time is not representable"); |
| 1738 | XSETFASTINT (list_args[0], decoded_time->tm_sec); | 1746 | XSETFASTINT (list_args[0], decoded_time->tm_sec); |
| @@ -1748,7 +1756,9 @@ DOW and ZONE.) */) | |||
| 1748 | 1756 | ||
| 1749 | /* Make a copy, in case gmtime modifies the struct. */ | 1757 | /* Make a copy, in case gmtime modifies the struct. */ |
| 1750 | save_tm = *decoded_time; | 1758 | save_tm = *decoded_time; |
| 1759 | BLOCK_INPUT; | ||
| 1751 | decoded_time = gmtime (&time_spec); | 1760 | decoded_time = gmtime (&time_spec); |
| 1761 | UNBLOCK_INPUT; | ||
| 1752 | if (decoded_time == 0) | 1762 | if (decoded_time == 0) |
| 1753 | list_args[8] = Qnil; | 1763 | list_args[8] = Qnil; |
| 1754 | else | 1764 | else |
| @@ -1804,7 +1814,11 @@ usage: (encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE) */) | |||
| 1804 | if (CONSP (zone)) | 1814 | if (CONSP (zone)) |
| 1805 | zone = Fcar (zone); | 1815 | zone = Fcar (zone); |
| 1806 | if (NILP (zone)) | 1816 | if (NILP (zone)) |
| 1807 | time = mktime (&tm); | 1817 | { |
| 1818 | BLOCK_INPUT; | ||
| 1819 | time = mktime (&tm); | ||
| 1820 | UNBLOCK_INPUT; | ||
| 1821 | } | ||
| 1808 | else | 1822 | else |
| 1809 | { | 1823 | { |
| 1810 | char tzbuf[100]; | 1824 | char tzbuf[100]; |
| @@ -1829,7 +1843,9 @@ usage: (encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE) */) | |||
| 1829 | value doesn't suffice, since that would mishandle leap seconds. */ | 1843 | value doesn't suffice, since that would mishandle leap seconds. */ |
| 1830 | set_time_zone_rule (tzstring); | 1844 | set_time_zone_rule (tzstring); |
| 1831 | 1845 | ||
| 1846 | BLOCK_INPUT; | ||
| 1832 | time = mktime (&tm); | 1847 | time = mktime (&tm); |
| 1848 | UNBLOCK_INPUT; | ||
| 1833 | 1849 | ||
| 1834 | /* Restore TZ to previous value. */ | 1850 | /* Restore TZ to previous value. */ |
| 1835 | newenv = environ; | 1851 | newenv = environ; |
| @@ -1873,7 +1889,9 @@ but this is considered obsolete. */) | |||
| 1873 | /* Convert to a string, checking for out-of-range time stamps. | 1889 | /* Convert to a string, checking for out-of-range time stamps. |
| 1874 | Don't use 'ctime', as that might dump core if VALUE is out of | 1890 | Don't use 'ctime', as that might dump core if VALUE is out of |
| 1875 | range. */ | 1891 | range. */ |
| 1892 | BLOCK_INPUT; | ||
| 1876 | tm = localtime (&value); | 1893 | tm = localtime (&value); |
| 1894 | UNBLOCK_INPUT; | ||
| 1877 | if (! (tm && TM_YEAR_IN_ASCTIME_RANGE (tm->tm_year) && (tem = asctime (tm)))) | 1895 | if (! (tm && TM_YEAR_IN_ASCTIME_RANGE (tm->tm_year) && (tem = asctime (tm)))) |
| 1878 | error ("Specified time is not representable"); | 1896 | error ("Specified time is not representable"); |
| 1879 | 1897 | ||
| @@ -1929,9 +1947,21 @@ the data it can't find. */) | |||
| 1929 | struct tm *t; | 1947 | struct tm *t; |
| 1930 | struct tm gmt; | 1948 | struct tm gmt; |
| 1931 | 1949 | ||
| 1932 | if (lisp_time_argument (specified_time, &value, NULL) | 1950 | if (!lisp_time_argument (specified_time, &value, NULL)) |
| 1933 | && (t = gmtime (&value)) != 0 | 1951 | t = NULL; |
| 1934 | && (gmt = *t, t = localtime (&value)) != 0) | 1952 | else |
| 1953 | { | ||
| 1954 | BLOCK_INPUT; | ||
| 1955 | t = gmtime (&value); | ||
| 1956 | if (t) | ||
| 1957 | { | ||
| 1958 | gmt = *t; | ||
| 1959 | t = localtime (&value); | ||
| 1960 | } | ||
| 1961 | UNBLOCK_INPUT; | ||
| 1962 | } | ||
| 1963 | |||
| 1964 | if (t) | ||
| 1935 | { | 1965 | { |
| 1936 | int offset = tm_diff (t, &gmt); | 1966 | int offset = tm_diff (t, &gmt); |
| 1937 | char *s = 0; | 1967 | char *s = 0; |
diff --git a/src/gtkutil.c b/src/gtkutil.c index d136dbe0fce..d57a0b56c0c 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -1718,9 +1718,9 @@ menuitem_destroy_callback (w, client_data) | |||
| 1718 | } | 1718 | } |
| 1719 | 1719 | ||
| 1720 | /* Callback called when the pointer enters/leaves a menu item. | 1720 | /* Callback called when the pointer enters/leaves a menu item. |
| 1721 | W is the menu item. | 1721 | W is the parent of the menu item. |
| 1722 | EVENT is either an enter event or leave event. | 1722 | EVENT is either an enter event or leave event. |
| 1723 | CLIENT_DATA points to the xg_menu_item_cb_data associated with the W. | 1723 | CLIENT_DATA is not used. |
| 1724 | 1724 | ||
| 1725 | Returns FALSE to tell GTK to keep processing this event. */ | 1725 | Returns FALSE to tell GTK to keep processing this event. */ |
| 1726 | 1726 | ||
| @@ -1730,15 +1730,21 @@ menuitem_highlight_callback (w, event, client_data) | |||
| 1730 | GdkEventCrossing *event; | 1730 | GdkEventCrossing *event; |
| 1731 | gpointer client_data; | 1731 | gpointer client_data; |
| 1732 | { | 1732 | { |
| 1733 | if (client_data) | 1733 | GdkEvent ev; |
| 1734 | { | 1734 | GtkWidget *subwidget; |
| 1735 | xg_menu_item_cb_data *data = (xg_menu_item_cb_data*) client_data; | 1735 | xg_menu_item_cb_data *data; |
| 1736 | gpointer call_data = event->type == GDK_LEAVE_NOTIFY ? 0 : client_data; | ||
| 1737 | 1736 | ||
| 1737 | ev.crossing = *event; | ||
| 1738 | subwidget = gtk_get_event_widget (&ev); | ||
| 1739 | data = (xg_menu_item_cb_data *) g_object_get_data (G_OBJECT (subwidget), | ||
| 1740 | XG_ITEM_DATA); | ||
| 1741 | if (data) | ||
| 1742 | { | ||
| 1738 | if (! NILP (data->help) && data->cl_data->highlight_cb) | 1743 | if (! NILP (data->help) && data->cl_data->highlight_cb) |
| 1739 | { | 1744 | { |
| 1745 | gpointer call_data = event->type == GDK_LEAVE_NOTIFY ? 0 : data; | ||
| 1740 | GtkCallback func = (GtkCallback) data->cl_data->highlight_cb; | 1746 | GtkCallback func = (GtkCallback) data->cl_data->highlight_cb; |
| 1741 | (*func) (w, call_data); | 1747 | (*func) (subwidget, call_data); |
| 1742 | } | 1748 | } |
| 1743 | } | 1749 | } |
| 1744 | 1750 | ||
| @@ -2004,7 +2010,7 @@ xg_create_one_menuitem (item, f, select_cb, highlight_cb, cl_data, group) | |||
| 2004 | 2010 | ||
| 2005 | xg_list_insert (&xg_menu_item_cb_list, &cb_data->ptrs); | 2011 | xg_list_insert (&xg_menu_item_cb_list, &cb_data->ptrs); |
| 2006 | 2012 | ||
| 2007 | cb_data->unhighlight_id = cb_data->highlight_id = cb_data->select_id = 0; | 2013 | cb_data->select_id = 0; |
| 2008 | cb_data->help = item->help; | 2014 | cb_data->help = item->help; |
| 2009 | cb_data->cl_data = cl_data; | 2015 | cb_data->cl_data = cl_data; |
| 2010 | cb_data->call_data = item->call_data; | 2016 | cb_data->call_data = item->call_data; |
| @@ -2025,22 +2031,6 @@ xg_create_one_menuitem (item, f, select_cb, highlight_cb, cl_data, group) | |||
| 2025 | = g_signal_connect (G_OBJECT (w), "activate", select_cb, cb_data); | 2031 | = g_signal_connect (G_OBJECT (w), "activate", select_cb, cb_data); |
| 2026 | } | 2032 | } |
| 2027 | 2033 | ||
| 2028 | if (! NILP (item->help) && highlight_cb) | ||
| 2029 | { | ||
| 2030 | /* We use enter/leave notify instead of select/deselect because | ||
| 2031 | select/deselect doesn't go well with detached menus. */ | ||
| 2032 | cb_data->highlight_id | ||
| 2033 | = g_signal_connect (G_OBJECT (w), | ||
| 2034 | "enter-notify-event", | ||
| 2035 | G_CALLBACK (menuitem_highlight_callback), | ||
| 2036 | cb_data); | ||
| 2037 | cb_data->unhighlight_id | ||
| 2038 | = g_signal_connect (G_OBJECT (w), | ||
| 2039 | "leave-notify-event", | ||
| 2040 | G_CALLBACK (menuitem_highlight_callback), | ||
| 2041 | cb_data); | ||
| 2042 | } | ||
| 2043 | |||
| 2044 | return w; | 2034 | return w; |
| 2045 | } | 2035 | } |
| 2046 | 2036 | ||
| @@ -2123,6 +2113,17 @@ create_menus (data, f, select_cb, deactivate_cb, highlight_cb, | |||
| 2123 | { | 2113 | { |
| 2124 | wmenu = gtk_menu_new (); | 2114 | wmenu = gtk_menu_new (); |
| 2125 | xg_set_screen (wmenu, f); | 2115 | xg_set_screen (wmenu, f); |
| 2116 | /* Connect this to the menu instead of items so we get enter/leave for | ||
| 2117 | disabled items also. TODO: Still does not get enter/leave for | ||
| 2118 | disabled items in detached menus. */ | ||
| 2119 | g_signal_connect (G_OBJECT (wmenu), | ||
| 2120 | "enter-notify-event", | ||
| 2121 | G_CALLBACK (menuitem_highlight_callback), | ||
| 2122 | NULL); | ||
| 2123 | g_signal_connect (G_OBJECT (wmenu), | ||
| 2124 | "leave-notify-event", | ||
| 2125 | G_CALLBACK (menuitem_highlight_callback), | ||
| 2126 | NULL); | ||
| 2126 | } | 2127 | } |
| 2127 | else wmenu = gtk_menu_bar_new (); | 2128 | else wmenu = gtk_menu_bar_new (); |
| 2128 | 2129 | ||
| @@ -2619,37 +2620,6 @@ xg_update_menu_item (val, w, select_cb, highlight_cb, cl_data) | |||
| 2619 | g_signal_handler_disconnect (w, cb_data->select_id); | 2620 | g_signal_handler_disconnect (w, cb_data->select_id); |
| 2620 | cb_data->select_id = 0; | 2621 | cb_data->select_id = 0; |
| 2621 | } | 2622 | } |
| 2622 | |||
| 2623 | if (NILP (cb_data->help)) | ||
| 2624 | { | ||
| 2625 | /* Shall not have help. Remove if any existed previously. */ | ||
| 2626 | if (cb_data->highlight_id) | ||
| 2627 | { | ||
| 2628 | g_signal_handler_disconnect (G_OBJECT (w), | ||
| 2629 | cb_data->highlight_id); | ||
| 2630 | cb_data->highlight_id = 0; | ||
| 2631 | } | ||
| 2632 | if (cb_data->unhighlight_id) | ||
| 2633 | { | ||
| 2634 | g_signal_handler_disconnect (G_OBJECT (w), | ||
| 2635 | cb_data->unhighlight_id); | ||
| 2636 | cb_data->unhighlight_id = 0; | ||
| 2637 | } | ||
| 2638 | } | ||
| 2639 | else if (! cb_data->highlight_id && highlight_cb) | ||
| 2640 | { | ||
| 2641 | /* Have help now, but didn't previously. Add callback. */ | ||
| 2642 | cb_data->highlight_id | ||
| 2643 | = g_signal_connect (G_OBJECT (w), | ||
| 2644 | "enter-notify-event", | ||
| 2645 | G_CALLBACK (menuitem_highlight_callback), | ||
| 2646 | cb_data); | ||
| 2647 | cb_data->unhighlight_id | ||
| 2648 | = g_signal_connect (G_OBJECT (w), | ||
| 2649 | "leave-notify-event", | ||
| 2650 | G_CALLBACK (menuitem_highlight_callback), | ||
| 2651 | cb_data); | ||
| 2652 | } | ||
| 2653 | } | 2623 | } |
| 2654 | } | 2624 | } |
| 2655 | 2625 | ||
diff --git a/src/gtkutil.h b/src/gtkutil.h index 742e3ecb1e5..c3957223a18 100644 --- a/src/gtkutil.h +++ b/src/gtkutil.h | |||
| @@ -79,8 +79,6 @@ typedef struct xg_menu_item_cb_data_ | |||
| 79 | { | 79 | { |
| 80 | xg_list_node ptrs; | 80 | xg_list_node ptrs; |
| 81 | 81 | ||
| 82 | gulong highlight_id; | ||
| 83 | gulong unhighlight_id; | ||
| 84 | gulong select_id; | 82 | gulong select_id; |
| 85 | Lisp_Object help; | 83 | Lisp_Object help; |
| 86 | gpointer call_data; | 84 | gpointer call_data; |
diff --git a/src/indent.c b/src/indent.c index e84059972f3..af556bc38e3 100644 --- a/src/indent.c +++ b/src/indent.c | |||
| @@ -2076,7 +2076,7 @@ whether or not it is currently displayed in some window. */) | |||
| 2076 | { | 2076 | { |
| 2077 | int it_start; | 2077 | int it_start; |
| 2078 | int oselective; | 2078 | int oselective; |
| 2079 | int it_overshoot_expected_p; | 2079 | int it_overshoot_expected; |
| 2080 | 2080 | ||
| 2081 | SET_TEXT_POS (pt, PT, PT_BYTE); | 2081 | SET_TEXT_POS (pt, PT, PT_BYTE); |
| 2082 | start_display (&it, w, pt); | 2082 | start_display (&it, w, pt); |
| @@ -2102,12 +2102,16 @@ whether or not it is currently displayed in some window. */) | |||
| 2102 | while (s < e && *s != '\n') | 2102 | while (s < e && *s != '\n') |
| 2103 | ++s; | 2103 | ++s; |
| 2104 | 2104 | ||
| 2105 | it_overshoot_expected_p = (s == e); | 2105 | /* If there is no newline in the string, we need to check |
| 2106 | whether there is a newline immediately after the string | ||
| 2107 | in move_it_to below. This may happen if there is an | ||
| 2108 | overlay with an after-string just before the newline. */ | ||
| 2109 | it_overshoot_expected = (s == e) ? -1 : 0; | ||
| 2106 | } | 2110 | } |
| 2107 | else | 2111 | else |
| 2108 | it_overshoot_expected_p = (it.method == GET_FROM_IMAGE | 2112 | it_overshoot_expected = (it.method == GET_FROM_IMAGE |
| 2109 | || it.method == GET_FROM_STRETCH | 2113 | || it.method == GET_FROM_STRETCH |
| 2110 | || it.method == GET_FROM_COMPOSITION); | 2114 | || it.method == GET_FROM_COMPOSITION); |
| 2111 | 2115 | ||
| 2112 | reseat_at_previous_visible_line_start (&it); | 2116 | reseat_at_previous_visible_line_start (&it); |
| 2113 | it.current_x = it.hpos = 0; | 2117 | it.current_x = it.hpos = 0; |
| @@ -2121,7 +2125,10 @@ whether or not it is currently displayed in some window. */) | |||
| 2121 | truncate-lines is on and PT is beyond right margin. | 2125 | truncate-lines is on and PT is beyond right margin. |
| 2122 | Don't go back if the overshoot is expected (see above). */ | 2126 | Don't go back if the overshoot is expected (see above). */ |
| 2123 | if (IT_CHARPOS (it) > it_start && XINT (lines) > 0 | 2127 | if (IT_CHARPOS (it) > it_start && XINT (lines) > 0 |
| 2124 | && !it_overshoot_expected_p) | 2128 | && (!it_overshoot_expected |
| 2129 | || (it_overshoot_expected < 0 | ||
| 2130 | && it.method == GET_FROM_BUFFER | ||
| 2131 | && it.c == '\n'))) | ||
| 2125 | move_it_by_lines (&it, -1, 0); | 2132 | move_it_by_lines (&it, -1, 0); |
| 2126 | 2133 | ||
| 2127 | it.vpos = 0; | 2134 | it.vpos = 0; |
| @@ -2261,7 +2261,7 @@ sys_open (const char *path, int oflag) | |||
| 2261 | int res = open (mac_pathname, oflag); | 2261 | int res = open (mac_pathname, oflag); |
| 2262 | /* if (oflag == O_WRONLY || oflag == O_RDWR) */ | 2262 | /* if (oflag == O_WRONLY || oflag == O_RDWR) */ |
| 2263 | if (oflag & O_CREAT) | 2263 | if (oflag & O_CREAT) |
| 2264 | fsetfileinfo (mac_pathname, 'EMAx', 'TEXT'); | 2264 | fsetfileinfo (mac_pathname, MAC_EMACS_CREATOR_CODE, 'TEXT'); |
| 2265 | return res; | 2265 | return res; |
| 2266 | #else /* not __MRC__ */ | 2266 | #else /* not __MRC__ */ |
| 2267 | return open (mac_pathname, oflag); | 2267 | return open (mac_pathname, oflag); |
| @@ -2287,7 +2287,7 @@ sys_creat (const char *path, mode_t mode) | |||
| 2287 | { | 2287 | { |
| 2288 | #ifdef __MRC__ | 2288 | #ifdef __MRC__ |
| 2289 | int result = creat (mac_pathname); | 2289 | int result = creat (mac_pathname); |
| 2290 | fsetfileinfo (mac_pathname, 'EMAx', 'TEXT'); | 2290 | fsetfileinfo (mac_pathname, MAC_EMACS_CREATOR_CODE, 'TEXT'); |
| 2291 | return result; | 2291 | return result; |
| 2292 | #else /* not __MRC__ */ | 2292 | #else /* not __MRC__ */ |
| 2293 | return creat (mac_pathname, mode); | 2293 | return creat (mac_pathname, mode); |
| @@ -2415,7 +2415,7 @@ sys_fopen (const char *name, const char *mode) | |||
| 2415 | { | 2415 | { |
| 2416 | #ifdef __MRC__ | 2416 | #ifdef __MRC__ |
| 2417 | if (mode[0] == 'w' || mode[0] == 'a') | 2417 | if (mode[0] == 'w' || mode[0] == 'a') |
| 2418 | fsetfileinfo (mac_pathname, 'EMAx', 'TEXT'); | 2418 | fsetfileinfo (mac_pathname, MAC_EMACS_CREATOR_CODE, 'TEXT'); |
| 2419 | #endif /* not __MRC__ */ | 2419 | #endif /* not __MRC__ */ |
| 2420 | return fopen (mac_pathname, mode); | 2420 | return fopen (mac_pathname, mode); |
| 2421 | } | 2421 | } |
| @@ -4316,7 +4316,7 @@ assumed. Return non-nil if successful. */) | |||
| 4316 | OSType cCode; | 4316 | OSType cCode; |
| 4317 | CHECK_STRING (filename); | 4317 | CHECK_STRING (filename); |
| 4318 | 4318 | ||
| 4319 | cCode = mac_get_code_from_arg(code, 'EMAx'); | 4319 | cCode = mac_get_code_from_arg(code, MAC_EMACS_CREATOR_CODE); |
| 4320 | 4320 | ||
| 4321 | if (NILP(Ffile_exists_p(filename)) || !NILP(Ffile_directory_p(filename))) { | 4321 | if (NILP(Ffile_exists_p(filename)) || !NILP(Ffile_directory_p(filename))) { |
| 4322 | return Qnil; | 4322 | return Qnil; |
diff --git a/src/macgui.h b/src/macgui.h index 1ea53af59be..3a9913181de 100644 --- a/src/macgui.h +++ b/src/macgui.h | |||
| @@ -244,6 +244,14 @@ typedef struct _XGC | |||
| 244 | /* QuickDraw background color. */ | 244 | /* QuickDraw background color. */ |
| 245 | RGBColor back_color; | 245 | RGBColor back_color; |
| 246 | 246 | ||
| 247 | #if USE_CG_DRAWING && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 | ||
| 248 | /* Quartz 2D foreground color. */ | ||
| 249 | CGColorRef cg_fore_color; | ||
| 250 | |||
| 251 | /* Quartz 2D background color. */ | ||
| 252 | CGColorRef cg_back_color; | ||
| 253 | #endif | ||
| 254 | |||
| 247 | #define MAX_CLIP_RECTS 2 | 255 | #define MAX_CLIP_RECTS 2 |
| 248 | /* Number of clipping rectangles. */ | 256 | /* Number of clipping rectangles. */ |
| 249 | int n_clip_rects; | 257 | int n_clip_rects; |
diff --git a/src/macmenu.c b/src/macmenu.c index 14bfe92cb25..9981250979a 100644 --- a/src/macmenu.c +++ b/src/macmenu.c | |||
| @@ -1450,6 +1450,80 @@ update_submenu_strings (first_wv) | |||
| 1450 | } | 1450 | } |
| 1451 | 1451 | ||
| 1452 | 1452 | ||
| 1453 | #if TARGET_API_MAC_CARBON | ||
| 1454 | extern Lisp_Object Vshow_help_function; | ||
| 1455 | |||
| 1456 | static Lisp_Object | ||
| 1457 | restore_show_help_function (old_show_help_function) | ||
| 1458 | Lisp_Object old_show_help_function; | ||
| 1459 | { | ||
| 1460 | Vshow_help_function = old_show_help_function; | ||
| 1461 | |||
| 1462 | return Qnil; | ||
| 1463 | } | ||
| 1464 | |||
| 1465 | static pascal OSStatus | ||
| 1466 | menu_target_item_handler (next_handler, event, data) | ||
| 1467 | EventHandlerCallRef next_handler; | ||
| 1468 | EventRef event; | ||
| 1469 | void *data; | ||
| 1470 | { | ||
| 1471 | OSStatus err, result; | ||
| 1472 | MenuRef menu; | ||
| 1473 | MenuItemIndex menu_item; | ||
| 1474 | Lisp_Object help; | ||
| 1475 | GrafPtr port; | ||
| 1476 | int specpdl_count = SPECPDL_INDEX (); | ||
| 1477 | |||
| 1478 | result = CallNextEventHandler (next_handler, event); | ||
| 1479 | |||
| 1480 | err = GetEventParameter (event, kEventParamDirectObject, typeMenuRef, | ||
| 1481 | NULL, sizeof (MenuRef), NULL, &menu); | ||
| 1482 | if (err == noErr) | ||
| 1483 | err = GetEventParameter (event, kEventParamMenuItemIndex, | ||
| 1484 | typeMenuItemIndex, NULL, | ||
| 1485 | sizeof (MenuItemIndex), NULL, &menu_item); | ||
| 1486 | if (err == noErr) | ||
| 1487 | err = GetMenuItemProperty (menu, menu_item, | ||
| 1488 | MAC_EMACS_CREATOR_CODE, 'help', | ||
| 1489 | sizeof (Lisp_Object), NULL, &help); | ||
| 1490 | if (err != noErr) | ||
| 1491 | help = Qnil; | ||
| 1492 | |||
| 1493 | /* Temporarily bind Vshow_help_function to Qnil because we don't | ||
| 1494 | want tooltips during menu tracking. */ | ||
| 1495 | record_unwind_protect (restore_show_help_function, Vshow_help_function); | ||
| 1496 | Vshow_help_function = Qnil; | ||
| 1497 | GetPort (&port); | ||
| 1498 | show_help_echo (help, Qnil, Qnil, Qnil, 1); | ||
| 1499 | SetPort (port); | ||
| 1500 | unbind_to (specpdl_count, Qnil); | ||
| 1501 | |||
| 1502 | return err == noErr ? noErr : result; | ||
| 1503 | } | ||
| 1504 | #endif | ||
| 1505 | |||
| 1506 | OSStatus | ||
| 1507 | install_menu_target_item_handler (window) | ||
| 1508 | WindowPtr window; | ||
| 1509 | { | ||
| 1510 | OSStatus err = noErr; | ||
| 1511 | #if TARGET_API_MAC_CARBON | ||
| 1512 | static const EventTypeSpec specs[] = | ||
| 1513 | {{kEventClassMenu, kEventMenuTargetItem}}; | ||
| 1514 | static EventHandlerUPP menu_target_item_handlerUPP = NULL; | ||
| 1515 | |||
| 1516 | if (menu_target_item_handlerUPP == NULL) | ||
| 1517 | menu_target_item_handlerUPP = | ||
| 1518 | NewEventHandlerUPP (menu_target_item_handler); | ||
| 1519 | |||
| 1520 | err = InstallWindowEventHandler (window, menu_target_item_handlerUPP, | ||
| 1521 | GetEventTypeCount (specs), specs, | ||
| 1522 | NULL, NULL); | ||
| 1523 | #endif | ||
| 1524 | return err; | ||
| 1525 | } | ||
| 1526 | |||
| 1453 | /* Event handler function that pops down a menu on C-g. We can only pop | 1527 | /* Event handler function that pops down a menu on C-g. We can only pop |
| 1454 | down menus if CancelMenuTracking is present (OSX 10.3 or later). */ | 1528 | down menus if CancelMenuTracking is present (OSX 10.3 or later). */ |
| 1455 | 1529 | ||
| @@ -2485,6 +2559,10 @@ add_menu_item (menu, pos, wv) | |||
| 2485 | EnableMenuItem (menu, pos); | 2559 | EnableMenuItem (menu, pos); |
| 2486 | else | 2560 | else |
| 2487 | DisableMenuItem (menu, pos); | 2561 | DisableMenuItem (menu, pos); |
| 2562 | |||
| 2563 | if (STRINGP (wv->help)) | ||
| 2564 | SetMenuItemProperty (menu, pos, MAC_EMACS_CREATOR_CODE, 'help', | ||
| 2565 | sizeof (Lisp_Object), &wv->help); | ||
| 2488 | #else /* ! TARGET_API_MAC_CARBON */ | 2566 | #else /* ! TARGET_API_MAC_CARBON */ |
| 2489 | item_name[sizeof (item_name) - 1] = '\0'; | 2567 | item_name[sizeof (item_name) - 1] = '\0'; |
| 2490 | strncpy (item_name, wv->name, sizeof (item_name) - 1); | 2568 | strncpy (item_name, wv->name, sizeof (item_name) - 1); |
diff --git a/src/macterm.c b/src/macterm.c index 6eaf549ba85..7c3f036f1ba 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -270,16 +270,63 @@ static void XSetFont P_ ((Display *, GC, XFontStruct *)); | |||
| 270 | #define GC_BACK_COLOR(gc) (&(gc)->back_color) | 270 | #define GC_BACK_COLOR(gc) (&(gc)->back_color) |
| 271 | #define GC_FONT(gc) ((gc)->xgcv.font) | 271 | #define GC_FONT(gc) ((gc)->xgcv.font) |
| 272 | #define FRAME_NORMAL_GC(f) ((f)->output_data.mac->normal_gc) | 272 | #define FRAME_NORMAL_GC(f) ((f)->output_data.mac->normal_gc) |
| 273 | #define CG_SET_FILL_COLOR(context, color) \ | 273 | |
| 274 | #define CG_SET_FILL_COLOR(context, color) \ | ||
| 274 | CGContextSetRGBFillColor (context, \ | 275 | CGContextSetRGBFillColor (context, \ |
| 275 | RED_FROM_ULONG (color) / 255.0f, \ | 276 | RED_FROM_ULONG (color) / 255.0f, \ |
| 276 | GREEN_FROM_ULONG (color) / 255.0f, \ | 277 | GREEN_FROM_ULONG (color) / 255.0f, \ |
| 277 | BLUE_FROM_ULONG (color) / 255.0f, 1.0f) | 278 | BLUE_FROM_ULONG (color) / 255.0f, 1.0f) |
| 278 | #define CG_SET_STROKE_COLOR(context, color) \ | 279 | #if USE_CG_DRAWING && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 |
| 280 | #if MAC_OS_X_VERSION_MIN_REQUIRED == 1020 | ||
| 281 | #define CG_SET_FILL_COLOR_MAYBE_WITH_CGCOLOR(context, color, cg_color) \ | ||
| 282 | do { \ | ||
| 283 | if (CGColorGetTypeID != NULL) \ | ||
| 284 | CGContextSetFillColorWithColor (context, cg_color); \ | ||
| 285 | else \ | ||
| 286 | CG_SET_FILL_COLOR (context, color); \ | ||
| 287 | } while (0) | ||
| 288 | #else | ||
| 289 | #define CG_SET_FILL_COLOR_MAYBE_WITH_CGCOLOR(context, color, cg_color) \ | ||
| 290 | CGContextSetFillColorWithColor (context, cg_color) | ||
| 291 | #endif | ||
| 292 | #else | ||
| 293 | #define CG_SET_FILL_COLOR_MAYBE_WITH_CGCOLOR(context, color, cg_color) \ | ||
| 294 | CG_SET_FILL_COLOR (context, color) | ||
| 295 | #endif | ||
| 296 | #define CG_SET_FILL_COLOR_WITH_GC_FOREGROUND(context, gc) \ | ||
| 297 | CG_SET_FILL_COLOR_MAYBE_WITH_CGCOLOR (context, (gc)->xgcv.foreground, \ | ||
| 298 | (gc)->cg_fore_color) | ||
| 299 | #define CG_SET_FILL_COLOR_WITH_GC_BACKGROUND(context, gc) \ | ||
| 300 | CG_SET_FILL_COLOR_MAYBE_WITH_CGCOLOR (context, (gc)->xgcv.background, \ | ||
| 301 | (gc)->cg_back_color) | ||
| 302 | |||
| 303 | |||
| 304 | #define CG_SET_STROKE_COLOR(context, color) \ | ||
| 279 | CGContextSetRGBStrokeColor (context, \ | 305 | CGContextSetRGBStrokeColor (context, \ |
| 280 | RED_FROM_ULONG (color) / 255.0f, \ | 306 | RED_FROM_ULONG (color) / 255.0f, \ |
| 281 | GREEN_FROM_ULONG (color) / 255.0f, \ | 307 | GREEN_FROM_ULONG (color) / 255.0f, \ |
| 282 | BLUE_FROM_ULONG (color) / 255.0f, 1.0f) | 308 | BLUE_FROM_ULONG (color) / 255.0f, 1.0f) |
| 309 | #if USE_CG_DRAWING && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 | ||
| 310 | #if MAC_OS_X_VERSION_MIN_REQUIRED == 1020 | ||
| 311 | #define CG_SET_STROKE_COLOR_MAYBE_WITH_CGCOLOR(context, color, cg_color) \ | ||
| 312 | do { \ | ||
| 313 | if (CGColorGetTypeID != NULL) \ | ||
| 314 | CGContextSetStrokeColorWithColor (context, cg_color); \ | ||
| 315 | else \ | ||
| 316 | CG_SET_STROKE_COLOR (context, color); \ | ||
| 317 | } while (0) | ||
| 318 | #else | ||
| 319 | #define CG_SET_STROKE_COLOR_MAYBE_WITH_CGCOLOR(context, color, cg_color) \ | ||
| 320 | CGContextSetStrokeColorWithColor (context, cg_color) | ||
| 321 | #endif | ||
| 322 | #else | ||
| 323 | #define CG_SET_STROKE_COLOR_MAYBE_WITH_CGCOLOR(context, color, cg_color) \ | ||
| 324 | CG_SET_STROKE_COLOR (context, color) | ||
| 325 | #endif | ||
| 326 | #define CG_SET_STROKE_COLOR_WITH_GC_FOREGROUND(context, gc) \ | ||
| 327 | CG_SET_STROKE_COLOR_MAYBE_WITH_CGCOLOR (context, (gc)->xgcv.foreground, \ | ||
| 328 | (gc)->cg_fore_color) | ||
| 329 | |||
| 283 | #if USE_CG_DRAWING | 330 | #if USE_CG_DRAWING |
| 284 | #define FRAME_CG_CONTEXT(f) ((f)->output_data.mac->cg_context) | 331 | #define FRAME_CG_CONTEXT(f) ((f)->output_data.mac->cg_context) |
| 285 | 332 | ||
| @@ -288,6 +335,29 @@ static void XSetFont P_ ((Display *, GC, XFontStruct *)); | |||
| 288 | static int max_fringe_bmp = 0; | 335 | static int max_fringe_bmp = 0; |
| 289 | static CGImageRef *fringe_bmp = 0; | 336 | static CGImageRef *fringe_bmp = 0; |
| 290 | 337 | ||
| 338 | static CGColorSpaceRef mac_cg_color_space_rgb; | ||
| 339 | #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 | ||
| 340 | static CGColorRef mac_cg_color_black; | ||
| 341 | #endif | ||
| 342 | |||
| 343 | static void | ||
| 344 | init_cg_color () | ||
| 345 | { | ||
| 346 | mac_cg_color_space_rgb = CGColorSpaceCreateDeviceRGB (); | ||
| 347 | #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 | ||
| 348 | #if MAC_OS_X_VERSION_MIN_REQUIRED == 1020 | ||
| 349 | /* Don't check the availability of CGColorCreate; this symbol is | ||
| 350 | defined even in Mac OS X 10.1. */ | ||
| 351 | if (CGColorGetTypeID != NULL) | ||
| 352 | #endif | ||
| 353 | { | ||
| 354 | float rgba[] = {0.0f, 0.0f, 0.0f, 1.0f}; | ||
| 355 | |||
| 356 | mac_cg_color_black = CGColorCreate (mac_cg_color_space_rgb, rgba); | ||
| 357 | } | ||
| 358 | #endif | ||
| 359 | } | ||
| 360 | |||
| 291 | static CGContextRef | 361 | static CGContextRef |
| 292 | mac_begin_cg_clip (f, gc) | 362 | mac_begin_cg_clip (f, gc) |
| 293 | struct frame *f; | 363 | struct frame *f; |
| @@ -401,7 +471,7 @@ mac_draw_line (f, gc, x1, y1, x2, y2) | |||
| 401 | gy1 += 0.5f, gy2 += 0.5f; | 471 | gy1 += 0.5f, gy2 += 0.5f; |
| 402 | 472 | ||
| 403 | context = mac_begin_cg_clip (f, gc); | 473 | context = mac_begin_cg_clip (f, gc); |
| 404 | CG_SET_STROKE_COLOR (context, gc->xgcv.foreground); | 474 | CG_SET_STROKE_COLOR_WITH_GC_FOREGROUND (context, gc); |
| 405 | CGContextBeginPath (context); | 475 | CGContextBeginPath (context); |
| 406 | CGContextMoveToPoint (context, gx1, gy1); | 476 | CGContextMoveToPoint (context, gx1, gy1); |
| 407 | CGContextAddLineToPoint (context, gx2, gy2); | 477 | CGContextAddLineToPoint (context, gx2, gy2); |
| @@ -485,7 +555,7 @@ mac_erase_rectangle (f, gc, x, y, width, height) | |||
| 485 | CGContextRef context; | 555 | CGContextRef context; |
| 486 | 556 | ||
| 487 | context = mac_begin_cg_clip (f, gc); | 557 | context = mac_begin_cg_clip (f, gc); |
| 488 | CG_SET_FILL_COLOR (context, gc->xgcv.background); | 558 | CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, gc); |
| 489 | CGContextFillRect (context, CGRectMake (x, y, width, height)); | 559 | CGContextFillRect (context, CGRectMake (x, y, width, height)); |
| 490 | mac_end_cg_clip (f); | 560 | mac_end_cg_clip (f); |
| 491 | #else | 561 | #else |
| @@ -527,7 +597,7 @@ mac_clear_window (f) | |||
| 527 | GC gc = FRAME_NORMAL_GC (f); | 597 | GC gc = FRAME_NORMAL_GC (f); |
| 528 | 598 | ||
| 529 | context = mac_begin_cg_clip (f, NULL); | 599 | context = mac_begin_cg_clip (f, NULL); |
| 530 | CG_SET_FILL_COLOR (context, gc->xgcv.background); | 600 | CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, gc); |
| 531 | CGContextFillRect (context, CGRectMake (0, 0, FRAME_PIXEL_WIDTH (f), | 601 | CGContextFillRect (context, CGRectMake (0, 0, FRAME_PIXEL_WIDTH (f), |
| 532 | FRAME_PIXEL_HEIGHT (f))); | 602 | FRAME_PIXEL_HEIGHT (f))); |
| 533 | mac_end_cg_clip (f); | 603 | mac_end_cg_clip (f); |
| @@ -570,14 +640,14 @@ mac_draw_cg_image (image, f, gc, src_x, src_y, width, height, | |||
| 570 | context = mac_begin_cg_clip (f, gc); | 640 | context = mac_begin_cg_clip (f, gc); |
| 571 | if (!overlay_p) | 641 | if (!overlay_p) |
| 572 | { | 642 | { |
| 573 | CG_SET_FILL_COLOR (context, gc->xgcv.background); | 643 | CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, gc); |
| 574 | CGContextFillRect (context, dest_rect); | 644 | CGContextFillRect (context, dest_rect); |
| 575 | } | 645 | } |
| 576 | CGContextClipToRect (context, dest_rect); | 646 | CGContextClipToRect (context, dest_rect); |
| 577 | CGContextScaleCTM (context, 1, -1); | 647 | CGContextScaleCTM (context, 1, -1); |
| 578 | CGContextTranslateCTM (context, 0, -port_height); | 648 | CGContextTranslateCTM (context, 0, -port_height); |
| 579 | if (CGImageIsMask (image)) | 649 | if (CGImageIsMask (image)) |
| 580 | CG_SET_FILL_COLOR (context, gc->xgcv.foreground); | 650 | CG_SET_FILL_COLOR_WITH_GC_FOREGROUND (context, gc); |
| 581 | CGContextDrawImage (context, | 651 | CGContextDrawImage (context, |
| 582 | CGRectMake (dest_x - src_x, | 652 | CGRectMake (dest_x - src_x, |
| 583 | port_height - (dest_y - src_y | 653 | port_height - (dest_y - src_y |
| @@ -764,7 +834,7 @@ mac_fill_rectangle (f, gc, x, y, width, height) | |||
| 764 | CGContextRef context; | 834 | CGContextRef context; |
| 765 | 835 | ||
| 766 | context = mac_begin_cg_clip (f, gc); | 836 | context = mac_begin_cg_clip (f, gc); |
| 767 | CG_SET_FILL_COLOR (context, gc->xgcv.foreground); | 837 | CG_SET_FILL_COLOR_WITH_GC_FOREGROUND (context, gc); |
| 768 | CGContextFillRect (context, CGRectMake (x, y, width, height)); | 838 | CGContextFillRect (context, CGRectMake (x, y, width, height)); |
| 769 | mac_end_cg_clip (f); | 839 | mac_end_cg_clip (f); |
| 770 | #else | 840 | #else |
| @@ -795,7 +865,7 @@ mac_draw_rectangle (f, gc, x, y, width, height) | |||
| 795 | CGContextRef context; | 865 | CGContextRef context; |
| 796 | 866 | ||
| 797 | context = mac_begin_cg_clip (f, gc); | 867 | context = mac_begin_cg_clip (f, gc); |
| 798 | CG_SET_STROKE_COLOR (context, gc->xgcv.foreground); | 868 | CG_SET_STROKE_COLOR_WITH_GC_FOREGROUND (context, gc); |
| 799 | CGContextStrokeRect (context, | 869 | CGContextStrokeRect (context, |
| 800 | CGRectMake (x + 0.5f, y + 0.5f, width, height)); | 870 | CGRectMake (x + 0.5f, y + 0.5f, width, height)); |
| 801 | mac_end_cg_clip (f); | 871 | mac_end_cg_clip (f); |
| @@ -982,7 +1052,7 @@ mac_draw_string_common (f, gc, x, y, buf, nchars, bg_width, | |||
| 982 | #endif | 1052 | #endif |
| 983 | if (bg_width) | 1053 | if (bg_width) |
| 984 | { | 1054 | { |
| 985 | CG_SET_FILL_COLOR (context, gc->xgcv.background); | 1055 | CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, gc); |
| 986 | CGContextFillRect | 1056 | CGContextFillRect |
| 987 | (context, | 1057 | (context, |
| 988 | CGRectMake (x, y - FONT_BASE (GC_FONT (gc)), | 1058 | CGRectMake (x, y - FONT_BASE (GC_FONT (gc)), |
| @@ -993,7 +1063,7 @@ mac_draw_string_common (f, gc, x, y, buf, nchars, bg_width, | |||
| 993 | #if !USE_CG_DRAWING | 1063 | #if !USE_CG_DRAWING |
| 994 | } | 1064 | } |
| 995 | #endif | 1065 | #endif |
| 996 | CG_SET_FILL_COLOR (context, gc->xgcv.foreground); | 1066 | CG_SET_FILL_COLOR_WITH_GC_FOREGROUND (context, gc); |
| 997 | err = ATSUSetLayoutControls (text_layout, | 1067 | err = ATSUSetLayoutControls (text_layout, |
| 998 | sizeof (tags) / sizeof (tags[0]), | 1068 | sizeof (tags) / sizeof (tags[0]), |
| 999 | tags, sizes, values); | 1069 | tags, sizes, values); |
| @@ -1344,7 +1414,7 @@ mac_draw_image_string_cg (f, gc, x, y, buf, nchars, bg_width, overstrike_p) | |||
| 1344 | #endif | 1414 | #endif |
| 1345 | if (bg_width) | 1415 | if (bg_width) |
| 1346 | { | 1416 | { |
| 1347 | CG_SET_FILL_COLOR (context, gc->xgcv.background); | 1417 | CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, gc); |
| 1348 | CGContextFillRect | 1418 | CGContextFillRect |
| 1349 | (context, | 1419 | (context, |
| 1350 | CGRectMake (gx, y - FONT_BASE (GC_FONT (gc)), | 1420 | CGRectMake (gx, y - FONT_BASE (GC_FONT (gc)), |
| @@ -1355,7 +1425,7 @@ mac_draw_image_string_cg (f, gc, x, y, buf, nchars, bg_width, overstrike_p) | |||
| 1355 | #if !USE_CG_DRAWING | 1425 | #if !USE_CG_DRAWING |
| 1356 | } | 1426 | } |
| 1357 | #endif | 1427 | #endif |
| 1358 | CG_SET_FILL_COLOR (context, gc->xgcv.foreground); | 1428 | CG_SET_FILL_COLOR_WITH_GC_FOREGROUND (context, gc); |
| 1359 | CGContextSetFont (context, GC_FONT (gc)->cg_font); | 1429 | CGContextSetFont (context, GC_FONT (gc)->cg_font); |
| 1360 | CGContextSetFontSize (context, GC_FONT (gc)->mac_fontsize); | 1430 | CGContextSetFontSize (context, GC_FONT (gc)->mac_fontsize); |
| 1361 | if (GC_FONT (gc)->mac_fontsize <= cg_text_anti_aliasing_threshold) | 1431 | if (GC_FONT (gc)->mac_fontsize <= cg_text_anti_aliasing_threshold) |
| @@ -1567,6 +1637,16 @@ XCreateGC (display, window, mask, xgcv) | |||
| 1567 | GC gc = xmalloc (sizeof (*gc)); | 1637 | GC gc = xmalloc (sizeof (*gc)); |
| 1568 | 1638 | ||
| 1569 | bzero (gc, sizeof (*gc)); | 1639 | bzero (gc, sizeof (*gc)); |
| 1640 | #if USE_CG_DRAWING && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 | ||
| 1641 | #if MAC_OS_X_VERSION_MIN_REQUIRED == 1020 | ||
| 1642 | if (CGColorGetTypeID != NULL) | ||
| 1643 | #endif | ||
| 1644 | { | ||
| 1645 | gc->cg_fore_color = gc->cg_back_color = mac_cg_color_black; | ||
| 1646 | CGColorRetain (gc->cg_fore_color); | ||
| 1647 | CGColorRetain (gc->cg_back_color); | ||
| 1648 | } | ||
| 1649 | #endif | ||
| 1570 | XChangeGC (display, gc, mask, xgcv); | 1650 | XChangeGC (display, gc, mask, xgcv); |
| 1571 | 1651 | ||
| 1572 | return gc; | 1652 | return gc; |
| @@ -1582,6 +1662,10 @@ XFreeGC (display, gc) | |||
| 1582 | { | 1662 | { |
| 1583 | if (gc->clip_region) | 1663 | if (gc->clip_region) |
| 1584 | DisposeRgn (gc->clip_region); | 1664 | DisposeRgn (gc->clip_region); |
| 1665 | #if USE_CG_DRAWING && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 | ||
| 1666 | CGColorRelease (gc->cg_fore_color); | ||
| 1667 | CGColorRelease (gc->cg_back_color); | ||
| 1668 | #endif | ||
| 1585 | xfree (gc); | 1669 | xfree (gc); |
| 1586 | } | 1670 | } |
| 1587 | 1671 | ||
| @@ -1618,6 +1702,29 @@ XSetForeground (display, gc, color) | |||
| 1618 | gc->fore_color.red = RED16_FROM_ULONG (color); | 1702 | gc->fore_color.red = RED16_FROM_ULONG (color); |
| 1619 | gc->fore_color.green = GREEN16_FROM_ULONG (color); | 1703 | gc->fore_color.green = GREEN16_FROM_ULONG (color); |
| 1620 | gc->fore_color.blue = BLUE16_FROM_ULONG (color); | 1704 | gc->fore_color.blue = BLUE16_FROM_ULONG (color); |
| 1705 | #if USE_CG_DRAWING && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 | ||
| 1706 | #if MAC_OS_X_VERSION_MIN_REQUIRED == 1020 | ||
| 1707 | if (CGColorGetTypeID != NULL) | ||
| 1708 | #endif | ||
| 1709 | { | ||
| 1710 | CGColorRelease (gc->cg_fore_color); | ||
| 1711 | if (color == 0) | ||
| 1712 | { | ||
| 1713 | gc->cg_fore_color = mac_cg_color_black; | ||
| 1714 | CGColorRetain (gc->cg_fore_color); | ||
| 1715 | } | ||
| 1716 | else | ||
| 1717 | { | ||
| 1718 | float rgba[4]; | ||
| 1719 | |||
| 1720 | rgba[0] = gc->fore_color.red / 65535.0f; | ||
| 1721 | rgba[1] = gc->fore_color.green / 65535.0f; | ||
| 1722 | rgba[2] = gc->fore_color.blue / 65535.0f; | ||
| 1723 | rgba[3] = 1.0f; | ||
| 1724 | gc->cg_fore_color = CGColorCreate (mac_cg_color_space_rgb, rgba); | ||
| 1725 | } | ||
| 1726 | } | ||
| 1727 | #endif | ||
| 1621 | } | 1728 | } |
| 1622 | } | 1729 | } |
| 1623 | 1730 | ||
| @@ -1636,6 +1743,29 @@ XSetBackground (display, gc, color) | |||
| 1636 | gc->back_color.red = RED16_FROM_ULONG (color); | 1743 | gc->back_color.red = RED16_FROM_ULONG (color); |
| 1637 | gc->back_color.green = GREEN16_FROM_ULONG (color); | 1744 | gc->back_color.green = GREEN16_FROM_ULONG (color); |
| 1638 | gc->back_color.blue = BLUE16_FROM_ULONG (color); | 1745 | gc->back_color.blue = BLUE16_FROM_ULONG (color); |
| 1746 | #if USE_CG_DRAWING && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 | ||
| 1747 | #if MAC_OS_X_VERSION_MIN_REQUIRED == 1020 | ||
| 1748 | if (CGColorGetTypeID != NULL) | ||
| 1749 | #endif | ||
| 1750 | { | ||
| 1751 | CGColorRelease (gc->cg_back_color); | ||
| 1752 | if (color == 0) | ||
| 1753 | { | ||
| 1754 | gc->cg_back_color = mac_cg_color_black; | ||
| 1755 | CGColorRetain (gc->cg_back_color); | ||
| 1756 | } | ||
| 1757 | else | ||
| 1758 | { | ||
| 1759 | float rgba[4]; | ||
| 1760 | |||
| 1761 | rgba[0] = gc->back_color.red / 65535.0f; | ||
| 1762 | rgba[1] = gc->back_color.green / 65535.0f; | ||
| 1763 | rgba[2] = gc->back_color.blue / 65535.0f; | ||
| 1764 | rgba[3] = 1.0f; | ||
| 1765 | gc->cg_back_color = CGColorCreate (mac_cg_color_space_rgb, rgba); | ||
| 1766 | } | ||
| 1767 | } | ||
| 1768 | #endif | ||
| 1639 | } | 1769 | } |
| 1640 | } | 1770 | } |
| 1641 | 1771 | ||
| @@ -8738,14 +8868,18 @@ extern void mac_find_apple_event_spec P_ ((AEEventClass, AEEventID, | |||
| 8738 | extern OSErr init_coercion_handler P_ ((void)); | 8868 | extern OSErr init_coercion_handler P_ ((void)); |
| 8739 | 8869 | ||
| 8740 | /* Drag and Drop */ | 8870 | /* Drag and Drop */ |
| 8741 | OSErr install_drag_handler P_ ((WindowRef)); | 8871 | extern OSErr install_drag_handler P_ ((WindowRef)); |
| 8742 | void remove_drag_handler P_ ((WindowRef)); | 8872 | extern void remove_drag_handler P_ ((WindowRef)); |
| 8873 | |||
| 8874 | /* Showing help echo string during menu tracking */ | ||
| 8875 | extern OSStatus install_menu_target_item_handler P_ ((WindowPtr)); | ||
| 8743 | 8876 | ||
| 8744 | #if USE_CARBON_EVENTS | 8877 | #if USE_CARBON_EVENTS |
| 8745 | #ifdef MAC_OSX | 8878 | #ifdef MAC_OSX |
| 8746 | extern void init_service_handler (); | 8879 | extern void init_service_handler (); |
| 8747 | static Lisp_Object Qservice, Qpaste, Qperform; | 8880 | static Lisp_Object Qservice, Qpaste, Qperform; |
| 8748 | #endif | 8881 | #endif |
| 8882 | |||
| 8749 | /* Window Event Handler */ | 8883 | /* Window Event Handler */ |
| 8750 | static pascal OSStatus mac_handle_window_event (EventHandlerCallRef, | 8884 | static pascal OSStatus mac_handle_window_event (EventHandlerCallRef, |
| 8751 | EventRef, void *); | 8885 | EventRef, void *); |
| @@ -10168,6 +10302,8 @@ install_window_handler (window) | |||
| 10168 | #endif | 10302 | #endif |
| 10169 | if (err == noErr) | 10303 | if (err == noErr) |
| 10170 | err = install_drag_handler (window); | 10304 | err = install_drag_handler (window); |
| 10305 | if (err == noErr) | ||
| 10306 | err = install_menu_target_item_handler (window); | ||
| 10171 | 10307 | ||
| 10172 | return err; | 10308 | return err; |
| 10173 | } | 10309 | } |
| @@ -10215,7 +10351,7 @@ main (void) | |||
| 10215 | 10351 | ||
| 10216 | #if __MWERKS__ | 10352 | #if __MWERKS__ |
| 10217 | /* set creator and type for files created by MSL */ | 10353 | /* set creator and type for files created by MSL */ |
| 10218 | _fcreator = 'EMAx'; | 10354 | _fcreator = MAC_EMACS_CREATOR_CODE; |
| 10219 | _ftype = 'TEXT'; | 10355 | _ftype = 'TEXT'; |
| 10220 | #endif | 10356 | #endif |
| 10221 | 10357 | ||
| @@ -11692,6 +11828,8 @@ mac_initialize () | |||
| 11692 | #endif | 11828 | #endif |
| 11693 | 11829 | ||
| 11694 | #if USE_CG_DRAWING | 11830 | #if USE_CG_DRAWING |
| 11831 | init_cg_color (); | ||
| 11832 | |||
| 11695 | mac_init_fringe (); | 11833 | mac_init_fringe (); |
| 11696 | #endif | 11834 | #endif |
| 11697 | 11835 | ||
diff --git a/src/macterm.h b/src/macterm.h index a7e4ccff775..c941fafb690 100644 --- a/src/macterm.h +++ b/src/macterm.h | |||
| @@ -528,6 +528,11 @@ struct scroll_bar { | |||
| 528 | #define HOURGLASS_HEIGHT 16 | 528 | #define HOURGLASS_HEIGHT 16 |
| 529 | 529 | ||
| 530 | /* Some constants that are used locally. */ | 530 | /* Some constants that are used locally. */ |
| 531 | /* Creator code for Emacs on Mac OS. */ | ||
| 532 | enum { | ||
| 533 | MAC_EMACS_CREATOR_CODE = 'EMAx' | ||
| 534 | }; | ||
| 535 | |||
| 531 | /* Apple event descriptor types */ | 536 | /* Apple event descriptor types */ |
| 532 | enum { | 537 | enum { |
| 533 | TYPE_FILE_NAME = 'fNam' | 538 | TYPE_FILE_NAME = 'fNam' |
diff --git a/src/minibuf.c b/src/minibuf.c index 7b276a2e925..3778d185e97 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -989,7 +989,7 @@ POSITION in the minibuffer. Any integer value less than or equal to | |||
| 989 | one puts point at the beginning of the string. *Note* that this | 989 | one puts point at the beginning of the string. *Note* that this |
| 990 | behavior differs from the way such arguments are used in `completing-read' | 990 | behavior differs from the way such arguments are used in `completing-read' |
| 991 | and some related functions, which use zero-indexing for POSITION. */) | 991 | and some related functions, which use zero-indexing for POSITION. */) |
| 992 | (prompt, initial_contents, keymap, read, hist, default_value, inherit_input_method) | 992 | (prompt, initial_contents, keymap, read, hist, default_value, inherit_input_method) |
| 993 | Lisp_Object prompt, initial_contents, keymap, read, hist, default_value; | 993 | Lisp_Object prompt, initial_contents, keymap, read, hist, default_value; |
| 994 | Lisp_Object inherit_input_method; | 994 | Lisp_Object inherit_input_method; |
| 995 | { | 995 | { |
diff --git a/src/window.c b/src/window.c index b34cc3659c1..00a2e06bdeb 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -1184,7 +1184,8 @@ if it isn't already recorded. */) | |||
| 1184 | 1184 | ||
| 1185 | if (! NILP (update) | 1185 | if (! NILP (update) |
| 1186 | && ! (! NILP (w->window_end_valid) | 1186 | && ! (! NILP (w->window_end_valid) |
| 1187 | && XFASTINT (w->last_modified) >= BUF_MODIFF (b)) | 1187 | && XFASTINT (w->last_modified) >= BUF_MODIFF (b) |
| 1188 | && XFASTINT (w->last_overlay_modified) >= BUF_OVERLAY_MODIFF (b)) | ||
| 1188 | && !noninteractive) | 1189 | && !noninteractive) |
| 1189 | { | 1190 | { |
| 1190 | struct text_pos startp; | 1191 | struct text_pos startp; |