diff options
| author | Joakim Verona | 2013-01-11 00:03:43 +0100 |
|---|---|---|
| committer | Joakim Verona | 2013-01-11 00:03:43 +0100 |
| commit | 26f277ba01010776e63623d446f182f5b6f23dd3 (patch) | |
| tree | aa2a9a9f31241f687902eafafc1535ea23bd1887 | |
| parent | 09708f70bd02e7a2edec79e1bcfd04fb9b7f48d3 (diff) | |
| parent | a778dd57d0da9004a72320f8082d4f6220f178e2 (diff) | |
| download | emacs-26f277ba01010776e63623d446f182f5b6f23dd3.tar.gz emacs-26f277ba01010776e63623d446f182f5b6f23dd3.zip | |
auto upstream
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | admin/ChangeLog | 11 | ||||
| -rw-r--r-- | admin/make-tarball.txt | 99 | ||||
| -rw-r--r-- | doc/lispref/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/lispref/commands.texi | 8 | ||||
| -rw-r--r-- | doc/misc/ChangeLog | 4 | ||||
| -rw-r--r-- | doc/misc/tramp.texi | 16 | ||||
| -rw-r--r-- | etc/ChangeLog | 2 | ||||
| -rw-r--r-- | etc/NEWS | 3 | ||||
| -rw-r--r-- | lib/getopt.in.h | 2 | ||||
| -rw-r--r-- | lib/stdlib.in.h | 5 | ||||
| -rw-r--r-- | lib/unistd.in.h | 2 | ||||
| -rw-r--r-- | lisp/ChangeLog | 115 | ||||
| -rw-r--r-- | lisp/autorevert.el | 101 | ||||
| -rw-r--r-- | lisp/cus-start.el | 6 | ||||
| -rw-r--r-- | lisp/doc-view.el | 236 | ||||
| -rw-r--r-- | lisp/emacs-lisp/authors.el | 16 | ||||
| -rw-r--r-- | lisp/emacs-lisp/crm.el | 59 | ||||
| -rw-r--r-- | lisp/faces.el | 36 | ||||
| -rw-r--r-- | lisp/files.el | 2 | ||||
| -rw-r--r-- | lisp/image-mode.el | 5 | ||||
| -rw-r--r-- | lisp/imenu.el | 2 | ||||
| -rw-r--r-- | lisp/man.el | 79 | ||||
| -rw-r--r-- | lisp/progmodes/cc-engine.el | 42 | ||||
| -rw-r--r-- | lisp/progmodes/which-func.el | 4 | ||||
| -rw-r--r-- | lisp/simple.el | 6 | ||||
| -rw-r--r-- | src/ChangeLog | 25 | ||||
| -rw-r--r-- | src/buffer.c | 86 | ||||
| -rw-r--r-- | src/buffer.h | 1 | ||||
| -rw-r--r-- | src/data.c | 10 | ||||
| -rw-r--r-- | src/gtkutil.c | 2 | ||||
| -rw-r--r-- | src/lisp.h | 3 | ||||
| -rw-r--r-- | test/ChangeLog | 4 | ||||
| -rw-r--r-- | test/automated/man-tests.el | 118 |
34 files changed, 791 insertions, 329 deletions
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-01-10 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Merge from gnulib, incorporating: | ||
| 4 | 2013-01-09 stdlib: port to Solaris 2.6 | ||
| 5 | |||
| 1 | 2013-01-04 Glenn Morris <rgm@gnu.org> | 6 | 2013-01-04 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * info/dir: Add htmlfontify. | 8 | * info/dir: Add htmlfontify. |
diff --git a/admin/ChangeLog b/admin/ChangeLog index fa001ede6cb..7d77becb522 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog | |||
| @@ -132,15 +132,14 @@ | |||
| 132 | 132 | ||
| 133 | * grammars/bovine-grammar.el (bovine--grammar-newstyle-unquote): | 133 | * grammars/bovine-grammar.el (bovine--grammar-newstyle-unquote): |
| 134 | Remove. | 134 | Remove. |
| 135 | (bovine-grammar-expand-form): Test for emacs-major-version. | 135 | (bovine-grammar-expand-form): Test for emacs-major-version. |
| 136 | 136 | ||
| 137 | * grammars/c.by: Add EXPLICIT to keyword tokens. | 137 | * grammars/c.by: Add EXPLICIT to keyword tokens. |
| 138 | Add %provide token. | ||
| 138 | 139 | ||
| 139 | * grammars/f90.by: Add %provide token. | 140 | * grammars/grammar.wy (semantic-grammar-lexer): Remove, since it |
| 140 | |||
| 141 | * grammar/grammar.wy (semantic-grammar-lexer): Remove, since it | ||
| 142 | was copied to grammar.el. New %provide token to generate prefix | 141 | was copied to grammar.el. New %provide token to generate prefix |
| 143 | which conforms with Emacs conventions. Remove lexer definition, | 142 | which conforms with Emacs conventions. Remove lexer definition, |
| 144 | which is now in grammar.el. | 143 | which is now in grammar.el. |
| 145 | 144 | ||
| 146 | 2012-09-27 Glenn Morris <rgm@gnu.org> | 145 | 2012-09-27 Glenn Morris <rgm@gnu.org> |
| @@ -184,7 +183,7 @@ | |||
| 184 | 2012-09-13 Paul Eggert <eggert@cs.ucla.edu> | 183 | 2012-09-13 Paul Eggert <eggert@cs.ucla.edu> |
| 185 | 184 | ||
| 186 | Simplify SIGIO usage (Bug#12408). | 185 | Simplify SIGIO usage (Bug#12408). |
| 187 | * CPP_DEFINES (BROKEN_SIGAIO, BROKEN_SIGIO, BROKEN_SIGPOLL) | 186 | * CPP-DEFINES (BROKEN_SIGAIO, BROKEN_SIGIO, BROKEN_SIGPOLL) |
| 188 | (BROKEN_SIGPTY, NO_TERMIO): Remove. | 187 | (BROKEN_SIGPTY, NO_TERMIO): Remove. |
| 189 | 188 | ||
| 190 | 2012-09-11 Paul Eggert <eggert@cs.ucla.edu> | 189 | 2012-09-11 Paul Eggert <eggert@cs.ucla.edu> |
diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt index 573bb218c43..3825ac49278 100644 --- a/admin/make-tarball.txt +++ b/admin/make-tarball.txt | |||
| @@ -2,22 +2,46 @@ Instructions to create pretest or release tarballs. | |||
| 2 | -- originally written by Gerd Moellmann, amended by Francesco Potort́ | 2 | -- originally written by Gerd Moellmann, amended by Francesco Potort́ |
| 3 | with the initial help of Eli Zaretskii | 3 | with the initial help of Eli Zaretskii |
| 4 | 4 | ||
| 5 | For each step, check for possible errors. | ||
| 6 | 5 | ||
| 7 | 0. Decide on versions of automake and autoconf, and ensure you will | 6 | Steps to take before starting on the first pretest in any release sequence: |
| 7 | |||
| 8 | 1. Decide on versions of automake and autoconf, and ensure you will | ||
| 8 | have them available for the duration of the release process. | 9 | have them available for the duration of the release process. |
| 9 | 10 | ||
| 11 | 2. Consider increasing the value of the variable | ||
| 12 | `customize-changed-options-previous-release' in cus-edit.el to | ||
| 13 | refer to a newer version of Emacs. (This is probably needed only | ||
| 14 | when preparing the first pretest for a major Emacs release.) | ||
| 15 | Commit cus-edit.el if changed. | ||
| 16 | |||
| 17 | |||
| 18 | General steps (for each step, check for possible errors): | ||
| 19 | |||
| 10 | 1. `bzr update' (for a bound branch), or `bzr pull'. | 20 | 1. `bzr update' (for a bound branch), or `bzr pull'. |
| 11 | bzr status # check for locally modified files | 21 | bzr status # check for locally modified files |
| 12 | 22 | ||
| 13 | 2. Bootstrap to make 100% sure all elc files are up-to-date, and to | 23 | 2. Bootstrap to make 100% sure all elc files are up-to-date, and to |
| 14 | make sure that the later tagged version will bootstrap, should it be | 24 | make sure that the later tagged version will bootstrap, should it be |
| 15 | necessary to check it out. | 25 | necessary to check it out. |
| 16 | 26 | ||
| 17 | 3. Regenerate the etc/AUTHORS file: | 27 | 3. Regenerate the etc/AUTHORS file: |
| 18 | M-: (require 'authors) RET, M-x authors RET, save the *Authors* buffer. | 28 | M-: (require 'authors) RET |
| 19 | If there are errors that relate to syntactically incorrect | 29 | M-x authors RET |
| 20 | ChangeLog entries, consider fixing them and repeating. | 30 | |
| 31 | There is almost guaranteed to be an "*Authors Errors*" buffer with | ||
| 32 | problems caused by certain bad ChangeLog entries. You can ignore | ||
| 33 | the very old ones (eg lisp/erc has a lot). If there are errors | ||
| 34 | related to new entries (especially entries that are new since the | ||
| 35 | last pretest), see if you can fix them. If there was a ChangeLog | ||
| 36 | typo, fix it. If a file was deleted or renamed, consider adding | ||
| 37 | an appropriate entry to authors-ignored-files, authors-valid-file-names, | ||
| 38 | or authors-renamed-files-alist. | ||
| 39 | |||
| 40 | If necessary, repeat M-x authors after making those changes. | ||
| 41 | Save the "*Authors*" buffer as etc/AUTHORS. | ||
| 42 | Check the diff looks reasonable. Maybe add entries to | ||
| 43 | authors-ambiguous-files or authors-aliases, and repeat. | ||
| 44 | Commit any fixes to ChangeLogs or authors.el. | ||
| 21 | 45 | ||
| 22 | 4. Set the version number (M-x load-file RET admin/admin.el RET, then | 46 | 4. Set the version number (M-x load-file RET admin/admin.el RET, then |
| 23 | M-x set-version RET). For a release, add released ChangeLog | 47 | M-x set-version RET). For a release, add released ChangeLog |
| @@ -26,20 +50,18 @@ For each step, check for possible errors. | |||
| 26 | For a pretest, start at version .90. After .99, use .990 (so that | 50 | For a pretest, start at version .90. After .99, use .990 (so that |
| 27 | it sorts). | 51 | it sorts). |
| 28 | 52 | ||
| 29 | If needed, increment the value of the variable | ||
| 30 | `customize-changed-options-previous-release' in cus-edit.el to | ||
| 31 | refer to a newer release of Emacs. (This is probably needed only | ||
| 32 | when preparing a major Emacs release, or branching for it.) | ||
| 33 | |||
| 34 | 5. autoreconf -i -I m4 --force | 53 | 5. autoreconf -i -I m4 --force |
| 35 | make bootstrap | 54 | make bootstrap |
| 36 | 55 | ||
| 37 | 6. Commit etc/AUTHORS, all the files changed by M-x set-version, and | 56 | 6. Copy lisp/loaddefs.el to lisp/ldefs-boot.el. |
| 38 | lisp/cus-edit.el (if modified). | 57 | |
| 39 | Copy lisp/loaddefs.el to lisp/ldefs-boot.el and commit lisp/ldefs-boot.el. | 58 | Commit etc/AUTHORS, lisp/ldefs-boot.el, and the files changed |
| 59 | by M-x set-version. | ||
| 40 | For a release, also commit the ChangeLog files in all directories. | 60 | For a release, also commit the ChangeLog files in all directories. |
| 41 | 61 | ||
| 42 | 7. make-dist --snapshot. Check the contents of the new tar with | 62 | 7. ./make-dist --snapshot --no-compress |
| 63 | |||
| 64 | Check the contents of the new tar with | ||
| 43 | admin/diff-tar-files against an older tar file. Some old pretest | 65 | admin/diff-tar-files against an older tar file. Some old pretest |
| 44 | tarballs may be found at <ftp://alpha.gnu.org/gnu/emacs/pretest>; | 66 | tarballs may be found at <ftp://alpha.gnu.org/gnu/emacs/pretest>; |
| 45 | old release tarballs are at <ftp://ftp.gnu.org/pub/gnu/emacs/>. | 67 | old release tarballs are at <ftp://ftp.gnu.org/pub/gnu/emacs/>. |
| @@ -49,15 +71,15 @@ For each step, check for possible errors. | |||
| 49 | something like `find . | sort' in a clean bzr tree, and compare the | 71 | something like `find . | sort' in a clean bzr tree, and compare the |
| 50 | results against the new tar contents. | 72 | results against the new tar contents. |
| 51 | 73 | ||
| 52 | 8. tar -zxf emacs-NEW.tar.gz; cd emacs-NEW | 74 | 8. tar -xf emacs-NEW.tar; cd emacs-NEW |
| 53 | ./configure && make && make -n install | 75 | ./configure --prefix=/tmp/emacs && make && make install |
| 54 | Use `script' or M-x compile to save the compilation log in | 76 | Use `script' or M-x compile to save the compilation log in |
| 55 | compile-NEW.log and compare it against an old one. The easiest way | 77 | compile-NEW.log and compare it against an old one. The easiest way |
| 56 | to do that is to visit the old log in Emacs, change the version | 78 | to do that is to visit the old log in Emacs, change the version |
| 57 | number of the old Emacs to __, do the same with the new log and do | 79 | number of the old Emacs to __, do the same with the new log and do |
| 58 | M-x ediff. Especially check that Info files aren't built. | 80 | M-x ediff. Especially check that Info files aren't built. |
| 59 | 81 | ||
| 60 | 9. cd EMACS_ROOT_DIR; bzr tag TAG | 82 | 9. cd EMACS_ROOT_DIR && bzr tag TAG |
| 61 | TAG is emacs-XX.Y.ZZ for a pretest, emacs-XX.Y for a release. | 83 | TAG is emacs-XX.Y.ZZ for a pretest, emacs-XX.Y for a release. |
| 62 | 84 | ||
| 63 | Shortly before the release, cut the version branch also, and open | 85 | Shortly before the release, cut the version branch also, and open |
| @@ -65,16 +87,37 @@ For each step, check for possible errors. | |||
| 65 | be sent to the emacs-diffs mailing list (by default, the list | 87 | be sent to the emacs-diffs mailing list (by default, the list |
| 66 | normally only gets commits to the trunk). | 88 | normally only gets commits to the trunk). |
| 67 | 89 | ||
| 68 | 10. Now you should upload the files to the GNU ftp server. In order to | 90 | 10. Decide what compression schemes to offer. |
| 91 | For a release, at least gz and xz: | ||
| 92 | gzip --best -c emacs-NEW.tar > emacs-NEW.tar.gz | ||
| 93 | xz -c emacs-NEW.tar > emacs-NEW.tar.xz | ||
| 94 | |||
| 95 | Now you should upload the files to the GNU ftp server. In order to | ||
| 69 | do that, you must be registered as an Emacs maintainer and have your | 96 | do that, you must be registered as an Emacs maintainer and have your |
| 70 | GPG key acknowledged by the ftp people. For instructions, see | 97 | GPG key acknowledged by the ftp people. For instructions, see |
| 71 | http://www.gnu.org/prep/maintain/html_node/Automated-Upload-Registration.html | 98 | http://www.gnu.org/prep/maintain/html_node/Automated-Upload-Registration.html |
| 72 | You can use the gnulib script "gnupload" to upload each FILE, like this: | 99 | The simplest method is to use the gnulib <http://www.gnu.org/s/gnulib/> |
| 73 | gnupload --to alpha.gnu.org:emacs/pretest FILE (for a pretest) | 100 | script "build-aux/gnupload" to upload each FILE, like this: |
| 74 | gnupload --to ftp.gnu.org:emacs FILE (for a release) | 101 | |
| 102 | For a pretest: | ||
| 103 | gnupload [--user your@gpg.key.email] --to alpha.gnu.org:emacs/pretest \ | ||
| 104 | FILE.gz FILE.xz ... | ||
| 105 | |||
| 106 | For a release: | ||
| 107 | gnupload [--user your@gpg.key.email] --to ftp.gnu.org:emacs \ | ||
| 108 | FILE.gz FILE.xz ... | ||
| 109 | |||
| 110 | You only need the --user part if you have multiple GPG keys and do | ||
| 111 | not want to use the default. | ||
| 112 | Obviously, if you do not have a fast uplink, be prepared for the | ||
| 113 | upload to take a while. | ||
| 114 | |||
| 115 | |||
| 116 | If you prefer to do it yourself rather than use gnupload: | ||
| 117 | |||
| 118 | For each FILE, create a detached GPG binary signature and a | ||
| 119 | clearsigned directive file like this: | ||
| 75 | 120 | ||
| 76 | Instead of using gnupload, for each FILE, create a detached GPG | ||
| 77 | binary signature and a clearsigned directive file like this: | ||
| 78 | gpg -b FILE | 121 | gpg -b FILE |
| 79 | echo directory: emacs/pretest > FILE.directive (for a pretest) | 122 | echo directory: emacs/pretest > FILE.directive (for a pretest) |
| 80 | echo directory: emacs > FILE.directive (for a release) | 123 | echo directory: emacs > FILE.directive (for a release) |
| @@ -85,13 +128,12 @@ For each step, check for possible errors. | |||
| 85 | For a pretest, place the files in /incoming/alpha instead, so that | 128 | For a pretest, place the files in /incoming/alpha instead, so that |
| 86 | they appear on ftp://alpha.gnu.org/. | 129 | they appear on ftp://alpha.gnu.org/. |
| 87 | 130 | ||
| 88 | For a release, upload xz and bz2 tarfiles as well; this can save a lot | ||
| 89 | of bandwidth. | ||
| 90 | |||
| 91 | 11. After five minutes, verify that the files are visible at | 131 | 11. After five minutes, verify that the files are visible at |
| 92 | ftp://alpha.gnu.org/gnu/emacs/pretest/ for a pretest, at | 132 | ftp://alpha.gnu.org/gnu/emacs/pretest/ for a pretest, or |
| 93 | ftp://ftp.gnu.org/gnu/emacs/ for a release. | 133 | ftp://ftp.gnu.org/gnu/emacs/ for a release. |
| 94 | 134 | ||
| 135 | Download them and check the signatures. Check they build. | ||
| 136 | |||
| 95 | 12. For a pretest, announce it on emacs-devel and info-gnu-emacs@gnu.org. | 137 | 12. For a pretest, announce it on emacs-devel and info-gnu-emacs@gnu.org. |
| 96 | For a release, also announce it on info-gnu@gnu.org. (Probably | 138 | For a release, also announce it on info-gnu@gnu.org. (Probably |
| 97 | bcc the info- addresses to make it less likely that people will | 139 | bcc the info- addresses to make it less likely that people will |
| @@ -99,3 +141,4 @@ For each step, check for possible errors. | |||
| 99 | 141 | ||
| 100 | 13. For a release, update the Emacs homepage in the web repository. | 142 | 13. For a release, update the Emacs homepage in the web repository. |
| 101 | Also add the new NEWS file as NEWS.xx.y. | 143 | Also add the new NEWS file as NEWS.xx.y. |
| 144 | Maybe regenerate the html manuals, update the FAQ, etc, etc. | ||
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 64973ca38c5..2631bdf708a 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-01-09 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * commands.texi (Interactive Codes): | ||
| 4 | Whitespace does not terminate interactive "S". (Bug#13393) | ||
| 5 | |||
| 1 | 2013-01-06 Chong Yidong <cyd@gnu.org> | 6 | 2013-01-06 Chong Yidong <cyd@gnu.org> |
| 2 | 7 | ||
| 3 | * windows.texi (Vertical Scrolling): Fix typos (Bug#13267). | 8 | * windows.texi (Vertical Scrolling): Fix typos (Bug#13267). |
diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index f3589fc2edd..846d6f3a4a9 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi | |||
| @@ -471,10 +471,10 @@ Arbitrary text, read in the minibuffer and returned as a string | |||
| 471 | these characters in the input.) Prompt. | 471 | these characters in the input.) Prompt. |
| 472 | 472 | ||
| 473 | @item S | 473 | @item S |
| 474 | An interned symbol whose name is read in the minibuffer. Any whitespace | 474 | An interned symbol whose name is read in the minibuffer. Terminate |
| 475 | character terminates the input. (Use @kbd{C-q} to include whitespace in | 475 | the input with either @kbd{C-j} or @key{RET}. Other characters that |
| 476 | the string.) Other characters that normally terminate a symbol (e.g., | 476 | normally terminate a symbol (e.g., whitespace, parentheses and |
| 477 | parentheses and brackets) do not do so here. Prompt. | 477 | brackets) do not do so here. Prompt. |
| 478 | 478 | ||
| 479 | @item U | 479 | @item U |
| 480 | A key sequence or @code{nil}. Can be used after a @samp{k} or | 480 | A key sequence or @code{nil}. Can be used after a @samp{k} or |
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index fba163a84ac..4412b1c3c2c 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2013-01-10 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * tramp.texi (Default Host): Introduce `tramp-default-host-alist'. | ||
| 4 | |||
| 1 | 2013-01-09 Bastien Guerry <bzg@gnu.org> | 5 | 2013-01-09 Bastien Guerry <bzg@gnu.org> |
| 2 | 6 | ||
| 3 | * org.texi (Pushing to MobileOrg): Add footnote about using | 7 | * org.texi (Pushing to MobileOrg): Add footnote about using |
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index a683425868a..3a859c62728 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi | |||
| @@ -1279,8 +1279,8 @@ example, if you always have to use the user @samp{john} in the domain | |||
| 1279 | @end lisp | 1279 | @end lisp |
| 1280 | 1280 | ||
| 1281 | @noindent | 1281 | @noindent |
| 1282 | See the documentation for the variable | 1282 | See the documentation for the variable @code{tramp-default-user-alist} |
| 1283 | @code{tramp-default-user-alist} for more details. | 1283 | for more details. |
| 1284 | 1284 | ||
| 1285 | One trap to fall in must be known. If @value{tramp} finds a default | 1285 | One trap to fall in must be known. If @value{tramp} finds a default |
| 1286 | user, this user will be passed always to the connection command as | 1286 | user, this user will be passed always to the connection command as |
| @@ -1338,6 +1338,18 @@ Note, however, that the most simplification @samp{/::} won't work, | |||
| 1338 | because @samp{/:} is the prefix for quoted file names. | 1338 | because @samp{/:} is the prefix for quoted file names. |
| 1339 | @end ifset | 1339 | @end ifset |
| 1340 | 1340 | ||
| 1341 | @vindex tramp-default-host-alist | ||
| 1342 | Like with methods and users, you can also specify different default | ||
| 1343 | hosts for certain method/user combinations via the variable | ||
| 1344 | @code{tramp-default-host-alist}. Usually, this isn't necessary, | ||
| 1345 | because @code{tramp-default-host} should be sufficient. For some | ||
| 1346 | methods, like @code{adb}, that default value must be overwritten, | ||
| 1347 | which is already the initial value of @code{tramp-default-host-alist}. | ||
| 1348 | |||
| 1349 | @noindent | ||
| 1350 | See the documentation for the variable @code{tramp-default-host-alist} | ||
| 1351 | for more details. | ||
| 1352 | |||
| 1341 | 1353 | ||
| 1342 | @node Multi-hops | 1354 | @node Multi-hops |
| 1343 | @section Connecting to a remote host using multiple hops | 1355 | @section Connecting to a remote host using multiple hops |
diff --git a/etc/ChangeLog b/etc/ChangeLog index 1c057848ead..6c1a08cb670 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog | |||
| @@ -85,7 +85,7 @@ | |||
| 85 | 85 | ||
| 86 | 2012-10-01 Eric Ludlam <zappo@gnu.org> | 86 | 2012-10-01 Eric Ludlam <zappo@gnu.org> |
| 87 | 87 | ||
| 88 | * srecode/cc.srt, srecode/ede-autoconf.srt: New files. | 88 | * srecode/c.srt, srecode/ede-autoconf.srt: New files. |
| 89 | 89 | ||
| 90 | * srecode/cpp.srt: Move parts to c.srt. | 90 | * srecode/cpp.srt: Move parts to c.srt. |
| 91 | 91 | ||
| @@ -66,6 +66,9 @@ bound to <f11> and M-<f10>, respectively. | |||
| 66 | 66 | ||
| 67 | * Changes in Specialized Modes and Packages in Emacs 24.4 | 67 | * Changes in Specialized Modes and Packages in Emacs 24.4 |
| 68 | 68 | ||
| 69 | ** completing-read-multiple's separator can now be a regexp. | ||
| 70 | The default separator is changed to allow surrounding spaces around the comma. | ||
| 71 | |||
| 69 | ** Battery | 72 | ** Battery |
| 70 | 73 | ||
| 71 | *** Battery information via the BSD `apm' utility is now supported. | 74 | *** Battery information via the BSD `apm' utility is now supported. |
diff --git a/lib/getopt.in.h b/lib/getopt.in.h index 490994f860f..d9c7d8144ae 100644 --- a/lib/getopt.in.h +++ b/lib/getopt.in.h | |||
| @@ -49,7 +49,9 @@ | |||
| 49 | linkers. */ | 49 | linkers. */ |
| 50 | #if defined __GETOPT_PREFIX && !defined __need_getopt | 50 | #if defined __GETOPT_PREFIX && !defined __need_getopt |
| 51 | # if !@HAVE_GETOPT_H@ | 51 | # if !@HAVE_GETOPT_H@ |
| 52 | # define __need_system_stdlib_h | ||
| 52 | # include <stdlib.h> | 53 | # include <stdlib.h> |
| 54 | # undef __need_system_stdlib_h | ||
| 53 | # include <stdio.h> | 55 | # include <stdio.h> |
| 54 | # include <unistd.h> | 56 | # include <unistd.h> |
| 55 | # endif | 57 | # endif |
diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h index 3b3b4b1bd43..422ad714c32 100644 --- a/lib/stdlib.in.h +++ b/lib/stdlib.in.h | |||
| @@ -20,8 +20,9 @@ | |||
| 20 | #endif | 20 | #endif |
| 21 | @PRAGMA_COLUMNS@ | 21 | @PRAGMA_COLUMNS@ |
| 22 | 22 | ||
| 23 | #if defined __need_malloc_and_calloc | 23 | #if defined __need_system_stdlib_h || defined __need_malloc_and_calloc |
| 24 | /* Special invocation convention inside glibc header files. */ | 24 | /* Special invocation conventions inside some gnulib header files, |
| 25 | and inside some glibc header files, respectively. */ | ||
| 25 | 26 | ||
| 26 | #@INCLUDE_NEXT@ @NEXT_STDLIB_H@ | 27 | #@INCLUDE_NEXT@ @NEXT_STDLIB_H@ |
| 27 | 28 | ||
diff --git a/lib/unistd.in.h b/lib/unistd.in.h index 5127eecd603..f011b71d5f5 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h | |||
| @@ -79,7 +79,9 @@ | |||
| 79 | /* Solaris declares getcwd not only in <unistd.h> but also in <stdlib.h>. */ | 79 | /* Solaris declares getcwd not only in <unistd.h> but also in <stdlib.h>. */ |
| 80 | /* But avoid namespace pollution on glibc systems. */ | 80 | /* But avoid namespace pollution on glibc systems. */ |
| 81 | #ifndef __GLIBC__ | 81 | #ifndef __GLIBC__ |
| 82 | # define __need_system_stdlib_h | ||
| 82 | # include <stdlib.h> | 83 | # include <stdlib.h> |
| 84 | # undef __need_system_stdlib_h | ||
| 83 | #endif | 85 | #endif |
| 84 | 86 | ||
| 85 | /* Native Windows platforms declare chdir, getcwd, rmdir in | 87 | /* Native Windows platforms declare chdir, getcwd, rmdir in |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3ccb944a2f4..0d4566a91a6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,116 @@ | |||
| 1 | 2013-01-10 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * autorevert.el (auto-revert-notify-enabled): Move up. | ||
| 4 | (auto-revert-use-notify): New defcustom. | ||
| 5 | (auto-revert-mode, global-auto-revert-mode) | ||
| 6 | (auto-revert-notify-add-watch, auto-revert-handler) | ||
| 7 | (auto-revert-buffers): Use `auto-revert-use-notify' instead of | ||
| 8 | `auto-revert-notify-enabled'. | ||
| 9 | |||
| 10 | 2013-01-10 Elias Pipping <pipping@exherbo.org> | ||
| 11 | |||
| 12 | * files.el (auto-mode-alist): Use doc-view for djvu files (bug#13164). | ||
| 13 | * doc-view.el (doc-view-document->bitmap): | ||
| 14 | Use doc-view-single-page-converter-function instead of | ||
| 15 | single-page-converter arg; adjust callers. | ||
| 16 | |||
| 17 | 2013-01-10 Feng Li <fengli@gmail.com> (tiny change) | ||
| 18 | |||
| 19 | * progmodes/which-func.el (which-function): Understand Semantic's use | ||
| 20 | of overlays in imenu--index-alist. | ||
| 21 | |||
| 22 | 2013-01-10 Wolfgang Jenkner <wjenkner@inode.at> | ||
| 23 | |||
| 24 | * man.el: Handle different "man -k" behaviors (bug#13160). Use utf-8. | ||
| 25 | (Man-man-k-use-anchor): New var. | ||
| 26 | (Man-parse-man-k): New function. | ||
| 27 | (Man-completion-table): Use it. | ||
| 28 | (man): Flush the completion cache between uses. | ||
| 29 | |||
| 30 | 2013-01-10 Michael Albinus <michael.albinus@gmx.de> | ||
| 31 | |||
| 32 | * autorevert.el: Add file watch support. | ||
| 33 | (auto-revert-notify-enabled): New defconst. | ||
| 34 | (auto-revert-notify-watch-descriptor-hash-list) | ||
| 35 | (auto-revert-notify-watch-descriptor) | ||
| 36 | (auto-revert-notify-modified-p): New defvars. | ||
| 37 | (auto-revert-notify-rm-watch, auto-revert-notify-add-watch) | ||
| 38 | (auto-revert-notify-handler): New defuns. | ||
| 39 | (auto-revert-mode, global-auto-revert-mode): Remove file watches | ||
| 40 | when mode is disabled. | ||
| 41 | (auto-revert-handler): Check for `auto-revert-notify-modified-p'. | ||
| 42 | (auto-revert-buffers): Add file watches for active buffers. | ||
| 43 | |||
| 44 | 2013-01-10 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 45 | |||
| 46 | * cus-start.el (toplevel): Only allow float values for | ||
| 47 | scroll-up-aggressively and scroll-down-aggressively. | ||
| 48 | Allow any number for line-spacing. | ||
| 49 | |||
| 50 | 2013-01-10 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 51 | |||
| 52 | * doc-view.el (doc-view-pdfdraw-program): Allow "pdfdraw" name. | ||
| 53 | (doc-view-pdf->png-converter-function): Use mupdf if available. | ||
| 54 | (doc-view-djvu->png-converter-function) | ||
| 55 | (doc-view-ps->png-converter-function): Remove. | ||
| 56 | (doc-view--image-file-pattern): Replace doc-view--image-file-extension. | ||
| 57 | (doc-view-goto-page, doc-view-convert-current-doc, doc-view-display) | ||
| 58 | (doc-view-already-converted-p): Adjust accordingly. | ||
| 59 | (doc-view-mode-p): Simplify. | ||
| 60 | (doc-view-enlarge): Use setq-local. | ||
| 61 | (doc-view-pdf->png-converter-ghostscript) | ||
| 62 | (doc-view-djvu->png-converter-ddjvu) | ||
| 63 | (doc-view-pdf->png-converter-mupdf): Rework to call | ||
| 64 | doc-view-start-process directly. | ||
| 65 | (doc-view-pdf/ps->png): Simplify accordingly. | ||
| 66 | (doc-view-pdf->png-1, doc-view-djvu->png-1): Remove. | ||
| 67 | (doc-view-document->bitmap): Rename from doc-view-document->png. | ||
| 68 | (doc-view-convert-current-doc): Merge pdf and djvu cases. | ||
| 69 | (doc-view-set-slice-from-bounding-box): Fix completion table. | ||
| 70 | (doc-view-mode): Use add-hook for after-revert-hook. | ||
| 71 | |||
| 72 | 2013-01-10 Glenn Morris <rgm@gnu.org> | ||
| 73 | |||
| 74 | * emacs-lisp/authors.el (authors-ignored-files) | ||
| 75 | (authors-valid-file-names, authors-renamed-files-alist): | ||
| 76 | Add some more entries. | ||
| 77 | |||
| 78 | 2013-01-10 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 79 | |||
| 80 | * image-mode.el (image-mode-winprops): Don't throw away the fallback | ||
| 81 | `t' pseudo-window entry. | ||
| 82 | |||
| 83 | 2013-01-10 Alan Mackenzie <acm@muc.de> | ||
| 84 | |||
| 85 | Fix bugs in the c-parse-state mechanism. Reuse some markers | ||
| 86 | instead of continually generating new ones. | ||
| 87 | |||
| 88 | * progmodes/cc-engine.el (c-state-old-cpp-beg-marker) | ||
| 89 | (c-state-old-cpp-end-marker): New variables. | ||
| 90 | (c-append-lower-brace-pair-to-state-cache): Start a backward | ||
| 91 | search for "}" definitively outside CPP constructs. | ||
| 92 | (c-remove-stale-state-cache): Inform the caller of a need to | ||
| 93 | search back for a brace pair in certain circumstances. | ||
| 94 | (c-state-maybe-marker): New macro. | ||
| 95 | (c-parse-state): Reuse markers when appropriate. | ||
| 96 | |||
| 97 | 2013-01-10 Glenn Morris <rgm@gnu.org> | ||
| 98 | |||
| 99 | * simple.el (execute-extended-command): Doc fix. | ||
| 100 | Bind prefix-arg around read-extended-command, for prompt. (Bug#13395) | ||
| 101 | |||
| 102 | 2013-01-10 Chong Yidong <cyd@gnu.org> | ||
| 103 | |||
| 104 | * faces.el (read-face-name): Doc fix. | ||
| 105 | |||
| 106 | 2013-01-10 Roland Winkler <winkler@gnu.org> | ||
| 107 | |||
| 108 | * emacs-lisp/crm.el: Allow any regexp for separators. | ||
| 109 | (crm-default-separator): All spaces around the default comma separator. | ||
| 110 | (crm--completion-command): New macro. | ||
| 111 | (crm-completion-help, crm-complete, crm-complete-word): Use it. | ||
| 112 | (crm-complete-and-exit): Handle non-single-char separators. | ||
| 113 | |||
| 1 | 2013-01-09 Elias Pipping <pipping@lavabit.com> | 114 | 2013-01-09 Elias Pipping <pipping@lavabit.com> |
| 2 | 115 | ||
| 3 | * doc-view.el: Add support for DjVu (bug#13164). | 116 | * doc-view.el: Add support for DjVu (bug#13164). |
| @@ -5945,7 +6058,7 @@ | |||
| 5945 | 6058 | ||
| 5946 | 2012-08-08 FabiĂ¡n Ezequiel Gallina <fgallina@cuca> | 6059 | 2012-08-08 FabiĂ¡n Ezequiel Gallina <fgallina@cuca> |
| 5947 | 6060 | ||
| 5948 | * progmodes/python.el Fixed defsubst warning. | 6061 | * progmodes/python.el: Fix defsubst warning. |
| 5949 | (python-syntax-context) Rename from python-info-ppss-context. | 6062 | (python-syntax-context) Rename from python-info-ppss-context. |
| 5950 | (python-syntax-context-type): Rename from | 6063 | (python-syntax-context-type): Rename from |
| 5951 | python-info-ppss-context-type. | 6064 | python-info-ppss-context-type. |
diff --git a/lisp/autorevert.el b/lisp/autorevert.el index f491f2427be..4434ed21169 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el | |||
| @@ -48,6 +48,11 @@ | |||
| 48 | ;; Emacs. You should never even notice that this package is active | 48 | ;; Emacs. You should never even notice that this package is active |
| 49 | ;; (except that your buffers will be reverted, of course). | 49 | ;; (except that your buffers will be reverted, of course). |
| 50 | ;; | 50 | ;; |
| 51 | ;; If Emacs is compiled with file watch support, notifications are | ||
| 52 | ;; used instead of checking the time stamp of the files. You can | ||
| 53 | ;; disable this by setting the user option `auto-revert-use-notify' to | ||
| 54 | ;; nil. | ||
| 55 | ;; | ||
| 51 | ;; After reverting a file buffer, Auto Revert Mode normally puts point | 56 | ;; After reverting a file buffer, Auto Revert Mode normally puts point |
| 52 | ;; at the same position that a regular manual revert would. However, | 57 | ;; at the same position that a regular manual revert would. However, |
| 53 | ;; there is one exception to this rule. If point is at the end of the | 58 | ;; there is one exception to this rule. If point is at the end of the |
| @@ -254,6 +259,28 @@ buffers. CPU usage depends on the version control system." | |||
| 254 | This variable becomes buffer local when set in any fashion.") | 259 | This variable becomes buffer local when set in any fashion.") |
| 255 | (make-variable-buffer-local 'global-auto-revert-ignore-buffer) | 260 | (make-variable-buffer-local 'global-auto-revert-ignore-buffer) |
| 256 | 261 | ||
| 262 | (defconst auto-revert-notify-enabled | ||
| 263 | (or (featurep 'inotify) (featurep 'w32notify)) | ||
| 264 | "Non-nil when Emacs has been compiled with file watch support.") | ||
| 265 | |||
| 266 | (defcustom auto-revert-use-notify auto-revert-notify-enabled | ||
| 267 | "If non-nil Auto Revert Mode uses file watch functions. | ||
| 268 | This requires Emacs being compiled with file watch support (see | ||
| 269 | `auto-revert-notify-enabled'). You should set this variable | ||
| 270 | through Custom only." | ||
| 271 | :group 'auto-revert | ||
| 272 | :type 'boolean | ||
| 273 | :set (lambda (variable value) | ||
| 274 | (set-default variable (and auto-revert-notify-enabled value)) | ||
| 275 | (if (symbol-value variable) | ||
| 276 | (add-hook 'kill-buffer-hook 'auto-revert-notify-rm-watch) | ||
| 277 | (remove-hook 'kill-buffer-hook 'auto-revert-notify-rm-watch) | ||
| 278 | (when auto-revert-notify-enabled | ||
| 279 | (dolist (buf (buffer-list)) | ||
| 280 | (with-current-buffer buf | ||
| 281 | (auto-revert-notify-rm-watch)))))) | ||
| 282 | :version "24.4") | ||
| 283 | |||
| 257 | ;; Internal variables: | 284 | ;; Internal variables: |
| 258 | 285 | ||
| 259 | (defvar auto-revert-buffer-list () | 286 | (defvar auto-revert-buffer-list () |
| @@ -276,6 +303,20 @@ the list of old buffers.") | |||
| 276 | (set (make-local-variable 'auto-revert-tail-pos) | 303 | (set (make-local-variable 'auto-revert-tail-pos) |
| 277 | (nth 7 (file-attributes buffer-file-name))))) | 304 | (nth 7 (file-attributes buffer-file-name))))) |
| 278 | 305 | ||
| 306 | (defvar auto-revert-notify-watch-descriptor-hash-list | ||
| 307 | (make-hash-table :test 'equal) | ||
| 308 | "A hash table collecting all file watch descriptors. | ||
| 309 | Hash key is a watch descriptor, hash value is the corresponding buffer.") | ||
| 310 | |||
| 311 | (defvar auto-revert-notify-watch-descriptor nil | ||
| 312 | "The file watch descriptor active for the current buffer.") | ||
| 313 | (make-variable-buffer-local 'auto-revert-notify-watch-descriptor) | ||
| 314 | |||
| 315 | (defvar auto-revert-notify-modified-p nil | ||
| 316 | "Non-nil when file has been modified on the file system. | ||
| 317 | This has been reported by a file watch event.") | ||
| 318 | (make-variable-buffer-local 'auto-revert-notify-modified-p) | ||
| 319 | |||
| 279 | ;; Functions: | 320 | ;; Functions: |
| 280 | 321 | ||
| 281 | ;;;###autoload | 322 | ;;;###autoload |
| @@ -296,6 +337,7 @@ without being changed in the part that is already in the buffer." | |||
| 296 | (if auto-revert-mode | 337 | (if auto-revert-mode |
| 297 | (if (not (memq (current-buffer) auto-revert-buffer-list)) | 338 | (if (not (memq (current-buffer) auto-revert-buffer-list)) |
| 298 | (push (current-buffer) auto-revert-buffer-list)) | 339 | (push (current-buffer) auto-revert-buffer-list)) |
| 340 | (when auto-revert-use-notify (auto-revert-notify-rm-watch)) | ||
| 299 | (setq auto-revert-buffer-list | 341 | (setq auto-revert-buffer-list |
| 300 | (delq (current-buffer) auto-revert-buffer-list))) | 342 | (delq (current-buffer) auto-revert-buffer-list))) |
| 301 | (auto-revert-set-timer) | 343 | (auto-revert-set-timer) |
| @@ -399,9 +441,12 @@ It displays the text that `global-auto-revert-mode-text' | |||
| 399 | specifies in the mode line." | 441 | specifies in the mode line." |
| 400 | :global t :group 'auto-revert :lighter global-auto-revert-mode-text | 442 | :global t :group 'auto-revert :lighter global-auto-revert-mode-text |
| 401 | (auto-revert-set-timer) | 443 | (auto-revert-set-timer) |
| 402 | (when global-auto-revert-mode | 444 | (if global-auto-revert-mode |
| 403 | (auto-revert-buffers))) | 445 | (auto-revert-buffers) |
| 404 | 446 | (when auto-revert-use-notify | |
| 447 | (dolist (buf (buffer-list)) | ||
| 448 | (with-current-buffer buf | ||
| 449 | (auto-revert-notify-rm-watch)))))) | ||
| 405 | 450 | ||
| 406 | (defun auto-revert-set-timer () | 451 | (defun auto-revert-set-timer () |
| 407 | "Restart or cancel the timer used by Auto-Revert Mode. | 452 | "Restart or cancel the timer used by Auto-Revert Mode. |
| @@ -418,6 +463,39 @@ will use an up-to-date value of `auto-revert-interval'" | |||
| 418 | auto-revert-interval | 463 | auto-revert-interval |
| 419 | 'auto-revert-buffers)))) | 464 | 'auto-revert-buffers)))) |
| 420 | 465 | ||
| 466 | (defun auto-revert-notify-rm-watch () | ||
| 467 | "Disable file watch for current buffer's associated file." | ||
| 468 | (when auto-revert-notify-watch-descriptor | ||
| 469 | (funcall (if (fboundp 'inotify-rm-watch) 'inotify-rm-watch 'w32-rm-watch) | ||
| 470 | auto-revert-notify-watch-descriptor) | ||
| 471 | (remhash auto-revert-notify-watch-descriptor | ||
| 472 | auto-revert-notify-watch-descriptor-hash-list)) | ||
| 473 | (setq auto-revert-notify-watch-descriptor nil | ||
| 474 | auto-revert-notify-modified-p nil)) | ||
| 475 | |||
| 476 | (defun auto-revert-notify-add-watch () | ||
| 477 | "Enable file watch for current buffer's associated file." | ||
| 478 | (when (and buffer-file-name auto-revert-use-notify) | ||
| 479 | (auto-revert-notify-rm-watch) | ||
| 480 | (let ((func (if (fboundp 'inotify-add-watch) | ||
| 481 | 'inotify-add-watch 'w32-add-watch)) | ||
| 482 | (aspect (if (fboundp 'inotify-add-watch) | ||
| 483 | '(close-write) '(last-write-time)))) | ||
| 484 | (setq auto-revert-notify-watch-descriptor | ||
| 485 | (funcall func buffer-file-name aspect 'auto-revert-notify-handler)) | ||
| 486 | (puthash auto-revert-notify-watch-descriptor | ||
| 487 | (current-buffer) | ||
| 488 | auto-revert-notify-watch-descriptor-hash-list)))) | ||
| 489 | |||
| 490 | (defun auto-revert-notify-handler (event) | ||
| 491 | "Handle an event returned from file watch." | ||
| 492 | (when (listp event) | ||
| 493 | (let ((buffer | ||
| 494 | (gethash (car event) auto-revert-notify-watch-descriptor-hash-list))) | ||
| 495 | (when (bufferp buffer) | ||
| 496 | (with-current-buffer buffer | ||
| 497 | (setq auto-revert-notify-modified-p t)))))) | ||
| 498 | |||
| 421 | (defun auto-revert-active-p () | 499 | (defun auto-revert-active-p () |
| 422 | "Check if auto-revert is active (in current buffer or globally)." | 500 | "Check if auto-revert is active (in current buffer or globally)." |
| 423 | (or auto-revert-mode | 501 | (or auto-revert-mode |
| @@ -445,9 +523,12 @@ This is an internal function used by Auto-Revert Mode." | |||
| 445 | (setq size | 523 | (setq size |
| 446 | (nth 7 (file-attributes | 524 | (nth 7 (file-attributes |
| 447 | buffer-file-name)))))) | 525 | buffer-file-name)))))) |
| 448 | (and (not (file-remote-p buffer-file-name)) | 526 | (if auto-revert-use-notify |
| 449 | (file-readable-p buffer-file-name) | 527 | ;; There are file watches. |
| 450 | (not (verify-visited-file-modtime buffer))))) | 528 | auto-revert-notify-modified-p |
| 529 | (and (not (file-remote-p buffer-file-name)) | ||
| 530 | (file-readable-p buffer-file-name) | ||
| 531 | (not (verify-visited-file-modtime buffer)))))) | ||
| 451 | (and (or auto-revert-mode | 532 | (and (or auto-revert-mode |
| 452 | global-auto-revert-non-file-buffers) | 533 | global-auto-revert-non-file-buffers) |
| 453 | revert-buffer-function | 534 | revert-buffer-function |
| @@ -456,6 +537,7 @@ This is an internal function used by Auto-Revert Mode." | |||
| 456 | (funcall buffer-stale-function t)))) | 537 | (funcall buffer-stale-function t)))) |
| 457 | eob eoblist) | 538 | eob eoblist) |
| 458 | (when revert | 539 | (when revert |
| 540 | (setq auto-revert-notify-modified-p nil) | ||
| 459 | (when (and auto-revert-verbose | 541 | (when (and auto-revert-verbose |
| 460 | (not (eq revert 'fast))) | 542 | (not (eq revert 'fast))) |
| 461 | (message "Reverting buffer `%s'." (buffer-name))) | 543 | (message "Reverting buffer `%s'." (buffer-name))) |
| @@ -561,7 +643,12 @@ the timer when no buffers need to be checked." | |||
| 561 | (memq buf auto-revert-buffer-list)) | 643 | (memq buf auto-revert-buffer-list)) |
| 562 | (setq auto-revert-buffer-list | 644 | (setq auto-revert-buffer-list |
| 563 | (delq buf auto-revert-buffer-list))) | 645 | (delq buf auto-revert-buffer-list))) |
| 564 | (when (auto-revert-active-p) (auto-revert-handler))) | 646 | (when (auto-revert-active-p) |
| 647 | ;; Enable file watches. | ||
| 648 | (when (and auto-revert-use-notify buffer-file-name | ||
| 649 | (not auto-revert-notify-watch-descriptor) | ||
| 650 | (auto-revert-notify-add-watch))) | ||
| 651 | (auto-revert-handler))) | ||
| 565 | ;; Remove dead buffer from `auto-revert-buffer-list'. | 652 | ;; Remove dead buffer from `auto-revert-buffer-list'. |
| 566 | (setq auto-revert-buffer-list | 653 | (setq auto-revert-buffer-list |
| 567 | (delq buf auto-revert-buffer-list)))) | 654 | (delq buf auto-revert-buffer-list)))) |
diff --git a/lisp/cus-start.el b/lisp/cus-start.el index 9d2c2750987..b954ed60baa 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el | |||
| @@ -115,12 +115,12 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of | |||
| 115 | (const :tag "On the right" (down . right)))) | 115 | (const :tag "On the right" (down . right)))) |
| 116 | (other :tag "On left, no arrows" t))) | 116 | (other :tag "On left, no arrows" t))) |
| 117 | (scroll-up-aggressively windows | 117 | (scroll-up-aggressively windows |
| 118 | (choice (const :tag "off" nil) number) | 118 | (choice (const :tag "off" nil) float) |
| 119 | "21.1") | 119 | "21.1") |
| 120 | (scroll-down-aggressively windows | 120 | (scroll-down-aggressively windows |
| 121 | (choice (const :tag "off" nil) number) | 121 | (choice (const :tag "off" nil) float) |
| 122 | "21.1") | 122 | "21.1") |
| 123 | (line-spacing display (choice (const :tag "none" nil) integer) | 123 | (line-spacing display (choice (const :tag "none" nil) number) |
| 124 | "22.1") | 124 | "22.1") |
| 125 | (cursor-in-non-selected-windows | 125 | (cursor-in-non-selected-windows |
| 126 | cursor boolean nil | 126 | cursor boolean nil |
diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 0658a11c30a..fa54eef828d 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el | |||
| @@ -158,13 +158,18 @@ | |||
| 158 | :type 'file | 158 | :type 'file |
| 159 | :group 'doc-view) | 159 | :group 'doc-view) |
| 160 | 160 | ||
| 161 | (defcustom doc-view-pdfdraw-program "mudraw" | 161 | (defcustom doc-view-pdfdraw-program |
| 162 | "Program to convert PDF files to PNG." | 162 | (cond |
| 163 | ((executable-find "pdfdraw") "pdfdraw") | ||
| 164 | (t "mudraw")) | ||
| 165 | "Name of MuPDF's program to convert PDF files to PNG." | ||
| 163 | :type 'file | 166 | :type 'file |
| 164 | :version "24.4") | 167 | :version "24.4") |
| 165 | 168 | ||
| 166 | (defcustom doc-view-pdf->png-converter-function | 169 | (defcustom doc-view-pdf->png-converter-function |
| 167 | 'doc-view-pdf->png-converter-ghostscript | 170 | (if (executable-find doc-view-pdfdraw-program) |
| 171 | #'doc-view-pdf->png-converter-mupdf | ||
| 172 | #'doc-view-pdf->png-converter-ghostscript) | ||
| 168 | "Function to call to convert a PDF file into a PNG file." | 173 | "Function to call to convert a PDF file into a PNG file." |
| 169 | :type '(radio | 174 | :type '(radio |
| 170 | (function-item doc-view-pdf->png-converter-ghostscript | 175 | (function-item doc-view-pdf->png-converter-ghostscript |
| @@ -174,23 +179,6 @@ | |||
| 174 | function) | 179 | function) |
| 175 | :version "24.4") | 180 | :version "24.4") |
| 176 | 181 | ||
| 177 | ;; FIXME: Get rid of it: there's no choice. | ||
| 178 | (defcustom doc-view-djvu->png-converter-function | ||
| 179 | 'doc-view-djvu->png-converter-ddjvu | ||
| 180 | "Function to call to convert a DJVU file into a PNG file" | ||
| 181 | :type '(radio (function-item doc-view-djvu->png-converter-ddjvu | ||
| 182 | :doc "Use ddjvu") | ||
| 183 | function)) | ||
| 184 | |||
| 185 | ;; FIXME: Get rid of it: there's no choice. | ||
| 186 | (defcustom doc-view-ps->png-converter-function | ||
| 187 | 'doc-view-ps->png-converter-ghostscript | ||
| 188 | "Function to call to convert a PS file into a PNG file." | ||
| 189 | :type '(radio (function-item doc-view-ps->png-converter-ghostscript | ||
| 190 | :doc "Use ghostscript") | ||
| 191 | function) | ||
| 192 | :version "24.4") | ||
| 193 | |||
| 194 | (defcustom doc-view-ghostscript-options | 182 | (defcustom doc-view-ghostscript-options |
| 195 | '("-dSAFER" ;; Avoid security problems when rendering files from untrusted | 183 | '("-dSAFER" ;; Avoid security problems when rendering files from untrusted |
| 196 | ;; sources. | 184 | ;; sources. |
| @@ -358,14 +346,13 @@ Can be `dvi', `pdf', or `ps'.") | |||
| 358 | May operate on the source document or on some intermediate (typically PDF) | 346 | May operate on the source document or on some intermediate (typically PDF) |
| 359 | conversion of it.") | 347 | conversion of it.") |
| 360 | 348 | ||
| 361 | (defvar doc-view--image-type nil | 349 | (defvar-local doc-view--image-type nil |
| 362 | "The type of image in the current buffer. | 350 | "The type of image in the current buffer. |
| 363 | Can be `png' or `tiff'.") | 351 | Can be `png' or `tiff'.") |
| 364 | 352 | ||
| 365 | (defvar doc-view--image-file-extension nil | 353 | (defvar-local doc-view--image-file-pattern nil |
| 366 | ;; FIXME: Replace it with a `format' string, like "page-%d.png". | 354 | "The `format' pattern of image file names. |
| 367 | "The file extension of the image type in the current buffer. | 355 | Typically \"page-%s.png\".") |
| 368 | Can be `png' or `tif'.") | ||
| 369 | 356 | ||
| 370 | ;;;; DocView Keymaps | 357 | ;;;; DocView Keymaps |
| 371 | 358 | ||
| @@ -506,7 +493,7 @@ Can be `png' or `tif'.") | |||
| 506 | ;; that's not right if the pages are not generated sequentially | 493 | ;; that's not right if the pages are not generated sequentially |
| 507 | ;; or if the page isn't in doc-view-current-files yet. | 494 | ;; or if the page isn't in doc-view-current-files yet. |
| 508 | (let ((file (expand-file-name | 495 | (let ((file (expand-file-name |
| 509 | (format "page-%d.%s" page doc-view--image-file-extension) | 496 | (format doc-view--image-file-pattern page) |
| 510 | (doc-view-current-cache-dir)))) | 497 | (doc-view-current-cache-dir)))) |
| 511 | (doc-view-insert-image file :pointer 'arrow) | 498 | (doc-view-insert-image file :pointer 'arrow) |
| 512 | (set-window-hscroll (selected-window) hscroll) | 499 | (set-window-hscroll (selected-window) hscroll) |
| @@ -708,8 +695,7 @@ OpenDocument format)." | |||
| 708 | (executable-find doc-view-dvipdf-program)) | 695 | (executable-find doc-view-dvipdf-program)) |
| 709 | (and doc-view-dvipdfm-program | 696 | (and doc-view-dvipdfm-program |
| 710 | (executable-find doc-view-dvipdfm-program))))) | 697 | (executable-find doc-view-dvipdfm-program))))) |
| 711 | ((or (eq type 'postscript) (eq type 'ps) (eq type 'eps) | 698 | ((memq type '(postscript ps eps pdf)) |
| 712 | (eq type 'pdf)) | ||
| 713 | ;; FIXME: allow mupdf here | 699 | ;; FIXME: allow mupdf here |
| 714 | (and doc-view-ghostscript-program | 700 | (and doc-view-ghostscript-program |
| 715 | (executable-find doc-view-ghostscript-program))) | 701 | (executable-find doc-view-ghostscript-program))) |
| @@ -735,13 +721,13 @@ OpenDocument format)." | |||
| 735 | ;; ImageMagick supports on-the-fly-rescaling. | 721 | ;; ImageMagick supports on-the-fly-rescaling. |
| 736 | (let ((new (ceiling (* factor doc-view-image-width)))) | 722 | (let ((new (ceiling (* factor doc-view-image-width)))) |
| 737 | (unless (equal new doc-view-image-width) | 723 | (unless (equal new doc-view-image-width) |
| 738 | (set (make-local-variable 'doc-view-image-width) new) | 724 | (setq-local doc-view-image-width new) |
| 739 | (doc-view-insert-image | 725 | (doc-view-insert-image |
| 740 | (plist-get (cdr (doc-view-current-image)) :file) | 726 | (plist-get (cdr (doc-view-current-image)) :file) |
| 741 | :width doc-view-image-width))) | 727 | :width doc-view-image-width))) |
| 742 | (let ((new (ceiling (* factor doc-view-resolution)))) | 728 | (let ((new (ceiling (* factor doc-view-resolution)))) |
| 743 | (unless (equal new doc-view-resolution) | 729 | (unless (equal new doc-view-resolution) |
| 744 | (set (make-local-variable 'doc-view-resolution) new) | 730 | (setq-local doc-view-resolution new) |
| 745 | (doc-view-reconvert-doc))))) | 731 | (doc-view-reconvert-doc))))) |
| 746 | 732 | ||
| 747 | (defun doc-view-shrink (factor) | 733 | (defun doc-view-shrink (factor) |
| @@ -878,35 +864,44 @@ Should be invoked when the cached images aren't up-to-date." | |||
| 878 | (list "-o" pdf dvi) | 864 | (list "-o" pdf dvi) |
| 879 | callback))) | 865 | callback))) |
| 880 | 866 | ||
| 881 | (defun doc-view-pdf->png-converter-ghostscript (resolution pdf png &optional page) | 867 | (defun doc-view-pdf->png-converter-ghostscript (pdf png page callback) |
| 882 | `((command . ,doc-view-ghostscript-program) | 868 | (doc-view-start-process |
| 883 | (arguments . (,@doc-view-ghostscript-options | 869 | "pdf/ps->png" doc-view-ghostscript-program |
| 884 | ,(format "-r%d" resolution) | 870 | `(,@doc-view-ghostscript-options |
| 885 | ,@(if page `(,(format "-dFirstPage=%d" page))) | 871 | ,(format "-r%d" (round doc-view-resolution)) |
| 886 | ,@(if page `(,(format "-dLastPage=%d" page))) | 872 | ,@(if page `(,(format "-dFirstPage=%d" page))) |
| 887 | ,(concat "-sOutputFile=" png) | 873 | ,@(if page `(,(format "-dLastPage=%d" page))) |
| 888 | ,pdf)))) | 874 | ,(concat "-sOutputFile=" png) |
| 875 | ,pdf) | ||
| 876 | callback)) | ||
| 889 | 877 | ||
| 890 | (defalias 'doc-view-ps->png-converter-ghostscript | 878 | (defalias 'doc-view-ps->png-converter-ghostscript |
| 891 | 'doc-view-pdf->png-converter-ghostscript) | 879 | 'doc-view-pdf->png-converter-ghostscript) |
| 892 | 880 | ||
| 893 | (defun doc-view-djvu->png-converter-ddjvu (resolution djvu png &optional page) | 881 | (defun doc-view-djvu->tiff-converter-ddjvu (djvu tiff page callback) |
| 894 | `((command . "ddjvu") | 882 | "Convert PAGE of a DJVU file to bitmap(s) asynchronously. |
| 895 | (arguments . ("-format=tiff" | 883 | Call CALLBACK with no arguments when done. |
| 896 | ;; ddjvu only accepts the range 1-999. | 884 | If PAGE is nil, convert the whole document." |
| 897 | ,(format "-scale=%d" resolution) | 885 | (doc-view-start-process |
| 898 | ;; -eachpage was only added after djvulibre-3.5.25.3! | 886 | "djvu->tiff" "ddjvu" |
| 899 | ,@(unless page '("-eachpage")) | 887 | `("-format=tiff" |
| 900 | ,@(if page `(,(format "-page=%d" page))) | 888 | ;; ddjvu only accepts the range 1-999. |
| 901 | ,djvu | 889 | ,(format "-scale=%d" (round doc-view-resolution)) |
| 902 | ,png)))) | 890 | ;; -eachpage was only added after djvulibre-3.5.25.3! |
| 903 | 891 | ,@(unless page '("-eachpage")) | |
| 904 | (defun doc-view-pdf->png-converter-mupdf (resolution pdf png &optional page) | 892 | ,@(if page `(,(format "-page=%d" page))) |
| 905 | `((command . ,doc-view-pdfdraw-program) | 893 | ,djvu |
| 906 | (arguments . (,(concat "-o" png) | 894 | ,tiff) |
| 907 | ,(format "-r%d" resolution) | 895 | callback)) |
| 908 | 896 | ||
| 909 | ,@(if page `(,(format "%d" page))))))) | 897 | (defun doc-view-pdf->png-converter-mupdf (pdf png page callback) |
| 898 | (doc-view-start-process | ||
| 899 | "pdf->png" doc-view-pdfdraw-program | ||
| 900 | `(,(concat "-o" png) | ||
| 901 | ,(format "-r%d" (round doc-view-resolution)) | ||
| 902 | |||
| 903 | ,@(if page `(,(format "%d" page)))) | ||
| 904 | callback)) | ||
| 910 | 905 | ||
| 911 | (defun doc-view-odf->pdf (odf callback) | 906 | (defun doc-view-odf->pdf (odf callback) |
| 912 | "Convert ODF to PDF asynchronously and call CALLBACK when finished. | 907 | "Convert ODF to PDF asynchronously and call CALLBACK when finished. |
| @@ -919,16 +914,12 @@ is named like ODF with the extension turned to pdf." | |||
| 919 | (defun doc-view-pdf/ps->png (pdf-ps png) | 914 | (defun doc-view-pdf/ps->png (pdf-ps png) |
| 920 | ;; FIXME: Fix name and docstring to account for djvu&tiff. | 915 | ;; FIXME: Fix name and docstring to account for djvu&tiff. |
| 921 | "Convert PDF-PS to PNG asynchronously." | 916 | "Convert PDF-PS to PNG asynchronously." |
| 922 | (let ((invocation | 917 | (funcall |
| 923 | (funcall (pcase doc-view-doc-type | 918 | (pcase doc-view-doc-type |
| 924 | (`pdf doc-view-pdf->png-converter-function) | 919 | (`pdf doc-view-pdf->png-converter-function) |
| 925 | (`djvu doc-view-djvu->png-converter-function) | 920 | (`djvu #'doc-view-djvu->tiff-converter-ddjvu) |
| 926 | (_ doc-view-ps->png-converter-function)) | 921 | (_ #'doc-view-ps->png-converter-ghostscript)) |
| 927 | (round doc-view-resolution) pdf-ps png))) | 922 | pdf-ps png nil |
| 928 | |||
| 929 | (doc-view-start-process | ||
| 930 | "pdf/ps->png" (cdr (assoc 'command invocation)) | ||
| 931 | (cdr (assoc 'arguments invocation)) | ||
| 932 | (let ((resolution doc-view-resolution)) | 923 | (let ((resolution doc-view-resolution)) |
| 933 | (lambda () | 924 | (lambda () |
| 934 | ;; Only create the resolution file when it's all done, so it also | 925 | ;; Only create the resolution file when it's all done, so it also |
| @@ -940,7 +931,8 @@ is named like ODF with the extension turned to pdf." | |||
| 940 | (when doc-view-current-timer | 931 | (when doc-view-current-timer |
| 941 | (cancel-timer doc-view-current-timer) | 932 | (cancel-timer doc-view-current-timer) |
| 942 | (setq doc-view-current-timer nil)) | 933 | (setq doc-view-current-timer nil)) |
| 943 | (doc-view-display (current-buffer) 'force))))) | 934 | (doc-view-display (current-buffer) 'force)))) |
| 935 | |||
| 944 | ;; Update the displayed pages as soon as they're done generating. | 936 | ;; Update the displayed pages as soon as they're done generating. |
| 945 | (when doc-view-conversion-refresh-interval | 937 | (when doc-view-conversion-refresh-interval |
| 946 | (setq doc-view-current-timer | 938 | (setq doc-view-current-timer |
| @@ -948,31 +940,10 @@ is named like ODF with the extension turned to pdf." | |||
| 948 | 'doc-view-display | 940 | 'doc-view-display |
| 949 | (current-buffer))))) | 941 | (current-buffer))))) |
| 950 | 942 | ||
| 951 | (defun doc-view-pdf->png-1 (pdf png page callback) | ||
| 952 | "Convert a PAGE of a PDF file to PNG asynchronously. | ||
| 953 | Call CALLBACK with no arguments when done." | ||
| 954 | (let ((invocation (funcall doc-view-pdf->png-converter-function | ||
| 955 | (round doc-view-resolution) pdf png page))) | ||
| 956 | (doc-view-start-process | ||
| 957 | "pdf/ps->png" (cdr (assoc 'command invocation)) | ||
| 958 | (cdr (assoc 'arguments invocation)) | ||
| 959 | callback))) | ||
| 960 | |||
| 961 | (defun doc-view-djvu->png-1 (djvu png page callback) | ||
| 962 | "Convert a PAGE of a DJVU file to bitmap asynchronously. | ||
| 963 | Call CALLBACK with no arguments when done." | ||
| 964 | (let ((invocation (funcall doc-view-djvu->png-converter-function | ||
| 965 | (round doc-view-resolution) djvu png page))) | ||
| 966 | (doc-view-start-process | ||
| 967 | "djvu->png" (cdr (assoc 'command invocation)) | ||
| 968 | (cdr (assoc 'arguments invocation)) | ||
| 969 | callback))) | ||
| 970 | |||
| 971 | (declare-function clear-image-cache "image.c" (&optional filter)) | 943 | (declare-function clear-image-cache "image.c" (&optional filter)) |
| 972 | 944 | ||
| 973 | (defun doc-view-document->png (pdf png pages single-page-converter) | 945 | (defun doc-view-document->bitmap (pdf png pages) |
| 974 | ;; FIXME: Fix docstring. | 946 | "Convert a document file to bitmap images asynchronously. |
| 975 | "Convert a PDF file to PNG asynchronously. | ||
| 976 | Start by converting PAGES, and then the rest." | 947 | Start by converting PAGES, and then the rest." |
| 977 | (if (null pages) | 948 | (if (null pages) |
| 978 | (doc-view-pdf/ps->png pdf png) | 949 | (doc-view-pdf/ps->png pdf png) |
| @@ -981,11 +952,11 @@ Start by converting PAGES, and then the rest." | |||
| 981 | ;; a single page anyway, and of the remaining 1%, few cases will have | 952 | ;; a single page anyway, and of the remaining 1%, few cases will have |
| 982 | ;; consecutive pages, it's not worth the trouble. | 953 | ;; consecutive pages, it's not worth the trouble. |
| 983 | (let ((rest (cdr pages))) | 954 | (let ((rest (cdr pages))) |
| 984 | (funcall single-page-converter | 955 | (funcall doc-view-single-page-converter-function |
| 985 | pdf (format png (car pages)) (car pages) | 956 | pdf (format png (car pages)) (car pages) |
| 986 | (lambda () | 957 | (lambda () |
| 987 | (if rest | 958 | (if rest |
| 988 | (doc-view-document->png pdf png rest) | 959 | (doc-view-document->bitmap pdf png rest) |
| 989 | ;; Yippie, the important pages are done, update the display. | 960 | ;; Yippie, the important pages are done, update the display. |
| 990 | (clear-image-cache) | 961 | (clear-image-cache) |
| 991 | ;; For the windows that have a message (like "Welcome to | 962 | ;; For the windows that have a message (like "Welcome to |
| @@ -1065,7 +1036,7 @@ Those files are saved in the directory given by the function | |||
| 1065 | ;; resets during the redisplay). | 1036 | ;; resets during the redisplay). |
| 1066 | (setq doc-view-pending-cache-flush t) | 1037 | (setq doc-view-pending-cache-flush t) |
| 1067 | (let ((png-file (expand-file-name | 1038 | (let ((png-file (expand-file-name |
| 1068 | (concat "page-%d." doc-view--image-file-extension) | 1039 | (format doc-view--image-file-pattern "%d") |
| 1069 | (doc-view-current-cache-dir)))) | 1040 | (doc-view-current-cache-dir)))) |
| 1070 | (make-directory (doc-view-current-cache-dir) t) | 1041 | (make-directory (doc-view-current-cache-dir) t) |
| 1071 | (pcase doc-view-doc-type | 1042 | (pcase doc-view-doc-type |
| @@ -1092,15 +1063,10 @@ Those files are saved in the directory given by the function | |||
| 1092 | ;; Rename to doc.pdf | 1063 | ;; Rename to doc.pdf |
| 1093 | (rename-file opdf pdf) | 1064 | (rename-file opdf pdf) |
| 1094 | (doc-view-pdf/ps->png pdf png-file))))) | 1065 | (doc-view-pdf/ps->png pdf png-file))))) |
| 1095 | 1066 | ((or `pdf `djvu) | |
| 1096 | (let ((pages (doc-view-active-pages))) | ||
| 1097 | ;; Convert PDF to PNG images starting with the active pages. | ||
| 1098 | (doc-view-document->png doc-view-buffer-file-name png-file pages | ||
| 1099 | 'doc-view-pdf->png-1))) | ||
| 1100 | (`djvu | ||
| 1101 | (let ((pages (doc-view-active-pages))) | 1067 | (let ((pages (doc-view-active-pages))) |
| 1102 | (doc-view-document->png doc-view-buffer-file-name png-file pages | 1068 | ;; Convert doc to bitmap images starting with the active pages. |
| 1103 | 'doc-view-djvu->png-1))) | 1069 | (doc-view-document->bitmap doc-view-buffer-file-name png-file pages))) |
| 1104 | (_ | 1070 | (_ |
| 1105 | ;; Convert to PNG images. | 1071 | ;; Convert to PNG images. |
| 1106 | (doc-view-pdf/ps->png doc-view-buffer-file-name png-file))))) | 1072 | (doc-view-pdf/ps->png doc-view-buffer-file-name png-file))))) |
| @@ -1211,9 +1177,10 @@ much more accurate than could be done manually using | |||
| 1211 | (let* ((is (image-size (doc-view-current-image) t)) | 1177 | (let* ((is (image-size (doc-view-current-image) t)) |
| 1212 | (iw (car is)) | 1178 | (iw (car is)) |
| 1213 | (ih (cdr is)) | 1179 | (ih (cdr is)) |
| 1214 | (ps (or (and (null force-paper-size) (doc-view-guess-paper-size iw ih)) | 1180 | (ps (or (and (null force-paper-size) |
| 1181 | (doc-view-guess-paper-size iw ih)) | ||
| 1215 | (intern (completing-read "Paper size: " | 1182 | (intern (completing-read "Paper size: " |
| 1216 | (mapcar #'car doc-view-paper-sizes) | 1183 | doc-view-paper-sizes |
| 1217 | nil t)))) | 1184 | nil t)))) |
| 1218 | (bb (doc-view-scale-bounding-box ps iw ih bb)) | 1185 | (bb (doc-view-scale-bounding-box ps iw ih bb)) |
| 1219 | (x1 (nth 0 bb)) | 1186 | (x1 (nth 0 bb)) |
| @@ -1294,16 +1261,15 @@ have the page we want to view." | |||
| 1294 | (let ((prev-pages doc-view-current-files)) | 1261 | (let ((prev-pages doc-view-current-files)) |
| 1295 | (setq doc-view-current-files | 1262 | (setq doc-view-current-files |
| 1296 | (sort (directory-files (doc-view-current-cache-dir) t | 1263 | (sort (directory-files (doc-view-current-cache-dir) t |
| 1297 | (concat "page-[0-9]+\\." | 1264 | (format doc-view--image-file-pattern |
| 1298 | doc-view--image-file-extension) | 1265 | "[0-9]+") |
| 1299 | t) | 1266 | t) |
| 1300 | 'doc-view-sort)) | 1267 | 'doc-view-sort)) |
| 1301 | (dolist (win (or (get-buffer-window-list buffer nil t) | 1268 | (dolist (win (or (get-buffer-window-list buffer nil t) |
| 1302 | (list t))) | 1269 | (list t))) |
| 1303 | (let* ((page (doc-view-current-page win)) | 1270 | (let* ((page (doc-view-current-page win)) |
| 1304 | (pagefile (expand-file-name | 1271 | (pagefile (expand-file-name |
| 1305 | (format "page-%d.%s" | 1272 | (format doc-view--image-file-pattern page) |
| 1306 | page doc-view--image-file-extension) | ||
| 1307 | (doc-view-current-cache-dir)))) | 1273 | (doc-view-current-cache-dir)))) |
| 1308 | (when (or force | 1274 | (when (or force |
| 1309 | (and (not (member pagefile prev-pages)) | 1275 | (and (not (member pagefile prev-pages)) |
| @@ -1369,7 +1335,7 @@ For now these keys are useful: | |||
| 1369 | (doc-view-kill-proc) | 1335 | (doc-view-kill-proc) |
| 1370 | (setq buffer-read-only nil) | 1336 | (setq buffer-read-only nil) |
| 1371 | (remove-overlays (point-min) (point-max) 'doc-view t) | 1337 | (remove-overlays (point-min) (point-max) 'doc-view t) |
| 1372 | (set (make-local-variable 'image-mode-winprops-alist) t) | 1338 | (setq-local image-mode-winprops-alist t) |
| 1373 | ;; Switch to the previously used major mode or fall back to | 1339 | ;; Switch to the previously used major mode or fall back to |
| 1374 | ;; normal mode. | 1340 | ;; normal mode. |
| 1375 | (doc-view-fallback-mode) | 1341 | (doc-view-fallback-mode) |
| @@ -1499,7 +1465,7 @@ If BACKWARD is non-nil, jump to the previous match." | |||
| 1499 | (doc-view-current-cache-dir))) | 1465 | (doc-view-current-cache-dir))) |
| 1500 | (> (length (directory-files | 1466 | (> (length (directory-files |
| 1501 | (doc-view-current-cache-dir) | 1467 | (doc-view-current-cache-dir) |
| 1502 | nil (concat "\\." doc-view--image-file-extension "\\'"))) | 1468 | nil (format doc-view--image-file-pattern "[0-9]+"))) |
| 1503 | 0))) | 1469 | 0))) |
| 1504 | 1470 | ||
| 1505 | (defun doc-view-initiate-display () | 1471 | (defun doc-view-initiate-display () |
| @@ -1511,7 +1477,7 @@ If BACKWARD is non-nil, jump to the previous match." | |||
| 1511 | (if (doc-view-already-converted-p) | 1477 | (if (doc-view-already-converted-p) |
| 1512 | (progn | 1478 | (progn |
| 1513 | (message "DocView: using cached files!") | 1479 | (message "DocView: using cached files!") |
| 1514 | ;; Load the saved resolution | 1480 | ;; Load the saved resolution. |
| 1515 | (let* ((res-file (expand-file-name "resolution.el" | 1481 | (let* ((res-file (expand-file-name "resolution.el" |
| 1516 | (doc-view-current-cache-dir))) | 1482 | (doc-view-current-cache-dir))) |
| 1517 | (res | 1483 | (res |
| @@ -1520,7 +1486,7 @@ If BACKWARD is non-nil, jump to the previous match." | |||
| 1520 | (insert-file-contents res-file) | 1486 | (insert-file-contents res-file) |
| 1521 | (read (current-buffer)))))) | 1487 | (read (current-buffer)))))) |
| 1522 | (when (numberp res) | 1488 | (when (numberp res) |
| 1523 | (set (make-local-variable 'doc-view-resolution) res))) | 1489 | (setq-local doc-view-resolution res))) |
| 1524 | (doc-view-display (current-buffer) 'force)) | 1490 | (doc-view-display (current-buffer) 'force)) |
| 1525 | (doc-view-convert-current-doc)) | 1491 | (doc-view-convert-current-doc)) |
| 1526 | (message | 1492 | (message |
| @@ -1590,23 +1556,23 @@ If BACKWARD is non-nil, jump to the previous match." | |||
| 1590 | ((looking-at "%PDF") '(pdf)) | 1556 | ((looking-at "%PDF") '(pdf)) |
| 1591 | ((looking-at "\367\002") '(dvi)) | 1557 | ((looking-at "\367\002") '(dvi)) |
| 1592 | ((looking-at "AT&TFORM") '(djvu)))))) | 1558 | ((looking-at "AT&TFORM") '(djvu)))))) |
| 1593 | (set (make-local-variable 'doc-view-doc-type) | 1559 | (setq-local doc-view-doc-type |
| 1594 | (car (or (doc-view-intersection name-types content-types) | 1560 | (car (or (doc-view-intersection name-types content-types) |
| 1595 | (when (and name-types content-types) | 1561 | (when (and name-types content-types) |
| 1596 | (error "Conflicting types: name says %s but content says %s" | 1562 | (error "Conflicting types: name says %s but content says %s" |
| 1597 | name-types content-types)) | 1563 | name-types content-types)) |
| 1598 | name-types content-types | 1564 | name-types content-types |
| 1599 | (error "Cannot determine the document type")))))) | 1565 | (error "Cannot determine the document type")))))) |
| 1600 | 1566 | ||
| 1601 | (defun doc-view-set-up-single-converter () | 1567 | (defun doc-view-set-up-single-converter () |
| 1602 | "Find the right single-page converter for the current document type" | 1568 | "Find the right single-page converter for the current document type" |
| 1603 | (pcase-let ((`(,conv-function ,type ,extension) | 1569 | (pcase-let ((`(,conv-function ,type ,extension) |
| 1604 | (pcase doc-view-doc-type | 1570 | (pcase doc-view-doc-type |
| 1605 | (`djvu (list #'doc-view-djvu->png-1 'tiff "tif")) | 1571 | (`djvu (list #'doc-view-djvu->tiff-converter-ddjvu 'tiff "tif")) |
| 1606 | (_ (list #'doc-view-pdf->png-1 'png "png"))))) | 1572 | (_ (list doc-view-pdf->png-converter-function 'png "png"))))) |
| 1607 | (setq-local doc-view-single-page-converter-function conv-function) | 1573 | (setq-local doc-view-single-page-converter-function conv-function) |
| 1608 | (setq-local doc-view--image-type type) | 1574 | (setq-local doc-view--image-type type) |
| 1609 | (setq-local doc-view--image-file-extension extension))) | 1575 | (setq-local doc-view--image-file-pattern (concat "page-%s." extension)))) |
| 1610 | 1576 | ||
| 1611 | ;;;###autoload | 1577 | ;;;###autoload |
| 1612 | (defun doc-view-mode () | 1578 | (defun doc-view-mode () |
| @@ -1631,8 +1597,7 @@ toggle between displaying the document or editing it as text. | |||
| 1631 | (unless (eq major-mode 'fundamental-mode) | 1597 | (unless (eq major-mode 'fundamental-mode) |
| 1632 | major-mode)))) | 1598 | major-mode)))) |
| 1633 | (kill-all-local-variables) | 1599 | (kill-all-local-variables) |
| 1634 | (set (make-local-variable 'doc-view-previous-major-mode) | 1600 | (setq-local doc-view-previous-major-mode prev-major-mode)) |
| 1635 | prev-major-mode)) | ||
| 1636 | 1601 | ||
| 1637 | (dolist (var doc-view-saved-settings) | 1602 | (dolist (var doc-view-saved-settings) |
| 1638 | (set (make-local-variable (car var)) (cdr var))) | 1603 | (set (make-local-variable (car var)) (cdr var))) |
| @@ -1644,7 +1609,7 @@ toggle between displaying the document or editing it as text. | |||
| 1644 | 1609 | ||
| 1645 | (doc-view-make-safe-dir doc-view-cache-directory) | 1610 | (doc-view-make-safe-dir doc-view-cache-directory) |
| 1646 | ;; Handle compressed files, remote files, files inside archives | 1611 | ;; Handle compressed files, remote files, files inside archives |
| 1647 | (set (make-local-variable 'doc-view-buffer-file-name) | 1612 | (setq-local doc-view-buffer-file-name |
| 1648 | (cond | 1613 | (cond |
| 1649 | (jka-compr-really-do-compress | 1614 | (jka-compr-really-do-compress |
| 1650 | ;; FIXME: there's a risk of name conflicts here. | 1615 | ;; FIXME: there's a risk of name conflicts here. |
| @@ -1683,20 +1648,19 @@ toggle between displaying the document or editing it as text. | |||
| 1683 | 'doc-view-new-window-function nil t) | 1648 | 'doc-view-new-window-function nil t) |
| 1684 | (image-mode-setup-winprops) | 1649 | (image-mode-setup-winprops) |
| 1685 | 1650 | ||
| 1686 | (set (make-local-variable 'mode-line-position) | 1651 | (setq-local mode-line-position |
| 1687 | '(" P" (:eval (number-to-string (doc-view-current-page))) | 1652 | '(" P" (:eval (number-to-string (doc-view-current-page))) |
| 1688 | "/" (:eval (number-to-string (doc-view-last-page-number))))) | 1653 | "/" (:eval (number-to-string (doc-view-last-page-number))))) |
| 1689 | ;; Don't scroll unless the user specifically asked for it. | 1654 | ;; Don't scroll unless the user specifically asked for it. |
| 1690 | (set (make-local-variable 'auto-hscroll-mode) nil) | 1655 | (setq-local auto-hscroll-mode nil) |
| 1691 | (set (make-local-variable 'mwheel-scroll-up-function) | 1656 | (setq-local mwheel-scroll-up-function #'doc-view-scroll-up-or-next-page) |
| 1692 | 'doc-view-scroll-up-or-next-page) | 1657 | (setq-local mwheel-scroll-down-function |
| 1693 | (set (make-local-variable 'mwheel-scroll-down-function) | 1658 | #'doc-view-scroll-down-or-previous-page) |
| 1694 | 'doc-view-scroll-down-or-previous-page) | 1659 | (setq-local cursor-type nil) |
| 1695 | (set (make-local-variable 'cursor-type) nil) | ||
| 1696 | (use-local-map doc-view-mode-map) | 1660 | (use-local-map doc-view-mode-map) |
| 1697 | (set (make-local-variable 'after-revert-hook) 'doc-view-reconvert-doc) | 1661 | (add-hook 'after-revert-hook 'doc-view-reconvert-doc nil t) |
| 1698 | (set (make-local-variable 'bookmark-make-record-function) | 1662 | (setq-local bookmark-make-record-function |
| 1699 | 'doc-view-bookmark-make-record) | 1663 | #'doc-view-bookmark-make-record) |
| 1700 | (setq mode-name "DocView" | 1664 | (setq mode-name "DocView" |
| 1701 | buffer-read-only t | 1665 | buffer-read-only t |
| 1702 | major-mode 'doc-view-mode) | 1666 | major-mode 'doc-view-mode) |
| @@ -1705,7 +1669,7 @@ toggle between displaying the document or editing it as text. | |||
| 1705 | ;; canonical view mode for PDF/PS/DVI files. This could be | 1669 | ;; canonical view mode for PDF/PS/DVI files. This could be |
| 1706 | ;; switched on automatically depending on the value of | 1670 | ;; switched on automatically depending on the value of |
| 1707 | ;; `view-read-only'. | 1671 | ;; `view-read-only'. |
| 1708 | (set (make-local-variable 'view-read-only) nil) | 1672 | (setq-local view-read-only nil) |
| 1709 | (run-mode-hooks 'doc-view-mode-hook))) | 1673 | (run-mode-hooks 'doc-view-mode-hook))) |
| 1710 | 1674 | ||
| 1711 | (defun doc-view-fallback-mode () | 1675 | (defun doc-view-fallback-mode () |
diff --git a/lisp/emacs-lisp/authors.el b/lisp/emacs-lisp/authors.el index 6741094aa55..270badd53cb 100644 --- a/lisp/emacs-lisp/authors.el +++ b/lisp/emacs-lisp/authors.el | |||
| @@ -295,6 +295,14 @@ Changes to files matching one of the regexps in this list are not listed.") | |||
| 295 | "calc/INSTALL" "calc/Makefile" | 295 | "calc/INSTALL" "calc/Makefile" |
| 296 | "vms-pp.trans" "_emacs" "batcomp.com" "notes/cpp" ; admin/ | 296 | "vms-pp.trans" "_emacs" "batcomp.com" "notes/cpp" ; admin/ |
| 297 | "emacsver.texi.in" | 297 | "emacsver.texi.in" |
| 298 | "vpath.sed" | ||
| 299 | "Cocoa/Emacs.base/Contents/Info.plist" | ||
| 300 | "Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings" | ||
| 301 | "GNUstep/Emacs.base/Resources/Info-gnustep.plist" | ||
| 302 | "GNUstep/Emacs.base/Resources/Emacs.desktop" | ||
| 303 | "Cocoa/Emacs.base/Contents/Resources/English.lproj" | ||
| 304 | ;; Only existed briefly, then deleted: | ||
| 305 | "coccinelle/overlay.cocci" "coccinelle/symbol.cocci" | ||
| 298 | ;; MH-E stuff not in Emacs: | 306 | ;; MH-E stuff not in Emacs: |
| 299 | "import-emacs" "release-utils" | 307 | "import-emacs" "release-utils" |
| 300 | ;; Erc stuff not in Emacs: | 308 | ;; Erc stuff not in Emacs: |
| @@ -540,6 +548,7 @@ Changes to files in this list are not listed.") | |||
| 540 | "makedist.bat" | 548 | "makedist.bat" |
| 541 | "makefile.def" | 549 | "makefile.def" |
| 542 | "makefile.nt" | 550 | "makefile.nt" |
| 551 | "ns.mk" | ||
| 543 | "debug.bat.in" "emacs.bat.in" | 552 | "debug.bat.in" "emacs.bat.in" |
| 544 | ".gdbinit-union" | 553 | ".gdbinit-union" |
| 545 | "alloca.s" | 554 | "alloca.s" |
| @@ -553,15 +562,17 @@ Changes to files in this list are not listed.") | |||
| 553 | "ymakefile" | 562 | "ymakefile" |
| 554 | "permute-index" "index.perm" | 563 | "permute-index" "index.perm" |
| 555 | "ibmrs6000.inp" | 564 | "ibmrs6000.inp" |
| 556 | "b2m.c" "b2m.1" "b2m.pl" | 565 | "b2m.c" "b2m.1" "b2m.pl" "rcs-checkin.1" |
| 557 | "emacs.bash" "emacs.csh" "ms-kermit" | 566 | "emacs.bash" "emacs.csh" "ms-kermit" |
| 558 | "emacs.ico" | 567 | "emacs.ico" |
| 559 | "emacs21.ico" | 568 | "emacs21.ico" |
| 569 | "emacs.py" "emacs2.py" "emacs3.py" | ||
| 560 | "BABYL" "LPF" "LEDIT" "OTHER.EMACSES" | 570 | "BABYL" "LPF" "LEDIT" "OTHER.EMACSES" |
| 561 | "emacs16_mac.png" "emacs24_mac.png" | 571 | "emacs16_mac.png" "emacs24_mac.png" |
| 562 | "emacs256_mac.png" "emacs32_mac.png" | 572 | "emacs256_mac.png" "emacs32_mac.png" |
| 563 | "emacs48_mac.png" "emacs512_mac.png" | 573 | "emacs48_mac.png" "emacs512_mac.png" |
| 564 | "revdiff" ; admin/ | 574 | "revdiff" ; admin/ |
| 575 | "vcdiff" "rcs-checkin" "tindex.pl" | ||
| 565 | "mainmake" "sed1.inp" "sed2.inp" "sed3.inp" ; msdos/ | 576 | "mainmake" "sed1.inp" "sed2.inp" "sed3.inp" ; msdos/ |
| 566 | "mac-fix-env.m" | 577 | "mac-fix-env.m" |
| 567 | ;; Deleted vms stuff: | 578 | ;; Deleted vms stuff: |
| @@ -580,6 +591,7 @@ in the repository.") | |||
| 580 | ("s/windowsnt.h" . "s/ms-w32.h") | 591 | ("s/windowsnt.h" . "s/ms-w32.h") |
| 581 | ("s/ms-w32.h" . "inc/ms-w32.h") | 592 | ("s/ms-w32.h" . "inc/ms-w32.h") |
| 582 | ("winnt.el" . "w32-fns.el") | 593 | ("winnt.el" . "w32-fns.el") |
| 594 | ("emacs.manifest" . "emacs-x86.manifest") | ||
| 583 | ("config.emacs" . "configure") | 595 | ("config.emacs" . "configure") |
| 584 | ("configure.in" . "configure.ac") | 596 | ("configure.in" . "configure.ac") |
| 585 | ("config.h.dist" . "config.in") | 597 | ("config.h.dist" . "config.in") |
| @@ -616,6 +628,8 @@ in the repository.") | |||
| 616 | ("build-install" . "build-ins.in") | 628 | ("build-install" . "build-ins.in") |
| 617 | ("build-install.in" . "build-ins.in") | 629 | ("build-install.in" . "build-ins.in") |
| 618 | ("unidata/Makefile" . "unidata/Makefile.in") | 630 | ("unidata/Makefile" . "unidata/Makefile.in") |
| 631 | ("move-if-change" . "build-aux/move-if-change") | ||
| 632 | ("update-subdirs" . "build-aux/update-subdirs") | ||
| 619 | ;; Not renamed, but we only have the latter in the Emacs repo. | 633 | ;; Not renamed, but we only have the latter in the Emacs repo. |
| 620 | ("trampver.texi.in" . "trampver.texi") | 634 | ("trampver.texi.in" . "trampver.texi") |
| 621 | ("e/eterm" . "e/eterm-color") | 635 | ("e/eterm" . "e/eterm-color") |
diff --git a/lisp/emacs-lisp/crm.el b/lisp/emacs-lisp/crm.el index 5607c9b0698..f88cb0ef9bb 100644 --- a/lisp/emacs-lisp/crm.el +++ b/lisp/emacs-lisp/crm.el | |||
| @@ -30,12 +30,12 @@ | |||
| 30 | ;; a single prompt, optionally using completion. | 30 | ;; a single prompt, optionally using completion. |
| 31 | 31 | ||
| 32 | ;; Multiple strings are specified by separating each of the strings | 32 | ;; Multiple strings are specified by separating each of the strings |
| 33 | ;; with a prespecified separator character. For example, if the | 33 | ;; with a prespecified separator regexp. For example, if the |
| 34 | ;; separator character is a comma, the strings 'alice', 'bob', and | 34 | ;; separator regexp is ",", the strings 'alice', 'bob', and |
| 35 | ;; 'eve' would be specified as 'alice,bob,eve'. | 35 | ;; 'eve' would be specified as 'alice,bob,eve'. |
| 36 | 36 | ||
| 37 | ;; The default value for the separator character is the value of | 37 | ;; The default value for the separator regexp is the value of |
| 38 | ;; `crm-default-separator' (comma). The separator character may be | 38 | ;; `crm-default-separator' (comma). The separator regexp may be |
| 39 | ;; changed by modifying the value of `crm-separator'. | 39 | ;; changed by modifying the value of `crm-separator'. |
| 40 | 40 | ||
| 41 | ;; Contiguous strings of non-separator-characters are referred to as | 41 | ;; Contiguous strings of non-separator-characters are referred to as |
| @@ -96,14 +96,14 @@ | |||
| 96 | ;; first revamped version | 96 | ;; first revamped version |
| 97 | 97 | ||
| 98 | ;;; Code: | 98 | ;;; Code: |
| 99 | (defconst crm-default-separator "," | 99 | (defconst crm-default-separator "[ \t]*,[ \t]*" |
| 100 | "Default separator for `completing-read-multiple'.") | 100 | "Default separator regexp for `completing-read-multiple'.") |
| 101 | 101 | ||
| 102 | (defvar crm-separator crm-default-separator | 102 | (defvar crm-separator crm-default-separator |
| 103 | "Separator used for separating strings in `completing-read-multiple'. | 103 | "Separator regexp used for separating strings in `completing-read-multiple'. |
| 104 | It should be a single character string that doesn't appear in the list of | 104 | It should be a regexp that does not match the list of completion candidates. |
| 105 | completion candidates. Modify this value to make `completing-read-multiple' | 105 | Modify this value to make `completing-read-multiple' use a separator other |
| 106 | use a separator other than `crm-default-separator'.") | 106 | than `crm-default-separator'.") |
| 107 | 107 | ||
| 108 | (defvar crm-local-completion-map | 108 | (defvar crm-local-completion-map |
| 109 | (let ((map (make-sparse-keymap))) | 109 | (let ((map (make-sparse-keymap))) |
| @@ -173,13 +173,17 @@ Place an overlay on the element, with a `field' property, and return it." | |||
| 173 | (overlay-put ol 'field (make-symbol "crm")) | 173 | (overlay-put ol 'field (make-symbol "crm")) |
| 174 | ol)) | 174 | ol)) |
| 175 | 175 | ||
| 176 | (defmacro crm--completion-command (command) | ||
| 177 | "Make COMMAND a completion command for `completing-read-multiple'." | ||
| 178 | `(let ((ol (crm--select-current-element))) | ||
| 179 | (unwind-protect | ||
| 180 | ,command | ||
| 181 | (delete-overlay ol)))) | ||
| 182 | |||
| 176 | (defun crm-completion-help () | 183 | (defun crm-completion-help () |
| 177 | "Display a list of possible completions of the current minibuffer element." | 184 | "Display a list of possible completions of the current minibuffer element." |
| 178 | (interactive) | 185 | (interactive) |
| 179 | (let ((ol (crm--select-current-element))) | 186 | (crm--completion-command (minibuffer-completion-help)) |
| 180 | (unwind-protect | ||
| 181 | (minibuffer-completion-help) | ||
| 182 | (delete-overlay ol))) | ||
| 183 | nil) | 187 | nil) |
| 184 | 188 | ||
| 185 | (defun crm-complete () | 189 | (defun crm-complete () |
| @@ -188,19 +192,13 @@ If no characters can be completed, display a list of possible completions. | |||
| 188 | 192 | ||
| 189 | Return t if the current element is now a valid match; otherwise return nil." | 193 | Return t if the current element is now a valid match; otherwise return nil." |
| 190 | (interactive) | 194 | (interactive) |
| 191 | (let ((ol (crm--select-current-element))) | 195 | (crm--completion-command (minibuffer-complete))) |
| 192 | (unwind-protect | ||
| 193 | (minibuffer-complete) | ||
| 194 | (delete-overlay ol)))) | ||
| 195 | 196 | ||
| 196 | (defun crm-complete-word () | 197 | (defun crm-complete-word () |
| 197 | "Complete the current element at most a single word. | 198 | "Complete the current element at most a single word. |
| 198 | Like `minibuffer-complete-word' but for `completing-read-multiple'." | 199 | Like `minibuffer-complete-word' but for `completing-read-multiple'." |
| 199 | (interactive) | 200 | (interactive) |
| 200 | (let ((ol (crm--select-current-element))) | 201 | (crm--completion-command (minibuffer-complete-word))) |
| 201 | (unwind-protect | ||
| 202 | (minibuffer-complete-word) | ||
| 203 | (delete-overlay ol)))) | ||
| 204 | 202 | ||
| 205 | (defun crm-complete-and-exit () | 203 | (defun crm-complete-and-exit () |
| 206 | "If all of the minibuffer elements are valid completions then exit. | 204 | "If all of the minibuffer elements are valid completions then exit. |
| @@ -222,9 +220,10 @@ This function is modeled after `minibuffer-complete-and-exit'." | |||
| 222 | (setq doexit nil)) | 220 | (setq doexit nil)) |
| 223 | (goto-char (overlay-end ol)) | 221 | (goto-char (overlay-end ol)) |
| 224 | (delete-overlay ol)) | 222 | (delete-overlay ol)) |
| 225 | (not (eobp)))) | 223 | (not (eobp))) |
| 224 | (looking-at crm-separator)) | ||
| 226 | ;; Skip to the next element. | 225 | ;; Skip to the next element. |
| 227 | (forward-char 1)) | 226 | (goto-char (match-end 0))) |
| 228 | (if doexit (exit-minibuffer)))) | 227 | (if doexit (exit-minibuffer)))) |
| 229 | 228 | ||
| 230 | (defun crm--choose-completion-string (choice buffer base-position | 229 | (defun crm--choose-completion-string (choice buffer base-position |
| @@ -248,12 +247,12 @@ By using this functionality, a user may specify multiple strings at a | |||
| 248 | single prompt, optionally using completion. | 247 | single prompt, optionally using completion. |
| 249 | 248 | ||
| 250 | Multiple strings are specified by separating each of the strings with | 249 | Multiple strings are specified by separating each of the strings with |
| 251 | a prespecified separator character. For example, if the separator | 250 | a prespecified separator regexp. For example, if the separator |
| 252 | character is a comma, the strings 'alice', 'bob', and 'eve' would be | 251 | regexp is \",\", the strings 'alice', 'bob', and 'eve' would be |
| 253 | specified as 'alice,bob,eve'. | 252 | specified as 'alice,bob,eve'. |
| 254 | 253 | ||
| 255 | The default value for the separator character is the value of | 254 | The default value for the separator regexp is the value of |
| 256 | `crm-default-separator' (comma). The separator character may be | 255 | `crm-default-separator' (comma). The separator regexp may be |
| 257 | changed by modifying the value of `crm-separator'. | 256 | changed by modifying the value of `crm-separator'. |
| 258 | 257 | ||
| 259 | Contiguous strings of non-separator-characters are referred to as | 258 | Contiguous strings of non-separator-characters are referred to as |
| @@ -282,8 +281,8 @@ INHERIT-INPUT-METHOD." | |||
| 282 | (map (if require-match | 281 | (map (if require-match |
| 283 | crm-local-must-match-map | 282 | crm-local-must-match-map |
| 284 | crm-local-completion-map)) | 283 | crm-local-completion-map)) |
| 285 | ;; If the user enters empty input, read-from-minibuffer returns | 284 | ;; If the user enters empty input, `read-from-minibuffer' |
| 286 | ;; the empty string, not DEF. | 285 | ;; returns the empty string, not DEF. |
| 287 | (input (read-from-minibuffer | 286 | (input (read-from-minibuffer |
| 288 | prompt initial-input map | 287 | prompt initial-input map |
| 289 | nil hist def inherit-input-method))) | 288 | nil hist def inherit-input-method))) |
diff --git a/lisp/faces.el b/lisp/faces.el index f78a4cb9e3d..60410733514 100644 --- a/lisp/faces.el +++ b/lisp/faces.el | |||
| @@ -929,27 +929,29 @@ of the default face. Value is FACE." | |||
| 929 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 929 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 930 | 930 | ||
| 931 | (defun read-face-name (prompt &optional default multiple) | 931 | (defun read-face-name (prompt &optional default multiple) |
| 932 | "Read a face, defaulting to the face or faces at point. | 932 | "Read one or more face names, defaulting to the face(s) at point. |
| 933 | If the text at point has the property `read-face-name', that | 933 | PROMPT should be a prompt string; it should not end in a space or |
| 934 | overrides the `face' property for determining the default. | 934 | a colon. |
| 935 | 935 | ||
| 936 | PROMPT should be a string that describes what the caller will do | 936 | The optional argument DEFAULT specifies the default face name(s) |
| 937 | with the face; it should not end in a space. | 937 | to return if the user just types RET. If its value is non-nil, |
| 938 | it should be a list of face names (symbols); in that case, the | ||
| 939 | default return value is the `car' of DEFAULT (if the argument | ||
| 940 | MULTIPLE is non-nil), or DEFAULT (if MULTIPLE is nil). See below | ||
| 941 | for the meaning of MULTIPLE. | ||
| 938 | 942 | ||
| 943 | If DEFAULT is nil, the list of default face names is taken from | ||
| 944 | the `read-face-name' property of the text at point, or, if that | ||
| 945 | is nil, from the `face' property of the text at point. | ||
| 939 | 946 | ||
| 940 | This function uses `completing-read-multiple' with \",\" as the | 947 | This function uses `completing-read-multiple' with \",\" as the |
| 941 | separator character, i.e. | 948 | separator character. Thus, the user may enter multiple face |
| 942 | 949 | names, separated by commas. The optional argument MULTIPLE | |
| 943 | 950 | specifies the form of the return value. If MULTIPLE is non-nil, | |
| 944 | 951 | return a list of face names; if the user entered just one face | |
| 945 | 952 | name, the return value would be a list of one face name. | |
| 946 | 953 | Otherwise, return a single face name; if the user entered more | |
| 947 | The optional argument DEFAULT provides the value to display in the | 954 | than one face name, return only the first one." |
| 948 | minibuffer prompt that is returned if the user just types RET | ||
| 949 | unless DEFAULT is a string (in which case nil is returned). | ||
| 950 | |||
| 951 | If MULTIPLE is non-nil, return a list of faces (possibly only one). | ||
| 952 | Otherwise, return a single face." | ||
| 953 | (let ((faceprop (or (get-char-property (point) 'read-face-name) | 955 | (let ((faceprop (or (get-char-property (point) 'read-face-name) |
| 954 | (get-char-property (point) 'face))) | 956 | (get-char-property (point) 'face))) |
| 955 | (aliasfaces nil) | 957 | (aliasfaces nil) |
diff --git a/lisp/files.el b/lisp/files.el index ca5a415fb8e..b015b53db3c 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -2357,7 +2357,7 @@ ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\|7Z\\)\\'" . archive-mode) | |||
| 2357 | ("\\.\\(diffs?\\|patch\\|rej\\)\\'" . diff-mode) | 2357 | ("\\.\\(diffs?\\|patch\\|rej\\)\\'" . diff-mode) |
| 2358 | ("\\.\\(dif\\|pat\\)\\'" . diff-mode) ; for MSDOG | 2358 | ("\\.\\(dif\\|pat\\)\\'" . diff-mode) ; for MSDOG |
| 2359 | ("\\.[eE]?[pP][sS]\\'" . ps-mode) | 2359 | ("\\.[eE]?[pP][sS]\\'" . ps-mode) |
| 2360 | ("\\.\\(?:PDF\\|DVI\\|OD[FGPST]\\|DOCX?\\|XLSX?\\|PPTX?\\|pdf\\|dvi\\|od[fgpst]\\|docx?\\|xlsx?\\|pptx?\\)\\'" . doc-view-mode-maybe) | 2360 | ("\\.\\(?:PDF\\|DVI\\|OD[FGPST]\\|DOCX?\\|XLSX?\\|PPTX?\\|pdf\\|djvu\\|dvi\\|od[fgpst]\\|docx?\\|xlsx?\\|pptx?\\)\\'" . doc-view-mode-maybe) |
| 2361 | ("configure\\.\\(ac\\|in\\)\\'" . autoconf-mode) | 2361 | ("configure\\.\\(ac\\|in\\)\\'" . autoconf-mode) |
| 2362 | ("\\.s\\(v\\|iv\\|ieve\\)\\'" . sieve-mode) | 2362 | ("\\.s\\(v\\|iv\\|ieve\\)\\'" . sieve-mode) |
| 2363 | ("BROWSE\\'" . ebrowse-tree-mode) | 2363 | ("BROWSE\\'" . ebrowse-tree-mode) |
diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 90eb5dfaec5..a95dde1d999 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el | |||
| @@ -63,8 +63,9 @@ otherwise it defaults to t, used for times when the buffer is not displayed." | |||
| 63 | (when cleanup | 63 | (when cleanup |
| 64 | (setq image-mode-winprops-alist | 64 | (setq image-mode-winprops-alist |
| 65 | (delq nil (mapcar (lambda (winprop) | 65 | (delq nil (mapcar (lambda (winprop) |
| 66 | (if (window-live-p (car-safe winprop)) | 66 | (let ((w (car-safe winprop))) |
| 67 | winprop)) | 67 | (if (or (not (windowp w)) (window-live-p w)) |
| 68 | winprop))) | ||
| 68 | image-mode-winprops-alist)))) | 69 | image-mode-winprops-alist)))) |
| 69 | (let ((winprops (assq window image-mode-winprops-alist))) | 70 | (let ((winprops (assq window image-mode-winprops-alist))) |
| 70 | ;; For new windows, set defaults from the latest. | 71 | ;; For new windows, set defaults from the latest. |
diff --git a/lisp/imenu.el b/lisp/imenu.el index 0bfee770094..f64d1afe951 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el | |||
| @@ -447,6 +447,8 @@ Don't move point." | |||
| 447 | Simple elements in the alist look like (INDEX-NAME . POSITION). | 447 | Simple elements in the alist look like (INDEX-NAME . POSITION). |
| 448 | POSITION is the buffer position of the item; to go to the item | 448 | POSITION is the buffer position of the item; to go to the item |
| 449 | is simply to move point to that position. | 449 | is simply to move point to that position. |
| 450 | POSITION is passed to `imenu-default-goto-function', so it can be a non-number | ||
| 451 | if that variable has been changed (e.g. Semantic uses overlays for POSITIONs). | ||
| 450 | 452 | ||
| 451 | Special elements look like (INDEX-NAME POSITION FUNCTION ARGUMENTS...). | 453 | Special elements look like (INDEX-NAME POSITION FUNCTION ARGUMENTS...). |
| 452 | To \"go to\" a special element means applying FUNCTION | 454 | To \"go to\" a special element means applying FUNCTION |
diff --git a/lisp/man.el b/lisp/man.el index b6a6c179374..93a67128de4 100644 --- a/lisp/man.el +++ b/lisp/man.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; man.el --- browse UNIX manual pages -*- coding: iso-8859-1 -*- | 1 | ;;; man.el --- browse UNIX manual pages -*- coding: utf-8 -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1993-1994, 1996-1997, 2001-2013 Free Software | 3 | ;; Copyright (C) 1993-1994, 1996-1997, 2001-2013 Free Software |
| 4 | ;; Foundation, Inc. | 4 | ;; Foundation, Inc. |
| @@ -276,7 +276,7 @@ Used in `bookmark-set' to get the default bookmark name." | |||
| 276 | :type 'hook | 276 | :type 'hook |
| 277 | :group 'man) | 277 | :group 'man) |
| 278 | 278 | ||
| 279 | (defvar Man-name-regexp "[-a-zA-Z0-9_+][-a-zA-Z0-9_.:+]*" | 279 | (defvar Man-name-regexp "[-a-zA-Z0-9_Â+][-a-zA-Z0-9_.:Â+]*" |
| 280 | "Regular expression describing the name of a manpage (without section).") | 280 | "Regular expression describing the name of a manpage (without section).") |
| 281 | 281 | ||
| 282 | (defvar Man-section-regexp "[0-9][a-zA-Z0-9+]*\\|[LNln]" | 282 | (defvar Man-section-regexp "[0-9][a-zA-Z0-9+]*\\|[LNln]" |
| @@ -780,6 +780,59 @@ POS defaults to `point'." | |||
| 780 | ;; but apparently that's not the case in all cases, so let's add a cache. | 780 | ;; but apparently that's not the case in all cases, so let's add a cache. |
| 781 | "Cache of completion table of the form (PREFIX . TABLE).") | 781 | "Cache of completion table of the form (PREFIX . TABLE).") |
| 782 | 782 | ||
| 783 | (defvar Man-man-k-use-anchor | ||
| 784 | ;; man-db or man-1.* | ||
| 785 | (memq system-type '(gnu gnu/linux gnu/kfreebsd)) | ||
| 786 | "If non-nil prepend ^ to the prefix passed to \"man -k\" for completion. | ||
| 787 | The value should be nil if \"man -k ^PREFIX\" may omit some man | ||
| 788 | pages whose names start with PREFIX. | ||
| 789 | |||
| 790 | Currently, the default value depends on `system-type' and is | ||
| 791 | non-nil where the standard man programs are known to behave | ||
| 792 | properly. Setting the value to nil always gives correct results | ||
| 793 | but computing the list of completions may take a bit longer.") | ||
| 794 | |||
| 795 | (defun Man-parse-man-k () | ||
| 796 | "Parse \"man -k\" output and return the list of page names. | ||
| 797 | |||
| 798 | The current buffer should contain the output of a command of the | ||
| 799 | form \"man -k keyword\", which is traditionally also available with | ||
| 800 | apropos(1). | ||
| 801 | |||
| 802 | While POSIX man(1p) is a bit vague about what to expect here, | ||
| 803 | this function tries to parse some commonly used formats, which | ||
| 804 | can be described in the following informal way, with square brackets | ||
| 805 | indicating optional parts and whitespace being interpreted | ||
| 806 | somewhat loosely. | ||
| 807 | |||
| 808 | foo[, bar [, ...]] [other stuff] (sec) - description | ||
| 809 | foo(sec)[, bar(sec) [, ...]] [other stuff] - description | ||
| 810 | |||
| 811 | For more details and some regression tests, please see | ||
| 812 | test/automated/man-tests.el in the emacs bzr repository." | ||
| 813 | (goto-char (point-min)) | ||
| 814 | ;; See man-tests for data about which systems use which format (hopefully we | ||
| 815 | ;; will be able to simplify the code if/when some of those formats aren't | ||
| 816 | ;; used any more). | ||
| 817 | (let (table) | ||
| 818 | (while (search-forward-regexp "^\\([^ \t,\n]+\\)\\(.*?\\)\ | ||
| 819 | \\(?:[ \t]\\(([^ \t,\n]+?)\\)\\)?\\(?:[ \t]+- ?\\(.*\\)\\)?$" nil t) | ||
| 820 | (let ((section (match-string 3)) | ||
| 821 | (description (match-string 4)) | ||
| 822 | (bound (match-end 2))) | ||
| 823 | (goto-char (match-end 1)) | ||
| 824 | (while | ||
| 825 | (progn | ||
| 826 | ;; The first regexp grouping may already match the section | ||
| 827 | ;; tacked on to the name, which is ok since for the formats we | ||
| 828 | ;; claim to support the third (non-shy) grouping does not | ||
| 829 | ;; match in this case, i.e., section is nil. | ||
| 830 | (push (propertize (concat (match-string 1) section) | ||
| 831 | 'help-echo description) | ||
| 832 | table) | ||
| 833 | (search-forward-regexp "\\=, *\\([^ \t,]+\\)" bound t))))) | ||
| 834 | (nreverse table))) | ||
| 835 | |||
| 783 | (defun Man-completion-table (string pred action) | 836 | (defun Man-completion-table (string pred action) |
| 784 | (cond | 837 | (cond |
| 785 | ;; This ends up returning t for pretty much any string, and hence leads to | 838 | ;; This ends up returning t for pretty much any string, and hence leads to |
| @@ -811,16 +864,15 @@ POS defaults to `point'." | |||
| 811 | ;; run differently in Man-getpage-in-background, an error | 864 | ;; run differently in Man-getpage-in-background, an error |
| 812 | ;; here may not necessarily mean that we'll also get an | 865 | ;; here may not necessarily mean that we'll also get an |
| 813 | ;; error later. | 866 | ;; error later. |
| 814 | (ignore-errors | 867 | (ignore-errors |
| 815 | (call-process manual-program nil '(t nil) nil | 868 | (call-process manual-program nil '(t nil) nil |
| 816 | "-k" (concat "^" prefix)))) | 869 | "-k" (concat (when (or Man-man-k-use-anchor |
| 817 | (goto-char (point-min)) | 870 | (string-equal prefix "")) |
| 818 | (while (re-search-forward "^\\([^ \t\n]+\\)\\(?: ?\\((.+?)\\)\\(?:[ \t]+- \\(.*\\)\\)?\\)?" nil t) | 871 | "^") |
| 819 | (push (propertize (concat (match-string 1) (match-string 2)) | 872 | prefix)))) |
| 820 | 'help-echo (match-string 3)) | 873 | (setq table (Man-parse-man-k))) |
| 821 | table))) | 874 | ;; Cache the table for later reuse. |
| 822 | ;; Cache the table for later reuse. | 875 | (setq Man-completion-cache (cons prefix table))) |
| 823 | (setq Man-completion-cache (cons prefix table))) | ||
| 824 | ;; The table may contain false positives since the match is made | 876 | ;; The table may contain false positives since the match is made |
| 825 | ;; by "man -k" not just on the manpage's name. | 877 | ;; by "man -k" not just on the manpage's name. |
| 826 | (if section | 878 | (if section |
| @@ -891,6 +943,7 @@ names or descriptions. The pattern argument is usually an | |||
| 891 | ;; ("man -k" is case-insensitive similarly, so the | 943 | ;; ("man -k" is case-insensitive similarly, so the |
| 892 | ;; table has everything available to complete) | 944 | ;; table has everything available to complete) |
| 893 | (completion-ignore-case t) | 945 | (completion-ignore-case t) |
| 946 | Man-completion-cache ;Don't cache across calls. | ||
| 894 | (input (completing-read | 947 | (input (completing-read |
| 895 | (format "Manual entry%s" | 948 | (format "Manual entry%s" |
| 896 | (if (string= default-entry "") | 949 | (if (string= default-entry "") |
| @@ -1395,7 +1448,7 @@ The following key bindings are currently in effect in the buffer: | |||
| 1395 | ;; Update len, in case a reference spans | 1448 | ;; Update len, in case a reference spans |
| 1396 | ;; more than two lines (paranoia). | 1449 | ;; more than two lines (paranoia). |
| 1397 | len (1- (length word)))) | 1450 | len (1- (length word)))) |
| 1398 | (if (memq (aref word len) '(?- ?)) | 1451 | (if (memq (aref word len) '(?- ?Â)) |
| 1399 | (setq hyphenated (substring word 0 len))) | 1452 | (setq hyphenated (substring word 0 len))) |
| 1400 | (and (string-match Man-reference-regexp word) | 1453 | (and (string-match Man-reference-regexp word) |
| 1401 | (not (member word Man--refpages)) | 1454 | (not (member word Man--refpages)) |
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 6ffa67f59c1..560b66bf3b0 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el | |||
| @@ -2464,8 +2464,12 @@ comment at the start of cc-engine.el for more info." | |||
| 2464 | 2464 | ||
| 2465 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 2465 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 2466 | ;; Variables which keep track of preprocessor constructs. | 2466 | ;; Variables which keep track of preprocessor constructs. |
| 2467 | (defvar c-state-old-cpp-beg-marker nil) | ||
| 2468 | (make-variable-buffer-local 'c-state-old-cpp-beg-marker) | ||
| 2467 | (defvar c-state-old-cpp-beg nil) | 2469 | (defvar c-state-old-cpp-beg nil) |
| 2468 | (make-variable-buffer-local 'c-state-old-cpp-beg) | 2470 | (make-variable-buffer-local 'c-state-old-cpp-beg) |
| 2471 | (defvar c-state-old-cpp-end-marker nil) | ||
| 2472 | (make-variable-buffer-local 'c-state-old-cpp-end-marker) | ||
| 2469 | (defvar c-state-old-cpp-end nil) | 2473 | (defvar c-state-old-cpp-end nil) |
| 2470 | (make-variable-buffer-local 'c-state-old-cpp-end) | 2474 | (make-variable-buffer-local 'c-state-old-cpp-end) |
| 2471 | ;; These are the limits of the macro containing point at the previous call of | 2475 | ;; These are the limits of the macro containing point at the previous call of |
| @@ -2653,13 +2657,21 @@ comment at the start of cc-engine.el for more info." | |||
| 2653 | ;; reduce the time wasted in repeated fruitless searches in brace deserts. | 2657 | ;; reduce the time wasted in repeated fruitless searches in brace deserts. |
| 2654 | (save-excursion | 2658 | (save-excursion |
| 2655 | (save-restriction | 2659 | (save-restriction |
| 2656 | (let ((bra from) ce ; Positions of "{" and "}". | 2660 | (let* (new-cons |
| 2657 | new-cons | 2661 | (cache-pos (c-state-cache-top-lparen)) ; might be nil. |
| 2658 | (cache-pos (c-state-cache-top-lparen)) ; might be nil. | 2662 | (macro-start-or-from |
| 2659 | (macro-start-or-from | 2663 | (progn (goto-char from) |
| 2660 | (progn (goto-char from) | 2664 | (c-beginning-of-macro) |
| 2661 | (c-beginning-of-macro) | 2665 | (point))) |
| 2662 | (point)))) | 2666 | (bra ; Position of "{". |
| 2667 | ;; Don't start scanning in the middle of a CPP construct unless | ||
| 2668 | ;; it contains HERE - these constructs, in Emacs, are "commented | ||
| 2669 | ;; out" with category properties. | ||
| 2670 | (if (eq (c-get-char-property macro-start-or-from 'category) | ||
| 2671 | 'c-cpp-delimiter) | ||
| 2672 | macro-start-or-from | ||
| 2673 | from)) | ||
| 2674 | ce) ; Position of "}" | ||
| 2663 | (or upper-lim (setq upper-lim from)) | 2675 | (or upper-lim (setq upper-lim from)) |
| 2664 | 2676 | ||
| 2665 | ;; If we're essentially repeating a fruitless search, just give up. | 2677 | ;; If we're essentially repeating a fruitless search, just give up. |
| @@ -2899,7 +2911,9 @@ comment at the start of cc-engine.el for more info." | |||
| 2899 | (point-max) | 2911 | (point-max) |
| 2900 | (min (point-max) c-state-old-cpp-beg))) | 2912 | (min (point-max) c-state-old-cpp-beg))) |
| 2901 | (while (and c-state-cache (>= (c-state-cache-top-lparen) upper-lim)) | 2913 | (while (and c-state-cache (>= (c-state-cache-top-lparen) upper-lim)) |
| 2914 | (setq scan-back-pos (car-safe (car c-state-cache))) | ||
| 2902 | (setq c-state-cache (cdr c-state-cache))) | 2915 | (setq c-state-cache (cdr c-state-cache))) |
| 2916 | |||
| 2903 | ;; If `upper-lim' is inside the last recorded brace pair, remove its | 2917 | ;; If `upper-lim' is inside the last recorded brace pair, remove its |
| 2904 | ;; RBrace and indicate we'll need to search backwards for a previous | 2918 | ;; RBrace and indicate we'll need to search backwards for a previous |
| 2905 | ;; brace pair. | 2919 | ;; brace pair. |
| @@ -3324,6 +3338,13 @@ comment at the start of cc-engine.el for more info." | |||
| 3324 | (c-with-cpps-commented-out | 3338 | (c-with-cpps-commented-out |
| 3325 | (c-invalidate-state-cache-1 here))))) | 3339 | (c-invalidate-state-cache-1 here))))) |
| 3326 | 3340 | ||
| 3341 | (defmacro c-state-maybe-marker (place marker) | ||
| 3342 | ;; If PLACE is non-nil, return a marker marking it, otherwise nil. | ||
| 3343 | ;; We (re)use MARKER. | ||
| 3344 | `(and ,place | ||
| 3345 | (or ,marker (setq ,marker (make-marker))) | ||
| 3346 | (set-marker ,marker ,place))) | ||
| 3347 | |||
| 3327 | (defun c-parse-state () | 3348 | (defun c-parse-state () |
| 3328 | ;; This is a wrapper over `c-parse-state-1'. See that function for a | 3349 | ;; This is a wrapper over `c-parse-state-1'. See that function for a |
| 3329 | ;; description of the functionality and return value. | 3350 | ;; description of the functionality and return value. |
| @@ -3350,9 +3371,10 @@ comment at the start of cc-engine.el for more info." | |||
| 3350 | (c-parse-state-1)) | 3371 | (c-parse-state-1)) |
| 3351 | (c-with-cpps-commented-out | 3372 | (c-with-cpps-commented-out |
| 3352 | (c-parse-state-1)))) | 3373 | (c-parse-state-1)))) |
| 3353 | (setq c-state-old-cpp-beg (and here-cpp-beg (copy-marker here-cpp-beg t)) | 3374 | (setq c-state-old-cpp-beg |
| 3354 | c-state-old-cpp-end (and here-cpp-end (copy-marker here-cpp-end t))) | 3375 | (c-state-maybe-marker here-cpp-beg c-state-old-cpp-beg-marker) |
| 3355 | ))) | 3376 | c-state-old-cpp-end |
| 3377 | (c-state-maybe-marker here-cpp-end c-state-old-cpp-end-marker))))) | ||
| 3356 | 3378 | ||
| 3357 | ;; Debug tool to catch cache inconsistencies. This is called from | 3379 | ;; Debug tool to catch cache inconsistencies. This is called from |
| 3358 | ;; 000tests.el. | 3380 | ;; 000tests.el. |
diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el index 0279319cc89..adf378f6bc7 100644 --- a/lisp/progmodes/which-func.el +++ b/lisp/progmodes/which-func.el | |||
| @@ -319,7 +319,9 @@ If no function name is found, return nil." | |||
| 319 | namestack (cons (car pair) namestack) | 319 | namestack (cons (car pair) namestack) |
| 320 | alist (cdr pair))) | 320 | alist (cdr pair))) |
| 321 | 321 | ||
| 322 | ((number-or-marker-p (setq mark (cdr pair))) | 322 | ((or (number-or-marker-p (setq mark (cdr pair))) |
| 323 | (and (overlayp mark) | ||
| 324 | (setq mark (overlay-start mark)))) | ||
| 323 | (when (and (>= (setq offset (- (point) mark)) 0) | 325 | (when (and (>= (setq offset (- (point) mark)) 0) |
| 324 | (< offset minoffset)) ; Find the closest item. | 326 | (< offset minoffset)) ; Find the closest item. |
| 325 | (setq minoffset offset | 327 | (setq minoffset offset |
diff --git a/lisp/simple.el b/lisp/simple.el index d06a04aa5dc..dcd6d792acb 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -1391,14 +1391,16 @@ If the value is non-nil and not a number, we wait 2 seconds." | |||
| 1391 | ;; Aaron S. Hawley <aaron.s.hawley(at)gmail.com> 2009-08-24 | 1391 | ;; Aaron S. Hawley <aaron.s.hawley(at)gmail.com> 2009-08-24 |
| 1392 | "Read function name, then read its arguments and call it. | 1392 | "Read function name, then read its arguments and call it. |
| 1393 | 1393 | ||
| 1394 | To pass a numeric argument to the command you are invoking with, specify | 1394 | To pass a numeric argument to the command you are invoking, specify |
| 1395 | the numeric argument to this command. | 1395 | the numeric argument to this command. |
| 1396 | 1396 | ||
| 1397 | Noninteractively, the argument PREFIXARG is the prefix argument to | 1397 | Noninteractively, the argument PREFIXARG is the prefix argument to |
| 1398 | give to the command you invoke, if it asks for an argument." | 1398 | give to the command you invoke, if it asks for an argument." |
| 1399 | (interactive (list current-prefix-arg (read-extended-command))) | 1399 | (interactive (list current-prefix-arg (read-extended-command))) |
| 1400 | ;; Emacs<24 calling-convention was with a single `prefixarg' argument. | 1400 | ;; Emacs<24 calling-convention was with a single `prefixarg' argument. |
| 1401 | (if (null command-name) (setq command-name (read-extended-command))) | 1401 | (if (null command-name) |
| 1402 | (setq command-name (let ((current-prefix-arg prefixarg)) ; for prompt | ||
| 1403 | (read-extended-command)))) | ||
| 1402 | (let* ((function (and (stringp command-name) (intern-soft command-name))) | 1404 | (let* ((function (and (stringp command-name) (intern-soft command-name))) |
| 1403 | (binding (and suggest-key-bindings | 1405 | (binding (and suggest-key-bindings |
| 1404 | (not executing-kbd-macro) | 1406 | (not executing-kbd-macro) |
diff --git a/src/ChangeLog b/src/ChangeLog index 6ce141331ec..dd22c5388b0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,28 @@ | |||
| 1 | 2013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change) | ||
| 2 | |||
| 3 | * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around | ||
| 4 | x_last_font_name (Bug#13403). | ||
| 5 | |||
| 6 | 2013-01-10 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 7 | |||
| 8 | Omit buffer_slot_type_mismatch and use generic predicates to enforce | ||
| 9 | the type of per-buffer values where appropriate. | ||
| 10 | * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to | ||
| 11 | predicate, which is how it's really used now. Adjust comment. | ||
| 12 | * buffer.h (buffer_slot_type_mismatch): Remove prototype. | ||
| 13 | * buffer.c (buffer_slot_type_mismatch): Remove. | ||
| 14 | (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to | ||
| 15 | predicate. Adjust comment. | ||
| 16 | (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for | ||
| 17 | fill-column, left-margin, tab-width, buffer-saved-size, | ||
| 18 | left-margin-width, right-margin-width, left-fringe-width, | ||
| 19 | right-fringe-width, scroll-bar-width and buffer-display-count. | ||
| 20 | Use Qstringp for default-directory, buffer-file-name, | ||
| 21 | buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for | ||
| 22 | scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for | ||
| 23 | line-spacing. | ||
| 24 | * data.c (store_symval_forwarding): Adjust to call the predicate. | ||
| 25 | |||
| 1 | 2013-01-09 Juanma Barranquero <lekktu@gmail.com> | 26 | 2013-01-09 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 27 | ||
| 3 | * w32.c (get_name_and_id, acl_set_file): | 28 | * w32.c (get_name_and_id, acl_set_file): |
diff --git a/src/buffer.c b/src/buffer.c index 51c4d9c71da..218ae1a7d11 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -4576,27 +4576,7 @@ evaporate_overlays (ptrdiff_t pos) | |||
| 4576 | for (; CONSP (hit_list); hit_list = XCDR (hit_list)) | 4576 | for (; CONSP (hit_list); hit_list = XCDR (hit_list)) |
| 4577 | Fdelete_overlay (XCAR (hit_list)); | 4577 | Fdelete_overlay (XCAR (hit_list)); |
| 4578 | } | 4578 | } |
| 4579 | |||
| 4580 | /* Somebody has tried to store a value with an unacceptable type | ||
| 4581 | in the slot with offset OFFSET. */ | ||
| 4582 | 4579 | ||
| 4583 | void | ||
| 4584 | buffer_slot_type_mismatch (Lisp_Object newval, int type) | ||
| 4585 | { | ||
| 4586 | Lisp_Object predicate; | ||
| 4587 | |||
| 4588 | switch (type) | ||
| 4589 | { | ||
| 4590 | case_Lisp_Int: predicate = Qintegerp; break; | ||
| 4591 | case Lisp_String: predicate = Qstringp; break; | ||
| 4592 | case Lisp_Symbol: predicate = Qsymbolp; break; | ||
| 4593 | default: emacs_abort (); | ||
| 4594 | } | ||
| 4595 | |||
| 4596 | wrong_type_argument (predicate, newval); | ||
| 4597 | } | ||
| 4598 | |||
| 4599 | |||
| 4600 | /*********************************************************************** | 4580 | /*********************************************************************** |
| 4601 | Allocation with mmap | 4581 | Allocation with mmap |
| 4602 | ***********************************************************************/ | 4582 | ***********************************************************************/ |
| @@ -5370,25 +5350,23 @@ init_buffer (void) | |||
| 5370 | free (pwd); | 5350 | free (pwd); |
| 5371 | } | 5351 | } |
| 5372 | 5352 | ||
| 5373 | /* Similar to defvar_lisp but define a variable whose value is the Lisp | 5353 | /* Similar to defvar_lisp but define a variable whose value is the |
| 5374 | Object stored in the current buffer. address is the address of the slot | 5354 | Lisp_Object stored in the current buffer. LNAME is the Lisp-level |
| 5375 | in the buffer that is current now. */ | 5355 | variable name. VNAME is the name of the buffer slot. PREDICATE |
| 5376 | 5356 | is nil for a general Lisp variable. If PREDICATE is non-nil, then | |
| 5377 | /* TYPE is nil for a general Lisp variable. | 5357 | only Lisp values that satisfies the PREDICATE are allowed (except |
| 5378 | An integer specifies a type; then only Lisp values | 5358 | that nil is allowed too). DOC is a dummy where you write the doc |
| 5379 | with that type code are allowed (except that nil is allowed too). | 5359 | string as a comment. */ |
| 5380 | LNAME is the Lisp-level variable name. | 5360 | |
| 5381 | VNAME is the name of the buffer slot. | 5361 | #define DEFVAR_PER_BUFFER(lname, vname, predicate, doc) \ |
| 5382 | DOC is a dummy where you write the doc string as a comment. */ | 5362 | do { \ |
| 5383 | #define DEFVAR_PER_BUFFER(lname, vname, type, doc) \ | 5363 | static struct Lisp_Buffer_Objfwd bo_fwd; \ |
| 5384 | do { \ | 5364 | defvar_per_buffer (&bo_fwd, lname, vname, predicate); \ |
| 5385 | static struct Lisp_Buffer_Objfwd bo_fwd; \ | ||
| 5386 | defvar_per_buffer (&bo_fwd, lname, vname, type); \ | ||
| 5387 | } while (0) | 5365 | } while (0) |
| 5388 | 5366 | ||
| 5389 | static void | 5367 | static void |
| 5390 | defvar_per_buffer (struct Lisp_Buffer_Objfwd *bo_fwd, const char *namestring, | 5368 | defvar_per_buffer (struct Lisp_Buffer_Objfwd *bo_fwd, const char *namestring, |
| 5391 | Lisp_Object *address, Lisp_Object type) | 5369 | Lisp_Object *address, Lisp_Object predicate) |
| 5392 | { | 5370 | { |
| 5393 | struct Lisp_Symbol *sym; | 5371 | struct Lisp_Symbol *sym; |
| 5394 | int offset; | 5372 | int offset; |
| @@ -5398,7 +5376,7 @@ defvar_per_buffer (struct Lisp_Buffer_Objfwd *bo_fwd, const char *namestring, | |||
| 5398 | 5376 | ||
| 5399 | bo_fwd->type = Lisp_Fwd_Buffer_Obj; | 5377 | bo_fwd->type = Lisp_Fwd_Buffer_Obj; |
| 5400 | bo_fwd->offset = offset; | 5378 | bo_fwd->offset = offset; |
| 5401 | bo_fwd->slottype = type; | 5379 | bo_fwd->predicate = predicate; |
| 5402 | sym->declared_special = 1; | 5380 | sym->declared_special = 1; |
| 5403 | sym->redirect = SYMBOL_FORWARDED; | 5381 | sym->redirect = SYMBOL_FORWARDED; |
| 5404 | { | 5382 | { |
| @@ -5661,7 +5639,7 @@ Decimal digits after the % specify field width to which to pad. */); | |||
| 5661 | doc: /* Value of `major-mode' for new buffers. */); | 5639 | doc: /* Value of `major-mode' for new buffers. */); |
| 5662 | 5640 | ||
| 5663 | DEFVAR_PER_BUFFER ("major-mode", &BVAR (current_buffer, major_mode), | 5641 | DEFVAR_PER_BUFFER ("major-mode", &BVAR (current_buffer, major_mode), |
| 5664 | make_number (Lisp_Symbol), | 5642 | Qsymbolp, |
| 5665 | doc: /* Symbol for current buffer's major mode. | 5643 | doc: /* Symbol for current buffer's major mode. |
| 5666 | The default value (normally `fundamental-mode') affects new buffers. | 5644 | The default value (normally `fundamental-mode') affects new buffers. |
| 5667 | A value of nil means to use the current buffer's major mode, provided | 5645 | A value of nil means to use the current buffer's major mode, provided |
| @@ -5692,17 +5670,17 @@ Use the command `abbrev-mode' to change this variable. */); | |||
| 5692 | doc: /* Non-nil if searches and matches should ignore case. */); | 5670 | doc: /* Non-nil if searches and matches should ignore case. */); |
| 5693 | 5671 | ||
| 5694 | DEFVAR_PER_BUFFER ("fill-column", &BVAR (current_buffer, fill_column), | 5672 | DEFVAR_PER_BUFFER ("fill-column", &BVAR (current_buffer, fill_column), |
| 5695 | make_number (Lisp_Int0), | 5673 | Qintegerp, |
| 5696 | doc: /* Column beyond which automatic line-wrapping should happen. | 5674 | doc: /* Column beyond which automatic line-wrapping should happen. |
| 5697 | Interactively, you can set the buffer local value using \\[set-fill-column]. */); | 5675 | Interactively, you can set the buffer local value using \\[set-fill-column]. */); |
| 5698 | 5676 | ||
| 5699 | DEFVAR_PER_BUFFER ("left-margin", &BVAR (current_buffer, left_margin), | 5677 | DEFVAR_PER_BUFFER ("left-margin", &BVAR (current_buffer, left_margin), |
| 5700 | make_number (Lisp_Int0), | 5678 | Qintegerp, |
| 5701 | doc: /* Column for the default `indent-line-function' to indent to. | 5679 | doc: /* Column for the default `indent-line-function' to indent to. |
| 5702 | Linefeed indents to this column in Fundamental mode. */); | 5680 | Linefeed indents to this column in Fundamental mode. */); |
| 5703 | 5681 | ||
| 5704 | DEFVAR_PER_BUFFER ("tab-width", &BVAR (current_buffer, tab_width), | 5682 | DEFVAR_PER_BUFFER ("tab-width", &BVAR (current_buffer, tab_width), |
| 5705 | make_number (Lisp_Int0), | 5683 | Qintegerp, |
| 5706 | doc: /* Distance between tab stops (for display of tab characters), in columns. | 5684 | doc: /* Distance between tab stops (for display of tab characters), in columns. |
| 5707 | This should be an integer greater than zero. */); | 5685 | This should be an integer greater than zero. */); |
| 5708 | 5686 | ||
| @@ -5787,7 +5765,7 @@ visual lines rather than logical lines. See the documentation of | |||
| 5787 | `visual-line-mode'. */); | 5765 | `visual-line-mode'. */); |
| 5788 | 5766 | ||
| 5789 | DEFVAR_PER_BUFFER ("default-directory", &BVAR (current_buffer, directory), | 5767 | DEFVAR_PER_BUFFER ("default-directory", &BVAR (current_buffer, directory), |
| 5790 | make_number (Lisp_String), | 5768 | Qstringp, |
| 5791 | doc: /* Name of default directory of current buffer. Should end with slash. | 5769 | doc: /* Name of default directory of current buffer. Should end with slash. |
| 5792 | To interactively change the default directory, use command `cd'. */); | 5770 | To interactively change the default directory, use command `cd'. */); |
| 5793 | 5771 | ||
| @@ -5800,18 +5778,18 @@ NOTE: This variable is not a hook; | |||
| 5800 | its value may not be a list of functions. */); | 5778 | its value may not be a list of functions. */); |
| 5801 | 5779 | ||
| 5802 | DEFVAR_PER_BUFFER ("buffer-file-name", &BVAR (current_buffer, filename), | 5780 | DEFVAR_PER_BUFFER ("buffer-file-name", &BVAR (current_buffer, filename), |
| 5803 | make_number (Lisp_String), | 5781 | Qstringp, |
| 5804 | doc: /* Name of file visited in current buffer, or nil if not visiting a file. */); | 5782 | doc: /* Name of file visited in current buffer, or nil if not visiting a file. */); |
| 5805 | 5783 | ||
| 5806 | DEFVAR_PER_BUFFER ("buffer-file-truename", &BVAR (current_buffer, file_truename), | 5784 | DEFVAR_PER_BUFFER ("buffer-file-truename", &BVAR (current_buffer, file_truename), |
| 5807 | make_number (Lisp_String), | 5785 | Qstringp, |
| 5808 | doc: /* Abbreviated truename of file visited in current buffer, or nil if none. | 5786 | doc: /* Abbreviated truename of file visited in current buffer, or nil if none. |
| 5809 | The truename of a file is calculated by `file-truename' | 5787 | The truename of a file is calculated by `file-truename' |
| 5810 | and then abbreviated with `abbreviate-file-name'. */); | 5788 | and then abbreviated with `abbreviate-file-name'. */); |
| 5811 | 5789 | ||
| 5812 | DEFVAR_PER_BUFFER ("buffer-auto-save-file-name", | 5790 | DEFVAR_PER_BUFFER ("buffer-auto-save-file-name", |
| 5813 | &BVAR (current_buffer, auto_save_file_name), | 5791 | &BVAR (current_buffer, auto_save_file_name), |
| 5814 | make_number (Lisp_String), | 5792 | Qstringp, |
| 5815 | doc: /* Name of file for auto-saving current buffer. | 5793 | doc: /* Name of file for auto-saving current buffer. |
| 5816 | If it is nil, that means don't auto-save this buffer. */); | 5794 | If it is nil, that means don't auto-save this buffer. */); |
| 5817 | 5795 | ||
| @@ -5823,7 +5801,7 @@ If it is nil, that means don't auto-save this buffer. */); | |||
| 5823 | Backing up is done before the first time the file is saved. */); | 5801 | Backing up is done before the first time the file is saved. */); |
| 5824 | 5802 | ||
| 5825 | DEFVAR_PER_BUFFER ("buffer-saved-size", &BVAR (current_buffer, save_length), | 5803 | DEFVAR_PER_BUFFER ("buffer-saved-size", &BVAR (current_buffer, save_length), |
| 5826 | make_number (Lisp_Int0), | 5804 | Qintegerp, |
| 5827 | doc: /* Length of current buffer when last read in, saved or auto-saved. | 5805 | doc: /* Length of current buffer when last read in, saved or auto-saved. |
| 5828 | 0 initially. | 5806 | 0 initially. |
| 5829 | -1 means auto-saving turned off until next real save. | 5807 | -1 means auto-saving turned off until next real save. |
| @@ -5893,23 +5871,23 @@ In addition, a char-table has six extra slots to control the display of: | |||
| 5893 | See also the functions `display-table-slot' and `set-display-table-slot'. */); | 5871 | See also the functions `display-table-slot' and `set-display-table-slot'. */); |
| 5894 | 5872 | ||
| 5895 | DEFVAR_PER_BUFFER ("left-margin-width", &BVAR (current_buffer, left_margin_cols), | 5873 | DEFVAR_PER_BUFFER ("left-margin-width", &BVAR (current_buffer, left_margin_cols), |
| 5896 | Qnil, | 5874 | Qintegerp, |
| 5897 | doc: /* Width of left marginal area for display of a buffer. | 5875 | doc: /* Width of left marginal area for display of a buffer. |
| 5898 | A value of nil means no marginal area. */); | 5876 | A value of nil means no marginal area. */); |
| 5899 | 5877 | ||
| 5900 | DEFVAR_PER_BUFFER ("right-margin-width", &BVAR (current_buffer, right_margin_cols), | 5878 | DEFVAR_PER_BUFFER ("right-margin-width", &BVAR (current_buffer, right_margin_cols), |
| 5901 | Qnil, | 5879 | Qintegerp, |
| 5902 | doc: /* Width of right marginal area for display of a buffer. | 5880 | doc: /* Width of right marginal area for display of a buffer. |
| 5903 | A value of nil means no marginal area. */); | 5881 | A value of nil means no marginal area. */); |
| 5904 | 5882 | ||
| 5905 | DEFVAR_PER_BUFFER ("left-fringe-width", &BVAR (current_buffer, left_fringe_width), | 5883 | DEFVAR_PER_BUFFER ("left-fringe-width", &BVAR (current_buffer, left_fringe_width), |
| 5906 | Qnil, | 5884 | Qintegerp, |
| 5907 | doc: /* Width of this buffer's left fringe (in pixels). | 5885 | doc: /* Width of this buffer's left fringe (in pixels). |
| 5908 | A value of 0 means no left fringe is shown in this buffer's window. | 5886 | A value of 0 means no left fringe is shown in this buffer's window. |
| 5909 | A value of nil means to use the left fringe width from the window's frame. */); | 5887 | A value of nil means to use the left fringe width from the window's frame. */); |
| 5910 | 5888 | ||
| 5911 | DEFVAR_PER_BUFFER ("right-fringe-width", &BVAR (current_buffer, right_fringe_width), | 5889 | DEFVAR_PER_BUFFER ("right-fringe-width", &BVAR (current_buffer, right_fringe_width), |
| 5912 | Qnil, | 5890 | Qintegerp, |
| 5913 | doc: /* Width of this buffer's right fringe (in pixels). | 5891 | doc: /* Width of this buffer's right fringe (in pixels). |
| 5914 | A value of 0 means no right fringe is shown in this buffer's window. | 5892 | A value of 0 means no right fringe is shown in this buffer's window. |
| 5915 | A value of nil means to use the right fringe width from the window's frame. */); | 5893 | A value of nil means to use the right fringe width from the window's frame. */); |
| @@ -5920,7 +5898,7 @@ A value of nil means to use the right fringe width from the window's frame. */) | |||
| 5920 | A value of nil means to display fringes between margins and buffer text. */); | 5898 | A value of nil means to display fringes between margins and buffer text. */); |
| 5921 | 5899 | ||
| 5922 | DEFVAR_PER_BUFFER ("scroll-bar-width", &BVAR (current_buffer, scroll_bar_width), | 5900 | DEFVAR_PER_BUFFER ("scroll-bar-width", &BVAR (current_buffer, scroll_bar_width), |
| 5923 | Qnil, | 5901 | Qintegerp, |
| 5924 | doc: /* Width of this buffer's scroll bars in pixels. | 5902 | doc: /* Width of this buffer's scroll bars in pixels. |
| 5925 | A value of nil means to use the scroll bar width from the window's frame. */); | 5903 | A value of nil means to use the scroll bar width from the window's frame. */); |
| 5926 | 5904 | ||
| @@ -6000,7 +5978,7 @@ BITMAP is the corresponding fringe bitmap shown for the logical | |||
| 6000 | cursor type. */); | 5978 | cursor type. */); |
| 6001 | 5979 | ||
| 6002 | DEFVAR_PER_BUFFER ("scroll-up-aggressively", | 5980 | DEFVAR_PER_BUFFER ("scroll-up-aggressively", |
| 6003 | &BVAR (current_buffer, scroll_up_aggressively), Qnil, | 5981 | &BVAR (current_buffer, scroll_up_aggressively), Qfloatp, |
| 6004 | doc: /* How far to scroll windows upward. | 5982 | doc: /* How far to scroll windows upward. |
| 6005 | If you move point off the bottom, the window scrolls automatically. | 5983 | If you move point off the bottom, the window scrolls automatically. |
| 6006 | This variable controls how far it scrolls. The value nil, the default, | 5984 | This variable controls how far it scrolls. The value nil, the default, |
| @@ -6013,7 +5991,7 @@ window scrolls by a full window height. Meaningful values are | |||
| 6013 | between 0.0 and 1.0, inclusive. */); | 5991 | between 0.0 and 1.0, inclusive. */); |
| 6014 | 5992 | ||
| 6015 | DEFVAR_PER_BUFFER ("scroll-down-aggressively", | 5993 | DEFVAR_PER_BUFFER ("scroll-down-aggressively", |
| 6016 | &BVAR (current_buffer, scroll_down_aggressively), Qnil, | 5994 | &BVAR (current_buffer, scroll_down_aggressively), Qfloatp, |
| 6017 | doc: /* How far to scroll windows downward. | 5995 | doc: /* How far to scroll windows downward. |
| 6018 | If you move point off the top, the window scrolls automatically. | 5996 | If you move point off the top, the window scrolls automatically. |
| 6019 | This variable controls how far it scrolls. The value nil, the default, | 5997 | This variable controls how far it scrolls. The value nil, the default, |
| @@ -6167,7 +6145,7 @@ then characters with property value PROP are invisible, | |||
| 6167 | and they have an ellipsis as well if ELLIPSIS is non-nil. */); | 6145 | and they have an ellipsis as well if ELLIPSIS is non-nil. */); |
| 6168 | 6146 | ||
| 6169 | DEFVAR_PER_BUFFER ("buffer-display-count", | 6147 | DEFVAR_PER_BUFFER ("buffer-display-count", |
| 6170 | &BVAR (current_buffer, display_count), Qnil, | 6148 | &BVAR (current_buffer, display_count), Qintegerp, |
| 6171 | doc: /* A number incremented each time this buffer is displayed in a window. | 6149 | doc: /* A number incremented each time this buffer is displayed in a window. |
| 6172 | The function `set-window-buffer' increments it. */); | 6150 | The function `set-window-buffer' increments it. */); |
| 6173 | 6151 | ||
| @@ -6226,7 +6204,7 @@ cursor's appearance is instead controlled by the variable | |||
| 6226 | `cursor-in-non-selected-windows'. */); | 6204 | `cursor-in-non-selected-windows'. */); |
| 6227 | 6205 | ||
| 6228 | DEFVAR_PER_BUFFER ("line-spacing", | 6206 | DEFVAR_PER_BUFFER ("line-spacing", |
| 6229 | &BVAR (current_buffer, extra_line_spacing), Qnil, | 6207 | &BVAR (current_buffer, extra_line_spacing), Qnumberp, |
| 6230 | doc: /* Additional space to put between lines when displaying a buffer. | 6208 | doc: /* Additional space to put between lines when displaying a buffer. |
| 6231 | The space is measured in pixels, and put below lines on graphic displays, | 6209 | The space is measured in pixels, and put below lines on graphic displays, |
| 6232 | see `display-graphic-p'. | 6210 | see `display-graphic-p'. |
diff --git a/src/buffer.h b/src/buffer.h index ec9c34b3eb3..b4cc21d675d 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
| @@ -1078,7 +1078,6 @@ extern void set_buffer_internal_1 (struct buffer *); | |||
| 1078 | extern void set_buffer_temp (struct buffer *); | 1078 | extern void set_buffer_temp (struct buffer *); |
| 1079 | extern Lisp_Object buffer_local_value_1 (Lisp_Object, Lisp_Object); | 1079 | extern Lisp_Object buffer_local_value_1 (Lisp_Object, Lisp_Object); |
| 1080 | extern void record_buffer (Lisp_Object); | 1080 | extern void record_buffer (Lisp_Object); |
| 1081 | extern _Noreturn void buffer_slot_type_mismatch (Lisp_Object, int); | ||
| 1082 | extern void fix_overlays_before (struct buffer *, ptrdiff_t, ptrdiff_t); | 1081 | extern void fix_overlays_before (struct buffer *, ptrdiff_t, ptrdiff_t); |
| 1083 | extern void mmap_set_vars (bool); | 1082 | extern void mmap_set_vars (bool); |
| 1084 | 1083 | ||
diff --git a/src/data.c b/src/data.c index 50dc188684f..6622088b648 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -914,13 +914,11 @@ store_symval_forwarding (union Lisp_Fwd *valcontents, register Lisp_Object newva | |||
| 914 | case Lisp_Fwd_Buffer_Obj: | 914 | case Lisp_Fwd_Buffer_Obj: |
| 915 | { | 915 | { |
| 916 | int offset = XBUFFER_OBJFWD (valcontents)->offset; | 916 | int offset = XBUFFER_OBJFWD (valcontents)->offset; |
| 917 | Lisp_Object type = XBUFFER_OBJFWD (valcontents)->slottype; | 917 | Lisp_Object predicate = XBUFFER_OBJFWD (valcontents)->predicate; |
| 918 | 918 | ||
| 919 | if (!(NILP (type) || NILP (newval) | 919 | if (!NILP (predicate) && !NILP (newval) |
| 920 | || (XINT (type) == Lisp_Int0 | 920 | && NILP (call1 (predicate, newval))) |
| 921 | ? INTEGERP (newval) | 921 | wrong_type_argument (predicate, newval); |
| 922 | : XTYPE (newval) == XINT (type)))) | ||
| 923 | buffer_slot_type_mismatch (newval, XINT (type)); | ||
| 924 | 922 | ||
| 925 | if (buf == NULL) | 923 | if (buf == NULL) |
| 926 | buf = current_buffer; | 924 | buf = current_buffer; |
diff --git a/src/gtkutil.c b/src/gtkutil.c index 95ac04b8ff0..6daf189f74c 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -5041,7 +5041,9 @@ xg_initialize (void) | |||
| 5041 | "cancel", 0); | 5041 | "cancel", 0); |
| 5042 | update_theme_scrollbar_width (); | 5042 | update_theme_scrollbar_width (); |
| 5043 | 5043 | ||
| 5044 | #ifdef HAVE_FREETYPE | ||
| 5044 | x_last_font_name = NULL; | 5045 | x_last_font_name = NULL; |
| 5046 | #endif | ||
| 5045 | } | 5047 | } |
| 5046 | 5048 | ||
| 5047 | #endif /* USE_GTK */ | 5049 | #endif /* USE_GTK */ |
diff --git a/src/lisp.h b/src/lisp.h index 9be30563df8..6a22ce0b120 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -1455,7 +1455,8 @@ struct Lisp_Buffer_Objfwd | |||
| 1455 | { | 1455 | { |
| 1456 | enum Lisp_Fwd_Type type; /* = Lisp_Fwd_Buffer_Obj */ | 1456 | enum Lisp_Fwd_Type type; /* = Lisp_Fwd_Buffer_Obj */ |
| 1457 | int offset; | 1457 | int offset; |
| 1458 | Lisp_Object slottype; /* Qnil, Lisp_Int, Lisp_Symbol, or Lisp_String. */ | 1458 | /* One of Qnil, Qintegerp, Qsymbolp, Qstringp, Qfloatp or Qnumberp. */ |
| 1459 | Lisp_Object predicate; | ||
| 1459 | }; | 1460 | }; |
| 1460 | 1461 | ||
| 1461 | /* struct Lisp_Buffer_Local_Value is used in a symbol value cell when | 1462 | /* struct Lisp_Buffer_Local_Value is used in a symbol value cell when |
diff --git a/test/ChangeLog b/test/ChangeLog index c409e891d97..7b058c1d2bd 100644 --- a/test/ChangeLog +++ b/test/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2013-01-10 Wolfgang Jenkner <wjenkner@inode.at> | ||
| 2 | |||
| 3 | * automated/man-tests.el: New file. | ||
| 4 | |||
| 1 | 2013-01-09 Aaron S. Hawley <aaron.s.hawley@gmail.com> | 5 | 2013-01-09 Aaron S. Hawley <aaron.s.hawley@gmail.com> |
| 2 | 6 | ||
| 3 | * automated/undo-tests.el (undo-test0): Adjust error to code change. | 7 | * automated/undo-tests.el (undo-test0): Adjust error to code change. |
diff --git a/test/automated/man-tests.el b/test/automated/man-tests.el new file mode 100644 index 00000000000..8a2ec953002 --- /dev/null +++ b/test/automated/man-tests.el | |||
| @@ -0,0 +1,118 @@ | |||
| 1 | ;;; man-tests.el --- Test suite for man. | ||
| 2 | |||
| 3 | ;; Copyright (C) 2013 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; Author: Wolfgang Jenkner <wjenkner@inode.at> | ||
| 6 | ;; Keywords: help, internal, unix | ||
| 7 | |||
| 8 | ;; This file is part of GNU Emacs. | ||
| 9 | |||
| 10 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 11 | ;; it under the terms of the GNU General Public License as published by | ||
| 12 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 13 | ;; (at your option) any later version. | ||
| 14 | |||
| 15 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 16 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 17 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 18 | ;; GNU General Public License for more details. | ||
| 19 | |||
| 20 | ;; You should have received a copy of the GNU General Public License | ||
| 21 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | ||
| 22 | |||
| 23 | ;;; Code: | ||
| 24 | |||
| 25 | (require 'ert) | ||
| 26 | (require 'man) | ||
| 27 | |||
| 28 | (defconst man-tests-parse-man-k-tests | ||
| 29 | '(;; GNU/Linux: man-db-2.6.1 | ||
| 30 | ("\ | ||
| 31 | sin (3) - sine function | ||
| 32 | sinf (3) - sine function | ||
| 33 | sinl (3) - sine function" | ||
| 34 | . (#("sin(3)" 0 6 (help-echo "sine function")) #("sinf(3)" 0 7 (help-echo "sine function")) #("sinl(3)" 0 7 (help-echo "sine function")))) | ||
| 35 | ;; GNU/Linux: man-1.6g | ||
| 36 | ("\ | ||
| 37 | sin (3) - sine function | ||
| 38 | sinf [sin] (3) - sine function | ||
| 39 | sinl [sin] (3) - sine function" | ||
| 40 | . (#("sin(3)" 0 6 (help-echo "sine function")) #("sinf(3)" 0 7 (help-echo "sine function")) #("sinl(3)" 0 7 (help-echo "sine function")))) | ||
| 41 | ;; FreeBSD 9 | ||
| 42 | ("\ | ||
| 43 | sin(3), sinf(3), sinl(3) - sine functions" | ||
| 44 | . (#("sin(3)" 0 6 (help-echo "sine functions")) #("sinf(3)" 0 7 (help-echo "sine functions")) #("sinl(3)" 0 7 (help-echo "sine functions")))) | ||
| 45 | ;; SunOS, Solaris | ||
| 46 | ;; http://docs.oracle.com/cd/E19455-01/805-6331/usradm-7/index.html | ||
| 47 | ;; SunOS 4 | ||
| 48 | ("\ | ||
| 49 | tset, reset (1) - establish or restore terminal characteristics" | ||
| 50 | . (#("tset(1)" 0 7 (help-echo "establish or restore terminal characteristics")) #("reset(1)" 0 8 (help-echo "establish or restore terminal characteristics")))) | ||
| 51 | ;; SunOS 5.7, Solaris | ||
| 52 | ("\ | ||
| 53 | reset tset (1b) - establish or restore terminal characteristics | ||
| 54 | tset tset (1b) - establish or restore terminal characteristics" | ||
| 55 | . (#("reset(1b)" 0 8 (help-echo "establish or restore terminal characteristics")) #("tset(1b)" 0 7 (help-echo "establish or restore terminal characteristics")))) | ||
| 56 | ;; Minix 3 | ||
| 57 | ;; http://www.minix3.org/manpages/html5/whatis.html | ||
| 58 | ("\ | ||
| 59 | cawf, nroff (1) - C version of the nroff-like, Amazingly Workable (text) Formatter | ||
| 60 | whatis (5) - database of online manual pages" | ||
| 61 | . (#("cawf(1)" 0 7 (help-echo "C version of the nroff-like, Amazingly Workable (text) Formatter")) #("nroff(1)" 0 8 (help-echo "C version of the nroff-like, Amazingly Workable (text) Formatter")) #("whatis(5)" 0 9 (help-echo "database of online manual pages")))) | ||
| 62 | ;; HP-UX | ||
| 63 | ;; http://docstore.mik.ua/manuals/hp-ux/en/B2355-60130/man.1.html | ||
| 64 | ;; Assuming that the line break in the zgrep description was | ||
| 65 | ;; introduced by the man page formatting. | ||
| 66 | ("\ | ||
| 67 | grep, egrep, fgrep (1) - search a file for a pattern | ||
| 68 | zgrep(1) - search possibly compressed files for a regular expression" | ||
| 69 | . (#("grep(1)" 0 7 (help-echo "search a file for a pattern")) #("egrep(1)" 0 8 (help-echo "search a file for a pattern")) #("fgrep(1)" 0 8 (help-echo "search a file for a pattern")) #("zgrep(1)" 0 8 (help-echo "search possibly compressed files for a regular expression")))) | ||
| 70 | ;; AIX | ||
| 71 | ;; http://pic.dhe.ibm.com/infocenter/aix/v7r1/topic/com.ibm.aix.cmds/doc/aixcmds6/whatis.htm | ||
| 72 | ("\ | ||
| 73 | ls(1) -Displays the contents of a directory." | ||
| 74 | . (#("ls(1)" 0 5 (help-echo "Displays the contents of a directory.")))) | ||
| 75 | ;; https://www.ibm.com/developerworks/mydeveloperworks/blogs/cgaix/entry/catman_0703_102_usr_lbin_mkwhatis_the_error_number_is_1?lang=en | ||
| 76 | ("\ | ||
| 77 | loopmount(1) - Associate an image file to a loopback device." | ||
| 78 | . (#("loopmount(1)" 0 12 (help-echo "Associate an image file to a loopback device.")))) | ||
| 79 | ) | ||
| 80 | "List of tests for `Man-parse-man-k'. | ||
| 81 | Each element is a cons cell whose car is a string containing | ||
| 82 | man -k output. That should result in the table which is stored | ||
| 83 | in the cdr of the element.") | ||
| 84 | |||
| 85 | (defun man-tests-name-equal-p (name description string) | ||
| 86 | (and (equal name string) | ||
| 87 | (not (next-single-property-change 0 'help-echo string)) | ||
| 88 | (equal (get-text-property 0 'help-echo string) description))) | ||
| 89 | |||
| 90 | (defun man-tests-parse-man-k-test-case (test) | ||
| 91 | (let ((temp-buffer (get-buffer-create " *test-man*")) | ||
| 92 | (man-k-output (car test))) | ||
| 93 | (unwind-protect | ||
| 94 | (save-window-excursion | ||
| 95 | (with-current-buffer temp-buffer | ||
| 96 | (erase-buffer) | ||
| 97 | (insert man-k-output) | ||
| 98 | (let ((result (Man-parse-man-k)) | ||
| 99 | (checklist (cdr test))) | ||
| 100 | (while (and checklist result | ||
| 101 | (man-tests-name-equal-p | ||
| 102 | (car checklist) | ||
| 103 | (get-text-property 0 'help-echo | ||
| 104 | (car checklist)) | ||
| 105 | (pop result))) | ||
| 106 | (pop checklist)) | ||
| 107 | (and (null checklist) (null result))))) | ||
| 108 | (and (buffer-name temp-buffer) | ||
| 109 | (kill-buffer temp-buffer))))) | ||
| 110 | |||
| 111 | (ert-deftest man-tests () | ||
| 112 | "Test man." | ||
| 113 | (dolist (test man-tests-parse-man-k-tests) | ||
| 114 | (should (man-tests-parse-man-k-test-case test)))) | ||
| 115 | |||
| 116 | (provide 'man-tests) | ||
| 117 | |||
| 118 | ;;; man-tests.el ends here | ||