diff options
| author | Kenichi Handa | 2010-04-20 16:26:02 +0900 |
|---|---|---|
| committer | Kenichi Handa | 2010-04-20 16:26:02 +0900 |
| commit | 1f2f0b2818b884e44db792729a92ccff2f766a26 (patch) | |
| tree | 7b547b9a0a586d1dc76884ecbb1dcdd29415f740 | |
| parent | c0be27fda00b238ea82e43a8590a96c3a9ae9023 (diff) | |
| parent | ce5b453a449e4e7729abb5128114e2687f08360d (diff) | |
| download | emacs-1f2f0b2818b884e44db792729a92ccff2f766a26.tar.gz emacs-1f2f0b2818b884e44db792729a92ccff2f766a26.zip | |
merge trunk
70 files changed, 2301 insertions, 1338 deletions
diff --git a/admin/notes/bugtracker b/admin/notes/bugtracker index 19a383dff5b..5936eead85a 100644 --- a/admin/notes/bugtracker +++ b/admin/notes/bugtracker | |||
| @@ -4,7 +4,7 @@ The Emacs Bug Tracker can be found at http://debbugs.gnu.org/ | |||
| 4 | 4 | ||
| 5 | * Quick-start guide | 5 | * Quick-start guide |
| 6 | 6 | ||
| 7 | This is 95% of all you will ever need. | 7 | This is 95% of all you will ever need to know. |
| 8 | 8 | ||
| 9 | ** How do I report a bug? | 9 | ** How do I report a bug? |
| 10 | Use M-x report-emacs-bug, or send mail to bug-gnu-emacs@gnu.org. | 10 | Use M-x report-emacs-bug, or send mail to bug-gnu-emacs@gnu.org. |
| @@ -34,8 +34,12 @@ tags 123 moreinfo|unreproducible|wontfix|patch | |||
| 34 | 34 | ||
| 35 | For a list of all bugs, see http://debbugs.gnu.org/db/pa/lemacs.html | 35 | For a list of all bugs, see http://debbugs.gnu.org/db/pa/lemacs.html |
| 36 | This is a static page, updated once a day. There is also a dynamic | 36 | This is a static page, updated once a day. There is also a dynamic |
| 37 | list, generated on request, but since there are many bug reports this | 37 | list, generated on request. This accepts various options, eg to see |
| 38 | is slow and not recommended. | 38 | the most recent bugs: |
| 39 | |||
| 40 | http://debbugs.gnu.org/cgi/pkgreport.cgi?newest=100 | ||
| 41 | |||
| 42 | Or follow the links on the front page http://debbugs.gnu.org . | ||
| 39 | 43 | ||
| 40 | ** How do I report a bug in Emacs now? | 44 | ** How do I report a bug in Emacs now? |
| 41 | The same way as you always did. Send mail to bug-gnu-emacs@gnu.org, | 45 | The same way as you always did. Send mail to bug-gnu-emacs@gnu.org, |
| @@ -92,6 +96,9 @@ mail with the bug report number in. If you do not do this, each reply | |||
| 92 | in the subsequent discussion will end up creating a new bug. | 96 | in the subsequent discussion will end up creating a new bug. |
| 93 | This is annoying. | 97 | This is annoying. |
| 94 | 98 | ||
| 99 | (So annoying that a form of message-id tracking has been implemented | ||
| 100 | to hopefully stop this happening, but it is still better to use X-Debbugs-CC.) | ||
| 101 | |||
| 95 | If a new report contains X-Debbugs-CC in the input, this is | 102 | If a new report contains X-Debbugs-CC in the input, this is |
| 96 | converted to a real Cc header in the output. (See Bug#1720). | 103 | converted to a real Cc header in the output. (See Bug#1720). |
| 97 | It is also merged into the Resent-CC header (see below). | 104 | It is also merged into the Resent-CC header (see below). |
| @@ -191,8 +198,7 @@ Package: emacs | |||
| 191 | Version: 23.0.60 | 198 | Version: 23.0.60 |
| 192 | Severity: minor | 199 | Severity: minor |
| 193 | 200 | ||
| 194 | Optionally, add a sub-package, eg Package: emacs,calendar. | 201 | This can also include tags. Some things (e.g. submitter) don't seem to |
| 195 | This can include tags. Some things (e.g. submitter) don't seem to | ||
| 196 | work here. | 202 | work here. |
| 197 | 203 | ||
| 198 | Otherwise, send mail to the control server, control@debbugs.gnu.org. | 204 | Otherwise, send mail to the control server, control@debbugs.gnu.org. |
| @@ -229,7 +235,7 @@ http://debbugs.gnu.org/... | |||
| 229 | 235 | ||
| 230 | 123 # given bug number | 236 | 123 # given bug number |
| 231 | 123;mbox=yes # mbox version of given bug | 237 | 123;mbox=yes # mbox version of given bug |
| 232 | package # bugs in given package (don't use "emacs" - too many bugs!) | 238 | package # bugs in given package |
| 233 | from:submitter@email.address | 239 | from:submitter@email.address |
| 234 | severity:severity # all bugs of given severity | 240 | severity:severity # all bugs of given severity |
| 235 | tag:tag # all bugs with given tag | 241 | tag:tag # all bugs with given tag |
| @@ -281,6 +287,9 @@ to construct the relevant url yourself rather than just typing in a | |||
| 281 | search box. The only piece you really need to add is the "users" | 287 | search box. The only piece you really need to add is the "users" |
| 282 | portion, the rest has the same syntax as normal. | 288 | portion, the rest has the same syntax as normal. |
| 283 | 289 | ||
| 290 | **** To browse bugs by usertag: | ||
| 291 | http://debbugs.gnu.org/cgi/pkgindex.cgi?indexon=users | ||
| 292 | |||
| 284 | **** To find all bugs usertagged by a given email address: | 293 | **** To find all bugs usertagged by a given email address: |
| 285 | 294 | ||
| 286 | http://debbugs.gnu.org/cgi/pkgreport.cgi?users=bug-gnu-emacs@gnu.org | 295 | http://debbugs.gnu.org/cgi/pkgreport.cgi?users=bug-gnu-emacs@gnu.org |
| @@ -359,7 +368,7 @@ fixed 123 23.0.60 | |||
| 359 | notfixed 123 23.0.60 | 368 | notfixed 123 23.0.60 |
| 360 | 369 | ||
| 361 | *** To assign or reassign a bug to a package or list of packages: | 370 | *** To assign or reassign a bug to a package or list of packages: |
| 362 | reassign 1234 emacs,cc-mode | 371 | reassign 1234 emacs |
| 363 | 372 | ||
| 364 | ** To remove spam from the tracker, move it to the `spam' pseudo-package: | 373 | ** To remove spam from the tracker, move it to the `spam' pseudo-package: |
| 365 | reassign 123 spam | 374 | reassign 123 spam |
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index d589694e168..7c050b83af7 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,3 +1,42 @@ | |||
| 1 | 2010-04-18 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * programs.texi (Semantic): New node. | ||
| 4 | |||
| 5 | * maintaining.texi (EDE): New node. | ||
| 6 | |||
| 7 | * emacs.texi: Update node listing. | ||
| 8 | |||
| 9 | * misc.texi (Gnus): Use the `C-h i' keybinding for info. | ||
| 10 | |||
| 11 | 2010-04-18 Glenn Morris <rgm@gnu.org> | ||
| 12 | |||
| 13 | * emacs.texi (Acknowledgments): Remove duplicate. | ||
| 14 | |||
| 15 | * maintaining.texi (VC Directory Commands): Mention stashes and shelves. | ||
| 16 | |||
| 17 | 2010-04-18 Glenn Morris <rgm@gnu.org> | ||
| 18 | |||
| 19 | * dired.texi (Misc Dired Features): Mention VC diff and log. | ||
| 20 | * maintaining.texi (Old Revisions, VC Change Log): | ||
| 21 | Mention that diff and log work in Dired buffers. | ||
| 22 | |||
| 23 | * help.texi (Help Summary): Mention M-x info-finder. | ||
| 24 | |||
| 25 | * ack.texi (Acknowledgments): Add mpc.el. | ||
| 26 | |||
| 27 | * custom.texi (Specifying File Variables, Directory Variables): | ||
| 28 | Document new commands for manipulating local variable lists. | ||
| 29 | |||
| 30 | 2010-04-18 Glenn Morris <rgm@gnu.org> | ||
| 31 | |||
| 32 | * trouble.texi (Contributing): Add cindex entry. | ||
| 33 | Mention etc/CONTRIBUTE. | ||
| 34 | |||
| 35 | 2010-04-18 Chong Yidong <cyd@stupidchicken.com> | ||
| 36 | |||
| 37 | * mark.texi (Persistent Mark): Copyedits. Replace undo example with | ||
| 38 | query-replace (Bug#5774). | ||
| 39 | |||
| 1 | 2010-04-16 Glenn Morris <rgm@gnu.org> | 40 | 2010-04-16 Glenn Morris <rgm@gnu.org> |
| 2 | 41 | ||
| 3 | * ack.texi, emacs.texi (Acknowledgments): Update for Org changes. | 42 | * ack.texi, emacs.texi (Acknowledgments): Update for Org changes. |
diff --git a/doc/emacs/ack.texi b/doc/emacs/ack.texi index bb2e9c926a0..2d4636dd74f 100644 --- a/doc/emacs/ack.texi +++ b/doc/emacs/ack.texi | |||
| @@ -801,8 +801,9 @@ a directory-level front end to the CVS version control system; | |||
| 801 | @file{reveal.el}, a minor mode for automatically revealing invisible | 801 | @file{reveal.el}, a minor mode for automatically revealing invisible |
| 802 | text; @file{smerge-mode.el}, a minor mode for resolving @code{diff3} | 802 | text; @file{smerge-mode.el}, a minor mode for resolving @code{diff3} |
| 803 | conflicts; @file{diff-mode.el}, a mode for viewing and editing context | 803 | conflicts; @file{diff-mode.el}, a mode for viewing and editing context |
| 804 | diffs; @file{css-mode.el} for Cascading Style Sheets; and | 804 | diffs; @file{css-mode.el} for Cascading Style Sheets; |
| 805 | @file{bibtex-style.el} for BibTeX Style files. | 805 | @file{bibtex-style.el} for BibTeX Style files; and @file{mpc.el}, a |
| 806 | client for the ``Music Player Daemon''. | ||
| 806 | 807 | ||
| 807 | @item | 808 | @item |
| 808 | Morioka Tomohiko wrote several packages for MIME support in Gnus and | 809 | Morioka Tomohiko wrote several packages for MIME support in Gnus and |
diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index f0faec4d40c..a8bba419c25 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | @c This is part of the Emacs manual. | 1 | @c This is part of the Emacs manual. |
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, | 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, |
| 3 | @c 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. | 3 | @c 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 |
| 4 | @c Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | 5 | @c See file emacs.texi for copying conditions. |
| 5 | @node Customization, Quitting, Amusements, Top | 6 | @node Customization, Quitting, Amusements, Top |
| 6 | @chapter Customization | 7 | @chapter Customization |
| @@ -1086,11 +1087,22 @@ You can specify any number of variable/value pairs in this way, each | |||
| 1086 | pair with a colon and semicolon as shown above. The special | 1087 | pair with a colon and semicolon as shown above. The special |
| 1087 | variable/value pair @code{mode: @var{modename};}, if present, | 1088 | variable/value pair @code{mode: @var{modename};}, if present, |
| 1088 | specifies a major or minor mode; if you use this to specify a major | 1089 | specifies a major or minor mode; if you use this to specify a major |
| 1089 | mode, it should come first in the line. The @var{value}s are are used | 1090 | mode, it should come first in the line. The @var{value}s are used |
| 1090 | literally, and not evaluated. | 1091 | literally, and not evaluated. |
| 1091 | 1092 | ||
| 1092 | Here is an example that specifies Lisp mode and sets two variables | 1093 | @findex add-file-local-variable-prop-line |
| 1093 | with numeric values: | 1094 | @findex delete-file-local-variable-prop-line |
| 1095 | @findex copy-dir-locals-to-file-locals-prop-line | ||
| 1096 | You can use the command @code{add-file-local-variable-prop-line} | ||
| 1097 | instead of adding entries by hand. It prompts for a variable | ||
| 1098 | and value, and adds them to the first line in the appropriate way. | ||
| 1099 | The command @code{delete-file-local-variable-prop-line} deletes a | ||
| 1100 | variable from the line. The command | ||
| 1101 | @code{copy-dir-locals-to-file-locals-prop-line} copies directory-local | ||
| 1102 | variables (@pxref{Directory Variables}) to the first line. | ||
| 1103 | |||
| 1104 | Here is an example first line that specifies Lisp mode and sets two | ||
| 1105 | variables with numeric values: | ||
| 1094 | 1106 | ||
| 1095 | @smallexample | 1107 | @smallexample |
| 1096 | ;; -*- mode: Lisp; fill-column: 75; comment-column: 50; -*- | 1108 | ;; -*- mode: Lisp; fill-column: 75; comment-column: 50; -*- |
| @@ -1144,6 +1156,17 @@ won't confuse other programs that the file is intended for. The | |||
| 1144 | example above is for the C programming language, where comment lines | 1156 | example above is for the C programming language, where comment lines |
| 1145 | start with @samp{/*} and end with @samp{*/}. | 1157 | start with @samp{/*} and end with @samp{*/}. |
| 1146 | 1158 | ||
| 1159 | @findex add-file-local-variable | ||
| 1160 | @findex delete-file-local-variable | ||
| 1161 | @findex copy-dir-locals-to-file-locals | ||
| 1162 | You can construct the local variables list yourself, or use the | ||
| 1163 | command @code{add-file-local-variable}. This prompts for a variable | ||
| 1164 | and value, and adds them to the list. If necessary, it also adds the | ||
| 1165 | start and end markers. The command @code{delete-file-local-variable} | ||
| 1166 | deletes a variable from the list. The command | ||
| 1167 | @code{copy-dir-locals-to-file-locals} copies directory-local variables | ||
| 1168 | (@pxref{Directory Variables}) to the list. | ||
| 1169 | |||
| 1147 | As with the @samp{-*-} line, the variables in a local variables list | 1170 | As with the @samp{-*-} line, the variables in a local variables list |
| 1148 | are used literally, and are not evaluated first. If you want to split | 1171 | are used literally, and are not evaluated first. If you want to split |
| 1149 | a long string across multiple lines of the file, you can use | 1172 | a long string across multiple lines of the file, you can use |
| @@ -1323,6 +1346,16 @@ style for any C or Java source file. Finally, it specifies a different | |||
| 1323 | subdirectory of the directory where you put the @file{.dir-locals.el} | 1346 | subdirectory of the directory where you put the @file{.dir-locals.el} |
| 1324 | file. | 1347 | file. |
| 1325 | 1348 | ||
| 1349 | @findex add-dir-local-variable | ||
| 1350 | @findex delete-dir-local-variable | ||
| 1351 | @findex copy-file-locals-to-dir-locals | ||
| 1352 | You can edit the @file{.dir-locals.el} file by hand, or use the | ||
| 1353 | command @code{add-dir-local-variable}. This prompts for a mode (or | ||
| 1354 | subdirectory), variable and value, and adds an entry to the file. | ||
| 1355 | The command @code{delete-dir-local-variable} deletes an entry. The | ||
| 1356 | command @code{copy-file-locals-to-dir-locals} copies file local | ||
| 1357 | variables (@pxref{File Variables}) to the @file{.dir-locals.el} file. | ||
| 1358 | |||
| 1326 | @findex dir-locals-set-class-variables | 1359 | @findex dir-locals-set-class-variables |
| 1327 | @findex dir-locals-set-directory-class | 1360 | @findex dir-locals-set-directory-class |
| 1328 | Another method of specifying directory-local variables is to explicitly | 1361 | Another method of specifying directory-local variables is to explicitly |
diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi index f1a8b0aa9c1..f6a4572f8dd 100644 --- a/doc/emacs/dired.texi +++ b/doc/emacs/dired.texi | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | @c This is part of the Emacs manual. | 1 | @c This is part of the Emacs manual. |
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, | 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, |
| 3 | @c 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. | 3 | @c 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 |
| 4 | @c Free Software Foundation, Inc. | ||
| 4 | @c See file emacs.texi for copying conditions. | 5 | @c See file emacs.texi for copying conditions. |
| 5 | @node Dired, Calendar/Diary, Rmail, Top | 6 | @node Dired, Calendar/Diary, Rmail, Top |
| 6 | @chapter Dired, the Directory Editor | 7 | @chapter Dired, the Directory Editor |
| @@ -1339,6 +1340,11 @@ names into arguments for other Emacs commands. It also displays what | |||
| 1339 | it added to the kill ring, so you can use it to display the list of | 1340 | it added to the kill ring, so you can use it to display the list of |
| 1340 | currently marked files in the echo area. | 1341 | currently marked files in the echo area. |
| 1341 | 1342 | ||
| 1343 | @cindex Dired and version control | ||
| 1344 | If the directory you are visiting is under version control | ||
| 1345 | (@pxref{Version Control}), then the normal VC diff and log commands | ||
| 1346 | will operate on the selected files. | ||
| 1347 | |||
| 1342 | @findex dired-compare-directories | 1348 | @findex dired-compare-directories |
| 1343 | The command @kbd{M-x dired-compare-directories} is used to compare | 1349 | The command @kbd{M-x dired-compare-directories} is used to compare |
| 1344 | the current Dired buffer with another directory. It marks all the files | 1350 | the current Dired buffer with another directory. It marks all the files |
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index a92da3b4842..d4f6c1af92c 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi | |||
| @@ -649,6 +649,7 @@ Editing Programs | |||
| 649 | * Hideshow:: Displaying blocks selectively. | 649 | * Hideshow:: Displaying blocks selectively. |
| 650 | * Symbol Completion:: Completion on symbol names of your program or language. | 650 | * Symbol Completion:: Completion on symbol names of your program or language. |
| 651 | * Glasses:: Making identifiersLikeThis more readable. | 651 | * Glasses:: Making identifiersLikeThis more readable. |
| 652 | * Semantic:: Suite of editing tools based on source code parsing. | ||
| 652 | * Misc for Programs:: Other Emacs features useful for editing programs. | 653 | * Misc for Programs:: Other Emacs features useful for editing programs. |
| 653 | * C Modes:: Special commands of C, C++, Objective-C, | 654 | * C Modes:: Special commands of C, C++, Objective-C, |
| 654 | Java, and Pike modes. | 655 | Java, and Pike modes. |
| @@ -763,6 +764,7 @@ Maintaining Large Programs | |||
| 763 | * Change Log:: Maintaining a change history for your program. | 764 | * Change Log:: Maintaining a change history for your program. |
| 764 | * Tags:: Go directly to any function in your program in one | 765 | * Tags:: Go directly to any function in your program in one |
| 765 | command. Tags remembers which file it is in. | 766 | command. Tags remembers which file it is in. |
| 767 | * EDE:: An integrated development environment for Emacs. | ||
| 766 | * Emerge:: A convenient way of merging two versions of a program. | 768 | * Emerge:: A convenient way of merging two versions of a program. |
| 767 | 769 | ||
| 768 | Version Control | 770 | Version Control |
diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi index 4ee1a728ae6..ac3539881d8 100644 --- a/doc/emacs/help.texi +++ b/doc/emacs/help.texi | |||
| @@ -133,7 +133,9 @@ Display documentation of the current major mode (@code{describe-mode}). | |||
| 133 | @item C-h n | 133 | @item C-h n |
| 134 | Display news of recent Emacs changes (@code{view-emacs-news}). | 134 | Display news of recent Emacs changes (@code{view-emacs-news}). |
| 135 | @item C-h p | 135 | @item C-h p |
| 136 | Find packages by topic keyword (@code{finder-by-keyword}). | 136 | Find packages by topic keyword (@code{finder-by-keyword}). For an |
| 137 | alternative interface to the same information, try the @code{info-finder} | ||
| 138 | command. | ||
| 137 | @item C-h r | 139 | @item C-h r |
| 138 | Display the Emacs manual in Info (@code{info-emacs-manual}). | 140 | Display the Emacs manual in Info (@code{info-emacs-manual}). |
| 139 | @item C-h s | 141 | @item C-h s |
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 8cc5b97d919..8c417bc12ac 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi | |||
| @@ -14,6 +14,7 @@ programs. | |||
| 14 | * Change Log:: Maintaining a change history for your program. | 14 | * Change Log:: Maintaining a change history for your program. |
| 15 | * Tags:: Go directly to any function in your program in one | 15 | * Tags:: Go directly to any function in your program in one |
| 16 | command. Tags remembers which file it is in. | 16 | command. Tags remembers which file it is in. |
| 17 | * EDE:: An integrated development environment for Emacs. | ||
| 17 | @ifnottex | 18 | @ifnottex |
| 18 | * Emerge:: A convenient way of merging two versions of a program. | 19 | * Emerge:: A convenient way of merging two versions of a program. |
| 19 | @end ifnottex | 20 | @end ifnottex |
| @@ -653,7 +654,8 @@ its own (@code{vc-revision-other-window}). | |||
| 653 | @item C-x v = | 654 | @item C-x v = |
| 654 | Compare the files in the current fileset with the working revision(s) | 655 | Compare the files in the current fileset with the working revision(s) |
| 655 | you started from (@code{vc-diff}). With a prefix argument, prompt for | 656 | you started from (@code{vc-diff}). With a prefix argument, prompt for |
| 656 | two revisions of the current fileset and compare them. | 657 | two revisions of the current fileset and compare them. You can call |
| 658 | this command from a Dired buffer (@pxref{Dired}). | ||
| 657 | 659 | ||
| 658 | @item C-x v D | 660 | @item C-x v D |
| 659 | Compare the entire tree corresponding to the current fileset with the | 661 | Compare the entire tree corresponding to the current fileset with the |
| @@ -895,6 +897,7 @@ i.e. the ones you enter via the @samp{*VC-Log*} buffer. @xref{Log | |||
| 895 | Buffer}.) Point is centered at the revision of the file currently | 897 | Buffer}.) Point is centered at the revision of the file currently |
| 896 | being visited. With a prefix argument, the command prompts for the | 898 | being visited. With a prefix argument, the command prompts for the |
| 897 | revision to center on, and the maximum number of revisions to display. | 899 | revision to center on, and the maximum number of revisions to display. |
| 900 | You can call this command from a Dired buffer (@pxref{Dired}). | ||
| 898 | 901 | ||
| 899 | @findex vc-print-root-log | 902 | @findex vc-print-root-log |
| 900 | Type @kbd{C-x v L} (@code{vc-print-root-log}) to display a | 903 | Type @kbd{C-x v L} (@code{vc-print-root-log}) to display a |
| @@ -1145,9 +1148,14 @@ directory buffer will be used. | |||
| 1145 | 1148 | ||
| 1146 | @kbd{M-s a C-M-s} does an incremental search on the marked files. | 1149 | @kbd{M-s a C-M-s} does an incremental search on the marked files. |
| 1147 | 1150 | ||
| 1148 | Commands are also accessible from the VC-dir menu. Note that some VC | 1151 | @cindex stashes in version control |
| 1149 | backends use the VC-dir menu to make available extra backend specific | 1152 | @cindex shelves in version control |
| 1150 | commands. | 1153 | Commands are also accessible from the VC-dir menu. Note that some |
| 1154 | VC backends use the VC-dir menu to make available extra, | ||
| 1155 | backend-specific, commands. For example, Git and Bazaar allow you to | ||
| 1156 | manipulate @dfn{stashes} and @dfn{shelves}. (These provide a | ||
| 1157 | mechanism to temporarily store uncommitted changes somewhere out of | ||
| 1158 | the way, and bring them back at a later time.) | ||
| 1151 | 1159 | ||
| 1152 | Normal VC commands with the @kbd{C-x v} prefix work in VC directory | 1160 | Normal VC commands with the @kbd{C-x v} prefix work in VC directory |
| 1153 | buffers. Some single-key shortcuts are available as well; @kbd{=}, | 1161 | buffers. Some single-key shortcuts are available as well; @kbd{=}, |
| @@ -2260,6 +2268,69 @@ name in the buffer. @xref{Symbol Completion}. | |||
| 2260 | @include emerge-xtra.texi | 2268 | @include emerge-xtra.texi |
| 2261 | @end ifnottex | 2269 | @end ifnottex |
| 2262 | 2270 | ||
| 2271 | @node EDE | ||
| 2272 | @section Emacs Development Environment | ||
| 2273 | @cindex EDE (Emacs Development Environment) | ||
| 2274 | @cindex Emacs Development Environment | ||
| 2275 | @cindex Integrated development environment | ||
| 2276 | |||
| 2277 | EDE (@dfn{Emacs Development Environment}) is a package that simplifies | ||
| 2278 | the task of creating, building, and debugging large programs with | ||
| 2279 | Emacs. It provides some of the features of an IDE, or @dfn{Integrated | ||
| 2280 | Development Environment}, in Emacs. | ||
| 2281 | |||
| 2282 | This section provides a brief description of EDE usage. | ||
| 2283 | @ifnottex | ||
| 2284 | For full details, see @ref{Top, EDE,, ede, Emacs Development Environment}. | ||
| 2285 | @end ifnottex | ||
| 2286 | @iftex | ||
| 2287 | For full details on Ede, type @kbd{C-h i} and then select the EDE | ||
| 2288 | manual. | ||
| 2289 | @end iftex | ||
| 2290 | |||
| 2291 | EDE is implemented as a global minor mode (@pxref{Minor Modes}). To | ||
| 2292 | enable it, type @kbd{M-x global-ede-mode} or click on the | ||
| 2293 | @samp{Project Support (EDE)} item in the @samp{Tools} menu. You can | ||
| 2294 | also enable EDE each time you start Emacs, by adding the following | ||
| 2295 | line to your initialization file: | ||
| 2296 | |||
| 2297 | @smallexample | ||
| 2298 | (global-ede-mode t) | ||
| 2299 | @end smallexample | ||
| 2300 | |||
| 2301 | @noindent | ||
| 2302 | Activating EDE adds a menu named @samp{Development} to the menu bar. | ||
| 2303 | Many EDE commands, including the ones described below, can be invoked | ||
| 2304 | from this menu. | ||
| 2305 | |||
| 2306 | EDE organizes files into @dfn{projects}, which correspond to | ||
| 2307 | directory trees. The @dfn{project root} is the topmost directory of a | ||
| 2308 | project. To define a new project, visit a file in the desired project | ||
| 2309 | root and type @kbd{M-x ede-new}. This command prompts for a | ||
| 2310 | @dfn{project type}, which refers to the underlying method that EDE | ||
| 2311 | will use to manage the project (@pxref{Creating a Project, EDE,, ede, | ||
| 2312 | Emacs Development Environment}). The most common project types are | ||
| 2313 | @samp{Make}, which uses Makefiles, and @samp{Automake}, which uses GNU | ||
| 2314 | Automake (@pxref{Top, Automake,, automake, Automake}). In both cases, | ||
| 2315 | EDE also creates a file named @file{Project.ede}, which stores | ||
| 2316 | information about the project. | ||
| 2317 | |||
| 2318 | A project may contain one or more @dfn{targets}. A target can be an | ||
| 2319 | object file, executable program, or some other type of file, which is | ||
| 2320 | ``built'' from one or more of the files in the project. | ||
| 2321 | |||
| 2322 | To add a new @dfn{target} to a project, type @kbd{C-c . t} | ||
| 2323 | (@code{M-x ede-new-target}). This command also asks if you wish to | ||
| 2324 | ``add'' the current file to that target, which means that the target | ||
| 2325 | is to be built from that file. After you have defined a target, you | ||
| 2326 | can add more files to it by typing @kbd{C-c . a} | ||
| 2327 | (@code{ede-add-file}). | ||
| 2328 | |||
| 2329 | To build a target, type @kbd{C-c . c} (@code{ede-compile-target}). | ||
| 2330 | To build all the targets in the project, type @kbd{C-c . C} | ||
| 2331 | (@code{ede-compile-project}). EDE uses the file types to guess how | ||
| 2332 | the target should be built. | ||
| 2333 | |||
| 2263 | @ignore | 2334 | @ignore |
| 2264 | arch-tag: b9d83dfb-82ea-4ff6-bab5-05a3617091fb | 2335 | arch-tag: b9d83dfb-82ea-4ff6-bab5-05a3617091fb |
| 2265 | @end ignore | 2336 | @end ignore |
diff --git a/doc/emacs/mark.texi b/doc/emacs/mark.texi index 5cf166c0cbf..217d5b1b06d 100644 --- a/doc/emacs/mark.texi +++ b/doc/emacs/mark.texi | |||
| @@ -387,10 +387,10 @@ Mark}), or with shift-selection (@pxref{Shift Selection}). | |||
| 387 | 387 | ||
| 388 | @findex transient-mark-mode | 388 | @findex transient-mark-mode |
| 389 | To turn off Transient Mark mode, type @kbd{M-x transient-mark-mode}. | 389 | To turn off Transient Mark mode, type @kbd{M-x transient-mark-mode}. |
| 390 | This command toggles the mode; you can use the same command to turn | 390 | This command toggles the mode; you can use the same command to turn it |
| 391 | Transient Mark mode on again. You can also turn off Transient Mark | 391 | on again. You can also toggle Transient Mark mode using the |
| 392 | mode using the menu bar: in the @samp{Options} menu, toggle the | 392 | @samp{Active Region Highlighting} menu item in the @samp{Options} |
| 393 | @samp{Active Region Highlighting} menu item. | 393 | menu. |
| 394 | 394 | ||
| 395 | Here are the details of how Emacs behaves when Transient Mark mode | 395 | Here are the details of how Emacs behaves when Transient Mark mode |
| 396 | is off: | 396 | is off: |
| @@ -415,13 +415,12 @@ Many commands that move point long distances, like @kbd{M-<} and | |||
| 415 | @kbd{C-s}, first set the mark where point was. | 415 | @kbd{C-s}, first set the mark where point was. |
| 416 | 416 | ||
| 417 | @item | 417 | @item |
| 418 | Some commands, which ordinarily operate on the region when the mark is | 418 | Some commands, which ordinarily act on the region when the mark is |
| 419 | active, instead act on the entire buffer. For instance, @kbd{C-x u} | 419 | active, no longer do so. For example, normally @kbd{M-%} |
| 420 | normally reverses changes within the region if the mark is active; | 420 | (@code{query-replace}) performs replacements within the region, if the |
| 421 | when Transient Mark mode is off, it acts on the entire buffer. | 421 | mark is active. When Transient Mark mode is off, it always operates |
| 422 | However, you can type @kbd{C-u C-x u} to make it operate on the | 422 | from point to the end of the buffer. Commands that act this way are |
| 423 | region. @xref{Undo}. Other commands that act this way are identified | 423 | identified in their own documentation. |
| 424 | in their own documentation. | ||
| 425 | @end itemize | 424 | @end itemize |
| 426 | 425 | ||
| 427 | While Transient Mark mode is off, you can activate it temporarily | 426 | While Transient Mark mode is off, you can activate it temporarily |
| @@ -437,9 +436,9 @@ command twice.) | |||
| 437 | 436 | ||
| 438 | @item C-u C-x C-x | 437 | @item C-u C-x C-x |
| 439 | @kindex C-u C-x C-x | 438 | @kindex C-u C-x C-x |
| 440 | Activate the mark without changing it; enable Transient Mark mode just | 439 | Activate the mark and enable Transient Mark mode temporarily, until |
| 441 | once, until the mark is deactivated. (This is the @kbd{C-x C-x} | 440 | the mark is next deactivated. (This is the @kbd{C-x C-x} command, |
| 442 | command, @code{exchange-point-and-mark}, with a prefix argument.) | 441 | @code{exchange-point-and-mark}, with a prefix argument.) |
| 443 | @end table | 442 | @end table |
| 444 | 443 | ||
| 445 | These commands set or activate the mark, and enable Transient Mark | 444 | These commands set or activate the mark, and enable Transient Mark |
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index 808c3bfc3d3..7944a6b85e7 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi | |||
| @@ -203,7 +203,7 @@ Here we introduce Gnus and describe several basic features. | |||
| 203 | For full details, see @ref{Top, Gnus,, gnus, The Gnus Manual}. | 203 | For full details, see @ref{Top, Gnus,, gnus, The Gnus Manual}. |
| 204 | @end ifnottex | 204 | @end ifnottex |
| 205 | @iftex | 205 | @iftex |
| 206 | For full details on Gnus, type @kbd{M-x info} and then select the Gnus | 206 | For full details on Gnus, type @kbd{C-h i} and then select the Gnus |
| 207 | manual. | 207 | manual. |
| 208 | @end iftex | 208 | @end iftex |
| 209 | 209 | ||
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index dce6c38692e..72aa8ff121a 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi | |||
| @@ -39,6 +39,7 @@ Highlight program syntax (@pxref{Font Lock}). | |||
| 39 | * Hideshow:: Displaying blocks selectively. | 39 | * Hideshow:: Displaying blocks selectively. |
| 40 | * Symbol Completion:: Completion on symbol names of your program or language. | 40 | * Symbol Completion:: Completion on symbol names of your program or language. |
| 41 | * Glasses:: Making identifiersLikeThis more readable. | 41 | * Glasses:: Making identifiersLikeThis more readable. |
| 42 | * Semantic:: Suite of editing tools based on source code parsing. | ||
| 42 | * Misc for Programs:: Other Emacs features useful for editing programs. | 43 | * Misc for Programs:: Other Emacs features useful for editing programs. |
| 43 | * C Modes:: Special commands of C, C++, Objective-C, | 44 | * C Modes:: Special commands of C, C++, Objective-C, |
| 44 | Java, and Pike modes. | 45 | Java, and Pike modes. |
| @@ -1387,6 +1388,73 @@ current buffer; you can also add @code{glasses-mode} to the mode hook | |||
| 1387 | of the programming language major modes in which you normally want | 1388 | of the programming language major modes in which you normally want |
| 1388 | to use Glasses mode. | 1389 | to use Glasses mode. |
| 1389 | 1390 | ||
| 1391 | @node Semantic | ||
| 1392 | @section Semantic | ||
| 1393 | @cindex Semantic package | ||
| 1394 | |||
| 1395 | Semantic is a package that provides language-aware editing commands | ||
| 1396 | based on @code{source code parsers}. This section provides a brief | ||
| 1397 | description of Semantic; | ||
| 1398 | @ifnottex | ||
| 1399 | for full details, see @ref{Top, Semantic,, semantic, Semantic}. | ||
| 1400 | @end ifnottex | ||
| 1401 | @iftex | ||
| 1402 | for full details, type @kbd{C-h i} (@code{info}) and then select the | ||
| 1403 | Semantic manual. | ||
| 1404 | @end iftex | ||
| 1405 | |||
| 1406 | Most of the ``language aware'' features in Emacs, such as font lock | ||
| 1407 | (@pxref{Font Lock}), rely on ``rules of thumb''@footnote{Regular | ||
| 1408 | expressions and syntax tables.} that usually give good results but are | ||
| 1409 | never completely exact. In contrast, the parsers used by Semantic | ||
| 1410 | have an exact understanding of programming language syntax. This | ||
| 1411 | allows Semantic to provide search, navigation, and completion commands | ||
| 1412 | that are powerful and precise. | ||
| 1413 | |||
| 1414 | To begin using Semantic, type @kbd{M-x semantic-mode} or click on | ||
| 1415 | the menu item named @samp{Source Code Parsers (Semantic)} in the | ||
| 1416 | @samp{Tools} menu. This enables Semantic mode, a global minor mode. | ||
| 1417 | |||
| 1418 | When Semantic mode is enabled, Emacs automatically attempts to | ||
| 1419 | parses each file you visit. Currently, Semantic understands C, C++, | ||
| 1420 | Scheme, Javascript, Java, HTML, and Make. Within each parsed buffer, | ||
| 1421 | the following commands are available: | ||
| 1422 | |||
| 1423 | @table @kbd | ||
| 1424 | @item C-c , j | ||
| 1425 | @kindex C-c , j | ||
| 1426 | Prompt for the name of a function defined in the current file, and | ||
| 1427 | move point there (@code{semantic-complete-jump-local}). | ||
| 1428 | |||
| 1429 | @item C-c , J | ||
| 1430 | @kindex C-c , J | ||
| 1431 | Prompt for the name of a function defined in any file Emacs has | ||
| 1432 | parsed, and move point there (@code{semantic-complete-jump}). | ||
| 1433 | |||
| 1434 | @item C-c , @key{SPC} | ||
| 1435 | @kindex C-c , @key{SPC} | ||
| 1436 | Display a list of possible completions for the symbol at point | ||
| 1437 | (@code{semantic-complete-analyze-inline}). This also activates a set | ||
| 1438 | of special keybindings for choosing a completion: @key{RET} accepts | ||
| 1439 | the current completion, @kbd{M-n} and @kbd{M-p} cycle through possible | ||
| 1440 | completions, @key{TAB} completes as far as possible and then cycles, | ||
| 1441 | and @kbd{C-g} or any other key aborts completion. | ||
| 1442 | |||
| 1443 | @item C-c , l | ||
| 1444 | @kindex C-c , l | ||
| 1445 | Display a list of the possible completions of the symbol at point, in | ||
| 1446 | another window (@code{semantic-analyze-possible-completions}). | ||
| 1447 | @end table | ||
| 1448 | |||
| 1449 | @noindent | ||
| 1450 | In addition to the above commands, the Semantic package provides a | ||
| 1451 | variety of other ways to make use of parser information. For | ||
| 1452 | instance, you can use it to display a list of completions when Emacs | ||
| 1453 | is idle. | ||
| 1454 | @ifnottex | ||
| 1455 | @xref{Top, Semantic,, semantic, Semantic}, for details. | ||
| 1456 | @end ifnottex | ||
| 1457 | |||
| 1390 | @node Misc for Programs | 1458 | @node Misc for Programs |
| 1391 | @section Other Features Useful for Editing Programs | 1459 | @section Other Features Useful for Editing Programs |
| 1392 | 1460 | ||
diff --git a/doc/emacs/trouble.texi b/doc/emacs/trouble.texi index dd0d36c7601..69b5b82a056 100644 --- a/doc/emacs/trouble.texi +++ b/doc/emacs/trouble.texi | |||
| @@ -1008,6 +1008,7 @@ form that is clearly safe to install. | |||
| 1008 | 1008 | ||
| 1009 | @node Contributing, Service, Bugs, Top | 1009 | @node Contributing, Service, Bugs, Top |
| 1010 | @section Contributing to Emacs Development | 1010 | @section Contributing to Emacs Development |
| 1011 | @cindex contributing to Emacs | ||
| 1011 | 1012 | ||
| 1012 | If you would like to help pretest Emacs releases to assure they work | 1013 | If you would like to help pretest Emacs releases to assure they work |
| 1013 | well, or if you would like to work on improving Emacs, please contact | 1014 | well, or if you would like to work on improving Emacs, please contact |
| @@ -1027,6 +1028,9 @@ repository where it is actively maintained by a group of developers. | |||
| 1027 | See the Emacs project page | 1028 | See the Emacs project page |
| 1028 | @url{http://savannah.gnu.org/projects/emacs/} for details. | 1029 | @url{http://savannah.gnu.org/projects/emacs/} for details. |
| 1029 | 1030 | ||
| 1031 | For more information on how to contribute, see the @file{etc/CONTRIBUTE} | ||
| 1032 | file in the Emacs distribution. | ||
| 1033 | |||
| 1030 | @node Service, Copying, Contributing, Top | 1034 | @node Service, Copying, Contributing, Top |
| 1031 | @section How To Get Help with GNU Emacs | 1035 | @section How To Get Help with GNU Emacs |
| 1032 | 1036 | ||
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index d3b268e10c7..ee95040496c 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,17 @@ | |||
| 1 | 2010-04-14 Juri Linkov <juri@jurta.org> | ||
| 2 | |||
| 3 | Fix @deffn without category. | ||
| 4 | |||
| 5 | * abbrevs.texi (Abbrev Expansion): Replace @deffn with @defun | ||
| 6 | for `abbrev-insert'. | ||
| 7 | |||
| 8 | * buffers.texi (Indirect Buffers): Add category `Command' | ||
| 9 | to @deffn of `clone-indirect-buffer'. | ||
| 10 | |||
| 11 | * windows.texi (Cyclic Window Ordering): Replace @deffn with @defun | ||
| 12 | for `next-window' and `previous-window'. Add category `Command' | ||
| 13 | to @deffn of `pop-to-buffer'. | ||
| 14 | |||
| 1 | 2010-04-01 Chong Yidong <cyd@stupidchicken.com> | 15 | 2010-04-01 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 16 | ||
| 3 | * nonascii.texi (Text Representations): Don't mark | 17 | * nonascii.texi (Text Representations): Don't mark |
diff --git a/doc/lispref/abbrevs.texi b/doc/lispref/abbrevs.texi index 5434aa62357..1bb33475240 100644 --- a/doc/lispref/abbrevs.texi +++ b/doc/lispref/abbrevs.texi | |||
| @@ -281,7 +281,7 @@ function returns @code{nil} as its value, then @code{expand-abbrev} | |||
| 281 | returns @code{nil} even though expansion did occur. | 281 | returns @code{nil} even though expansion did occur. |
| 282 | @end deffn | 282 | @end deffn |
| 283 | 283 | ||
| 284 | @deffn abbrev-insert abbrev &optional name start end | 284 | @defun abbrev-insert abbrev &optional name start end |
| 285 | This function inserts the abbrev expansion of @code{abbrev}, replacing | 285 | This function inserts the abbrev expansion of @code{abbrev}, replacing |
| 286 | the text between @code{start} and @code{end}. If @code{start} is | 286 | the text between @code{start} and @code{end}. If @code{start} is |
| 287 | omitted, it defaults to point. @code{name}, if non-@code{nil}, should | 287 | omitted, it defaults to point. @code{name}, if non-@code{nil}, should |
| @@ -289,7 +289,7 @@ be the name by which this abbrev was found (a string); it is used to | |||
| 289 | figure out whether to adjust the capitalization of the expansion. The | 289 | figure out whether to adjust the capitalization of the expansion. The |
| 290 | function returns @code{abbrev} if the abbrev was successfully | 290 | function returns @code{abbrev} if the abbrev was successfully |
| 291 | inserted. | 291 | inserted. |
| 292 | @end deffn | 292 | @end defun |
| 293 | 293 | ||
| 294 | @deffn Command abbrev-prefix-mark &optional arg | 294 | @deffn Command abbrev-prefix-mark &optional arg |
| 295 | This command marks the current location of point as the beginning of | 295 | This command marks the current location of point as the beginning of |
diff --git a/doc/lispref/buffers.texi b/doc/lispref/buffers.texi index 2aa1f725641..2a7a603e733 100644 --- a/doc/lispref/buffers.texi +++ b/doc/lispref/buffers.texi | |||
| @@ -1135,7 +1135,7 @@ non-@code{nil}, the initial state is copied from the actual base | |||
| 1135 | buffer, not from @var{base-buffer}. | 1135 | buffer, not from @var{base-buffer}. |
| 1136 | @end deffn | 1136 | @end deffn |
| 1137 | 1137 | ||
| 1138 | @deffn clone-indirect-buffer newname display-flag &optional norecord | 1138 | @deffn Command clone-indirect-buffer newname display-flag &optional norecord |
| 1139 | This function creates and returns a new indirect buffer that shares | 1139 | This function creates and returns a new indirect buffer that shares |
| 1140 | the current buffer's base buffer and copies the rest of the current | 1140 | the current buffer's base buffer and copies the rest of the current |
| 1141 | buffer's attributes. (If the current buffer is not indirect, it is | 1141 | buffer's attributes. (If the current buffer is not indirect, it is |
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 54006b35eb4..0e1062a622f 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi | |||
| @@ -525,7 +525,7 @@ horizontal, the ordering is top to bottom in the left part, and so on. | |||
| 525 | In general, within each set of siblings at any level in the window tree | 525 | In general, within each set of siblings at any level in the window tree |
| 526 | (@pxref{Window Tree}), the order is left to right, or top to bottom. | 526 | (@pxref{Window Tree}), the order is left to right, or top to bottom. |
| 527 | 527 | ||
| 528 | @deffn next-window &optional window minibuf all-frames | 528 | @defun next-window &optional window minibuf all-frames |
| 529 | @cindex minibuffer window, and @code{next-window} | 529 | @cindex minibuffer window, and @code{next-window} |
| 530 | This function returns the window following @var{window} in the cyclic | 530 | This function returns the window following @var{window} in the cyclic |
| 531 | ordering of windows. This is the window @kbd{C-x o} selects if typed | 531 | ordering of windows. This is the window @kbd{C-x o} selects if typed |
| @@ -588,13 +588,13 @@ buffer @samp{windows.texi}: | |||
| 588 | @result{} #<window 56 on windows.texi> | 588 | @result{} #<window 56 on windows.texi> |
| 589 | @end group | 589 | @end group |
| 590 | @end example | 590 | @end example |
| 591 | @end deffn | 591 | @end defun |
| 592 | 592 | ||
| 593 | @deffn previous-window &optional window minibuf all-frames | 593 | @defun previous-window &optional window minibuf all-frames |
| 594 | This function returns the window preceding @var{window} in the cyclic | 594 | This function returns the window preceding @var{window} in the cyclic |
| 595 | ordering of windows. The other arguments specify which windows to | 595 | ordering of windows. The other arguments specify which windows to |
| 596 | include in the cycle, as in @code{next-window}. | 596 | include in the cycle, as in @code{next-window}. |
| 597 | @end deffn | 597 | @end defun |
| 598 | 598 | ||
| 599 | @deffn Command other-window count &optional all-frames | 599 | @deffn Command other-window count &optional all-frames |
| 600 | This function selects another window in the cyclic ordering of windows. | 600 | This function selects another window in the cyclic ordering of windows. |
| @@ -827,7 +827,7 @@ This function updates the buffer list just like @code{switch-to-buffer} | |||
| 827 | unless @var{norecord} is non-@code{nil}. | 827 | unless @var{norecord} is non-@code{nil}. |
| 828 | @end deffn | 828 | @end deffn |
| 829 | 829 | ||
| 830 | @deffn pop-to-buffer buffer-or-name &optional other-window norecord | 830 | @deffn Command pop-to-buffer buffer-or-name &optional other-window norecord |
| 831 | This command makes @var{buffer-or-name} the current buffer and switches | 831 | This command makes @var{buffer-or-name} the current buffer and switches |
| 832 | to it in some window, preferably not the window previously selected. | 832 | to it in some window, preferably not the window previously selected. |
| 833 | The ``popped-to'' window becomes the selected window. Its frame is | 833 | The ``popped-to'' window becomes the selected window. Its frame is |
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 996c788738b..a559873d403 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,20 @@ | |||
| 1 | 2010-04-18 Teodor Zlatanov <tzz@lifelogs.com> | ||
| 2 | |||
| 3 | * gnus.texi (Gnus Versions, Oort Gnus): Mention the Git repo instead of | ||
| 4 | the CVS repo. Put the Git repo in the news section. | ||
| 5 | |||
| 6 | * gnus-coding.texi (Gnus Maintainance Guide): Fix title typo. | ||
| 7 | Removed some mentions of CVS. Mention the new Git repo. | ||
| 8 | |||
| 9 | 2010-04-18 Andreas Seltenreich <seltenreich@gmx.de> | ||
| 10 | |||
| 11 | * gnus.texi (Score File Format): Fix typo. Reported by Štěpán Němec. | ||
| 12 | (Mail Group Commands): Add index entry. | ||
| 13 | |||
| 14 | 2010-04-18 Glenn Morris <rgm@gnu.org> | ||
| 15 | |||
| 16 | * info.texi (Search Index): Mention Emacs's Info-virtual-index. | ||
| 17 | |||
| 1 | 2010-04-18 Jay Belanger <jay.p.belanger@gmail.com> | 18 | 2010-04-18 Jay Belanger <jay.p.belanger@gmail.com> |
| 2 | 19 | ||
| 3 | * calc.texi (Radix modes): Mention that the option prefix will | 20 | * calc.texi (Radix modes): Mention that the option prefix will |
| @@ -7,11 +24,10 @@ | |||
| 7 | 2010-04-15 Carsten Dominik <carsten.dominik@gmail.com> | 24 | 2010-04-15 Carsten Dominik <carsten.dominik@gmail.com> |
| 8 | 25 | ||
| 9 | * org.texi (LaTeX and PDF export): Add a footnote about xetex. | 26 | * org.texi (LaTeX and PDF export): Add a footnote about xetex. |
| 10 | (LaTeX/PDF export commands): Section renamed and | 27 | (LaTeX/PDF export commands): Rename and Move section. |
| 11 | moved. | ||
| 12 | (Sectioning structure): Update. | 28 | (Sectioning structure): Update. |
| 13 | (References): New use case for field coordinates. | 29 | (References): New use case for field coordinates. |
| 14 | (The export dispatcher): Renamed from ASCII export. | 30 | (The export dispatcher): Rename from ASCII export. |
| 15 | (Setting up the staging area): Document the availability of | 31 | (Setting up the staging area): Document the availability of |
| 16 | encryption for MobileOrg. | 32 | encryption for MobileOrg. |
| 17 | (Images and tables): Document how to reference labels. | 33 | (Images and tables): Document how to reference labels. |
| @@ -44,12 +60,10 @@ | |||
| 44 | scheduling and deadline commands. | 60 | scheduling and deadline commands. |
| 45 | (Search view): Point to the docstring of | 61 | (Search view): Point to the docstring of |
| 46 | `org-search-view' for more details. | 62 | `org-search-view' for more details. |
| 47 | (Agenda commands): Document that `>' prompts for a | 63 | (Agenda commands): Document that `>' prompts for a date. |
| 48 | date. | ||
| 49 | (Setting tags): Document variable | 64 | (Setting tags): Document variable |
| 50 | org-complete-tags-always-offer-all-agenda-tags. | 65 | org-complete-tags-always-offer-all-agenda-tags. |
| 51 | (Column attributes): Cross-reference special | 66 | (Column attributes): Cross-reference special properties. |
| 52 | properties. | ||
| 53 | 67 | ||
| 54 | 2010-04-10 Michael Albinus <michael.albinus@gmx.de> | 68 | 2010-04-10 Michael Albinus <michael.albinus@gmx.de> |
| 55 | 69 | ||
diff --git a/doc/misc/gnus-coding.texi b/doc/misc/gnus-coding.texi index fc88a6d47b6..fd637ece6a8 100644 --- a/doc/misc/gnus-coding.texi +++ b/doc/misc/gnus-coding.texi | |||
| @@ -32,16 +32,16 @@ license to the document, as described in section 6 of the license. | |||
| 32 | 32 | ||
| 33 | 33 | ||
| 34 | @titlepage | 34 | @titlepage |
| 35 | @title Gnus Coding Style and Maintainance Guide | 35 | @title Gnus Coding Style and Maintenance Guide |
| 36 | 36 | ||
| 37 | @author by Reiner Steib <Reiner.Steib@@gmx.de> | 37 | @author by Reiner Steib <Reiner.Steib@@gmx.de> |
| 38 | 38 | ||
| 39 | @insertcopying | 39 | @insertcopying |
| 40 | @end titlepage | 40 | @end titlepage |
| 41 | 41 | ||
| 42 | @c Obviously this is only a very rudimentary draft. We put it in CVS | 42 | @c Obviously this is only a very rudimentary draft. We put it in the |
| 43 | @c anyway hoping that it might annoy someone enough to fix it. ;-) | 43 | @c repository anyway hoping that it might annoy someone enough to fix |
| 44 | @c Fixing only a paragraph also is appreciated. | 44 | @c it. ;-) Fixing only a paragraph also is appreciated. |
| 45 | 45 | ||
| 46 | @ifnottex | 46 | @ifnottex |
| 47 | @node Top | 47 | @node Top |
| @@ -255,15 +255,17 @@ XEmacs 21.1 and up. | |||
| 255 | 255 | ||
| 256 | @section Stable and development versions | 256 | @section Stable and development versions |
| 257 | 257 | ||
| 258 | The development of Gnus normally is done on the CVS trunk, i.e. there | 258 | The development of Gnus normally is done on the Git repository trunk |
| 259 | are no separate branches to develop and test new features. Most of the | 259 | as of April 19, 2010 (formerly it was done in CVS; the repository is |
| 260 | time, the trunk is developed quite actively with more or less daily | 260 | at http://git.gnus.org), i.e. there are no separate branches to |
| 261 | changes. Only after a new major release, e.g. 5.10.1, there's usually a | 261 | develop and test new features. Most of the time, the trunk is |
| 262 | feature period of several months. After the release of Gnus 5.10.6 the | 262 | developed quite actively with more or less daily changes. Only after |
| 263 | development of new features started again on the trunk while the 5.10 | 263 | a new major release, e.g. 5.10.1, there's usually a feature period of |
| 264 | series is continued on the stable branch (v5-10) from which more stable | 264 | several months. After the release of Gnus 5.10.6 the development of |
| 265 | releases will be done when needed (5.10.8, @dots{}). | 265 | new features started again on the trunk while the 5.10 series is |
| 266 | @ref{Gnus Development, ,Gnus Development, gnus, The Gnus Newsreader} | 266 | continued on the stable branch (v5-10) from which more stable releases |
| 267 | will be done when needed (5.10.8, @dots{}). @ref{Gnus Development, | ||
| 268 | ,Gnus Development, gnus, The Gnus Newsreader} | ||
| 267 | 269 | ||
| 268 | Stable releases of Gnus finally become part of Emacs. E.g. Gnus 5.8 | 270 | Stable releases of Gnus finally become part of Emacs. E.g. Gnus 5.8 |
| 269 | became a part of Emacs 21 (relabeled to Gnus 5.9). The 5.10 series | 271 | became a part of Emacs 21 (relabeled to Gnus 5.9). The 5.10 series |
| @@ -333,8 +335,12 @@ rather than having to actually fix the code. | |||
| 333 | 335 | ||
| 334 | @item | 336 | @item |
| 335 | For general Gnus development changes, of course you just make the | 337 | For general Gnus development changes, of course you just make the |
| 336 | change on the Gnus CVS trunk and it goes into Emacs a few years | 338 | change on the Gnus Git trunk and it goes into Emacs a few years |
| 337 | later... :-) | 339 | later... :-) |
| 340 | |||
| 341 | With the new Git repository, we'll probably set up something to | ||
| 342 | automatically synchronize with Emacs when possible. CVS was much less | ||
| 343 | powerful for this kind of synchronization. | ||
| 338 | @end itemize | 344 | @end itemize |
| 339 | 345 | ||
| 340 | Of course in any case, if you just can't wait for me to sync your | 346 | Of course in any case, if you just can't wait for me to sync your |
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 7a3fe922cee..585c4d6bcb8 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi | |||
| @@ -11331,6 +11331,7 @@ disappear forever into that big @file{/dev/null} in the sky. | |||
| 11331 | 11331 | ||
| 11332 | @item B DEL | 11332 | @item B DEL |
| 11333 | @kindex B DEL (Summary) | 11333 | @kindex B DEL (Summary) |
| 11334 | @cindex deleting mail | ||
| 11334 | @findex gnus-summary-delete-article | 11335 | @findex gnus-summary-delete-article |
| 11335 | @c @icon{gnus-summary-mail-delete} | 11336 | @c @icon{gnus-summary-mail-delete} |
| 11336 | Delete the mail article. This is ``delete'' as in ``delete it from your | 11337 | Delete the mail article. This is ``delete'' as in ``delete it from your |
| @@ -21843,7 +21844,7 @@ You can do this with the following two score file entries: | |||
| 21843 | 21844 | ||
| 21844 | When you enter the group the first time, you will only see the new | 21845 | When you enter the group the first time, you will only see the new |
| 21845 | threads. You then raise the score of the threads that you find | 21846 | threads. You then raise the score of the threads that you find |
| 21846 | interesting (with @kbd{I T} or @kbd{I S}), and ignore (@kbd{C y}) the | 21847 | interesting (with @kbd{I T} or @kbd{I S}), and ignore (@kbd{c y}) the |
| 21847 | rest. Next time you enter the group, you will see new articles in the | 21848 | rest. Next time you enter the group, you will see new articles in the |
| 21848 | interesting threads, plus any new threads. | 21849 | interesting threads, plus any new threads. |
| 21849 | 21850 | ||
| @@ -27111,6 +27112,10 @@ Gnus 5.10 on May 1st 2003 (24 releases). | |||
| 27111 | 27112 | ||
| 27112 | On the January 4th 2004, No Gnus was begun. | 27113 | On the January 4th 2004, No Gnus was begun. |
| 27113 | 27114 | ||
| 27115 | On April 19, 2010 Gnus development was moved to Git. See | ||
| 27116 | http://git.gnus.org for details (http://www.gnus.org will be updated | ||
| 27117 | with the information when possible). | ||
| 27118 | |||
| 27114 | If you happen upon a version of Gnus that has a prefixed name -- | 27119 | If you happen upon a version of Gnus that has a prefixed name -- |
| 27115 | ``(ding) Gnus'', ``September Gnus'', ``Red Gnus'', ``Quassia Gnus'', | 27120 | ``(ding) Gnus'', ``September Gnus'', ``Red Gnus'', ``Quassia Gnus'', |
| 27116 | ``Pterodactyl Gnus'', ``Oort Gnus'', ``No Gnus'' -- don't panic. | 27121 | ``Pterodactyl Gnus'', ``Oort Gnus'', ``No Gnus'' -- don't panic. |
| @@ -28507,7 +28512,7 @@ directory is not used any more. You can safely delete the entire | |||
| 28507 | hierarchy. | 28512 | hierarchy. |
| 28508 | 28513 | ||
| 28509 | @c FIXME: `gnus-load' is mentioned in README, which is not included in | 28514 | @c FIXME: `gnus-load' is mentioned in README, which is not included in |
| 28510 | @c CVS. We should find a better place for this item. | 28515 | @c the repository. We should find a better place for this item. |
| 28511 | @item | 28516 | @item |
| 28512 | @code{(require 'gnus-load)} | 28517 | @code{(require 'gnus-load)} |
| 28513 | 28518 | ||
diff --git a/doc/misc/info.texi b/doc/misc/info.texi index 98fffabdd6b..b1157c0c4eb 100644 --- a/doc/misc/info.texi +++ b/doc/misc/info.texi | |||
| @@ -15,7 +15,8 @@ This file describes how to use Info, the on-line, menu-driven GNU | |||
| 15 | documentation system. | 15 | documentation system. |
| 16 | 16 | ||
| 17 | Copyright @copyright{} 1989, 1992, 1996, 1997, 1998, 1999, 2000, 2001, | 17 | Copyright @copyright{} 1989, 1992, 1996, 1997, 1998, 1999, 2000, 2001, |
| 18 | 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. | 18 | 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 |
| 19 | Free Software Foundation, Inc. | ||
| 19 | 20 | ||
| 20 | @quotation | 21 | @quotation |
| 21 | Permission is granted to copy, distribute and/or modify this document | 22 | Permission is granted to copy, distribute and/or modify this document |
| @@ -1050,6 +1051,13 @@ their names when @kbd{i} prompts you for a topic. For example, if you | |||
| 1050 | want to read the description of what the @kbd{C-l} key does, type | 1051 | want to read the description of what the @kbd{C-l} key does, type |
| 1051 | @kbd{iC-l@key{RET}} literally. | 1052 | @kbd{iC-l@key{RET}} literally. |
| 1052 | 1053 | ||
| 1054 | @findex Info-virtual-index | ||
| 1055 | @kindex I @r{(Info mode)} | ||
| 1056 | Emacs provides the command @code{Info-virtual-index}, bound to the | ||
| 1057 | @kbd{I} key. This behaves like @kbd{i}, but constructs a virtual | ||
| 1058 | info node displaying the results of an index search, making it easier | ||
| 1059 | to select the one you want. | ||
| 1060 | |||
| 1053 | @findex info-apropos | 1061 | @findex info-apropos |
| 1054 | @findex index-apropos | 1062 | @findex index-apropos |
| 1055 | If you aren't sure which manual documents the topic you are looking | 1063 | If you aren't sure which manual documents the topic you are looking |
diff --git a/etc/ChangeLog b/etc/ChangeLog index 6471a4d422a..b9e443284f3 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2010-04-18 Francesc Rocher <rocher@member.fsf.org> | ||
| 2 | |||
| 3 | * MORE.STUFF: Add a new entry for QWE. | ||
| 4 | |||
| 1 | 2010-04-18 Stefan Monnier <monnier@iro.umontreal.ca> | 5 | 2010-04-18 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 6 | ||
| 3 | * HELLO (Mathematics): Prefer Unicode charset. | 7 | * HELLO (Mathematics): Prefer Unicode charset. |
diff --git a/etc/MORE.STUFF b/etc/MORE.STUFF index a7cb3237b30..36c89651d67 100644 --- a/etc/MORE.STUFF +++ b/etc/MORE.STUFF | |||
| @@ -215,6 +215,10 @@ Several are for Debian GNU/Linux in particular. | |||
| 215 | * Quack: <URL:http://www.neilvandyke.org/quack/> | 215 | * Quack: <URL:http://www.neilvandyke.org/quack/> |
| 216 | Quack enhances Emacs support for Scheme. | 216 | Quack enhances Emacs support for Scheme. |
| 217 | 217 | ||
| 218 | * QWE: <URL:http://www.nongnu.org/qwe/> | ||
| 219 | QWE's not WEB for Emacs is a quasi-WYSIWYG literate programming system for | ||
| 220 | Emacs that can be used with almost every programming language. | ||
| 221 | |||
| 218 | * Session: <URL:http://emacs-session.sourceforge.net/> | 222 | * Session: <URL:http://emacs-session.sourceforge.net/> |
| 219 | Session Management for Emacs. | 223 | Session Management for Emacs. |
| 220 | 224 | ||
diff --git a/etc/NEWS.23 b/etc/NEWS.23 index 0d6bfbf52aa..717c2a8c2b5 100644 --- a/etc/NEWS.23 +++ b/etc/NEWS.23 | |||
| @@ -24,6 +24,7 @@ so we will look at it and add it to the manual. | |||
| 24 | 24 | ||
| 25 | * Installation Changes in Emacs 23.2 | 25 | * Installation Changes in Emacs 23.2 |
| 26 | 26 | ||
| 27 | --- | ||
| 27 | ** New configure options for Emacs developers | 28 | ** New configure options for Emacs developers |
| 28 | These are not new features; only the configure flags are new. | 29 | These are not new features; only the configure flags are new. |
| 29 | --- | 30 | --- |
| @@ -36,8 +37,10 @@ This might not work on all platforms. | |||
| 36 | ** `make install' now consistently ignores umask, creating a | 37 | ** `make install' now consistently ignores umask, creating a |
| 37 | world-readable install. | 38 | world-readable install. |
| 38 | 39 | ||
| 40 | +++ | ||
| 39 | ** Emacs compiles with Gconf support, if it is detected. | 41 | ** Emacs compiles with Gconf support, if it is detected. |
| 40 | Use the configure option --without-gconf to disable this. | 42 | Use the configure option --without-gconf to disable this. |
| 43 | This is used by the `font-use-system-font' feature (see below). | ||
| 41 | 44 | ||
| 42 | * Startup Changes in Emacs 23.2 | 45 | * Startup Changes in Emacs 23.2 |
| 43 | +++ | 46 | +++ |
| @@ -95,12 +98,14 @@ with `set-process-query-on-exit-flag'. | |||
| 95 | unconditionally. The previous behavior, toggling the mode, was | 98 | unconditionally. The previous behavior, toggling the mode, was |
| 96 | neither reliable nor generally desirable. | 99 | neither reliable nor generally desirable. |
| 97 | 100 | ||
| 98 | *** New commands for adding and removing file-local variables: | 101 | +++ |
| 102 | *** There are new commands for adding and removing file-local variables: | ||
| 99 | `add-file-local-variable', `delete-file-local-variable', | 103 | `add-file-local-variable', `delete-file-local-variable', |
| 100 | `add-file-local-variable-prop-line', and | 104 | `add-file-local-variable-prop-line', and |
| 101 | `delete-file-local-variable-prop-line'. | 105 | `delete-file-local-variable-prop-line'. |
| 102 | 106 | ||
| 103 | *** New commands for adding and removing directory-local variables, | 107 | +++ |
| 108 | *** There are new commands for adding and removing directory-local variables, | ||
| 104 | and copying them to and from file-local variable lists: | 109 | and copying them to and from file-local variable lists: |
| 105 | `add-dir-local-variable', `delete-dir-local-variable', | 110 | `add-dir-local-variable', `delete-dir-local-variable', |
| 106 | `copy-dir-locals-to-file-locals', | 111 | `copy-dir-locals-to-file-locals', |
| @@ -181,15 +186,18 @@ that file exists. | |||
| 181 | 186 | ||
| 182 | * Changes in Specialized Modes and Packages in Emacs 23.2 | 187 | * Changes in Specialized Modes and Packages in Emacs 23.2 |
| 183 | 188 | ||
| 189 | --- | ||
| 184 | ** The bookmark menu has a narrowing search via bookmark-bmenu-search. | 190 | ** The bookmark menu has a narrowing search via bookmark-bmenu-search. |
| 185 | 191 | ||
| 186 | ** LaTeX mode now provides completion (via completion-at-point). | 192 | ** LaTeX mode now provides completion (via completion-at-point). |
| 187 | 193 | ||
| 188 | --- | 194 | --- |
| 189 | ** sym-comp.el is now declared obsolete, superceded by completion-at-point. | 195 | ** sym-comp.el is now declared obsolete, superseded by completion-at-point. |
| 190 | 196 | ||
| 197 | --- | ||
| 191 | ** lucid.el and levents.el are now declared obsolete. | 198 | ** lucid.el and levents.el are now declared obsolete. |
| 192 | 199 | ||
| 200 | --- | ||
| 193 | ** pcomplete provides a new command `pcomplete-std-completion' which | 201 | ** pcomplete provides a new command `pcomplete-std-completion' which |
| 194 | is similar to `pcomplete' but using the standard completion UI code. | 202 | is similar to `pcomplete' but using the standard completion UI code. |
| 195 | 203 | ||
| @@ -233,9 +241,9 @@ on the page edge advances to the next/previous page. | |||
| 233 | 241 | ||
| 234 | ** GDB-UI | 242 | ** GDB-UI |
| 235 | 243 | ||
| 244 | +++ | ||
| 236 | *** Toolbar functionality for reverse debugging. Display of STL | 245 | *** Toolbar functionality for reverse debugging. Display of STL |
| 237 | collections as watch expressions. These features require GDB 7.0 | 246 | collections as watch expressions. These features require GDB 7.0 or later. |
| 238 | or later. | ||
| 239 | 247 | ||
| 240 | ** Grep | 248 | ** Grep |
| 241 | +++ | 249 | +++ |
| @@ -243,9 +251,11 @@ or later. | |||
| 243 | 251 | ||
| 244 | ** Info | 252 | ** Info |
| 245 | 253 | ||
| 254 | +++ | ||
| 246 | *** The new command `Info-virtual-index' bound to "I" displays a menu of | 255 | *** The new command `Info-virtual-index' bound to "I" displays a menu of |
| 247 | matched topics found in the index. | 256 | matched topics found in the index. |
| 248 | 257 | ||
| 258 | +++ | ||
| 249 | *** The new command `info-finder' replaces finder.el with a virtual Info | 259 | *** The new command `info-finder' replaces finder.el with a virtual Info |
| 250 | manual that generates an Info file which gives the same information | 260 | manual that generates an Info file which gives the same information |
| 251 | through a menu structure. | 261 | through a menu structure. |
| @@ -325,22 +335,25 @@ instead of redisplaying the full log. The RCS, CVS and SCCS VC | |||
| 325 | backends do not support this. | 335 | backends do not support this. |
| 326 | --- | 336 | --- |
| 327 | *** When a file is not found, VC will not try to check it out of RCS anymore. | 337 | *** When a file is not found, VC will not try to check it out of RCS anymore. |
| 328 | 338 | +++ | |
| 329 | *** Diff and log operations can be used from Dired buffers. | 339 | *** Diff and log operations can be used from Dired buffers. |
| 330 | 340 | ||
| 331 | *** vc-git changes | 341 | *** vc-git changes |
| 332 | 342 | ||
| 333 | **** The short log format for git makes use of the graph display, so | 343 | --- |
| 334 | it's not supported on git versions earlier than 1.5. | 344 | **** The short log format for git makes use of the graph display, |
| 335 | 345 | so it's not supported on git versions earlier than 1.5.6. | |
| 336 | **** Support for operating with stashes has been added to vc-dir: the stash list is | ||
| 337 | displayed in the *vc-dir* header, stashes can be created, removed, applied and | ||
| 338 | their content displayed. | ||
| 339 | 346 | ||
| 340 | **** vc-dir displays the stash status | 347 | --- |
| 348 | **** vc-dir uses the --relative option of git, and so requires at least | ||
| 349 | git version 1.5.5. | ||
| 341 | 350 | ||
| 342 | **** vc-dir requires at least git-1.5.5. | 351 | +++ |
| 352 | **** Support for operating with stashes has been added to vc-dir: | ||
| 353 | the stash list is displayed in the *vc-dir* header, stashes can be | ||
| 354 | created, removed, applied and their content displayed. | ||
| 343 | 355 | ||
| 356 | +++ | ||
| 344 | *** vc-bzr supports operating with shelves: the shelve list is | 357 | *** vc-bzr supports operating with shelves: the shelve list is |
| 345 | displayed in the *vc-dir* header, shelves can be created, removed and applied. | 358 | displayed in the *vc-dir* header, shelves can be created, removed and applied. |
| 346 | --- | 359 | --- |
| @@ -383,7 +396,7 @@ search in file buffers whose file names match the specified wildcard. | |||
| 383 | That means, they change `default-directory' to the new users value, | 396 | That means, they change `default-directory' to the new users value, |
| 384 | and let commands run under that user permissions. It works even when | 397 | and let commands run under that user permissions. It works even when |
| 385 | `default-directory' is already remote. Calling the external commands | 398 | `default-directory' is already remote. Calling the external commands |
| 386 | is possible by `*su' or `*sudo', repectively. | 399 | is possible by `*su' or `*sudo', respectively. |
| 387 | --- | 400 | --- |
| 388 | *** When running in a new enough xterm (newer than version 242), Emacs | 401 | *** When running in a new enough xterm (newer than version 242), Emacs |
| 389 | asks xterm what the background color is and it sets up faces | 402 | asks xterm what the background color is and it sets up faces |
| @@ -397,6 +410,7 @@ consider the background light). | |||
| 397 | This is a collection of packages to aid with using Emacs as an IDE | 410 | This is a collection of packages to aid with using Emacs as an IDE |
| 398 | (integrated development environment): | 411 | (integrated development environment): |
| 399 | 412 | ||
| 413 | +++ | ||
| 400 | *** The Semantic package allows the use of parsers to intelligently | 414 | *** The Semantic package allows the use of parsers to intelligently |
| 401 | edit and navigate source code. Parsers for C/C++, Java, Javascript, | 415 | edit and navigate source code. Parsers for C/C++, Java, Javascript, |
| 402 | and several other languages are included by default, and Semantic can | 416 | and several other languages are included by default, and Semantic can |
| @@ -405,6 +419,7 @@ also interface with external tools such as GNU Global and GNU Idutils. | |||
| 405 | To enable Semantic, use the global minor mode `semantic-mode'. | 419 | To enable Semantic, use the global minor mode `semantic-mode'. |
| 406 | See the Semantic manual for details. | 420 | See the Semantic manual for details. |
| 407 | 421 | ||
| 422 | +++ | ||
| 408 | *** EDE (Emacs Development Environment) is a package for managing code | 423 | *** EDE (Emacs Development Environment) is a package for managing code |
| 409 | projects, including features such as automatic Makefile generation. | 424 | projects, including features such as automatic Makefile generation. |
| 410 | 425 | ||
| @@ -415,9 +430,11 @@ See the EDE manual for details. | |||
| 415 | code. It is currently used by some parts of Semantic and EDE; in the | 430 | code. It is currently used by some parts of Semantic and EDE; in the |
| 416 | future, it may be used for code generation features. | 431 | future, it may be used for code generation features. |
| 417 | 432 | ||
| 433 | +++ | ||
| 418 | *** The EIEIO library implements a subset of the Common Lisp Object | 434 | *** The EIEIO library implements a subset of the Common Lisp Object |
| 419 | System (CLOS). It is used by the other CEDET packages. | 435 | System (CLOS). It is used by the other CEDET packages. |
| 420 | 436 | ||
| 437 | --- | ||
| 421 | ** mpc.el is a front end for the Music Player Daemon. Run it with M-x mpc. | 438 | ** mpc.el is a front end for the Music Player Daemon. Run it with M-x mpc. |
| 422 | 439 | ||
| 423 | ** htmlfontify.el turns a fontified Emacs buffer into an HTML page. | 440 | ** htmlfontify.el turns a fontified Emacs buffer into an HTML page. |
| @@ -425,6 +442,7 @@ System (CLOS). It is used by the other CEDET packages. | |||
| 425 | +++ | 442 | +++ |
| 426 | ** js.el is a new major mode for JavaScript files. | 443 | ** js.el is a new major mode for JavaScript files. |
| 427 | 444 | ||
| 445 | --- | ||
| 428 | ** imap-hash.el is a new library to address IMAP mailboxes as hashtables. | 446 | ** imap-hash.el is a new library to address IMAP mailboxes as hashtables. |
| 429 | 447 | ||
| 430 | 448 | ||
| @@ -452,16 +470,17 @@ be in use: | |||
| 452 | ** Support for generating Emacs 18 compatible bytecode (by setting | 470 | ** Support for generating Emacs 18 compatible bytecode (by setting |
| 453 | the variable `byte-compile-compatibility') has been removed. | 471 | the variable `byte-compile-compatibility') has been removed. |
| 454 | 472 | ||
| 455 | ** In image-mode.el `image-mode-maybe' is obsolete. Instead, you can | 473 | --- |
| 456 | either use `image-mode' that displays an image file as the actual image | 474 | ** In image-mode.el `image-mode-maybe' is obsolete. |
| 457 | inititally, or `image-mode-as-text' when you want to display an image file | 475 | Instead, you can either use `image-mode' (which displays an image file |
| 458 | as text inititally. `image-mode-as-text' is a combination of a non-image | 476 | as the actual image initially), or `image-mode-as-text' (when you want |
| 459 | mode from `auto-mode-alist' (or Fundamental mode) and `image-minor-mode'. | 477 | to display an image file as text initially). `image-mode-as-text' is a |
| 460 | `image-minor-mode' provides `C-c C-c' key binding to toggle image display. | 478 | combination of a non-image mode from `auto-mode-alist' (or Fundamental |
| 479 | mode) and `image-minor-mode'. `image-minor-mode' provides a `C-c C-c' | ||
| 480 | key binding to toggle image display. | ||
| 461 | `image-toggle-display-text' removes image properties. | 481 | `image-toggle-display-text' removes image properties. |
| 462 | `image-toggle-display-image' adds image properties. | 482 | `image-toggle-display-image' adds image properties. |
| 463 | `image-toggle-display' toggles between `image-mode-as-text' and | 483 | `image-toggle-display' toggles between `image-mode-as-text' and `image-mode'. |
| 464 | `image-mode'. | ||
| 465 | 484 | ||
| 466 | 485 | ||
| 467 | * Lisp changes in Emacs 23.2 | 486 | * Lisp changes in Emacs 23.2 |
diff --git a/leim/ChangeLog b/leim/ChangeLog index 9dd41d3bafa..22642193588 100644 --- a/leim/ChangeLog +++ b/leim/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2010-04-06 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * quail/vntelex.el: Fix "af" rule (Bug#5836). | ||
| 4 | |||
| 1 | 2010-03-27 Eli Zaretskii <eliz@gnu.org> | 5 | 2010-03-27 Eli Zaretskii <eliz@gnu.org> |
| 2 | 6 | ||
| 3 | * makefile.w32-in ($(TIT), $(MISC_DIC), leim-list.el): Enclose the | 7 | * makefile.w32-in ($(TIT), $(MISC_DIC), leim-list.el): Enclose the |
diff --git a/leim/quail/vntelex.el b/leim/quail/vntelex.el index bfa1cc9263f..8af020b093c 100644 --- a/leim/quail/vntelex.el +++ b/leim/quail/vntelex.el | |||
| @@ -285,7 +285,7 @@ and postfix: Eee -> Ee, ajj -> aj, etc. | |||
| 285 | ("Dd" ?,2p(B) | 285 | ("Dd" ?,2p(B) |
| 286 | ;("$$" ?$,1tK(B) ; U+20AB DONG SIGN (#### check) | 286 | ;("$$" ?$,1tK(B) ; U+20AB DONG SIGN (#### check) |
| 287 | 287 | ||
| 288 | ("aff" ["aff"]) | 288 | ("aff" ["af"]) |
| 289 | ("AFF" ["AF"]) | 289 | ("AFF" ["AF"]) |
| 290 | ("Aff" ["Af"]) | 290 | ("Aff" ["Af"]) |
| 291 | ("ass" ["as"]) | 291 | ("ass" ["as"]) |
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index cd0f834be6d..854718b450b 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2010-04-18 Juanma Barranquero <lekktu@gmail.com> | ||
| 2 | |||
| 3 | Add stubs for Windows, required after CVE-2010-0825 change. | ||
| 4 | * ntlib.c (getgid, getegid, setegid): New stubs. | ||
| 5 | * ntlib.h (getgid, getegid, setegid): Declare them. | ||
| 6 | |||
| 1 | 2010-04-12 Dan Nicolaescu <dann@ics.uci.edu> | 7 | 2010-04-12 Dan Nicolaescu <dann@ics.uci.edu> |
| 2 | 8 | ||
| 3 | * Makefile.in (ALL_CFLAGS, LINK_CFLAGS, CPP_CFLAGS): Move to the | 9 | * Makefile.in (ALL_CFLAGS, LINK_CFLAGS, CPP_CFLAGS): Move to the |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 78e2473e373..0639aa50884 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,98 @@ | |||
| 1 | 2010-04-19 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2010-04-19 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * international/mule.el: Help the user choose a valid coding-system. | ||
| 4 | (read-buffer-file-coding-system): New function. | ||
| 5 | (set-buffer-file-coding-system): Use it. Prompt the user if the | ||
| 6 | coding-system cannot encode all the chars. | ||
| 7 | |||
| 8 | * vc-bzr.el: Use standard *vc* and *vc-diff* buffers. | ||
| 9 | (vc-bzr-shelve-show, vc-bzr-shelve-apply) | ||
| 10 | (vc-bzr-shelve-apply-and-keep, vc-bzr-shelve-snapshot): | ||
| 11 | Don't use *vc-bzr-shelve*. | ||
| 12 | |||
| 13 | 2010-04-19 Chong Yidong <cyd@stupidchicken.com> | ||
| 14 | |||
| 15 | * cedet/ede/pmake.el (ede-proj-makefile-insert-variables): | ||
| 16 | Don't destroy list before using it. | ||
| 17 | |||
| 18 | 2010-04-19 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 19 | |||
| 20 | Fix the version number for added files. | ||
| 21 | * vc-hg.el (vc-hg-working-revision): Check if the file is | ||
| 22 | registered after hg parent fails (Bug#5961). | ||
| 23 | |||
| 24 | 2010-04-19 Glenn Morris <rgm@gnu.org> | ||
| 25 | |||
| 26 | * htmlfontify.el (htmlfontify-buffer) | ||
| 27 | (htmlfontify-copy-and-link-dir): Autoload entry points. | ||
| 28 | |||
| 29 | 2010-04-19 Magnus Henoch <magnus.henoch@gmail.com> | ||
| 30 | |||
| 31 | * vc-hg.el (vc-hg-annotate-extract-revision-at-line): Expand file | ||
| 32 | name relative to the project root (Bug#5960). | ||
| 33 | |||
| 34 | 2010-04-19 Glenn Morris <rgm@gnu.org> | ||
| 35 | |||
| 36 | * vc-git.el (vc-git-print-log): Doc fix. | ||
| 37 | |||
| 38 | 2010-04-19 Óscar Fuentes <ofv@wanadoo.es> | ||
| 39 | |||
| 40 | * ido.el (ido-file-internal): Fix 2009-12-02 change. | ||
| 41 | |||
| 42 | 2010-04-19 Christoph <cschol2112@googlemail.com> (tiny change) | ||
| 43 | |||
| 44 | * progmodes/grep.el (grep-compute-defaults): Fix handling of host | ||
| 45 | default settings (Bug#5928). | ||
| 46 | |||
| 47 | 2010-04-19 Glenn Morris <rgm@gnu.org> | ||
| 48 | |||
| 49 | * progmodes/fortran.el (fortran-match-and-skip-declaration): | ||
| 50 | New function. | ||
| 51 | (fortran-font-lock-keywords-3): Use it. (Bug#1385) | ||
| 52 | |||
| 53 | 2010-04-19 Kenichi Handa <handa@m17n.org> | ||
| 54 | |||
| 55 | * language/indian.el (malayalam-composable-pattern): Fix previous | ||
| 56 | change (add U+0D4D "SIGN VIRAMA"). | ||
| 57 | (oriya-composable-pattern): Add U+0B30 and fix typo in the regexp. | ||
| 58 | (tamil-composable-pattern): Fix typo in the regexp. | ||
| 59 | (telugu-composable-pattern): Fix U+0C4D and typo in the regexp. | ||
| 60 | (kannada-composable-pattern): Fix U+0CB0 and typo in the regexp. | ||
| 61 | (malayalam-composable-pattern): Fix U+0D4D and typo in the regexp. | ||
| 62 | |||
| 63 | 2010-04-19 Chong Yidong <cyd@stupidchicken.com> | ||
| 64 | |||
| 65 | * textmodes/tex-mode.el (latex-mode): Revert 2008-03-03 change to | ||
| 66 | paragraph-separate (Bug#5821). | ||
| 67 | |||
| 68 | 2010-04-19 Juri Linkov <juri@jurta.org> | ||
| 69 | |||
| 70 | Put breadcrumbs on overlay instead of inserting to buffer (bug#5809). | ||
| 71 | |||
| 72 | * info.el (Info-find-node-2): Comment out code that skips | ||
| 73 | breadcrumbs line. | ||
| 74 | (Info-mouse-follow-link): New command. | ||
| 75 | (Info-link-keymap): New keymap. | ||
| 76 | (Info-breadcrumbs): Rename from `Info-insert-breadcrumbs'. | ||
| 77 | Return a string with links instead of inserting breadcrumbs | ||
| 78 | to the Info buffer. | ||
| 79 | (Info-fontify-node): Comment out code that inserts breadcrumbs. | ||
| 80 | Instead of putting the `invisible' text property over the Info | ||
| 81 | header, make an overlay over the Info header with the `invisible' | ||
| 82 | property and `after-string' set to the string returned by | ||
| 83 | `Info-breadcrumbs'. | ||
| 84 | |||
| 85 | 2010-04-19 Chong Yidong <cyd@stupidchicken.com> | ||
| 86 | |||
| 87 | * help.el (help-window-setup-finish): Doc fix (Bug#5830). | ||
| 88 | Reported by monkey@sandpframing.com. | ||
| 89 | |||
| 90 | 2010-04-19 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 91 | |||
| 92 | * tmm.el (tmm-prompt): Remove obsolete call to x-popup-menu. | ||
| 93 | (tmm-get-keymap): Add key-binding shortcuts now that they're not | ||
| 94 | available in the "keyseq cache" any more. | ||
| 95 | |||
| 3 | * custom.el (defcustom): Add edebug spec. | 96 | * custom.el (defcustom): Add edebug spec. |
| 4 | 97 | ||
| 5 | 2010-04-18 Juri Linkov <juri@jurta.org> | 98 | 2010-04-18 Juri Linkov <juri@jurta.org> |
| @@ -355,32 +448,31 @@ | |||
| 355 | 448 | ||
| 356 | 2010-04-07 Michael McNamara <mac@mail.brushroad.com> | 449 | 2010-04-07 Michael McNamara <mac@mail.brushroad.com> |
| 357 | 450 | ||
| 358 | * progmodes/verilog-mode.el (verilog-forward-sexp): | 451 | * progmodes/verilog-mode.el (verilog-forward-sexp): |
| 359 | (verilog-calc-1): Support "disable fork" and "fork wait" multi | 452 | (verilog-calc-1): Support "disable fork" and "fork wait" multi |
| 360 | word keywords, suggested by Steve Pearlmutter. | 453 | word keywords, suggested by Steve Pearlmutter. |
| 361 | (verilog-pretty-declarations): Support lineup of declarations in | 454 | (verilog-pretty-declarations): Support lineup of declarations in |
| 362 | port lists. | 455 | port lists. |
| 363 | (verilog-skip-backward-comments, verilog-skip-forward-comment-p): | 456 | (verilog-skip-backward-comments, verilog-skip-forward-comment-p): |
| 364 | fix bug for /* / comments | 457 | fix bug for /* / comments |
| 365 | (verilog-backward-syntactic-ws, verilog-forward-syntactic-ws): | 458 | (verilog-backward-syntactic-ws, verilog-forward-syntactic-ws): |
| 366 | Speed up and simplfy as this is never called with a bound. | 459 | Speed up and simplfy as this is never called with a bound. |
| 367 | (verilog-pretty-declarations): Enhance to line up declarations | 460 | (verilog-pretty-declarations): Enhance to line up declarations |
| 368 | inside a parameter list, suggested by Alan Morgan. | 461 | inside a parameter list, suggested by Alan Morgan. |
| 369 | (verilog-pretty-expr): Tune assignment regular expression match | 462 | (verilog-pretty-expr): Tune assignment regular expression match |
| 370 | string for corner cases; also use markers instead of character | 463 | string for corner cases; also use markers instead of character |
| 371 | number as indent changes the later. | 464 | number as indent changes the later. |
| 372 | 465 | ||
| 373 | 2010-04-07 Wilson Snyder <wsnyder@wsnyder.org> | 466 | 2010-04-07 Wilson Snyder <wsnyder@wsnyder.org> |
| 374 | 467 | ||
| 375 | * progmodes/verilog-mode.el (verilog-type-keywords): Fix pulldown as missing | 468 | * progmodes/verilog-mode.el (verilog-type-keywords): Fix pulldown |
| 376 | keyword. | 469 | as missing keyword. |
| 377 | (verilog-read-sub-decls-line): Fix comments in AUTO_TEMPLATE | 470 | (verilog-read-sub-decls-line): Fix comments in AUTO_TEMPLATE |
| 378 | causing truncation of AUTOWIRE signals. Reported by Bruce | 471 | causing truncation of AUTOWIRE signals. Reported by Bruce Tennant. |
| 379 | Tennant. | 472 | (verilog-auto-inst, verilog-auto-inst-port): Add vl_mbits for |
| 380 | (verilog-auto-inst, verilog-auto-inst-port): Add vl_mbits for | 473 | AUTO_TEMPLATEs needing multiple array bits. Suggested by Bruce |
| 381 | AUTO_TEMPLATEs needing multiple array bits. Suggested by Bruce | 474 | Tennant. |
| 382 | Tennant. | 475 | (verilog-keywords): |
| 383 | (verilog-keywords): | ||
| 384 | (verilog-1800-2005-keywords, verilog-1800-2009-keywords): Add IEEE | 476 | (verilog-1800-2005-keywords, verilog-1800-2009-keywords): Add IEEE |
| 385 | 1800-2009 keywords, including "global.". | 477 | 1800-2009 keywords, including "global.". |
| 386 | 478 | ||
| @@ -543,7 +635,7 @@ | |||
| 543 | 635 | ||
| 544 | 2010-03-31 Stefan Monnier <monnier@iro.umontreal.ca> | 636 | 2010-03-31 Stefan Monnier <monnier@iro.umontreal.ca> |
| 545 | 637 | ||
| 546 | Make tmm-menubar work for the Buffers menu again. | 638 | Make tmm-menubar work for the Buffers menu again (bug#5726). |
| 547 | * tmm.el (tmm-prompt): Also handle keymap entries in the form of | 639 | * tmm.el (tmm-prompt): Also handle keymap entries in the form of |
| 548 | vectors rather than cons cells, as used in menu-bar-update-buffers. | 640 | vectors rather than cons cells, as used in menu-bar-update-buffers. |
| 549 | 641 | ||
| @@ -1267,11 +1359,6 @@ | |||
| 1267 | * calendar/cal-hebrew.el (holiday-hebrew-passover): Fix date | 1359 | * calendar/cal-hebrew.el (holiday-hebrew-passover): Fix date |
| 1268 | of Yom HaAtzma'ut when it falls on a Monday (rule changed in 2004). | 1360 | of Yom HaAtzma'ut when it falls on a Monday (rule changed in 2004). |
| 1269 | 1361 | ||
| 1270 | 2010-03-01 Alan Mackenzie <acm@muc.de> | ||
| 1271 | |||
| 1272 | * progmodes/cc-engine.el (c-remove-stale-state-cache): | ||
| 1273 | Correct previous patch. | ||
| 1274 | |||
| 1275 | 2010-03-01 Kenichi Handa <handa@m17n.org> | 1362 | 2010-03-01 Kenichi Handa <handa@m17n.org> |
| 1276 | 1363 | ||
| 1277 | * language/burmese.el (burmese-composable-pattern): Rename from | 1364 | * language/burmese.el (burmese-composable-pattern): Rename from |
| @@ -1283,11 +1370,6 @@ | |||
| 1283 | (otf-script-alist): Likewise. | 1370 | (otf-script-alist): Likewise. |
| 1284 | (setup-default-fontset): Likewise. Re-fix :otf spec. | 1371 | (setup-default-fontset): Likewise. Re-fix :otf spec. |
| 1285 | 1372 | ||
| 1286 | 2010-03-01 Alan Mackenzie <bug-cc-mode@gnu.org> | ||
| 1287 | |||
| 1288 | * cc-engine.el (c-remove-stale-state-cache): Take account of when | ||
| 1289 | `good-pos' is in the same macro as `here'. Fixes bug#5649. | ||
| 1290 | |||
| 1291 | 2010-02-28 Katsumi Yamaoka <yamaoka@jpl.org> | 1373 | 2010-02-28 Katsumi Yamaoka <yamaoka@jpl.org> |
| 1292 | 1374 | ||
| 1293 | * menu-bar.el (menu-bar-manuals-menu): Fix typo. | 1375 | * menu-bar.el (menu-bar-manuals-menu): Fix typo. |
| @@ -1353,16 +1435,6 @@ | |||
| 1353 | * mail/sendmail.el (send-mail-function): Autoload the call | 1435 | * mail/sendmail.el (send-mail-function): Autoload the call |
| 1354 | to custom-initialize-delay, not otherwise preserved in loaddefs.el. | 1436 | to custom-initialize-delay, not otherwise preserved in loaddefs.el. |
| 1355 | 1437 | ||
| 1356 | 2010-02-25 Alan Mackenzie <acm@muc.de> | ||
| 1357 | |||
| 1358 | * progmodes/cc-engine.el (c-clear-<-pair-props) | ||
| 1359 | (c-clear->-pair-props): Correct to wipe category text props, not | ||
| 1360 | syntax-table ones. | ||
| 1361 | |||
| 1362 | * progmodes/cc-mode.el (c-after-change): Remove any hard | ||
| 1363 | syntax-table properties for <, > which, e.g., C-y has | ||
| 1364 | inopportunely converted from category properties. | ||
| 1365 | |||
| 1366 | 2010-02-24 Chong Yidong <cyd@stupidchicken.com> | 1438 | 2010-02-24 Chong Yidong <cyd@stupidchicken.com> |
| 1367 | 1439 | ||
| 1368 | * files.el (hack-local-variables-filter): For eval forms, also | 1440 | * files.el (hack-local-variables-filter): For eval forms, also |
| @@ -1700,33 +1772,6 @@ | |||
| 1700 | (doc-view-pdf->png): Don't rely on doc-view-pdf/ps->png for the few | 1772 | (doc-view-pdf->png): Don't rely on doc-view-pdf/ps->png for the few |
| 1701 | windows that are not yet showing images. | 1773 | windows that are not yet showing images. |
| 1702 | 1774 | ||
| 1703 | 2010-02-04 Alan Mackenzie <acm@muc.de> | ||
| 1704 | |||
| 1705 | Change strategy for marking < and > as template delimiters: mark | ||
| 1706 | them strictly in matching pairs. | ||
| 1707 | |||
| 1708 | * cc-mode.el (c-before-change): | ||
| 1709 | Use c-get-state-before-change-functions. | ||
| 1710 | (c-common-init): Adapt to use | ||
| 1711 | c-get-state-before-change-functions (note plural). | ||
| 1712 | |||
| 1713 | * cc-langs.el (c-no-parens-syntax-table): New syntax table, used | ||
| 1714 | for searching syntactically for matching <s and >s. | ||
| 1715 | (c-get-state-before-change-functions): New language variable (note | ||
| 1716 | the plural) which supersedes c-get-state-before-change-function. | ||
| 1717 | |||
| 1718 | * cc-engine.el (c-clear-<-pair-props, c-clear->-pair-props) | ||
| 1719 | (c-clear-<>-pair-props, c-clear-<-pair-props-if-match-after) | ||
| 1720 | (c-clear->-pair-props-if-match-before) | ||
| 1721 | (c-before-change-check-<>-operators): New functions. | ||
| 1722 | (c-after-change-check-<>-operators): Use macro | ||
| 1723 | c-unmark-<->-as-paren. | ||
| 1724 | |||
| 1725 | * cc-defs.el (c-search-backward-char-property): New macro. | ||
| 1726 | |||
| 1727 | * cc-cmds.el (c-electric-lt-gt): Do not set text properties on < | ||
| 1728 | and > any more. (These will be handled by font locking.) | ||
| 1729 | |||
| 1730 | 2010-02-04 Michael Albinus <michael.albinus@gmx.de> | 1775 | 2010-02-04 Michael Albinus <michael.albinus@gmx.de> |
| 1731 | 1776 | ||
| 1732 | * dired.el (dired-revert): If DIRED-DIRECTORY is a cons cell, call | 1777 | * dired.el (dired-revert): If DIRED-DIRECTORY is a cons cell, call |
diff --git a/lisp/cedet/ede/pmake.el b/lisp/cedet/ede/pmake.el index 971cd70a6ee..19c4b26edcd 100644 --- a/lisp/cedet/ede/pmake.el +++ b/lisp/cedet/ede/pmake.el | |||
| @@ -425,10 +425,9 @@ sources variable." | |||
| 425 | (link (ede-proj-linkers this)) | 425 | (link (ede-proj-linkers this)) |
| 426 | (name (ede-proj-makefile-target-name this)) | 426 | (name (ede-proj-makefile-target-name this)) |
| 427 | (src (oref this source))) | 427 | (src (oref this source))) |
| 428 | (while comp | 428 | (dolist (obj comp) |
| 429 | (ede-compiler-only-once (car comp) | 429 | (ede-compiler-only-once obj |
| 430 | (ede-proj-makefile-insert-variables (car comp))) | 430 | (ede-proj-makefile-insert-variables obj))) |
| 431 | (setq comp (cdr comp))) | ||
| 432 | (ede-proj-makefile-insert-object-variables (car comp) name src) | 431 | (ede-proj-makefile-insert-object-variables (car comp) name src) |
| 433 | (while link | 432 | (while link |
| 434 | (ede-linker-only-once (car link) | 433 | (ede-linker-only-once (car link) |
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index b0b3cd11b6a..94524c262ac 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,6 +1,15 @@ | |||
| 1 | 2010-04-17 Teodor Zlatanov <tzz@lifelogs.com> | ||
| 2 | |||
| 3 | * smime.el: Don't mention CVS. | ||
| 4 | |||
| 5 | * nnrss.el (nnrss-fetch): Don't mention CVS. | ||
| 6 | |||
| 7 | * nnir.el: Don't mention CVS. | ||
| 8 | |||
| 1 | 2010-04-14 Stefan Monnier <monnier@iro.umontreal.ca> | 9 | 2010-04-14 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 10 | ||
| 3 | * gnus-sum.el (gnus-summary-bookmark-make-record): Add `location' field. | 11 | * gnus-sum.el (gnus-summary-bookmark-make-record): |
| 12 | Add `location' field. | ||
| 4 | 13 | ||
| 5 | 2010-04-12 Stefan Monnier <monnier@iro.umontreal.ca> | 14 | 2010-04-12 Stefan Monnier <monnier@iro.umontreal.ca> |
| 6 | 15 | ||
diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el index 5475506746a..c14d9a1b6aa 100644 --- a/lisp/gnus/nnir.el +++ b/lisp/gnus/nnir.el | |||
| @@ -52,7 +52,7 @@ | |||
| 52 | 52 | ||
| 53 | 53 | ||
| 54 | ;; The most recent version of this can always be fetched from the Gnus | 54 | ;; The most recent version of this can always be fetched from the Gnus |
| 55 | ;; CVS repository. See http://www.gnus.org/ for more information. | 55 | ;; repository. See http://www.gnus.org/ for more information. |
| 56 | 56 | ||
| 57 | ;; This code is still in the development stage but I'd like other | 57 | ;; This code is still in the development stage but I'd like other |
| 58 | ;; people to have a look at it. Please do not hesitate to contact me | 58 | ;; people to have a look at it. Please do not hesitate to contact me |
diff --git a/lisp/gnus/nnrss.el b/lisp/gnus/nnrss.el index 36291537909..08b621919eb 100644 --- a/lisp/gnus/nnrss.el +++ b/lisp/gnus/nnrss.el | |||
| @@ -427,7 +427,7 @@ otherwise return nil." | |||
| 427 | (defun nnrss-fetch (url &optional local) | 427 | (defun nnrss-fetch (url &optional local) |
| 428 | "Fetch URL and put it in a the expected Lisp structure." | 428 | "Fetch URL and put it in a the expected Lisp structure." |
| 429 | (mm-with-unibyte-buffer | 429 | (mm-with-unibyte-buffer |
| 430 | ;;some CVS versions of url.el need this to close the connection quickly | 430 | ;;some versions of url.el need this to close the connection quickly |
| 431 | (let (cs xmlform htmlform) | 431 | (let (cs xmlform htmlform) |
| 432 | ;; bit o' work necessary for w3 pre-cvs and post-cvs | 432 | ;; bit o' work necessary for w3 pre-cvs and post-cvs |
| 433 | (if local | 433 | (if local |
diff --git a/lisp/gnus/smime.el b/lisp/gnus/smime.el index 8780d6cfb61..b60acee445d 100644 --- a/lisp/gnus/smime.el +++ b/lisp/gnus/smime.el | |||
| @@ -42,7 +42,7 @@ | |||
| 42 | ;; done on messages encoded in these formats. The terminology chosen | 42 | ;; done on messages encoded in these formats. The terminology chosen |
| 43 | ;; reflect this. | 43 | ;; reflect this. |
| 44 | ;; | 44 | ;; |
| 45 | ;; The home of this file is in Gnus CVS, but also available from | 45 | ;; The home of this file is in Gnus, but also available from |
| 46 | ;; http://josefsson.org/smime.html. | 46 | ;; http://josefsson.org/smime.html. |
| 47 | 47 | ||
| 48 | ;;; Quick introduction: | 48 | ;;; Quick introduction: |
diff --git a/lisp/help.el b/lisp/help.el index 5e4c4ebaf61..899547aa0a1 100644 --- a/lisp/help.el +++ b/lisp/help.el | |||
| @@ -1048,10 +1048,9 @@ scroll the \"other\" window." | |||
| 1048 | Select WINDOW according to the value of `help-window-select'. | 1048 | Select WINDOW according to the value of `help-window-select'. |
| 1049 | Display message telling how to scroll and eventually quit WINDOW. | 1049 | Display message telling how to scroll and eventually quit WINDOW. |
| 1050 | 1050 | ||
| 1051 | Optional argument REUSE non-nil means WINDOW has been reused \(by | 1051 | Optional argument REUSE non-nil means WINDOW has been reused by |
| 1052 | `display-buffer'\) for displaying help. Optional argument | 1052 | `display-buffer'. Optional argument KEEP-FRAME non-nil means |
| 1053 | KEEP-FRAME non-nil means that quitting must no delete the frame | 1053 | that quitting should not delete WINDOW's frame." |
| 1054 | of WINDOW." | ||
| 1055 | (let ((number-of-windows | 1054 | (let ((number-of-windows |
| 1056 | (length (window-list (window-frame window) 'no-mini window)))) | 1055 | (length (window-list (window-frame window) 'no-mini window)))) |
| 1057 | (cond | 1056 | (cond |
diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el index dbf5cea7fc8..19aae590cb2 100644 --- a/lisp/htmlfontify.el +++ b/lisp/htmlfontify.el | |||
| @@ -1790,6 +1790,7 @@ FILE, if set, is the file name." | |||
| 1790 | (when font-lock-defaults | 1790 | (when font-lock-defaults |
| 1791 | (font-lock-fontify-buffer)) )) | 1791 | (font-lock-fontify-buffer)) )) |
| 1792 | 1792 | ||
| 1793 | ;;;###autoload | ||
| 1793 | (defun htmlfontify-buffer (&optional srcdir file) | 1794 | (defun htmlfontify-buffer (&optional srcdir file) |
| 1794 | "Create a new buffer, named for the current buffer + a .html extension, | 1795 | "Create a new buffer, named for the current buffer + a .html extension, |
| 1795 | containing an inline CSS-stylesheet and formatted CSS-markup HTML | 1796 | containing an inline CSS-stylesheet and formatted CSS-markup HTML |
| @@ -2276,6 +2277,7 @@ See also `hfy-load-tags-cache'." | |||
| 2276 | (save-buffer) | 2277 | (save-buffer) |
| 2277 | (kill-buffer B))) | 2278 | (kill-buffer B))) |
| 2278 | 2279 | ||
| 2280 | ;;;###autoload | ||
| 2279 | (defun htmlfontify-copy-and-link-dir (srcdir dstdir &optional f-ext l-ext) | 2281 | (defun htmlfontify-copy-and-link-dir (srcdir dstdir &optional f-ext l-ext) |
| 2280 | "Trawl SRCDIR and write fontified-and-hyperlinked output in DSTDIR. | 2282 | "Trawl SRCDIR and write fontified-and-hyperlinked output in DSTDIR. |
| 2281 | F-EXT and L-EXT specify values for `hfy-extn' and `hfy-link-extn'.\n | 2283 | F-EXT and L-EXT specify values for `hfy-extn' and `hfy-link-extn'.\n |
diff --git a/lisp/ido.el b/lisp/ido.el index ebfcbd4da88..57aa7d4a723 100644 --- a/lisp/ido.el +++ b/lisp/ido.el | |||
| @@ -2312,7 +2312,8 @@ If cursor is not at the end of the user input, move to end of input." | |||
| 2312 | (or ido-use-url-at-point ido-use-filename-at-point)) | 2312 | (or ido-use-url-at-point ido-use-filename-at-point)) |
| 2313 | (let (fn d) | 2313 | (let (fn d) |
| 2314 | (require 'ffap) | 2314 | (require 'ffap) |
| 2315 | ;; Duplicate code from ffap-guesser as we want different behavior for files and URLs. | 2315 | ;; Duplicate code from ffap-guesser as we want different |
| 2316 | ;; behavior for files and URLs. | ||
| 2316 | (cond | 2317 | (cond |
| 2317 | ((with-no-warnings | 2318 | ((with-no-warnings |
| 2318 | (and ido-use-url-at-point | 2319 | (and ido-use-url-at-point |
| @@ -2328,7 +2329,10 @@ If cursor is not at the end of the user input, move to end of input." | |||
| 2328 | (ffap-guesser) | 2329 | (ffap-guesser) |
| 2329 | (ffap-string-at-point)))) | 2330 | (ffap-string-at-point)))) |
| 2330 | (not (string-match "^http:/" fn)) | 2331 | (not (string-match "^http:/" fn)) |
| 2331 | (setq d (file-name-directory (expand-file-name fn))) | 2332 | (let ((absolute-fn (expand-file-name fn))) |
| 2333 | (setq d (if (file-directory-p absolute-fn) | ||
| 2334 | (file-name-as-directory absolute-fn) | ||
| 2335 | (file-name-directory absolute-fn)))) | ||
| 2332 | (file-directory-p d)) | 2336 | (file-directory-p d)) |
| 2333 | (setq ido-current-directory d) | 2337 | (setq ido-current-directory d) |
| 2334 | (setq initial (file-name-nondirectory fn)))))) | 2338 | (setq initial (file-name-nondirectory fn)))))) |
diff --git a/lisp/info.el b/lisp/info.el index 18a11d28777..aea283403ec 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -1053,8 +1053,8 @@ a case-insensitive match is tried." | |||
| 1053 | (Info-select-node) | 1053 | (Info-select-node) |
| 1054 | (goto-char (point-min)) | 1054 | (goto-char (point-min)) |
| 1055 | (forward-line 1) ; skip header line | 1055 | (forward-line 1) ; skip header line |
| 1056 | (when (> Info-breadcrumbs-depth 0) ; skip breadcrumbs line | 1056 | ;; (when (> Info-breadcrumbs-depth 0) ; skip breadcrumbs line |
| 1057 | (forward-line 1)) | 1057 | ;; (forward-line 1)) |
| 1058 | 1058 | ||
| 1059 | (cond (anchorpos | 1059 | (cond (anchorpos |
| 1060 | (let ((new-history (list Info-current-file | 1060 | (let ((new-history (list Info-current-file |
| @@ -3602,6 +3602,19 @@ If FORK is non-nil, it is passed to `Info-goto-node'." | |||
| 3602 | ((setq node (Info-get-token (point) "Prev: " "Prev: \\([^,\n\t]*\\)")) | 3602 | ((setq node (Info-get-token (point) "Prev: " "Prev: \\([^,\n\t]*\\)")) |
| 3603 | (Info-goto-node node fork))) | 3603 | (Info-goto-node node fork))) |
| 3604 | node)) | 3604 | node)) |
| 3605 | |||
| 3606 | (defun Info-mouse-follow-link (click) | ||
| 3607 | "Follow a link where you click." | ||
| 3608 | (interactive "e") | ||
| 3609 | (let* ((position (event-start click)) | ||
| 3610 | (posn-string (and position (posn-string position))) | ||
| 3611 | (string (car-safe posn-string)) | ||
| 3612 | (string-pos (cdr-safe posn-string)) | ||
| 3613 | (link-args (and string string-pos | ||
| 3614 | (get-text-property string-pos 'link-args string)))) | ||
| 3615 | (when link-args | ||
| 3616 | (Info-goto-node link-args)))) | ||
| 3617 | |||
| 3605 | 3618 | ||
| 3606 | (defvar Info-mode-map | 3619 | (defvar Info-mode-map |
| 3607 | (let ((map (make-keymap))) | 3620 | (let ((map (make-keymap))) |
| @@ -4183,11 +4196,22 @@ the variable `Info-file-list-for-emacs'." | |||
| 4183 | keymap) | 4196 | keymap) |
| 4184 | "Keymap to put on the Up link in the text or the header line.") | 4197 | "Keymap to put on the Up link in the text or the header line.") |
| 4185 | 4198 | ||
| 4186 | (defun Info-insert-breadcrumbs () | 4199 | (defvar Info-link-keymap |
| 4200 | (let ((keymap (make-sparse-keymap))) | ||
| 4201 | (define-key keymap [header-line mouse-1] 'Info-mouse-follow-link) | ||
| 4202 | (define-key keymap [header-line mouse-2] 'Info-mouse-follow-link) | ||
| 4203 | (define-key keymap [header-line down-mouse-1] 'ignore) | ||
| 4204 | (define-key keymap [mouse-2] 'Info-mouse-follow-link) | ||
| 4205 | (define-key keymap [follow-link] 'mouse-face) | ||
| 4206 | keymap) | ||
| 4207 | "Keymap to put on the link in the text or the header line.") | ||
| 4208 | |||
| 4209 | (defun Info-breadcrumbs () | ||
| 4187 | (let ((nodes (Info-toc-nodes Info-current-file)) | 4210 | (let ((nodes (Info-toc-nodes Info-current-file)) |
| 4188 | (node Info-current-node) | 4211 | (node Info-current-node) |
| 4189 | (crumbs ()) | 4212 | (crumbs ()) |
| 4190 | (depth Info-breadcrumbs-depth)) | 4213 | (depth Info-breadcrumbs-depth) |
| 4214 | line) | ||
| 4191 | 4215 | ||
| 4192 | ;; Get ancestors from the cached parent-children node info | 4216 | ;; Get ancestors from the cached parent-children node info |
| 4193 | (while (and (not (equal "Top" node)) (> depth 0)) | 4217 | (while (and (not (equal "Top" node)) (> depth 0)) |
| @@ -4214,15 +4238,25 @@ the variable `Info-file-list-for-emacs'." | |||
| 4214 | (file-name-nondirectory Info-current-file) | 4238 | (file-name-nondirectory Info-current-file) |
| 4215 | ;; Some legacy code can still use a symbol. | 4239 | ;; Some legacy code can still use a symbol. |
| 4216 | Info-current-file))))) | 4240 | Info-current-file))))) |
| 4217 | (insert (if (bolp) "" " > ") | 4241 | (setq line (concat |
| 4218 | (cond | 4242 | line |
| 4219 | ((null node) "...") | 4243 | (if (null line) "" " > ") |
| 4220 | ((equal node Info-current-node) | 4244 | (cond |
| 4221 | ;; No point linking to ourselves. | 4245 | ((null node) "...") |
| 4222 | (propertize text 'font-lock-face 'info-header-node)) | 4246 | ((equal node Info-current-node) |
| 4223 | (t | 4247 | ;; No point linking to ourselves. |
| 4224 | (concat "*Note " text "::")))))) | 4248 | (propertize text 'font-lock-face 'info-header-node)) |
| 4225 | (insert "\n")))) | 4249 | (t |
| 4250 | (propertize text | ||
| 4251 | 'mouse-face 'highlight | ||
| 4252 | 'font-lock-face 'info-header-xref | ||
| 4253 | 'help-echo "mouse-2: Go to node" | ||
| 4254 | 'keymap Info-link-keymap | ||
| 4255 | 'link-args text))))))) | ||
| 4256 | (setq line (concat line "\n"))) | ||
| 4257 | ;; (font-lock-append-text-property 0 (length line) | ||
| 4258 | ;; 'font-lock-face 'header-line line) | ||
| 4259 | line)) | ||
| 4226 | 4260 | ||
| 4227 | (defun Info-fontify-node () | 4261 | (defun Info-fontify-node () |
| 4228 | "Fontify the node." | 4262 | "Fontify the node." |
| @@ -4269,8 +4303,8 @@ the variable `Info-file-list-for-emacs'." | |||
| 4269 | ((string-equal (downcase tag) "next") Info-next-link-keymap) | 4303 | ((string-equal (downcase tag) "next") Info-next-link-keymap) |
| 4270 | ((string-equal (downcase tag) "up" ) Info-up-link-keymap)))))) | 4304 | ((string-equal (downcase tag) "up" ) Info-up-link-keymap)))))) |
| 4271 | 4305 | ||
| 4272 | (when (> Info-breadcrumbs-depth 0) | 4306 | ;; (when (> Info-breadcrumbs-depth 0) |
| 4273 | (Info-insert-breadcrumbs)) | 4307 | ;; (insert (Info-breadcrumbs))) |
| 4274 | 4308 | ||
| 4275 | ;; Treat header line. | 4309 | ;; Treat header line. |
| 4276 | (when Info-use-header-line | 4310 | (when Info-use-header-line |
| @@ -4302,7 +4336,10 @@ the variable `Info-file-list-for-emacs'." | |||
| 4302 | ;; that is in the header, if it is just part. | 4336 | ;; that is in the header, if it is just part. |
| 4303 | (cond | 4337 | (cond |
| 4304 | ((> Info-breadcrumbs-depth 0) | 4338 | ((> Info-breadcrumbs-depth 0) |
| 4305 | (put-text-property (point-min) (1+ header-end) 'invisible t)) | 4339 | (let ((ov (make-overlay (point-min) (1+ header-end)))) |
| 4340 | (overlay-put ov 'invisible t) | ||
| 4341 | (overlay-put ov 'after-string (Info-breadcrumbs)) | ||
| 4342 | (overlay-put ov 'evaporate t))) | ||
| 4306 | ((not (bobp)) | 4343 | ((not (bobp)) |
| 4307 | ;; Hide the punctuation at the end, too. | 4344 | ;; Hide the punctuation at the end, too. |
| 4308 | (skip-chars-backward " \t,") | 4345 | (skip-chars-backward " \t,") |
diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 244bfca8d28..ac33d26779f 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el | |||
| @@ -1165,6 +1165,64 @@ Internal use only.") | |||
| 1165 | (make-variable-buffer-local 'buffer-file-coding-system-explicit) | 1165 | (make-variable-buffer-local 'buffer-file-coding-system-explicit) |
| 1166 | (put 'buffer-file-coding-system-explicit 'permanent-local t) | 1166 | (put 'buffer-file-coding-system-explicit 'permanent-local t) |
| 1167 | 1167 | ||
| 1168 | (defun read-buffer-file-coding-system () | ||
| 1169 | (let* ((bcss (find-coding-systems-region (point-min) (point-max))) | ||
| 1170 | (css-table | ||
| 1171 | (unless (equal bcss '(undecided)) | ||
| 1172 | (append '("dos" "unix" "mac") | ||
| 1173 | (delq nil (mapcar (lambda (cs) | ||
| 1174 | (if (memq (coding-system-base cs) bcss) | ||
| 1175 | (symbol-name cs))) | ||
| 1176 | coding-system-list))))) | ||
| 1177 | (combined-table | ||
| 1178 | (if css-table | ||
| 1179 | (completion-table-in-turn css-table coding-system-alist) | ||
| 1180 | coding-system-alist)) | ||
| 1181 | (auto-cs | ||
| 1182 | (unless find-file-literally | ||
| 1183 | (save-excursion | ||
| 1184 | (save-restriction | ||
| 1185 | (widen) | ||
| 1186 | (goto-char (point-min)) | ||
| 1187 | (funcall set-auto-coding-function | ||
| 1188 | (or buffer-file-name "") (buffer-size)))))) | ||
| 1189 | (preferred | ||
| 1190 | (let ((bfcs (default-value 'buffer-file-coding-system))) | ||
| 1191 | (cons (and (or (equal bcss '(undecided)) | ||
| 1192 | (memq (coding-system-base bfcs) bcss)) | ||
| 1193 | bfcs) | ||
| 1194 | (mapcar (lambda (cs) | ||
| 1195 | (and (coding-system-p cs) | ||
| 1196 | (coding-system-get cs :mime-charset) | ||
| 1197 | (or (equal bcss '(undecided)) | ||
| 1198 | (memq (coding-system-base cs) bcss)) | ||
| 1199 | cs)) | ||
| 1200 | (coding-system-priority-list))))) | ||
| 1201 | (default | ||
| 1202 | (let ((current (coding-system-base buffer-file-coding-system))) | ||
| 1203 | ;; Generally use as a default the first preferred coding-system | ||
| 1204 | ;; different from the current coding-system, except for | ||
| 1205 | ;; the case of auto-cs since choosing anything else is asking | ||
| 1206 | ;; for trouble (would lead to using a different coding | ||
| 1207 | ;; system than specified in the coding tag). | ||
| 1208 | (or auto-cs | ||
| 1209 | (car (delq nil | ||
| 1210 | (mapcar (lambda (cs) | ||
| 1211 | (if (eq current (coding-system-base cs)) | ||
| 1212 | nil | ||
| 1213 | cs)) | ||
| 1214 | preferred)))))) | ||
| 1215 | (completion-ignore-case t) | ||
| 1216 | (completion-pcm--delim-wild-regex ; Let "u8" complete to "utf-8". | ||
| 1217 | (concat completion-pcm--delim-wild-regex | ||
| 1218 | "\\|\\([[:alpha:]]\\)[[:digit:]]")) | ||
| 1219 | (cs (completing-read | ||
| 1220 | (format "Coding system for saving file (default %s): " default) | ||
| 1221 | combined-table | ||
| 1222 | nil t nil 'coding-system-history | ||
| 1223 | (if default (symbol-name default))))) | ||
| 1224 | (unless (zerop (length cs)) (intern cs)))) | ||
| 1225 | |||
| 1168 | (defun set-buffer-file-coding-system (coding-system &optional force nomodify) | 1226 | (defun set-buffer-file-coding-system (coding-system &optional force nomodify) |
| 1169 | "Set the file coding-system of the current buffer to CODING-SYSTEM. | 1227 | "Set the file coding-system of the current buffer to CODING-SYSTEM. |
| 1170 | This means that when you save the buffer, it will be converted | 1228 | This means that when you save the buffer, it will be converted |
| @@ -1182,19 +1240,26 @@ surely saves the buffer with CODING-SYSTEM. From a program, if you | |||
| 1182 | don't want to mark the buffer modified, specify t for NOMODIFY. | 1240 | don't want to mark the buffer modified, specify t for NOMODIFY. |
| 1183 | If you know exactly what coding system you want to use, | 1241 | If you know exactly what coding system you want to use, |
| 1184 | just set the variable `buffer-file-coding-system' directly." | 1242 | just set the variable `buffer-file-coding-system' directly." |
| 1185 | (interactive "zCoding system for saving file (default nil): \nP") | 1243 | (interactive |
| 1244 | (list (read-buffer-file-coding-system) | ||
| 1245 | current-prefix-arg)) | ||
| 1186 | (check-coding-system coding-system) | 1246 | (check-coding-system coding-system) |
| 1187 | (if (and coding-system buffer-file-coding-system (null force)) | 1247 | (if (and coding-system buffer-file-coding-system (null force)) |
| 1188 | (setq coding-system | 1248 | (setq coding-system |
| 1189 | (merge-coding-systems coding-system buffer-file-coding-system))) | 1249 | (merge-coding-systems coding-system buffer-file-coding-system))) |
| 1250 | (when (called-interactively-p 'interactive) | ||
| 1251 | ;; Check whether save would succeed, and jump to the offending char(s) | ||
| 1252 | ;; if not. | ||
| 1253 | (let ((css (find-coding-systems-region (point-min) (point-max)))) | ||
| 1254 | (unless (or (eq (car css) 'undecided) | ||
| 1255 | (memq (coding-system-base coding-system) css)) | ||
| 1256 | (setq coding-system (select-safe-coding-system-interactively | ||
| 1257 | (point-min) (point-max) css | ||
| 1258 | (list coding-system)))))) | ||
| 1190 | (setq buffer-file-coding-system coding-system) | 1259 | (setq buffer-file-coding-system coding-system) |
| 1191 | (if buffer-file-coding-system-explicit | 1260 | (if buffer-file-coding-system-explicit |
| 1192 | (setcdr buffer-file-coding-system-explicit coding-system) | 1261 | (setcdr buffer-file-coding-system-explicit coding-system) |
| 1193 | (setq buffer-file-coding-system-explicit (cons nil coding-system))) | 1262 | (setq buffer-file-coding-system-explicit (cons nil coding-system))) |
| 1194 | ;; This is in case of an explicit call. Normally, `normal-mode' and | ||
| 1195 | ;; `set-buffer-major-mode-hook' take care of setting the table. | ||
| 1196 | (if (fboundp 'ucs-set-table-for-input) ; don't lose when building | ||
| 1197 | (ucs-set-table-for-input)) | ||
| 1198 | (unless nomodify | 1263 | (unless nomodify |
| 1199 | (set-buffer-modified-p t)) | 1264 | (set-buffer-modified-p t)) |
| 1200 | (force-mode-line-update)) | 1265 | (force-mode-line-update)) |
diff --git a/lisp/language/indian.el b/lisp/language/indian.el index dd5bf2960b1..3414da2e045 100644 --- a/lisp/language/indian.el +++ b/lisp/language/indian.el | |||
| @@ -241,7 +241,7 @@ South Indian language Malayalam is supported in this language environment.")) | |||
| 241 | ;; syllables with an independent vowel, or | 241 | ;; syllables with an independent vowel, or |
| 242 | "\\(?:RH\\)?Vn?\\(?:J?HR\\)?v*n?a?A?\\|" | 242 | "\\(?:RH\\)?Vn?\\(?:J?HR\\)?v*n?a?A?\\|" |
| 243 | ;; consonant-based syllables, or | 243 | ;; consonant-based syllables, or |
| 244 | "Cn?\\(?:J?HJ?Cn?\\)*\\(?:H[NJ]?|v*n?a?A?\\)\\|" | 244 | "Cn?\\(?:J?HJ?Cn?\\)*\\(?:H[NJ]?\\|v*n?a?A?\\)\\|" |
| 245 | ;; special consonant form, or | 245 | ;; special consonant form, or |
| 246 | "JHR\\|" | 246 | "JHR\\|" |
| 247 | ;; any other singleton characters | 247 | ;; any other singleton characters |
| @@ -256,8 +256,9 @@ South Indian language Malayalam is supported in this language environment.")) | |||
| 256 | ("V" . "[\u0B05-\u0B14\u0B60-\u0B61]") ; independent vowel | 256 | ("V" . "[\u0B05-\u0B14\u0B60-\u0B61]") ; independent vowel |
| 257 | ("C" . "[\u0B15-\u0B39\u0B5C-\u0B5D\u0B71]") ; consonant | 257 | ("C" . "[\u0B15-\u0B39\u0B5C-\u0B5D\u0B71]") ; consonant |
| 258 | ("B" . "[\u0B15-\u0B17\u0B1B-\u0B1D\u0B1F-\u0B21\u0B23-\u0B24\u0B27-\u0B30\u0B32-\u0B35\u0B38-\u0B39]") ; consonant with below form | 258 | ("B" . "[\u0B15-\u0B17\u0B1B-\u0B1D\u0B1F-\u0B21\u0B23-\u0B24\u0B27-\u0B30\u0B32-\u0B35\u0B38-\u0B39]") ; consonant with below form |
| 259 | ("R" . "\u0B30") ; RA | ||
| 259 | ("n" . "\u0B3C") ; NUKTA | 260 | ("n" . "\u0B3C") ; NUKTA |
| 260 | ("v" . "[\u0B3E-\u0B44\u0B56-\u0B57\u0B62-\u0B63]") ; vowel sign | 261 | ("v" . "[\u0B3E-\u0B44\u0B47\u0B56-\u0B57\u0B62-\u0B63]") ; vowel sign |
| 261 | ("H" . "\u0B4D") ; VIRAMA | 262 | ("H" . "\u0B4D") ; VIRAMA |
| 262 | ("N" . "\u200C") ; ZWNJ | 263 | ("N" . "\u200C") ; ZWNJ |
| 263 | ("J" . "\u200D") ; ZWJ | 264 | ("J" . "\u200D") ; ZWJ |
| @@ -267,7 +268,7 @@ South Indian language Malayalam is supported in this language environment.")) | |||
| 267 | ;; syllables with an independent vowel, or | 268 | ;; syllables with an independent vowel, or |
| 268 | "\\(?:RH\\)?Vn?\\(?:J?HB\\)?v*n?a?A?\\|" | 269 | "\\(?:RH\\)?Vn?\\(?:J?HB\\)?v*n?a?A?\\|" |
| 269 | ;; consonant-based syllables, or | 270 | ;; consonant-based syllables, or |
| 270 | "Cn?\\(?:J?HJ?Cn?\\)*\\(?:H[NJ]?|v*n?a?A?\\)\\|" | 271 | "Cn?\\(?:J?HJ?Cn?\\)*\\(?:H[NJ]?\\|v*n?a?A?\\)\\|" |
| 271 | ;; special consonant form, or | 272 | ;; special consonant form, or |
| 272 | "JHB\\|" | 273 | "JHB\\|" |
| 273 | ;; any other singleton characters | 274 | ;; any other singleton characters |
| @@ -288,7 +289,7 @@ South Indian language Malayalam is supported in this language environment.")) | |||
| 288 | (indian-compose-regexp | 289 | (indian-compose-regexp |
| 289 | (concat | 290 | (concat |
| 290 | ;; consonant-based syllables, or | 291 | ;; consonant-based syllables, or |
| 291 | "C\\(?:J?HJ?C\\)*\\(?:H[NJ]?|v*a?\\)\\|" | 292 | "C\\(?:J?HJ?C\\)*\\(?:H[NJ]?\\|v*a?\\)\\|" |
| 292 | ;; syllables with an independent vowel, or | 293 | ;; syllables with an independent vowel, or |
| 293 | "Vv*a?\\|" | 294 | "Vv*a?\\|" |
| 294 | ;; any other singleton characters | 295 | ;; any other singleton characters |
| @@ -302,14 +303,14 @@ South Indian language Malayalam is supported in this language environment.")) | |||
| 302 | ("V" . "[\u0C05-\u0C14\u0C60-\u0C61]") ; independent vowel | 303 | ("V" . "[\u0C05-\u0C14\u0C60-\u0C61]") ; independent vowel |
| 303 | ("C" . "[\u0C15-\u0C39\u0C58-\u0C59]") ; consonant | 304 | ("C" . "[\u0C15-\u0C39\u0C58-\u0C59]") ; consonant |
| 304 | ("v" . "[\u0C3E-\u0C4C\u0C55-\u0C56\u0C62-\u0C63]") ; vowel sign | 305 | ("v" . "[\u0C3E-\u0C4C\u0C55-\u0C56\u0C62-\u0C63]") ; vowel sign |
| 305 | ("H" . "\u0BCD") ; VIRAMA | 306 | ("H" . "\u0C4D") ; VIRAMA |
| 306 | ("N" . "\u200C") ; ZWNJ | 307 | ("N" . "\u200C") ; ZWNJ |
| 307 | ("J" . "\u200D") ; ZWJ | 308 | ("J" . "\u200D") ; ZWJ |
| 308 | ("X" . "[\u0C00-\u0C7F]")))) ; all coverage | 309 | ("X" . "[\u0C00-\u0C7F]")))) ; all coverage |
| 309 | (indian-compose-regexp | 310 | (indian-compose-regexp |
| 310 | (concat | 311 | (concat |
| 311 | ;; consonant-based syllables, or | 312 | ;; consonant-based syllables, or |
| 312 | "C\\(?:J?HJ?C\\)*\\(?:H[NJ]?|v*a?\\)\\|" | 313 | "C\\(?:J?HJ?C\\)*\\(?:H[NJ]?\\|v*a?\\)\\|" |
| 313 | ;; syllables with an independent vowel, or | 314 | ;; syllables with an independent vowel, or |
| 314 | "V\\(?:J?HC\\)?v*a?\\|" | 315 | "V\\(?:J?HC\\)?v*a?\\|" |
| 315 | ;; special consonant form, or | 316 | ;; special consonant form, or |
| @@ -324,7 +325,7 @@ South Indian language Malayalam is supported in this language environment.")) | |||
| 324 | '(("A" . "[\u0C82-\u0C83]") ; SIGN ANUSVARA .. VISARGA | 325 | '(("A" . "[\u0C82-\u0C83]") ; SIGN ANUSVARA .. VISARGA |
| 325 | ("V" . "[\u0C85-\u0C94\u0CE0-\u0CE1]") ; independent vowel | 326 | ("V" . "[\u0C85-\u0C94\u0CE0-\u0CE1]") ; independent vowel |
| 326 | ("C" . "[\u0C95-\u0CB9\u0CDE]") ; consonant | 327 | ("C" . "[\u0C95-\u0CB9\u0CDE]") ; consonant |
| 327 | ("B" . "\u0CB0") ; RA | 328 | ("R" . "\u0CB0") ; RA |
| 328 | ("n" . "\u0CBC") ; NUKTA | 329 | ("n" . "\u0CBC") ; NUKTA |
| 329 | ("v" . "[\u0CBE-\u0CCC\u0CD5-\u0CD6\u0CE2-\u0CE3]") ; vowel sign | 330 | ("v" . "[\u0CBE-\u0CCC\u0CD5-\u0CD6\u0CE2-\u0CE3]") ; vowel sign |
| 330 | ("H" . "\u0CCD") ; VIRAMA | 331 | ("H" . "\u0CCD") ; VIRAMA |
| @@ -336,9 +337,9 @@ South Indian language Malayalam is supported in this language environment.")) | |||
| 336 | ;; syllables with an independent vowel, or | 337 | ;; syllables with an independent vowel, or |
| 337 | "\\(?:RH\\)?Vn?\\(?:J?HC\\)?v?A?\\|" | 338 | "\\(?:RH\\)?Vn?\\(?:J?HC\\)?v?A?\\|" |
| 338 | ;; consonant-based syllables, or | 339 | ;; consonant-based syllables, or |
| 339 | "Cn?\\(?:J?HJ?Cn?\\)*\\(?:H[NJ]?|v*n?A?\\)\\|" | 340 | "Cn?\\(?:J?HJ?Cn?\\)*\\(?:H[NJ]?\\|v*n?A?\\)\\|" |
| 340 | ;; special consonant form, or | 341 | ;; special consonant form, or |
| 341 | "JHB\\|" | 342 | "JHC\\|" |
| 342 | ;; any other singleton characters | 343 | ;; any other singleton characters |
| 343 | "X") | 344 | "X") |
| 344 | table)) | 345 | table)) |
| @@ -351,13 +352,14 @@ South Indian language Malayalam is supported in this language environment.")) | |||
| 351 | ("C" . "[\u0D15-\u0D39]") ; consonant | 352 | ("C" . "[\u0D15-\u0D39]") ; consonant |
| 352 | ("Y" . "[\u0D2F-\u0D30\u0D32\u0D35]") ; YA, RA, LA, VA | 353 | ("Y" . "[\u0D2F-\u0D30\u0D32\u0D35]") ; YA, RA, LA, VA |
| 353 | ("v" . "[\u0D3E-\u0D48\u0D57\u0D62-\u0D63]") ; postbase matra | 354 | ("v" . "[\u0D3E-\u0D48\u0D57\u0D62-\u0D63]") ; postbase matra |
| 355 | ("H" . "\u0D4D") ; SIGN VIRAMA | ||
| 354 | ("N" . "\u200C") ; ZWNJ | 356 | ("N" . "\u200C") ; ZWNJ |
| 355 | ("J" . "\u200D") ; ZWJ | 357 | ("J" . "\u200D") ; ZWJ |
| 356 | ("X" . "[\u0D00-\u0D7F]")))) ; all coverage | 358 | ("X" . "[\u0D00-\u0D7F]")))) ; all coverage |
| 357 | (indian-compose-regexp | 359 | (indian-compose-regexp |
| 358 | (concat | 360 | (concat |
| 359 | ;; consonant-based syllables, or | 361 | ;; consonant-based syllables, or |
| 360 | "\\(?:CJ?HJ?C\\)*\\(?:H[NJ]?\\|v?A?\\)\\|" | 362 | "C\\(?:J?HJ?C\\)*\\(?:H[NJ]?\\|v?A?\\)\\|" |
| 361 | ;; syllables with an independent vowel, or | 363 | ;; syllables with an independent vowel, or |
| 362 | "V\\(?:J?HY\\)?v*?A?\\|" | 364 | "V\\(?:J?HY\\)?v*?A?\\|" |
| 363 | ;; special consonant form, or | 365 | ;; special consonant form, or |
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 05cc13bd2e4..2730350c3df 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el | |||
| @@ -381,21 +381,38 @@ the second failed attempt to complete." | |||
| 381 | (defconst completion-styles-alist | 381 | (defconst completion-styles-alist |
| 382 | '((emacs21 | 382 | '((emacs21 |
| 383 | completion-emacs21-try-completion completion-emacs21-all-completions | 383 | completion-emacs21-try-completion completion-emacs21-all-completions |
| 384 | "Simple prefix-based completion.") | 384 | "Simple prefix-based completion. |
| 385 | I.e. when completing \"foo_bar\" (where _ is the position of point), | ||
| 386 | it will consider all completions candidates matching the glob | ||
| 387 | pattern \"foobar*\".") | ||
| 385 | (emacs22 | 388 | (emacs22 |
| 386 | completion-emacs22-try-completion completion-emacs22-all-completions | 389 | completion-emacs22-try-completion completion-emacs22-all-completions |
| 387 | "Prefix completion that only operates on the text before point.") | 390 | "Prefix completion that only operates on the text before point. |
| 391 | I.e. when completing \"foo_bar\" (where _ is the position of point), | ||
| 392 | it will consider all completions candidates matching the glob | ||
| 393 | pattern \"foo*\" and will add back \"bar\" to the end of it.") | ||
| 388 | (basic | 394 | (basic |
| 389 | completion-basic-try-completion completion-basic-all-completions | 395 | completion-basic-try-completion completion-basic-all-completions |
| 390 | "Completion of the prefix before point and the suffix after point.") | 396 | "Completion of the prefix before point and the suffix after point. |
| 397 | I.e. when completing \"foo_bar\" (where _ is the position of point), | ||
| 398 | it will consider all completions candidates matching the glob | ||
| 399 | pattern \"foo*bar*\".") | ||
| 391 | (partial-completion | 400 | (partial-completion |
| 392 | completion-pcm-try-completion completion-pcm-all-completions | 401 | completion-pcm-try-completion completion-pcm-all-completions |
| 393 | "Completion of multiple words, each one taken as a prefix. | 402 | "Completion of multiple words, each one taken as a prefix. |
| 394 | E.g. M-x l-c-h can complete to list-command-history | 403 | I.e. when completing \"l-co_h\" (where _ is the position of point), |
| 395 | and C-x C-f /u/m/s to /usr/monnier/src.") | 404 | it will consider all completions candidates matching the glob |
| 405 | pattern \"l*-co*h*\". | ||
| 406 | Furthermore, for completions that are done step by step in subfields, | ||
| 407 | the method is applied to all the preceding fields that do not yet match. | ||
| 408 | E.g. C-x C-f /u/mo/s TAB could complete to /usr/monnier/src. | ||
| 409 | Additionally the user can use the char \"*\" as a glob pattern.") | ||
| 396 | (substring | 410 | (substring |
| 397 | completion-substring-try-completion completion-substring-all-completions | 411 | completion-substring-try-completion completion-substring-all-completions |
| 398 | "Completion of the string taken as a substring.") | 412 | "Completion of the string taken as a substring. |
| 413 | I.e. when completing \"foo_bar\" (where _ is the position of point), | ||
| 414 | it will consider all completions candidates matching the glob | ||
| 415 | pattern \"*foo*bar*\".") | ||
| 399 | (initials | 416 | (initials |
| 400 | completion-initials-try-completion completion-initials-all-completions | 417 | completion-initials-try-completion completion-initials-all-completions |
| 401 | "Completion of acronyms and initialisms. | 418 | "Completion of acronyms and initialisms. |
| @@ -410,7 +427,19 @@ ALL-COMPLETIONS is the function that lists the completions (it should | |||
| 410 | follow the calling convention of `completion-all-completions'), | 427 | follow the calling convention of `completion-all-completions'), |
| 411 | and DOC describes the way this style of completion works.") | 428 | and DOC describes the way this style of completion works.") |
| 412 | 429 | ||
| 413 | (defcustom completion-styles '(basic partial-completion emacs22) | 430 | (defcustom completion-styles |
| 431 | ;; First, use `basic' because prefix completion has been the standard | ||
| 432 | ;; for "ever" and works well in most cases, so using it first | ||
| 433 | ;; ensures that we obey previous behavior in most cases. | ||
| 434 | '(basic | ||
| 435 | ;; Then use `partial-completion' because it has proven to | ||
| 436 | ;; be a very convenient extension. | ||
| 437 | partial-completion | ||
| 438 | ;; Finally use `emacs22' so as to maintain (in many/most cases) | ||
| 439 | ;; the previous behavior that when completing "foobar" with point | ||
| 440 | ;; between "foo" and "bar" the completion try to complete "foo" | ||
| 441 | ;; and simply add "bar" to the end of the result. | ||
| 442 | emacs22) | ||
| 414 | "List of completion styles to use. | 443 | "List of completion styles to use. |
| 415 | The available styles are listed in `completion-styles-alist'." | 444 | The available styles are listed in `completion-styles-alist'." |
| 416 | :type `(repeat (choice ,@(mapcar (lambda (x) (list 'const (car x))) | 445 | :type `(repeat (choice ,@(mapcar (lambda (x) (list 'const (car x))) |
diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el index 6ba9fac608d..3784ba787c4 100644 --- a/lisp/progmodes/fortran.el +++ b/lisp/progmodes/fortran.el | |||
| @@ -403,6 +403,28 @@ program\\|subroutine\\)\\>[ \t]*\\(\\sw+\\)?" | |||
| 403 | '("^ *\\([0-9]+\\)" . font-lock-constant-face))) | 403 | '("^ *\\([0-9]+\\)" . font-lock-constant-face))) |
| 404 | "Medium level highlighting for Fortran mode.") | 404 | "Medium level highlighting for Fortran mode.") |
| 405 | 405 | ||
| 406 | ;; See bug#1385. Never really looked into _why_ this matters... | ||
| 407 | (defun fortran-match-and-skip-declaration (limit) | ||
| 408 | "Like `font-lock-match-c-style-declaration-item-and-skip-to-next'. | ||
| 409 | The only difference is, it returns t in a case when the default returns nil." | ||
| 410 | (when (looking-at "[ \n\t*]*\\(\\sw+\\)[ \t\n]*\\(((?\\)?") | ||
| 411 | (when (and (match-end 2) (> (- (match-end 2) (match-beginning 2)) 1)) | ||
| 412 | (let ((pos (point))) | ||
| 413 | (skip-chars-backward " \t\n") | ||
| 414 | (skip-syntax-backward "w") | ||
| 415 | (unless (looking-at "\\(\\sw+\\)[ \t\n]*\\sw+[ \t\n]*\\(((?\\)?") | ||
| 416 | (goto-char pos) | ||
| 417 | (looking-at "[ \n\t*]*\\(\\sw+\\)[ \t\n]*\\(((?\\)?")))) | ||
| 418 | (save-match-data | ||
| 419 | (condition-case nil | ||
| 420 | (save-restriction | ||
| 421 | (narrow-to-region (point-min) limit) | ||
| 422 | (goto-char (match-end 1)) | ||
| 423 | (while (not (looking-at "[ \t\n]*\\(\\(,\\)\\|;\\|\\'\\)")) | ||
| 424 | (goto-char (or (scan-sexps (point) 1) (point-max)))) | ||
| 425 | (goto-char (match-end 2))) | ||
| 426 | (error t))))) | ||
| 427 | |||
| 406 | (defvar fortran-font-lock-keywords-3 | 428 | (defvar fortran-font-lock-keywords-3 |
| 407 | (append | 429 | (append |
| 408 | fortran-font-lock-keywords-1 | 430 | fortran-font-lock-keywords-1 |
| @@ -412,7 +434,7 @@ program\\|subroutine\\)\\>[ \t]*\\(\\sw+\\)?" | |||
| 412 | ;; Type specifier. | 434 | ;; Type specifier. |
| 413 | '(1 font-lock-type-face) | 435 | '(1 font-lock-type-face) |
| 414 | ;; Declaration item (or just /.../ block name). | 436 | ;; Declaration item (or just /.../ block name). |
| 415 | `(font-lock-match-c-style-declaration-item-and-skip-to-next | 437 | `(fortran-match-and-skip-declaration |
| 416 | ;; Start after any *(...) expression. | 438 | ;; Start after any *(...) expression. |
| 417 | (condition-case nil | 439 | (condition-case nil |
| 418 | (and (match-beginning ,(1+ (regexp-opt-depth | 440 | (and (match-beginning ,(1+ (regexp-opt-depth |
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index b13a75e3844..de94620c737 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el | |||
| @@ -513,8 +513,8 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'." | |||
| 513 | grep-find-template grep-find-use-xargs | 513 | grep-find-template grep-find-use-xargs |
| 514 | grep-highlight-matches)) | 514 | grep-highlight-matches)) |
| 515 | (set setting | 515 | (set setting |
| 516 | (or (cadr (assq setting host-defaults)) | 516 | (cadr (or (assq setting host-defaults) |
| 517 | (cadr (assq setting defaults))))) | 517 | (assq setting defaults))))) |
| 518 | 518 | ||
| 519 | (unless (or (not grep-use-null-device) (eq grep-use-null-device t)) | 519 | (unless (or (not grep-use-null-device) (eq grep-use-null-device t)) |
| 520 | (setq grep-use-null-device | 520 | (setq grep-use-null-device |
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 38698af7885..5fc92a92d37 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el | |||
| @@ -1060,7 +1060,7 @@ subshell is initiated, `tex-shell-hook' is run." | |||
| 1060 | "\\>\\|\\\\[a-z]*" (regexp-opt '("space" "skip" "page") t) | 1060 | "\\>\\|\\\\[a-z]*" (regexp-opt '("space" "skip" "page") t) |
| 1061 | "\\>\\)")) | 1061 | "\\>\\)")) |
| 1062 | (setq paragraph-separate | 1062 | (setq paragraph-separate |
| 1063 | (concat "[\f]\\|[ \t]*\\($\\|" | 1063 | (concat "[\f%]\\|[ \t]*\\($\\|" |
| 1064 | "\\\\[][]\\|" | 1064 | "\\\\[][]\\|" |
| 1065 | "\\\\" (regexp-opt (append | 1065 | "\\\\" (regexp-opt (append |
| 1066 | (mapcar 'car latex-section-alist) | 1066 | (mapcar 'car latex-section-alist) |
diff --git a/lisp/tmm.el b/lisp/tmm.el index e453dbde84b..0cbc72673a4 100644 --- a/lisp/tmm.el +++ b/lisp/tmm.el | |||
| @@ -262,9 +262,6 @@ Its value should be an event that has a binding in MENU." | |||
| 262 | (condition-case nil | 262 | (condition-case nil |
| 263 | (require 'mouse) | 263 | (require 'mouse) |
| 264 | (error nil)) | 264 | (error nil)) |
| 265 | (condition-case nil | ||
| 266 | (x-popup-menu nil choice) ; Get the shortcuts | ||
| 267 | (error nil)) | ||
| 268 | (tmm-prompt choice)) | 265 | (tmm-prompt choice)) |
| 269 | ;; We just handled a menu keymap and found a command. | 266 | ;; We just handled a menu keymap and found a command. |
| 270 | (choice | 267 | (choice |
| @@ -445,7 +442,7 @@ element of keymap, an `x-popup-menu' argument, or an element of | |||
| 445 | `x-popup-menu' argument (when IN-X-MENU is not-nil). | 442 | `x-popup-menu' argument (when IN-X-MENU is not-nil). |
| 446 | This function adds the element only if it is not already present. | 443 | This function adds the element only if it is not already present. |
| 447 | It uses the free variable `tmm-table-undef' to keep undefined keys." | 444 | It uses the free variable `tmm-table-undef' to keep undefined keys." |
| 448 | (let (km str cache plist filter visible enable (event (car elt))) | 445 | (let (km str plist filter visible enable (event (car elt))) |
| 449 | (setq elt (cdr elt)) | 446 | (setq elt (cdr elt)) |
| 450 | (if (eq elt 'undefined) | 447 | (if (eq elt 'undefined) |
| 451 | (setq tmm-table-undef (cons (cons event nil) tmm-table-undef)) | 448 | (setq tmm-table-undef (cons (cons event nil) tmm-table-undef)) |
| @@ -468,11 +465,7 @@ It uses the free variable `tmm-table-undef' to keep undefined keys." | |||
| 468 | (and (symbolp (cdr-safe (cdr-safe elt))) | 465 | (and (symbolp (cdr-safe (cdr-safe elt))) |
| 469 | (fboundp (cdr-safe (cdr-safe elt))))) | 466 | (fboundp (cdr-safe (cdr-safe elt))))) |
| 470 | (setq km (cddr elt)) | 467 | (setq km (cddr elt)) |
| 471 | (and (stringp (car elt)) (setq str (car elt))) | 468 | (and (stringp (car elt)) (setq str (car elt)))) |
| 472 | (and str | ||
| 473 | (stringp (cdr-safe (cadr elt))) ; keyseq cache | ||
| 474 | (setq cache (cdr (cadr elt))) | ||
| 475 | cache (setq str (concat str cache)))) | ||
| 476 | 469 | ||
| 477 | ((eq (car-safe elt) 'menu-item) | 470 | ((eq (car-safe elt) 'menu-item) |
| 478 | ;; (menu-item TITLE COMMAND KEY ...) | 471 | ;; (menu-item TITLE COMMAND KEY ...) |
| @@ -489,13 +482,7 @@ It uses the free variable `tmm-table-undef' to keep undefined keys." | |||
| 489 | (setq km (and (eval visible) km))) | 482 | (setq km (and (eval visible) km))) |
| 490 | (setq enable (plist-get plist :enable)) | 483 | (setq enable (plist-get plist :enable)) |
| 491 | (if enable | 484 | (if enable |
| 492 | (setq km (if (eval enable) km 'ignore))) | 485 | (setq km (if (eval enable) km 'ignore)))) |
| 493 | (and str | ||
| 494 | (consp (nth 3 elt)) | ||
| 495 | (stringp (cdr (nth 3 elt))) ; keyseq cache | ||
| 496 | (setq cache (cdr (nth 3 elt))) | ||
| 497 | cache | ||
| 498 | (setq str (concat str cache)))) | ||
| 499 | 486 | ||
| 500 | ((if (listp (cdr-safe (cdr-safe (cdr-safe elt)))) | 487 | ((if (listp (cdr-safe (cdr-safe (cdr-safe elt)))) |
| 501 | (or (keymapp (cdr-safe (cdr-safe (cdr-safe elt)))) | 488 | (or (keymapp (cdr-safe (cdr-safe (cdr-safe elt)))) |
| @@ -504,16 +491,25 @@ It uses the free variable `tmm-table-undef' to keep undefined keys." | |||
| 504 | (fboundp (cdr-safe (cdr-safe (cdr-safe elt)))))) | 491 | (fboundp (cdr-safe (cdr-safe (cdr-safe elt)))))) |
| 505 | ; New style of easy-menu | 492 | ; New style of easy-menu |
| 506 | (setq km (cdr (cddr elt))) | 493 | (setq km (cdr (cddr elt))) |
| 507 | (and (stringp (car elt)) (setq str (car elt))) | 494 | (and (stringp (car elt)) (setq str (car elt)))) |
| 508 | (and str | ||
| 509 | (stringp (cdr-safe (car (cddr elt)))) ; keyseq cache | ||
| 510 | (setq cache (cdr (car (cdr (cdr elt))))) | ||
| 511 | cache (setq str (concat str cache)))) | ||
| 512 | 495 | ||
| 513 | ((stringp event) ; x-popup or x-popup element | 496 | ((stringp event) ; x-popup or x-popup element |
| 514 | (if (or in-x-menu (stringp (car-safe elt))) | 497 | (if (or in-x-menu (stringp (car-safe elt))) |
| 515 | (setq str event event nil km elt) | 498 | (setq str event event nil km elt) |
| 516 | (setq str event event nil km (cons 'keymap elt)))))) | 499 | (setq str event event nil km (cons 'keymap elt))))) |
| 500 | (unless (eq km 'ignore) | ||
| 501 | (let ((binding (where-is-internal km nil t))) | ||
| 502 | (when binding | ||
| 503 | (setq binding (key-description binding)) | ||
| 504 | ;; Try to align the keybindings. | ||
| 505 | (let ((colwidth (min 30 (- (/ (window-width) 2) 10)))) | ||
| 506 | (setq str | ||
| 507 | (concat str | ||
| 508 | (make-string (max 2 (- colwidth | ||
| 509 | (string-width str) | ||
| 510 | (string-width binding))) | ||
| 511 | ?\s) | ||
| 512 | binding))))))) | ||
| 517 | (and km (stringp km) (setq str km)) | 513 | (and km (stringp km) (setq str km)) |
| 518 | ;; Verify that the command is enabled; | 514 | ;; Verify that the command is enabled; |
| 519 | ;; if not, don't mention it. | 515 | ;; if not, don't mention it. |
diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el index 2c576623120..64935f16dbd 100644 --- a/lisp/vc-bzr.el +++ b/lisp/vc-bzr.el | |||
| @@ -899,10 +899,10 @@ stream. Standard error output is discarded." | |||
| 899 | (defun vc-bzr-shelve-show (name) | 899 | (defun vc-bzr-shelve-show (name) |
| 900 | "Show the contents of shelve NAME." | 900 | "Show the contents of shelve NAME." |
| 901 | (interactive "sShelve name: ") | 901 | (interactive "sShelve name: ") |
| 902 | (vc-setup-buffer "*vc-bzr-shelve*") | 902 | (vc-setup-buffer "*vc-diff*") |
| 903 | ;; FIXME: how can you show the contents of a shelf? | 903 | ;; FIXME: how can you show the contents of a shelf? |
| 904 | (vc-bzr-command "unshelve" "*vc-bzr-shelve*" 'async nil "--preview" name) | 904 | (vc-bzr-command "unshelve" "*vc-diff*" 'async nil "--preview" name) |
| 905 | (set-buffer "*vc-bzr-shelve*") | 905 | (set-buffer "*vc-diff*") |
| 906 | (diff-mode) | 906 | (diff-mode) |
| 907 | (setq buffer-read-only t) | 907 | (setq buffer-read-only t) |
| 908 | (pop-to-buffer (current-buffer))) | 908 | (pop-to-buffer (current-buffer))) |
| @@ -910,13 +910,13 @@ stream. Standard error output is discarded." | |||
| 910 | (defun vc-bzr-shelve-apply (name) | 910 | (defun vc-bzr-shelve-apply (name) |
| 911 | "Apply shelve NAME and remove it afterwards." | 911 | "Apply shelve NAME and remove it afterwards." |
| 912 | (interactive "sApply (and remove) shelf: ") | 912 | (interactive "sApply (and remove) shelf: ") |
| 913 | (vc-bzr-command "unshelve" "*vc-bzr-shelve*" 0 nil "--apply" name) | 913 | (vc-bzr-command "unshelve" nil 0 nil "--apply" name) |
| 914 | (vc-resynch-buffer (vc-bzr-root default-directory) t t)) | 914 | (vc-resynch-buffer (vc-bzr-root default-directory) t t)) |
| 915 | 915 | ||
| 916 | (defun vc-bzr-shelve-apply-and-keep (name) | 916 | (defun vc-bzr-shelve-apply-and-keep (name) |
| 917 | "Apply shelve NAME and keep it afterwards." | 917 | "Apply shelve NAME and keep it afterwards." |
| 918 | (interactive "sApply (and keep) shelf: ") | 918 | (interactive "sApply (and keep) shelf: ") |
| 919 | (vc-bzr-command "unshelve" "*vc-bzr-shelve*" 0 nil "--apply" "--keep" name) | 919 | (vc-bzr-command "unshelve" nil 0 nil "--apply" "--keep" name) |
| 920 | (vc-resynch-buffer (vc-bzr-root default-directory) t t)) | 920 | (vc-resynch-buffer (vc-bzr-root default-directory) t t)) |
| 921 | 921 | ||
| 922 | (defun vc-bzr-shelve-snapshot () | 922 | (defun vc-bzr-shelve-snapshot () |
| @@ -927,7 +927,7 @@ stream. Standard error output is discarded." | |||
| 927 | (concat | 927 | (concat |
| 928 | (format-time-string "Snapshot on %Y-%m-%d" ct) | 928 | (format-time-string "Snapshot on %Y-%m-%d" ct) |
| 929 | (format-time-string " at %H:%M" ct)))) | 929 | (format-time-string " at %H:%M" ct)))) |
| 930 | (vc-bzr-command "unshelve" "*vc-bzr-shelve*" 0 nil "--apply" "--keep") | 930 | (vc-bzr-command "unshelve" nil 0 nil "--apply" "--keep") |
| 931 | (vc-resynch-buffer (vc-bzr-root default-directory) t t)) | 931 | (vc-resynch-buffer (vc-bzr-root default-directory) t t)) |
| 932 | 932 | ||
| 933 | (defun vc-bzr-shelve-list () | 933 | (defun vc-bzr-shelve-list () |
diff --git a/lisp/vc-git.el b/lisp/vc-git.el index 6010aa20b35..14cdb4a1e38 100644 --- a/lisp/vc-git.el +++ b/lisp/vc-git.el | |||
| @@ -420,6 +420,7 @@ or an empty string if none." | |||
| 420 | (vc-git-command (current-buffer) 'async files | 420 | (vc-git-command (current-buffer) 'async files |
| 421 | "ls-files" "-z" "-o" "-i" "--directory" | 421 | "ls-files" "-z" "-o" "-i" "--directory" |
| 422 | "--no-empty-directory" "--exclude-standard" "--")) | 422 | "--no-empty-directory" "--exclude-standard" "--")) |
| 423 | ;; --relative added in Git 1.5.5. | ||
| 423 | (diff-index | 424 | (diff-index |
| 424 | (vc-git-command (current-buffer) 'async files | 425 | (vc-git-command (current-buffer) 'async files |
| 425 | "diff-index" "--relative" "-z" "-M" "HEAD" "--"))) | 426 | "diff-index" "--relative" "-z" "-M" "HEAD" "--"))) |
| @@ -578,7 +579,9 @@ or an empty string if none." | |||
| 578 | ;;; HISTORY FUNCTIONS | 579 | ;;; HISTORY FUNCTIONS |
| 579 | 580 | ||
| 580 | (defun vc-git-print-log (files buffer &optional shortlog start-revision limit) | 581 | (defun vc-git-print-log (files buffer &optional shortlog start-revision limit) |
| 581 | "Get change log associated with FILES." | 582 | "Get change log associated with FILES. |
| 583 | Note that using SHORTLOG requires at least Git version 1.5.6, | ||
| 584 | for the --graph option." | ||
| 582 | (let ((coding-system-for-read git-commits-coding-system)) | 585 | (let ((coding-system-for-read git-commits-coding-system)) |
| 583 | ;; `vc-do-command' creates the buffer, but we need it before running | 586 | ;; `vc-do-command' creates the buffer, but we need it before running |
| 584 | ;; the command. | 587 | ;; the command. |
diff --git a/lisp/vc-hg.el b/lisp/vc-hg.el index fae9a15fed2..e67342d707a 100644 --- a/lisp/vc-hg.el +++ b/lisp/vc-hg.el | |||
| @@ -196,16 +196,16 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches." | |||
| 196 | (let* | 196 | (let* |
| 197 | ((status nil) | 197 | ((status nil) |
| 198 | (default-directory (file-name-directory file)) | 198 | (default-directory (file-name-directory file)) |
| 199 | ;; Avoid localization of messages so we can parse the output. | ||
| 200 | (avoid-local-env (append (list "TERM=dumb" "LANGUAGE=C" "HGRC=") | ||
| 201 | process-environment)) | ||
| 199 | (out | 202 | (out |
| 200 | (with-output-to-string | 203 | (with-output-to-string |
| 201 | (with-current-buffer | 204 | (with-current-buffer |
| 202 | standard-output | 205 | standard-output |
| 203 | (setq status | 206 | (setq status |
| 204 | (condition-case nil | 207 | (condition-case nil |
| 205 | (let ((process-environment | 208 | (let ((process-environment avoid-local-env)) |
| 206 | ;; Avoid localization of messages so we can parse the output. | ||
| 207 | (append (list "TERM=dumb" "LANGUAGE=C" "HGRC=") | ||
| 208 | process-environment))) | ||
| 209 | ;; Ignore all errors. | 209 | ;; Ignore all errors. |
| 210 | (process-file | 210 | (process-file |
| 211 | "hg" nil t nil | 211 | "hg" nil t nil |
| @@ -213,7 +213,23 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches." | |||
| 213 | ;; Some problem happened. E.g. We can't find an `hg' | 213 | ;; Some problem happened. E.g. We can't find an `hg' |
| 214 | ;; executable. | 214 | ;; executable. |
| 215 | (error nil))))))) | 215 | (error nil))))))) |
| 216 | (when (eq 0 status) out))) | 216 | (if (eq 0 status) |
| 217 | out | ||
| 218 | ;; Check if the file is in the 'added state, the above hg | ||
| 219 | ;; command does not distinguish between 'added and 'unregistered. | ||
| 220 | (setq status | ||
| 221 | (condition-case nil | ||
| 222 | (let ((process-environment avoid-local-env)) | ||
| 223 | (process-file | ||
| 224 | "hg" nil nil nil | ||
| 225 | ;; We use "log" here, if there's a faster command | ||
| 226 | ;; that returns true for an 'added file and false | ||
| 227 | ;; for an 'unregistered one, we could use that. | ||
| 228 | "log" "-l1" (file-relative-name file))) | ||
| 229 | ;; Some problem happened. E.g. We can't find an `hg' | ||
| 230 | ;; executable. | ||
| 231 | (error nil))) | ||
| 232 | (when (eq 0 status) "0")))) | ||
| 217 | 233 | ||
| 218 | ;;; History functions | 234 | ;;; History functions |
| 219 | 235 | ||
| @@ -356,7 +372,8 @@ Optional arg REVISION is a revision to annotate from." | |||
| 356 | (if (match-beginning 3) | 372 | (if (match-beginning 3) |
| 357 | (match-string-no-properties 1) | 373 | (match-string-no-properties 1) |
| 358 | (cons (match-string-no-properties 1) | 374 | (cons (match-string-no-properties 1) |
| 359 | (expand-file-name (match-string-no-properties 4))))))) | 375 | (expand-file-name (match-string-no-properties 4) |
| 376 | (vc-hg-root default-directory))))))) | ||
| 360 | 377 | ||
| 361 | (defun vc-hg-previous-revision (file rev) | 378 | (defun vc-hg-previous-revision (file rev) |
| 362 | (let ((newrev (1- (string-to-number rev)))) | 379 | (let ((newrev (1- (string-to-number rev)))) |
diff --git a/src/.gdbinit b/src/.gdbinit index b959baae8f3..32b3827b22d 100644 --- a/src/.gdbinit +++ b/src/.gdbinit | |||
| @@ -889,6 +889,19 @@ Print the address of the char-table $, and its purpose. | |||
| 889 | This command assumes that $ is an Emacs Lisp char-table value. | 889 | This command assumes that $ is an Emacs Lisp char-table value. |
| 890 | end | 890 | end |
| 891 | 891 | ||
| 892 | define xsubchartable | ||
| 893 | xgetptr $ | ||
| 894 | print (struct Lisp_Sub_Char_Table *) $ptr | ||
| 895 | xgetint $->depth | ||
| 896 | set $depth = $int | ||
| 897 | xgetint $->min_char | ||
| 898 | printf "Depth: %d, Min char: %d (0x%x)\n", $depth, $int, $int | ||
| 899 | end | ||
| 900 | document xsubchartable | ||
| 901 | Print the address of the sub-char-table $, its depth and min-char. | ||
| 902 | This command assumes that $ is an Emacs Lisp sub-char-table value. | ||
| 903 | end | ||
| 904 | |||
| 892 | define xboolvector | 905 | define xboolvector |
| 893 | xgetptr $ | 906 | xgetptr $ |
| 894 | print (struct Lisp_Bool_Vector *) $ptr | 907 | print (struct Lisp_Bool_Vector *) $ptr |
diff --git a/src/ChangeLog b/src/ChangeLog index 856cc1aec64..fb4bd4de1cc 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -3,10 +3,122 @@ | |||
| 3 | * charset.c (char_charset): Consider Vcharset_non_preferred_head | 3 | * charset.c (char_charset): Consider Vcharset_non_preferred_head |
| 4 | only when the arg CHARSET_LIST is nil. | 4 | only when the arg CHARSET_LIST is nil. |
| 5 | 5 | ||
| 6 | 2010-04-20 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 7 | |||
| 8 | Make variable forwarding explicit rather the using special values. | ||
| 9 | Basically, this makes the structure of buffer-local values and object | ||
| 10 | forwarding explicit in the type of Lisp_Symbols rather than use | ||
| 11 | special Lisp_Objects for that. This tends to lead to slightly more | ||
| 12 | verbose code, but is more C-like, simpler, and makes it easier to make | ||
| 13 | sure we handled all cases, among other things by letting the compiler | ||
| 14 | help us check it. | ||
| 15 | * lisp.h (enum Lisp_Misc_Type, union Lisp_Misc): | ||
| 16 | Removing forwarding objects. | ||
| 17 | (enum Lisp_Fwd_Type, enum symbol_redirect, union Lisp_Fwd): New types. | ||
| 18 | (struct Lisp_Symbol): Make the various forms of variable-forwarding | ||
| 19 | explicit rather than hiding them inside Lisp_Object "values". | ||
| 20 | (XFWDTYPE): New macro. | ||
| 21 | (XINTFWD, XBOOLFWD, XOBJFWD, XKBOARD_OBJFWD): Redefine. | ||
| 22 | (XBUFFER_LOCAL_VALUE): Remove. | ||
| 23 | (SYMBOL_VAL, SYMBOL_ALIAS, SYMBOL_BLV, SYMBOL_FWD, SET_SYMBOL_VAL) | ||
| 24 | (SET_SYMBOL_ALIAS, SET_SYMBOL_BLV, SET_SYMBOL_FWD): New macros. | ||
| 25 | (SYMBOL_VALUE, SET_SYMBOL_VALUE): Remove. | ||
| 26 | (struct Lisp_Intfwd, struct Lisp_Boolfwd, struct Lisp_Objfwd) | ||
| 27 | (struct Lisp_Buffer_Objfwd, struct Lisp_Kboard_Objfwd): | ||
| 28 | Remove the Lisp_Misc_* header. | ||
| 29 | (struct Lisp_Buffer_Local_Value): Redefine. | ||
| 30 | (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): New macros. | ||
| 31 | (struct Lisp_Misc_Any): Add filler to get the right size. | ||
| 32 | (struct Lisp_Free): Use struct Lisp_Misc_Any rather than struct | ||
| 33 | Lisp_Intfwd. | ||
| 34 | (DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL, DEFVAR_INT) | ||
| 35 | (DEFVAR_KBOARD): Allocate a forwarding object. | ||
| 36 | * data.c (do_blv_forwarding, store_blv_forwarding): New macros. | ||
| 37 | (let_shadows_global_binding_p): New function. | ||
| 38 | (union Lisp_Val_Fwd): New type. | ||
| 39 | (make_blv): New function. | ||
| 40 | (swap_in_symval_forwarding, indirect_variable, do_symval_forwarding) | ||
| 41 | (store_symval_forwarding, swap_in_global_binding, Fboundp) | ||
| 42 | (swap_in_symval_forwarding, find_symbol_value, Fset) | ||
| 43 | (let_shadows_buffer_binding_p, set_internal, default_value) | ||
| 44 | (Fset_default, Fmake_variable_buffer_local, Fmake_local_variable) | ||
| 45 | (Fkill_local_variable, Fmake_variable_frame_local) | ||
| 46 | (Flocal_variable_p, Flocal_variable_if_set_p) | ||
| 47 | (Fvariable_binding_locus): | ||
| 48 | * xdisp.c (select_frame_for_redisplay): | ||
| 49 | * lread.c (Fintern, Funintern, init_obarray, defvar_int) | ||
| 50 | (defvar_bool, defvar_lisp_nopro, defvar_lisp, defvar_kboard): | ||
| 51 | * frame.c (store_frame_param): | ||
| 52 | * eval.c (Fdefvaralias, Fuser_variable_p, specbind, unbind_to): | ||
| 53 | * bytecode.c (Fbyte_code) <varref, varset>: Adapt to the new symbol | ||
| 54 | value structure. | ||
| 55 | * buffer.c (PER_BUFFER_SYMBOL): Move from buffer.h. | ||
| 56 | (clone_per_buffer_values): Only adjust markers into the current buffer. | ||
| 57 | (reset_buffer_local_variables): PER_BUFFER_IDX is never -2. | ||
| 58 | (Fbuffer_local_value, set_buffer_internal_1) | ||
| 59 | (swap_out_buffer_local_variables): | ||
| 60 | Adapt to the new symbol value structure. | ||
| 61 | (DEFVAR_PER_BUFFER): Allocate a Lisp_Buffer_Objfwd object. | ||
| 62 | (defvar_per_buffer): Take a new arg for the fwd object. | ||
| 63 | (buffer_lisp_local_variables): Return a proper alist (different fix | ||
| 64 | for bug#4138). | ||
| 65 | * alloc.c (Fmake_symbol): Use SET_SYMBOL_VAL. | ||
| 66 | (Fgarbage_collect): Don't handle buffer_defaults specially. | ||
| 67 | (mark_object): Handle new symbol value structure rather than the old | ||
| 68 | special Lisp_Misc_* objects. | ||
| 69 | (gc_sweep) <symbols>: Free also the buffer-local-value objects. | ||
| 70 | * term.c (set_tty_color_mode): | ||
| 71 | * bidi.c (bidi_initialize): Don't access the ->value field directly. | ||
| 72 | * buffer.h (PER_BUFFER_VAR_OFFSET): Don't bother with | ||
| 73 | a buffer_local_flags. | ||
| 74 | * print.c (print_object): Get rid of impossible forwarding objects. | ||
| 75 | |||
| 76 | 2010-04-19 Eli Zaretskii <eliz@gnu.org> | ||
| 77 | |||
| 78 | * bidi.c (bidi_get_type, bidi_get_category) | ||
| 79 | (bidi_at_paragraph_end, bidi_resolve_weak, bidi_resolve_neutral) | ||
| 80 | (bidi_type_of_next_char, bidi_level_of_next_char): | ||
| 81 | Declare static. Use `INLINE' rather than `inline'. | ||
| 82 | |||
| 83 | 2010-04-19 Juanma Barranquero <lekktu@gmail.com> | ||
| 84 | |||
| 85 | * dired.c (Ffile_attributes): Fix typo in docstring. | ||
| 86 | |||
| 87 | 2010-04-19 Adrian Robert <Adrian.B.Robert@gmail.com> | ||
| 88 | |||
| 89 | * nsmenu.m (EmacsDialog-runDialogAt:): Declare ret as | ||
| 90 | NSInteger (Bug#5811). | ||
| 91 | |||
| 92 | 2010-04-19 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 93 | |||
| 94 | * s/darwin.h (PTY_ITERATION, PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF) | ||
| 95 | (PTY_OPEN): New defines. Use openpty (Bug#726, Bug#5819). | ||
| 96 | |||
| 97 | 2010-04-19 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 98 | |||
| 99 | * frame.h (FRAME_LINE_TO_PIXEL_Y): Add missing parenthesis. | ||
| 100 | |||
| 101 | 2010-04-19 Jan Djärv <jan.h.d@swipnet.se> | ||
| 102 | |||
| 103 | * frame.h (FRAME_TEXT_LINES_TO_PIXEL_HEIGHT): Don't use | ||
| 104 | FRAME_LINE_TO_PIXEL_Y. | ||
| 105 | |||
| 106 | * xterm.c (x_set_window_size_1): Don't add border_width/height to | ||
| 107 | pixelwidth/height. | ||
| 108 | |||
| 109 | 2010-04-19 Chong Yidong <cyd@stupidchicken.com> | ||
| 110 | |||
| 111 | * xdisp.c (prepare_menu_bars): Don't call ns_set_doc_edited for | ||
| 112 | terminal frames (Bug#5837). | ||
| 113 | |||
| 114 | 2010-04-19 Eli Zaretskii <eliz@gnu.org> | ||
| 115 | |||
| 116 | * .gdbinit (xsubchartable): New command. | ||
| 117 | |||
| 6 | 2010-04-19 Eli Zaretskii <eliz@gnu.org> | 118 | 2010-04-19 Eli Zaretskii <eliz@gnu.org> |
| 7 | 119 | ||
| 8 | * xdisp.c (display_line): Don't write beyond the last glyph row in | 120 | * xdisp.c (display_line): Don't write beyond the last glyph row in |
| 9 | the desired matrix. Fixes a crash in "emacs -nw", see | 121 | the desired matrix. Fixes a crash in "emacs -nw" (bug#5972), see |
| 10 | http://lists.gnu.org/archive/html/emacs-devel/2010-04/msg00075.html | 122 | http://lists.gnu.org/archive/html/emacs-devel/2010-04/msg00075.html |
| 11 | and | 123 | and |
| 12 | http://lists.gnu.org/archive/html/emacs-devel/2010-04/msg00213.html | 124 | http://lists.gnu.org/archive/html/emacs-devel/2010-04/msg00213.html |
diff --git a/src/alloc.c b/src/alloc.c index 37ec06c7be1..c1f1094d15f 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -1365,7 +1365,7 @@ uninterrupt_malloc () | |||
| 1365 | pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE); | 1365 | pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE); |
| 1366 | pthread_mutex_init (&alloc_mutex, &attr); | 1366 | pthread_mutex_init (&alloc_mutex, &attr); |
| 1367 | #else /* !DOUG_LEA_MALLOC */ | 1367 | #else /* !DOUG_LEA_MALLOC */ |
| 1368 | /* Some systems such as Solaris 2.6 doesn't have a recursive mutex, | 1368 | /* Some systems such as Solaris 2.6 don't have a recursive mutex, |
| 1369 | and the bundled gmalloc.c doesn't require it. */ | 1369 | and the bundled gmalloc.c doesn't require it. */ |
| 1370 | pthread_mutex_init (&alloc_mutex, NULL); | 1370 | pthread_mutex_init (&alloc_mutex, NULL); |
| 1371 | #endif /* !DOUG_LEA_MALLOC */ | 1371 | #endif /* !DOUG_LEA_MALLOC */ |
| @@ -3193,13 +3193,13 @@ Its value and function definition are void, and its property list is nil. */) | |||
| 3193 | p = XSYMBOL (val); | 3193 | p = XSYMBOL (val); |
| 3194 | p->xname = name; | 3194 | p->xname = name; |
| 3195 | p->plist = Qnil; | 3195 | p->plist = Qnil; |
| 3196 | p->value = Qunbound; | 3196 | p->redirect = SYMBOL_PLAINVAL; |
| 3197 | SET_SYMBOL_VAL (p, Qunbound); | ||
| 3197 | p->function = Qunbound; | 3198 | p->function = Qunbound; |
| 3198 | p->next = NULL; | 3199 | p->next = NULL; |
| 3199 | p->gcmarkbit = 0; | 3200 | p->gcmarkbit = 0; |
| 3200 | p->interned = SYMBOL_UNINTERNED; | 3201 | p->interned = SYMBOL_UNINTERNED; |
| 3201 | p->constant = 0; | 3202 | p->constant = 0; |
| 3202 | p->indirect_variable = 0; | ||
| 3203 | consing_since_gc += sizeof (struct Lisp_Symbol); | 3203 | consing_since_gc += sizeof (struct Lisp_Symbol); |
| 3204 | symbols_consed++; | 3204 | symbols_consed++; |
| 3205 | return val; | 3205 | return val; |
| @@ -5581,17 +5581,42 @@ mark_object (arg) | |||
| 5581 | break; | 5581 | break; |
| 5582 | CHECK_ALLOCATED_AND_LIVE (live_symbol_p); | 5582 | CHECK_ALLOCATED_AND_LIVE (live_symbol_p); |
| 5583 | ptr->gcmarkbit = 1; | 5583 | ptr->gcmarkbit = 1; |
| 5584 | mark_object (ptr->value); | ||
| 5585 | mark_object (ptr->function); | 5584 | mark_object (ptr->function); |
| 5586 | mark_object (ptr->plist); | 5585 | mark_object (ptr->plist); |
| 5587 | 5586 | switch (ptr->redirect) | |
| 5587 | { | ||
| 5588 | case SYMBOL_PLAINVAL: mark_object (SYMBOL_VAL (ptr)); break; | ||
| 5589 | case SYMBOL_VARALIAS: | ||
| 5590 | { | ||
| 5591 | Lisp_Object tem; | ||
| 5592 | XSETSYMBOL (tem, SYMBOL_ALIAS (ptr)); | ||
| 5593 | mark_object (tem); | ||
| 5594 | break; | ||
| 5595 | } | ||
| 5596 | case SYMBOL_LOCALIZED: | ||
| 5597 | { | ||
| 5598 | struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (ptr); | ||
| 5599 | /* If the value is forwarded to a buffer or keyboard field, | ||
| 5600 | these are marked when we see the corresponding object. | ||
| 5601 | And if it's forwarded to a C variable, either it's not | ||
| 5602 | a Lisp_Object var, or it's staticpro'd already. */ | ||
| 5603 | mark_object (blv->where); | ||
| 5604 | mark_object (blv->valcell); | ||
| 5605 | mark_object (blv->defcell); | ||
| 5606 | break; | ||
| 5607 | } | ||
| 5608 | case SYMBOL_FORWARDED: | ||
| 5609 | /* If the value is forwarded to a buffer or keyboard field, | ||
| 5610 | these are marked when we see the corresponding object. | ||
| 5611 | And if it's forwarded to a C variable, either it's not | ||
| 5612 | a Lisp_Object var, or it's staticpro'd already. */ | ||
| 5613 | break; | ||
| 5614 | default: abort (); | ||
| 5615 | } | ||
| 5588 | if (!PURE_POINTER_P (XSTRING (ptr->xname))) | 5616 | if (!PURE_POINTER_P (XSTRING (ptr->xname))) |
| 5589 | MARK_STRING (XSTRING (ptr->xname)); | 5617 | MARK_STRING (XSTRING (ptr->xname)); |
| 5590 | MARK_INTERVAL_TREE (STRING_INTERVALS (ptr->xname)); | 5618 | MARK_INTERVAL_TREE (STRING_INTERVALS (ptr->xname)); |
| 5591 | 5619 | ||
| 5592 | /* Note that we do not mark the obarray of the symbol. | ||
| 5593 | It is safe not to do so because nothing accesses that | ||
| 5594 | slot except to check whether it is nil. */ | ||
| 5595 | ptr = ptr->next; | 5620 | ptr = ptr->next; |
| 5596 | if (ptr) | 5621 | if (ptr) |
| 5597 | { | 5622 | { |
| @@ -5610,22 +5635,6 @@ mark_object (arg) | |||
| 5610 | 5635 | ||
| 5611 | switch (XMISCTYPE (obj)) | 5636 | switch (XMISCTYPE (obj)) |
| 5612 | { | 5637 | { |
| 5613 | case Lisp_Misc_Buffer_Local_Value: | ||
| 5614 | { | ||
| 5615 | register struct Lisp_Buffer_Local_Value *ptr | ||
| 5616 | = XBUFFER_LOCAL_VALUE (obj); | ||
| 5617 | /* If the cdr is nil, avoid recursion for the car. */ | ||
| 5618 | if (EQ (ptr->cdr, Qnil)) | ||
| 5619 | { | ||
| 5620 | obj = ptr->realvalue; | ||
| 5621 | goto loop; | ||
| 5622 | } | ||
| 5623 | mark_object (ptr->realvalue); | ||
| 5624 | mark_object (ptr->buffer); | ||
| 5625 | mark_object (ptr->frame); | ||
| 5626 | obj = ptr->cdr; | ||
| 5627 | goto loop; | ||
| 5628 | } | ||
| 5629 | 5638 | ||
| 5630 | case Lisp_Misc_Marker: | 5639 | case Lisp_Misc_Marker: |
| 5631 | /* DO NOT mark thru the marker's chain. | 5640 | /* DO NOT mark thru the marker's chain. |
| @@ -5633,17 +5642,6 @@ mark_object (arg) | |||
| 5633 | instead, markers are removed from the chain when freed by gc. */ | 5642 | instead, markers are removed from the chain when freed by gc. */ |
| 5634 | break; | 5643 | break; |
| 5635 | 5644 | ||
| 5636 | case Lisp_Misc_Intfwd: | ||
| 5637 | case Lisp_Misc_Boolfwd: | ||
| 5638 | case Lisp_Misc_Objfwd: | ||
| 5639 | case Lisp_Misc_Buffer_Objfwd: | ||
| 5640 | case Lisp_Misc_Kboard_Objfwd: | ||
| 5641 | /* Don't bother with Lisp_Buffer_Objfwd, | ||
| 5642 | since all markable slots in current buffer marked anyway. */ | ||
| 5643 | /* Don't need to do Lisp_Objfwd, since the places they point | ||
| 5644 | are protected with staticpro. */ | ||
| 5645 | break; | ||
| 5646 | |||
| 5647 | case Lisp_Misc_Save_Value: | 5645 | case Lisp_Misc_Save_Value: |
| 5648 | #if GC_MARK_STACK | 5646 | #if GC_MARK_STACK |
| 5649 | { | 5647 | { |
| @@ -6048,6 +6046,8 @@ gc_sweep () | |||
| 6048 | 6046 | ||
| 6049 | if (!sym->gcmarkbit && !pure_p) | 6047 | if (!sym->gcmarkbit && !pure_p) |
| 6050 | { | 6048 | { |
| 6049 | if (sym->redirect == SYMBOL_LOCALIZED) | ||
| 6050 | xfree (SYMBOL_BLV (sym)); | ||
| 6051 | sym->next = symbol_free_list; | 6051 | sym->next = symbol_free_list; |
| 6052 | symbol_free_list = sym; | 6052 | symbol_free_list = sym; |
| 6053 | #if GC_MARK_STACK | 6053 | #if GC_MARK_STACK |
diff --git a/src/bidi.c b/src/bidi.c index d637ee0eeb5..fee97ae0c8e 100644 --- a/src/bidi.c +++ b/src/bidi.c | |||
| @@ -23,7 +23,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 23 | as per UAX#9, a part of the Unicode Standard. | 23 | as per UAX#9, a part of the Unicode Standard. |
| 24 | 24 | ||
| 25 | Unlike the reference and most other implementations, this one is | 25 | Unlike the reference and most other implementations, this one is |
| 26 | designed to be called once for every character in the buffer. | 26 | designed to be called once for every character in the buffer or |
| 27 | string. | ||
| 27 | 28 | ||
| 28 | The main entry point is bidi_get_next_char_visually. Each time it | 29 | The main entry point is bidi_get_next_char_visually. Each time it |
| 29 | is called, it finds the next character in the visual order, and | 30 | is called, it finds the next character in the visual order, and |
| @@ -34,6 +35,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 34 | more details about its algorithm that finds the next visual-order | 35 | more details about its algorithm that finds the next visual-order |
| 35 | character by resolving their levels on the fly. | 36 | character by resolving their levels on the fly. |
| 36 | 37 | ||
| 38 | The two other entry points are bidi_paragraph_init and | ||
| 39 | bidi_mirror_char. The first determines the base direction of a | ||
| 40 | paragraph, while the second returns the mirrored version of its | ||
| 41 | argument character. | ||
| 42 | |||
| 37 | If you want to understand the code, you will have to read it | 43 | If you want to understand the code, you will have to read it |
| 38 | together with the relevant portions of UAX#9. The comments include | 44 | together with the relevant portions of UAX#9. The comments include |
| 39 | references to UAX#9 rules, for that very reason. | 45 | references to UAX#9 rules, for that very reason. |
| @@ -394,14 +400,14 @@ bidi_initialize () | |||
| 394 | make_number (bidi_type[i].type)); | 400 | make_number (bidi_type[i].type)); |
| 395 | 401 | ||
| 396 | fallback_paragraph_start_re = | 402 | fallback_paragraph_start_re = |
| 397 | XSYMBOL (Fintern_soft (build_string ("paragraph-start"), Qnil))->value; | 403 | Fsymbol_value (Fintern_soft (build_string ("paragraph-start"), Qnil)); |
| 398 | if (!STRINGP (fallback_paragraph_start_re)) | 404 | if (!STRINGP (fallback_paragraph_start_re)) |
| 399 | fallback_paragraph_start_re = build_string ("\f\\|[ \t]*$"); | 405 | fallback_paragraph_start_re = build_string ("\f\\|[ \t]*$"); |
| 400 | staticpro (&fallback_paragraph_start_re); | 406 | staticpro (&fallback_paragraph_start_re); |
| 401 | Qparagraph_start = intern ("paragraph-start"); | 407 | Qparagraph_start = intern ("paragraph-start"); |
| 402 | staticpro (&Qparagraph_start); | 408 | staticpro (&Qparagraph_start); |
| 403 | fallback_paragraph_separate_re = | 409 | fallback_paragraph_separate_re = |
| 404 | XSYMBOL (Fintern_soft (build_string ("paragraph-separate"), Qnil))->value; | 410 | Fsymbol_value (Fintern_soft (build_string ("paragraph-separate"), Qnil)); |
| 405 | if (!STRINGP (fallback_paragraph_separate_re)) | 411 | if (!STRINGP (fallback_paragraph_separate_re)) |
| 406 | fallback_paragraph_separate_re = build_string ("[ \t\f]*$"); | 412 | fallback_paragraph_separate_re = build_string ("[ \t\f]*$"); |
| 407 | staticpro (&fallback_paragraph_separate_re); | 413 | staticpro (&fallback_paragraph_separate_re); |
| @@ -412,7 +418,7 @@ bidi_initialize () | |||
| 412 | 418 | ||
| 413 | /* Return the bidi type of a character CH, subject to the current | 419 | /* Return the bidi type of a character CH, subject to the current |
| 414 | directional OVERRIDE. */ | 420 | directional OVERRIDE. */ |
| 415 | bidi_type_t | 421 | static INLINE bidi_type_t |
| 416 | bidi_get_type (int ch, bidi_dir_t override) | 422 | bidi_get_type (int ch, bidi_dir_t override) |
| 417 | { | 423 | { |
| 418 | bidi_type_t default_type; | 424 | bidi_type_t default_type; |
| @@ -463,7 +469,7 @@ bidi_check_type (bidi_type_t type) | |||
| 463 | } | 469 | } |
| 464 | 470 | ||
| 465 | /* Given a bidi TYPE of a character, return its category. */ | 471 | /* Given a bidi TYPE of a character, return its category. */ |
| 466 | bidi_category_t | 472 | static INLINE bidi_category_t |
| 467 | bidi_get_category (bidi_type_t type) | 473 | bidi_get_category (bidi_type_t type) |
| 468 | { | 474 | { |
| 469 | switch (type) | 475 | switch (type) |
| @@ -520,7 +526,7 @@ bidi_mirror_char (int c) | |||
| 520 | 526 | ||
| 521 | /* Copy the bidi iterator from FROM to TO. To save cycles, this only | 527 | /* Copy the bidi iterator from FROM to TO. To save cycles, this only |
| 522 | copies the part of the level stack that is actually in use. */ | 528 | copies the part of the level stack that is actually in use. */ |
| 523 | static inline void | 529 | static INLINE void |
| 524 | bidi_copy_it (struct bidi_it *to, struct bidi_it *from) | 530 | bidi_copy_it (struct bidi_it *to, struct bidi_it *from) |
| 525 | { | 531 | { |
| 526 | int i; | 532 | int i; |
| @@ -540,14 +546,14 @@ static struct bidi_it bidi_cache[1000]; /* FIXME: make this dynamically allocate | |||
| 540 | static int bidi_cache_idx; | 546 | static int bidi_cache_idx; |
| 541 | static int bidi_cache_last_idx; | 547 | static int bidi_cache_last_idx; |
| 542 | 548 | ||
| 543 | static inline void | 549 | static INLINE void |
| 544 | bidi_cache_reset (void) | 550 | bidi_cache_reset (void) |
| 545 | { | 551 | { |
| 546 | bidi_cache_idx = 0; | 552 | bidi_cache_idx = 0; |
| 547 | bidi_cache_last_idx = -1; | 553 | bidi_cache_last_idx = -1; |
| 548 | } | 554 | } |
| 549 | 555 | ||
| 550 | static inline void | 556 | static INLINE void |
| 551 | bidi_cache_fetch_state (int idx, struct bidi_it *bidi_it) | 557 | bidi_cache_fetch_state (int idx, struct bidi_it *bidi_it) |
| 552 | { | 558 | { |
| 553 | int current_scan_dir = bidi_it->scan_dir; | 559 | int current_scan_dir = bidi_it->scan_dir; |
| @@ -564,7 +570,7 @@ bidi_cache_fetch_state (int idx, struct bidi_it *bidi_it) | |||
| 564 | level less or equal to LEVEL. if LEVEL is -1, disregard the | 570 | level less or equal to LEVEL. if LEVEL is -1, disregard the |
| 565 | resolved levels in cached states. DIR, if non-zero, means search | 571 | resolved levels in cached states. DIR, if non-zero, means search |
| 566 | in that direction from the last cache hit. */ | 572 | in that direction from the last cache hit. */ |
| 567 | static inline int | 573 | static INLINE int |
| 568 | bidi_cache_search (int charpos, int level, int dir) | 574 | bidi_cache_search (int charpos, int level, int dir) |
| 569 | { | 575 | { |
| 570 | int i, i_start; | 576 | int i, i_start; |
| @@ -655,7 +661,7 @@ bidi_cache_find_level_change (int level, int dir, int before) | |||
| 655 | return -1; | 661 | return -1; |
| 656 | } | 662 | } |
| 657 | 663 | ||
| 658 | static inline void | 664 | static INLINE void |
| 659 | bidi_cache_iterator_state (struct bidi_it *bidi_it, int resolved) | 665 | bidi_cache_iterator_state (struct bidi_it *bidi_it, int resolved) |
| 660 | { | 666 | { |
| 661 | int idx; | 667 | int idx; |
| @@ -710,7 +716,7 @@ bidi_cache_iterator_state (struct bidi_it *bidi_it, int resolved) | |||
| 710 | bidi_cache_idx = idx + 1; | 716 | bidi_cache_idx = idx + 1; |
| 711 | } | 717 | } |
| 712 | 718 | ||
| 713 | static inline bidi_type_t | 719 | static INLINE bidi_type_t |
| 714 | bidi_cache_find (int charpos, int level, struct bidi_it *bidi_it) | 720 | bidi_cache_find (int charpos, int level, struct bidi_it *bidi_it) |
| 715 | { | 721 | { |
| 716 | int i = bidi_cache_search (charpos, level, bidi_it->scan_dir); | 722 | int i = bidi_cache_search (charpos, level, bidi_it->scan_dir); |
| @@ -730,7 +736,7 @@ bidi_cache_find (int charpos, int level, struct bidi_it *bidi_it) | |||
| 730 | return UNKNOWN_BT; | 736 | return UNKNOWN_BT; |
| 731 | } | 737 | } |
| 732 | 738 | ||
| 733 | static inline int | 739 | static INLINE int |
| 734 | bidi_peek_at_next_level (struct bidi_it *bidi_it) | 740 | bidi_peek_at_next_level (struct bidi_it *bidi_it) |
| 735 | { | 741 | { |
| 736 | if (bidi_cache_idx == 0 || bidi_cache_last_idx == -1) | 742 | if (bidi_cache_idx == 0 || bidi_cache_last_idx == -1) |
| @@ -743,7 +749,7 @@ bidi_peek_at_next_level (struct bidi_it *bidi_it) | |||
| 743 | following the buffer position, -1 if position is at the beginning | 749 | following the buffer position, -1 if position is at the beginning |
| 744 | of a new paragraph, or -2 if position is neither at beginning nor | 750 | of a new paragraph, or -2 if position is neither at beginning nor |
| 745 | at end of a paragraph. */ | 751 | at end of a paragraph. */ |
| 746 | EMACS_INT | 752 | static EMACS_INT |
| 747 | bidi_at_paragraph_end (EMACS_INT charpos, EMACS_INT bytepos) | 753 | bidi_at_paragraph_end (EMACS_INT charpos, EMACS_INT bytepos) |
| 748 | { | 754 | { |
| 749 | Lisp_Object sep_re = Fbuffer_local_value (Qparagraph_separate, | 755 | Lisp_Object sep_re = Fbuffer_local_value (Qparagraph_separate, |
| @@ -773,7 +779,7 @@ bidi_at_paragraph_end (EMACS_INT charpos, EMACS_INT bytepos) | |||
| 773 | embedding levels on either side of the run boundary. Also, update | 779 | embedding levels on either side of the run boundary. Also, update |
| 774 | the saved info about previously seen characters, since that info is | 780 | the saved info about previously seen characters, since that info is |
| 775 | generally valid for a single level run. */ | 781 | generally valid for a single level run. */ |
| 776 | static inline void | 782 | static INLINE void |
| 777 | bidi_set_sor_type (struct bidi_it *bidi_it, int level_before, int level_after) | 783 | bidi_set_sor_type (struct bidi_it *bidi_it, int level_before, int level_after) |
| 778 | { | 784 | { |
| 779 | int higher_level = level_before > level_after ? level_before : level_after; | 785 | int higher_level = level_before > level_after ? level_before : level_after; |
| @@ -873,7 +879,6 @@ bidi_paragraph_init (bidi_dir_t dir, struct bidi_it *bidi_it) | |||
| 873 | int ch, ch_len; | 879 | int ch, ch_len; |
| 874 | EMACS_INT pos; | 880 | EMACS_INT pos; |
| 875 | bidi_type_t type; | 881 | bidi_type_t type; |
| 876 | EMACS_INT sep_len; | ||
| 877 | 882 | ||
| 878 | /* If we are inside a paragraph separator, we are just waiting | 883 | /* If we are inside a paragraph separator, we are just waiting |
| 879 | for the separator to be exhausted; use the previous paragraph | 884 | for the separator to be exhausted; use the previous paragraph |
| @@ -954,7 +959,7 @@ bidi_paragraph_init (bidi_dir_t dir, struct bidi_it *bidi_it) | |||
| 954 | 959 | ||
| 955 | /* Do whatever UAX#9 clause X8 says should be done at paragraph's | 960 | /* Do whatever UAX#9 clause X8 says should be done at paragraph's |
| 956 | end. */ | 961 | end. */ |
| 957 | static inline void | 962 | static INLINE void |
| 958 | bidi_set_paragraph_end (struct bidi_it *bidi_it) | 963 | bidi_set_paragraph_end (struct bidi_it *bidi_it) |
| 959 | { | 964 | { |
| 960 | bidi_it->invalid_levels = 0; | 965 | bidi_it->invalid_levels = 0; |
| @@ -996,7 +1001,7 @@ bidi_init_it (EMACS_INT charpos, EMACS_INT bytepos, struct bidi_it *bidi_it) | |||
| 996 | 1001 | ||
| 997 | /* Push the current embedding level and override status; reset the | 1002 | /* Push the current embedding level and override status; reset the |
| 998 | current level to LEVEL and the current override status to OVERRIDE. */ | 1003 | current level to LEVEL and the current override status to OVERRIDE. */ |
| 999 | static inline void | 1004 | static INLINE void |
| 1000 | bidi_push_embedding_level (struct bidi_it *bidi_it, | 1005 | bidi_push_embedding_level (struct bidi_it *bidi_it, |
| 1001 | int level, bidi_dir_t override) | 1006 | int level, bidi_dir_t override) |
| 1002 | { | 1007 | { |
| @@ -1009,7 +1014,7 @@ bidi_push_embedding_level (struct bidi_it *bidi_it, | |||
| 1009 | 1014 | ||
| 1010 | /* Pop the embedding level and directional override status from the | 1015 | /* Pop the embedding level and directional override status from the |
| 1011 | stack, and return the new level. */ | 1016 | stack, and return the new level. */ |
| 1012 | static inline int | 1017 | static INLINE int |
| 1013 | bidi_pop_embedding_level (struct bidi_it *bidi_it) | 1018 | bidi_pop_embedding_level (struct bidi_it *bidi_it) |
| 1014 | { | 1019 | { |
| 1015 | /* UAX#9 says to ignore invalid PDFs. */ | 1020 | /* UAX#9 says to ignore invalid PDFs. */ |
| @@ -1019,7 +1024,7 @@ bidi_pop_embedding_level (struct bidi_it *bidi_it) | |||
| 1019 | } | 1024 | } |
| 1020 | 1025 | ||
| 1021 | /* Record in SAVED_INFO the information about the current character. */ | 1026 | /* Record in SAVED_INFO the information about the current character. */ |
| 1022 | static inline void | 1027 | static INLINE void |
| 1023 | bidi_remember_char (struct bidi_saved_info *saved_info, | 1028 | bidi_remember_char (struct bidi_saved_info *saved_info, |
| 1024 | struct bidi_it *bidi_it) | 1029 | struct bidi_it *bidi_it) |
| 1025 | { | 1030 | { |
| @@ -1035,7 +1040,7 @@ bidi_remember_char (struct bidi_saved_info *saved_info, | |||
| 1035 | 1040 | ||
| 1036 | /* Resolve the type of a neutral character according to the type of | 1041 | /* Resolve the type of a neutral character according to the type of |
| 1037 | surrounding strong text and the current embedding level. */ | 1042 | surrounding strong text and the current embedding level. */ |
| 1038 | static inline bidi_type_t | 1043 | static INLINE bidi_type_t |
| 1039 | bidi_resolve_neutral_1 (bidi_type_t prev_type, bidi_type_t next_type, int lev) | 1044 | bidi_resolve_neutral_1 (bidi_type_t prev_type, bidi_type_t next_type, int lev) |
| 1040 | { | 1045 | { |
| 1041 | /* N1: European and Arabic numbers are treated as though they were R. */ | 1046 | /* N1: European and Arabic numbers are treated as though they were R. */ |
| @@ -1052,7 +1057,7 @@ bidi_resolve_neutral_1 (bidi_type_t prev_type, bidi_type_t next_type, int lev) | |||
| 1052 | return STRONG_R; | 1057 | return STRONG_R; |
| 1053 | } | 1058 | } |
| 1054 | 1059 | ||
| 1055 | static inline int | 1060 | static INLINE int |
| 1056 | bidi_explicit_dir_char (int c) | 1061 | bidi_explicit_dir_char (int c) |
| 1057 | { | 1062 | { |
| 1058 | /* FIXME: this should be replaced with a lookup table with suitable | 1063 | /* FIXME: this should be replaced with a lookup table with suitable |
| @@ -1302,7 +1307,7 @@ bidi_resolve_explicit (struct bidi_it *bidi_it) | |||
| 1302 | 1307 | ||
| 1303 | /* Advance in the buffer, resolve weak types and return the type of | 1308 | /* Advance in the buffer, resolve weak types and return the type of |
| 1304 | the next character after weak type resolution. */ | 1309 | the next character after weak type resolution. */ |
| 1305 | bidi_type_t | 1310 | static bidi_type_t |
| 1306 | bidi_resolve_weak (struct bidi_it *bidi_it) | 1311 | bidi_resolve_weak (struct bidi_it *bidi_it) |
| 1307 | { | 1312 | { |
| 1308 | bidi_type_t type; | 1313 | bidi_type_t type; |
| @@ -1493,7 +1498,7 @@ bidi_resolve_weak (struct bidi_it *bidi_it) | |||
| 1493 | return type; | 1498 | return type; |
| 1494 | } | 1499 | } |
| 1495 | 1500 | ||
| 1496 | bidi_type_t | 1501 | static bidi_type_t |
| 1497 | bidi_resolve_neutral (struct bidi_it *bidi_it) | 1502 | bidi_resolve_neutral (struct bidi_it *bidi_it) |
| 1498 | { | 1503 | { |
| 1499 | int prev_level = bidi_it->level_stack[bidi_it->stack_idx].level; | 1504 | int prev_level = bidi_it->level_stack[bidi_it->stack_idx].level; |
| @@ -1617,7 +1622,7 @@ bidi_resolve_neutral (struct bidi_it *bidi_it) | |||
| 1617 | /* Given an iterator state in BIDI_IT, advance one character position | 1622 | /* Given an iterator state in BIDI_IT, advance one character position |
| 1618 | in the buffer to the next character (in the logical order), resolve | 1623 | in the buffer to the next character (in the logical order), resolve |
| 1619 | the bidi type of that next character, and return that type. */ | 1624 | the bidi type of that next character, and return that type. */ |
| 1620 | bidi_type_t | 1625 | static bidi_type_t |
| 1621 | bidi_type_of_next_char (struct bidi_it *bidi_it) | 1626 | bidi_type_of_next_char (struct bidi_it *bidi_it) |
| 1622 | { | 1627 | { |
| 1623 | bidi_type_t type; | 1628 | bidi_type_t type; |
| @@ -1643,7 +1648,7 @@ bidi_type_of_next_char (struct bidi_it *bidi_it) | |||
| 1643 | the buffer to the next character (in the logical order), resolve | 1648 | the buffer to the next character (in the logical order), resolve |
| 1644 | the embedding and implicit levels of that next character, and | 1649 | the embedding and implicit levels of that next character, and |
| 1645 | return the resulting level. */ | 1650 | return the resulting level. */ |
| 1646 | int | 1651 | static int |
| 1647 | bidi_level_of_next_char (struct bidi_it *bidi_it) | 1652 | bidi_level_of_next_char (struct bidi_it *bidi_it) |
| 1648 | { | 1653 | { |
| 1649 | bidi_type_t type; | 1654 | bidi_type_t type; |
diff --git a/src/buffer.c b/src/buffer.c index 0759ce1c43c..9932c649044 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -78,9 +78,6 @@ static Lisp_Object Vbuffer_defaults; | |||
| 78 | be a DEFVAR_PER_BUFFER for the slot, there is no default value for it; | 78 | be a DEFVAR_PER_BUFFER for the slot, there is no default value for it; |
| 79 | and the corresponding slot in buffer_defaults is not used. | 79 | and the corresponding slot in buffer_defaults is not used. |
| 80 | 80 | ||
| 81 | If a slot is -2, then there is no DEFVAR_PER_BUFFER for it, | ||
| 82 | but there is a default value which is copied into each buffer. | ||
| 83 | |||
| 84 | If a slot in this structure corresponding to a DEFVAR_PER_BUFFER is | 81 | If a slot in this structure corresponding to a DEFVAR_PER_BUFFER is |
| 85 | zero, that is a bug */ | 82 | zero, that is a bug */ |
| 86 | 83 | ||
| @@ -94,6 +91,12 @@ DECL_ALIGN (struct buffer, buffer_local_symbols); | |||
| 94 | /* A Lisp_Object pointer to the above, used for staticpro */ | 91 | /* A Lisp_Object pointer to the above, used for staticpro */ |
| 95 | static Lisp_Object Vbuffer_local_symbols; | 92 | static Lisp_Object Vbuffer_local_symbols; |
| 96 | 93 | ||
| 94 | /* Return the symbol of the per-buffer variable at offset OFFSET in | ||
| 95 | the buffer structure. */ | ||
| 96 | |||
| 97 | #define PER_BUFFER_SYMBOL(OFFSET) \ | ||
| 98 | (*(Lisp_Object *)((OFFSET) + (char *) &buffer_local_symbols)) | ||
| 99 | |||
| 97 | /* Flags indicating which built-in buffer-local variables | 100 | /* Flags indicating which built-in buffer-local variables |
| 98 | are permanent locals. */ | 101 | are permanent locals. */ |
| 99 | static char buffer_permanent_local_flags[MAX_PER_BUFFER_VARS]; | 102 | static char buffer_permanent_local_flags[MAX_PER_BUFFER_VARS]; |
| @@ -507,7 +510,7 @@ clone_per_buffer_values (from, to) | |||
| 507 | continue; | 510 | continue; |
| 508 | 511 | ||
| 509 | obj = PER_BUFFER_VALUE (from, offset); | 512 | obj = PER_BUFFER_VALUE (from, offset); |
| 510 | if (MARKERP (obj)) | 513 | if (MARKERP (obj) && XMARKER (obj)->buffer == from) |
| 511 | { | 514 | { |
| 512 | struct Lisp_Marker *m = XMARKER (obj); | 515 | struct Lisp_Marker *m = XMARKER (obj); |
| 513 | obj = Fmake_marker (); | 516 | obj = Fmake_marker (); |
| @@ -770,9 +773,7 @@ reset_buffer_local_variables (b, permanent_too) | |||
| 770 | { | 773 | { |
| 771 | Lisp_Object tmp, prop, last = Qnil; | 774 | Lisp_Object tmp, prop, last = Qnil; |
| 772 | for (tmp = b->local_var_alist; CONSP (tmp); tmp = XCDR (tmp)) | 775 | for (tmp = b->local_var_alist; CONSP (tmp); tmp = XCDR (tmp)) |
| 773 | if (CONSP (XCAR (tmp)) | 776 | if (!NILP (prop = Fget (XCAR (XCAR (tmp)), Qpermanent_local))) |
| 774 | && SYMBOLP (XCAR (XCAR (tmp))) | ||
| 775 | && !NILP (prop = Fget (XCAR (XCAR (tmp)), Qpermanent_local))) | ||
| 776 | { | 777 | { |
| 777 | /* If permanent-local, keep it. */ | 778 | /* If permanent-local, keep it. */ |
| 778 | last = tmp; | 779 | last = tmp; |
| @@ -822,9 +823,7 @@ reset_buffer_local_variables (b, permanent_too) | |||
| 822 | int idx = PER_BUFFER_IDX (offset); | 823 | int idx = PER_BUFFER_IDX (offset); |
| 823 | if ((idx > 0 | 824 | if ((idx > 0 |
| 824 | && (permanent_too | 825 | && (permanent_too |
| 825 | || buffer_permanent_local_flags[idx] == 0)) | 826 | || buffer_permanent_local_flags[idx] == 0))) |
| 826 | /* Is -2 used anywhere? */ | ||
| 827 | || idx == -2) | ||
| 828 | PER_BUFFER_VALUE (b, offset) = PER_BUFFER_DEFAULT (offset); | 827 | PER_BUFFER_VALUE (b, offset) = PER_BUFFER_DEFAULT (offset); |
| 829 | } | 828 | } |
| 830 | } | 829 | } |
| @@ -938,59 +937,49 @@ is the default binding of the variable. */) | |||
| 938 | CHECK_SYMBOL (variable); | 937 | CHECK_SYMBOL (variable); |
| 939 | CHECK_BUFFER (buffer); | 938 | CHECK_BUFFER (buffer); |
| 940 | buf = XBUFFER (buffer); | 939 | buf = XBUFFER (buffer); |
| 940 | sym = XSYMBOL (variable); | ||
| 941 | 941 | ||
| 942 | sym = indirect_variable (XSYMBOL (variable)); | 942 | start: |
| 943 | XSETSYMBOL (variable, sym); | 943 | switch (sym->redirect) |
| 944 | |||
| 945 | /* Look in local_var_list */ | ||
| 946 | result = Fassoc (variable, buf->local_var_alist); | ||
| 947 | if (NILP (result)) | ||
| 948 | { | ||
| 949 | int offset, idx; | ||
| 950 | int found = 0; | ||
| 951 | |||
| 952 | /* Look in special slots */ | ||
| 953 | /* buffer-local Lisp variables start at `undo_list', | ||
| 954 | tho only the ones from `name' on are GC'd normally. */ | ||
| 955 | for (offset = PER_BUFFER_VAR_OFFSET (undo_list); | ||
| 956 | offset < sizeof (struct buffer); | ||
| 957 | /* sizeof EMACS_INT == sizeof Lisp_Object */ | ||
| 958 | offset += (sizeof (EMACS_INT))) | ||
| 959 | { | ||
| 960 | idx = PER_BUFFER_IDX (offset); | ||
| 961 | if ((idx == -1 || PER_BUFFER_VALUE_P (buf, idx)) | ||
| 962 | && SYMBOLP (PER_BUFFER_SYMBOL (offset)) | ||
| 963 | && EQ (PER_BUFFER_SYMBOL (offset), variable)) | ||
| 964 | { | ||
| 965 | result = PER_BUFFER_VALUE (buf, offset); | ||
| 966 | found = 1; | ||
| 967 | break; | ||
| 968 | } | ||
| 969 | } | ||
| 970 | |||
| 971 | if (!found) | ||
| 972 | result = Fdefault_value (variable); | ||
| 973 | } | ||
| 974 | else | ||
| 975 | { | 944 | { |
| 976 | Lisp_Object valcontents; | 945 | case SYMBOL_VARALIAS: sym = indirect_variable (sym); goto start; |
| 977 | Lisp_Object current_alist_element; | 946 | case SYMBOL_PLAINVAL: result = SYMBOL_VAL (sym); break; |
| 978 | 947 | case SYMBOL_LOCALIZED: | |
| 979 | /* What binding is loaded right now? */ | 948 | { /* Look in local_var_alist. */ |
| 980 | valcontents = sym->value; | 949 | struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym); |
| 981 | current_alist_element | 950 | XSETSYMBOL (variable, sym); /* Update In case of aliasing. */ |
| 982 | = XCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr); | 951 | result = Fassoc (variable, buf->local_var_alist); |
| 983 | 952 | if (!NILP (result)) | |
| 984 | /* The value of the currently loaded binding is not | 953 | { |
| 985 | stored in it, but rather in the realvalue slot. | 954 | if (blv->fwd) |
| 986 | Store that value into the binding it belongs to | 955 | { /* What binding is loaded right now? */ |
| 987 | in case that is the one we are about to use. */ | 956 | Lisp_Object current_alist_element = blv->valcell; |
| 988 | 957 | ||
| 989 | Fsetcdr (current_alist_element, | 958 | /* The value of the currently loaded binding is not |
| 990 | do_symval_forwarding (XBUFFER_LOCAL_VALUE (valcontents)->realvalue)); | 959 | stored in it, but rather in the realvalue slot. |
| 960 | Store that value into the binding it belongs to | ||
| 961 | in case that is the one we are about to use. */ | ||
| 991 | 962 | ||
| 992 | /* Now get the (perhaps updated) value out of the binding. */ | 963 | XSETCDR (current_alist_element, |
| 993 | result = XCDR (result); | 964 | do_symval_forwarding (blv->fwd)); |
| 965 | } | ||
| 966 | /* Now get the (perhaps updated) value out of the binding. */ | ||
| 967 | result = XCDR (result); | ||
| 968 | } | ||
| 969 | else | ||
| 970 | result = Fdefault_value (variable); | ||
| 971 | break; | ||
| 972 | } | ||
| 973 | case SYMBOL_FORWARDED: | ||
| 974 | { | ||
| 975 | union Lisp_Fwd *fwd = SYMBOL_FWD (sym); | ||
| 976 | if (BUFFER_OBJFWDP (fwd)) | ||
| 977 | result = PER_BUFFER_VALUE (buf, XBUFFER_OBJFWD (fwd)->offset); | ||
| 978 | else | ||
| 979 | result = Fdefault_value (variable); | ||
| 980 | break; | ||
| 981 | } | ||
| 982 | default: abort (); | ||
| 994 | } | 983 | } |
| 995 | 984 | ||
| 996 | if (!EQ (result, Qunbound)) | 985 | if (!EQ (result, Qunbound)) |
| @@ -1025,12 +1014,7 @@ buffer_lisp_local_variables (buf) | |||
| 1025 | if (buf != current_buffer) | 1014 | if (buf != current_buffer) |
| 1026 | val = XCDR (elt); | 1015 | val = XCDR (elt); |
| 1027 | 1016 | ||
| 1028 | /* If symbol is unbound, put just the symbol in the list. */ | 1017 | result = Fcons (Fcons (XCAR (elt), val), result); |
| 1029 | if (EQ (val, Qunbound)) | ||
| 1030 | result = Fcons (XCAR (elt), result); | ||
| 1031 | /* Otherwise, put (symbol . value) in the list. */ | ||
| 1032 | else | ||
| 1033 | result = Fcons (Fcons (XCAR (elt), val), result); | ||
| 1034 | } | 1018 | } |
| 1035 | 1019 | ||
| 1036 | return result; | 1020 | return result; |
| @@ -1862,8 +1846,7 @@ set_buffer_internal_1 (b) | |||
| 1862 | register struct buffer *b; | 1846 | register struct buffer *b; |
| 1863 | { | 1847 | { |
| 1864 | register struct buffer *old_buf; | 1848 | register struct buffer *old_buf; |
| 1865 | register Lisp_Object tail, valcontents; | 1849 | register Lisp_Object tail; |
| 1866 | Lisp_Object tem; | ||
| 1867 | 1850 | ||
| 1868 | #ifdef USE_MMAP_FOR_BUFFERS | 1851 | #ifdef USE_MMAP_FOR_BUFFERS |
| 1869 | if (b->text->beg == NULL) | 1852 | if (b->text->beg == NULL) |
| @@ -1935,34 +1918,21 @@ set_buffer_internal_1 (b) | |||
| 1935 | /* Look down buffer's list of local Lisp variables | 1918 | /* Look down buffer's list of local Lisp variables |
| 1936 | to find and update any that forward into C variables. */ | 1919 | to find and update any that forward into C variables. */ |
| 1937 | 1920 | ||
| 1938 | for (tail = b->local_var_alist; CONSP (tail); tail = XCDR (tail)) | 1921 | do |
| 1939 | { | 1922 | { |
| 1940 | if (CONSP (XCAR (tail)) | 1923 | for (tail = b->local_var_alist; CONSP (tail); tail = XCDR (tail)) |
| 1941 | && SYMBOLP (XCAR (XCAR (tail))) | 1924 | { |
| 1942 | && (valcontents = SYMBOL_VALUE (XCAR (XCAR (tail))), | 1925 | Lisp_Object var = XCAR (XCAR (tail)); |
| 1943 | (BUFFER_LOCAL_VALUEP (valcontents))) | 1926 | struct Lisp_Symbol *sym = XSYMBOL (var); |
| 1944 | && (tem = XBUFFER_LOCAL_VALUE (valcontents)->realvalue, | 1927 | if (sym->redirect == SYMBOL_LOCALIZED /* Just to be sure. */ |
| 1945 | (BOOLFWDP (tem) || INTFWDP (tem) || OBJFWDP (tem)))) | 1928 | && SYMBOL_BLV (sym)->fwd) |
| 1946 | /* Just reference the variable to cause it to become set for | 1929 | /* Just reference the variable |
| 1947 | this buffer. */ | 1930 | to cause it to become set for this buffer. */ |
| 1948 | Fsymbol_value (XCAR (XCAR (tail))); | 1931 | Fsymbol_value (var); |
| 1932 | } | ||
| 1949 | } | 1933 | } |
| 1950 | |||
| 1951 | /* Do the same with any others that were local to the previous buffer */ | 1934 | /* Do the same with any others that were local to the previous buffer */ |
| 1952 | 1935 | while (b != old_buf && (b = old_buf, b)); | |
| 1953 | if (old_buf) | ||
| 1954 | for (tail = old_buf->local_var_alist; CONSP (tail); tail = XCDR (tail)) | ||
| 1955 | { | ||
| 1956 | if (CONSP (tail) | ||
| 1957 | && SYMBOLP (XCAR (XCAR (tail))) | ||
| 1958 | && (valcontents = SYMBOL_VALUE (XCAR (XCAR (tail))), | ||
| 1959 | (BUFFER_LOCAL_VALUEP (valcontents))) | ||
| 1960 | && (tem = XBUFFER_LOCAL_VALUE (valcontents)->realvalue, | ||
| 1961 | (BOOLFWDP (tem) || INTFWDP (tem) || OBJFWDP (tem)))) | ||
| 1962 | /* Just reference the variable to cause it to become set for | ||
| 1963 | this buffer. */ | ||
| 1964 | Fsymbol_value (XCAR (XCAR (tail))); | ||
| 1965 | } | ||
| 1966 | } | 1936 | } |
| 1967 | 1937 | ||
| 1968 | /* Switch to buffer B temporarily for redisplay purposes. | 1938 | /* Switch to buffer B temporarily for redisplay purposes. |
| @@ -2677,23 +2647,22 @@ static void | |||
| 2677 | swap_out_buffer_local_variables (b) | 2647 | swap_out_buffer_local_variables (b) |
| 2678 | struct buffer *b; | 2648 | struct buffer *b; |
| 2679 | { | 2649 | { |
| 2680 | Lisp_Object oalist, alist, sym, buffer; | 2650 | Lisp_Object oalist, alist, buffer; |
| 2681 | 2651 | ||
| 2682 | XSETBUFFER (buffer, b); | 2652 | XSETBUFFER (buffer, b); |
| 2683 | oalist = b->local_var_alist; | 2653 | oalist = b->local_var_alist; |
| 2684 | 2654 | ||
| 2685 | for (alist = oalist; CONSP (alist); alist = XCDR (alist)) | 2655 | for (alist = oalist; CONSP (alist); alist = XCDR (alist)) |
| 2686 | { | 2656 | { |
| 2687 | if (CONSP (XCAR (alist)) | 2657 | Lisp_Object sym = XCAR (XCAR (alist)); |
| 2688 | && (sym = XCAR (XCAR (alist)), SYMBOLP (sym)) | 2658 | eassert (XSYMBOL (sym)->redirect == SYMBOL_LOCALIZED); |
| 2689 | /* Need not do anything if some other buffer's binding is | 2659 | /* Need not do anything if some other buffer's binding is |
| 2690 | now encached. */ | 2660 | now encached. */ |
| 2691 | && EQ (XBUFFER_LOCAL_VALUE (SYMBOL_VALUE (sym))->buffer, | 2661 | if (EQ (SYMBOL_BLV (XSYMBOL (sym))->where, buffer)) |
| 2692 | buffer)) | ||
| 2693 | { | 2662 | { |
| 2694 | /* Symbol is set up for this buffer's old local value: | 2663 | /* Symbol is set up for this buffer's old local value: |
| 2695 | swap it out! */ | 2664 | swap it out! */ |
| 2696 | swap_in_global_binding (sym); | 2665 | swap_in_global_binding (XSYMBOL (sym)); |
| 2697 | } | 2666 | } |
| 2698 | } | 2667 | } |
| 2699 | } | 2668 | } |
| @@ -5162,7 +5131,9 @@ init_buffer_once () | |||
| 5162 | /* Make sure all markable slots in buffer_defaults | 5131 | /* Make sure all markable slots in buffer_defaults |
| 5163 | are initialized reasonably, so mark_buffer won't choke. */ | 5132 | are initialized reasonably, so mark_buffer won't choke. */ |
| 5164 | reset_buffer (&buffer_defaults); | 5133 | reset_buffer (&buffer_defaults); |
| 5134 | eassert (EQ (buffer_defaults.name, make_number (0))); | ||
| 5165 | reset_buffer_local_variables (&buffer_defaults, 1); | 5135 | reset_buffer_local_variables (&buffer_defaults, 1); |
| 5136 | eassert (EQ (buffer_local_symbols.name, make_number (0))); | ||
| 5166 | reset_buffer (&buffer_local_symbols); | 5137 | reset_buffer (&buffer_local_symbols); |
| 5167 | reset_buffer_local_variables (&buffer_local_symbols, 1); | 5138 | reset_buffer_local_variables (&buffer_local_symbols, 1); |
| 5168 | /* Prevent GC from getting confused. */ | 5139 | /* Prevent GC from getting confused. */ |
| @@ -5421,33 +5392,41 @@ init_buffer () | |||
| 5421 | in the buffer that is current now. */ | 5392 | in the buffer that is current now. */ |
| 5422 | 5393 | ||
| 5423 | /* TYPE is nil for a general Lisp variable. | 5394 | /* TYPE is nil for a general Lisp variable. |
| 5424 | An integer specifies a type; then only LIsp values | 5395 | An integer specifies a type; then only Lisp values |
| 5425 | with that type code are allowed (except that nil is allowed too). | 5396 | with that type code are allowed (except that nil is allowed too). |
| 5426 | LNAME is the LIsp-level variable name. | 5397 | LNAME is the Lisp-level variable name. |
| 5427 | VNAME is the name of the buffer slot. | 5398 | VNAME is the name of the buffer slot. |
| 5428 | DOC is a dummy where you write the doc string as a comment. */ | 5399 | DOC is a dummy where you write the doc string as a comment. */ |
| 5429 | #define DEFVAR_PER_BUFFER(lname, vname, type, doc) \ | 5400 | #define DEFVAR_PER_BUFFER(lname, vname, type, doc) \ |
| 5430 | defvar_per_buffer (lname, vname, type, 0) | 5401 | do { \ |
| 5402 | static struct Lisp_Buffer_Objfwd bo_fwd; \ | ||
| 5403 | defvar_per_buffer (&bo_fwd, lname, vname, type, 0); \ | ||
| 5404 | } while (0) | ||
| 5431 | 5405 | ||
| 5432 | static void | 5406 | static void |
| 5433 | defvar_per_buffer (namestring, address, type, doc) | 5407 | defvar_per_buffer (bo_fwd, namestring, address, type, doc) |
| 5408 | struct Lisp_Buffer_Objfwd *bo_fwd; | ||
| 5434 | char *namestring; | 5409 | char *namestring; |
| 5435 | Lisp_Object *address; | 5410 | Lisp_Object *address; |
| 5436 | Lisp_Object type; | 5411 | Lisp_Object type; |
| 5437 | char *doc; | 5412 | char *doc; |
| 5438 | { | 5413 | { |
| 5439 | Lisp_Object sym, val; | 5414 | struct Lisp_Symbol *sym; |
| 5440 | int offset; | 5415 | int offset; |
| 5441 | 5416 | ||
| 5442 | sym = intern (namestring); | 5417 | sym = XSYMBOL (intern (namestring)); |
| 5443 | val = allocate_misc (); | ||
| 5444 | offset = (char *)address - (char *)current_buffer; | 5418 | offset = (char *)address - (char *)current_buffer; |
| 5445 | 5419 | ||
| 5446 | XMISCTYPE (val) = Lisp_Misc_Buffer_Objfwd; | 5420 | bo_fwd->type = Lisp_Fwd_Buffer_Obj; |
| 5447 | XBUFFER_OBJFWD (val)->offset = offset; | 5421 | bo_fwd->offset = offset; |
| 5448 | XBUFFER_OBJFWD (val)->slottype = type; | 5422 | bo_fwd->slottype = type; |
| 5449 | SET_SYMBOL_VALUE (sym, val); | 5423 | sym->redirect = SYMBOL_FORWARDED; |
| 5450 | PER_BUFFER_SYMBOL (offset) = sym; | 5424 | { |
| 5425 | /* I tried to do the job without a cast, but it seems impossible. | ||
| 5426 | union Lisp_Fwd *fwd; &(fwd->u_buffer_objfwd) = bo_fwd; */ | ||
| 5427 | SET_SYMBOL_FWD (sym, (union Lisp_Fwd *)bo_fwd); | ||
| 5428 | } | ||
| 5429 | XSETSYMBOL (PER_BUFFER_SYMBOL (offset), sym); | ||
| 5451 | 5430 | ||
| 5452 | if (PER_BUFFER_IDX (offset) == 0) | 5431 | if (PER_BUFFER_IDX (offset) == 0) |
| 5453 | /* Did a DEFVAR_PER_BUFFER without initializing the corresponding | 5432 | /* Did a DEFVAR_PER_BUFFER without initializing the corresponding |
diff --git a/src/buffer.h b/src/buffer.h index fa3fc6dafb8..b750e490078 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
| @@ -107,6 +107,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 107 | #define BUF_BEG(buf) (BEG) | 107 | #define BUF_BEG(buf) (BEG) |
| 108 | #define BUF_BEG_BYTE(buf) (BEG_BYTE) | 108 | #define BUF_BEG_BYTE(buf) (BEG_BYTE) |
| 109 | 109 | ||
| 110 | /* !!!FIXME: all the BUF_BEGV/BUF_ZV/BUF_PT macros are flawed: | ||
| 111 | on indirect (or base) buffers, that value is only correct if that buffer | ||
| 112 | is the current_buffer, or if the buffer's text hasn't been modified (via | ||
| 113 | an indirect buffer) since it was last current. */ | ||
| 114 | |||
| 110 | /* Position of beginning of accessible range of buffer. */ | 115 | /* Position of beginning of accessible range of buffer. */ |
| 111 | #define BUF_BEGV(buf) ((buf)->begv) | 116 | #define BUF_BEGV(buf) ((buf)->begv) |
| 112 | #define BUF_BEGV_BYTE(buf) ((buf)->begv_byte) | 117 | #define BUF_BEGV_BYTE(buf) ((buf)->begv_byte) |
| @@ -313,7 +318,7 @@ while (0) | |||
| 313 | - (ptr - (current_buffer)->text->beg <= (unsigned) (GPT_BYTE - BEG_BYTE) ? 0 : GAP_SIZE) \ | 318 | - (ptr - (current_buffer)->text->beg <= (unsigned) (GPT_BYTE - BEG_BYTE) ? 0 : GAP_SIZE) \ |
| 314 | + BEG_BYTE) | 319 | + BEG_BYTE) |
| 315 | 320 | ||
| 316 | /* Return character at position POS. */ | 321 | /* Return character at byte position POS. */ |
| 317 | 322 | ||
| 318 | #define FETCH_CHAR(pos) \ | 323 | #define FETCH_CHAR(pos) \ |
| 319 | (!NILP (current_buffer->enable_multibyte_characters) \ | 324 | (!NILP (current_buffer->enable_multibyte_characters) \ |
| @@ -327,7 +332,7 @@ while (0) | |||
| 327 | /* Variables used locally in FETCH_MULTIBYTE_CHAR. */ | 332 | /* Variables used locally in FETCH_MULTIBYTE_CHAR. */ |
| 328 | extern unsigned char *_fetch_multibyte_char_p; | 333 | extern unsigned char *_fetch_multibyte_char_p; |
| 329 | 334 | ||
| 330 | /* Return character code of multi-byte form at position POS. If POS | 335 | /* Return character code of multi-byte form at byte position POS. If POS |
| 331 | doesn't point the head of valid multi-byte form, only the byte at | 336 | doesn't point the head of valid multi-byte form, only the byte at |
| 332 | POS is returned. No range checking. */ | 337 | POS is returned. No range checking. */ |
| 333 | 338 | ||
| @@ -336,7 +341,7 @@ extern unsigned char *_fetch_multibyte_char_p; | |||
| 336 | + (pos) + BEG_ADDR - BEG_BYTE), \ | 341 | + (pos) + BEG_ADDR - BEG_BYTE), \ |
| 337 | STRING_CHAR (_fetch_multibyte_char_p)) | 342 | STRING_CHAR (_fetch_multibyte_char_p)) |
| 338 | 343 | ||
| 339 | /* Return character at position POS. If the current buffer is unibyte | 344 | /* Return character at byte position POS. If the current buffer is unibyte |
| 340 | and the character is not ASCII, make the returning character | 345 | and the character is not ASCII, make the returning character |
| 341 | multibyte. */ | 346 | multibyte. */ |
| 342 | 347 | ||
| @@ -447,7 +452,10 @@ struct buffer_text | |||
| 447 | /* The markers that refer to this buffer. | 452 | /* The markers that refer to this buffer. |
| 448 | This is actually a single marker --- | 453 | This is actually a single marker --- |
| 449 | successive elements in its marker `chain' | 454 | successive elements in its marker `chain' |
| 450 | are the other markers referring to this buffer. */ | 455 | are the other markers referring to this buffer. |
| 456 | This is a singly linked unordered list, which means that it's | ||
| 457 | very cheap to add a marker to the list and it's also very cheap | ||
| 458 | to move a marker within a buffer. */ | ||
| 451 | struct Lisp_Marker *markers; | 459 | struct Lisp_Marker *markers; |
| 452 | 460 | ||
| 453 | /* Usually 0. Temporarily set to 1 in decode_coding_gap to | 461 | /* Usually 0. Temporarily set to 1 in decode_coding_gap to |
| @@ -843,6 +851,7 @@ extern struct buffer buffer_defaults; | |||
| 843 | be a Lisp-level local variable for the slot, it has no default value, | 851 | be a Lisp-level local variable for the slot, it has no default value, |
| 844 | and the corresponding slot in buffer_defaults is not used. */ | 852 | and the corresponding slot in buffer_defaults is not used. */ |
| 845 | 853 | ||
| 854 | |||
| 846 | extern struct buffer buffer_local_flags; | 855 | extern struct buffer buffer_local_flags; |
| 847 | 856 | ||
| 848 | /* For each buffer slot, this points to the Lisp symbol name | 857 | /* For each buffer slot, this points to the Lisp symbol name |
| @@ -948,7 +957,7 @@ extern int last_per_buffer_idx; | |||
| 948 | from the start of a buffer structure. */ | 957 | from the start of a buffer structure. */ |
| 949 | 958 | ||
| 950 | #define PER_BUFFER_VAR_OFFSET(VAR) \ | 959 | #define PER_BUFFER_VAR_OFFSET(VAR) \ |
| 951 | ((char *) &buffer_local_flags.VAR - (char *) &buffer_local_flags) | 960 | ((char *) &((struct buffer *)0)->VAR - (char *) ((struct buffer *)0)) |
| 952 | 961 | ||
| 953 | /* Return the index of buffer-local variable VAR. Each per-buffer | 962 | /* Return the index of buffer-local variable VAR. Each per-buffer |
| 954 | variable has an index > 0 associated with it, except when it always | 963 | variable has an index > 0 associated with it, except when it always |
| @@ -1013,11 +1022,5 @@ extern int last_per_buffer_idx; | |||
| 1013 | #define PER_BUFFER_VALUE(BUFFER, OFFSET) \ | 1022 | #define PER_BUFFER_VALUE(BUFFER, OFFSET) \ |
| 1014 | (*(Lisp_Object *)((OFFSET) + (char *) (BUFFER))) | 1023 | (*(Lisp_Object *)((OFFSET) + (char *) (BUFFER))) |
| 1015 | 1024 | ||
| 1016 | /* Return the symbol of the per-buffer variable at offset OFFSET in | ||
| 1017 | the buffer structure. */ | ||
| 1018 | |||
| 1019 | #define PER_BUFFER_SYMBOL(OFFSET) \ | ||
| 1020 | (*(Lisp_Object *)((OFFSET) + (char *) &buffer_local_symbols)) | ||
| 1021 | |||
| 1022 | /* arch-tag: 679305dd-d41c-4a50-b170-3caf5c97b2d1 | 1025 | /* arch-tag: 679305dd-d41c-4a50-b170-3caf5c97b2d1 |
| 1023 | (do not change this comment) */ | 1026 | (do not change this comment) */ |
diff --git a/src/bytecode.c b/src/bytecode.c index e95614c72a9..c59f75dc78e 100644 --- a/src/bytecode.c +++ b/src/bytecode.c | |||
| @@ -505,8 +505,9 @@ If the third argument is incorrect, Emacs may crash. */) | |||
| 505 | v1 = vectorp[op]; | 505 | v1 = vectorp[op]; |
| 506 | if (SYMBOLP (v1)) | 506 | if (SYMBOLP (v1)) |
| 507 | { | 507 | { |
| 508 | v2 = SYMBOL_VALUE (v1); | 508 | if (XSYMBOL (v1)->redirect != SYMBOL_PLAINVAL |
| 509 | if (MISCP (v2) || EQ (v2, Qunbound)) | 509 | || (v2 = SYMBOL_VAL (XSYMBOL (v1)), |
| 510 | EQ (v2, Qunbound))) | ||
| 510 | { | 511 | { |
| 511 | BEFORE_POTENTIAL_GC (); | 512 | BEFORE_POTENTIAL_GC (); |
| 512 | v2 = Fsymbol_value (v1); | 513 | v2 = Fsymbol_value (v1); |
| @@ -597,10 +598,9 @@ If the third argument is incorrect, Emacs may crash. */) | |||
| 597 | /* Inline the most common case. */ | 598 | /* Inline the most common case. */ |
| 598 | if (SYMBOLP (sym) | 599 | if (SYMBOLP (sym) |
| 599 | && !EQ (val, Qunbound) | 600 | && !EQ (val, Qunbound) |
| 600 | && !XSYMBOL (sym)->indirect_variable | 601 | && !XSYMBOL (sym)->redirect |
| 601 | && !SYMBOL_CONSTANT_P (sym) | 602 | && !SYMBOL_CONSTANT_P (sym)) |
| 602 | && !MISCP (XSYMBOL (sym)->value)) | 603 | XSYMBOL (sym)->val.value = val; |
| 603 | XSYMBOL (sym)->value = val; | ||
| 604 | else | 604 | else |
| 605 | { | 605 | { |
| 606 | BEFORE_POTENTIAL_GC (); | 606 | BEFORE_POTENTIAL_GC (); |
diff --git a/src/character.h b/src/character.h index 1f1f6eade84..41f47e4b179 100644 --- a/src/character.h +++ b/src/character.h | |||
| @@ -296,7 +296,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 296 | 296 | ||
| 297 | /* If P is after LIMIT, advance P to the previous character boundary. | 297 | /* If P is after LIMIT, advance P to the previous character boundary. |
| 298 | Assumes that P is already at a character boundary of the same | 298 | Assumes that P is already at a character boundary of the same |
| 299 | mulitbyte form whose beginning address is LIMIT. */ | 299 | multibyte form whose beginning address is LIMIT. */ |
| 300 | 300 | ||
| 301 | #define PREV_CHAR_BOUNDARY(p, limit) \ | 301 | #define PREV_CHAR_BOUNDARY(p, limit) \ |
| 302 | do { \ | 302 | do { \ |
diff --git a/src/coding.c b/src/coding.c index bdc37cb7c53..6435fa1ddb1 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -6408,7 +6408,7 @@ detect_coding (coding) | |||
| 6408 | { | 6408 | { |
| 6409 | /* We didn't find an 8-bit code. We may | 6409 | /* We didn't find an 8-bit code. We may |
| 6410 | have found a null-byte, but it's very | 6410 | have found a null-byte, but it's very |
| 6411 | rare that a binary file confirm to | 6411 | rare that a binary file conforms to |
| 6412 | ISO-2022. */ | 6412 | ISO-2022. */ |
| 6413 | src = src_end; | 6413 | src = src_end; |
| 6414 | coding->head_ascii = src - coding->source; | 6414 | coding->head_ascii = src - coding->source; |
diff --git a/src/data.c b/src/data.c index bdba3a9bb36..a56b112196d 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -91,7 +91,7 @@ Lisp_Object Qfont_spec, Qfont_entity, Qfont_object; | |||
| 91 | 91 | ||
| 92 | Lisp_Object Qinteractive_form; | 92 | Lisp_Object Qinteractive_form; |
| 93 | 93 | ||
| 94 | static Lisp_Object swap_in_symval_forwarding P_ ((Lisp_Object, Lisp_Object)); | 94 | static void swap_in_symval_forwarding (struct Lisp_Symbol *, struct Lisp_Buffer_Local_Value *); |
| 95 | 95 | ||
| 96 | Lisp_Object Vmost_positive_fixnum, Vmost_negative_fixnum; | 96 | Lisp_Object Vmost_positive_fixnum, Vmost_negative_fixnum; |
| 97 | 97 | ||
| @@ -582,12 +582,35 @@ DEFUN ("boundp", Fboundp, Sboundp, 1, 1, 0, | |||
| 582 | register Lisp_Object symbol; | 582 | register Lisp_Object symbol; |
| 583 | { | 583 | { |
| 584 | Lisp_Object valcontents; | 584 | Lisp_Object valcontents; |
| 585 | struct Lisp_Symbol *sym; | ||
| 585 | CHECK_SYMBOL (symbol); | 586 | CHECK_SYMBOL (symbol); |
| 587 | sym = XSYMBOL (symbol); | ||
| 586 | 588 | ||
| 587 | valcontents = SYMBOL_VALUE (symbol); | 589 | start: |
| 588 | 590 | switch (sym->redirect) | |
| 589 | if (BUFFER_LOCAL_VALUEP (valcontents)) | 591 | { |
| 590 | valcontents = swap_in_symval_forwarding (symbol, valcontents); | 592 | case SYMBOL_PLAINVAL: valcontents = SYMBOL_VAL (sym); break; |
| 593 | case SYMBOL_VARALIAS: sym = indirect_variable (sym); goto start; | ||
| 594 | case SYMBOL_LOCALIZED: | ||
| 595 | { | ||
| 596 | struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym); | ||
| 597 | if (blv->fwd) | ||
| 598 | /* In set_internal, we un-forward vars when their value is | ||
| 599 | set to Qunbound. */ | ||
| 600 | return Qt; | ||
| 601 | else | ||
| 602 | { | ||
| 603 | swap_in_symval_forwarding (sym, blv); | ||
| 604 | valcontents = BLV_VALUE (blv); | ||
| 605 | } | ||
| 606 | break; | ||
| 607 | } | ||
| 608 | case SYMBOL_FORWARDED: | ||
| 609 | /* In set_internal, we un-forward vars when their value is | ||
| 610 | set to Qunbound. */ | ||
| 611 | return Qt; | ||
| 612 | default: abort (); | ||
| 613 | } | ||
| 591 | 614 | ||
| 592 | return (EQ (valcontents, Qunbound) ? Qnil : Qt); | 615 | return (EQ (valcontents, Qunbound) ? Qnil : Qt); |
| 593 | } | 616 | } |
| @@ -824,14 +847,14 @@ indirect_variable (symbol) | |||
| 824 | 847 | ||
| 825 | hare = tortoise = symbol; | 848 | hare = tortoise = symbol; |
| 826 | 849 | ||
| 827 | while (hare->indirect_variable) | 850 | while (hare->redirect == SYMBOL_VARALIAS) |
| 828 | { | 851 | { |
| 829 | hare = XSYMBOL (hare->value); | 852 | hare = SYMBOL_ALIAS (hare); |
| 830 | if (!hare->indirect_variable) | 853 | if (hare->redirect != SYMBOL_VARALIAS) |
| 831 | break; | 854 | break; |
| 832 | 855 | ||
| 833 | hare = XSYMBOL (hare->value); | 856 | hare = SYMBOL_ALIAS (hare); |
| 834 | tortoise = XSYMBOL (tortoise->value); | 857 | tortoise = SYMBOL_ALIAS (tortoise); |
| 835 | 858 | ||
| 836 | if (hare == tortoise) | 859 | if (hare == tortoise) |
| 837 | { | 860 | { |
| @@ -865,44 +888,46 @@ variable chain of symbols. */) | |||
| 865 | This does not handle buffer-local variables; use | 888 | This does not handle buffer-local variables; use |
| 866 | swap_in_symval_forwarding for that. */ | 889 | swap_in_symval_forwarding for that. */ |
| 867 | 890 | ||
| 891 | #define do_blv_forwarding(blv) \ | ||
| 892 | ((blv)->forwarded ? do_symval_forwarding (BLV_FWD (blv)) : BLV_VALUE (blv)) | ||
| 893 | |||
| 868 | Lisp_Object | 894 | Lisp_Object |
| 869 | do_symval_forwarding (valcontents) | 895 | do_symval_forwarding (valcontents) |
| 870 | register Lisp_Object valcontents; | 896 | register union Lisp_Fwd *valcontents; |
| 871 | { | 897 | { |
| 872 | register Lisp_Object val; | 898 | register Lisp_Object val; |
| 873 | if (MISCP (valcontents)) | 899 | switch (XFWDTYPE (valcontents)) |
| 874 | switch (XMISCTYPE (valcontents)) | 900 | { |
| 875 | { | 901 | case Lisp_Fwd_Int: |
| 876 | case Lisp_Misc_Intfwd: | 902 | XSETINT (val, *XINTFWD (valcontents)->intvar); |
| 877 | XSETINT (val, *XINTFWD (valcontents)->intvar); | 903 | return val; |
| 878 | return val; | 904 | |
| 879 | 905 | case Lisp_Fwd_Bool: | |
| 880 | case Lisp_Misc_Boolfwd: | 906 | return (*XBOOLFWD (valcontents)->boolvar ? Qt : Qnil); |
| 881 | return (*XBOOLFWD (valcontents)->boolvar ? Qt : Qnil); | 907 | |
| 882 | 908 | case Lisp_Fwd_Obj: | |
| 883 | case Lisp_Misc_Objfwd: | 909 | return *XOBJFWD (valcontents)->objvar; |
| 884 | return *XOBJFWD (valcontents)->objvar; | 910 | |
| 885 | 911 | case Lisp_Fwd_Buffer_Obj: | |
| 886 | case Lisp_Misc_Buffer_Objfwd: | 912 | return PER_BUFFER_VALUE (current_buffer, |
| 887 | return PER_BUFFER_VALUE (current_buffer, | 913 | XBUFFER_OBJFWD (valcontents)->offset); |
| 888 | XBUFFER_OBJFWD (valcontents)->offset); | 914 | |
| 889 | 915 | case Lisp_Fwd_Kboard_Obj: | |
| 890 | case Lisp_Misc_Kboard_Objfwd: | 916 | /* We used to simply use current_kboard here, but from Lisp |
| 891 | /* We used to simply use current_kboard here, but from Lisp | 917 | code, it's value is often unexpected. It seems nicer to |
| 892 | code, it's value is often unexpected. It seems nicer to | 918 | allow constructions like this to work as intuitively expected: |
| 893 | allow constructions like this to work as intuitively expected: | 919 | |
| 894 | 920 | (with-selected-frame frame | |
| 895 | (with-selected-frame frame | 921 | (define-key local-function-map "\eOP" [f1])) |
| 896 | (define-key local-function-map "\eOP" [f1])) | 922 | |
| 897 | 923 | On the other hand, this affects the semantics of | |
| 898 | On the other hand, this affects the semantics of | 924 | last-command and real-last-command, and people may rely on |
| 899 | last-command and real-last-command, and people may rely on | 925 | that. I took a quick look at the Lisp codebase, and I |
| 900 | that. I took a quick look at the Lisp codebase, and I | 926 | don't think anything will break. --lorentey */ |
| 901 | don't think anything will break. --lorentey */ | 927 | return *(Lisp_Object *)(XKBOARD_OBJFWD (valcontents)->offset |
| 902 | return *(Lisp_Object *)(XKBOARD_OBJFWD (valcontents)->offset | 928 | + (char *)FRAME_KBOARD (SELECTED_FRAME ())); |
| 903 | + (char *)FRAME_KBOARD (SELECTED_FRAME ())); | 929 | default: abort (); |
| 904 | } | 930 | } |
| 905 | return valcontents; | ||
| 906 | } | 931 | } |
| 907 | 932 | ||
| 908 | /* Store NEWVAL into SYMBOL, where VALCONTENTS is found in the value cell | 933 | /* Store NEWVAL into SYMBOL, where VALCONTENTS is found in the value cell |
| @@ -913,102 +938,93 @@ do_symval_forwarding (valcontents) | |||
| 913 | BUF non-zero means set the value in buffer BUF instead of the | 938 | BUF non-zero means set the value in buffer BUF instead of the |
| 914 | current buffer. This only plays a role for per-buffer variables. */ | 939 | current buffer. This only plays a role for per-buffer variables. */ |
| 915 | 940 | ||
| 916 | void | 941 | #define store_blv_forwarding(blv, newval, buf) \ |
| 917 | store_symval_forwarding (symbol, valcontents, newval, buf) | 942 | do { \ |
| 918 | Lisp_Object symbol; | 943 | if ((blv)->forwarded) \ |
| 919 | register Lisp_Object valcontents, newval; | 944 | store_symval_forwarding (BLV_FWD (blv), (newval), (buf)); \ |
| 945 | else \ | ||
| 946 | SET_BLV_VALUE (blv, newval); \ | ||
| 947 | } while (0) | ||
| 948 | |||
| 949 | static void | ||
| 950 | store_symval_forwarding (/* symbol, */ valcontents, newval, buf) | ||
| 951 | /* struct Lisp_Symbol *symbol; */ | ||
| 952 | union Lisp_Fwd *valcontents; | ||
| 953 | register Lisp_Object newval; | ||
| 920 | struct buffer *buf; | 954 | struct buffer *buf; |
| 921 | { | 955 | { |
| 922 | switch (SWITCH_ENUM_CAST (XTYPE (valcontents))) | 956 | switch (XFWDTYPE (valcontents)) |
| 923 | { | 957 | { |
| 924 | case Lisp_Misc: | 958 | case Lisp_Fwd_Int: |
| 925 | switch (XMISCTYPE (valcontents)) | 959 | CHECK_NUMBER (newval); |
| 960 | *XINTFWD (valcontents)->intvar = XINT (newval); | ||
| 961 | break; | ||
| 962 | |||
| 963 | case Lisp_Fwd_Bool: | ||
| 964 | *XBOOLFWD (valcontents)->boolvar = !NILP (newval); | ||
| 965 | break; | ||
| 966 | |||
| 967 | case Lisp_Fwd_Obj: | ||
| 968 | *XOBJFWD (valcontents)->objvar = newval; | ||
| 969 | |||
| 970 | /* If this variable is a default for something stored | ||
| 971 | in the buffer itself, such as default-fill-column, | ||
| 972 | find the buffers that don't have local values for it | ||
| 973 | and update them. */ | ||
| 974 | if (XOBJFWD (valcontents)->objvar > (Lisp_Object *) &buffer_defaults | ||
| 975 | && XOBJFWD (valcontents)->objvar < (Lisp_Object *) (&buffer_defaults + 1)) | ||
| 926 | { | 976 | { |
| 927 | case Lisp_Misc_Intfwd: | 977 | int offset = ((char *) XOBJFWD (valcontents)->objvar |
| 928 | CHECK_NUMBER (newval); | 978 | - (char *) &buffer_defaults); |
| 929 | *XINTFWD (valcontents)->intvar = XINT (newval); | 979 | int idx = PER_BUFFER_IDX (offset); |
| 930 | /* This can never happen since intvar points to an EMACS_INT | 980 | |
| 931 | which is at least large enough to hold a Lisp_Object. | 981 | Lisp_Object tail; |
| 932 | if (*XINTFWD (valcontents)->intvar != XINT (newval)) | 982 | |
| 933 | error ("Value out of range for variable `%s'", | 983 | if (idx <= 0) |
| 934 | SDATA (SYMBOL_NAME (symbol))); */ | 984 | break; |
| 935 | break; | 985 | |
| 936 | 986 | for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail)) | |
| 937 | case Lisp_Misc_Boolfwd: | ||
| 938 | *XBOOLFWD (valcontents)->boolvar = !NILP (newval); | ||
| 939 | break; | ||
| 940 | |||
| 941 | case Lisp_Misc_Objfwd: | ||
| 942 | *XOBJFWD (valcontents)->objvar = newval; | ||
| 943 | |||
| 944 | /* If this variable is a default for something stored | ||
| 945 | in the buffer itself, such as default-fill-column, | ||
| 946 | find the buffers that don't have local values for it | ||
| 947 | and update them. */ | ||
| 948 | if (XOBJFWD (valcontents)->objvar > (Lisp_Object *) &buffer_defaults | ||
| 949 | && XOBJFWD (valcontents)->objvar < (Lisp_Object *) (&buffer_defaults + 1)) | ||
| 950 | { | 987 | { |
| 951 | int offset = ((char *) XOBJFWD (valcontents)->objvar | 988 | Lisp_Object buf; |
| 952 | - (char *) &buffer_defaults); | 989 | struct buffer *b; |
| 953 | int idx = PER_BUFFER_IDX (offset); | ||
| 954 | 990 | ||
| 955 | Lisp_Object tail; | 991 | buf = Fcdr (XCAR (tail)); |
| 992 | if (!BUFFERP (buf)) continue; | ||
| 993 | b = XBUFFER (buf); | ||
| 956 | 994 | ||
| 957 | if (idx <= 0) | 995 | if (! PER_BUFFER_VALUE_P (b, idx)) |
| 958 | break; | 996 | PER_BUFFER_VALUE (b, offset) = newval; |
| 959 | |||
| 960 | for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail)) | ||
| 961 | { | ||
| 962 | Lisp_Object buf; | ||
| 963 | struct buffer *b; | ||
| 964 | |||
| 965 | buf = Fcdr (XCAR (tail)); | ||
| 966 | if (!BUFFERP (buf)) continue; | ||
| 967 | b = XBUFFER (buf); | ||
| 968 | |||
| 969 | if (! PER_BUFFER_VALUE_P (b, idx)) | ||
| 970 | PER_BUFFER_VALUE (b, offset) = newval; | ||
| 971 | } | ||
| 972 | } | 997 | } |
| 973 | break; | 998 | } |
| 974 | 999 | break; | |
| 975 | case Lisp_Misc_Buffer_Objfwd: | ||
| 976 | { | ||
| 977 | int offset = XBUFFER_OBJFWD (valcontents)->offset; | ||
| 978 | Lisp_Object type = XBUFFER_OBJFWD (valcontents)->slottype; | ||
| 979 | |||
| 980 | if (!(NILP (type) || NILP (newval) | ||
| 981 | || (XINT (type) == LISP_INT_TAG | ||
| 982 | ? INTEGERP (newval) | ||
| 983 | : XTYPE (newval) == XINT (type)))) | ||
| 984 | buffer_slot_type_mismatch (newval, XINT (type)); | ||
| 985 | |||
| 986 | if (buf == NULL) | ||
| 987 | buf = current_buffer; | ||
| 988 | PER_BUFFER_VALUE (buf, offset) = newval; | ||
| 989 | } | ||
| 990 | break; | ||
| 991 | 1000 | ||
| 992 | case Lisp_Misc_Kboard_Objfwd: | 1001 | case Lisp_Fwd_Buffer_Obj: |
| 993 | { | 1002 | { |
| 994 | char *base = (char *) FRAME_KBOARD (SELECTED_FRAME ()); | 1003 | int offset = XBUFFER_OBJFWD (valcontents)->offset; |
| 995 | char *p = base + XKBOARD_OBJFWD (valcontents)->offset; | 1004 | Lisp_Object type = XBUFFER_OBJFWD (valcontents)->slottype; |
| 996 | *(Lisp_Object *) p = newval; | 1005 | |
| 997 | } | 1006 | if (!(NILP (type) || NILP (newval) |
| 998 | break; | 1007 | || (XINT (type) == LISP_INT_TAG |
| 1008 | ? INTEGERP (newval) | ||
| 1009 | : XTYPE (newval) == XINT (type)))) | ||
| 1010 | buffer_slot_type_mismatch (newval, XINT (type)); | ||
| 1011 | |||
| 1012 | if (buf == NULL) | ||
| 1013 | buf = current_buffer; | ||
| 1014 | PER_BUFFER_VALUE (buf, offset) = newval; | ||
| 1015 | } | ||
| 1016 | break; | ||
| 999 | 1017 | ||
| 1000 | default: | 1018 | case Lisp_Fwd_Kboard_Obj: |
| 1001 | goto def; | 1019 | { |
| 1002 | } | 1020 | char *base = (char *) FRAME_KBOARD (SELECTED_FRAME ()); |
| 1021 | char *p = base + XKBOARD_OBJFWD (valcontents)->offset; | ||
| 1022 | *(Lisp_Object *) p = newval; | ||
| 1023 | } | ||
| 1003 | break; | 1024 | break; |
| 1004 | 1025 | ||
| 1005 | default: | 1026 | default: |
| 1006 | def: | 1027 | abort (); /* goto def; */ |
| 1007 | valcontents = SYMBOL_VALUE (symbol); | ||
| 1008 | if (BUFFER_LOCAL_VALUEP (valcontents)) | ||
| 1009 | XBUFFER_LOCAL_VALUE (valcontents)->realvalue = newval; | ||
| 1010 | else | ||
| 1011 | SET_SYMBOL_VALUE (symbol, newval); | ||
| 1012 | } | 1028 | } |
| 1013 | } | 1029 | } |
| 1014 | 1030 | ||
| @@ -1017,25 +1033,22 @@ store_symval_forwarding (symbol, valcontents, newval, buf) | |||
| 1017 | 1033 | ||
| 1018 | void | 1034 | void |
| 1019 | swap_in_global_binding (symbol) | 1035 | swap_in_global_binding (symbol) |
| 1020 | Lisp_Object symbol; | 1036 | struct Lisp_Symbol *symbol; |
| 1021 | { | 1037 | { |
| 1022 | Lisp_Object valcontents = SYMBOL_VALUE (symbol); | 1038 | struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (symbol); |
| 1023 | struct Lisp_Buffer_Local_Value *blv = XBUFFER_LOCAL_VALUE (valcontents); | ||
| 1024 | Lisp_Object cdr = blv->cdr; | ||
| 1025 | 1039 | ||
| 1026 | /* Unload the previously loaded binding. */ | 1040 | /* Unload the previously loaded binding. */ |
| 1027 | Fsetcdr (XCAR (cdr), | 1041 | if (blv->fwd) |
| 1028 | do_symval_forwarding (blv->realvalue)); | 1042 | SET_BLV_VALUE (blv, do_symval_forwarding (blv->fwd)); |
| 1029 | 1043 | ||
| 1030 | /* Select the global binding in the symbol. */ | 1044 | /* Select the global binding in the symbol. */ |
| 1031 | XSETCAR (cdr, cdr); | 1045 | blv->valcell = blv->defcell; |
| 1032 | store_symval_forwarding (symbol, blv->realvalue, XCDR (cdr), NULL); | 1046 | if (blv->fwd) |
| 1047 | store_symval_forwarding (blv->fwd, XCDR (blv->defcell), NULL); | ||
| 1033 | 1048 | ||
| 1034 | /* Indicate that the global binding is set up now. */ | 1049 | /* Indicate that the global binding is set up now. */ |
| 1035 | blv->frame = Qnil; | 1050 | blv->where = Qnil; |
| 1036 | blv->buffer = Qnil; | 1051 | SET_BLV_FOUND (blv, 0); |
| 1037 | blv->found_for_frame = 0; | ||
| 1038 | blv->found_for_buffer = 0; | ||
| 1039 | } | 1052 | } |
| 1040 | 1053 | ||
| 1041 | /* Set up the buffer-local symbol SYMBOL for validity in the current buffer. | 1054 | /* Set up the buffer-local symbol SYMBOL for validity in the current buffer. |
| @@ -1045,55 +1058,50 @@ swap_in_global_binding (symbol) | |||
| 1045 | Return the value forwarded one step past the buffer-local stage. | 1058 | Return the value forwarded one step past the buffer-local stage. |
| 1046 | This could be another forwarding pointer. */ | 1059 | This could be another forwarding pointer. */ |
| 1047 | 1060 | ||
| 1048 | static Lisp_Object | 1061 | static void |
| 1049 | swap_in_symval_forwarding (symbol, valcontents) | 1062 | swap_in_symval_forwarding (symbol, blv) |
| 1050 | Lisp_Object symbol, valcontents; | 1063 | struct Lisp_Symbol *symbol; |
| 1064 | struct Lisp_Buffer_Local_Value *blv; | ||
| 1051 | { | 1065 | { |
| 1052 | register Lisp_Object tem1; | 1066 | register Lisp_Object tem1; |
| 1053 | 1067 | ||
| 1054 | tem1 = XBUFFER_LOCAL_VALUE (valcontents)->buffer; | 1068 | eassert (blv == SYMBOL_BLV (symbol)); |
| 1069 | |||
| 1070 | tem1 = blv->where; | ||
| 1055 | 1071 | ||
| 1056 | if (NILP (tem1) | 1072 | if (NILP (tem1) |
| 1057 | || current_buffer != XBUFFER (tem1) | 1073 | || (blv->frame_local |
| 1058 | || (XBUFFER_LOCAL_VALUE (valcontents)->check_frame | 1074 | ? !EQ (selected_frame, tem1) |
| 1059 | && ! EQ (selected_frame, XBUFFER_LOCAL_VALUE (valcontents)->frame))) | 1075 | : current_buffer != XBUFFER (tem1))) |
| 1060 | { | 1076 | { |
| 1061 | struct Lisp_Symbol *sym = XSYMBOL (symbol); | ||
| 1062 | if (sym->indirect_variable) | ||
| 1063 | { | ||
| 1064 | sym = indirect_variable (sym); | ||
| 1065 | XSETSYMBOL (symbol, sym); | ||
| 1066 | } | ||
| 1067 | 1077 | ||
| 1068 | /* Unload the previously loaded binding. */ | 1078 | /* Unload the previously loaded binding. */ |
| 1069 | tem1 = XCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr); | 1079 | tem1 = blv->valcell; |
| 1070 | Fsetcdr (tem1, | 1080 | if (blv->fwd) |
| 1071 | do_symval_forwarding (XBUFFER_LOCAL_VALUE (valcontents)->realvalue)); | 1081 | SET_BLV_VALUE (blv, do_symval_forwarding (blv->fwd)); |
| 1072 | /* Choose the new binding. */ | 1082 | /* Choose the new binding. */ |
| 1073 | tem1 = assq_no_quit (symbol, current_buffer->local_var_alist); | 1083 | { |
| 1074 | XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame = 0; | 1084 | Lisp_Object var; |
| 1075 | XBUFFER_LOCAL_VALUE (valcontents)->found_for_buffer = 0; | 1085 | XSETSYMBOL (var, symbol); |
| 1076 | if (NILP (tem1)) | 1086 | if (blv->frame_local) |
| 1077 | { | 1087 | { |
| 1078 | if (XBUFFER_LOCAL_VALUE (valcontents)->check_frame) | 1088 | tem1 = assq_no_quit (var, XFRAME (selected_frame)->param_alist); |
| 1079 | tem1 = assq_no_quit (symbol, XFRAME (selected_frame)->param_alist); | 1089 | blv->where = selected_frame; |
| 1080 | if (! NILP (tem1)) | 1090 | } |
| 1081 | XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame = 1; | 1091 | else |
| 1082 | else | 1092 | { |
| 1083 | tem1 = XBUFFER_LOCAL_VALUE (valcontents)->cdr; | 1093 | tem1 = assq_no_quit (var, current_buffer->local_var_alist); |
| 1084 | } | 1094 | XSETBUFFER (blv->where, current_buffer); |
| 1085 | else | 1095 | } |
| 1086 | XBUFFER_LOCAL_VALUE (valcontents)->found_for_buffer = 1; | 1096 | } |
| 1097 | if (!(blv->found = !NILP (tem1))) | ||
| 1098 | tem1 = blv->defcell; | ||
| 1087 | 1099 | ||
| 1088 | /* Load the new binding. */ | 1100 | /* Load the new binding. */ |
| 1089 | XSETCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr, tem1); | 1101 | blv->valcell = tem1; |
| 1090 | XSETBUFFER (XBUFFER_LOCAL_VALUE (valcontents)->buffer, current_buffer); | 1102 | if (blv->fwd) |
| 1091 | XBUFFER_LOCAL_VALUE (valcontents)->frame = selected_frame; | 1103 | store_symval_forwarding (blv->fwd, BLV_VALUE (blv), NULL); |
| 1092 | store_symval_forwarding (symbol, | ||
| 1093 | XBUFFER_LOCAL_VALUE (valcontents)->realvalue, | ||
| 1094 | Fcdr (tem1), NULL); | ||
| 1095 | } | 1104 | } |
| 1096 | return XBUFFER_LOCAL_VALUE (valcontents)->realvalue; | ||
| 1097 | } | 1105 | } |
| 1098 | 1106 | ||
| 1099 | /* Find the value of a symbol, returning Qunbound if it's not bound. | 1107 | /* Find the value of a symbol, returning Qunbound if it's not bound. |
| @@ -1106,16 +1114,27 @@ Lisp_Object | |||
| 1106 | find_symbol_value (symbol) | 1114 | find_symbol_value (symbol) |
| 1107 | Lisp_Object symbol; | 1115 | Lisp_Object symbol; |
| 1108 | { | 1116 | { |
| 1109 | register Lisp_Object valcontents; | 1117 | struct Lisp_Symbol *sym; |
| 1110 | register Lisp_Object val; | ||
| 1111 | 1118 | ||
| 1112 | CHECK_SYMBOL (symbol); | 1119 | CHECK_SYMBOL (symbol); |
| 1113 | valcontents = SYMBOL_VALUE (symbol); | 1120 | sym = XSYMBOL (symbol); |
| 1114 | |||
| 1115 | if (BUFFER_LOCAL_VALUEP (valcontents)) | ||
| 1116 | valcontents = swap_in_symval_forwarding (symbol, valcontents); | ||
| 1117 | 1121 | ||
| 1118 | return do_symval_forwarding (valcontents); | 1122 | start: |
| 1123 | switch (sym->redirect) | ||
| 1124 | { | ||
| 1125 | case SYMBOL_VARALIAS: sym = indirect_variable (sym); goto start; | ||
| 1126 | case SYMBOL_PLAINVAL: return SYMBOL_VAL (sym); | ||
| 1127 | case SYMBOL_LOCALIZED: | ||
| 1128 | { | ||
| 1129 | struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym); | ||
| 1130 | swap_in_symval_forwarding (sym, blv); | ||
| 1131 | return blv->fwd ? do_symval_forwarding (blv->fwd) : BLV_VALUE (blv); | ||
| 1132 | } | ||
| 1133 | /* FALLTHROUGH */ | ||
| 1134 | case SYMBOL_FORWARDED: | ||
| 1135 | return do_symval_forwarding (SYMBOL_FWD (sym)); | ||
| 1136 | default: abort (); | ||
| 1137 | } | ||
| 1119 | } | 1138 | } |
| 1120 | 1139 | ||
| 1121 | DEFUN ("symbol-value", Fsymbol_value, Ssymbol_value, 1, 1, 0, | 1140 | DEFUN ("symbol-value", Fsymbol_value, Ssymbol_value, 1, 1, 0, |
| @@ -1137,26 +1156,25 @@ DEFUN ("set", Fset, Sset, 2, 2, 0, | |||
| 1137 | (symbol, newval) | 1156 | (symbol, newval) |
| 1138 | register Lisp_Object symbol, newval; | 1157 | register Lisp_Object symbol, newval; |
| 1139 | { | 1158 | { |
| 1140 | return set_internal (symbol, newval, current_buffer, 0); | 1159 | set_internal (symbol, newval, current_buffer, 0); |
| 1160 | return newval; | ||
| 1141 | } | 1161 | } |
| 1142 | 1162 | ||
| 1143 | /* Return 1 if SYMBOL currently has a let-binding | 1163 | /* Return 1 if SYMBOL currently has a let-binding |
| 1144 | which was made in the buffer that is now current. */ | 1164 | which was made in the buffer that is now current. */ |
| 1145 | 1165 | ||
| 1146 | static int | 1166 | static int |
| 1147 | let_shadows_buffer_binding_p (symbol) | 1167 | let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol) |
| 1148 | struct Lisp_Symbol *symbol; | ||
| 1149 | { | 1168 | { |
| 1150 | volatile struct specbinding *p; | 1169 | struct specbinding *p; |
| 1151 | 1170 | ||
| 1152 | for (p = specpdl_ptr - 1; p >= specpdl; p--) | 1171 | for (p = specpdl_ptr - 1; p >= specpdl; p--) |
| 1153 | if (p->func == NULL | 1172 | if (p->func == NULL |
| 1154 | && CONSP (p->symbol)) | 1173 | && CONSP (p->symbol)) |
| 1155 | { | 1174 | { |
| 1156 | struct Lisp_Symbol *let_bound_symbol = XSYMBOL (XCAR (p->symbol)); | 1175 | struct Lisp_Symbol *let_bound_symbol = XSYMBOL (XCAR (p->symbol)); |
| 1157 | if ((symbol == let_bound_symbol | 1176 | eassert (let_bound_symbol->redirect != SYMBOL_VARALIAS); |
| 1158 | || (let_bound_symbol->indirect_variable | 1177 | if (symbol == let_bound_symbol |
| 1159 | && symbol == indirect_variable (let_bound_symbol))) | ||
| 1160 | && XBUFFER (XCDR (XCDR (p->symbol))) == current_buffer) | 1178 | && XBUFFER (XCDR (XCDR (p->symbol))) == current_buffer) |
| 1161 | break; | 1179 | break; |
| 1162 | } | 1180 | } |
| @@ -1164,6 +1182,19 @@ let_shadows_buffer_binding_p (symbol) | |||
| 1164 | return p >= specpdl; | 1182 | return p >= specpdl; |
| 1165 | } | 1183 | } |
| 1166 | 1184 | ||
| 1185 | static int | ||
| 1186 | let_shadows_global_binding_p (symbol) | ||
| 1187 | Lisp_Object symbol; | ||
| 1188 | { | ||
| 1189 | struct specbinding *p; | ||
| 1190 | |||
| 1191 | for (p = specpdl_ptr - 1; p >= specpdl; p--) | ||
| 1192 | if (p->func == NULL && EQ (p->symbol, symbol)) | ||
| 1193 | break; | ||
| 1194 | |||
| 1195 | return p >= specpdl; | ||
| 1196 | } | ||
| 1197 | |||
| 1167 | /* Store the value NEWVAL into SYMBOL. | 1198 | /* Store the value NEWVAL into SYMBOL. |
| 1168 | If buffer-locality is an issue, BUF specifies which buffer to use. | 1199 | If buffer-locality is an issue, BUF specifies which buffer to use. |
| 1169 | (0 stands for the current buffer.) | 1200 | (0 stands for the current buffer.) |
| @@ -1172,133 +1203,155 @@ let_shadows_buffer_binding_p (symbol) | |||
| 1172 | local in every buffer where it is set, then we make it local. | 1203 | local in every buffer where it is set, then we make it local. |
| 1173 | If BINDFLAG is nonzero, we don't do that. */ | 1204 | If BINDFLAG is nonzero, we don't do that. */ |
| 1174 | 1205 | ||
| 1175 | Lisp_Object | 1206 | void |
| 1176 | set_internal (symbol, newval, buf, bindflag) | 1207 | set_internal (symbol, newval, buf, bindflag) |
| 1177 | register Lisp_Object symbol, newval; | 1208 | register Lisp_Object symbol, newval; |
| 1178 | struct buffer *buf; | 1209 | struct buffer *buf; |
| 1179 | int bindflag; | 1210 | int bindflag; |
| 1180 | { | 1211 | { |
| 1181 | int voide = EQ (newval, Qunbound); | 1212 | int voide = EQ (newval, Qunbound); |
| 1182 | 1213 | struct Lisp_Symbol *sym; | |
| 1183 | register Lisp_Object valcontents, innercontents, tem1, current_alist_element; | 1214 | Lisp_Object tem1; |
| 1184 | 1215 | ||
| 1185 | if (buf == 0) | 1216 | if (buf == 0) |
| 1186 | buf = current_buffer; | 1217 | buf = current_buffer; |
| 1187 | 1218 | ||
| 1188 | /* If restoring in a dead buffer, do nothing. */ | 1219 | /* If restoring in a dead buffer, do nothing. */ |
| 1189 | if (NILP (buf->name)) | 1220 | if (NILP (buf->name)) |
| 1190 | return newval; | 1221 | return; |
| 1191 | 1222 | ||
| 1192 | CHECK_SYMBOL (symbol); | 1223 | CHECK_SYMBOL (symbol); |
| 1193 | if (SYMBOL_CONSTANT_P (symbol) | 1224 | if (SYMBOL_CONSTANT_P (symbol)) |
| 1194 | && (NILP (Fkeywordp (symbol)) | ||
| 1195 | || !EQ (newval, SYMBOL_VALUE (symbol)))) | ||
| 1196 | xsignal1 (Qsetting_constant, symbol); | ||
| 1197 | |||
| 1198 | innercontents = valcontents = SYMBOL_VALUE (symbol); | ||
| 1199 | |||
| 1200 | if (BUFFER_OBJFWDP (valcontents)) | ||
| 1201 | { | 1225 | { |
| 1202 | int offset = XBUFFER_OBJFWD (valcontents)->offset; | 1226 | if (NILP (Fkeywordp (symbol)) |
| 1203 | int idx = PER_BUFFER_IDX (offset); | 1227 | || !EQ (newval, Fsymbol_value (symbol))) |
| 1204 | if (idx > 0 | 1228 | xsignal1 (Qsetting_constant, symbol); |
| 1205 | && !bindflag | 1229 | else |
| 1206 | && !let_shadows_buffer_binding_p (XSYMBOL (symbol))) | 1230 | /* Allow setting keywords to their own value. */ |
| 1207 | SET_PER_BUFFER_VALUE_P (buf, idx, 1); | 1231 | return; |
| 1208 | } | 1232 | } |
| 1209 | else if (BUFFER_LOCAL_VALUEP (valcontents)) | ||
| 1210 | { | ||
| 1211 | /* valcontents is a struct Lisp_Buffer_Local_Value. */ | ||
| 1212 | if (XSYMBOL (symbol)->indirect_variable) | ||
| 1213 | XSETSYMBOL (symbol, indirect_variable (XSYMBOL (symbol))); | ||
| 1214 | |||
| 1215 | /* What binding is loaded right now? */ | ||
| 1216 | current_alist_element | ||
| 1217 | = XCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr); | ||
| 1218 | |||
| 1219 | /* If the current buffer is not the buffer whose binding is | ||
| 1220 | loaded, or if there may be frame-local bindings and the frame | ||
| 1221 | isn't the right one, or if it's a Lisp_Buffer_Local_Value and | ||
| 1222 | the default binding is loaded, the loaded binding may be the | ||
| 1223 | wrong one. */ | ||
| 1224 | if (!BUFFERP (XBUFFER_LOCAL_VALUE (valcontents)->buffer) | ||
| 1225 | || buf != XBUFFER (XBUFFER_LOCAL_VALUE (valcontents)->buffer) | ||
| 1226 | || (XBUFFER_LOCAL_VALUE (valcontents)->check_frame | ||
| 1227 | && !EQ (selected_frame, XBUFFER_LOCAL_VALUE (valcontents)->frame)) | ||
| 1228 | /* Also unload a global binding (if the var is local_if_set). */ | ||
| 1229 | || (EQ (XCAR (current_alist_element), | ||
| 1230 | current_alist_element))) | ||
| 1231 | { | ||
| 1232 | /* The currently loaded binding is not necessarily valid. | ||
| 1233 | We need to unload it, and choose a new binding. */ | ||
| 1234 | 1233 | ||
| 1235 | /* Write out `realvalue' to the old loaded binding. */ | 1234 | sym = XSYMBOL (symbol); |
| 1236 | Fsetcdr (current_alist_element, | ||
| 1237 | do_symval_forwarding (XBUFFER_LOCAL_VALUE (valcontents)->realvalue)); | ||
| 1238 | 1235 | ||
| 1239 | /* Find the new binding. */ | 1236 | start: |
| 1240 | tem1 = Fassq (symbol, buf->local_var_alist); | 1237 | switch (sym->redirect) |
| 1241 | XBUFFER_LOCAL_VALUE (valcontents)->found_for_buffer = 1; | 1238 | { |
| 1242 | XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame = 0; | 1239 | case SYMBOL_VARALIAS: sym = indirect_variable (sym); goto start; |
| 1240 | case SYMBOL_PLAINVAL: SET_SYMBOL_VAL (sym , newval); return; | ||
| 1241 | case SYMBOL_LOCALIZED: | ||
| 1242 | { | ||
| 1243 | struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym); | ||
| 1244 | Lisp_Object tmp; XSETBUFFER (tmp, buf); | ||
| 1245 | |||
| 1246 | /* If the current buffer is not the buffer whose binding is | ||
| 1247 | loaded, or if there may be frame-local bindings and the frame | ||
| 1248 | isn't the right one, or if it's a Lisp_Buffer_Local_Value and | ||
| 1249 | the default binding is loaded, the loaded binding may be the | ||
| 1250 | wrong one. */ | ||
| 1251 | if (!EQ (blv->where, | ||
| 1252 | blv->frame_local ? selected_frame : tmp) | ||
| 1253 | /* Also unload a global binding (if the var is local_if_set). */ | ||
| 1254 | || (EQ (blv->valcell, blv->defcell))) | ||
| 1255 | { | ||
| 1256 | /* The currently loaded binding is not necessarily valid. | ||
| 1257 | We need to unload it, and choose a new binding. */ | ||
| 1258 | |||
| 1259 | /* Write out `realvalue' to the old loaded binding. */ | ||
| 1260 | if (blv->fwd) | ||
| 1261 | SET_BLV_VALUE (blv, do_symval_forwarding (blv->fwd)); | ||
| 1243 | 1262 | ||
| 1244 | if (NILP (tem1)) | 1263 | /* Find the new binding. */ |
| 1245 | { | 1264 | { |
| 1246 | /* This buffer still sees the default value. */ | 1265 | XSETSYMBOL (symbol, sym); /* May have changed via aliasing. */ |
| 1247 | 1266 | if (blv->frame_local) | |
| 1248 | /* If the variable is not local_if_set, | ||
| 1249 | or if this is `let' rather than `set', | ||
| 1250 | make CURRENT-ALIST-ELEMENT point to itself, | ||
| 1251 | indicating that we're seeing the default value. | ||
| 1252 | Likewise if the variable has been let-bound | ||
| 1253 | in the current buffer. */ | ||
| 1254 | if (bindflag || !XBUFFER_LOCAL_VALUE (valcontents)->local_if_set | ||
| 1255 | || let_shadows_buffer_binding_p (XSYMBOL (symbol))) | ||
| 1256 | { | 1267 | { |
| 1257 | XBUFFER_LOCAL_VALUE (valcontents)->found_for_buffer = 0; | 1268 | tem1 = Fassq (symbol, XFRAME (selected_frame)->param_alist); |
| 1258 | 1269 | blv->where = selected_frame; | |
| 1259 | if (XBUFFER_LOCAL_VALUE (valcontents)->check_frame) | ||
| 1260 | tem1 = Fassq (symbol, | ||
| 1261 | XFRAME (selected_frame)->param_alist); | ||
| 1262 | |||
| 1263 | if (! NILP (tem1)) | ||
| 1264 | XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame = 1; | ||
| 1265 | else | ||
| 1266 | tem1 = XBUFFER_LOCAL_VALUE (valcontents)->cdr; | ||
| 1267 | } | 1270 | } |
| 1268 | /* If it's a Lisp_Buffer_Local_Value, being set not bound, | ||
| 1269 | and we're not within a let that was made for this buffer, | ||
| 1270 | create a new buffer-local binding for the variable. | ||
| 1271 | That means, give this buffer a new assoc for a local value | ||
| 1272 | and load that binding. */ | ||
| 1273 | else | 1271 | else |
| 1274 | { | 1272 | { |
| 1275 | tem1 = Fcons (symbol, XCDR (current_alist_element)); | 1273 | tem1 = Fassq (symbol, buf->local_var_alist); |
| 1276 | buf->local_var_alist | 1274 | blv->where = tmp; |
| 1277 | = Fcons (tem1, buf->local_var_alist); | ||
| 1278 | } | 1275 | } |
| 1279 | } | 1276 | } |
| 1277 | blv->found = 1; | ||
| 1278 | |||
| 1279 | if (NILP (tem1)) | ||
| 1280 | { | ||
| 1281 | /* This buffer still sees the default value. */ | ||
| 1282 | |||
| 1283 | /* If the variable is a Lisp_Some_Buffer_Local_Value, | ||
| 1284 | or if this is `let' rather than `set', | ||
| 1285 | make CURRENT-ALIST-ELEMENT point to itself, | ||
| 1286 | indicating that we're seeing the default value. | ||
| 1287 | Likewise if the variable has been let-bound | ||
| 1288 | in the current buffer. */ | ||
| 1289 | if (bindflag || !blv->local_if_set | ||
| 1290 | || let_shadows_buffer_binding_p (sym)) | ||
| 1291 | { | ||
| 1292 | blv->found = 0; | ||
| 1293 | tem1 = blv->defcell; | ||
| 1294 | } | ||
| 1295 | /* If it's a local_if_set, being set not bound, | ||
| 1296 | and we're not within a let that was made for this buffer, | ||
| 1297 | create a new buffer-local binding for the variable. | ||
| 1298 | That means, give this buffer a new assoc for a local value | ||
| 1299 | and load that binding. */ | ||
| 1300 | else | ||
| 1301 | { | ||
| 1302 | /* local_if_set is only supported for buffer-local | ||
| 1303 | bindings, not for frame-local bindings. */ | ||
| 1304 | eassert (!blv->frame_local); | ||
| 1305 | tem1 = Fcons (symbol, XCDR (blv->defcell)); | ||
| 1306 | buf->local_var_alist | ||
| 1307 | = Fcons (tem1, buf->local_var_alist); | ||
| 1308 | } | ||
| 1309 | } | ||
| 1310 | |||
| 1311 | /* Record which binding is now loaded. */ | ||
| 1312 | blv->valcell = tem1; | ||
| 1313 | } | ||
| 1280 | 1314 | ||
| 1281 | /* Record which binding is now loaded. */ | 1315 | /* Store the new value in the cons cell. */ |
| 1282 | XSETCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr, tem1); | 1316 | SET_BLV_VALUE (blv, newval); |
| 1283 | 1317 | ||
| 1284 | /* Set `buffer' and `frame' slots for the binding now loaded. */ | 1318 | if (blv->fwd) |
| 1285 | XSETBUFFER (XBUFFER_LOCAL_VALUE (valcontents)->buffer, buf); | 1319 | { |
| 1286 | XBUFFER_LOCAL_VALUE (valcontents)->frame = selected_frame; | 1320 | if (voide) |
| 1287 | } | 1321 | /* If storing void (making the symbol void), forward only through |
| 1288 | innercontents = XBUFFER_LOCAL_VALUE (valcontents)->realvalue; | 1322 | buffer-local indicator, not through Lisp_Objfwd, etc. */ |
| 1323 | blv->fwd = NULL; | ||
| 1324 | else | ||
| 1325 | store_symval_forwarding (blv->fwd, newval, buf); | ||
| 1326 | } | ||
| 1327 | break; | ||
| 1328 | } | ||
| 1329 | case SYMBOL_FORWARDED: | ||
| 1330 | { | ||
| 1331 | union Lisp_Fwd *innercontents = SYMBOL_FWD (sym); | ||
| 1332 | if (BUFFER_OBJFWDP (innercontents)) | ||
| 1333 | { | ||
| 1334 | int offset = XBUFFER_OBJFWD (innercontents)->offset; | ||
| 1335 | int idx = PER_BUFFER_IDX (offset); | ||
| 1336 | if (idx > 0 | ||
| 1337 | && !bindflag | ||
| 1338 | && !let_shadows_buffer_binding_p (sym)) | ||
| 1339 | SET_PER_BUFFER_VALUE_P (buf, idx, 1); | ||
| 1340 | } | ||
| 1289 | 1341 | ||
| 1290 | /* Store the new value in the cons-cell. */ | 1342 | if (voide) |
| 1291 | XSETCDR (XCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr), newval); | 1343 | { /* If storing void (making the symbol void), forward only through |
| 1344 | buffer-local indicator, not through Lisp_Objfwd, etc. */ | ||
| 1345 | sym->redirect = SYMBOL_PLAINVAL; | ||
| 1346 | SET_SYMBOL_VAL (sym, newval); | ||
| 1347 | } | ||
| 1348 | else | ||
| 1349 | store_symval_forwarding (/* sym, */ innercontents, newval, buf); | ||
| 1350 | break; | ||
| 1351 | } | ||
| 1352 | default: abort (); | ||
| 1292 | } | 1353 | } |
| 1293 | 1354 | return; | |
| 1294 | /* If storing void (making the symbol void), forward only through | ||
| 1295 | buffer-local indicator, not through Lisp_Objfwd, etc. */ | ||
| 1296 | if (voide) | ||
| 1297 | store_symval_forwarding (symbol, Qnil, newval, buf); | ||
| 1298 | else | ||
| 1299 | store_symval_forwarding (symbol, innercontents, newval, buf); | ||
| 1300 | |||
| 1301 | return newval; | ||
| 1302 | } | 1355 | } |
| 1303 | 1356 | ||
| 1304 | /* Access or set a buffer-local symbol's default value. */ | 1357 | /* Access or set a buffer-local symbol's default value. */ |
| @@ -1310,38 +1363,46 @@ Lisp_Object | |||
| 1310 | default_value (symbol) | 1363 | default_value (symbol) |
| 1311 | Lisp_Object symbol; | 1364 | Lisp_Object symbol; |
| 1312 | { | 1365 | { |
| 1313 | register Lisp_Object valcontents; | 1366 | struct Lisp_Symbol *sym; |
| 1314 | 1367 | ||
| 1315 | CHECK_SYMBOL (symbol); | 1368 | CHECK_SYMBOL (symbol); |
| 1316 | valcontents = SYMBOL_VALUE (symbol); | 1369 | sym = XSYMBOL (symbol); |
| 1317 | 1370 | ||
| 1318 | /* For a built-in buffer-local variable, get the default value | 1371 | start: |
| 1319 | rather than letting do_symval_forwarding get the current value. */ | 1372 | switch (sym->redirect) |
| 1320 | if (BUFFER_OBJFWDP (valcontents)) | ||
| 1321 | { | 1373 | { |
| 1322 | int offset = XBUFFER_OBJFWD (valcontents)->offset; | 1374 | case SYMBOL_VARALIAS: sym = indirect_variable (sym); goto start; |
| 1323 | if (PER_BUFFER_IDX (offset) != 0) | 1375 | case SYMBOL_PLAINVAL: return SYMBOL_VAL (sym); |
| 1324 | return PER_BUFFER_DEFAULT (offset); | 1376 | case SYMBOL_LOCALIZED: |
| 1325 | } | 1377 | { |
| 1378 | /* If var is set up for a buffer that lacks a local value for it, | ||
| 1379 | the current value is nominally the default value. | ||
| 1380 | But the `realvalue' slot may be more up to date, since | ||
| 1381 | ordinary setq stores just that slot. So use that. */ | ||
| 1382 | struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym); | ||
| 1383 | if (blv->fwd && EQ (blv->valcell, blv->defcell)) | ||
| 1384 | return do_symval_forwarding (blv->fwd); | ||
| 1385 | else | ||
| 1386 | return XCDR (blv->defcell); | ||
| 1387 | } | ||
| 1388 | case SYMBOL_FORWARDED: | ||
| 1389 | { | ||
| 1390 | union Lisp_Fwd *valcontents = SYMBOL_FWD (sym); | ||
| 1326 | 1391 | ||
| 1327 | /* Handle user-created local variables. */ | 1392 | /* For a built-in buffer-local variable, get the default value |
| 1328 | if (BUFFER_LOCAL_VALUEP (valcontents)) | 1393 | rather than letting do_symval_forwarding get the current value. */ |
| 1329 | { | 1394 | if (BUFFER_OBJFWDP (valcontents)) |
| 1330 | /* If var is set up for a buffer that lacks a local value for it, | 1395 | { |
| 1331 | the current value is nominally the default value. | 1396 | int offset = XBUFFER_OBJFWD (valcontents)->offset; |
| 1332 | But the `realvalue' slot may be more up to date, since | 1397 | if (PER_BUFFER_IDX (offset) != 0) |
| 1333 | ordinary setq stores just that slot. So use that. */ | 1398 | return PER_BUFFER_DEFAULT (offset); |
| 1334 | Lisp_Object current_alist_element, alist_element_car; | 1399 | } |
| 1335 | current_alist_element | 1400 | |
| 1336 | = XCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr); | 1401 | /* For other variables, get the current value. */ |
| 1337 | alist_element_car = XCAR (current_alist_element); | 1402 | return do_symval_forwarding (valcontents); |
| 1338 | if (EQ (alist_element_car, current_alist_element)) | 1403 | } |
| 1339 | return do_symval_forwarding (XBUFFER_LOCAL_VALUE (valcontents)->realvalue); | 1404 | default: abort (); |
| 1340 | else | ||
| 1341 | return XCDR (XBUFFER_LOCAL_VALUE (valcontents)->cdr); | ||
| 1342 | } | 1405 | } |
| 1343 | /* For other variables, get the current value. */ | ||
| 1344 | return do_symval_forwarding (valcontents); | ||
| 1345 | } | 1406 | } |
| 1346 | 1407 | ||
| 1347 | DEFUN ("default-boundp", Fdefault_boundp, Sdefault_boundp, 1, 1, 0, | 1408 | DEFUN ("default-boundp", Fdefault_boundp, Sdefault_boundp, 1, 1, 0, |
| @@ -1381,50 +1442,68 @@ for this variable. */) | |||
| 1381 | (symbol, value) | 1442 | (symbol, value) |
| 1382 | Lisp_Object symbol, value; | 1443 | Lisp_Object symbol, value; |
| 1383 | { | 1444 | { |
| 1384 | register Lisp_Object valcontents, current_alist_element, alist_element_buffer; | 1445 | struct Lisp_Symbol *sym; |
| 1385 | 1446 | ||
| 1386 | CHECK_SYMBOL (symbol); | 1447 | CHECK_SYMBOL (symbol); |
| 1387 | valcontents = SYMBOL_VALUE (symbol); | 1448 | if (SYMBOL_CONSTANT_P (symbol)) |
| 1388 | |||
| 1389 | /* Handle variables like case-fold-search that have special slots | ||
| 1390 | in the buffer. Make them work apparently like Lisp_Buffer_Local_Value | ||
| 1391 | variables. */ | ||
| 1392 | if (BUFFER_OBJFWDP (valcontents)) | ||
| 1393 | { | 1449 | { |
| 1394 | int offset = XBUFFER_OBJFWD (valcontents)->offset; | 1450 | if (NILP (Fkeywordp (symbol)) |
| 1395 | int idx = PER_BUFFER_IDX (offset); | 1451 | || !EQ (value, Fdefault_value (symbol))) |
| 1452 | xsignal1 (Qsetting_constant, symbol); | ||
| 1453 | else | ||
| 1454 | /* Allow setting keywords to their own value. */ | ||
| 1455 | return value; | ||
| 1456 | } | ||
| 1457 | sym = XSYMBOL (symbol); | ||
| 1396 | 1458 | ||
| 1397 | PER_BUFFER_DEFAULT (offset) = value; | 1459 | start: |
| 1460 | switch (sym->redirect) | ||
| 1461 | { | ||
| 1462 | case SYMBOL_VARALIAS: sym = indirect_variable (sym); goto start; | ||
| 1463 | case SYMBOL_PLAINVAL: return Fset (symbol, value); | ||
| 1464 | case SYMBOL_LOCALIZED: | ||
| 1465 | { | ||
| 1466 | struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym); | ||
| 1398 | 1467 | ||
| 1399 | /* If this variable is not always local in all buffers, | 1468 | /* Store new value into the DEFAULT-VALUE slot. */ |
| 1400 | set it in the buffers that don't nominally have a local value. */ | 1469 | XSETCDR (blv->defcell, value); |
| 1401 | if (idx > 0) | ||
| 1402 | { | ||
| 1403 | struct buffer *b; | ||
| 1404 | 1470 | ||
| 1405 | for (b = all_buffers; b; b = b->next) | 1471 | /* If the default binding is now loaded, set the REALVALUE slot too. */ |
| 1406 | if (!PER_BUFFER_VALUE_P (b, idx)) | 1472 | if (blv->fwd && EQ (blv->defcell, blv->valcell)) |
| 1407 | PER_BUFFER_VALUE (b, offset) = value; | 1473 | store_symval_forwarding (blv->fwd, value, NULL); |
| 1408 | } | 1474 | return value; |
| 1409 | return value; | 1475 | } |
| 1410 | } | 1476 | case SYMBOL_FORWARDED: |
| 1477 | { | ||
| 1478 | union Lisp_Fwd *valcontents = SYMBOL_FWD (sym); | ||
| 1411 | 1479 | ||
| 1412 | if (!BUFFER_LOCAL_VALUEP (valcontents)) | 1480 | /* Handle variables like case-fold-search that have special slots |
| 1413 | return Fset (symbol, value); | 1481 | in the buffer. |
| 1482 | Make them work apparently like Lisp_Buffer_Local_Value variables. */ | ||
| 1483 | if (BUFFER_OBJFWDP (valcontents)) | ||
| 1484 | { | ||
| 1485 | int offset = XBUFFER_OBJFWD (valcontents)->offset; | ||
| 1486 | int idx = PER_BUFFER_IDX (offset); | ||
| 1414 | 1487 | ||
| 1415 | /* Store new value into the DEFAULT-VALUE slot. */ | 1488 | PER_BUFFER_DEFAULT (offset) = value; |
| 1416 | XSETCDR (XBUFFER_LOCAL_VALUE (valcontents)->cdr, value); | ||
| 1417 | 1489 | ||
| 1418 | /* If the default binding is now loaded, set the REALVALUE slot too. */ | 1490 | /* If this variable is not always local in all buffers, |
| 1419 | current_alist_element | 1491 | set it in the buffers that don't nominally have a local value. */ |
| 1420 | = XCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr); | 1492 | if (idx > 0) |
| 1421 | alist_element_buffer = Fcar (current_alist_element); | 1493 | { |
| 1422 | if (EQ (alist_element_buffer, current_alist_element)) | 1494 | struct buffer *b; |
| 1423 | store_symval_forwarding (symbol, | ||
| 1424 | XBUFFER_LOCAL_VALUE (valcontents)->realvalue, | ||
| 1425 | value, NULL); | ||
| 1426 | 1495 | ||
| 1427 | return value; | 1496 | for (b = all_buffers; b; b = b->next) |
| 1497 | if (!PER_BUFFER_VALUE_P (b, idx)) | ||
| 1498 | PER_BUFFER_VALUE (b, offset) = value; | ||
| 1499 | } | ||
| 1500 | return value; | ||
| 1501 | } | ||
| 1502 | else | ||
| 1503 | return Fset (symbol, value); | ||
| 1504 | } | ||
| 1505 | default: abort (); | ||
| 1506 | } | ||
| 1428 | } | 1507 | } |
| 1429 | 1508 | ||
| 1430 | DEFUN ("setq-default", Fsetq_default, Ssetq_default, 0, UNEVALLED, 0, | 1509 | DEFUN ("setq-default", Fsetq_default, Ssetq_default, 0, UNEVALLED, 0, |
| @@ -1468,6 +1547,35 @@ usage: (setq-default [VAR VALUE]...) */) | |||
| 1468 | 1547 | ||
| 1469 | /* Lisp functions for creating and removing buffer-local variables. */ | 1548 | /* Lisp functions for creating and removing buffer-local variables. */ |
| 1470 | 1549 | ||
| 1550 | union Lisp_Val_Fwd | ||
| 1551 | { | ||
| 1552 | Lisp_Object value; | ||
| 1553 | union Lisp_Fwd *fwd; | ||
| 1554 | }; | ||
| 1555 | |||
| 1556 | static struct Lisp_Buffer_Local_Value * | ||
| 1557 | make_blv (struct Lisp_Symbol *sym, int forwarded, union Lisp_Val_Fwd valcontents) | ||
| 1558 | { | ||
| 1559 | struct Lisp_Buffer_Local_Value *blv | ||
| 1560 | = xmalloc (sizeof (struct Lisp_Buffer_Local_Value)); | ||
| 1561 | Lisp_Object symbol; XSETSYMBOL (symbol, sym); | ||
| 1562 | Lisp_Object tem = Fcons (symbol, (forwarded | ||
| 1563 | ? do_symval_forwarding (valcontents.fwd) | ||
| 1564 | : valcontents.value)); | ||
| 1565 | /* Buffer_Local_Values cannot have as realval a buffer-local | ||
| 1566 | or keyboard-local forwarding. */ | ||
| 1567 | eassert (!(forwarded && BUFFER_OBJFWDP (valcontents.fwd))); | ||
| 1568 | eassert (!(forwarded && KBOARD_OBJFWDP (valcontents.fwd))); | ||
| 1569 | blv->fwd = forwarded ? valcontents.fwd : NULL; | ||
| 1570 | blv->where = Qnil; | ||
| 1571 | blv->frame_local = 0; | ||
| 1572 | blv->local_if_set = 0; | ||
| 1573 | blv->defcell = tem; | ||
| 1574 | blv->valcell = tem; | ||
| 1575 | SET_BLV_FOUND (blv, 0); | ||
| 1576 | return blv; | ||
| 1577 | } | ||
| 1578 | |||
| 1471 | DEFUN ("make-variable-buffer-local", Fmake_variable_buffer_local, Smake_variable_buffer_local, | 1579 | DEFUN ("make-variable-buffer-local", Fmake_variable_buffer_local, Smake_variable_buffer_local, |
| 1472 | 1, 1, "vMake Variable Buffer Local: ", | 1580 | 1, 1, "vMake Variable Buffer Local: ", |
| 1473 | doc: /* Make VARIABLE become buffer-local whenever it is set. | 1581 | doc: /* Make VARIABLE become buffer-local whenever it is set. |
| @@ -1485,42 +1593,58 @@ The function `default-value' gets the default value and `set-default' sets it. | |||
| 1485 | (variable) | 1593 | (variable) |
| 1486 | register Lisp_Object variable; | 1594 | register Lisp_Object variable; |
| 1487 | { | 1595 | { |
| 1488 | register Lisp_Object tem, valcontents, newval; | ||
| 1489 | struct Lisp_Symbol *sym; | 1596 | struct Lisp_Symbol *sym; |
| 1597 | struct Lisp_Buffer_Local_Value *blv = NULL; | ||
| 1598 | union Lisp_Val_Fwd valcontents; | ||
| 1599 | int forwarded; | ||
| 1490 | 1600 | ||
| 1491 | CHECK_SYMBOL (variable); | 1601 | CHECK_SYMBOL (variable); |
| 1492 | sym = indirect_variable (XSYMBOL (variable)); | 1602 | sym = XSYMBOL (variable); |
| 1493 | |||
| 1494 | valcontents = sym->value; | ||
| 1495 | if (sym->constant || KBOARD_OBJFWDP (valcontents)) | ||
| 1496 | error ("Symbol %s may not be buffer-local", SDATA (sym->xname)); | ||
| 1497 | 1603 | ||
| 1498 | if (BUFFER_OBJFWDP (valcontents)) | 1604 | start: |
| 1499 | return variable; | 1605 | switch (sym->redirect) |
| 1500 | else if (BUFFER_LOCAL_VALUEP (valcontents)) | ||
| 1501 | { | 1606 | { |
| 1502 | if (XBUFFER_LOCAL_VALUE (valcontents)->check_frame) | 1607 | case SYMBOL_VARALIAS: sym = indirect_variable (sym); goto start; |
| 1503 | error ("Symbol %s may not be buffer-local", SDATA (sym->xname)); | 1608 | case SYMBOL_PLAINVAL: |
| 1504 | newval = valcontents; | 1609 | forwarded = 0; valcontents.value = SYMBOL_VAL (sym); |
| 1610 | if (EQ (valcontents.value, Qunbound)) | ||
| 1611 | valcontents.value = Qnil; | ||
| 1612 | break; | ||
| 1613 | case SYMBOL_LOCALIZED: | ||
| 1614 | blv = SYMBOL_BLV (sym); | ||
| 1615 | if (blv->frame_local) | ||
| 1616 | error ("Symbol %s may not be buffer-local", | ||
| 1617 | SDATA (SYMBOL_NAME (variable))); | ||
| 1618 | break; | ||
| 1619 | case SYMBOL_FORWARDED: | ||
| 1620 | forwarded = 1; valcontents.fwd = SYMBOL_FWD (sym); | ||
| 1621 | if (KBOARD_OBJFWDP (valcontents.fwd)) | ||
| 1622 | error ("Symbol %s may not be buffer-local", | ||
| 1623 | SDATA (SYMBOL_NAME (variable))); | ||
| 1624 | else if (BUFFER_OBJFWDP (valcontents.fwd)) | ||
| 1625 | return variable; | ||
| 1626 | break; | ||
| 1627 | default: abort (); | ||
| 1505 | } | 1628 | } |
| 1506 | else | 1629 | |
| 1630 | if (sym->constant) | ||
| 1631 | error ("Symbol %s may not be buffer-local", SDATA (SYMBOL_NAME (variable))); | ||
| 1632 | |||
| 1633 | if (!blv) | ||
| 1507 | { | 1634 | { |
| 1508 | if (EQ (valcontents, Qunbound)) | 1635 | blv = make_blv (sym, forwarded, valcontents); |
| 1509 | sym->value = Qnil; | 1636 | sym->redirect = SYMBOL_LOCALIZED; |
| 1510 | tem = Fcons (Qnil, Fsymbol_value (variable)); | 1637 | SET_SYMBOL_BLV (sym, blv); |
| 1511 | XSETCAR (tem, tem); | 1638 | { |
| 1512 | newval = allocate_misc (); | 1639 | Lisp_Object symbol; |
| 1513 | XMISCTYPE (newval) = Lisp_Misc_Buffer_Local_Value; | 1640 | XSETSYMBOL (symbol, sym); /* In case `variable' is aliased. */ |
| 1514 | XBUFFER_LOCAL_VALUE (newval)->realvalue = sym->value; | 1641 | if (let_shadows_global_binding_p (symbol)) |
| 1515 | XBUFFER_LOCAL_VALUE (newval)->buffer = Fcurrent_buffer (); | 1642 | error ("Making %s buffer-local while let-bound!", |
| 1516 | XBUFFER_LOCAL_VALUE (newval)->frame = Qnil; | 1643 | SDATA (SYMBOL_NAME (variable))); |
| 1517 | XBUFFER_LOCAL_VALUE (newval)->found_for_buffer = 0; | 1644 | } |
| 1518 | XBUFFER_LOCAL_VALUE (newval)->found_for_frame = 0; | ||
| 1519 | XBUFFER_LOCAL_VALUE (newval)->check_frame = 0; | ||
| 1520 | XBUFFER_LOCAL_VALUE (newval)->cdr = tem; | ||
| 1521 | sym->value = newval; | ||
| 1522 | } | 1645 | } |
| 1523 | XBUFFER_LOCAL_VALUE (newval)->local_if_set = 1; | 1646 | |
| 1647 | blv->local_if_set = 1; | ||
| 1524 | return variable; | 1648 | return variable; |
| 1525 | } | 1649 | } |
| 1526 | 1650 | ||
| @@ -1547,82 +1671,95 @@ Instead, use `add-hook' and specify t for the LOCAL argument. */) | |||
| 1547 | (variable) | 1671 | (variable) |
| 1548 | register Lisp_Object variable; | 1672 | register Lisp_Object variable; |
| 1549 | { | 1673 | { |
| 1550 | register Lisp_Object tem, valcontents; | 1674 | register Lisp_Object tem; |
| 1675 | int forwarded; | ||
| 1676 | union Lisp_Val_Fwd valcontents; | ||
| 1551 | struct Lisp_Symbol *sym; | 1677 | struct Lisp_Symbol *sym; |
| 1678 | struct Lisp_Buffer_Local_Value *blv = NULL; | ||
| 1552 | 1679 | ||
| 1553 | CHECK_SYMBOL (variable); | 1680 | CHECK_SYMBOL (variable); |
| 1554 | sym = indirect_variable (XSYMBOL (variable)); | 1681 | sym = XSYMBOL (variable); |
| 1555 | 1682 | ||
| 1556 | valcontents = sym->value; | 1683 | start: |
| 1557 | if (sym->constant || KBOARD_OBJFWDP (valcontents) | 1684 | switch (sym->redirect) |
| 1558 | || (BUFFER_LOCAL_VALUEP (valcontents) | 1685 | { |
| 1559 | && (XBUFFER_LOCAL_VALUE (valcontents)->check_frame))) | 1686 | case SYMBOL_VARALIAS: sym = indirect_variable (sym); goto start; |
| 1560 | error ("Symbol %s may not be buffer-local", SDATA (sym->xname)); | 1687 | case SYMBOL_PLAINVAL: |
| 1688 | forwarded = 0; valcontents.value = SYMBOL_VAL (sym); break; | ||
| 1689 | case SYMBOL_LOCALIZED: | ||
| 1690 | blv = SYMBOL_BLV (sym); | ||
| 1691 | if (blv->frame_local) | ||
| 1692 | error ("Symbol %s may not be buffer-local", | ||
| 1693 | SDATA (SYMBOL_NAME (variable))); | ||
| 1694 | break; | ||
| 1695 | case SYMBOL_FORWARDED: | ||
| 1696 | forwarded = 1; valcontents.fwd = SYMBOL_FWD (sym); | ||
| 1697 | if (KBOARD_OBJFWDP (valcontents.fwd)) | ||
| 1698 | error ("Symbol %s may not be buffer-local", | ||
| 1699 | SDATA (SYMBOL_NAME (variable))); | ||
| 1700 | break; | ||
| 1701 | default: abort (); | ||
| 1702 | } | ||
| 1561 | 1703 | ||
| 1562 | if ((BUFFER_LOCAL_VALUEP (valcontents) | 1704 | if (sym->constant) |
| 1563 | && XBUFFER_LOCAL_VALUE (valcontents)->local_if_set) | 1705 | error ("Symbol %s may not be buffer-local", SDATA (SYMBOL_NAME (variable))); |
| 1564 | || BUFFER_OBJFWDP (valcontents)) | 1706 | |
| 1707 | if (blv ? blv->local_if_set | ||
| 1708 | : (forwarded && BUFFER_OBJFWDP (valcontents.fwd))) | ||
| 1565 | { | 1709 | { |
| 1566 | tem = Fboundp (variable); | 1710 | tem = Fboundp (variable); |
| 1567 | |||
| 1568 | /* Make sure the symbol has a local value in this particular buffer, | 1711 | /* Make sure the symbol has a local value in this particular buffer, |
| 1569 | by setting it to the same value it already has. */ | 1712 | by setting it to the same value it already has. */ |
| 1570 | Fset (variable, (EQ (tem, Qt) ? Fsymbol_value (variable) : Qunbound)); | 1713 | Fset (variable, (EQ (tem, Qt) ? Fsymbol_value (variable) : Qunbound)); |
| 1571 | return variable; | 1714 | return variable; |
| 1572 | } | 1715 | } |
| 1573 | /* Make sure symbol is set up to hold per-buffer values. */ | 1716 | if (!blv) |
| 1574 | if (!BUFFER_LOCAL_VALUEP (valcontents)) | ||
| 1575 | { | 1717 | { |
| 1576 | Lisp_Object newval; | 1718 | blv = make_blv (sym, forwarded, valcontents); |
| 1577 | tem = Fcons (Qnil, do_symval_forwarding (valcontents)); | 1719 | sym->redirect = SYMBOL_LOCALIZED; |
| 1578 | XSETCAR (tem, tem); | 1720 | SET_SYMBOL_BLV (sym, blv); |
| 1579 | newval = allocate_misc (); | 1721 | { |
| 1580 | XMISCTYPE (newval) = Lisp_Misc_Buffer_Local_Value; | 1722 | Lisp_Object symbol; |
| 1581 | XBUFFER_LOCAL_VALUE (newval)->realvalue = sym->value; | 1723 | XSETSYMBOL (symbol, sym); /* In case `variable' is aliased. */ |
| 1582 | XBUFFER_LOCAL_VALUE (newval)->buffer = Qnil; | 1724 | if (let_shadows_global_binding_p (symbol)) |
| 1583 | XBUFFER_LOCAL_VALUE (newval)->frame = Qnil; | 1725 | error ("Making %s local to %s while let-bound!", |
| 1584 | XBUFFER_LOCAL_VALUE (newval)->local_if_set = 0; | 1726 | SDATA (SYMBOL_NAME (variable)), SDATA (current_buffer->name)); |
| 1585 | XBUFFER_LOCAL_VALUE (newval)->found_for_buffer = 0; | 1727 | } |
| 1586 | XBUFFER_LOCAL_VALUE (newval)->found_for_frame = 0; | ||
| 1587 | XBUFFER_LOCAL_VALUE (newval)->check_frame = 0; | ||
| 1588 | XBUFFER_LOCAL_VALUE (newval)->cdr = tem; | ||
| 1589 | sym->value = newval; | ||
| 1590 | } | 1728 | } |
| 1729 | |||
| 1591 | /* Make sure this buffer has its own value of symbol. */ | 1730 | /* Make sure this buffer has its own value of symbol. */ |
| 1592 | XSETSYMBOL (variable, sym); /* Propagate variable indirections. */ | 1731 | XSETSYMBOL (variable, sym); /* Update in case of aliasing. */ |
| 1593 | tem = Fassq (variable, current_buffer->local_var_alist); | 1732 | tem = Fassq (variable, current_buffer->local_var_alist); |
| 1594 | if (NILP (tem)) | 1733 | if (NILP (tem)) |
| 1595 | { | 1734 | { |
| 1735 | if (let_shadows_buffer_binding_p (sym)) | ||
| 1736 | message ("Making %s buffer-local while locally let-bound!", | ||
| 1737 | SDATA (SYMBOL_NAME (variable))); | ||
| 1738 | |||
| 1596 | /* Swap out any local binding for some other buffer, and make | 1739 | /* Swap out any local binding for some other buffer, and make |
| 1597 | sure the current value is permanently recorded, if it's the | 1740 | sure the current value is permanently recorded, if it's the |
| 1598 | default value. */ | 1741 | default value. */ |
| 1599 | find_symbol_value (variable); | 1742 | find_symbol_value (variable); |
| 1600 | 1743 | ||
| 1601 | current_buffer->local_var_alist | 1744 | current_buffer->local_var_alist |
| 1602 | = Fcons (Fcons (variable, XCDR (XBUFFER_LOCAL_VALUE (sym->value)->cdr)), | 1745 | = Fcons (Fcons (variable, XCDR (blv->defcell)), |
| 1603 | current_buffer->local_var_alist); | 1746 | current_buffer->local_var_alist); |
| 1604 | 1747 | ||
| 1605 | /* Make sure symbol does not think it is set up for this buffer; | 1748 | /* Make sure symbol does not think it is set up for this buffer; |
| 1606 | force it to look once again for this buffer's value. */ | 1749 | force it to look once again for this buffer's value. */ |
| 1607 | { | 1750 | if (current_buffer == XBUFFER (blv->where)) |
| 1608 | Lisp_Object *pvalbuf; | 1751 | blv->where = Qnil; |
| 1609 | 1752 | /* blv->valcell = blv->defcell; | |
| 1610 | valcontents = sym->value; | 1753 | * SET_BLV_FOUND (blv, 0); */ |
| 1611 | 1754 | blv->found = 0; | |
| 1612 | pvalbuf = &XBUFFER_LOCAL_VALUE (valcontents)->buffer; | ||
| 1613 | if (current_buffer == XBUFFER (*pvalbuf)) | ||
| 1614 | *pvalbuf = Qnil; | ||
| 1615 | XBUFFER_LOCAL_VALUE (valcontents)->found_for_buffer = 0; | ||
| 1616 | } | ||
| 1617 | } | 1755 | } |
| 1618 | 1756 | ||
| 1619 | /* If the symbol forwards into a C variable, then load the binding | 1757 | /* If the symbol forwards into a C variable, then load the binding |
| 1620 | for this buffer now. If C code modifies the variable before we | 1758 | for this buffer now. If C code modifies the variable before we |
| 1621 | load the binding in, then that new value will clobber the default | 1759 | load the binding in, then that new value will clobber the default |
| 1622 | binding the next time we unload it. */ | 1760 | binding the next time we unload it. */ |
| 1623 | valcontents = XBUFFER_LOCAL_VALUE (sym->value)->realvalue; | 1761 | if (blv->fwd) |
| 1624 | if (INTFWDP (valcontents) || BOOLFWDP (valcontents) || OBJFWDP (valcontents)) | 1762 | swap_in_symval_forwarding (sym, blv); |
| 1625 | swap_in_symval_forwarding (variable, sym->value); | ||
| 1626 | 1763 | ||
| 1627 | return variable; | 1764 | return variable; |
| 1628 | } | 1765 | } |
| @@ -1634,31 +1771,43 @@ From now on the default value will apply in this buffer. Return VARIABLE. */) | |||
| 1634 | (variable) | 1771 | (variable) |
| 1635 | register Lisp_Object variable; | 1772 | register Lisp_Object variable; |
| 1636 | { | 1773 | { |
| 1637 | register Lisp_Object tem, valcontents; | 1774 | register Lisp_Object tem; |
| 1775 | struct Lisp_Buffer_Local_Value *blv; | ||
| 1638 | struct Lisp_Symbol *sym; | 1776 | struct Lisp_Symbol *sym; |
| 1639 | 1777 | ||
| 1640 | CHECK_SYMBOL (variable); | 1778 | CHECK_SYMBOL (variable); |
| 1641 | sym = indirect_variable (XSYMBOL (variable)); | 1779 | sym = XSYMBOL (variable); |
| 1642 | |||
| 1643 | valcontents = sym->value; | ||
| 1644 | 1780 | ||
| 1645 | if (BUFFER_OBJFWDP (valcontents)) | 1781 | start: |
| 1782 | switch (sym->redirect) | ||
| 1646 | { | 1783 | { |
| 1647 | int offset = XBUFFER_OBJFWD (valcontents)->offset; | 1784 | case SYMBOL_VARALIAS: sym = indirect_variable (sym); goto start; |
| 1648 | int idx = PER_BUFFER_IDX (offset); | 1785 | case SYMBOL_PLAINVAL: return variable; |
| 1649 | 1786 | case SYMBOL_FORWARDED: | |
| 1650 | if (idx > 0) | 1787 | { |
| 1651 | { | 1788 | union Lisp_Fwd *valcontents = SYMBOL_FWD (sym); |
| 1652 | SET_PER_BUFFER_VALUE_P (current_buffer, idx, 0); | 1789 | if (BUFFER_OBJFWDP (valcontents)) |
| 1653 | PER_BUFFER_VALUE (current_buffer, offset) | 1790 | { |
| 1654 | = PER_BUFFER_DEFAULT (offset); | 1791 | int offset = XBUFFER_OBJFWD (valcontents)->offset; |
| 1655 | } | 1792 | int idx = PER_BUFFER_IDX (offset); |
| 1656 | return variable; | 1793 | |
| 1794 | if (idx > 0) | ||
| 1795 | { | ||
| 1796 | SET_PER_BUFFER_VALUE_P (current_buffer, idx, 0); | ||
| 1797 | PER_BUFFER_VALUE (current_buffer, offset) | ||
| 1798 | = PER_BUFFER_DEFAULT (offset); | ||
| 1799 | } | ||
| 1800 | } | ||
| 1801 | return variable; | ||
| 1802 | } | ||
| 1803 | case SYMBOL_LOCALIZED: | ||
| 1804 | blv = SYMBOL_BLV (sym); | ||
| 1805 | if (blv->frame_local) | ||
| 1806 | return variable; | ||
| 1807 | break; | ||
| 1808 | default: abort (); | ||
| 1657 | } | 1809 | } |
| 1658 | 1810 | ||
| 1659 | if (!BUFFER_LOCAL_VALUEP (valcontents)) | ||
| 1660 | return variable; | ||
| 1661 | |||
| 1662 | /* Get rid of this buffer's alist element, if any. */ | 1811 | /* Get rid of this buffer's alist element, if any. */ |
| 1663 | XSETSYMBOL (variable, sym); /* Propagate variable indirection. */ | 1812 | XSETSYMBOL (variable, sym); /* Propagate variable indirection. */ |
| 1664 | tem = Fassq (variable, current_buffer->local_var_alist); | 1813 | tem = Fassq (variable, current_buffer->local_var_alist); |
| @@ -1670,14 +1819,13 @@ From now on the default value will apply in this buffer. Return VARIABLE. */) | |||
| 1670 | loaded, recompute its value. We have to do it now, or else | 1819 | loaded, recompute its value. We have to do it now, or else |
| 1671 | forwarded objects won't work right. */ | 1820 | forwarded objects won't work right. */ |
| 1672 | { | 1821 | { |
| 1673 | Lisp_Object *pvalbuf, buf; | 1822 | Lisp_Object buf; XSETBUFFER (buf, current_buffer); |
| 1674 | valcontents = sym->value; | 1823 | if (EQ (buf, blv->where)) |
| 1675 | pvalbuf = &XBUFFER_LOCAL_VALUE (valcontents)->buffer; | ||
| 1676 | XSETBUFFER (buf, current_buffer); | ||
| 1677 | if (EQ (buf, *pvalbuf)) | ||
| 1678 | { | 1824 | { |
| 1679 | *pvalbuf = Qnil; | 1825 | blv->where = Qnil; |
| 1680 | XBUFFER_LOCAL_VALUE (valcontents)->found_for_buffer = 0; | 1826 | /* blv->valcell = blv->defcell; |
| 1827 | * SET_BLV_FOUND (blv, 0); */ | ||
| 1828 | blv->found = 0; | ||
| 1681 | find_symbol_value (variable); | 1829 | find_symbol_value (variable); |
| 1682 | } | 1830 | } |
| 1683 | } | 1831 | } |
| @@ -1712,39 +1860,45 @@ frame-local bindings). */) | |||
| 1712 | (variable) | 1860 | (variable) |
| 1713 | register Lisp_Object variable; | 1861 | register Lisp_Object variable; |
| 1714 | { | 1862 | { |
| 1715 | register Lisp_Object tem, valcontents, newval; | 1863 | int forwarded; |
| 1864 | union Lisp_Val_Fwd valcontents; | ||
| 1716 | struct Lisp_Symbol *sym; | 1865 | struct Lisp_Symbol *sym; |
| 1866 | struct Lisp_Buffer_Local_Value *blv = NULL; | ||
| 1717 | 1867 | ||
| 1718 | CHECK_SYMBOL (variable); | 1868 | CHECK_SYMBOL (variable); |
| 1719 | sym = indirect_variable (XSYMBOL (variable)); | 1869 | sym = XSYMBOL (variable); |
| 1720 | |||
| 1721 | valcontents = sym->value; | ||
| 1722 | if (sym->constant || KBOARD_OBJFWDP (valcontents) | ||
| 1723 | || BUFFER_OBJFWDP (valcontents)) | ||
| 1724 | error ("Symbol %s may not be frame-local", SDATA (sym->xname)); | ||
| 1725 | 1870 | ||
| 1726 | if (BUFFER_LOCAL_VALUEP (valcontents)) | 1871 | start: |
| 1872 | switch (sym->redirect) | ||
| 1727 | { | 1873 | { |
| 1728 | if (!XBUFFER_LOCAL_VALUE (valcontents)->check_frame) | 1874 | case SYMBOL_VARALIAS: sym = indirect_variable (sym); goto start; |
| 1729 | error ("Symbol %s may not be frame-local", SDATA (sym->xname)); | 1875 | case SYMBOL_PLAINVAL: |
| 1730 | return variable; | 1876 | forwarded = 0; valcontents.value = SYMBOL_VAL (sym); |
| 1877 | if (EQ (valcontents.value, Qunbound)) | ||
| 1878 | valcontents.value = Qnil; | ||
| 1879 | break; | ||
| 1880 | case SYMBOL_LOCALIZED: | ||
| 1881 | if (SYMBOL_BLV (sym)->frame_local) | ||
| 1882 | return variable; | ||
| 1883 | else | ||
| 1884 | error ("Symbol %s may not be frame-local", | ||
| 1885 | SDATA (SYMBOL_NAME (variable))); | ||
| 1886 | case SYMBOL_FORWARDED: | ||
| 1887 | forwarded = 1; valcontents.fwd = SYMBOL_FWD (sym); | ||
| 1888 | if (KBOARD_OBJFWDP (valcontents.fwd) || BUFFER_OBJFWDP (valcontents.fwd)) | ||
| 1889 | error ("Symbol %s may not be frame-local", | ||
| 1890 | SDATA (SYMBOL_NAME (variable))); | ||
| 1891 | break; | ||
| 1892 | default: abort (); | ||
| 1731 | } | 1893 | } |
| 1732 | 1894 | ||
| 1733 | if (EQ (valcontents, Qunbound)) | 1895 | if (sym->constant) |
| 1734 | sym->value = Qnil; | 1896 | error ("Symbol %s may not be frame-local", SDATA (SYMBOL_NAME (variable))); |
| 1735 | tem = Fcons (Qnil, Fsymbol_value (variable)); | 1897 | |
| 1736 | XSETCAR (tem, tem); | 1898 | blv = make_blv (sym, forwarded, valcontents); |
| 1737 | newval = allocate_misc (); | 1899 | blv->frame_local = 1; |
| 1738 | XMISCTYPE (newval) = Lisp_Misc_Buffer_Local_Value; | 1900 | sym->redirect = SYMBOL_LOCALIZED; |
| 1739 | XBUFFER_LOCAL_VALUE (newval)->realvalue = sym->value; | 1901 | SET_SYMBOL_BLV (sym, blv); |
| 1740 | XBUFFER_LOCAL_VALUE (newval)->buffer = Qnil; | ||
| 1741 | XBUFFER_LOCAL_VALUE (newval)->frame = Qnil; | ||
| 1742 | XBUFFER_LOCAL_VALUE (newval)->local_if_set = 0; | ||
| 1743 | XBUFFER_LOCAL_VALUE (newval)->found_for_buffer = 0; | ||
| 1744 | XBUFFER_LOCAL_VALUE (newval)->found_for_frame = 0; | ||
| 1745 | XBUFFER_LOCAL_VALUE (newval)->check_frame = 1; | ||
| 1746 | XBUFFER_LOCAL_VALUE (newval)->cdr = tem; | ||
| 1747 | sym->value = newval; | ||
| 1748 | return variable; | 1902 | return variable; |
| 1749 | } | 1903 | } |
| 1750 | 1904 | ||
| @@ -1755,7 +1909,6 @@ BUFFER defaults to the current buffer. */) | |||
| 1755 | (variable, buffer) | 1909 | (variable, buffer) |
| 1756 | register Lisp_Object variable, buffer; | 1910 | register Lisp_Object variable, buffer; |
| 1757 | { | 1911 | { |
| 1758 | Lisp_Object valcontents; | ||
| 1759 | register struct buffer *buf; | 1912 | register struct buffer *buf; |
| 1760 | struct Lisp_Symbol *sym; | 1913 | struct Lisp_Symbol *sym; |
| 1761 | 1914 | ||
| @@ -1768,29 +1921,46 @@ BUFFER defaults to the current buffer. */) | |||
| 1768 | } | 1921 | } |
| 1769 | 1922 | ||
| 1770 | CHECK_SYMBOL (variable); | 1923 | CHECK_SYMBOL (variable); |
| 1771 | sym = indirect_variable (XSYMBOL (variable)); | 1924 | sym = XSYMBOL (variable); |
| 1772 | XSETSYMBOL (variable, sym); | ||
| 1773 | |||
| 1774 | valcontents = sym->value; | ||
| 1775 | if (BUFFER_LOCAL_VALUEP (valcontents)) | ||
| 1776 | { | ||
| 1777 | Lisp_Object tail, elt; | ||
| 1778 | 1925 | ||
| 1779 | for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail)) | 1926 | start: |
| 1780 | { | 1927 | switch (sym->redirect) |
| 1781 | elt = XCAR (tail); | ||
| 1782 | if (EQ (variable, XCAR (elt))) | ||
| 1783 | return Qt; | ||
| 1784 | } | ||
| 1785 | } | ||
| 1786 | if (BUFFER_OBJFWDP (valcontents)) | ||
| 1787 | { | 1928 | { |
| 1788 | int offset = XBUFFER_OBJFWD (valcontents)->offset; | 1929 | case SYMBOL_VARALIAS: sym = indirect_variable (sym); goto start; |
| 1789 | int idx = PER_BUFFER_IDX (offset); | 1930 | case SYMBOL_PLAINVAL: return Qnil; |
| 1790 | if (idx == -1 || PER_BUFFER_VALUE_P (buf, idx)) | 1931 | case SYMBOL_LOCALIZED: |
| 1791 | return Qt; | 1932 | { |
| 1933 | Lisp_Object tail, elt, tmp; | ||
| 1934 | struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym); | ||
| 1935 | XSETBUFFER (tmp, buf); | ||
| 1936 | |||
| 1937 | for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail)) | ||
| 1938 | { | ||
| 1939 | elt = XCAR (tail); | ||
| 1940 | if (EQ (variable, XCAR (elt))) | ||
| 1941 | { | ||
| 1942 | eassert (!blv->frame_local); | ||
| 1943 | eassert (BLV_FOUND (blv) || !EQ (blv->where, tmp)); | ||
| 1944 | return Qt; | ||
| 1945 | } | ||
| 1946 | } | ||
| 1947 | eassert (!BLV_FOUND (blv) || !EQ (blv->where, tmp)); | ||
| 1948 | return Qnil; | ||
| 1949 | } | ||
| 1950 | case SYMBOL_FORWARDED: | ||
| 1951 | { | ||
| 1952 | union Lisp_Fwd *valcontents = SYMBOL_FWD (sym); | ||
| 1953 | if (BUFFER_OBJFWDP (valcontents)) | ||
| 1954 | { | ||
| 1955 | int offset = XBUFFER_OBJFWD (valcontents)->offset; | ||
| 1956 | int idx = PER_BUFFER_IDX (offset); | ||
| 1957 | if (idx == -1 || PER_BUFFER_VALUE_P (buf, idx)) | ||
| 1958 | return Qt; | ||
| 1959 | } | ||
| 1960 | return Qnil; | ||
| 1961 | } | ||
| 1962 | default: abort (); | ||
| 1792 | } | 1963 | } |
| 1793 | return Qnil; | ||
| 1794 | } | 1964 | } |
| 1795 | 1965 | ||
| 1796 | DEFUN ("local-variable-if-set-p", Flocal_variable_if_set_p, Slocal_variable_if_set_p, | 1966 | DEFUN ("local-variable-if-set-p", Flocal_variable_if_set_p, Slocal_variable_if_set_p, |
| @@ -1804,40 +1974,29 @@ BUFFER defaults to the current buffer. */) | |||
| 1804 | (variable, buffer) | 1974 | (variable, buffer) |
| 1805 | register Lisp_Object variable, buffer; | 1975 | register Lisp_Object variable, buffer; |
| 1806 | { | 1976 | { |
| 1807 | Lisp_Object valcontents; | ||
| 1808 | register struct buffer *buf; | ||
| 1809 | struct Lisp_Symbol *sym; | 1977 | struct Lisp_Symbol *sym; |
| 1810 | 1978 | ||
| 1811 | if (NILP (buffer)) | ||
| 1812 | buf = current_buffer; | ||
| 1813 | else | ||
| 1814 | { | ||
| 1815 | CHECK_BUFFER (buffer); | ||
| 1816 | buf = XBUFFER (buffer); | ||
| 1817 | } | ||
| 1818 | |||
| 1819 | CHECK_SYMBOL (variable); | 1979 | CHECK_SYMBOL (variable); |
| 1820 | sym = indirect_variable (XSYMBOL (variable)); | 1980 | sym = XSYMBOL (variable); |
| 1821 | XSETSYMBOL (variable, sym); | ||
| 1822 | |||
| 1823 | valcontents = sym->value; | ||
| 1824 | 1981 | ||
| 1825 | if (BUFFER_OBJFWDP (valcontents)) | 1982 | start: |
| 1826 | /* All these slots become local if they are set. */ | 1983 | switch (sym->redirect) |
| 1827 | return Qt; | ||
| 1828 | else if (BUFFER_LOCAL_VALUEP (valcontents)) | ||
| 1829 | { | 1984 | { |
| 1830 | Lisp_Object tail, elt; | 1985 | case SYMBOL_VARALIAS: sym = indirect_variable (sym); goto start; |
| 1831 | if (XBUFFER_LOCAL_VALUE (valcontents)->local_if_set) | 1986 | case SYMBOL_PLAINVAL: return Qnil; |
| 1832 | return Qt; | 1987 | case SYMBOL_LOCALIZED: |
| 1833 | for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail)) | 1988 | { |
| 1834 | { | 1989 | struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym); |
| 1835 | elt = XCAR (tail); | 1990 | if (blv->local_if_set) |
| 1836 | if (EQ (variable, XCAR (elt))) | 1991 | return Qt; |
| 1837 | return Qt; | 1992 | XSETSYMBOL (variable, sym); /* Update in case of aliasing. */ |
| 1838 | } | 1993 | return Flocal_variable_p (variable, buffer); |
| 1994 | } | ||
| 1995 | case SYMBOL_FORWARDED: | ||
| 1996 | /* All BUFFER_OBJFWD slots become local if they are set. */ | ||
| 1997 | return (BUFFER_OBJFWDP (SYMBOL_FWD (sym)) ? Qt : Qnil); | ||
| 1998 | default: abort (); | ||
| 1839 | } | 1999 | } |
| 1840 | return Qnil; | ||
| 1841 | } | 2000 | } |
| 1842 | 2001 | ||
| 1843 | DEFUN ("variable-binding-locus", Fvariable_binding_locus, Svariable_binding_locus, | 2002 | DEFUN ("variable-binding-locus", Fvariable_binding_locus, Svariable_binding_locus, |
| @@ -1849,30 +2008,40 @@ If the current binding is global (the default), the value is nil. */) | |||
| 1849 | (variable) | 2008 | (variable) |
| 1850 | register Lisp_Object variable; | 2009 | register Lisp_Object variable; |
| 1851 | { | 2010 | { |
| 1852 | Lisp_Object valcontents; | ||
| 1853 | struct Lisp_Symbol *sym; | 2011 | struct Lisp_Symbol *sym; |
| 1854 | 2012 | ||
| 1855 | CHECK_SYMBOL (variable); | 2013 | CHECK_SYMBOL (variable); |
| 1856 | sym = indirect_variable (XSYMBOL (variable)); | 2014 | sym = XSYMBOL (variable); |
| 1857 | 2015 | ||
| 1858 | /* Make sure the current binding is actually swapped in. */ | 2016 | /* Make sure the current binding is actually swapped in. */ |
| 1859 | find_symbol_value (variable); | 2017 | find_symbol_value (variable); |
| 1860 | 2018 | ||
| 1861 | valcontents = sym->value; | 2019 | start: |
| 1862 | 2020 | switch (sym->redirect) | |
| 1863 | if (BUFFER_LOCAL_VALUEP (valcontents) | ||
| 1864 | || BUFFER_OBJFWDP (valcontents)) | ||
| 1865 | { | 2021 | { |
| 2022 | case SYMBOL_VARALIAS: sym = indirect_variable (sym); goto start; | ||
| 2023 | case SYMBOL_PLAINVAL: return Qnil; | ||
| 2024 | case SYMBOL_FORWARDED: | ||
| 2025 | { | ||
| 2026 | union Lisp_Fwd *valcontents = SYMBOL_FWD (sym); | ||
| 2027 | if (KBOARD_OBJFWDP (valcontents)) | ||
| 2028 | return Fframe_terminal (Fselected_frame ()); | ||
| 2029 | else if (!BUFFER_OBJFWDP (valcontents)) | ||
| 2030 | return Qnil; | ||
| 2031 | } | ||
| 2032 | /* FALLTHROUGH */ | ||
| 2033 | case SYMBOL_LOCALIZED: | ||
| 1866 | /* For a local variable, record both the symbol and which | 2034 | /* For a local variable, record both the symbol and which |
| 1867 | buffer's or frame's value we are saving. */ | 2035 | buffer's or frame's value we are saving. */ |
| 1868 | if (!NILP (Flocal_variable_p (variable, Qnil))) | 2036 | if (!NILP (Flocal_variable_p (variable, Qnil))) |
| 1869 | return Fcurrent_buffer (); | 2037 | return Fcurrent_buffer (); |
| 1870 | else if (BUFFER_LOCAL_VALUEP (valcontents) | 2038 | else if (sym->redirect == SYMBOL_LOCALIZED |
| 1871 | && XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame) | 2039 | && BLV_FOUND (SYMBOL_BLV (sym))) |
| 1872 | return XBUFFER_LOCAL_VALUE (valcontents)->frame; | 2040 | return SYMBOL_BLV (sym)->where; |
| 2041 | else | ||
| 2042 | return Qnil; | ||
| 2043 | default: abort (); | ||
| 1873 | } | 2044 | } |
| 1874 | |||
| 1875 | return Qnil; | ||
| 1876 | } | 2045 | } |
| 1877 | 2046 | ||
| 1878 | /* This code is disabled now that we use the selected frame to return | 2047 | /* This code is disabled now that we use the selected frame to return |
diff --git a/src/dired.c b/src/dired.c index 2240f6ec76e..a3ea23df2f6 100644 --- a/src/dired.c +++ b/src/dired.c | |||
| @@ -935,9 +935,9 @@ DEFUN ("file-attributes", Ffile_attributes, Sfile_attributes, 1, 2, 0, | |||
| 935 | Value is nil if specified file cannot be opened. | 935 | Value is nil if specified file cannot be opened. |
| 936 | 936 | ||
| 937 | ID-FORMAT specifies the preferred format of attributes uid and gid (see | 937 | ID-FORMAT specifies the preferred format of attributes uid and gid (see |
| 938 | below) - valid values are 'string and 'integer. The latter is the default, | 938 | below) - valid values are 'string and 'integer. The latter is the |
| 939 | but we plan to change that, so you should specify a non-nil value for | 939 | default, but we plan to change that, so you should specify a non-nil value |
| 940 | ID-FORMAT if you use the returned uid or gid. | 940 | for ID-FORMAT if you use the returned uid or gid. |
| 941 | 941 | ||
| 942 | Elements of the attribute list are: | 942 | Elements of the attribute list are: |
| 943 | 0. t for directory, string (name linked to) for symbolic link, or nil. | 943 | 0. t for directory, string (name linked to) for symbolic link, or nil. |
diff --git a/src/dispextern.h b/src/dispextern.h index 00da256c43e..b0a072f71f8 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -2222,13 +2222,22 @@ struct it | |||
| 2222 | MODE_LINE_FACE_ID, etc, depending on what we are displaying. */ | 2222 | MODE_LINE_FACE_ID, etc, depending on what we are displaying. */ |
| 2223 | int base_face_id; | 2223 | int base_face_id; |
| 2224 | 2224 | ||
| 2225 | /* If what == IT_CHARACTER, character and length in bytes. This is | 2225 | /* If `what' == IT_CHARACTER, the character and the length in bytes |
| 2226 | a character from a buffer or string. It may be different from | 2226 | of its multibyte sequence. The character comes from a buffer or |
| 2227 | the character displayed in case that | 2227 | a string. It may be different from the character displayed in |
| 2228 | unibyte_display_via_language_environment is set. | 2228 | case that unibyte_display_via_language_environment is set. |
| 2229 | 2229 | ||
| 2230 | If what == IT_COMPOSITION, the first component of a composition | 2230 | If `what' == IT_COMPOSITION, the first component of a composition |
| 2231 | and length in bytes of the composition. */ | 2231 | and length in bytes of the composition. |
| 2232 | |||
| 2233 | If `what' is anything else, these tow are undefined (will | ||
| 2234 | probably hold values for the last IT_CHARACTER or IT_COMPOSITION | ||
| 2235 | traversed by the iterator. | ||
| 2236 | |||
| 2237 | The values are updated by get_next_display_element, so they are | ||
| 2238 | out of sync with the value returned by IT_CHARPOS between the | ||
| 2239 | time set_iterator_to_next advances the position and the time | ||
| 2240 | get_next_display_element loads the new values into c and len. */ | ||
| 2232 | int c, len; | 2241 | int c, len; |
| 2233 | 2242 | ||
| 2234 | /* If what == IT_COMPOSITION, iterator substructure for the | 2243 | /* If what == IT_COMPOSITION, iterator substructure for the |
diff --git a/src/eval.c b/src/eval.c index 6609d3b5c8a..cb1d435cb8b 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -767,24 +767,46 @@ The return value is BASE-VARIABLE. */) | |||
| 767 | CHECK_SYMBOL (new_alias); | 767 | CHECK_SYMBOL (new_alias); |
| 768 | CHECK_SYMBOL (base_variable); | 768 | CHECK_SYMBOL (base_variable); |
| 769 | 769 | ||
| 770 | if (SYMBOL_CONSTANT_P (new_alias)) | ||
| 771 | error ("Cannot make a constant an alias"); | ||
| 772 | |||
| 773 | sym = XSYMBOL (new_alias); | 770 | sym = XSYMBOL (new_alias); |
| 771 | |||
| 772 | if (sym->constant) | ||
| 773 | if (sym->redirect == SYMBOL_VARALIAS) | ||
| 774 | sym->constant = 0; /* Reset. */ | ||
| 775 | else | ||
| 776 | /* Not sure why. */ | ||
| 777 | error ("Cannot make a constant an alias"); | ||
| 778 | |||
| 779 | switch (sym->redirect) | ||
| 780 | { | ||
| 781 | case SYMBOL_FORWARDED: | ||
| 782 | error ("Cannot make an internal variable an alias"); | ||
| 783 | case SYMBOL_LOCALIZED: | ||
| 784 | error ("Don't know how to make a localized variable an alias"); | ||
| 785 | } | ||
| 786 | |||
| 774 | /* http://lists.gnu.org/archive/html/emacs-devel/2008-04/msg00834.html | 787 | /* http://lists.gnu.org/archive/html/emacs-devel/2008-04/msg00834.html |
| 775 | If n_a is bound, but b_v is not, set the value of b_v to n_a. | 788 | If n_a is bound, but b_v is not, set the value of b_v to n_a, |
| 776 | This is for the sake of define-obsolete-variable-alias and user | 789 | so that old-code that affects n_a before the aliasing is setup |
| 777 | customizations. */ | 790 | still works. */ |
| 778 | if (NILP (Fboundp (base_variable)) && !NILP (Fboundp (new_alias))) | 791 | if (NILP (Fboundp (base_variable))) |
| 779 | XSYMBOL(base_variable)->value = sym->value; | 792 | set_internal (base_variable, find_symbol_value (new_alias), NULL, 1); |
| 780 | sym->indirect_variable = 1; | 793 | |
| 781 | sym->value = base_variable; | 794 | { |
| 795 | struct specbinding *p; | ||
| 796 | |||
| 797 | for (p = specpdl_ptr - 1; p >= specpdl; p--) | ||
| 798 | if (p->func == NULL | ||
| 799 | && (EQ (new_alias, | ||
| 800 | CONSP (p->symbol) ? XCAR (p->symbol) : p->symbol))) | ||
| 801 | error ("Don't know how to make a let-bound variable an alias"); | ||
| 802 | } | ||
| 803 | |||
| 804 | sym->redirect = SYMBOL_VARALIAS; | ||
| 805 | SET_SYMBOL_ALIAS (sym, XSYMBOL (base_variable)); | ||
| 782 | sym->constant = SYMBOL_CONSTANT_P (base_variable); | 806 | sym->constant = SYMBOL_CONSTANT_P (base_variable); |
| 783 | LOADHIST_ATTACH (new_alias); | 807 | LOADHIST_ATTACH (new_alias); |
| 784 | if (!NILP (docstring)) | 808 | /* Even if docstring is nil: remove old docstring. */ |
| 785 | Fput (new_alias, Qvariable_documentation, docstring); | 809 | Fput (new_alias, Qvariable_documentation, docstring); |
| 786 | else | ||
| 787 | Fput (new_alias, Qvariable_documentation, Qnil); | ||
| 788 | 810 | ||
| 789 | return base_variable; | 811 | return base_variable; |
| 790 | } | 812 | } |
| @@ -944,7 +966,7 @@ chain of symbols. */) | |||
| 944 | return Qnil; | 966 | return Qnil; |
| 945 | 967 | ||
| 946 | /* If indirect and there's an alias loop, don't check anything else. */ | 968 | /* If indirect and there's an alias loop, don't check anything else. */ |
| 947 | if (XSYMBOL (variable)->indirect_variable | 969 | if (XSYMBOL (variable)->redirect == SYMBOL_VARALIAS |
| 948 | && NILP (internal_condition_case_1 (lisp_indirect_variable, variable, | 970 | && NILP (internal_condition_case_1 (lisp_indirect_variable, variable, |
| 949 | Qt, user_variable_p_eh))) | 971 | Qt, user_variable_p_eh))) |
| 950 | return Qnil; | 972 | return Qnil; |
| @@ -968,11 +990,11 @@ chain of symbols. */) | |||
| 968 | || (!NILP (Fget (variable, intern ("custom-autoload"))))) | 990 | || (!NILP (Fget (variable, intern ("custom-autoload"))))) |
| 969 | return Qt; | 991 | return Qt; |
| 970 | 992 | ||
| 971 | if (!XSYMBOL (variable)->indirect_variable) | 993 | if (!(XSYMBOL (variable)->redirect == SYMBOL_VARALIAS)) |
| 972 | return Qnil; | 994 | return Qnil; |
| 973 | 995 | ||
| 974 | /* An indirect variable? Let's follow the chain. */ | 996 | /* An indirect variable? Let's follow the chain. */ |
| 975 | variable = XSYMBOL (variable)->value; | 997 | XSETSYMBOL (variable, SYMBOL_ALIAS (XSYMBOL (variable))); |
| 976 | } | 998 | } |
| 977 | } | 999 | } |
| 978 | 1000 | ||
| @@ -3263,78 +3285,94 @@ void | |||
| 3263 | specbind (symbol, value) | 3285 | specbind (symbol, value) |
| 3264 | Lisp_Object symbol, value; | 3286 | Lisp_Object symbol, value; |
| 3265 | { | 3287 | { |
| 3266 | Lisp_Object valcontents; | 3288 | struct Lisp_Symbol *sym; |
| 3289 | |||
| 3290 | eassert (!handling_signal); | ||
| 3267 | 3291 | ||
| 3268 | CHECK_SYMBOL (symbol); | 3292 | CHECK_SYMBOL (symbol); |
| 3293 | sym = XSYMBOL (symbol); | ||
| 3269 | if (specpdl_ptr == specpdl + specpdl_size) | 3294 | if (specpdl_ptr == specpdl + specpdl_size) |
| 3270 | grow_specpdl (); | 3295 | grow_specpdl (); |
| 3271 | 3296 | ||
| 3272 | /* The most common case is that of a non-constant symbol with a | 3297 | start: |
| 3273 | trivial value. Make that as fast as we can. */ | 3298 | switch (sym->redirect) |
| 3274 | valcontents = SYMBOL_VALUE (symbol); | 3299 | { |
| 3275 | if (!MISCP (valcontents) && !SYMBOL_CONSTANT_P (symbol)) | 3300 | case SYMBOL_VARALIAS: |
| 3276 | { | 3301 | sym = indirect_variable (sym); XSETSYMBOL (symbol, sym); goto start; |
| 3277 | specpdl_ptr->symbol = symbol; | 3302 | case SYMBOL_PLAINVAL: |
| 3278 | specpdl_ptr->old_value = valcontents; | 3303 | { /* The most common case is that of a non-constant symbol with a |
| 3279 | specpdl_ptr->func = NULL; | 3304 | trivial value. Make that as fast as we can. */ |
| 3280 | ++specpdl_ptr; | 3305 | specpdl_ptr->symbol = symbol; |
| 3281 | SET_SYMBOL_VALUE (symbol, value); | 3306 | specpdl_ptr->old_value = SYMBOL_VAL (sym); |
| 3282 | } | 3307 | specpdl_ptr->func = NULL; |
| 3283 | else | 3308 | ++specpdl_ptr; |
| 3284 | { | 3309 | if (!sym->constant) |
| 3285 | Lisp_Object ovalue = find_symbol_value (symbol); | 3310 | SET_SYMBOL_VAL (sym, value); |
| 3286 | specpdl_ptr->func = 0; | ||
| 3287 | specpdl_ptr->old_value = ovalue; | ||
| 3288 | |||
| 3289 | valcontents = XSYMBOL (symbol)->value; | ||
| 3290 | |||
| 3291 | if (BUFFER_LOCAL_VALUEP (valcontents) | ||
| 3292 | || BUFFER_OBJFWDP (valcontents)) | ||
| 3293 | { | ||
| 3294 | Lisp_Object where, current_buffer; | ||
| 3295 | |||
| 3296 | current_buffer = Fcurrent_buffer (); | ||
| 3297 | |||
| 3298 | /* For a local variable, record both the symbol and which | ||
| 3299 | buffer's or frame's value we are saving. */ | ||
| 3300 | if (!NILP (Flocal_variable_p (symbol, Qnil))) | ||
| 3301 | where = current_buffer; | ||
| 3302 | else if (BUFFER_LOCAL_VALUEP (valcontents) | ||
| 3303 | && XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame) | ||
| 3304 | where = XBUFFER_LOCAL_VALUE (valcontents)->frame; | ||
| 3305 | else | 3311 | else |
| 3306 | where = Qnil; | 3312 | set_internal (symbol, value, 0, 1); |
| 3307 | 3313 | break; | |
| 3308 | /* We're not using the `unused' slot in the specbinding | ||
| 3309 | structure because this would mean we have to do more | ||
| 3310 | work for simple variables. */ | ||
| 3311 | specpdl_ptr->symbol = Fcons (symbol, Fcons (where, current_buffer)); | ||
| 3312 | |||
| 3313 | /* If SYMBOL is a per-buffer variable which doesn't have a | ||
| 3314 | buffer-local value here, make the `let' change the global | ||
| 3315 | value by changing the value of SYMBOL in all buffers not | ||
| 3316 | having their own value. This is consistent with what | ||
| 3317 | happens with other buffer-local variables. */ | ||
| 3318 | if (NILP (where) | ||
| 3319 | && BUFFER_OBJFWDP (valcontents)) | ||
| 3320 | { | ||
| 3321 | ++specpdl_ptr; | ||
| 3322 | Fset_default (symbol, value); | ||
| 3323 | return; | ||
| 3324 | } | ||
| 3325 | } | 3314 | } |
| 3326 | else | 3315 | case SYMBOL_LOCALIZED: case SYMBOL_FORWARDED: |
| 3327 | specpdl_ptr->symbol = symbol; | 3316 | { |
| 3328 | 3317 | Lisp_Object ovalue = find_symbol_value (symbol); | |
| 3329 | specpdl_ptr++; | 3318 | specpdl_ptr->func = 0; |
| 3330 | /* We used to do | 3319 | specpdl_ptr->old_value = ovalue; |
| 3331 | if (BUFFER_OBJFWDP (ovalue) || KBOARD_OBJFWDP (ovalue)) | 3320 | |
| 3332 | store_symval_forwarding (symbol, ovalue, value, NULL); | 3321 | eassert (sym->redirect != SYMBOL_LOCALIZED |
| 3333 | else | 3322 | || (EQ (SYMBOL_BLV (sym)->where, |
| 3334 | but ovalue comes from find_symbol_value which should never return | 3323 | SYMBOL_BLV (sym)->frame_local ? |
| 3335 | such an internal value. */ | 3324 | Fselected_frame () : Fcurrent_buffer ()))); |
| 3336 | eassert (!(BUFFER_OBJFWDP (ovalue) || KBOARD_OBJFWDP (ovalue))); | 3325 | |
| 3337 | set_internal (symbol, value, 0, 1); | 3326 | if (sym->redirect == SYMBOL_LOCALIZED |
| 3327 | || BUFFER_OBJFWDP (SYMBOL_FWD (sym))) | ||
| 3328 | { | ||
| 3329 | Lisp_Object where, cur_buf = Fcurrent_buffer (); | ||
| 3330 | |||
| 3331 | /* For a local variable, record both the symbol and which | ||
| 3332 | buffer's or frame's value we are saving. */ | ||
| 3333 | if (!NILP (Flocal_variable_p (symbol, Qnil))) | ||
| 3334 | { | ||
| 3335 | eassert (sym->redirect != SYMBOL_LOCALIZED | ||
| 3336 | || (BLV_FOUND (SYMBOL_BLV (sym)) | ||
| 3337 | && EQ (cur_buf, SYMBOL_BLV (sym)->where))); | ||
| 3338 | where = cur_buf; | ||
| 3339 | } | ||
| 3340 | else if (sym->redirect == SYMBOL_LOCALIZED | ||
| 3341 | && BLV_FOUND (SYMBOL_BLV (sym))) | ||
| 3342 | where = SYMBOL_BLV (sym)->where; | ||
| 3343 | else | ||
| 3344 | where = Qnil; | ||
| 3345 | |||
| 3346 | /* We're not using the `unused' slot in the specbinding | ||
| 3347 | structure because this would mean we have to do more | ||
| 3348 | work for simple variables. */ | ||
| 3349 | /* FIXME: The third value `current_buffer' is only used in | ||
| 3350 | let_shadows_buffer_binding_p which is itself only used | ||
| 3351 | in set_internal for local_if_set. */ | ||
| 3352 | specpdl_ptr->symbol = Fcons (symbol, Fcons (where, cur_buf)); | ||
| 3353 | |||
| 3354 | /* If SYMBOL is a per-buffer variable which doesn't have a | ||
| 3355 | buffer-local value here, make the `let' change the global | ||
| 3356 | value by changing the value of SYMBOL in all buffers not | ||
| 3357 | having their own value. This is consistent with what | ||
| 3358 | happens with other buffer-local variables. */ | ||
| 3359 | if (NILP (where) | ||
| 3360 | && sym->redirect == SYMBOL_FORWARDED) | ||
| 3361 | { | ||
| 3362 | eassert (BUFFER_OBJFWDP (SYMBOL_FWD (sym))); | ||
| 3363 | ++specpdl_ptr; | ||
| 3364 | Fset_default (symbol, value); | ||
| 3365 | return; | ||
| 3366 | } | ||
| 3367 | } | ||
| 3368 | else | ||
| 3369 | specpdl_ptr->symbol = symbol; | ||
| 3370 | |||
| 3371 | specpdl_ptr++; | ||
| 3372 | set_internal (symbol, value, 0, 1); | ||
| 3373 | break; | ||
| 3374 | } | ||
| 3375 | default: abort (); | ||
| 3338 | } | 3376 | } |
| 3339 | } | 3377 | } |
| 3340 | 3378 | ||
| @@ -3394,7 +3432,12 @@ unbind_to (count, value) | |||
| 3394 | if (NILP (where)) | 3432 | if (NILP (where)) |
| 3395 | Fset_default (symbol, this_binding.old_value); | 3433 | Fset_default (symbol, this_binding.old_value); |
| 3396 | else if (BUFFERP (where)) | 3434 | else if (BUFFERP (where)) |
| 3397 | set_internal (symbol, this_binding.old_value, XBUFFER (where), 1); | 3435 | if (!NILP (Flocal_variable_p (symbol, where))) |
| 3436 | set_internal (symbol, this_binding.old_value, XBUFFER (where), 1); | ||
| 3437 | /* else if (!NILP (Fbuffer_live_p (where))) | ||
| 3438 | error ("Unbinding local %s to global!", symbol); */ | ||
| 3439 | else | ||
| 3440 | ; | ||
| 3398 | else | 3441 | else |
| 3399 | set_internal (symbol, this_binding.old_value, NULL, 1); | 3442 | set_internal (symbol, this_binding.old_value, NULL, 1); |
| 3400 | } | 3443 | } |
| @@ -3403,8 +3446,9 @@ unbind_to (count, value) | |||
| 3403 | /* If variable has a trivial value (no forwarding), we can | 3446 | /* If variable has a trivial value (no forwarding), we can |
| 3404 | just set it. No need to check for constant symbols here, | 3447 | just set it. No need to check for constant symbols here, |
| 3405 | since that was already done by specbind. */ | 3448 | since that was already done by specbind. */ |
| 3406 | if (!MISCP (SYMBOL_VALUE (this_binding.symbol))) | 3449 | if (XSYMBOL (this_binding.symbol)->redirect == SYMBOL_PLAINVAL) |
| 3407 | SET_SYMBOL_VALUE (this_binding.symbol, this_binding.old_value); | 3450 | SET_SYMBOL_VAL (XSYMBOL (this_binding.symbol), |
| 3451 | this_binding.old_value); | ||
| 3408 | else | 3452 | else |
| 3409 | set_internal (this_binding.symbol, this_binding.old_value, 0, 1); | 3453 | set_internal (this_binding.symbol, this_binding.old_value, 0, 1); |
| 3410 | } | 3454 | } |
diff --git a/src/frame.c b/src/frame.c index 757ed8f01a3..3e1b2daf556 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -2298,13 +2298,20 @@ store_frame_param (f, prop, val) | |||
| 2298 | without messing up the symbol's status. */ | 2298 | without messing up the symbol's status. */ |
| 2299 | if (SYMBOLP (prop)) | 2299 | if (SYMBOLP (prop)) |
| 2300 | { | 2300 | { |
| 2301 | Lisp_Object valcontents; | 2301 | struct Lisp_Symbol *sym = XSYMBOL (prop); |
| 2302 | valcontents = SYMBOL_VALUE (prop); | 2302 | start: |
| 2303 | if ((BUFFER_LOCAL_VALUEP (valcontents)) | 2303 | switch (sym->redirect) |
| 2304 | && XBUFFER_LOCAL_VALUE (valcontents)->check_frame | 2304 | { |
| 2305 | && XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame | 2305 | case SYMBOL_VARALIAS: sym = indirect_variable (sym); goto start; |
| 2306 | && XFRAME (XBUFFER_LOCAL_VALUE (valcontents)->frame) == f) | 2306 | case SYMBOL_PLAINVAL: case SYMBOL_FORWARDED: break; |
| 2307 | swap_in_global_binding (prop); | 2307 | case SYMBOL_LOCALIZED: |
| 2308 | { struct Lisp_Buffer_Local_Value *blv = sym->val.blv; | ||
| 2309 | if (blv->frame_local && BLV_FOUND (blv) && XFRAME (blv->where) == f) | ||
| 2310 | swap_in_global_binding (sym); | ||
| 2311 | break; | ||
| 2312 | } | ||
| 2313 | default: abort (); | ||
| 2314 | } | ||
| 2308 | } | 2315 | } |
| 2309 | 2316 | ||
| 2310 | /* The tty color needed to be set before the frame's parameter | 2317 | /* The tty color needed to be set before the frame's parameter |
| @@ -2520,6 +2527,8 @@ If FRAME is nil, describe the currently selected frame. */) | |||
| 2520 | || EQ (parameter, Qbackground_mode)) | 2527 | || EQ (parameter, Qbackground_mode)) |
| 2521 | value = Fcdr (Fassq (parameter, f->param_alist)); | 2528 | value = Fcdr (Fassq (parameter, f->param_alist)); |
| 2522 | else | 2529 | else |
| 2530 | /* FIXME: Avoid this code path at all (as well as code duplication) | ||
| 2531 | by sharing more code with Fframe_parameters. */ | ||
| 2523 | value = Fcdr (Fassq (parameter, Fframe_parameters (frame))); | 2532 | value = Fcdr (Fassq (parameter, Fframe_parameters (frame))); |
| 2524 | } | 2533 | } |
| 2525 | 2534 | ||
diff --git a/src/frame.h b/src/frame.h index 36b0b6b069c..887d47eff21 100644 --- a/src/frame.h +++ b/src/frame.h | |||
| @@ -980,7 +980,7 @@ extern Lisp_Object selected_frame; | |||
| 980 | at ROW/COL. */ | 980 | at ROW/COL. */ |
| 981 | 981 | ||
| 982 | #define FRAME_LINE_TO_PIXEL_Y(f, row) \ | 982 | #define FRAME_LINE_TO_PIXEL_Y(f, row) \ |
| 983 | ((row < FRAME_TOP_MARGIN (f) ? 0 : FRAME_INTERNAL_BORDER_WIDTH (f)) \ | 983 | (((row) < FRAME_TOP_MARGIN (f) ? 0 : FRAME_INTERNAL_BORDER_WIDTH (f)) \ |
| 984 | + (row) * FRAME_LINE_HEIGHT (f)) | 984 | + (row) * FRAME_LINE_HEIGHT (f)) |
| 985 | 985 | ||
| 986 | #define FRAME_COL_TO_PIXEL_X(f, col) \ | 986 | #define FRAME_COL_TO_PIXEL_X(f, col) \ |
diff --git a/src/insdel.c b/src/insdel.c index ededd597b0d..6cc797a12ff 100644 --- a/src/insdel.c +++ b/src/insdel.c | |||
| @@ -54,7 +54,7 @@ static void adjust_point (EMACS_INT nchars, EMACS_INT nbytes); | |||
| 54 | Lisp_Object Fcombine_after_change_execute (); | 54 | Lisp_Object Fcombine_after_change_execute (); |
| 55 | 55 | ||
| 56 | /* Non-nil means don't call the after-change-functions right away, | 56 | /* Non-nil means don't call the after-change-functions right away, |
| 57 | just record an element in Vcombine_after_change_calls_list. */ | 57 | just record an element in combine_after_change_list. */ |
| 58 | Lisp_Object Vcombine_after_change_calls; | 58 | Lisp_Object Vcombine_after_change_calls; |
| 59 | 59 | ||
| 60 | /* List of elements of the form (BEG-UNCHANGED END-UNCHANGED CHANGE-AMOUNT) | 60 | /* List of elements of the form (BEG-UNCHANGED END-UNCHANGED CHANGE-AMOUNT) |
diff --git a/src/keyboard.c b/src/keyboard.c index f2aeff89542..1d99c31999f 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -1520,7 +1520,6 @@ Lisp_Object | |||
| 1520 | command_loop_1 () | 1520 | command_loop_1 () |
| 1521 | { | 1521 | { |
| 1522 | Lisp_Object cmd; | 1522 | Lisp_Object cmd; |
| 1523 | int lose; | ||
| 1524 | Lisp_Object keybuf[30]; | 1523 | Lisp_Object keybuf[30]; |
| 1525 | int i; | 1524 | int i; |
| 1526 | int prev_modiff = 0; | 1525 | int prev_modiff = 0; |
diff --git a/src/lisp.h b/src/lisp.h index 7f5d5df66c6..d7e88e7c8b8 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -223,13 +223,7 @@ enum Lisp_Misc_Type | |||
| 223 | { | 223 | { |
| 224 | Lisp_Misc_Free = 0x5eab, | 224 | Lisp_Misc_Free = 0x5eab, |
| 225 | Lisp_Misc_Marker, | 225 | Lisp_Misc_Marker, |
| 226 | Lisp_Misc_Intfwd, | ||
| 227 | Lisp_Misc_Boolfwd, | ||
| 228 | Lisp_Misc_Objfwd, | ||
| 229 | Lisp_Misc_Buffer_Objfwd, | ||
| 230 | Lisp_Misc_Buffer_Local_Value, | ||
| 231 | Lisp_Misc_Overlay, | 226 | Lisp_Misc_Overlay, |
| 232 | Lisp_Misc_Kboard_Objfwd, | ||
| 233 | Lisp_Misc_Save_Value, | 227 | Lisp_Misc_Save_Value, |
| 234 | /* Currently floats are not a misc type, | 228 | /* Currently floats are not a misc type, |
| 235 | but let's define this in case we want to change that. */ | 229 | but let's define this in case we want to change that. */ |
| @@ -238,6 +232,18 @@ enum Lisp_Misc_Type | |||
| 238 | Lisp_Misc_Limit | 232 | Lisp_Misc_Limit |
| 239 | }; | 233 | }; |
| 240 | 234 | ||
| 235 | /* These are the types of forwarding objects used in the value slot | ||
| 236 | of symbols for special built-in variables whose value is stored in | ||
| 237 | C variables. */ | ||
| 238 | enum Lisp_Fwd_Type | ||
| 239 | { | ||
| 240 | Lisp_Fwd_Int, /* Fwd to a C `int' variable. */ | ||
| 241 | Lisp_Fwd_Bool, /* Fwd to a C boolean var. */ | ||
| 242 | Lisp_Fwd_Obj, /* Fwd to a C Lisp_Object variable. */ | ||
| 243 | Lisp_Fwd_Buffer_Obj, /* Fwd to a Lisp_Object field of buffers. */ | ||
| 244 | Lisp_Fwd_Kboard_Obj, /* Fwd to a Lisp_Object field of kboards. */ | ||
| 245 | }; | ||
| 246 | |||
| 241 | #ifndef GCTYPEBITS | 247 | #ifndef GCTYPEBITS |
| 242 | #define GCTYPEBITS 3 | 248 | #define GCTYPEBITS 3 |
| 243 | #endif | 249 | #endif |
| @@ -566,17 +572,19 @@ extern size_t pure_size; | |||
| 566 | #define XMISCANY(a) (eassert (MISCP (a)), &(XMISC(a)->u_any)) | 572 | #define XMISCANY(a) (eassert (MISCP (a)), &(XMISC(a)->u_any)) |
| 567 | #define XMISCTYPE(a) (XMISCANY (a)->type) | 573 | #define XMISCTYPE(a) (XMISCANY (a)->type) |
| 568 | #define XMARKER(a) (eassert (MARKERP (a)), &(XMISC(a)->u_marker)) | 574 | #define XMARKER(a) (eassert (MARKERP (a)), &(XMISC(a)->u_marker)) |
| 569 | #define XINTFWD(a) (eassert (INTFWDP (a)), &(XMISC(a)->u_intfwd)) | ||
| 570 | #define XBOOLFWD(a) (eassert (BOOLFWDP (a)), &(XMISC(a)->u_boolfwd)) | ||
| 571 | #define XOBJFWD(a) (eassert (OBJFWDP (a)), &(XMISC(a)->u_objfwd)) | ||
| 572 | #define XOVERLAY(a) (eassert (OVERLAYP (a)), &(XMISC(a)->u_overlay)) | 575 | #define XOVERLAY(a) (eassert (OVERLAYP (a)), &(XMISC(a)->u_overlay)) |
| 573 | #define XSAVE_VALUE(a) (eassert (SAVE_VALUEP (a)), &(XMISC(a)->u_save_value)) | 576 | #define XSAVE_VALUE(a) (eassert (SAVE_VALUEP (a)), &(XMISC(a)->u_save_value)) |
| 577 | |||
| 578 | /* Forwarding object types. */ | ||
| 579 | |||
| 580 | #define XFWDTYPE(a) (a->u_intfwd.type) | ||
| 581 | #define XINTFWD(a) (eassert (INTFWDP (a)), &((a)->u_intfwd)) | ||
| 582 | #define XBOOLFWD(a) (eassert (BOOLFWDP (a)), &((a)->u_boolfwd)) | ||
| 583 | #define XOBJFWD(a) (eassert (OBJFWDP (a)), &((a)->u_objfwd)) | ||
| 574 | #define XBUFFER_OBJFWD(a) \ | 584 | #define XBUFFER_OBJFWD(a) \ |
| 575 | (eassert (BUFFER_OBJFWDP (a)), &(XMISC(a)->u_buffer_objfwd)) | 585 | (eassert (BUFFER_OBJFWDP (a)), &((a)->u_buffer_objfwd)) |
| 576 | #define XBUFFER_LOCAL_VALUE(a) \ | ||
| 577 | (eassert (BUFFER_LOCAL_VALUEP (a)), &(XMISC(a)->u_buffer_local_value)) | ||
| 578 | #define XKBOARD_OBJFWD(a) \ | 586 | #define XKBOARD_OBJFWD(a) \ |
| 579 | (eassert (KBOARD_OBJFWDP (a)), &(XMISC(a)->u_kboard_objfwd)) | 587 | (eassert (KBOARD_OBJFWDP (a)), &((a)->u_kboard_objfwd)) |
| 580 | 588 | ||
| 581 | /* Pseudovector types. */ | 589 | /* Pseudovector types. */ |
| 582 | 590 | ||
| @@ -988,19 +996,32 @@ enum symbol_interned | |||
| 988 | SYMBOL_INTERNED_IN_INITIAL_OBARRAY = 2 | 996 | SYMBOL_INTERNED_IN_INITIAL_OBARRAY = 2 |
| 989 | }; | 997 | }; |
| 990 | 998 | ||
| 999 | enum symbol_redirect | ||
| 1000 | { | ||
| 1001 | SYMBOL_PLAINVAL = 4, | ||
| 1002 | SYMBOL_VARALIAS = 1, | ||
| 1003 | SYMBOL_LOCALIZED = 2, | ||
| 1004 | SYMBOL_FORWARDED = 3 | ||
| 1005 | }; | ||
| 1006 | |||
| 991 | /* In a symbol, the markbit of the plist is used as the gc mark bit */ | 1007 | /* In a symbol, the markbit of the plist is used as the gc mark bit */ |
| 992 | 1008 | ||
| 993 | struct Lisp_Symbol | 1009 | struct Lisp_Symbol |
| 994 | { | 1010 | { |
| 995 | unsigned gcmarkbit : 1; | 1011 | unsigned gcmarkbit : 1; |
| 996 | 1012 | ||
| 997 | /* Non-zero means symbol serves as a variable alias. The symbol | 1013 | /* Indicates where the value can be found: |
| 998 | holding the real value is found in the value slot. */ | 1014 | 0 : it's a plain var, the value is in the `value' field. |
| 999 | unsigned indirect_variable : 1; | 1015 | 1 : it's a varalias, the value is really in the `alias' symbol. |
| 1016 | 2 : it's a localized var, the value is in the `blv' object. | ||
| 1017 | 3 : it's a forwarding variable, the value is in `forward'. | ||
| 1018 | */ | ||
| 1019 | enum symbol_redirect redirect : 3; | ||
| 1000 | 1020 | ||
| 1001 | /* Non-zero means symbol is constant, i.e. changing its value | 1021 | /* Non-zero means symbol is constant, i.e. changing its value |
| 1002 | should signal an error. */ | 1022 | should signal an error. If the value is 3, then the var |
| 1003 | unsigned constant : 1; | 1023 | can be changed, but only by `defconst'. */ |
| 1024 | unsigned constant : 2; | ||
| 1004 | 1025 | ||
| 1005 | /* Interned state of the symbol. This is an enumerator from | 1026 | /* Interned state of the symbol. This is an enumerator from |
| 1006 | enum symbol_interned. */ | 1027 | enum symbol_interned. */ |
| @@ -1013,10 +1034,15 @@ struct Lisp_Symbol | |||
| 1013 | Lisp_Object xname; | 1034 | Lisp_Object xname; |
| 1014 | 1035 | ||
| 1015 | /* Value of the symbol or Qunbound if unbound. If this symbol is a | 1036 | /* Value of the symbol or Qunbound if unbound. If this symbol is a |
| 1016 | defvaralias, `value' contains the symbol for which it is an | 1037 | defvaralias, `alias' contains the symbol for which it is an |
| 1017 | alias. Use the SYMBOL_VALUE and SET_SYMBOL_VALUE macros to get | 1038 | alias. Use the SYMBOL_VALUE and SET_SYMBOL_VALUE macros to get |
| 1018 | and set a symbol's value, to take defvaralias into account. */ | 1039 | and set a symbol's value, to take defvaralias into account. */ |
| 1019 | Lisp_Object value; | 1040 | union { |
| 1041 | Lisp_Object value; | ||
| 1042 | struct Lisp_Symbol *alias; | ||
| 1043 | struct Lisp_Buffer_Local_Value *blv; | ||
| 1044 | union Lisp_Fwd *fwd; | ||
| 1045 | } val; | ||
| 1020 | 1046 | ||
| 1021 | /* Function value of the symbol or Qunbound if not fboundp. */ | 1047 | /* Function value of the symbol or Qunbound if not fboundp. */ |
| 1022 | Lisp_Object function; | 1048 | Lisp_Object function; |
| @@ -1030,6 +1056,23 @@ struct Lisp_Symbol | |||
| 1030 | 1056 | ||
| 1031 | /* Value is name of symbol. */ | 1057 | /* Value is name of symbol. */ |
| 1032 | 1058 | ||
| 1059 | #define SYMBOL_VAL(sym) \ | ||
| 1060 | (eassert ((sym)->redirect == SYMBOL_PLAINVAL), (sym)->val.value) | ||
| 1061 | #define SYMBOL_ALIAS(sym) \ | ||
| 1062 | (eassert ((sym)->redirect == SYMBOL_VARALIAS), (sym)->val.alias) | ||
| 1063 | #define SYMBOL_BLV(sym) \ | ||
| 1064 | (eassert ((sym)->redirect == SYMBOL_LOCALIZED), (sym)->val.blv) | ||
| 1065 | #define SYMBOL_FWD(sym) \ | ||
| 1066 | (eassert ((sym)->redirect == SYMBOL_FORWARDED), (sym)->val.fwd) | ||
| 1067 | #define SET_SYMBOL_VAL(sym, v) \ | ||
| 1068 | (eassert ((sym)->redirect == SYMBOL_PLAINVAL), (sym)->val.value = (v)) | ||
| 1069 | #define SET_SYMBOL_ALIAS(sym, v) \ | ||
| 1070 | (eassert ((sym)->redirect == SYMBOL_VARALIAS), (sym)->val.alias = (v)) | ||
| 1071 | #define SET_SYMBOL_BLV(sym, v) \ | ||
| 1072 | (eassert ((sym)->redirect == SYMBOL_LOCALIZED), (sym)->val.blv = (v)) | ||
| 1073 | #define SET_SYMBOL_FWD(sym, v) \ | ||
| 1074 | (eassert ((sym)->redirect == SYMBOL_FORWARDED), (sym)->val.fwd = (v)) | ||
| 1075 | |||
| 1033 | #define SYMBOL_NAME(sym) \ | 1076 | #define SYMBOL_NAME(sym) \ |
| 1034 | LISP_MAKE_RVALUE (XSYMBOL (sym)->xname) | 1077 | LISP_MAKE_RVALUE (XSYMBOL (sym)->xname) |
| 1035 | 1078 | ||
| @@ -1049,24 +1092,6 @@ struct Lisp_Symbol | |||
| 1049 | 1092 | ||
| 1050 | #define SYMBOL_CONSTANT_P(sym) XSYMBOL (sym)->constant | 1093 | #define SYMBOL_CONSTANT_P(sym) XSYMBOL (sym)->constant |
| 1051 | 1094 | ||
| 1052 | /* Value is the value of SYM, with defvaralias taken into | ||
| 1053 | account. */ | ||
| 1054 | |||
| 1055 | #define SYMBOL_VALUE(sym) \ | ||
| 1056 | (XSYMBOL (sym)->indirect_variable \ | ||
| 1057 | ? indirect_variable (XSYMBOL (sym))->value \ | ||
| 1058 | : XSYMBOL (sym)->value) | ||
| 1059 | |||
| 1060 | /* Set SYM's value to VAL, taking defvaralias into account. */ | ||
| 1061 | |||
| 1062 | #define SET_SYMBOL_VALUE(sym, val) \ | ||
| 1063 | do { \ | ||
| 1064 | if (XSYMBOL (sym)->indirect_variable) \ | ||
| 1065 | indirect_variable (XSYMBOL (sym))->value = (val); \ | ||
| 1066 | else \ | ||
| 1067 | XSYMBOL (sym)->value = (val); \ | ||
| 1068 | } while (0) | ||
| 1069 | |||
| 1070 | 1095 | ||
| 1071 | /*********************************************************************** | 1096 | /*********************************************************************** |
| 1072 | Hash Tables | 1097 | Hash Tables |
| @@ -1200,9 +1225,11 @@ struct Lisp_Hash_Table | |||
| 1200 | 1225 | ||
| 1201 | struct Lisp_Misc_Any /* Supertype of all Misc types. */ | 1226 | struct Lisp_Misc_Any /* Supertype of all Misc types. */ |
| 1202 | { | 1227 | { |
| 1203 | enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_Marker */ | 1228 | enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_??? */ |
| 1204 | unsigned gcmarkbit : 1; | 1229 | unsigned gcmarkbit : 1; |
| 1205 | int spacer : 15; | 1230 | int spacer : 15; |
| 1231 | /* Make it as long as "Lisp_Free without padding". */ | ||
| 1232 | void *fill; | ||
| 1206 | }; | 1233 | }; |
| 1207 | 1234 | ||
| 1208 | struct Lisp_Marker | 1235 | struct Lisp_Marker |
| @@ -1225,7 +1252,7 @@ struct Lisp_Marker | |||
| 1225 | - Fmarker_buffer | 1252 | - Fmarker_buffer |
| 1226 | - Fset_marker: check eq(oldbuf, newbuf) to avoid unchain+rechain. | 1253 | - Fset_marker: check eq(oldbuf, newbuf) to avoid unchain+rechain. |
| 1227 | - unchain_marker: to find the list from which to unchain. | 1254 | - unchain_marker: to find the list from which to unchain. |
| 1228 | - Fkill_buffer: to unchain the markers of current indirect buffer. | 1255 | - Fkill_buffer: to only unchain the markers of current indirect buffer. |
| 1229 | */ | 1256 | */ |
| 1230 | struct buffer *buffer; | 1257 | struct buffer *buffer; |
| 1231 | 1258 | ||
| @@ -1239,7 +1266,10 @@ struct Lisp_Marker | |||
| 1239 | struct Lisp_Marker *next; | 1266 | struct Lisp_Marker *next; |
| 1240 | /* This is the char position where the marker points. */ | 1267 | /* This is the char position where the marker points. */ |
| 1241 | EMACS_INT charpos; | 1268 | EMACS_INT charpos; |
| 1242 | /* This is the byte position. */ | 1269 | /* This is the byte position. |
| 1270 | It's mostly used as a charpos<->bytepos cache (i.e. it's not directly | ||
| 1271 | used to implement the functionality of markers, but rather to (ab)use | ||
| 1272 | markers as a cache for char<->byte mappings). */ | ||
| 1243 | EMACS_INT bytepos; | 1273 | EMACS_INT bytepos; |
| 1244 | }; | 1274 | }; |
| 1245 | 1275 | ||
| @@ -1249,9 +1279,7 @@ struct Lisp_Marker | |||
| 1249 | specified int variable. */ | 1279 | specified int variable. */ |
| 1250 | struct Lisp_Intfwd | 1280 | struct Lisp_Intfwd |
| 1251 | { | 1281 | { |
| 1252 | int type : 16; /* = Lisp_Misc_Intfwd */ | 1282 | enum Lisp_Fwd_Type type; /* = Lisp_Fwd_Int */ |
| 1253 | unsigned gcmarkbit : 1; | ||
| 1254 | int spacer : 15; | ||
| 1255 | EMACS_INT *intvar; | 1283 | EMACS_INT *intvar; |
| 1256 | }; | 1284 | }; |
| 1257 | 1285 | ||
| @@ -1261,9 +1289,7 @@ struct Lisp_Intfwd | |||
| 1261 | nil if it is zero. */ | 1289 | nil if it is zero. */ |
| 1262 | struct Lisp_Boolfwd | 1290 | struct Lisp_Boolfwd |
| 1263 | { | 1291 | { |
| 1264 | int type : 16; /* = Lisp_Misc_Boolfwd */ | 1292 | enum Lisp_Fwd_Type type; /* = Lisp_Fwd_Bool */ |
| 1265 | unsigned gcmarkbit : 1; | ||
| 1266 | int spacer : 15; | ||
| 1267 | int *boolvar; | 1293 | int *boolvar; |
| 1268 | }; | 1294 | }; |
| 1269 | 1295 | ||
| @@ -1273,9 +1299,7 @@ struct Lisp_Boolfwd | |||
| 1273 | specified variable. */ | 1299 | specified variable. */ |
| 1274 | struct Lisp_Objfwd | 1300 | struct Lisp_Objfwd |
| 1275 | { | 1301 | { |
| 1276 | int type : 16; /* = Lisp_Misc_Objfwd */ | 1302 | enum Lisp_Fwd_Type type; /* = Lisp_Fwd_Obj */ |
| 1277 | unsigned gcmarkbit : 1; | ||
| 1278 | int spacer : 15; | ||
| 1279 | Lisp_Object *objvar; | 1303 | Lisp_Object *objvar; |
| 1280 | }; | 1304 | }; |
| 1281 | 1305 | ||
| @@ -1283,11 +1307,9 @@ struct Lisp_Objfwd | |||
| 1283 | current buffer. Value is byte index of slot within buffer. */ | 1307 | current buffer. Value is byte index of slot within buffer. */ |
| 1284 | struct Lisp_Buffer_Objfwd | 1308 | struct Lisp_Buffer_Objfwd |
| 1285 | { | 1309 | { |
| 1286 | int type : 16; /* = Lisp_Misc_Buffer_Objfwd */ | 1310 | enum Lisp_Fwd_Type type; /* = Lisp_Fwd_Buffer_Obj */ |
| 1287 | unsigned gcmarkbit : 1; | ||
| 1288 | int spacer : 15; | ||
| 1289 | Lisp_Object slottype; /* Qnil, Lisp_Int, Lisp_Symbol, or Lisp_String. */ | ||
| 1290 | int offset; | 1311 | int offset; |
| 1312 | Lisp_Object slottype; /* Qnil, Lisp_Int, Lisp_Symbol, or Lisp_String. */ | ||
| 1291 | }; | 1313 | }; |
| 1292 | 1314 | ||
| 1293 | /* struct Lisp_Buffer_Local_Value is used in a symbol value cell when | 1315 | /* struct Lisp_Buffer_Local_Value is used in a symbol value cell when |
| @@ -1316,48 +1338,51 @@ struct Lisp_Buffer_Objfwd | |||
| 1316 | 1338 | ||
| 1317 | struct Lisp_Buffer_Local_Value | 1339 | struct Lisp_Buffer_Local_Value |
| 1318 | { | 1340 | { |
| 1319 | int type : 16; /* = Lisp_Misc_Buffer_Local_Value */ | ||
| 1320 | unsigned gcmarkbit : 1; | ||
| 1321 | int spacer : 11; | ||
| 1322 | |||
| 1323 | /* 1 means that merely setting the variable creates a local | 1341 | /* 1 means that merely setting the variable creates a local |
| 1324 | binding for the current buffer */ | 1342 | binding for the current buffer */ |
| 1325 | unsigned int local_if_set : 1; | 1343 | unsigned int local_if_set : 1; |
| 1326 | /* 1 means this variable is allowed to have frame-local bindings, | 1344 | /* 1 means this variable can have frame-local bindings, otherwise, it is |
| 1327 | so check for them when looking for the proper binding. */ | 1345 | can have buffer-local bindings. The two cannot be combined. */ |
| 1328 | unsigned int check_frame : 1; | 1346 | unsigned int frame_local : 1; |
| 1329 | /* 1 means that the binding now loaded was found | 1347 | /* 1 means that the binding now loaded was found. |
| 1330 | as a local binding for the buffer in the `buffer' slot. */ | 1348 | Presumably equivalent to (defcell!=valcell) */ |
| 1331 | unsigned int found_for_buffer : 1; | 1349 | unsigned int found : 1; |
| 1332 | /* 1 means that the binding now loaded was found | 1350 | /* If non-NULL, a forwarding to the C var where it should also be set. */ |
| 1333 | as a local binding for the frame in the `frame' slot. */ | 1351 | union Lisp_Fwd *fwd; /* Should never be (Buffer|Kboard)_Objfwd. */ |
| 1334 | unsigned int found_for_frame : 1; | 1352 | /* The buffer or frame for which the loaded binding was found. */ |
| 1335 | Lisp_Object realvalue; | 1353 | Lisp_Object where; |
| 1336 | /* The buffer and frame for which the loaded binding was found. */ | 1354 | /* A cons cell that holds the default value. It has the form |
| 1337 | /* Having both is only needed if we want to allow variables that are | 1355 | (SYMBOL . DEFAULT-VALUE). */ |
| 1338 | both buffer local and frame local (in which case, we currently give | 1356 | Lisp_Object defcell; |
| 1339 | precedence to the buffer-local binding). I don't think such | 1357 | /* The cons cell from `where's parameter alist. |
| 1340 | a combination is desirable. --Stef */ | 1358 | It always has the form (SYMBOL . VALUE) |
| 1341 | Lisp_Object buffer, frame; | 1359 | Note that if `forward' is non-nil, VALUE may be out of date. |
| 1342 | 1360 | Also if the currently loaded binding is the default binding, then | |
| 1343 | /* A cons cell, (LOADED-BINDING . DEFAULT-VALUE). | 1361 | this is `eq'ual to defcell. */ |
| 1344 | 1362 | Lisp_Object valcell; | |
| 1345 | LOADED-BINDING is the binding now loaded. It is a cons cell | ||
| 1346 | whose cdr is the binding's value. The cons cell may be an | ||
| 1347 | element of a buffer's local-variable alist, or an element of a | ||
| 1348 | frame's parameter alist, or it may be this cons cell. | ||
| 1349 | |||
| 1350 | DEFAULT-VALUE is the variable's default value, seen when the | ||
| 1351 | current buffer and selected frame do not have their own | ||
| 1352 | bindings for the variable. When the default binding is loaded, | ||
| 1353 | LOADED-BINDING is actually this very cons cell; thus, its car | ||
| 1354 | points to itself. */ | ||
| 1355 | Lisp_Object cdr; | ||
| 1356 | }; | 1363 | }; |
| 1357 | 1364 | ||
| 1365 | #define BLV_FOUND(blv) \ | ||
| 1366 | (eassert ((blv)->found == !EQ ((blv)->defcell, (blv)->valcell)), (blv)->found) | ||
| 1367 | #define SET_BLV_FOUND(blv, v) \ | ||
| 1368 | (eassert ((v) == !EQ ((blv)->defcell, (blv)->valcell)), (blv)->found = (v)) | ||
| 1369 | |||
| 1370 | #define BLV_VALUE(blv) (XCDR ((blv)->valcell)) | ||
| 1371 | #define SET_BLV_VALUE(blv, v) (XSETCDR ((blv)->valcell, v)) | ||
| 1372 | |||
| 1358 | /* START and END are markers in the overlay's buffer, and | 1373 | /* START and END are markers in the overlay's buffer, and |
| 1359 | PLIST is the overlay's property list. */ | 1374 | PLIST is the overlay's property list. */ |
| 1360 | struct Lisp_Overlay | 1375 | struct Lisp_Overlay |
| 1376 | /* An overlay's real data content is: | ||
| 1377 | - plist | ||
| 1378 | - buffer | ||
| 1379 | - insertion type of both ends | ||
| 1380 | - start & start_byte | ||
| 1381 | - end & end_byte | ||
| 1382 | - next (singly linked list of overlays). | ||
| 1383 | - start_next and end_next (singly linked list of markers). | ||
| 1384 | I.e. 9words plus 2 bits, 3words of which are for external linked lists. | ||
| 1385 | */ | ||
| 1361 | { | 1386 | { |
| 1362 | enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_Overlay */ | 1387 | enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_Overlay */ |
| 1363 | unsigned gcmarkbit : 1; | 1388 | unsigned gcmarkbit : 1; |
| @@ -1370,9 +1395,7 @@ struct Lisp_Overlay | |||
| 1370 | current kboard. */ | 1395 | current kboard. */ |
| 1371 | struct Lisp_Kboard_Objfwd | 1396 | struct Lisp_Kboard_Objfwd |
| 1372 | { | 1397 | { |
| 1373 | enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_Kboard_Objfwd */ | 1398 | enum Lisp_Fwd_Type type; /* = Lisp_Fwd_Kboard_Obj */ |
| 1374 | unsigned gcmarkbit : 1; | ||
| 1375 | int spacer : 15; | ||
| 1376 | int offset; | 1399 | int offset; |
| 1377 | }; | 1400 | }; |
| 1378 | 1401 | ||
| @@ -1401,9 +1424,9 @@ struct Lisp_Free | |||
| 1401 | #ifdef USE_LSB_TAG | 1424 | #ifdef USE_LSB_TAG |
| 1402 | /* Try to make sure that sizeof(Lisp_Misc) preserves TYPEBITS-alignment. | 1425 | /* Try to make sure that sizeof(Lisp_Misc) preserves TYPEBITS-alignment. |
| 1403 | This assumes that Lisp_Marker is the largest of the alternatives and | 1426 | This assumes that Lisp_Marker is the largest of the alternatives and |
| 1404 | that Lisp_Intfwd has the same size as "Lisp_Free w/o padding". */ | 1427 | that Lisp_Misc_Any has the same size as "Lisp_Free w/o padding". */ |
| 1405 | char padding[((((sizeof (struct Lisp_Marker) - 1) >> GCTYPEBITS) + 1) | 1428 | char padding[((((sizeof (struct Lisp_Marker) - 1) >> GCTYPEBITS) + 1) |
| 1406 | << GCTYPEBITS) - sizeof (struct Lisp_Intfwd)]; | 1429 | << GCTYPEBITS) - sizeof (struct Lisp_Misc_Any)]; |
| 1407 | #endif | 1430 | #endif |
| 1408 | }; | 1431 | }; |
| 1409 | 1432 | ||
| @@ -1414,15 +1437,18 @@ union Lisp_Misc | |||
| 1414 | { | 1437 | { |
| 1415 | struct Lisp_Misc_Any u_any; /* Supertype of all Misc types. */ | 1438 | struct Lisp_Misc_Any u_any; /* Supertype of all Misc types. */ |
| 1416 | struct Lisp_Free u_free; /* Includes padding to force alignment. */ | 1439 | struct Lisp_Free u_free; /* Includes padding to force alignment. */ |
| 1417 | struct Lisp_Marker u_marker; | 1440 | struct Lisp_Marker u_marker; /* 5 */ |
| 1418 | struct Lisp_Intfwd u_intfwd; | 1441 | struct Lisp_Overlay u_overlay; /* 5 */ |
| 1419 | struct Lisp_Boolfwd u_boolfwd; | 1442 | struct Lisp_Save_Value u_save_value; /* 3 */ |
| 1420 | struct Lisp_Objfwd u_objfwd; | 1443 | }; |
| 1421 | struct Lisp_Buffer_Objfwd u_buffer_objfwd; | 1444 | |
| 1422 | struct Lisp_Buffer_Local_Value u_buffer_local_value; | 1445 | union Lisp_Fwd |
| 1423 | struct Lisp_Overlay u_overlay; | 1446 | { |
| 1424 | struct Lisp_Kboard_Objfwd u_kboard_objfwd; | 1447 | struct Lisp_Intfwd u_intfwd; /* 2 */ |
| 1425 | struct Lisp_Save_Value u_save_value; | 1448 | struct Lisp_Boolfwd u_boolfwd; /* 2 */ |
| 1449 | struct Lisp_Objfwd u_objfwd; /* 2 */ | ||
| 1450 | struct Lisp_Buffer_Objfwd u_buffer_objfwd; /* 2 */ | ||
| 1451 | struct Lisp_Kboard_Objfwd u_kboard_objfwd; /* 2 */ | ||
| 1426 | }; | 1452 | }; |
| 1427 | 1453 | ||
| 1428 | /* Lisp floating point type */ | 1454 | /* Lisp floating point type */ |
| @@ -1564,15 +1590,13 @@ typedef struct { | |||
| 1564 | #define VECTORP(x) (VECTORLIKEP (x) && !(XVECTOR (x)->size & PSEUDOVECTOR_FLAG)) | 1590 | #define VECTORP(x) (VECTORLIKEP (x) && !(XVECTOR (x)->size & PSEUDOVECTOR_FLAG)) |
| 1565 | #define OVERLAYP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Overlay) | 1591 | #define OVERLAYP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Overlay) |
| 1566 | #define MARKERP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Marker) | 1592 | #define MARKERP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Marker) |
| 1567 | #define INTFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Intfwd) | ||
| 1568 | #define BOOLFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Boolfwd) | ||
| 1569 | #define OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Objfwd) | ||
| 1570 | #define BUFFER_OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Buffer_Objfwd) | ||
| 1571 | #define BUFFER_LOCAL_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Buffer_Local_Value) | ||
| 1572 | #define SOME_BUFFER_LOCAL_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Some_Buffer_Local_Value) | ||
| 1573 | #define KBOARD_OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Kboard_Objfwd) | ||
| 1574 | #define SAVE_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Save_Value) | 1593 | #define SAVE_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Save_Value) |
| 1575 | 1594 | ||
| 1595 | #define INTFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Int) | ||
| 1596 | #define BOOLFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Bool) | ||
| 1597 | #define OBJFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Obj) | ||
| 1598 | #define BUFFER_OBJFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Buffer_Obj) | ||
| 1599 | #define KBOARD_OBJFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Kboard_Obj) | ||
| 1576 | 1600 | ||
| 1577 | /* True if object X is a pseudovector whose code is CODE. */ | 1601 | /* True if object X is a pseudovector whose code is CODE. */ |
| 1578 | #define PSEUDOVECTORP(x, code) \ | 1602 | #define PSEUDOVECTORP(x, code) \ |
| @@ -1789,24 +1813,44 @@ extern void defsubr P_ ((struct Lisp_Subr *)); | |||
| 1789 | #define MANY -2 | 1813 | #define MANY -2 |
| 1790 | #define UNEVALLED -1 | 1814 | #define UNEVALLED -1 |
| 1791 | 1815 | ||
| 1792 | extern void defvar_lisp (const char *, Lisp_Object *); | 1816 | extern void defvar_lisp (struct Lisp_Objfwd *, const char *, Lisp_Object *); |
| 1793 | extern void defvar_lisp_nopro (const char *, Lisp_Object *); | 1817 | extern void defvar_lisp_nopro (struct Lisp_Objfwd *, const char *, Lisp_Object *); |
| 1794 | extern void defvar_bool (const char *, int *); | 1818 | extern void defvar_bool (struct Lisp_Boolfwd *, const char *, int *); |
| 1795 | extern void defvar_int (const char *, EMACS_INT *); | 1819 | extern void defvar_int (struct Lisp_Intfwd *, const char *, EMACS_INT *); |
| 1796 | extern void defvar_kboard (const char *, int); | 1820 | extern void defvar_kboard (struct Lisp_Kboard_Objfwd *, const char *, int); |
| 1797 | 1821 | ||
| 1798 | /* Macros we use to define forwarded Lisp variables. | 1822 | /* Macros we use to define forwarded Lisp variables. |
| 1799 | These are used in the syms_of_FILENAME functions. */ | 1823 | These are used in the syms_of_FILENAME functions. */ |
| 1800 | 1824 | ||
| 1801 | #define DEFVAR_LISP(lname, vname, doc) defvar_lisp (lname, vname) | 1825 | #define DEFVAR_LISP(lname, vname, doc) \ |
| 1802 | #define DEFVAR_LISP_NOPRO(lname, vname, doc) defvar_lisp_nopro (lname, vname) | 1826 | do { \ |
| 1803 | #define DEFVAR_BOOL(lname, vname, doc) defvar_bool (lname, vname) | 1827 | static struct Lisp_Objfwd o_fwd; \ |
| 1804 | #define DEFVAR_INT(lname, vname, doc) defvar_int (lname, vname) | 1828 | defvar_lisp (&o_fwd, lname, vname); \ |
| 1829 | } while (0) | ||
| 1830 | #define DEFVAR_LISP_NOPRO(lname, vname, doc) \ | ||
| 1831 | do { \ | ||
| 1832 | static struct Lisp_Objfwd o_fwd; \ | ||
| 1833 | defvar_lisp_nopro (&o_fwd, lname, vname); \ | ||
| 1834 | } while (0) | ||
| 1835 | #define DEFVAR_BOOL(lname, vname, doc) \ | ||
| 1836 | do { \ | ||
| 1837 | static struct Lisp_Boolfwd b_fwd; \ | ||
| 1838 | defvar_bool (&b_fwd, lname, vname); \ | ||
| 1839 | } while (0) | ||
| 1840 | #define DEFVAR_INT(lname, vname, doc) \ | ||
| 1841 | do { \ | ||
| 1842 | static struct Lisp_Intfwd i_fwd; \ | ||
| 1843 | defvar_int (&i_fwd, lname, vname); \ | ||
| 1844 | } while (0) | ||
| 1805 | 1845 | ||
| 1806 | #define DEFVAR_KBOARD(lname, vname, doc) \ | 1846 | #define DEFVAR_KBOARD(lname, vname, doc) \ |
| 1807 | defvar_kboard (lname, \ | 1847 | do { \ |
| 1808 | (int)((char *)(¤t_kboard->vname) \ | 1848 | static struct Lisp_Kboard_Objfwd ko_fwd; \ |
| 1809 | - (char *)current_kboard)) | 1849 | defvar_kboard (&ko_fwd, \ |
| 1850 | lname, \ | ||
| 1851 | (int)((char *)(¤t_kboard->vname) \ | ||
| 1852 | - (char *)current_kboard)); \ | ||
| 1853 | } while (0) | ||
| 1810 | 1854 | ||
| 1811 | 1855 | ||
| 1812 | 1856 | ||
| @@ -2341,13 +2385,11 @@ extern void args_out_of_range P_ ((Lisp_Object, Lisp_Object)) NO_RETURN; | |||
| 2341 | extern void args_out_of_range_3 P_ ((Lisp_Object, Lisp_Object, | 2385 | extern void args_out_of_range_3 P_ ((Lisp_Object, Lisp_Object, |
| 2342 | Lisp_Object)) NO_RETURN; | 2386 | Lisp_Object)) NO_RETURN; |
| 2343 | extern Lisp_Object wrong_type_argument P_ ((Lisp_Object, Lisp_Object)) NO_RETURN; | 2387 | extern Lisp_Object wrong_type_argument P_ ((Lisp_Object, Lisp_Object)) NO_RETURN; |
| 2344 | extern void store_symval_forwarding P_ ((Lisp_Object, Lisp_Object, | 2388 | extern Lisp_Object do_symval_forwarding (union Lisp_Fwd *); |
| 2345 | Lisp_Object, struct buffer *)); | 2389 | extern void set_internal (Lisp_Object, Lisp_Object, struct buffer *, int); |
| 2346 | extern Lisp_Object do_symval_forwarding P_ ((Lisp_Object)); | ||
| 2347 | extern Lisp_Object set_internal P_ ((Lisp_Object, Lisp_Object, struct buffer *, int)); | ||
| 2348 | extern void syms_of_data P_ ((void)); | 2390 | extern void syms_of_data P_ ((void)); |
| 2349 | extern void init_data P_ ((void)); | 2391 | extern void init_data P_ ((void)); |
| 2350 | extern void swap_in_global_binding P_ ((Lisp_Object)); | 2392 | extern void swap_in_global_binding P_ ((struct Lisp_Symbol *)); |
| 2351 | 2393 | ||
| 2352 | /* Defined in cmds.c */ | 2394 | /* Defined in cmds.c */ |
| 2353 | EXFUN (Fend_of_line, 1); | 2395 | EXFUN (Fend_of_line, 1); |
| @@ -3388,6 +3430,7 @@ extern void syms_of_term P_ ((void)); | |||
| 3388 | extern void fatal P_ ((const char *msgid, ...)) NO_RETURN; | 3430 | extern void fatal P_ ((const char *msgid, ...)) NO_RETURN; |
| 3389 | 3431 | ||
| 3390 | /* Defined in terminal.c */ | 3432 | /* Defined in terminal.c */ |
| 3433 | EXFUN (Fframe_terminal, 1); | ||
| 3391 | EXFUN (Fdelete_terminal, 2); | 3434 | EXFUN (Fdelete_terminal, 2); |
| 3392 | extern void syms_of_terminal P_ ((void)); | 3435 | extern void syms_of_terminal P_ ((void)); |
| 3393 | 3436 | ||
diff --git a/src/lread.c b/src/lread.c index 83ebc8b3b10..a04b9679d83 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -3687,7 +3687,8 @@ it defaults to the value of `obarray'. */) | |||
| 3687 | && EQ (obarray, initial_obarray)) | 3687 | && EQ (obarray, initial_obarray)) |
| 3688 | { | 3688 | { |
| 3689 | XSYMBOL (sym)->constant = 1; | 3689 | XSYMBOL (sym)->constant = 1; |
| 3690 | XSYMBOL (sym)->value = sym; | 3690 | XSYMBOL (sym)->redirect = SYMBOL_PLAINVAL; |
| 3691 | SET_SYMBOL_VAL (XSYMBOL (sym), sym); | ||
| 3691 | } | 3692 | } |
| 3692 | 3693 | ||
| 3693 | ptr = &XVECTOR (obarray)->contents[XINT (tem)]; | 3694 | ptr = &XVECTOR (obarray)->contents[XINT (tem)]; |
| @@ -3768,8 +3769,6 @@ OBARRAY defaults to the value of the variable `obarray'. */) | |||
| 3768 | error ("Attempt to unintern t or nil"); */ | 3769 | error ("Attempt to unintern t or nil"); */ |
| 3769 | 3770 | ||
| 3770 | XSYMBOL (tem)->interned = SYMBOL_UNINTERNED; | 3771 | XSYMBOL (tem)->interned = SYMBOL_UNINTERNED; |
| 3771 | XSYMBOL (tem)->constant = 0; | ||
| 3772 | XSYMBOL (tem)->indirect_variable = 0; | ||
| 3773 | 3772 | ||
| 3774 | hash = oblookup_last_bucket_number; | 3773 | hash = oblookup_last_bucket_number; |
| 3775 | 3774 | ||
| @@ -3914,35 +3913,31 @@ void | |||
| 3914 | init_obarray () | 3913 | init_obarray () |
| 3915 | { | 3914 | { |
| 3916 | Lisp_Object oblength; | 3915 | Lisp_Object oblength; |
| 3917 | int hash; | ||
| 3918 | Lisp_Object *tem; | ||
| 3919 | 3916 | ||
| 3920 | XSETFASTINT (oblength, OBARRAY_SIZE); | 3917 | XSETFASTINT (oblength, OBARRAY_SIZE); |
| 3921 | 3918 | ||
| 3922 | Qnil = Fmake_symbol (make_pure_c_string ("nil")); | ||
| 3923 | Vobarray = Fmake_vector (oblength, make_number (0)); | 3919 | Vobarray = Fmake_vector (oblength, make_number (0)); |
| 3924 | initial_obarray = Vobarray; | 3920 | initial_obarray = Vobarray; |
| 3925 | staticpro (&initial_obarray); | 3921 | staticpro (&initial_obarray); |
| 3926 | /* Intern nil in the obarray */ | ||
| 3927 | XSYMBOL (Qnil)->interned = SYMBOL_INTERNED_IN_INITIAL_OBARRAY; | ||
| 3928 | XSYMBOL (Qnil)->constant = 1; | ||
| 3929 | |||
| 3930 | /* These locals are to kludge around a pyramid compiler bug. */ | ||
| 3931 | hash = hash_string ("nil", 3); | ||
| 3932 | /* Separate statement here to avoid VAXC bug. */ | ||
| 3933 | hash %= OBARRAY_SIZE; | ||
| 3934 | tem = &XVECTOR (Vobarray)->contents[hash]; | ||
| 3935 | *tem = Qnil; | ||
| 3936 | 3922 | ||
| 3937 | Qunbound = Fmake_symbol (make_pure_c_string ("unbound")); | 3923 | Qunbound = Fmake_symbol (make_pure_c_string ("unbound")); |
| 3938 | XSYMBOL (Qnil)->function = Qunbound; | 3924 | /* Set temporary dummy values to Qnil and Vpurify_flag to satisfy the |
| 3939 | XSYMBOL (Qunbound)->value = Qunbound; | 3925 | NILP (Vpurify_flag) check in intern_c_string. */ |
| 3926 | Qnil = make_number (-1); Vpurify_flag = make_number (1); | ||
| 3927 | Qnil = intern_c_string ("nil"); | ||
| 3928 | |||
| 3929 | /* Fmake_symbol inits fields of new symbols with Qunbound and Qnil, | ||
| 3930 | so those two need to be fixed manally. */ | ||
| 3931 | SET_SYMBOL_VAL (XSYMBOL (Qunbound), Qunbound); | ||
| 3940 | XSYMBOL (Qunbound)->function = Qunbound; | 3932 | XSYMBOL (Qunbound)->function = Qunbound; |
| 3933 | XSYMBOL (Qunbound)->plist = Qnil; | ||
| 3934 | /* XSYMBOL (Qnil)->function = Qunbound; */ | ||
| 3935 | SET_SYMBOL_VAL (XSYMBOL (Qnil), Qnil); | ||
| 3936 | XSYMBOL (Qnil)->constant = 1; | ||
| 3937 | XSYMBOL (Qnil)->plist = Qnil; | ||
| 3941 | 3938 | ||
| 3942 | Qt = intern_c_string ("t"); | 3939 | Qt = intern_c_string ("t"); |
| 3943 | XSYMBOL (Qnil)->value = Qnil; | 3940 | SET_SYMBOL_VAL (XSYMBOL (Qt), Qt); |
| 3944 | XSYMBOL (Qnil)->plist = Qnil; | ||
| 3945 | XSYMBOL (Qt)->value = Qt; | ||
| 3946 | XSYMBOL (Qt)->constant = 1; | 3941 | XSYMBOL (Qt)->constant = 1; |
| 3947 | 3942 | ||
| 3948 | /* Qt is correct even if CANNOT_DUMP. loadup.el will set to nil at end. */ | 3943 | /* Qt is correct even if CANNOT_DUMP. loadup.el will set to nil at end. */ |
| @@ -3981,27 +3976,29 @@ defalias (sname, string) | |||
| 3981 | to a C variable of type int. Sample call: | 3976 | to a C variable of type int. Sample call: |
| 3982 | DEFVAR_INT ("emacs-priority", &emacs_priority, "Documentation"); */ | 3977 | DEFVAR_INT ("emacs-priority", &emacs_priority, "Documentation"); */ |
| 3983 | void | 3978 | void |
| 3984 | defvar_int (const char *namestring, EMACS_INT *address) | 3979 | defvar_int (struct Lisp_Intfwd *i_fwd, |
| 3980 | const char *namestring, EMACS_INT *address) | ||
| 3985 | { | 3981 | { |
| 3986 | Lisp_Object sym, val; | 3982 | Lisp_Object sym; |
| 3987 | sym = intern_c_string (namestring); | 3983 | sym = intern_c_string (namestring); |
| 3988 | val = allocate_misc (); | 3984 | i_fwd->type = Lisp_Fwd_Int; |
| 3989 | XMISCTYPE (val) = Lisp_Misc_Intfwd; | 3985 | i_fwd->intvar = address; |
| 3990 | XINTFWD (val)->intvar = address; | 3986 | XSYMBOL (sym)->redirect = SYMBOL_FORWARDED; |
| 3991 | SET_SYMBOL_VALUE (sym, val); | 3987 | SET_SYMBOL_FWD (XSYMBOL (sym), (union Lisp_Fwd *)i_fwd); |
| 3992 | } | 3988 | } |
| 3993 | 3989 | ||
| 3994 | /* Similar but define a variable whose value is t if address contains 1, | 3990 | /* Similar but define a variable whose value is t if address contains 1, |
| 3995 | nil if address contains 0. */ | 3991 | nil if address contains 0. */ |
| 3996 | void | 3992 | void |
| 3997 | defvar_bool (const char *namestring, int *address) | 3993 | defvar_bool (struct Lisp_Boolfwd *b_fwd, |
| 3994 | const char *namestring, int *address) | ||
| 3998 | { | 3995 | { |
| 3999 | Lisp_Object sym, val; | 3996 | Lisp_Object sym; |
| 4000 | sym = intern_c_string (namestring); | 3997 | sym = intern_c_string (namestring); |
| 4001 | val = allocate_misc (); | 3998 | b_fwd->type = Lisp_Fwd_Bool; |
| 4002 | XMISCTYPE (val) = Lisp_Misc_Boolfwd; | 3999 | b_fwd->boolvar = address; |
| 4003 | XBOOLFWD (val)->boolvar = address; | 4000 | XSYMBOL (sym)->redirect = SYMBOL_FORWARDED; |
| 4004 | SET_SYMBOL_VALUE (sym, val); | 4001 | SET_SYMBOL_FWD (XSYMBOL (sym), (union Lisp_Fwd *)b_fwd); |
| 4005 | Vbyte_boolean_vars = Fcons (sym, Vbyte_boolean_vars); | 4002 | Vbyte_boolean_vars = Fcons (sym, Vbyte_boolean_vars); |
| 4006 | } | 4003 | } |
| 4007 | 4004 | ||
| @@ -4011,20 +4008,22 @@ defvar_bool (const char *namestring, int *address) | |||
| 4011 | gc-marked for some other reason, since marking the same slot twice | 4008 | gc-marked for some other reason, since marking the same slot twice |
| 4012 | can cause trouble with strings. */ | 4009 | can cause trouble with strings. */ |
| 4013 | void | 4010 | void |
| 4014 | defvar_lisp_nopro (const char *namestring, Lisp_Object *address) | 4011 | defvar_lisp_nopro (struct Lisp_Objfwd *o_fwd, |
| 4012 | const char *namestring, Lisp_Object *address) | ||
| 4015 | { | 4013 | { |
| 4016 | Lisp_Object sym, val; | 4014 | Lisp_Object sym; |
| 4017 | sym = intern_c_string (namestring); | 4015 | sym = intern_c_string (namestring); |
| 4018 | val = allocate_misc (); | 4016 | o_fwd->type = Lisp_Fwd_Obj; |
| 4019 | XMISCTYPE (val) = Lisp_Misc_Objfwd; | 4017 | o_fwd->objvar = address; |
| 4020 | XOBJFWD (val)->objvar = address; | 4018 | XSYMBOL (sym)->redirect = SYMBOL_FORWARDED; |
| 4021 | SET_SYMBOL_VALUE (sym, val); | 4019 | SET_SYMBOL_FWD (XSYMBOL (sym), (union Lisp_Fwd *)o_fwd); |
| 4022 | } | 4020 | } |
| 4023 | 4021 | ||
| 4024 | void | 4022 | void |
| 4025 | defvar_lisp (const char *namestring, Lisp_Object *address) | 4023 | defvar_lisp (struct Lisp_Objfwd *o_fwd, |
| 4024 | const char *namestring, Lisp_Object *address) | ||
| 4026 | { | 4025 | { |
| 4027 | defvar_lisp_nopro (namestring, address); | 4026 | defvar_lisp_nopro (o_fwd, namestring, address); |
| 4028 | staticpro (address); | 4027 | staticpro (address); |
| 4029 | } | 4028 | } |
| 4030 | 4029 | ||
| @@ -4032,14 +4031,15 @@ defvar_lisp (const char *namestring, Lisp_Object *address) | |||
| 4032 | at a particular offset in the current kboard object. */ | 4031 | at a particular offset in the current kboard object. */ |
| 4033 | 4032 | ||
| 4034 | void | 4033 | void |
| 4035 | defvar_kboard (const char *namestring, int offset) | 4034 | defvar_kboard (struct Lisp_Kboard_Objfwd *ko_fwd, |
| 4035 | const char *namestring, int offset) | ||
| 4036 | { | 4036 | { |
| 4037 | Lisp_Object sym, val; | 4037 | Lisp_Object sym; |
| 4038 | sym = intern_c_string (namestring); | 4038 | sym = intern_c_string (namestring); |
| 4039 | val = allocate_misc (); | 4039 | ko_fwd->type = Lisp_Fwd_Kboard_Obj; |
| 4040 | XMISCTYPE (val) = Lisp_Misc_Kboard_Objfwd; | 4040 | ko_fwd->offset = offset; |
| 4041 | XKBOARD_OBJFWD (val)->offset = offset; | 4041 | XSYMBOL (sym)->redirect = SYMBOL_FORWARDED; |
| 4042 | SET_SYMBOL_VALUE (sym, val); | 4042 | SET_SYMBOL_FWD (XSYMBOL (sym), (union Lisp_Fwd *)ko_fwd); |
| 4043 | } | 4043 | } |
| 4044 | 4044 | ||
| 4045 | /* Record the value of load-path used at the start of dumping | 4045 | /* Record the value of load-path used at the start of dumping |
diff --git a/src/nsmenu.m b/src/nsmenu.m index 2581be9aeb7..f85ebc165af 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m | |||
| @@ -1709,7 +1709,7 @@ void process_dialog (id window, Lisp_Object list) | |||
| 1709 | 1709 | ||
| 1710 | - (Lisp_Object)runDialogAt: (NSPoint)p | 1710 | - (Lisp_Object)runDialogAt: (NSPoint)p |
| 1711 | { | 1711 | { |
| 1712 | int ret; | 1712 | NSInteger ret; |
| 1713 | extern EMACS_TIME timer_check (int do_it_now); /* TODO: add to a header */ | 1713 | extern EMACS_TIME timer_check (int do_it_now); /* TODO: add to a header */ |
| 1714 | 1714 | ||
| 1715 | /* initiate a session that will be ended by pop_down_menu */ | 1715 | /* initiate a session that will be ended by pop_down_menu */ |
diff --git a/src/print.c b/src/print.c index ccbf8d8c0c7..6d403e00fe0 100644 --- a/src/print.c +++ b/src/print.c | |||
| @@ -2267,70 +2267,6 @@ print_object (obj, printcharfun, escapeflag) | |||
| 2267 | strout ("#<misc free cell>", -1, -1, printcharfun, 0); | 2267 | strout ("#<misc free cell>", -1, -1, printcharfun, 0); |
| 2268 | break; | 2268 | break; |
| 2269 | 2269 | ||
| 2270 | case Lisp_Misc_Intfwd: | ||
| 2271 | sprintf (buf, "#<intfwd to %ld>", (long) *XINTFWD (obj)->intvar); | ||
| 2272 | strout (buf, -1, -1, printcharfun, 0); | ||
| 2273 | break; | ||
| 2274 | |||
| 2275 | case Lisp_Misc_Boolfwd: | ||
| 2276 | sprintf (buf, "#<boolfwd to %s>", | ||
| 2277 | (*XBOOLFWD (obj)->boolvar ? "t" : "nil")); | ||
| 2278 | strout (buf, -1, -1, printcharfun, 0); | ||
| 2279 | break; | ||
| 2280 | |||
| 2281 | case Lisp_Misc_Objfwd: | ||
| 2282 | strout ("#<objfwd to ", -1, -1, printcharfun, 0); | ||
| 2283 | print_object (*XOBJFWD (obj)->objvar, printcharfun, escapeflag); | ||
| 2284 | PRINTCHAR ('>'); | ||
| 2285 | break; | ||
| 2286 | |||
| 2287 | case Lisp_Misc_Buffer_Objfwd: | ||
| 2288 | strout ("#<buffer_objfwd to ", -1, -1, printcharfun, 0); | ||
| 2289 | print_object (PER_BUFFER_VALUE (current_buffer, | ||
| 2290 | XBUFFER_OBJFWD (obj)->offset), | ||
| 2291 | printcharfun, escapeflag); | ||
| 2292 | PRINTCHAR ('>'); | ||
| 2293 | break; | ||
| 2294 | |||
| 2295 | case Lisp_Misc_Kboard_Objfwd: | ||
| 2296 | strout ("#<kboard_objfwd to ", -1, -1, printcharfun, 0); | ||
| 2297 | print_object (*(Lisp_Object *) ((char *) current_kboard | ||
| 2298 | + XKBOARD_OBJFWD (obj)->offset), | ||
| 2299 | printcharfun, escapeflag); | ||
| 2300 | PRINTCHAR ('>'); | ||
| 2301 | break; | ||
| 2302 | |||
| 2303 | case Lisp_Misc_Buffer_Local_Value: | ||
| 2304 | strout ("#<buffer_local_value ", -1, -1, printcharfun, 0); | ||
| 2305 | if (XBUFFER_LOCAL_VALUE (obj)->local_if_set) | ||
| 2306 | strout ("[local-if-set] ", -1, -1, printcharfun, 0); | ||
| 2307 | strout ("[realvalue] ", -1, -1, printcharfun, 0); | ||
| 2308 | print_object (XBUFFER_LOCAL_VALUE (obj)->realvalue, | ||
| 2309 | printcharfun, escapeflag); | ||
| 2310 | if (XBUFFER_LOCAL_VALUE (obj)->found_for_buffer) | ||
| 2311 | strout ("[local in buffer] ", -1, -1, printcharfun, 0); | ||
| 2312 | else | ||
| 2313 | strout ("[buffer] ", -1, -1, printcharfun, 0); | ||
| 2314 | print_object (XBUFFER_LOCAL_VALUE (obj)->buffer, | ||
| 2315 | printcharfun, escapeflag); | ||
| 2316 | if (XBUFFER_LOCAL_VALUE (obj)->check_frame) | ||
| 2317 | { | ||
| 2318 | if (XBUFFER_LOCAL_VALUE (obj)->found_for_frame) | ||
| 2319 | strout ("[local in frame] ", -1, -1, printcharfun, 0); | ||
| 2320 | else | ||
| 2321 | strout ("[frame] ", -1, -1, printcharfun, 0); | ||
| 2322 | print_object (XBUFFER_LOCAL_VALUE (obj)->frame, | ||
| 2323 | printcharfun, escapeflag); | ||
| 2324 | } | ||
| 2325 | strout ("[alist-elt] ", -1, -1, printcharfun, 0); | ||
| 2326 | print_object (XCAR (XBUFFER_LOCAL_VALUE (obj)->cdr), | ||
| 2327 | printcharfun, escapeflag); | ||
| 2328 | strout ("[default-value] ", -1, -1, printcharfun, 0); | ||
| 2329 | print_object (XCDR (XBUFFER_LOCAL_VALUE (obj)->cdr), | ||
| 2330 | printcharfun, escapeflag); | ||
| 2331 | PRINTCHAR ('>'); | ||
| 2332 | break; | ||
| 2333 | |||
| 2334 | case Lisp_Misc_Save_Value: | 2270 | case Lisp_Misc_Save_Value: |
| 2335 | strout ("#<save_value ", -1, -1, printcharfun, 0); | 2271 | strout ("#<save_value ", -1, -1, printcharfun, 0); |
| 2336 | sprintf(buf, "ptr=0x%08lx int=%d", | 2272 | sprintf(buf, "ptr=0x%08lx int=%d", |
diff --git a/src/s/darwin.h b/src/s/darwin.h index e8081c6dd25..016ed343f06 100644 --- a/src/s/darwin.h +++ b/src/s/darwin.h | |||
| @@ -90,6 +90,24 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 90 | */ | 90 | */ |
| 91 | 91 | ||
| 92 | #define HAVE_PTYS | 92 | #define HAVE_PTYS |
| 93 | /* Run only once. We need a `for'-loop because the code uses | ||
| 94 | `continue'. */ | ||
| 95 | #define PTY_ITERATION for (i = 0; i < 1; i++) | ||
| 96 | #define PTY_NAME_SPRINTF /* none */ | ||
| 97 | #define PTY_TTY_NAME_SPRINTF /* none */ | ||
| 98 | /* Note that openpty may fork via grantpt on Mac OS X 10.4/Darwin 8. | ||
| 99 | But we don't have to block SIGCHLD because it is blocked in the | ||
| 100 | implementation of grantpt. */ | ||
| 101 | #define PTY_OPEN \ | ||
| 102 | do \ | ||
| 103 | { \ | ||
| 104 | int slave; \ | ||
| 105 | if (openpty (&fd, &slave, pty_name, NULL, NULL) == -1) \ | ||
| 106 | fd = -1; \ | ||
| 107 | else \ | ||
| 108 | emacs_close (slave); \ | ||
| 109 | } \ | ||
| 110 | while (0) | ||
| 93 | 111 | ||
| 94 | /** | 112 | /** |
| 95 | * PTYs only work correctly on Darwin 7 or higher. So make the | 113 | * PTYs only work correctly on Darwin 7 or higher. So make the |
diff --git a/src/term.c b/src/term.c index df7dc9ee464..20f746decdb 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -2244,7 +2244,7 @@ set_tty_color_mode (tty, f) | |||
| 2244 | struct tty_display_info *tty; | 2244 | struct tty_display_info *tty; |
| 2245 | struct frame *f; | 2245 | struct frame *f; |
| 2246 | { | 2246 | { |
| 2247 | Lisp_Object tem, val, color_mode_spec; | 2247 | Lisp_Object tem, val; |
| 2248 | Lisp_Object color_mode; | 2248 | Lisp_Object color_mode; |
| 2249 | int mode; | 2249 | int mode; |
| 2250 | extern Lisp_Object Qtty_color_mode; | 2250 | extern Lisp_Object Qtty_color_mode; |
| @@ -2256,12 +2256,13 @@ set_tty_color_mode (tty, f) | |||
| 2256 | 2256 | ||
| 2257 | if (INTEGERP (val)) | 2257 | if (INTEGERP (val)) |
| 2258 | color_mode = val; | 2258 | color_mode = val; |
| 2259 | else | 2259 | else if (SYMBOLP (tty_color_mode_alist)) |
| 2260 | { | 2260 | { |
| 2261 | tem = (NILP (tty_color_mode_alist) ? Qnil | 2261 | tem = Fassq (val, Fsymbol_value (tty_color_mode_alist)); |
| 2262 | : Fassq (val, XSYMBOL (tty_color_mode_alist)->value)); | ||
| 2263 | color_mode = CONSP (tem) ? XCDR (tem) : Qnil; | 2262 | color_mode = CONSP (tem) ? XCDR (tem) : Qnil; |
| 2264 | } | 2263 | } |
| 2264 | else | ||
| 2265 | color_mode = Qnil; | ||
| 2265 | 2266 | ||
| 2266 | mode = INTEGERP (color_mode) ? XINT (color_mode) : 0; | 2267 | mode = INTEGERP (color_mode) ? XINT (color_mode) : 0; |
| 2267 | 2268 | ||
diff --git a/src/xdisp.c b/src/xdisp.c index d0bf26e1f00..6728e01f3bd 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -80,7 +80,39 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 80 | You will find a lot of redisplay optimizations when you start | 80 | You will find a lot of redisplay optimizations when you start |
| 81 | looking at the innards of redisplay. The overall goal of all these | 81 | looking at the innards of redisplay. The overall goal of all these |
| 82 | optimizations is to make redisplay fast because it is done | 82 | optimizations is to make redisplay fast because it is done |
| 83 | frequently. | 83 | frequently. Some of these optimizations are implemented by the |
| 84 | following functions: | ||
| 85 | |||
| 86 | . try_cursor_movement | ||
| 87 | |||
| 88 | This function tries to update the display if the text in the | ||
| 89 | window did not change and did not scroll, only point moved, and | ||
| 90 | it did not move off the displayed portion of the text. | ||
| 91 | |||
| 92 | . try_window_reusing_current_matrix | ||
| 93 | |||
| 94 | This function reuses the current matrix of a window when text | ||
| 95 | has not changed, but the window start changed (e.g., due to | ||
| 96 | scrolling). | ||
| 97 | |||
| 98 | . try_window_id | ||
| 99 | |||
| 100 | This function attempts to redisplay a window by reusing parts of | ||
| 101 | its existing display. It finds and reuses the part that was not | ||
| 102 | changed, and redraws the rest. | ||
| 103 | |||
| 104 | . try_window | ||
| 105 | |||
| 106 | This function performs the full redisplay of a single window | ||
| 107 | assuming that its fonts were not changed and that the cursor | ||
| 108 | will not end up in the scroll margins. (Loading fonts requires | ||
| 109 | re-adjustment of dimensions of glyph matrices, which makes this | ||
| 110 | method impossible to use.) | ||
| 111 | |||
| 112 | These optimizations are tried in sequence (some can be skipped if | ||
| 113 | it is known that they are not applicable). If none of the | ||
| 114 | optimizations were successful, redisplay calls redisplay_windows, | ||
| 115 | which performs a full redisplay of all windows. | ||
| 84 | 116 | ||
| 85 | Desired matrices. | 117 | Desired matrices. |
| 86 | 118 | ||
| @@ -112,13 +144,16 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 112 | see in dispextern.h. | 144 | see in dispextern.h. |
| 113 | 145 | ||
| 114 | Glyphs in a desired matrix are normally constructed in a loop | 146 | Glyphs in a desired matrix are normally constructed in a loop |
| 115 | calling get_next_display_element and then produce_glyphs. The call | 147 | calling get_next_display_element and then PRODUCE_GLYPHS. The call |
| 116 | to produce_glyphs will fill the iterator structure with pixel | 148 | to PRODUCE_GLYPHS will fill the iterator structure with pixel |
| 117 | information about the element being displayed and at the same time | 149 | information about the element being displayed and at the same time |
| 118 | produce glyphs for it. If the display element fits on the line | 150 | produce glyphs for it. If the display element fits on the line |
| 119 | being displayed, set_iterator_to_next is called next, otherwise the | 151 | being displayed, set_iterator_to_next is called next, otherwise the |
| 120 | glyphs produced are discarded. | 152 | glyphs produced are discarded. The function display_line is the |
| 121 | 153 | workhorse of filling glyph rows in the desired matrix with glyphs. | |
| 154 | In addition to producing glyphs, it also handles line truncation | ||
| 155 | and continuation, word wrap, and cursor positioning (for the | ||
| 156 | latter, see also set_cursor_from_row). | ||
| 122 | 157 | ||
| 123 | Frame matrices. | 158 | Frame matrices. |
| 124 | 159 | ||
| @@ -139,7 +174,50 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 139 | wanted to have without having to move many bytes around. To be | 174 | wanted to have without having to move many bytes around. To be |
| 140 | honest, there is a little bit more done, but not much more. If you | 175 | honest, there is a little bit more done, but not much more. If you |
| 141 | plan to extend that code, take a look at dispnew.c. The function | 176 | plan to extend that code, take a look at dispnew.c. The function |
| 142 | build_frame_matrix is a good starting point. */ | 177 | build_frame_matrix is a good starting point. |
| 178 | |||
| 179 | Bidirectional display. | ||
| 180 | |||
| 181 | Bidirectional display adds quite some hair to this already complex | ||
| 182 | design. The good news are that a large portion of that hairy stuff | ||
| 183 | is hidden in bidi.c behind only 3 interfaces. bidi.c implements a | ||
| 184 | reordering engine which is called by set_iterator_to_next and | ||
| 185 | returns the next character to display in the visual order. See | ||
| 186 | commentary on bidi.c for more details. As far as redisplay is | ||
| 187 | concerned, the effect of calling bidi_get_next_char_visually, the | ||
| 188 | main interface of the reordering engine, is that the iterator gets | ||
| 189 | magically placed on the buffer or string position that is to be | ||
| 190 | displayed next. In other words, a linear iteration through the | ||
| 191 | buffer/string is replaced with a non-linear one. All the rest of | ||
| 192 | the redisplay is oblivious to the bidi reordering. | ||
| 193 | |||
| 194 | Well, almost oblivious---there are still complications, most of | ||
| 195 | them due to the fact that buffer and string positions no longer | ||
| 196 | change monotonously with glyph indices in a glyph row. Moreover, | ||
| 197 | for continued lines, the buffer positions may not even be | ||
| 198 | monotonously changing with vertical positions. Also, accounting | ||
| 199 | for face changes, overlays, etc. becomes more complex because | ||
| 200 | non-linear iteration could potentially skip many positions with | ||
| 201 | changes, and then cross them again on the way back... | ||
| 202 | |||
| 203 | One other prominent effect of bidirectional display is that some | ||
| 204 | paragraphs of text need to be displayed starting at the right | ||
| 205 | margin of the window---the so-called right-to-left, or R2L | ||
| 206 | paragraphs. R2L paragraphs are displayed with R2L glyph rows, | ||
| 207 | which have their reversed_p flag set. The bidi reordering engine | ||
| 208 | produces characters in such rows starting from the character which | ||
| 209 | should be the rightmost on display. PRODUCE_GLYPHS then reverses | ||
| 210 | the order, when it fills up the glyph row whose reversed_p flag is | ||
| 211 | set, by prepending each new glyph to what is already there, instead | ||
| 212 | of appending it. When the glyph row is complete, the function | ||
| 213 | extend_face_to_end_of_line fills the empty space to the left of the | ||
| 214 | leftmost character with special glyphs, which will display as, | ||
| 215 | well, empty. On text terminals, these special glyphs are simply | ||
| 216 | blank characters. On graphics terminals, there's a single stretch | ||
| 217 | glyph with suitably computed width. Both the blanks and the | ||
| 218 | stretch glyph are given the face of the background of the line. | ||
| 219 | This way, the terminal-specific back-end can still draw the glyphs | ||
| 220 | left to right, even for R2L lines. */ | ||
| 143 | 221 | ||
| 144 | #include <config.h> | 222 | #include <config.h> |
| 145 | #include <stdio.h> | 223 | #include <stdio.h> |
| @@ -11514,7 +11592,7 @@ static void | |||
| 11514 | select_frame_for_redisplay (frame) | 11592 | select_frame_for_redisplay (frame) |
| 11515 | Lisp_Object frame; | 11593 | Lisp_Object frame; |
| 11516 | { | 11594 | { |
| 11517 | Lisp_Object tail, symbol, val; | 11595 | Lisp_Object tail, tem; |
| 11518 | Lisp_Object old = selected_frame; | 11596 | Lisp_Object old = selected_frame; |
| 11519 | struct Lisp_Symbol *sym; | 11597 | struct Lisp_Symbol *sym; |
| 11520 | 11598 | ||
| @@ -11522,20 +11600,18 @@ select_frame_for_redisplay (frame) | |||
| 11522 | 11600 | ||
| 11523 | selected_frame = frame; | 11601 | selected_frame = frame; |
| 11524 | 11602 | ||
| 11525 | do | 11603 | do { |
| 11526 | { | 11604 | for (tail = XFRAME (frame)->param_alist; CONSP (tail); tail = XCDR (tail)) |
| 11527 | for (tail = XFRAME (frame)->param_alist; CONSP (tail); tail = XCDR (tail)) | 11605 | if (CONSP (XCAR (tail)) |
| 11528 | if (CONSP (XCAR (tail)) | 11606 | && (tem = XCAR (XCAR (tail)), |
| 11529 | && (symbol = XCAR (XCAR (tail)), | 11607 | SYMBOLP (tem)) |
| 11530 | SYMBOLP (symbol)) | 11608 | && (sym = indirect_variable (XSYMBOL (tem)), |
| 11531 | && (sym = indirect_variable (XSYMBOL (symbol)), | 11609 | sym->redirect == SYMBOL_LOCALIZED) |
| 11532 | val = sym->value, | 11610 | && sym->val.blv->frame_local) |
| 11533 | (BUFFER_LOCAL_VALUEP (val))) | 11611 | /* Use find_symbol_value rather than Fsymbol_value |
| 11534 | && XBUFFER_LOCAL_VALUE (val)->check_frame) | 11612 | to avoid an error if it is void. */ |
| 11535 | /* Use find_symbol_value rather than Fsymbol_value | 11613 | find_symbol_value (tem); |
| 11536 | to avoid an error if it is void. */ | 11614 | } while (!EQ (frame, old) && (frame = old, 1)); |
| 11537 | find_symbol_value (symbol); | ||
| 11538 | } while (!EQ (frame, old) && (frame = old, 1)); | ||
| 11539 | } | 11615 | } |
| 11540 | 11616 | ||
| 11541 | 11617 | ||