diff options
| author | Joakim Verona | 2013-02-17 00:04:23 +0100 |
|---|---|---|
| committer | Joakim Verona | 2013-02-17 00:04:23 +0100 |
| commit | bcd8c34aabe11e72a0ce35f654515e2bb9c2964b (patch) | |
| tree | a294d312b78bc7db718819f498df3a3bbf07258f | |
| parent | 613fda6799a504feff2d5a930ef7998125498d10 (diff) | |
| parent | ed8d7fcaa2965216d44388fd00a757c8d55e7395 (diff) | |
| download | emacs-bcd8c34aabe11e72a0ce35f654515e2bb9c2964b.tar.gz emacs-bcd8c34aabe11e72a0ce35f654515e2bb9c2964b.zip | |
auto upstream
| -rw-r--r-- | doc/misc/ChangeLog | 10 | ||||
| -rw-r--r-- | doc/misc/tramp.texi | 120 | ||||
| -rw-r--r-- | etc/NEWS | 6 | ||||
| -rw-r--r-- | lisp/ChangeLog | 89 | ||||
| -rw-r--r-- | lisp/autorevert.el | 9 | ||||
| -rw-r--r-- | lisp/emacs-lisp/tabulated-list.el | 4 | ||||
| -rw-r--r-- | lisp/font-lock.el | 2 | ||||
| -rw-r--r-- | lisp/gnus/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/gnus/shr.el | 3 | ||||
| -rw-r--r-- | lisp/image-mode.el | 99 | ||||
| -rw-r--r-- | lisp/image.el | 71 | ||||
| -rw-r--r-- | lisp/info-look.el | 15 | ||||
| -rw-r--r-- | lisp/net/tramp-cache.el | 37 | ||||
| -rw-r--r-- | lisp/net/tramp-compat.el | 1 | ||||
| -rw-r--r-- | lisp/net/tramp-sh.el | 1 | ||||
| -rw-r--r-- | lisp/replace.el | 23 | ||||
| -rw-r--r-- | lisp/simple.el | 16 | ||||
| -rw-r--r-- | lisp/url/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/url/url-http.el | 4 | ||||
| -rw-r--r-- | nt/ChangeLog | 6 | ||||
| -rw-r--r-- | nt/inc/ms-w32.h | 12 | ||||
| -rw-r--r-- | src/ChangeLog | 17 | ||||
| -rw-r--r-- | src/w32.c | 136 | ||||
| -rw-r--r-- | src/w32term.c | 4 |
24 files changed, 486 insertions, 210 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index dd3c0ccd1e2..d24f2b593d4 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2013-02-16 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * tramp.texi (Top, Configuration): Insert section `Android shell | ||
| 4 | setup' in menu. | ||
| 5 | (Android shell setup): New section. | ||
| 6 | (Connection types, Default Method) | ||
| 7 | (Frequently Asked Questions): Mention "scp" instead of "scpc". | ||
| 8 | (External methods): Remove "scpc" and "rsyncc" entries. | ||
| 9 | (Frequently Asked Questions): Remove entry about ControlPersist. | ||
| 10 | |||
| 1 | 2013-02-13 Glenn Morris <rgm@gnu.org> | 11 | 2013-02-13 Glenn Morris <rgm@gnu.org> |
| 2 | 12 | ||
| 3 | * message.texi (News Headers): Don't mention yow any more. | 13 | * message.texi (News Headers): Don't mention yow any more. |
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index cfa3f84bda1..64b5ea40f24 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi | |||
| @@ -188,8 +188,9 @@ Configuring @value{tramp} for use | |||
| 188 | * Connection caching:: Reusing connection related information. | 188 | * Connection caching:: Reusing connection related information. |
| 189 | * Remote Programs:: How @value{tramp} finds and uses programs on the remote machine. | 189 | * Remote Programs:: How @value{tramp} finds and uses programs on the remote machine. |
| 190 | * Remote shell setup:: Remote shell setup hints. | 190 | * Remote shell setup:: Remote shell setup hints. |
| 191 | * Windows setup hints:: Issues with Cygwin ssh. | 191 | * Android shell setup:: Android shell setup hints. |
| 192 | * Auto-save and Backup:: Auto-save and Backup. | 192 | * Auto-save and Backup:: Auto-save and Backup. |
| 193 | * Windows setup hints:: Issues with Cygwin ssh. | ||
| 193 | 194 | ||
| 194 | Using @value{tramp} | 195 | Using @value{tramp} |
| 195 | 196 | ||
| @@ -515,6 +516,7 @@ Method}. | |||
| 515 | * Connection caching:: Reusing connection related information. | 516 | * Connection caching:: Reusing connection related information. |
| 516 | * Remote Programs:: How @value{tramp} finds and uses programs on the remote machine. | 517 | * Remote Programs:: How @value{tramp} finds and uses programs on the remote machine. |
| 517 | * Remote shell setup:: Remote shell setup hints. | 518 | * Remote shell setup:: Remote shell setup hints. |
| 519 | * Android shell setup:: Android shell setup hints. | ||
| 518 | * Auto-save and Backup:: Auto-save and Backup. | 520 | * Auto-save and Backup:: Auto-save and Backup. |
| 519 | * Windows setup hints:: Issues with Cygwin ssh. | 521 | * Windows setup hints:: Issues with Cygwin ssh. |
| 520 | @end menu | 522 | @end menu |
| @@ -557,9 +559,10 @@ startup may drown out the improvement in file transfer times. | |||
| 557 | External methods should be configured such a way that they don't | 559 | External methods should be configured such a way that they don't |
| 558 | require a password (with @command{ssh-agent}, or such alike). Modern | 560 | require a password (with @command{ssh-agent}, or such alike). Modern |
| 559 | @command{scp} implementations offer options to reuse existing | 561 | @command{scp} implementations offer options to reuse existing |
| 560 | @command{ssh} connections, see method @command{scpc}. If it isn't | 562 | @command{ssh} connections, which will be enabled by default if |
| 561 | possible, you should consider @ref{Password handling}, otherwise you | 563 | available. If it isn't possible, you should consider @ref{Password |
| 562 | will be prompted for a password every copy action. | 564 | handling}, otherwise you will be prompted for a password every copy |
| 565 | action. | ||
| 563 | 566 | ||
| 564 | 567 | ||
| 565 | @node Inline methods | 568 | @node Inline methods |
| @@ -867,51 +870,6 @@ to not print any shell prompt, which confuses @value{tramp} mightily. | |||
| 867 | This method supports the @samp{-p} argument. | 870 | This method supports the @samp{-p} argument. |
| 868 | 871 | ||
| 869 | 872 | ||
| 870 | @item @option{scpc}---@command{ssh} and @command{scp} | ||
| 871 | @cindex method scpc | ||
| 872 | @cindex scpc method | ||
| 873 | @cindex scp (with scpc method) | ||
| 874 | @cindex ssh (with scpc method) | ||
| 875 | |||
| 876 | Newer versions of @option{ssh} (for example OpenSSH 4) offer an option | ||
| 877 | @option{ControlMaster}. This allows @option{scp} to reuse an existing | ||
| 878 | @option{ssh} channel, which increases performance. | ||
| 879 | |||
| 880 | Before you use this method, you should check whether your @option{ssh} | ||
| 881 | implementation supports this option. Try from the command line | ||
| 882 | |||
| 883 | @example | ||
| 884 | ssh localhost -o ControlMaster=yes /bin/true | ||
| 885 | @end example | ||
| 886 | |||
| 887 | If that command succeeds silently, then you can use @option{scpc}; but | ||
| 888 | if it fails like | ||
| 889 | |||
| 890 | @example | ||
| 891 | command-line: line 0: Bad configuration option: ControlMaster | ||
| 892 | @end example | ||
| 893 | |||
| 894 | then you cannot use it. Note, that the option | ||
| 895 | @option{ControlPersist}, if it is supported by your @option{ssh} | ||
| 896 | version, must be set to @option{no}. | ||
| 897 | |||
| 898 | This method supports the @samp{-p} argument. | ||
| 899 | |||
| 900 | |||
| 901 | @item @option{rsyncc}---@command{ssh} and @command{rsync} | ||
| 902 | @cindex method rsyncc | ||
| 903 | @cindex rsyncc method | ||
| 904 | @cindex rsync (with rsyncc method) | ||
| 905 | @cindex ssh (with rsyncc method) | ||
| 906 | |||
| 907 | Like the @option{scpc} method, @option{rsyncc} improves the underlying | ||
| 908 | @command{ssh} connection by the option @option{ControlMaster}. This | ||
| 909 | allows @command{rsync} to reuse an existing @command{ssh} channel, | ||
| 910 | which increases performance. | ||
| 911 | |||
| 912 | This method supports the @samp{-p} argument. | ||
| 913 | |||
| 914 | |||
| 915 | @item @option{pscp}---@command{plink} and @command{pscp} | 873 | @item @option{pscp}---@command{plink} and @command{pscp} |
| 916 | @cindex method pscp | 874 | @cindex method pscp |
| 917 | @cindex pscp method | 875 | @cindex pscp method |
| @@ -1240,7 +1198,7 @@ user, see the @option{su} or @option{sudo} methods. They offer | |||
| 1240 | shortened syntax for the @samp{root} account, like | 1198 | shortened syntax for the @samp{root} account, like |
| 1241 | @file{@trampfn{su, , , /etc/motd}}. | 1199 | @file{@trampfn{su, , , /etc/motd}}. |
| 1242 | 1200 | ||
| 1243 | People who edit large files may want to consider @option{scpc} instead | 1201 | People who edit large files may want to consider @option{scp} instead |
| 1244 | of @option{ssh}, or @option{pscp} instead of @option{plink}. These | 1202 | of @option{ssh}, or @option{pscp} instead of @option{plink}. These |
| 1245 | external methods are faster than inline methods for large files. | 1203 | external methods are faster than inline methods for large files. |
| 1246 | Note, however, that external methods suffer from some limitations. | 1204 | Note, however, that external methods suffer from some limitations. |
| @@ -1343,7 +1301,7 @@ Like with methods and users, you can also specify different default | |||
| 1343 | hosts for certain method/user combinations via the variable | 1301 | hosts for certain method/user combinations via the variable |
| 1344 | @code{tramp-default-host-alist}. Usually, this isn't necessary, | 1302 | @code{tramp-default-host-alist}. Usually, this isn't necessary, |
| 1345 | because @code{tramp-default-host} should be sufficient. For some | 1303 | because @code{tramp-default-host} should be sufficient. For some |
| 1346 | methods, like @code{adb}, that default value must be overwritten, | 1304 | methods, like @option{adb}, that default value must be overwritten, |
| 1347 | which is already the initial value of @code{tramp-default-host-alist}. | 1305 | which is already the initial value of @code{tramp-default-host-alist}. |
| 1348 | 1306 | ||
| 1349 | @noindent | 1307 | @noindent |
| @@ -2047,6 +2005,50 @@ fi | |||
| 2047 | @end table | 2005 | @end table |
| 2048 | 2006 | ||
| 2049 | 2007 | ||
| 2008 | @node Android shell setup | ||
| 2009 | @section Android shell setup hints | ||
| 2010 | @cindex android shell setup | ||
| 2011 | |||
| 2012 | Android devices use a restricted shell. They can be accessed via the | ||
| 2013 | @option{adb} method. However, this restricts the access to a USB | ||
| 2014 | connection, and it requires the installation of the Android SDK on the | ||
| 2015 | local machine. | ||
| 2016 | |||
| 2017 | When an @command{sshd} process runs on the Android device, like | ||
| 2018 | provided by the @code{SSHDroid} app, any @option{ssh}-based method can | ||
| 2019 | be used. However, this requires some special settings. | ||
| 2020 | |||
| 2021 | The default shell @code{/bin/sh} does not exist. Instead, you shall | ||
| 2022 | use just @code{sh}, which invokes the shell installed on the device. | ||
| 2023 | You can instruct @value{tramp} by this form: | ||
| 2024 | |||
| 2025 | @lisp | ||
| 2026 | (add-to-list 'tramp-connection-properties | ||
| 2027 | (list (regexp-quote "192.168.0.26") "remote-shell" "sh")) | ||
| 2028 | @end lisp | ||
| 2029 | |||
| 2030 | @noindent | ||
| 2031 | with @samp{192.168.0.26} being the IP address of your Android device. | ||
| 2032 | |||
| 2033 | The user settings for the @code{$PATH} environment valiable must be | ||
| 2034 | preserved. Add this setting: | ||
| 2035 | |||
| 2036 | @lisp | ||
| 2037 | (add-to-list 'tramp-remote-path 'tramp-own-remote-path) | ||
| 2038 | @end lisp | ||
| 2039 | |||
| 2040 | If the Android device is not @samp{rooted}, you must give the shell a | ||
| 2041 | writable directory for temporary files. You could use this setting: | ||
| 2042 | |||
| 2043 | @lisp | ||
| 2044 | (add-to-list 'tramp-remote-process-environment "TMPDIR=$HOME") | ||
| 2045 | @end lisp | ||
| 2046 | |||
| 2047 | Now you shall be able to open a remote connection with @kbd{C-x C-f | ||
| 2048 | @trampfn{ssh, , 192.168.0.26#2222, }}, given that @command{sshd} | ||
| 2049 | listens on port @samp{2222}. | ||
| 2050 | |||
| 2051 | |||
| 2050 | @node Auto-save and Backup | 2052 | @node Auto-save and Backup |
| 2051 | @section Auto-save and Backup configuration | 2053 | @section Auto-save and Backup configuration |
| 2052 | @cindex auto-save | 2054 | @cindex auto-save |
| @@ -2942,7 +2944,7 @@ host as well as the time needed to perform the operations there count. | |||
| 2942 | In order to speed up @value{tramp}, one could either try to avoid some | 2944 | In order to speed up @value{tramp}, one could either try to avoid some |
| 2943 | of the operations, or one could try to improve their performance. | 2945 | of the operations, or one could try to improve their performance. |
| 2944 | 2946 | ||
| 2945 | Use an external method, like @option{scpc}. | 2947 | Use an external method, like @option{scp}. |
| 2946 | 2948 | ||
| 2947 | Use caching. This is already enabled by default. Information about | 2949 | Use caching. This is already enabled by default. Information about |
| 2948 | the remote host as well as the remote files are cached for reuse. The | 2950 | the remote host as well as the remote files are cached for reuse. The |
| @@ -3068,20 +3070,6 @@ Host * | |||
| 3068 | 3070 | ||
| 3069 | 3071 | ||
| 3070 | @item | 3072 | @item |
| 3071 | How can I use @samp{ControlPersist}? | ||
| 3072 | |||
| 3073 | When @samp{ControlPersist} is set to @samp{yes}, the @option{scpc} | ||
| 3074 | method does not work. You can use @option{scpx} instead with the | ||
| 3075 | following settings in @file{~/.ssh/config}: | ||
| 3076 | |||
| 3077 | @example | ||
| 3078 | Host * | ||
| 3079 | ControlMaster auto | ||
| 3080 | ControlPersist yes | ||
| 3081 | @end example | ||
| 3082 | |||
| 3083 | |||
| 3084 | @item | ||
| 3085 | File name completion does not work with @value{tramp} | 3073 | File name completion does not work with @value{tramp} |
| 3086 | 3074 | ||
| 3087 | When you log in to the remote machine, do you see the output of | 3075 | When you log in to the remote machine, do you see the output of |
| @@ -141,6 +141,12 @@ amounts of data into the ERC input. | |||
| 141 | visit the next image file and the previous image file in the same | 141 | visit the next image file and the previous image file in the same |
| 142 | directory, respectively. | 142 | directory, respectively. |
| 143 | 143 | ||
| 144 | *** New commands to show specific frames of multi-frame images. | ||
| 145 | `f' (`image-next-frame') and `b' (`image-previous-frame') visit the | ||
| 146 | next or previous frame. `F' (`image-goto-frame') shows a specific frame. | ||
| 147 | |||
| 148 | *** `image-animated-p' is now `image-multi-frame-p'. | ||
| 149 | |||
| 144 | --- | 150 | --- |
| 145 | *** The command `image-mode-fit-frame' deletes other windows. | 151 | *** The command `image-mode-fit-frame' deletes other windows. |
| 146 | When toggling, it restores the frame's previous window configuration. | 152 | When toggling, it restores the frame's previous window configuration. |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 99704a0b532..66c18a25803 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,25 +1,96 @@ | |||
| 1 | 2013-02-16 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * image.el (image-animated-types): Remove. | ||
| 4 | (image-multi-frame-p): Rename from image-animated-p, and generalize. | ||
| 5 | (image-animated-p): Make obsolete alias. | ||
| 6 | (image-animate, image-nth-frame, image-animate-timeout): | ||
| 7 | Use image-multi-frame-p. | ||
| 8 | (image-animate-timeout): If no delay, use image-default-frame-delay. | ||
| 9 | * image-mode.el (image-mode, image-toggle-animation): | ||
| 10 | Use image-multi-frame-p. (Bug#763, bug#10739) | ||
| 11 | (image-mode): Adjust startup message for a multi-frame image. | ||
| 12 | |||
| 13 | * image-mode.el (image-mode-map): Give it a menu. | ||
| 14 | |||
| 15 | 2013-02-16 Michael Albinus <michael.albinus@gmx.de> | ||
| 16 | |||
| 17 | * net/tramp-cache.el (tramp-connection-properties): New customer | ||
| 18 | option. | ||
| 19 | (tramp-get-connection-property): Use it. | ||
| 20 | |||
| 21 | * net/tramp-compat.el (top): Require 'trampver. | ||
| 22 | |||
| 23 | * net/tramp-sh.el (tramp-remote-process-environment): Set | ||
| 24 | tramp-autoload cookie. | ||
| 25 | |||
| 26 | 2013-02-16 Kevin Ryde <user42@zip.com.au> | ||
| 27 | |||
| 28 | * info-look.el (info-lookup-select-mode): If major-mode has no | ||
| 29 | info-lookup-alist entry then search up derived-mode-parent (bug#8660). | ||
| 30 | |||
| 31 | 2013-02-16 Jambunathan K <kjambunathan@gmail.com> | ||
| 32 | |||
| 33 | * replace.el (read-regexp): Tighten the regexp that matches tag. | ||
| 34 | When tag is retrieved with `find-tag-default', use regexp that | ||
| 35 | matches tag at point. Also update docstring (Bug#13687). | ||
| 36 | |||
| 37 | 2013-02-16 Eli Zaretskii <eliz@gnu.org> | ||
| 38 | |||
| 39 | * autorevert.el (auto-revert-notify-add-watch): With 'w32notify', | ||
| 40 | add watch for the file, not its parent directory, since w32notify | ||
| 41 | sets up the watch for the directory internally. (Bug#13725) | ||
| 42 | |||
| 43 | 2013-02-16 Glenn Morris <rgm@gnu.org> | ||
| 44 | |||
| 45 | * image.el (image-default-frame-delay): New variable. | ||
| 46 | (image-animated-p): Use image-default-frame-delay. | ||
| 47 | (image-minimum-frame-delay): New constant. | ||
| 48 | (image-animate-timeout): Use image-minimum-frame-delay. | ||
| 49 | |||
| 50 | * image.el (image-nth-frame): New, split from image-animate-timeout. | ||
| 51 | (image-animate-timeout): Use image-nth-frame. | ||
| 52 | * image-mode.el (image-goto-frame, image-next-frame) | ||
| 53 | (image-previous-frame): New commands. | ||
| 54 | (image-mode-map): Add new frame commands. | ||
| 55 | |||
| 56 | 2013-02-16 Jonas Bernoulli <jonas@bernoul.li> | ||
| 57 | |||
| 58 | * emacs-lisp/tabulated-list.el (tabulated-list-print-col): | ||
| 59 | If col-desc already has help-echo, use it. (Bug#13563) | ||
| 60 | |||
| 61 | 2013-02-16 Glenn Morris <rgm@gnu.org> | ||
| 62 | |||
| 63 | * image.el (image-current-frame): New variable. | ||
| 64 | (image-animate-timeout): Set image-current-frame. | ||
| 65 | * image-mode.el (image-mode): For animated images, | ||
| 66 | display a frame counter via mode-line-process. | ||
| 67 | |||
| 68 | * font-lock.el (lisp-font-lock-keywords-1): Add defvar-local. | ||
| 69 | |||
| 70 | 2013-02-15 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 71 | |||
| 72 | * simple.el (eval-expression): Let `exp' set the mark (bug#13724). | ||
| 73 | |||
| 1 | 2013-02-15 Alan Mackenzie <acm@muc.de> | 74 | 2013-02-15 Alan Mackenzie <acm@muc.de> |
| 2 | 75 | ||
| 3 | * emacs-lisp/easy-mmode.el (define-globalized-minor-mode): When a | 76 | * emacs-lisp/easy-mmode.el (define-globalized-minor-mode): When a |
| 4 | global minor mode has been enabled, call the minor mode function | 77 | global minor mode has been enabled, call the minor mode function |
| 5 | for a new buffer once only, after the major mode hook, whilst | 78 | for a new buffer once only, after the major mode hook, whilst |
| 6 | allowing that hook explicitly to disable the minor mode. | 79 | allowing that hook explicitly to disable the minor mode. |
| 7 | (MODE-disable-in-buffer): new (generated) function. | 80 | (MODE-disable-in-buffer): New (generated) function. |
| 8 | (disable-MODE): new (generated) buffer local variable. | 81 | (disable-MODE): New (generated) buffer local variable. |
| 9 | 82 | ||
| 10 | 2013-02-15 Jambunathan K <kjambunathan@gmail.com> | 83 | 2013-02-15 Jambunathan K <kjambunathan@gmail.com> |
| 11 | 84 | ||
| 12 | * iswitchb.el (iswitchb-read-buffer): Bind `C-.' and `C-,' to | 85 | * iswitchb.el (iswitchb-read-buffer): Bind `C-.' and `C-,' to |
| 13 | `iswitchb-next-match' and `iswitchb-prev-match' resply. | 86 | `iswitchb-next-match' and `iswitchb-prev-match' resply. |
| 14 | |||
| 15 | * ido.el (ido-init-completion-maps): Bind `C-.' and `C-,' to | 87 | * ido.el (ido-init-completion-maps): Bind `C-.' and `C-,' to |
| 16 | `ido-next-match' and `ido-prev-match' resply. | 88 | `ido-next-match' and `ido-prev-match' resply. |
| 17 | |||
| 18 | * icomplete.el (icomplete-minibuffer-map): Unbind `C-s' and `C-r'. | 89 | * icomplete.el (icomplete-minibuffer-map): Unbind `C-s' and `C-r'. |
| 19 | Bind `C-.' and `C-,' to `icomplete-forward-completions' and | 90 | Bind `C-.' and `C-,' to `icomplete-forward-completions' and |
| 20 | `icomplete-backward-completions' (Bug#13708). | 91 | `icomplete-backward-completions' (Bug#13708). |
| 21 | 92 | ||
| 22 | 2013-02-15 Michael Albinus <michael.albinus@gmx.de> | 93 | 2013-02-15 Glenn Morris <rgm@gnu.org> |
| 23 | 94 | ||
| 24 | * emacs-lisp/easy-mmode.el (define-minor-mode): Doc fix. | 95 | * emacs-lisp/easy-mmode.el (define-minor-mode): Doc fix. |
| 25 | 96 | ||
| @@ -52,8 +123,8 @@ | |||
| 52 | 123 | ||
| 53 | 2013-02-14 Michael Albinus <michael.albinus@gmx.de> | 124 | 2013-02-14 Michael Albinus <michael.albinus@gmx.de> |
| 54 | 125 | ||
| 55 | * net/tramp.el (tramp-debug-message): Add | 126 | * net/tramp.el (tramp-debug-message): |
| 56 | `tramp-condition-case-unless-debug'. | 127 | Add `tramp-condition-case-unless-debug'. |
| 57 | (tramp-debug-on-error): New defvar. | 128 | (tramp-debug-on-error): New defvar. |
| 58 | (tramp-condition-case-unless-debug): New defun. | 129 | (tramp-condition-case-unless-debug): New defun. |
| 59 | (tramp-file-name-handler): Use it. | 130 | (tramp-file-name-handler): Use it. |
| @@ -207,8 +278,8 @@ | |||
| 207 | * net/tramp-compat.el (top): Declare `remote-file-name-inhibit-cache' | 278 | * net/tramp-compat.el (top): Declare `remote-file-name-inhibit-cache' |
| 208 | only if it doesn't exist. | 279 | only if it doesn't exist. |
| 209 | 280 | ||
| 210 | * net/tramp-sh.el (tramp-sh-handle-start-file-process): Set | 281 | * net/tramp-sh.el (tramp-sh-handle-start-file-process): |
| 211 | process marker. | 282 | Set process marker. |
| 212 | 283 | ||
| 213 | 2013-02-12 Tassilo Horn <tsdh@gnu.org> | 284 | 2013-02-12 Tassilo Horn <tsdh@gnu.org> |
| 214 | 285 | ||
diff --git a/lisp/autorevert.el b/lisp/autorevert.el index fe6cf216363..a2d70c37762 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el | |||
| @@ -519,12 +519,13 @@ will use an up-to-date value of `auto-revert-interval'" | |||
| 519 | (let ((func (if (fboundp 'inotify-add-watch) | 519 | (let ((func (if (fboundp 'inotify-add-watch) |
| 520 | 'inotify-add-watch 'w32notify-add-watch)) | 520 | 'inotify-add-watch 'w32notify-add-watch)) |
| 521 | (aspect (if (fboundp 'inotify-add-watch) | 521 | (aspect (if (fboundp 'inotify-add-watch) |
| 522 | '(create modify moved-to) '(size last-write-time)))) | 522 | '(create modify moved-to) '(size last-write-time))) |
| 523 | (file (if (fboundp 'inotify-add-watch) | ||
| 524 | (directory-file-name (expand-file-name default-directory)) | ||
| 525 | (buffer-file-name)))) | ||
| 523 | (setq auto-revert-notify-watch-descriptor | 526 | (setq auto-revert-notify-watch-descriptor |
| 524 | (ignore-errors | 527 | (ignore-errors |
| 525 | (funcall | 528 | (funcall func file aspect 'auto-revert-notify-handler))) |
| 526 | func (directory-file-name (expand-file-name default-directory)) | ||
| 527 | aspect 'auto-revert-notify-handler))) | ||
| 528 | (if auto-revert-notify-watch-descriptor | 529 | (if auto-revert-notify-watch-descriptor |
| 529 | (progn | 530 | (progn |
| 530 | (puthash | 531 | (puthash |
diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el index 94b3c1553e5..da487e463e2 100644 --- a/lisp/emacs-lisp/tabulated-list.el +++ b/lisp/emacs-lisp/tabulated-list.el | |||
| @@ -379,7 +379,9 @@ Return the column number after insertion." | |||
| 379 | (setq width (- width shift)) | 379 | (setq width (- width shift)) |
| 380 | (setq x (+ x shift)))) | 380 | (setq x (+ x shift)))) |
| 381 | (if (stringp col-desc) | 381 | (if (stringp col-desc) |
| 382 | (insert (propertize label 'help-echo help-echo)) | 382 | (insert (if (get-text-property 0 'help-echo label) |
| 383 | label | ||
| 384 | (propertize label 'help-echo help-echo))) | ||
| 383 | (apply 'insert-text-button label (cdr col-desc))) | 385 | (apply 'insert-text-button label (cdr col-desc))) |
| 384 | (let ((next-x (+ x pad-right width))) | 386 | (let ((next-x (+ x pad-right width))) |
| 385 | ;; No need to append any spaces if this is the last column. | 387 | ;; No need to append any spaces if this is the last column. |
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index f714eaab233..6e3476ac9a5 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el | |||
| @@ -2256,7 +2256,7 @@ in which C preprocessor directives are used. e.g. `asm-mode' and | |||
| 2256 | "method-combination\\|setf-expander\\|skeleton\\|widget\\|" | 2256 | "method-combination\\|setf-expander\\|skeleton\\|widget\\|" |
| 2257 | "function\\|\\(compiler\\|modify\\|symbol\\)-macro\\)\\)\\|" | 2257 | "function\\|\\(compiler\\|modify\\|symbol\\)-macro\\)\\)\\|" |
| 2258 | ;; Variable declarations. | 2258 | ;; Variable declarations. |
| 2259 | "\\(const\\(ant\\)?\\|custom\\|varalias\\|face\\|parameter\\|var\\)\\|" | 2259 | "\\(const\\(ant\\)?\\|custom\\|varalias\\|face\\|parameter\\|var\\(?:-local\\)?\\)\\|" |
| 2260 | ;; Structure declarations. | 2260 | ;; Structure declarations. |
| 2261 | "\\(class\\|group\\|theme\\|package\\|struct\\|type\\)" | 2261 | "\\(class\\|group\\|theme\\|package\\|struct\\|type\\)" |
| 2262 | "\\)\\)\\>" | 2262 | "\\)\\)\\>" |
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index b6e8fd976d3..5030da87672 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-02-16 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * shr.el (shr-put-image): Only animate images that specify a delay. | ||
| 4 | This is consistent with the old image-animated-p behavior. | ||
| 5 | |||
| 1 | 2013-02-14 Katsumi Yamaoka <yamaoka@jpl.org> | 6 | 2013-02-14 Katsumi Yamaoka <yamaoka@jpl.org> |
| 2 | 7 | ||
| 3 | * gnus-util.el (gnus-define-keys): Convert [?\S-\ ] to [(shift space)] | 8 | * gnus-util.el (gnus-define-keys): Convert [?\S-\ ] to [(shift space)] |
diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el index c9bf324b4fa..1294ca7cd69 100644 --- a/lisp/gnus/shr.el +++ b/lisp/gnus/shr.el | |||
| @@ -615,7 +615,8 @@ size, and full-buffer size." | |||
| 615 | (overlay-put overlay 'face 'default))) | 615 | (overlay-put overlay 'face 'default))) |
| 616 | (insert-image image (or alt "*"))) | 616 | (insert-image image (or alt "*"))) |
| 617 | (put-text-property start (point) 'image-size size) | 617 | (put-text-property start (point) 'image-size size) |
| 618 | (when (image-animated-p image) | 618 | ;; Only animate multi-frame things that specify a delay. FIXME? |
| 619 | (when (cdr (image-animated-p image)) | ||
| 619 | (image-animate image nil 60))) | 620 | (image-animate image nil 60))) |
| 620 | image) | 621 | image) |
| 621 | (insert alt))) | 622 | (insert alt))) |
diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 196336717db..52367811341 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el | |||
| @@ -340,6 +340,9 @@ call." | |||
| 340 | (define-key map (kbd "S-SPC") 'image-scroll-down) | 340 | (define-key map (kbd "S-SPC") 'image-scroll-down) |
| 341 | (define-key map (kbd "DEL") 'image-scroll-down) | 341 | (define-key map (kbd "DEL") 'image-scroll-down) |
| 342 | (define-key map (kbd "RET") 'image-toggle-animation) | 342 | (define-key map (kbd "RET") 'image-toggle-animation) |
| 343 | (define-key map "F" 'image-goto-frame) | ||
| 344 | (define-key map "f" 'image-next-frame) | ||
| 345 | (define-key map "b" 'image-previous-frame) | ||
| 343 | (define-key map "n" 'image-next-file) | 346 | (define-key map "n" 'image-next-file) |
| 344 | (define-key map "p" 'image-previous-file) | 347 | (define-key map "p" 'image-previous-file) |
| 345 | (define-key map [remap forward-char] 'image-forward-hscroll) | 348 | (define-key map [remap forward-char] 'image-forward-hscroll) |
| @@ -356,6 +359,53 @@ call." | |||
| 356 | (define-key map [remap move-end-of-line] 'image-eol) | 359 | (define-key map [remap move-end-of-line] 'image-eol) |
| 357 | (define-key map [remap beginning-of-buffer] 'image-bob) | 360 | (define-key map [remap beginning-of-buffer] 'image-bob) |
| 358 | (define-key map [remap end-of-buffer] 'image-eob) | 361 | (define-key map [remap end-of-buffer] 'image-eob) |
| 362 | (easy-menu-define image-mode-menu map "Menu for Image mode." | ||
| 363 | '("Image" | ||
| 364 | ["Show as Text" image-toggle-display :active t | ||
| 365 | :help "Show image as text"] | ||
| 366 | "--" | ||
| 367 | ["Fit Frame to Image" image-mode-fit-frame :active t | ||
| 368 | :help "Resize frame to match image"] | ||
| 369 | ["Fit to Window Height" image-transform-fit-to-height | ||
| 370 | :visible (eq image-type 'imagemagick) | ||
| 371 | :help "Resize image to match the window height"] | ||
| 372 | ["Fit to Window Width" image-transform-fit-to-width | ||
| 373 | :visible (eq image-type 'imagemagick) | ||
| 374 | :help "Resize image to match the window width"] | ||
| 375 | ["Rotate Image..." image-transform-set-rotation | ||
| 376 | :visible (eq image-type 'imagemagick) | ||
| 377 | :help "Rotate the image"] | ||
| 378 | "--" | ||
| 379 | ["Next Image" image-next-file :active t | ||
| 380 | :help "Move to next image in this directory"] | ||
| 381 | ["Previous Image" image-previous-file :active t | ||
| 382 | :help "Move to previous image in this directory"] | ||
| 383 | "--" | ||
| 384 | ["Animate Image" image-toggle-animation :style toggle | ||
| 385 | :selected (let ((image (image-get-display-property))) | ||
| 386 | (and image (image-animate-timer image))) | ||
| 387 | :active image-current-frame | ||
| 388 | :help "Toggle image animation"] | ||
| 389 | ["Loop Animation" | ||
| 390 | (lambda () (interactive) | ||
| 391 | ;;; (make-variable-buffer-local 'image-animate-loop) | ||
| 392 | (setq image-animate-loop (not image-animate-loop)) | ||
| 393 | ;; FIXME this is a hacky way to make it affect a currently | ||
| 394 | ;; animating image. | ||
| 395 | (when (let ((image (image-get-display-property))) | ||
| 396 | (and image (image-animate-timer image))) | ||
| 397 | (image-toggle-animation) | ||
| 398 | (image-toggle-animation))) | ||
| 399 | :style toggle :selected image-animate-loop | ||
| 400 | :active image-current-frame | ||
| 401 | :help "Animate images once, or forever?"] | ||
| 402 | ["Next Frame" image-next-frame :active image-current-frame | ||
| 403 | :help "Show the next frame of this image"] | ||
| 404 | ["Previous Frame" image-previous-frame :active image-current-frame | ||
| 405 | :help "Show the previous frame of this image"] | ||
| 406 | ["Goto Frame..." image-goto-frame :active image-current-frame | ||
| 407 | :help "Show a specific frame of this image"] | ||
| 408 | )) | ||
| 359 | map) | 409 | map) |
| 360 | "Mode keymap for `image-mode'.") | 410 | "Mode keymap for `image-mode'.") |
| 361 | 411 | ||
| @@ -409,15 +459,22 @@ to toggle between display as an image and display as text." | |||
| 409 | (run-mode-hooks 'image-mode-hook) | 459 | (run-mode-hooks 'image-mode-hook) |
| 410 | (let ((image (image-get-display-property)) | 460 | (let ((image (image-get-display-property)) |
| 411 | (msg1 (substitute-command-keys | 461 | (msg1 (substitute-command-keys |
| 412 | "Type \\[image-toggle-display] to view the image as "))) | 462 | "Type \\[image-toggle-display] to view the image as ")) |
| 463 | animated) | ||
| 413 | (cond | 464 | (cond |
| 414 | ((null image) | 465 | ((null image) |
| 415 | (message "%s" (concat msg1 "an image."))) | 466 | (message "%s" (concat msg1 "an image."))) |
| 416 | ((image-animated-p image) | 467 | ((setq animated (image-multi-frame-p image)) |
| 468 | (setq image-current-frame (or (plist-get (cdr image) :index) 0) | ||
| 469 | mode-line-process | ||
| 470 | `(:eval (propertize (format " [%s/%s]" | ||
| 471 | (1+ image-current-frame) | ||
| 472 | ,(car animated)) | ||
| 473 | 'help-echo "Frame number"))) | ||
| 417 | (message "%s" | 474 | (message "%s" |
| 418 | (concat msg1 "text, or " | 475 | (concat msg1 "text. This image has multiple frames."))) |
| 419 | (substitute-command-keys | 476 | ;;; (substitute-command-keys |
| 420 | "\\[image-toggle-animation] to animate.")))) | 477 | ;;; "\\[image-toggle-animation] to animate.")))) |
| 421 | (t | 478 | (t |
| 422 | (message "%s" (concat msg1 "text.")))))) | 479 | (message "%s" (concat msg1 "text.")))))) |
| 423 | 480 | ||
| @@ -606,7 +663,7 @@ Otherwise it plays once, then stops." | |||
| 606 | (cond | 663 | (cond |
| 607 | ((null image) | 664 | ((null image) |
| 608 | (error "No image is present")) | 665 | (error "No image is present")) |
| 609 | ((null (setq animation (image-animated-p image))) | 666 | ((null (setq animation (image-multi-frame-p image))) |
| 610 | (message "No image animation.")) | 667 | (message "No image animation.")) |
| 611 | (t | 668 | (t |
| 612 | (let ((timer (image-animate-timer image))) | 669 | (let ((timer (image-animate-timer image))) |
| @@ -620,6 +677,36 @@ Otherwise it plays once, then stops." | |||
| 620 | (image-animate image index | 677 | (image-animate image index |
| 621 | (if image-animate-loop t))))))))) | 678 | (if image-animate-loop t))))))))) |
| 622 | 679 | ||
| 680 | (defun image-goto-frame (n &optional relative) | ||
| 681 | "Show frame N of a multi-frame image. | ||
| 682 | Optional argument OFFSET non-nil means interpret N as relative to the | ||
| 683 | current frame. Frames are indexed from 1." | ||
| 684 | (interactive | ||
| 685 | (list (or current-prefix-arg | ||
| 686 | (read-number "Show frame number: ")))) | ||
| 687 | (let ((image (image-get-display-property))) | ||
| 688 | (cond | ||
| 689 | ((null image) | ||
| 690 | (error "No image is present")) | ||
| 691 | ((null image-current-frame) | ||
| 692 | (message "No image animation.")) | ||
| 693 | (t | ||
| 694 | (image-nth-frame image (if relative (+ n image-current-frame) (1- n))))))) | ||
| 695 | |||
| 696 | (defun image-next-frame (&optional n) | ||
| 697 | "Switch to the next frame of a multi-frame image. | ||
| 698 | With optional argument N, switch to the Nth frame after the current one. | ||
| 699 | If N is negative, switch to the Nth frame before the current one." | ||
| 700 | (interactive "p") | ||
| 701 | (image-goto-frame n t)) | ||
| 702 | |||
| 703 | (defun image-previous-frame (&optional n) | ||
| 704 | "Switch to the previous frame of a multi-frame image. | ||
| 705 | With optional argument N, switch to the Nth frame before the current one. | ||
| 706 | If N is negative, switch to the Nth frame after the current one." | ||
| 707 | (interactive "p") | ||
| 708 | (image-next-frame (- n))) | ||
| 709 | |||
| 623 | 710 | ||
| 624 | ;;; Switching to the next/previous image | 711 | ;;; Switching to the next/previous image |
| 625 | 712 | ||
diff --git a/lisp/image.el b/lisp/image.el index 73b25f6da67..b91d136443d 100644 --- a/lisp/image.el +++ b/lisp/image.el | |||
| @@ -606,25 +606,25 @@ Example: | |||
| 606 | 606 | ||
| 607 | ;;; Animated image API | 607 | ;;; Animated image API |
| 608 | 608 | ||
| 609 | (defconst image-animated-types '(gif) | 609 | (defvar image-default-frame-delay 0.1 |
| 610 | "List of supported animated image types.") | 610 | "Default interval in seconds between frames of a multi-frame image. |
| 611 | 611 | Only used if the image does not specify a value.") | |
| 612 | (defun image-animated-p (image) | 612 | |
| 613 | "Return non-nil if IMAGE can be animated. | 613 | (defun image-multi-frame-p (image) |
| 614 | To be capable of being animated, an image must be of a type | 614 | "Return non-nil if IMAGE contains more than one frame. |
| 615 | listed in `image-animated-types', and contain more than one | 615 | The actual return value is a cons (NIMAGES . DELAY), where NIMAGES is |
| 616 | sub-image, with a specified animation delay. The actual return | 616 | the number of frames (or sub-images) in the image and DELAY is the delay |
| 617 | value is a cons (NIMAGES . DELAY), where NIMAGES is the number | 617 | in seconds that the image specifies between each frame. DELAY may be nil, |
| 618 | of sub-images in the animated image and DELAY is the delay in | 618 | in which case you might want to use `image-default-frame-delay'." |
| 619 | seconds until the next sub-image should be displayed." | 619 | (let* ((metadata (image-metadata image)) |
| 620 | (cond | 620 | (images (plist-get metadata 'count)) |
| 621 | ((memq (plist-get (cdr image) :type) image-animated-types) | 621 | (delay (plist-get metadata 'delay))) |
| 622 | (let* ((metadata (image-metadata image)) | 622 | (when (and images (> images 1)) |
| 623 | (images (plist-get metadata 'count)) | 623 | (if (or (not (numberp delay)) (< delay 0)) |
| 624 | (delay (plist-get metadata 'delay))) | 624 | (setq delay image-default-frame-delay)) |
| 625 | (when (and images (> images 1) (numberp delay)) | 625 | (cons images delay)))) |
| 626 | (if (< delay 0) (setq delay 0.1)) | 626 | |
| 627 | (cons images delay)))))) | 627 | (define-obsolete-function-alias 'image-animated-p 'image-multi-frame-p "24.4") |
| 628 | 628 | ||
| 629 | ;; "Destructively"? | 629 | ;; "Destructively"? |
| 630 | (defun image-animate (image &optional index limit) | 630 | (defun image-animate (image &optional index limit) |
| @@ -635,7 +635,7 @@ With optional INDEX, begin animating from that animation frame. | |||
| 635 | LIMIT specifies how long to animate the image. If omitted or | 635 | LIMIT specifies how long to animate the image. If omitted or |
| 636 | nil, play the animation until the end. If t, loop forever. If a | 636 | nil, play the animation until the end. If t, loop forever. If a |
| 637 | number, play until that number of seconds has elapsed." | 637 | number, play until that number of seconds has elapsed." |
| 638 | (let ((animation (image-animated-p image)) | 638 | (let ((animation (image-multi-frame-p image)) |
| 639 | timer) | 639 | timer) |
| 640 | (when animation | 640 | (when animation |
| 641 | (if (setq timer (image-animate-timer image)) | 641 | (if (setq timer (image-animate-timer image)) |
| @@ -657,8 +657,25 @@ number, play until that number of seconds has elapsed." | |||
| 657 | (setq timer nil))) | 657 | (setq timer nil))) |
| 658 | timer)) | 658 | timer)) |
| 659 | 659 | ||
| 660 | (defconst image-minimum-frame-delay 0.01 | ||
| 661 | "Minimum interval in seconds between frames of an animated image.") | ||
| 662 | |||
| 663 | (defvar-local image-current-frame nil | ||
| 664 | "The frame index of the current animated image.") | ||
| 665 | |||
| 666 | (defun image-nth-frame (image n &optional nocheck) | ||
| 667 | "Show frame N of IMAGE. | ||
| 668 | Frames are indexed from 0. Optional argument NOCHECK non-nil means | ||
| 669 | do not check N is within the range of frames present in the image." | ||
| 670 | (unless nocheck | ||
| 671 | (if (< n 0) (setq n 0) | ||
| 672 | (setq n (min n (1- (car (image-multi-frame-p image))))))) | ||
| 673 | (plist-put (cdr image) :index n) | ||
| 674 | (setq image-current-frame n) | ||
| 675 | (force-window-update)) | ||
| 676 | |||
| 660 | ;; FIXME? The delay may not be the same for different sub-images, | 677 | ;; FIXME? The delay may not be the same for different sub-images, |
| 661 | ;; hence we need to call image-animated-p to return it. | 678 | ;; hence we need to call image-multi-frame-p to return it. |
| 662 | ;; But it also returns count, so why do we bother passing that as an | 679 | ;; But it also returns count, so why do we bother passing that as an |
| 663 | ;; argument? | 680 | ;; argument? |
| 664 | (defun image-animate-timeout (image n count time-elapsed limit) | 681 | (defun image-animate-timeout (image n count time-elapsed limit) |
| @@ -670,16 +687,16 @@ TIME-ELAPSED is the total time that has elapsed since | |||
| 670 | LIMIT determines when to stop. If t, loop forever. If nil, stop | 687 | LIMIT determines when to stop. If t, loop forever. If nil, stop |
| 671 | after displaying the last animation frame. Otherwise, stop | 688 | after displaying the last animation frame. Otherwise, stop |
| 672 | after LIMIT seconds have elapsed. | 689 | after LIMIT seconds have elapsed. |
| 673 | The minimum delay between successive frames is 0.01s." | 690 | The minimum delay between successive frames is `image-minimum-frame-delay'." |
| 674 | (plist-put (cdr image) :index n) | 691 | (image-nth-frame image n t) |
| 675 | (force-window-update) | ||
| 676 | (setq n (1+ n)) | 692 | (setq n (1+ n)) |
| 677 | (let* ((time (float-time)) | 693 | (let* ((time (float-time)) |
| 678 | (animation (image-animated-p image)) | 694 | (animation (image-multi-frame-p image)) |
| 679 | ;; Subtract off the time we took to load the image from the | 695 | ;; Subtract off the time we took to load the image from the |
| 680 | ;; stated delay time. | 696 | ;; stated delay time. |
| 681 | (delay (max (+ (cdr animation) time (- (float-time))) | 697 | (delay (max (+ (or (cdr animation) image-default-frame-delay) |
| 682 | 0.01)) | 698 | time (- (float-time))) |
| 699 | image-minimum-frame-delay)) | ||
| 683 | done) | 700 | done) |
| 684 | (if (>= n count) | 701 | (if (>= n count) |
| 685 | (if limit | 702 | (if limit |
diff --git a/lisp/info-look.el b/lisp/info-look.el index a67fabc5a88..0b33dd51faf 100644 --- a/lisp/info-look.el +++ b/lisp/info-look.el | |||
| @@ -298,6 +298,21 @@ If optional argument QUERY is non-nil, query for the help mode." | |||
| 298 | (when (string-match (caar file-name-alist) file-name) | 298 | (when (string-match (caar file-name-alist) file-name) |
| 299 | (setq info-lookup-mode (cdar file-name-alist))) | 299 | (setq info-lookup-mode (cdar file-name-alist))) |
| 300 | (setq file-name-alist (cdr file-name-alist))))) | 300 | (setq file-name-alist (cdr file-name-alist))))) |
| 301 | |||
| 302 | ;; If major-mode has no setups in info-lookup-alist, under any topic, then | ||
| 303 | ;; search up through derived-mode-parent to find a parent mode which does | ||
| 304 | ;; have some setups. This means that a `define-derived-mode' with no | ||
| 305 | ;; setups of its own will select its parent mode for lookups, if one of | ||
| 306 | ;; its parents has some setups. Good for example on `makefile-gmake-mode' | ||
| 307 | ;; and similar derivatives of `makefile-mode'. | ||
| 308 | ;; | ||
| 309 | (let ((mode major-mode)) ;; Look for `mode' with some setups. | ||
| 310 | (while (and mode (not info-lookup-mode)) | ||
| 311 | (dolist (topic-cell info-lookup-alist) ;; Usually only two topics here. | ||
| 312 | (if (info-lookup->mode-value (car topic-cell) mode) | ||
| 313 | (setq info-lookup-mode mode))) | ||
| 314 | (setq mode (get mode 'derived-mode-parent)))) | ||
| 315 | |||
| 301 | (or info-lookup-mode (setq info-lookup-mode major-mode))) | 316 | (or info-lookup-mode (setq info-lookup-mode major-mode))) |
| 302 | 317 | ||
| 303 | (defun info-lookup-change-mode (topic) | 318 | (defun info-lookup-change-mode (topic) |
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index d1ef1739bf7..dc45a57b7c6 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el | |||
| @@ -58,6 +58,19 @@ | |||
| 58 | (defvar tramp-cache-data (make-hash-table :test 'equal) | 58 | (defvar tramp-cache-data (make-hash-table :test 'equal) |
| 59 | "Hash table for remote files properties.") | 59 | "Hash table for remote files properties.") |
| 60 | 60 | ||
| 61 | ;;;###tramp-autoload | ||
| 62 | (defcustom tramp-connection-properties nil | ||
| 63 | "List of static connection properties. | ||
| 64 | Every entry has the form (REGEXP PROPERTY VALUE). The regexp | ||
| 65 | matches remote file names. It can be nil. PROPERTY is a string, | ||
| 66 | and VALUE the corresponding value. They are used, if there is no | ||
| 67 | matching entry in for PROPERTY in `tramp-cache-data'." | ||
| 68 | :group 'tramp | ||
| 69 | :version "24.4" | ||
| 70 | :type '(repeat (list (choice :tag "File Name regexp" regexp (const nil)) | ||
| 71 | (choice :tag " Property" string) | ||
| 72 | (choice :tag " Value" sexp)))) | ||
| 73 | |||
| 61 | (defcustom tramp-persistency-file-name | 74 | (defcustom tramp-persistency-file-name |
| 62 | (cond | 75 | (cond |
| 63 | ;; GNU Emacs. | 76 | ;; GNU Emacs. |
| @@ -204,9 +217,27 @@ If the value is not set for the connection, returns DEFAULT." | |||
| 204 | (setq key (copy-sequence key)) | 217 | (setq key (copy-sequence key)) |
| 205 | (aset key 3 nil)) | 218 | (aset key 3 nil)) |
| 206 | (let* ((hash (gethash key tramp-cache-data)) | 219 | (let* ((hash (gethash key tramp-cache-data)) |
| 207 | (value (if (hash-table-p hash) | 220 | (value |
| 208 | (gethash property hash default) | 221 | (catch 'result |
| 209 | default))) | 222 | (or |
| 223 | ;; Check for dynamic properties. | ||
| 224 | (and | ||
| 225 | (hash-table-p hash) | ||
| 226 | (maphash | ||
| 227 | (lambda (x y) (when (equal x property) (throw 'result y))) | ||
| 228 | hash)) | ||
| 229 | ;; Check for static properties. | ||
| 230 | (and | ||
| 231 | (vectorp key) | ||
| 232 | (dolist (elt tramp-connection-properties) | ||
| 233 | (when (and (string-match | ||
| 234 | (or (nth 0 elt) "") | ||
| 235 | (tramp-make-tramp-file-name | ||
| 236 | (aref key 0) (aref key 1) (aref key 2) nil)) | ||
| 237 | (string-equal (or (nth 1 elt) "") (or property ""))) | ||
| 238 | (throw 'result (nth 2 elt))))) | ||
| 239 | ;; The default value. | ||
| 240 | default)))) | ||
| 210 | (tramp-message key 7 "%s %s" property value) | 241 | (tramp-message key 7 "%s %s" property value) |
| 211 | value)) | 242 | value)) |
| 212 | 243 | ||
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index 12510bf7fab..81c4d5ccced 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el | |||
| @@ -52,6 +52,7 @@ | |||
| 52 | (require 'format-spec) | 52 | (require 'format-spec) |
| 53 | (require 'shell) | 53 | (require 'shell) |
| 54 | 54 | ||
| 55 | (require 'trampver) | ||
| 55 | (require 'tramp-loaddefs) | 56 | (require 'tramp-loaddefs) |
| 56 | 57 | ||
| 57 | ;; As long as password.el is not part of (X)Emacs, it shouldn't be | 58 | ;; As long as password.el is not part of (X)Emacs, it shouldn't be |
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 001a27f3b2e..9be22352b23 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -512,6 +512,7 @@ as given in your `~/.profile'." | |||
| 512 | (const :tag "Private Directories" tramp-own-remote-path) | 512 | (const :tag "Private Directories" tramp-own-remote-path) |
| 513 | (string :tag "Directory")))) | 513 | (string :tag "Directory")))) |
| 514 | 514 | ||
| 515 | ;;;###tramp-autoload | ||
| 515 | (defcustom tramp-remote-process-environment | 516 | (defcustom tramp-remote-process-environment |
| 516 | `("HISTFILE=$HOME/.tramp_history" "HISTSIZE=1" "LC_ALL=C" | 517 | `("HISTFILE=$HOME/.tramp_history" "HISTSIZE=1" "LC_ALL=C" |
| 517 | ,(format "TERM=%s" tramp-terminal-type) | 518 | ,(format "TERM=%s" tramp-terminal-type) |
diff --git a/lisp/replace.el b/lisp/replace.el index 7757426cf95..0b8aaa7d349 100644 --- a/lisp/replace.el +++ b/lisp/replace.el | |||
| @@ -585,27 +585,32 @@ of `history-length', which see.") | |||
| 585 | When PROMPT doesn't end with a colon and space, it adds a final \": \". | 585 | When PROMPT doesn't end with a colon and space, it adds a final \": \". |
| 586 | If DEFAULTS is non-nil, it displays the first default in the prompt. | 586 | If DEFAULTS is non-nil, it displays the first default in the prompt. |
| 587 | 587 | ||
| 588 | Non-nil optional arg DEFAULTS is a string or a list of strings that | 588 | Optional arg DEFAULTS is a string or a list of strings that are |
| 589 | are prepended to a list of standard default values, which include the | 589 | prepended to a list of standard default values, which include the |
| 590 | string at point, the last isearch regexp, the last isearch string, and | 590 | tag at point, the last isearch regexp, the last isearch string, |
| 591 | the last replacement regexp. | 591 | and the last replacement regexp. |
| 592 | 592 | ||
| 593 | Non-nil HISTORY is a symbol to use for the history list. | 593 | Non-nil HISTORY is a symbol to use for the history list. |
| 594 | If HISTORY is nil, `regexp-history' is used." | 594 | If HISTORY is nil, `regexp-history' is used." |
| 595 | (let* ((default (if (consp defaults) (car defaults) defaults)) | 595 | (let* ((defaults |
| 596 | (defaults | ||
| 597 | (append | 596 | (append |
| 598 | (if (listp defaults) defaults (list defaults)) | 597 | (if (listp defaults) defaults (list defaults)) |
| 599 | (list (regexp-quote | 598 | (list |
| 600 | (or (funcall (or find-tag-default-function | 599 | ;; Regexp for tag at point. |
| 600 | (let* ((tagf (or find-tag-default-function | ||
| 601 | (get major-mode 'find-tag-default-function) | 601 | (get major-mode 'find-tag-default-function) |
| 602 | 'find-tag-default)) | 602 | 'find-tag-default)) |
| 603 | "")) | 603 | (tag (funcall tagf))) |
| 604 | (cond ((not tag) "") | ||
| 605 | ((eq tagf 'find-tag-default) | ||
| 606 | (format "\\_<%s\\_>" (regexp-quote tag))) | ||
| 607 | (t (regexp-quote tag)))) | ||
| 604 | (car regexp-search-ring) | 608 | (car regexp-search-ring) |
| 605 | (regexp-quote (or (car search-ring) "")) | 609 | (regexp-quote (or (car search-ring) "")) |
| 606 | (car (symbol-value | 610 | (car (symbol-value |
| 607 | query-replace-from-history-variable))))) | 611 | query-replace-from-history-variable))))) |
| 608 | (defaults (delete-dups (delq nil (delete "" defaults)))) | 612 | (defaults (delete-dups (delq nil (delete "" defaults)))) |
| 613 | (default (car defaults)) | ||
| 609 | ;; Do not automatically add default to the history for empty input. | 614 | ;; Do not automatically add default to the history for empty input. |
| 610 | (history-add-new-input nil) | 615 | (history-add-new-input nil) |
| 611 | (input (read-from-minibuffer | 616 | (input (read-from-minibuffer |
diff --git a/lisp/simple.el b/lisp/simple.el index 849f7dac55c..138c2420309 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -1293,13 +1293,12 @@ display the result of expression evaluation." | |||
| 1293 | 1293 | ||
| 1294 | ;; We define this, rather than making `eval' interactive, | 1294 | ;; We define this, rather than making `eval' interactive, |
| 1295 | ;; for the sake of completion of names like eval-region, eval-buffer. | 1295 | ;; for the sake of completion of names like eval-region, eval-buffer. |
| 1296 | (defun eval-expression (eval-expression-arg | 1296 | (defun eval-expression (exp &optional insert-value) |
| 1297 | &optional eval-expression-insert-value) | 1297 | "Evaluate EXP and print value in the echo area. |
| 1298 | "Evaluate EVAL-EXPRESSION-ARG and print value in the echo area. | ||
| 1299 | When called interactively, read an Emacs Lisp expression and | 1298 | When called interactively, read an Emacs Lisp expression and |
| 1300 | evaluate it. | 1299 | evaluate it. |
| 1301 | Value is also consed on to front of the variable `values'. | 1300 | Value is also consed on to front of the variable `values'. |
| 1302 | Optional argument EVAL-EXPRESSION-INSERT-VALUE non-nil (interactively, | 1301 | Optional argument INSERT-VALUE non-nil (interactively, |
| 1303 | with prefix argument) means insert the result into the current buffer | 1302 | with prefix argument) means insert the result into the current buffer |
| 1304 | instead of printing it in the echo area. Truncates long output | 1303 | instead of printing it in the echo area. Truncates long output |
| 1305 | according to the value of the variables `eval-expression-print-length' | 1304 | according to the value of the variables `eval-expression-print-length' |
| @@ -1315,12 +1314,12 @@ this command arranges for all errors to enter the debugger." | |||
| 1315 | current-prefix-arg)) | 1314 | current-prefix-arg)) |
| 1316 | 1315 | ||
| 1317 | (if (null eval-expression-debug-on-error) | 1316 | (if (null eval-expression-debug-on-error) |
| 1318 | (push (eval eval-expression-arg lexical-binding) values) | 1317 | (push (eval exp lexical-binding) values) |
| 1319 | (let ((old-value (make-symbol "t")) new-value) | 1318 | (let ((old-value (make-symbol "t")) new-value) |
| 1320 | ;; Bind debug-on-error to something unique so that we can | 1319 | ;; Bind debug-on-error to something unique so that we can |
| 1321 | ;; detect when evalled code changes it. | 1320 | ;; detect when evalled code changes it. |
| 1322 | (let ((debug-on-error old-value)) | 1321 | (let ((debug-on-error old-value)) |
| 1323 | (push (eval eval-expression-arg lexical-binding) values) | 1322 | (push (eval exp lexical-binding) values) |
| 1324 | (setq new-value debug-on-error)) | 1323 | (setq new-value debug-on-error)) |
| 1325 | ;; If evalled code has changed the value of debug-on-error, | 1324 | ;; If evalled code has changed the value of debug-on-error, |
| 1326 | ;; propagate that change to the global binding. | 1325 | ;; propagate that change to the global binding. |
| @@ -1328,8 +1327,9 @@ this command arranges for all errors to enter the debugger." | |||
| 1328 | (setq debug-on-error new-value)))) | 1327 | (setq debug-on-error new-value)))) |
| 1329 | 1328 | ||
| 1330 | (let ((print-length eval-expression-print-length) | 1329 | (let ((print-length eval-expression-print-length) |
| 1331 | (print-level eval-expression-print-level)) | 1330 | (print-level eval-expression-print-level) |
| 1332 | (if eval-expression-insert-value | 1331 | (deactivate-mark)) |
| 1332 | (if insert-value | ||
| 1333 | (with-no-warnings | 1333 | (with-no-warnings |
| 1334 | (let ((standard-output (current-buffer))) | 1334 | (let ((standard-output (current-buffer))) |
| 1335 | (prin1 (car values)))) | 1335 | (prin1 (car values)))) |
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index 72842ad188d..f8f24de6b68 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2013-02-16 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * url-http.el (url-http-wait-for-headers-change-function): | ||
| 4 | Avoid prematurely finding the end of headers when they arrive | ||
| 5 | line-by-line. (Bug#13598) | ||
| 6 | |||
| 1 | 2013-02-03 Stefan Monnier <monnier@iro.umontreal.ca> | 7 | 2013-02-03 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 8 | ||
| 3 | * url-cache.el (url-cache-create-filename-using-md5): Don't waste your | 9 | * url-cache.el (url-cache-create-filename-using-md5): Don't waste your |
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el index 5dd3a751702..33fc5722759 100644 --- a/lisp/url/url-http.el +++ b/lisp/url/url-http.el | |||
| @@ -1040,7 +1040,9 @@ the end of the document." | |||
| 1040 | (setq end-of-headers t | 1040 | (setq end-of-headers t |
| 1041 | url-http-end-of-headers 0 | 1041 | url-http-end-of-headers 0 |
| 1042 | old-http t) | 1042 | old-http t) |
| 1043 | (when (re-search-forward "^\r*$" nil t) | 1043 | ;; Blank line at end of headers. |
| 1044 | (when (re-search-forward "^\r?\n" nil t) | ||
| 1045 | (backward-char 1) | ||
| 1044 | ;; Saw the end of the headers | 1046 | ;; Saw the end of the headers |
| 1045 | (url-http-debug "Saw end of headers... (%s)" (buffer-name)) | 1047 | (url-http-debug "Saw end of headers... (%s)" (buffer-name)) |
| 1046 | (setq url-http-end-of-headers (set-marker (make-marker) | 1048 | (setq url-http-end-of-headers (set-marker (make-marker) |
diff --git a/nt/ChangeLog b/nt/ChangeLog index 18911b90fac..a8bb8c74c91 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2013-02-16 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * inc/ms-w32.h (__STDC__): Fiddle with value only for MSVC. | ||
| 4 | (Bug#9066) | ||
| 5 | (chown, logb): Remove, unused. | ||
| 6 | |||
| 1 | 2013-02-13 Juanma Barranquero <lekktu@gmail.com> | 7 | 2013-02-13 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 8 | ||
| 3 | * config.nt: Sync with autogen/config.in. | 9 | * config.nt: Sync with autogen/config.in. |
diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h index a74c74b4548..66f586a4f76 100644 --- a/nt/inc/ms-w32.h +++ b/nt/inc/ms-w32.h | |||
| @@ -149,7 +149,6 @@ extern char *getenv (); | |||
| 149 | #define chdir sys_chdir | 149 | #define chdir sys_chdir |
| 150 | #undef chmod | 150 | #undef chmod |
| 151 | #define chmod sys_chmod | 151 | #define chmod sys_chmod |
| 152 | #define chown sys_chown | ||
| 153 | #undef close | 152 | #undef close |
| 154 | #define close sys_close | 153 | #define close sys_close |
| 155 | #undef creat | 154 | #undef creat |
| @@ -222,7 +221,6 @@ typedef int pid_t; | |||
| 222 | #define strtoll _strtoi64 | 221 | #define strtoll _strtoi64 |
| 223 | #endif | 222 | #endif |
| 224 | #define isatty _isatty | 223 | #define isatty _isatty |
| 225 | #define logb _logb | ||
| 226 | #define _longjmp longjmp | 224 | #define _longjmp longjmp |
| 227 | #define lseek _lseek | 225 | #define lseek _lseek |
| 228 | #define popen _popen | 226 | #define popen _popen |
| @@ -265,8 +263,11 @@ struct timespec | |||
| 265 | extern struct tm *gmtime_r (time_t const * restrict, struct tm * restrict); | 263 | extern struct tm *gmtime_r (time_t const * restrict, struct tm * restrict); |
| 266 | extern struct tm *localtime_r (time_t const * restrict, struct tm * restrict); | 264 | extern struct tm *localtime_r (time_t const * restrict, struct tm * restrict); |
| 267 | 265 | ||
| 266 | #ifdef _MSC_VER | ||
| 268 | /* This is hacky, but is necessary to avoid warnings about macro | 267 | /* This is hacky, but is necessary to avoid warnings about macro |
| 269 | redefinitions using the SDK compilers. */ | 268 | redefinitions using the MSVC compilers, since, when __STDC__ is |
| 269 | undefined or zero, those compilers declare functions like fileno, | ||
| 270 | lseek, and chdir, for which we defined macros above. */ | ||
| 270 | #ifndef __STDC__ | 271 | #ifndef __STDC__ |
| 271 | #define __STDC__ 1 | 272 | #define __STDC__ 1 |
| 272 | #define MUST_UNDEF__STDC__ | 273 | #define MUST_UNDEF__STDC__ |
| @@ -278,6 +279,11 @@ extern struct tm *localtime_r (time_t const * restrict, struct tm * restrict); | |||
| 278 | #undef __STDC__ | 279 | #undef __STDC__ |
| 279 | #undef MUST_UNDEF__STDC__ | 280 | #undef MUST_UNDEF__STDC__ |
| 280 | #endif | 281 | #endif |
| 282 | #else /* !_MSC_VER */ | ||
| 283 | #include <direct.h> | ||
| 284 | #include <io.h> | ||
| 285 | #include <stdio.h> | ||
| 286 | #endif /* !_MSC_VER */ | ||
| 281 | 287 | ||
| 282 | /* Defines that we need that aren't in the standard signal.h. */ | 288 | /* Defines that we need that aren't in the standard signal.h. */ |
| 283 | #define SIGHUP 1 /* Hang up */ | 289 | #define SIGHUP 1 /* Hang up */ |
diff --git a/src/ChangeLog b/src/ChangeLog index 6ff25edac50..4d39a32e883 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,20 @@ | |||
| 1 | 2013-02-16 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * w32.c (sys_chown): Remove unused function. | ||
| 4 | |||
| 5 | * w32term.c <input_signal_count>: Declare 'volatile' | ||
| 6 | unconditionally. (Bug#9066) | ||
| 7 | |||
| 8 | * w32.c (set_errno): Reset h_errno and don't set it to any other | ||
| 9 | value. Set errno instead. | ||
| 10 | (check_errno): Reset h_errno. | ||
| 11 | (sys_socket, socket_to_fd, sys_bind, sys_connect) | ||
| 12 | (sys_gethostname, sys_getservbyname, sys_getpeername) | ||
| 13 | (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname) | ||
| 14 | (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set | ||
| 15 | h_errno. | ||
| 16 | (sys_gethostbyname): Set h_errno only errors detected. | ||
| 17 | |||
| 1 | 2013-02-15 Paul Eggert <eggert@cs.ucla.edu> | 18 | 2013-02-15 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 19 | ||
| 3 | * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl. | 20 | * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl. |
| @@ -3220,14 +3220,6 @@ sys_chmod (const char * path, int mode) | |||
| 3220 | } | 3220 | } |
| 3221 | 3221 | ||
| 3222 | int | 3222 | int |
| 3223 | sys_chown (const char *path, uid_t owner, gid_t group) | ||
| 3224 | { | ||
| 3225 | if (sys_chmod (path, S_IREAD) == -1) /* check if file exists */ | ||
| 3226 | return -1; | ||
| 3227 | return 0; | ||
| 3228 | } | ||
| 3229 | |||
| 3230 | int | ||
| 3231 | sys_creat (const char * path, int mode) | 3223 | sys_creat (const char * path, int mode) |
| 3232 | { | 3224 | { |
| 3233 | return _creat (map_w32_filename (path, NULL), mode); | 3225 | return _creat (map_w32_filename (path, NULL), mode); |
| @@ -6092,35 +6084,39 @@ init_winsock (int load_now) | |||
| 6092 | 6084 | ||
| 6093 | int h_errno = 0; | 6085 | int h_errno = 0; |
| 6094 | 6086 | ||
| 6095 | /* function to set h_errno for compatibility; map winsock error codes to | 6087 | /* Function to map winsock error codes to errno codes for those errno |
| 6096 | normal system codes where they overlap (non-overlapping definitions | 6088 | code defined in errno.h (errno values not defined by errno.h are |
| 6097 | are already in <sys/socket.h> */ | 6089 | already in nt/inc/sys/socket.h). */ |
| 6098 | static void | 6090 | static void |
| 6099 | set_errno (void) | 6091 | set_errno (void) |
| 6100 | { | 6092 | { |
| 6093 | int wsa_err; | ||
| 6094 | |||
| 6095 | h_errno = 0; | ||
| 6101 | if (winsock_lib == NULL) | 6096 | if (winsock_lib == NULL) |
| 6102 | h_errno = EINVAL; | 6097 | wsa_err = EINVAL; |
| 6103 | else | 6098 | else |
| 6104 | h_errno = pfn_WSAGetLastError (); | 6099 | wsa_err = pfn_WSAGetLastError (); |
| 6105 | 6100 | ||
| 6106 | switch (h_errno) | 6101 | switch (wsa_err) |
| 6107 | { | 6102 | { |
| 6108 | case WSAEACCES: h_errno = EACCES; break; | 6103 | case WSAEACCES: errno = EACCES; break; |
| 6109 | case WSAEBADF: h_errno = EBADF; break; | 6104 | case WSAEBADF: errno = EBADF; break; |
| 6110 | case WSAEFAULT: h_errno = EFAULT; break; | 6105 | case WSAEFAULT: errno = EFAULT; break; |
| 6111 | case WSAEINTR: h_errno = EINTR; break; | 6106 | case WSAEINTR: errno = EINTR; break; |
| 6112 | case WSAEINVAL: h_errno = EINVAL; break; | 6107 | case WSAEINVAL: errno = EINVAL; break; |
| 6113 | case WSAEMFILE: h_errno = EMFILE; break; | 6108 | case WSAEMFILE: errno = EMFILE; break; |
| 6114 | case WSAENAMETOOLONG: h_errno = ENAMETOOLONG; break; | 6109 | case WSAENAMETOOLONG: errno = ENAMETOOLONG; break; |
| 6115 | case WSAENOTEMPTY: h_errno = ENOTEMPTY; break; | 6110 | case WSAENOTEMPTY: errno = ENOTEMPTY; break; |
| 6111 | default: errno = wsa_err; break; | ||
| 6116 | } | 6112 | } |
| 6117 | errno = h_errno; | ||
| 6118 | } | 6113 | } |
| 6119 | 6114 | ||
| 6120 | static void | 6115 | static void |
| 6121 | check_errno (void) | 6116 | check_errno (void) |
| 6122 | { | 6117 | { |
| 6123 | if (h_errno == 0 && winsock_lib != NULL) | 6118 | h_errno = 0; |
| 6119 | if (winsock_lib != NULL) | ||
| 6124 | pfn_WSASetLastError (0); | 6120 | pfn_WSASetLastError (0); |
| 6125 | } | 6121 | } |
| 6126 | 6122 | ||
| @@ -6232,7 +6228,7 @@ sys_socket (int af, int type, int protocol) | |||
| 6232 | 6228 | ||
| 6233 | if (winsock_lib == NULL) | 6229 | if (winsock_lib == NULL) |
| 6234 | { | 6230 | { |
| 6235 | errno = h_errno = ENETDOWN; | 6231 | errno = ENETDOWN; |
| 6236 | return INVALID_SOCKET; | 6232 | return INVALID_SOCKET; |
| 6237 | } | 6233 | } |
| 6238 | 6234 | ||
| @@ -6242,13 +6238,7 @@ sys_socket (int af, int type, int protocol) | |||
| 6242 | s = pfn_socket (af, type, protocol); | 6238 | s = pfn_socket (af, type, protocol); |
| 6243 | 6239 | ||
| 6244 | if (s != INVALID_SOCKET) | 6240 | if (s != INVALID_SOCKET) |
| 6245 | { | 6241 | return socket_to_fd (s); |
| 6246 | int retval = socket_to_fd (s); | ||
| 6247 | |||
| 6248 | if (retval == -1) | ||
| 6249 | errno = h_errno; | ||
| 6250 | return retval; | ||
| 6251 | } | ||
| 6252 | 6242 | ||
| 6253 | set_errno (); | 6243 | set_errno (); |
| 6254 | return -1; | 6244 | return -1; |
| @@ -6344,8 +6334,9 @@ socket_to_fd (SOCKET s) | |||
| 6344 | /* clean up */ | 6334 | /* clean up */ |
| 6345 | _close (fd); | 6335 | _close (fd); |
| 6346 | } | 6336 | } |
| 6337 | else | ||
| 6347 | pfn_closesocket (s); | 6338 | pfn_closesocket (s); |
| 6348 | h_errno = EMFILE; | 6339 | errno = EMFILE; |
| 6349 | return -1; | 6340 | return -1; |
| 6350 | } | 6341 | } |
| 6351 | 6342 | ||
| @@ -6354,7 +6345,7 @@ sys_bind (int s, const struct sockaddr * addr, int namelen) | |||
| 6354 | { | 6345 | { |
| 6355 | if (winsock_lib == NULL) | 6346 | if (winsock_lib == NULL) |
| 6356 | { | 6347 | { |
| 6357 | errno = h_errno = ENOTSOCK; | 6348 | errno = ENOTSOCK; |
| 6358 | return SOCKET_ERROR; | 6349 | return SOCKET_ERROR; |
| 6359 | } | 6350 | } |
| 6360 | 6351 | ||
| @@ -6366,7 +6357,7 @@ sys_bind (int s, const struct sockaddr * addr, int namelen) | |||
| 6366 | set_errno (); | 6357 | set_errno (); |
| 6367 | return rc; | 6358 | return rc; |
| 6368 | } | 6359 | } |
| 6369 | errno = h_errno = ENOTSOCK; | 6360 | errno = ENOTSOCK; |
| 6370 | return SOCKET_ERROR; | 6361 | return SOCKET_ERROR; |
| 6371 | } | 6362 | } |
| 6372 | 6363 | ||
| @@ -6375,7 +6366,7 @@ sys_connect (int s, const struct sockaddr * name, int namelen) | |||
| 6375 | { | 6366 | { |
| 6376 | if (winsock_lib == NULL) | 6367 | if (winsock_lib == NULL) |
| 6377 | { | 6368 | { |
| 6378 | errno = h_errno = ENOTSOCK; | 6369 | errno = ENOTSOCK; |
| 6379 | return SOCKET_ERROR; | 6370 | return SOCKET_ERROR; |
| 6380 | } | 6371 | } |
| 6381 | 6372 | ||
| @@ -6387,7 +6378,7 @@ sys_connect (int s, const struct sockaddr * name, int namelen) | |||
| 6387 | set_errno (); | 6378 | set_errno (); |
| 6388 | return rc; | 6379 | return rc; |
| 6389 | } | 6380 | } |
| 6390 | errno = h_errno = ENOTSOCK; | 6381 | errno = ENOTSOCK; |
| 6391 | return SOCKET_ERROR; | 6382 | return SOCKET_ERROR; |
| 6392 | } | 6383 | } |
| 6393 | 6384 | ||
| @@ -6416,12 +6407,20 @@ int | |||
| 6416 | sys_gethostname (char * name, int namelen) | 6407 | sys_gethostname (char * name, int namelen) |
| 6417 | { | 6408 | { |
| 6418 | if (winsock_lib != NULL) | 6409 | if (winsock_lib != NULL) |
| 6419 | return pfn_gethostname (name, namelen); | 6410 | { |
| 6411 | int retval; | ||
| 6412 | |||
| 6413 | check_errno (); | ||
| 6414 | retval = pfn_gethostname (name, namelen); | ||
| 6415 | if (retval == SOCKET_ERROR) | ||
| 6416 | set_errno (); | ||
| 6417 | return retval; | ||
| 6418 | } | ||
| 6420 | 6419 | ||
| 6421 | if (namelen > MAX_COMPUTERNAME_LENGTH) | 6420 | if (namelen > MAX_COMPUTERNAME_LENGTH) |
| 6422 | return !GetComputerName (name, (DWORD *)&namelen); | 6421 | return !GetComputerName (name, (DWORD *)&namelen); |
| 6423 | 6422 | ||
| 6424 | errno = h_errno = EFAULT; | 6423 | errno = EFAULT; |
| 6425 | return SOCKET_ERROR; | 6424 | return SOCKET_ERROR; |
| 6426 | } | 6425 | } |
| 6427 | 6426 | ||
| @@ -6429,17 +6428,24 @@ struct hostent * | |||
| 6429 | sys_gethostbyname (const char * name) | 6428 | sys_gethostbyname (const char * name) |
| 6430 | { | 6429 | { |
| 6431 | struct hostent * host; | 6430 | struct hostent * host; |
| 6431 | int h_err = h_errno; | ||
| 6432 | 6432 | ||
| 6433 | if (winsock_lib == NULL) | 6433 | if (winsock_lib == NULL) |
| 6434 | { | 6434 | { |
| 6435 | errno = h_errno = ENETDOWN; | 6435 | h_errno = NO_RECOVERY; |
| 6436 | errno = ENETDOWN; | ||
| 6436 | return NULL; | 6437 | return NULL; |
| 6437 | } | 6438 | } |
| 6438 | 6439 | ||
| 6439 | check_errno (); | 6440 | check_errno (); |
| 6440 | host = pfn_gethostbyname (name); | 6441 | host = pfn_gethostbyname (name); |
| 6441 | if (!host) | 6442 | if (!host) |
| 6442 | set_errno (); | 6443 | { |
| 6444 | set_errno (); | ||
| 6445 | h_errno = errno; | ||
| 6446 | } | ||
| 6447 | else | ||
| 6448 | h_errno = h_err; | ||
| 6443 | return host; | 6449 | return host; |
| 6444 | } | 6450 | } |
| 6445 | 6451 | ||
| @@ -6450,7 +6456,7 @@ sys_getservbyname (const char * name, const char * proto) | |||
| 6450 | 6456 | ||
| 6451 | if (winsock_lib == NULL) | 6457 | if (winsock_lib == NULL) |
| 6452 | { | 6458 | { |
| 6453 | errno = h_errno = ENETDOWN; | 6459 | errno = ENETDOWN; |
| 6454 | return NULL; | 6460 | return NULL; |
| 6455 | } | 6461 | } |
| 6456 | 6462 | ||
| @@ -6466,7 +6472,7 @@ sys_getpeername (int s, struct sockaddr *addr, int * namelen) | |||
| 6466 | { | 6472 | { |
| 6467 | if (winsock_lib == NULL) | 6473 | if (winsock_lib == NULL) |
| 6468 | { | 6474 | { |
| 6469 | errno = h_errno = ENETDOWN; | 6475 | errno = ENETDOWN; |
| 6470 | return SOCKET_ERROR; | 6476 | return SOCKET_ERROR; |
| 6471 | } | 6477 | } |
| 6472 | 6478 | ||
| @@ -6478,7 +6484,7 @@ sys_getpeername (int s, struct sockaddr *addr, int * namelen) | |||
| 6478 | set_errno (); | 6484 | set_errno (); |
| 6479 | return rc; | 6485 | return rc; |
| 6480 | } | 6486 | } |
| 6481 | errno = h_errno = ENOTSOCK; | 6487 | errno = ENOTSOCK; |
| 6482 | return SOCKET_ERROR; | 6488 | return SOCKET_ERROR; |
| 6483 | } | 6489 | } |
| 6484 | 6490 | ||
| @@ -6487,7 +6493,7 @@ sys_shutdown (int s, int how) | |||
| 6487 | { | 6493 | { |
| 6488 | if (winsock_lib == NULL) | 6494 | if (winsock_lib == NULL) |
| 6489 | { | 6495 | { |
| 6490 | errno = h_errno = ENETDOWN; | 6496 | errno = ENETDOWN; |
| 6491 | return SOCKET_ERROR; | 6497 | return SOCKET_ERROR; |
| 6492 | } | 6498 | } |
| 6493 | 6499 | ||
| @@ -6499,7 +6505,7 @@ sys_shutdown (int s, int how) | |||
| 6499 | set_errno (); | 6505 | set_errno (); |
| 6500 | return rc; | 6506 | return rc; |
| 6501 | } | 6507 | } |
| 6502 | errno = h_errno = ENOTSOCK; | 6508 | errno = ENOTSOCK; |
| 6503 | return SOCKET_ERROR; | 6509 | return SOCKET_ERROR; |
| 6504 | } | 6510 | } |
| 6505 | 6511 | ||
| @@ -6508,7 +6514,7 @@ sys_setsockopt (int s, int level, int optname, const void * optval, int optlen) | |||
| 6508 | { | 6514 | { |
| 6509 | if (winsock_lib == NULL) | 6515 | if (winsock_lib == NULL) |
| 6510 | { | 6516 | { |
| 6511 | errno = h_errno = ENETDOWN; | 6517 | errno = ENETDOWN; |
| 6512 | return SOCKET_ERROR; | 6518 | return SOCKET_ERROR; |
| 6513 | } | 6519 | } |
| 6514 | 6520 | ||
| @@ -6521,7 +6527,7 @@ sys_setsockopt (int s, int level, int optname, const void * optval, int optlen) | |||
| 6521 | set_errno (); | 6527 | set_errno (); |
| 6522 | return rc; | 6528 | return rc; |
| 6523 | } | 6529 | } |
| 6524 | errno = h_errno = ENOTSOCK; | 6530 | errno = ENOTSOCK; |
| 6525 | return SOCKET_ERROR; | 6531 | return SOCKET_ERROR; |
| 6526 | } | 6532 | } |
| 6527 | 6533 | ||
| @@ -6530,7 +6536,7 @@ sys_listen (int s, int backlog) | |||
| 6530 | { | 6536 | { |
| 6531 | if (winsock_lib == NULL) | 6537 | if (winsock_lib == NULL) |
| 6532 | { | 6538 | { |
| 6533 | errno = h_errno = ENETDOWN; | 6539 | errno = ENETDOWN; |
| 6534 | return SOCKET_ERROR; | 6540 | return SOCKET_ERROR; |
| 6535 | } | 6541 | } |
| 6536 | 6542 | ||
| @@ -6544,7 +6550,7 @@ sys_listen (int s, int backlog) | |||
| 6544 | fd_info[s].flags |= FILE_LISTEN; | 6550 | fd_info[s].flags |= FILE_LISTEN; |
| 6545 | return rc; | 6551 | return rc; |
| 6546 | } | 6552 | } |
| 6547 | errno = h_errno = ENOTSOCK; | 6553 | errno = ENOTSOCK; |
| 6548 | return SOCKET_ERROR; | 6554 | return SOCKET_ERROR; |
| 6549 | } | 6555 | } |
| 6550 | 6556 | ||
| @@ -6553,7 +6559,7 @@ sys_getsockname (int s, struct sockaddr * name, int * namelen) | |||
| 6553 | { | 6559 | { |
| 6554 | if (winsock_lib == NULL) | 6560 | if (winsock_lib == NULL) |
| 6555 | { | 6561 | { |
| 6556 | errno = h_errno = ENETDOWN; | 6562 | errno = ENETDOWN; |
| 6557 | return SOCKET_ERROR; | 6563 | return SOCKET_ERROR; |
| 6558 | } | 6564 | } |
| 6559 | 6565 | ||
| @@ -6565,7 +6571,7 @@ sys_getsockname (int s, struct sockaddr * name, int * namelen) | |||
| 6565 | set_errno (); | 6571 | set_errno (); |
| 6566 | return rc; | 6572 | return rc; |
| 6567 | } | 6573 | } |
| 6568 | errno = h_errno = ENOTSOCK; | 6574 | errno = ENOTSOCK; |
| 6569 | return SOCKET_ERROR; | 6575 | return SOCKET_ERROR; |
| 6570 | } | 6576 | } |
| 6571 | 6577 | ||
| @@ -6574,7 +6580,7 @@ sys_accept (int s, struct sockaddr * addr, int * addrlen) | |||
| 6574 | { | 6580 | { |
| 6575 | if (winsock_lib == NULL) | 6581 | if (winsock_lib == NULL) |
| 6576 | { | 6582 | { |
| 6577 | errno = h_errno = ENETDOWN; | 6583 | errno = ENETDOWN; |
| 6578 | return -1; | 6584 | return -1; |
| 6579 | } | 6585 | } |
| 6580 | 6586 | ||
| @@ -6586,11 +6592,7 @@ sys_accept (int s, struct sockaddr * addr, int * addrlen) | |||
| 6586 | if (t == INVALID_SOCKET) | 6592 | if (t == INVALID_SOCKET) |
| 6587 | set_errno (); | 6593 | set_errno (); |
| 6588 | else | 6594 | else |
| 6589 | { | 6595 | fd = socket_to_fd (t); |
| 6590 | fd = socket_to_fd (t); | ||
| 6591 | if (fd < 0) | ||
| 6592 | errno = h_errno; /* socket_to_fd sets h_errno */ | ||
| 6593 | } | ||
| 6594 | 6596 | ||
| 6595 | if (fd >= 0) | 6597 | if (fd >= 0) |
| 6596 | { | 6598 | { |
| @@ -6599,7 +6601,7 @@ sys_accept (int s, struct sockaddr * addr, int * addrlen) | |||
| 6599 | } | 6601 | } |
| 6600 | return fd; | 6602 | return fd; |
| 6601 | } | 6603 | } |
| 6602 | errno = h_errno = ENOTSOCK; | 6604 | errno = ENOTSOCK; |
| 6603 | return -1; | 6605 | return -1; |
| 6604 | } | 6606 | } |
| 6605 | 6607 | ||
| @@ -6609,7 +6611,7 @@ sys_recvfrom (int s, char * buf, int len, int flags, | |||
| 6609 | { | 6611 | { |
| 6610 | if (winsock_lib == NULL) | 6612 | if (winsock_lib == NULL) |
| 6611 | { | 6613 | { |
| 6612 | errno = h_errno = ENETDOWN; | 6614 | errno = ENETDOWN; |
| 6613 | return SOCKET_ERROR; | 6615 | return SOCKET_ERROR; |
| 6614 | } | 6616 | } |
| 6615 | 6617 | ||
| @@ -6621,7 +6623,7 @@ sys_recvfrom (int s, char * buf, int len, int flags, | |||
| 6621 | set_errno (); | 6623 | set_errno (); |
| 6622 | return rc; | 6624 | return rc; |
| 6623 | } | 6625 | } |
| 6624 | errno = h_errno = ENOTSOCK; | 6626 | errno = ENOTSOCK; |
| 6625 | return SOCKET_ERROR; | 6627 | return SOCKET_ERROR; |
| 6626 | } | 6628 | } |
| 6627 | 6629 | ||
| @@ -6631,7 +6633,7 @@ sys_sendto (int s, const char * buf, int len, int flags, | |||
| 6631 | { | 6633 | { |
| 6632 | if (winsock_lib == NULL) | 6634 | if (winsock_lib == NULL) |
| 6633 | { | 6635 | { |
| 6634 | errno = h_errno = ENETDOWN; | 6636 | errno = ENETDOWN; |
| 6635 | return SOCKET_ERROR; | 6637 | return SOCKET_ERROR; |
| 6636 | } | 6638 | } |
| 6637 | 6639 | ||
| @@ -6643,7 +6645,7 @@ sys_sendto (int s, const char * buf, int len, int flags, | |||
| 6643 | set_errno (); | 6645 | set_errno (); |
| 6644 | return rc; | 6646 | return rc; |
| 6645 | } | 6647 | } |
| 6646 | errno = h_errno = ENOTSOCK; | 6648 | errno = ENOTSOCK; |
| 6647 | return SOCKET_ERROR; | 6649 | return SOCKET_ERROR; |
| 6648 | } | 6650 | } |
| 6649 | 6651 | ||
| @@ -6654,7 +6656,7 @@ fcntl (int s, int cmd, int options) | |||
| 6654 | { | 6656 | { |
| 6655 | if (winsock_lib == NULL) | 6657 | if (winsock_lib == NULL) |
| 6656 | { | 6658 | { |
| 6657 | errno = h_errno = ENETDOWN; | 6659 | errno = ENETDOWN; |
| 6658 | return -1; | 6660 | return -1; |
| 6659 | } | 6661 | } |
| 6660 | 6662 | ||
| @@ -6673,11 +6675,11 @@ fcntl (int s, int cmd, int options) | |||
| 6673 | } | 6675 | } |
| 6674 | else | 6676 | else |
| 6675 | { | 6677 | { |
| 6676 | h_errno = EINVAL; | 6678 | errno = EINVAL; |
| 6677 | return SOCKET_ERROR; | 6679 | return SOCKET_ERROR; |
| 6678 | } | 6680 | } |
| 6679 | } | 6681 | } |
| 6680 | errno = h_errno = ENOTSOCK; | 6682 | errno = ENOTSOCK; |
| 6681 | return SOCKET_ERROR; | 6683 | return SOCKET_ERROR; |
| 6682 | } | 6684 | } |
| 6683 | 6685 | ||
| @@ -7108,7 +7110,7 @@ sys_read (int fd, char * buffer, unsigned int count) | |||
| 7108 | pfn_ioctlsocket (SOCK_HANDLE (fd), FIONREAD, &waiting); | 7110 | pfn_ioctlsocket (SOCK_HANDLE (fd), FIONREAD, &waiting); |
| 7109 | if (waiting == 0 && nchars == 0) | 7111 | if (waiting == 0 && nchars == 0) |
| 7110 | { | 7112 | { |
| 7111 | h_errno = errno = EWOULDBLOCK; | 7113 | errno = EWOULDBLOCK; |
| 7112 | return -1; | 7114 | return -1; |
| 7113 | } | 7115 | } |
| 7114 | 7116 | ||
diff --git a/src/w32term.c b/src/w32term.c index c83ee31d200..170f33ecd67 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -191,11 +191,7 @@ static Time last_mouse_movement_time; | |||
| 191 | 191 | ||
| 192 | /* Incremented by w32_read_socket whenever it really tries to read | 192 | /* Incremented by w32_read_socket whenever it really tries to read |
| 193 | events. */ | 193 | events. */ |
| 194 | #ifdef __STDC__ | ||
| 195 | static int volatile input_signal_count; | 194 | static int volatile input_signal_count; |
| 196 | #else | ||
| 197 | static int input_signal_count; | ||
| 198 | #endif | ||
| 199 | 195 | ||
| 200 | #ifdef CYGWIN | 196 | #ifdef CYGWIN |
| 201 | int w32_message_fd = -1; | 197 | int w32_message_fd = -1; |