mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-24 06:20:43 -08:00
auto upstream
This commit is contained in:
commit
bcd8c34aab
24 changed files with 487 additions and 211 deletions
|
|
@ -1,3 +1,13 @@
|
|||
2013-02-16 Michael Albinus <michael.albinus@gmx.de>
|
||||
|
||||
* tramp.texi (Top, Configuration): Insert section `Android shell
|
||||
setup' in menu.
|
||||
(Android shell setup): New section.
|
||||
(Connection types, Default Method)
|
||||
(Frequently Asked Questions): Mention "scp" instead of "scpc".
|
||||
(External methods): Remove "scpc" and "rsyncc" entries.
|
||||
(Frequently Asked Questions): Remove entry about ControlPersist.
|
||||
|
||||
2013-02-13 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* message.texi (News Headers): Don't mention yow any more.
|
||||
|
|
|
|||
|
|
@ -188,8 +188,9 @@ Configuring @value{tramp} for use
|
|||
* Connection caching:: Reusing connection related information.
|
||||
* Remote Programs:: How @value{tramp} finds and uses programs on the remote machine.
|
||||
* Remote shell setup:: Remote shell setup hints.
|
||||
* Windows setup hints:: Issues with Cygwin ssh.
|
||||
* Android shell setup:: Android shell setup hints.
|
||||
* Auto-save and Backup:: Auto-save and Backup.
|
||||
* Windows setup hints:: Issues with Cygwin ssh.
|
||||
|
||||
Using @value{tramp}
|
||||
|
||||
|
|
@ -515,6 +516,7 @@ Method}.
|
|||
* Connection caching:: Reusing connection related information.
|
||||
* Remote Programs:: How @value{tramp} finds and uses programs on the remote machine.
|
||||
* Remote shell setup:: Remote shell setup hints.
|
||||
* Android shell setup:: Android shell setup hints.
|
||||
* Auto-save and Backup:: Auto-save and Backup.
|
||||
* Windows setup hints:: Issues with Cygwin ssh.
|
||||
@end menu
|
||||
|
|
@ -557,9 +559,10 @@ startup may drown out the improvement in file transfer times.
|
|||
External methods should be configured such a way that they don't
|
||||
require a password (with @command{ssh-agent}, or such alike). Modern
|
||||
@command{scp} implementations offer options to reuse existing
|
||||
@command{ssh} connections, see method @command{scpc}. If it isn't
|
||||
possible, you should consider @ref{Password handling}, otherwise you
|
||||
will be prompted for a password every copy action.
|
||||
@command{ssh} connections, which will be enabled by default if
|
||||
available. If it isn't possible, you should consider @ref{Password
|
||||
handling}, otherwise you will be prompted for a password every copy
|
||||
action.
|
||||
|
||||
|
||||
@node Inline methods
|
||||
|
|
@ -867,51 +870,6 @@ to not print any shell prompt, which confuses @value{tramp} mightily.
|
|||
This method supports the @samp{-p} argument.
|
||||
|
||||
|
||||
@item @option{scpc}---@command{ssh} and @command{scp}
|
||||
@cindex method scpc
|
||||
@cindex scpc method
|
||||
@cindex scp (with scpc method)
|
||||
@cindex ssh (with scpc method)
|
||||
|
||||
Newer versions of @option{ssh} (for example OpenSSH 4) offer an option
|
||||
@option{ControlMaster}. This allows @option{scp} to reuse an existing
|
||||
@option{ssh} channel, which increases performance.
|
||||
|
||||
Before you use this method, you should check whether your @option{ssh}
|
||||
implementation supports this option. Try from the command line
|
||||
|
||||
@example
|
||||
ssh localhost -o ControlMaster=yes /bin/true
|
||||
@end example
|
||||
|
||||
If that command succeeds silently, then you can use @option{scpc}; but
|
||||
if it fails like
|
||||
|
||||
@example
|
||||
command-line: line 0: Bad configuration option: ControlMaster
|
||||
@end example
|
||||
|
||||
then you cannot use it. Note, that the option
|
||||
@option{ControlPersist}, if it is supported by your @option{ssh}
|
||||
version, must be set to @option{no}.
|
||||
|
||||
This method supports the @samp{-p} argument.
|
||||
|
||||
|
||||
@item @option{rsyncc}---@command{ssh} and @command{rsync}
|
||||
@cindex method rsyncc
|
||||
@cindex rsyncc method
|
||||
@cindex rsync (with rsyncc method)
|
||||
@cindex ssh (with rsyncc method)
|
||||
|
||||
Like the @option{scpc} method, @option{rsyncc} improves the underlying
|
||||
@command{ssh} connection by the option @option{ControlMaster}. This
|
||||
allows @command{rsync} to reuse an existing @command{ssh} channel,
|
||||
which increases performance.
|
||||
|
||||
This method supports the @samp{-p} argument.
|
||||
|
||||
|
||||
@item @option{pscp}---@command{plink} and @command{pscp}
|
||||
@cindex method pscp
|
||||
@cindex pscp method
|
||||
|
|
@ -1240,7 +1198,7 @@ user, see the @option{su} or @option{sudo} methods. They offer
|
|||
shortened syntax for the @samp{root} account, like
|
||||
@file{@trampfn{su, , , /etc/motd}}.
|
||||
|
||||
People who edit large files may want to consider @option{scpc} instead
|
||||
People who edit large files may want to consider @option{scp} instead
|
||||
of @option{ssh}, or @option{pscp} instead of @option{plink}. These
|
||||
external methods are faster than inline methods for large files.
|
||||
Note, however, that external methods suffer from some limitations.
|
||||
|
|
@ -1343,7 +1301,7 @@ Like with methods and users, you can also specify different default
|
|||
hosts for certain method/user combinations via the variable
|
||||
@code{tramp-default-host-alist}. Usually, this isn't necessary,
|
||||
because @code{tramp-default-host} should be sufficient. For some
|
||||
methods, like @code{adb}, that default value must be overwritten,
|
||||
methods, like @option{adb}, that default value must be overwritten,
|
||||
which is already the initial value of @code{tramp-default-host-alist}.
|
||||
|
||||
@noindent
|
||||
|
|
@ -2047,6 +2005,50 @@ fi
|
|||
@end table
|
||||
|
||||
|
||||
@node Android shell setup
|
||||
@section Android shell setup hints
|
||||
@cindex android shell setup
|
||||
|
||||
Android devices use a restricted shell. They can be accessed via the
|
||||
@option{adb} method. However, this restricts the access to a USB
|
||||
connection, and it requires the installation of the Android SDK on the
|
||||
local machine.
|
||||
|
||||
When an @command{sshd} process runs on the Android device, like
|
||||
provided by the @code{SSHDroid} app, any @option{ssh}-based method can
|
||||
be used. However, this requires some special settings.
|
||||
|
||||
The default shell @code{/bin/sh} does not exist. Instead, you shall
|
||||
use just @code{sh}, which invokes the shell installed on the device.
|
||||
You can instruct @value{tramp} by this form:
|
||||
|
||||
@lisp
|
||||
(add-to-list 'tramp-connection-properties
|
||||
(list (regexp-quote "192.168.0.26") "remote-shell" "sh"))
|
||||
@end lisp
|
||||
|
||||
@noindent
|
||||
with @samp{192.168.0.26} being the IP address of your Android device.
|
||||
|
||||
The user settings for the @code{$PATH} environment valiable must be
|
||||
preserved. Add this setting:
|
||||
|
||||
@lisp
|
||||
(add-to-list 'tramp-remote-path 'tramp-own-remote-path)
|
||||
@end lisp
|
||||
|
||||
If the Android device is not @samp{rooted}, you must give the shell a
|
||||
writable directory for temporary files. You could use this setting:
|
||||
|
||||
@lisp
|
||||
(add-to-list 'tramp-remote-process-environment "TMPDIR=$HOME")
|
||||
@end lisp
|
||||
|
||||
Now you shall be able to open a remote connection with @kbd{C-x C-f
|
||||
@trampfn{ssh, , 192.168.0.26#2222, }}, given that @command{sshd}
|
||||
listens on port @samp{2222}.
|
||||
|
||||
|
||||
@node Auto-save and Backup
|
||||
@section Auto-save and Backup configuration
|
||||
@cindex auto-save
|
||||
|
|
@ -2942,7 +2944,7 @@ host as well as the time needed to perform the operations there count.
|
|||
In order to speed up @value{tramp}, one could either try to avoid some
|
||||
of the operations, or one could try to improve their performance.
|
||||
|
||||
Use an external method, like @option{scpc}.
|
||||
Use an external method, like @option{scp}.
|
||||
|
||||
Use caching. This is already enabled by default. Information about
|
||||
the remote host as well as the remote files are cached for reuse. The
|
||||
|
|
@ -3067,20 +3069,6 @@ Host *
|
|||
@end example
|
||||
|
||||
|
||||
@item
|
||||
How can I use @samp{ControlPersist}?
|
||||
|
||||
When @samp{ControlPersist} is set to @samp{yes}, the @option{scpc}
|
||||
method does not work. You can use @option{scpx} instead with the
|
||||
following settings in @file{~/.ssh/config}:
|
||||
|
||||
@example
|
||||
Host *
|
||||
ControlMaster auto
|
||||
ControlPersist yes
|
||||
@end example
|
||||
|
||||
|
||||
@item
|
||||
File name completion does not work with @value{tramp}
|
||||
|
||||
|
|
|
|||
6
etc/NEWS
6
etc/NEWS
|
|
@ -141,6 +141,12 @@ amounts of data into the ERC input.
|
|||
visit the next image file and the previous image file in the same
|
||||
directory, respectively.
|
||||
|
||||
*** New commands to show specific frames of multi-frame images.
|
||||
`f' (`image-next-frame') and `b' (`image-previous-frame') visit the
|
||||
next or previous frame. `F' (`image-goto-frame') shows a specific frame.
|
||||
|
||||
*** `image-animated-p' is now `image-multi-frame-p'.
|
||||
|
||||
---
|
||||
*** The command `image-mode-fit-frame' deletes other windows.
|
||||
When toggling, it restores the frame's previous window configuration.
|
||||
|
|
|
|||
|
|
@ -1,25 +1,96 @@
|
|||
2013-02-16 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* image.el (image-animated-types): Remove.
|
||||
(image-multi-frame-p): Rename from image-animated-p, and generalize.
|
||||
(image-animated-p): Make obsolete alias.
|
||||
(image-animate, image-nth-frame, image-animate-timeout):
|
||||
Use image-multi-frame-p.
|
||||
(image-animate-timeout): If no delay, use image-default-frame-delay.
|
||||
* image-mode.el (image-mode, image-toggle-animation):
|
||||
Use image-multi-frame-p. (Bug#763, bug#10739)
|
||||
(image-mode): Adjust startup message for a multi-frame image.
|
||||
|
||||
* image-mode.el (image-mode-map): Give it a menu.
|
||||
|
||||
2013-02-16 Michael Albinus <michael.albinus@gmx.de>
|
||||
|
||||
* net/tramp-cache.el (tramp-connection-properties): New customer
|
||||
option.
|
||||
(tramp-get-connection-property): Use it.
|
||||
|
||||
* net/tramp-compat.el (top): Require 'trampver.
|
||||
|
||||
* net/tramp-sh.el (tramp-remote-process-environment): Set
|
||||
tramp-autoload cookie.
|
||||
|
||||
2013-02-16 Kevin Ryde <user42@zip.com.au>
|
||||
|
||||
* info-look.el (info-lookup-select-mode): If major-mode has no
|
||||
info-lookup-alist entry then search up derived-mode-parent (bug#8660).
|
||||
|
||||
2013-02-16 Jambunathan K <kjambunathan@gmail.com>
|
||||
|
||||
* replace.el (read-regexp): Tighten the regexp that matches tag.
|
||||
When tag is retrieved with `find-tag-default', use regexp that
|
||||
matches tag at point. Also update docstring (Bug#13687).
|
||||
|
||||
2013-02-16 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* autorevert.el (auto-revert-notify-add-watch): With 'w32notify',
|
||||
add watch for the file, not its parent directory, since w32notify
|
||||
sets up the watch for the directory internally. (Bug#13725)
|
||||
|
||||
2013-02-16 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* image.el (image-default-frame-delay): New variable.
|
||||
(image-animated-p): Use image-default-frame-delay.
|
||||
(image-minimum-frame-delay): New constant.
|
||||
(image-animate-timeout): Use image-minimum-frame-delay.
|
||||
|
||||
* image.el (image-nth-frame): New, split from image-animate-timeout.
|
||||
(image-animate-timeout): Use image-nth-frame.
|
||||
* image-mode.el (image-goto-frame, image-next-frame)
|
||||
(image-previous-frame): New commands.
|
||||
(image-mode-map): Add new frame commands.
|
||||
|
||||
2013-02-16 Jonas Bernoulli <jonas@bernoul.li>
|
||||
|
||||
* emacs-lisp/tabulated-list.el (tabulated-list-print-col):
|
||||
If col-desc already has help-echo, use it. (Bug#13563)
|
||||
|
||||
2013-02-16 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* image.el (image-current-frame): New variable.
|
||||
(image-animate-timeout): Set image-current-frame.
|
||||
* image-mode.el (image-mode): For animated images,
|
||||
display a frame counter via mode-line-process.
|
||||
|
||||
* font-lock.el (lisp-font-lock-keywords-1): Add defvar-local.
|
||||
|
||||
2013-02-15 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
* simple.el (eval-expression): Let `exp' set the mark (bug#13724).
|
||||
|
||||
2013-02-15 Alan Mackenzie <acm@muc.de>
|
||||
|
||||
* emacs-lisp/easy-mmode.el (define-globalized-minor-mode): When a
|
||||
global minor mode has been enabled, call the minor mode function
|
||||
for a new buffer once only, after the major mode hook, whilst
|
||||
allowing that hook explicitly to disable the minor mode.
|
||||
(MODE-disable-in-buffer): new (generated) function.
|
||||
(disable-MODE): new (generated) buffer local variable.
|
||||
(MODE-disable-in-buffer): New (generated) function.
|
||||
(disable-MODE): New (generated) buffer local variable.
|
||||
|
||||
2013-02-15 Jambunathan K <kjambunathan@gmail.com>
|
||||
|
||||
* iswitchb.el (iswitchb-read-buffer): Bind `C-.' and `C-,' to
|
||||
`iswitchb-next-match' and `iswitchb-prev-match' resply.
|
||||
|
||||
* ido.el (ido-init-completion-maps): Bind `C-.' and `C-,' to
|
||||
`ido-next-match' and `ido-prev-match' resply.
|
||||
|
||||
* icomplete.el (icomplete-minibuffer-map): Unbind `C-s' and `C-r'.
|
||||
Bind `C-.' and `C-,' to `icomplete-forward-completions' and
|
||||
`icomplete-backward-completions' (Bug#13708).
|
||||
|
||||
2013-02-15 Michael Albinus <michael.albinus@gmx.de>
|
||||
2013-02-15 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* emacs-lisp/easy-mmode.el (define-minor-mode): Doc fix.
|
||||
|
||||
|
|
@ -52,8 +123,8 @@
|
|||
|
||||
2013-02-14 Michael Albinus <michael.albinus@gmx.de>
|
||||
|
||||
* net/tramp.el (tramp-debug-message): Add
|
||||
`tramp-condition-case-unless-debug'.
|
||||
* net/tramp.el (tramp-debug-message):
|
||||
Add `tramp-condition-case-unless-debug'.
|
||||
(tramp-debug-on-error): New defvar.
|
||||
(tramp-condition-case-unless-debug): New defun.
|
||||
(tramp-file-name-handler): Use it.
|
||||
|
|
@ -207,8 +278,8 @@
|
|||
* net/tramp-compat.el (top): Declare `remote-file-name-inhibit-cache'
|
||||
only if it doesn't exist.
|
||||
|
||||
* net/tramp-sh.el (tramp-sh-handle-start-file-process): Set
|
||||
process marker.
|
||||
* net/tramp-sh.el (tramp-sh-handle-start-file-process):
|
||||
Set process marker.
|
||||
|
||||
2013-02-12 Tassilo Horn <tsdh@gnu.org>
|
||||
|
||||
|
|
|
|||
|
|
@ -519,12 +519,13 @@ will use an up-to-date value of `auto-revert-interval'"
|
|||
(let ((func (if (fboundp 'inotify-add-watch)
|
||||
'inotify-add-watch 'w32notify-add-watch))
|
||||
(aspect (if (fboundp 'inotify-add-watch)
|
||||
'(create modify moved-to) '(size last-write-time))))
|
||||
'(create modify moved-to) '(size last-write-time)))
|
||||
(file (if (fboundp 'inotify-add-watch)
|
||||
(directory-file-name (expand-file-name default-directory))
|
||||
(buffer-file-name))))
|
||||
(setq auto-revert-notify-watch-descriptor
|
||||
(ignore-errors
|
||||
(funcall
|
||||
func (directory-file-name (expand-file-name default-directory))
|
||||
aspect 'auto-revert-notify-handler)))
|
||||
(funcall func file aspect 'auto-revert-notify-handler)))
|
||||
(if auto-revert-notify-watch-descriptor
|
||||
(progn
|
||||
(puthash
|
||||
|
|
|
|||
|
|
@ -379,7 +379,9 @@ Return the column number after insertion."
|
|||
(setq width (- width shift))
|
||||
(setq x (+ x shift))))
|
||||
(if (stringp col-desc)
|
||||
(insert (propertize label 'help-echo help-echo))
|
||||
(insert (if (get-text-property 0 'help-echo label)
|
||||
label
|
||||
(propertize label 'help-echo help-echo)))
|
||||
(apply 'insert-text-button label (cdr col-desc)))
|
||||
(let ((next-x (+ x pad-right width)))
|
||||
;; No need to append any spaces if this is the last column.
|
||||
|
|
|
|||
|
|
@ -2256,7 +2256,7 @@ in which C preprocessor directives are used. e.g. `asm-mode' and
|
|||
"method-combination\\|setf-expander\\|skeleton\\|widget\\|"
|
||||
"function\\|\\(compiler\\|modify\\|symbol\\)-macro\\)\\)\\|"
|
||||
;; Variable declarations.
|
||||
"\\(const\\(ant\\)?\\|custom\\|varalias\\|face\\|parameter\\|var\\)\\|"
|
||||
"\\(const\\(ant\\)?\\|custom\\|varalias\\|face\\|parameter\\|var\\(?:-local\\)?\\)\\|"
|
||||
;; Structure declarations.
|
||||
"\\(class\\|group\\|theme\\|package\\|struct\\|type\\)"
|
||||
"\\)\\)\\>"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
2013-02-16 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* shr.el (shr-put-image): Only animate images that specify a delay.
|
||||
This is consistent with the old image-animated-p behavior.
|
||||
|
||||
2013-02-14 Katsumi Yamaoka <yamaoka@jpl.org>
|
||||
|
||||
* gnus-util.el (gnus-define-keys): Convert [?\S-\ ] to [(shift space)]
|
||||
|
|
|
|||
|
|
@ -615,7 +615,8 @@ size, and full-buffer size."
|
|||
(overlay-put overlay 'face 'default)))
|
||||
(insert-image image (or alt "*")))
|
||||
(put-text-property start (point) 'image-size size)
|
||||
(when (image-animated-p image)
|
||||
;; Only animate multi-frame things that specify a delay. FIXME?
|
||||
(when (cdr (image-animated-p image))
|
||||
(image-animate image nil 60)))
|
||||
image)
|
||||
(insert alt)))
|
||||
|
|
|
|||
|
|
@ -340,6 +340,9 @@ call."
|
|||
(define-key map (kbd "S-SPC") 'image-scroll-down)
|
||||
(define-key map (kbd "DEL") 'image-scroll-down)
|
||||
(define-key map (kbd "RET") 'image-toggle-animation)
|
||||
(define-key map "F" 'image-goto-frame)
|
||||
(define-key map "f" 'image-next-frame)
|
||||
(define-key map "b" 'image-previous-frame)
|
||||
(define-key map "n" 'image-next-file)
|
||||
(define-key map "p" 'image-previous-file)
|
||||
(define-key map [remap forward-char] 'image-forward-hscroll)
|
||||
|
|
@ -356,6 +359,53 @@ call."
|
|||
(define-key map [remap move-end-of-line] 'image-eol)
|
||||
(define-key map [remap beginning-of-buffer] 'image-bob)
|
||||
(define-key map [remap end-of-buffer] 'image-eob)
|
||||
(easy-menu-define image-mode-menu map "Menu for Image mode."
|
||||
'("Image"
|
||||
["Show as Text" image-toggle-display :active t
|
||||
:help "Show image as text"]
|
||||
"--"
|
||||
["Fit Frame to Image" image-mode-fit-frame :active t
|
||||
:help "Resize frame to match image"]
|
||||
["Fit to Window Height" image-transform-fit-to-height
|
||||
:visible (eq image-type 'imagemagick)
|
||||
:help "Resize image to match the window height"]
|
||||
["Fit to Window Width" image-transform-fit-to-width
|
||||
:visible (eq image-type 'imagemagick)
|
||||
:help "Resize image to match the window width"]
|
||||
["Rotate Image..." image-transform-set-rotation
|
||||
:visible (eq image-type 'imagemagick)
|
||||
:help "Rotate the image"]
|
||||
"--"
|
||||
["Next Image" image-next-file :active t
|
||||
:help "Move to next image in this directory"]
|
||||
["Previous Image" image-previous-file :active t
|
||||
:help "Move to previous image in this directory"]
|
||||
"--"
|
||||
["Animate Image" image-toggle-animation :style toggle
|
||||
:selected (let ((image (image-get-display-property)))
|
||||
(and image (image-animate-timer image)))
|
||||
:active image-current-frame
|
||||
:help "Toggle image animation"]
|
||||
["Loop Animation"
|
||||
(lambda () (interactive)
|
||||
;;; (make-variable-buffer-local 'image-animate-loop)
|
||||
(setq image-animate-loop (not image-animate-loop))
|
||||
;; FIXME this is a hacky way to make it affect a currently
|
||||
;; animating image.
|
||||
(when (let ((image (image-get-display-property)))
|
||||
(and image (image-animate-timer image)))
|
||||
(image-toggle-animation)
|
||||
(image-toggle-animation)))
|
||||
:style toggle :selected image-animate-loop
|
||||
:active image-current-frame
|
||||
:help "Animate images once, or forever?"]
|
||||
["Next Frame" image-next-frame :active image-current-frame
|
||||
:help "Show the next frame of this image"]
|
||||
["Previous Frame" image-previous-frame :active image-current-frame
|
||||
:help "Show the previous frame of this image"]
|
||||
["Goto Frame..." image-goto-frame :active image-current-frame
|
||||
:help "Show a specific frame of this image"]
|
||||
))
|
||||
map)
|
||||
"Mode keymap for `image-mode'.")
|
||||
|
||||
|
|
@ -409,15 +459,22 @@ to toggle between display as an image and display as text."
|
|||
(run-mode-hooks 'image-mode-hook)
|
||||
(let ((image (image-get-display-property))
|
||||
(msg1 (substitute-command-keys
|
||||
"Type \\[image-toggle-display] to view the image as ")))
|
||||
"Type \\[image-toggle-display] to view the image as "))
|
||||
animated)
|
||||
(cond
|
||||
((null image)
|
||||
(message "%s" (concat msg1 "an image.")))
|
||||
((image-animated-p image)
|
||||
((setq animated (image-multi-frame-p image))
|
||||
(setq image-current-frame (or (plist-get (cdr image) :index) 0)
|
||||
mode-line-process
|
||||
`(:eval (propertize (format " [%s/%s]"
|
||||
(1+ image-current-frame)
|
||||
,(car animated))
|
||||
'help-echo "Frame number")))
|
||||
(message "%s"
|
||||
(concat msg1 "text, or "
|
||||
(substitute-command-keys
|
||||
"\\[image-toggle-animation] to animate."))))
|
||||
(concat msg1 "text. This image has multiple frames.")))
|
||||
;;; (substitute-command-keys
|
||||
;;; "\\[image-toggle-animation] to animate."))))
|
||||
(t
|
||||
(message "%s" (concat msg1 "text."))))))
|
||||
|
||||
|
|
@ -606,7 +663,7 @@ Otherwise it plays once, then stops."
|
|||
(cond
|
||||
((null image)
|
||||
(error "No image is present"))
|
||||
((null (setq animation (image-animated-p image)))
|
||||
((null (setq animation (image-multi-frame-p image)))
|
||||
(message "No image animation."))
|
||||
(t
|
||||
(let ((timer (image-animate-timer image)))
|
||||
|
|
@ -620,6 +677,36 @@ Otherwise it plays once, then stops."
|
|||
(image-animate image index
|
||||
(if image-animate-loop t)))))))))
|
||||
|
||||
(defun image-goto-frame (n &optional relative)
|
||||
"Show frame N of a multi-frame image.
|
||||
Optional argument OFFSET non-nil means interpret N as relative to the
|
||||
current frame. Frames are indexed from 1."
|
||||
(interactive
|
||||
(list (or current-prefix-arg
|
||||
(read-number "Show frame number: "))))
|
||||
(let ((image (image-get-display-property)))
|
||||
(cond
|
||||
((null image)
|
||||
(error "No image is present"))
|
||||
((null image-current-frame)
|
||||
(message "No image animation."))
|
||||
(t
|
||||
(image-nth-frame image (if relative (+ n image-current-frame) (1- n)))))))
|
||||
|
||||
(defun image-next-frame (&optional n)
|
||||
"Switch to the next frame of a multi-frame image.
|
||||
With optional argument N, switch to the Nth frame after the current one.
|
||||
If N is negative, switch to the Nth frame before the current one."
|
||||
(interactive "p")
|
||||
(image-goto-frame n t))
|
||||
|
||||
(defun image-previous-frame (&optional n)
|
||||
"Switch to the previous frame of a multi-frame image.
|
||||
With optional argument N, switch to the Nth frame before the current one.
|
||||
If N is negative, switch to the Nth frame after the current one."
|
||||
(interactive "p")
|
||||
(image-next-frame (- n)))
|
||||
|
||||
|
||||
;;; Switching to the next/previous image
|
||||
|
||||
|
|
|
|||
|
|
@ -606,25 +606,25 @@ Example:
|
|||
|
||||
;;; Animated image API
|
||||
|
||||
(defconst image-animated-types '(gif)
|
||||
"List of supported animated image types.")
|
||||
(defvar image-default-frame-delay 0.1
|
||||
"Default interval in seconds between frames of a multi-frame image.
|
||||
Only used if the image does not specify a value.")
|
||||
|
||||
(defun image-animated-p (image)
|
||||
"Return non-nil if IMAGE can be animated.
|
||||
To be capable of being animated, an image must be of a type
|
||||
listed in `image-animated-types', and contain more than one
|
||||
sub-image, with a specified animation delay. The actual return
|
||||
value is a cons (NIMAGES . DELAY), where NIMAGES is the number
|
||||
of sub-images in the animated image and DELAY is the delay in
|
||||
seconds until the next sub-image should be displayed."
|
||||
(cond
|
||||
((memq (plist-get (cdr image) :type) image-animated-types)
|
||||
(defun image-multi-frame-p (image)
|
||||
"Return non-nil if IMAGE contains more than one frame.
|
||||
The actual return value is a cons (NIMAGES . DELAY), where NIMAGES is
|
||||
the number of frames (or sub-images) in the image and DELAY is the delay
|
||||
in seconds that the image specifies between each frame. DELAY may be nil,
|
||||
in which case you might want to use `image-default-frame-delay'."
|
||||
(let* ((metadata (image-metadata image))
|
||||
(images (plist-get metadata 'count))
|
||||
(delay (plist-get metadata 'delay)))
|
||||
(when (and images (> images 1) (numberp delay))
|
||||
(if (< delay 0) (setq delay 0.1))
|
||||
(cons images delay))))))
|
||||
(when (and images (> images 1))
|
||||
(if (or (not (numberp delay)) (< delay 0))
|
||||
(setq delay image-default-frame-delay))
|
||||
(cons images delay))))
|
||||
|
||||
(define-obsolete-function-alias 'image-animated-p 'image-multi-frame-p "24.4")
|
||||
|
||||
;; "Destructively"?
|
||||
(defun image-animate (image &optional index limit)
|
||||
|
|
@ -635,7 +635,7 @@ With optional INDEX, begin animating from that animation frame.
|
|||
LIMIT specifies how long to animate the image. If omitted or
|
||||
nil, play the animation until the end. If t, loop forever. If a
|
||||
number, play until that number of seconds has elapsed."
|
||||
(let ((animation (image-animated-p image))
|
||||
(let ((animation (image-multi-frame-p image))
|
||||
timer)
|
||||
(when animation
|
||||
(if (setq timer (image-animate-timer image))
|
||||
|
|
@ -657,8 +657,25 @@ number, play until that number of seconds has elapsed."
|
|||
(setq timer nil)))
|
||||
timer))
|
||||
|
||||
(defconst image-minimum-frame-delay 0.01
|
||||
"Minimum interval in seconds between frames of an animated image.")
|
||||
|
||||
(defvar-local image-current-frame nil
|
||||
"The frame index of the current animated image.")
|
||||
|
||||
(defun image-nth-frame (image n &optional nocheck)
|
||||
"Show frame N of IMAGE.
|
||||
Frames are indexed from 0. Optional argument NOCHECK non-nil means
|
||||
do not check N is within the range of frames present in the image."
|
||||
(unless nocheck
|
||||
(if (< n 0) (setq n 0)
|
||||
(setq n (min n (1- (car (image-multi-frame-p image)))))))
|
||||
(plist-put (cdr image) :index n)
|
||||
(setq image-current-frame n)
|
||||
(force-window-update))
|
||||
|
||||
;; FIXME? The delay may not be the same for different sub-images,
|
||||
;; hence we need to call image-animated-p to return it.
|
||||
;; hence we need to call image-multi-frame-p to return it.
|
||||
;; But it also returns count, so why do we bother passing that as an
|
||||
;; argument?
|
||||
(defun image-animate-timeout (image n count time-elapsed limit)
|
||||
|
|
@ -670,16 +687,16 @@ TIME-ELAPSED is the total time that has elapsed since
|
|||
LIMIT determines when to stop. If t, loop forever. If nil, stop
|
||||
after displaying the last animation frame. Otherwise, stop
|
||||
after LIMIT seconds have elapsed.
|
||||
The minimum delay between successive frames is 0.01s."
|
||||
(plist-put (cdr image) :index n)
|
||||
(force-window-update)
|
||||
The minimum delay between successive frames is `image-minimum-frame-delay'."
|
||||
(image-nth-frame image n t)
|
||||
(setq n (1+ n))
|
||||
(let* ((time (float-time))
|
||||
(animation (image-animated-p image))
|
||||
(animation (image-multi-frame-p image))
|
||||
;; Subtract off the time we took to load the image from the
|
||||
;; stated delay time.
|
||||
(delay (max (+ (cdr animation) time (- (float-time)))
|
||||
0.01))
|
||||
(delay (max (+ (or (cdr animation) image-default-frame-delay)
|
||||
time (- (float-time)))
|
||||
image-minimum-frame-delay))
|
||||
done)
|
||||
(if (>= n count)
|
||||
(if limit
|
||||
|
|
|
|||
|
|
@ -298,6 +298,21 @@ If optional argument QUERY is non-nil, query for the help mode."
|
|||
(when (string-match (caar file-name-alist) file-name)
|
||||
(setq info-lookup-mode (cdar file-name-alist)))
|
||||
(setq file-name-alist (cdr file-name-alist)))))
|
||||
|
||||
;; If major-mode has no setups in info-lookup-alist, under any topic, then
|
||||
;; search up through derived-mode-parent to find a parent mode which does
|
||||
;; have some setups. This means that a `define-derived-mode' with no
|
||||
;; setups of its own will select its parent mode for lookups, if one of
|
||||
;; its parents has some setups. Good for example on `makefile-gmake-mode'
|
||||
;; and similar derivatives of `makefile-mode'.
|
||||
;;
|
||||
(let ((mode major-mode)) ;; Look for `mode' with some setups.
|
||||
(while (and mode (not info-lookup-mode))
|
||||
(dolist (topic-cell info-lookup-alist) ;; Usually only two topics here.
|
||||
(if (info-lookup->mode-value (car topic-cell) mode)
|
||||
(setq info-lookup-mode mode)))
|
||||
(setq mode (get mode 'derived-mode-parent))))
|
||||
|
||||
(or info-lookup-mode (setq info-lookup-mode major-mode)))
|
||||
|
||||
(defun info-lookup-change-mode (topic)
|
||||
|
|
|
|||
|
|
@ -58,6 +58,19 @@
|
|||
(defvar tramp-cache-data (make-hash-table :test 'equal)
|
||||
"Hash table for remote files properties.")
|
||||
|
||||
;;;###tramp-autoload
|
||||
(defcustom tramp-connection-properties nil
|
||||
"List of static connection properties.
|
||||
Every entry has the form (REGEXP PROPERTY VALUE). The regexp
|
||||
matches remote file names. It can be nil. PROPERTY is a string,
|
||||
and VALUE the corresponding value. They are used, if there is no
|
||||
matching entry in for PROPERTY in `tramp-cache-data'."
|
||||
:group 'tramp
|
||||
:version "24.4"
|
||||
:type '(repeat (list (choice :tag "File Name regexp" regexp (const nil))
|
||||
(choice :tag " Property" string)
|
||||
(choice :tag " Value" sexp))))
|
||||
|
||||
(defcustom tramp-persistency-file-name
|
||||
(cond
|
||||
;; GNU Emacs.
|
||||
|
|
@ -204,9 +217,27 @@ If the value is not set for the connection, returns DEFAULT."
|
|||
(setq key (copy-sequence key))
|
||||
(aset key 3 nil))
|
||||
(let* ((hash (gethash key tramp-cache-data))
|
||||
(value (if (hash-table-p hash)
|
||||
(gethash property hash default)
|
||||
default)))
|
||||
(value
|
||||
(catch 'result
|
||||
(or
|
||||
;; Check for dynamic properties.
|
||||
(and
|
||||
(hash-table-p hash)
|
||||
(maphash
|
||||
(lambda (x y) (when (equal x property) (throw 'result y)))
|
||||
hash))
|
||||
;; Check for static properties.
|
||||
(and
|
||||
(vectorp key)
|
||||
(dolist (elt tramp-connection-properties)
|
||||
(when (and (string-match
|
||||
(or (nth 0 elt) "")
|
||||
(tramp-make-tramp-file-name
|
||||
(aref key 0) (aref key 1) (aref key 2) nil))
|
||||
(string-equal (or (nth 1 elt) "") (or property "")))
|
||||
(throw 'result (nth 2 elt)))))
|
||||
;; The default value.
|
||||
default))))
|
||||
(tramp-message key 7 "%s %s" property value)
|
||||
value))
|
||||
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@
|
|||
(require 'format-spec)
|
||||
(require 'shell)
|
||||
|
||||
(require 'trampver)
|
||||
(require 'tramp-loaddefs)
|
||||
|
||||
;; As long as password.el is not part of (X)Emacs, it shouldn't be
|
||||
|
|
|
|||
|
|
@ -512,6 +512,7 @@ as given in your `~/.profile'."
|
|||
(const :tag "Private Directories" tramp-own-remote-path)
|
||||
(string :tag "Directory"))))
|
||||
|
||||
;;;###tramp-autoload
|
||||
(defcustom tramp-remote-process-environment
|
||||
`("HISTFILE=$HOME/.tramp_history" "HISTSIZE=1" "LC_ALL=C"
|
||||
,(format "TERM=%s" tramp-terminal-type)
|
||||
|
|
|
|||
|
|
@ -585,27 +585,32 @@ of `history-length', which see.")
|
|||
When PROMPT doesn't end with a colon and space, it adds a final \": \".
|
||||
If DEFAULTS is non-nil, it displays the first default in the prompt.
|
||||
|
||||
Non-nil optional arg DEFAULTS is a string or a list of strings that
|
||||
are prepended to a list of standard default values, which include the
|
||||
string at point, the last isearch regexp, the last isearch string, and
|
||||
the last replacement regexp.
|
||||
Optional arg DEFAULTS is a string or a list of strings that are
|
||||
prepended to a list of standard default values, which include the
|
||||
tag at point, the last isearch regexp, the last isearch string,
|
||||
and the last replacement regexp.
|
||||
|
||||
Non-nil HISTORY is a symbol to use for the history list.
|
||||
If HISTORY is nil, `regexp-history' is used."
|
||||
(let* ((default (if (consp defaults) (car defaults) defaults))
|
||||
(defaults
|
||||
(let* ((defaults
|
||||
(append
|
||||
(if (listp defaults) defaults (list defaults))
|
||||
(list (regexp-quote
|
||||
(or (funcall (or find-tag-default-function
|
||||
(list
|
||||
;; Regexp for tag at point.
|
||||
(let* ((tagf (or find-tag-default-function
|
||||
(get major-mode 'find-tag-default-function)
|
||||
'find-tag-default))
|
||||
""))
|
||||
(tag (funcall tagf)))
|
||||
(cond ((not tag) "")
|
||||
((eq tagf 'find-tag-default)
|
||||
(format "\\_<%s\\_>" (regexp-quote tag)))
|
||||
(t (regexp-quote tag))))
|
||||
(car regexp-search-ring)
|
||||
(regexp-quote (or (car search-ring) ""))
|
||||
(car (symbol-value
|
||||
query-replace-from-history-variable)))))
|
||||
(defaults (delete-dups (delq nil (delete "" defaults))))
|
||||
(default (car defaults))
|
||||
;; Do not automatically add default to the history for empty input.
|
||||
(history-add-new-input nil)
|
||||
(input (read-from-minibuffer
|
||||
|
|
|
|||
|
|
@ -1293,13 +1293,12 @@ display the result of expression evaluation."
|
|||
|
||||
;; We define this, rather than making `eval' interactive,
|
||||
;; for the sake of completion of names like eval-region, eval-buffer.
|
||||
(defun eval-expression (eval-expression-arg
|
||||
&optional eval-expression-insert-value)
|
||||
"Evaluate EVAL-EXPRESSION-ARG and print value in the echo area.
|
||||
(defun eval-expression (exp &optional insert-value)
|
||||
"Evaluate EXP and print value in the echo area.
|
||||
When called interactively, read an Emacs Lisp expression and
|
||||
evaluate it.
|
||||
Value is also consed on to front of the variable `values'.
|
||||
Optional argument EVAL-EXPRESSION-INSERT-VALUE non-nil (interactively,
|
||||
Optional argument INSERT-VALUE non-nil (interactively,
|
||||
with prefix argument) means insert the result into the current buffer
|
||||
instead of printing it in the echo area. Truncates long output
|
||||
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."
|
|||
current-prefix-arg))
|
||||
|
||||
(if (null eval-expression-debug-on-error)
|
||||
(push (eval eval-expression-arg lexical-binding) values)
|
||||
(push (eval exp lexical-binding) values)
|
||||
(let ((old-value (make-symbol "t")) new-value)
|
||||
;; Bind debug-on-error to something unique so that we can
|
||||
;; detect when evalled code changes it.
|
||||
(let ((debug-on-error old-value))
|
||||
(push (eval eval-expression-arg lexical-binding) values)
|
||||
(push (eval exp lexical-binding) values)
|
||||
(setq new-value debug-on-error))
|
||||
;; If evalled code has changed the value of debug-on-error,
|
||||
;; propagate that change to the global binding.
|
||||
|
|
@ -1328,8 +1327,9 @@ this command arranges for all errors to enter the debugger."
|
|||
(setq debug-on-error new-value))))
|
||||
|
||||
(let ((print-length eval-expression-print-length)
|
||||
(print-level eval-expression-print-level))
|
||||
(if eval-expression-insert-value
|
||||
(print-level eval-expression-print-level)
|
||||
(deactivate-mark))
|
||||
(if insert-value
|
||||
(with-no-warnings
|
||||
(let ((standard-output (current-buffer)))
|
||||
(prin1 (car values))))
|
||||
|
|
|
|||
|
|
@ -1,3 +1,9 @@
|
|||
2013-02-16 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* url-http.el (url-http-wait-for-headers-change-function):
|
||||
Avoid prematurely finding the end of headers when they arrive
|
||||
line-by-line. (Bug#13598)
|
||||
|
||||
2013-02-03 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
* url-cache.el (url-cache-create-filename-using-md5): Don't waste your
|
||||
|
|
|
|||
|
|
@ -1040,7 +1040,9 @@ the end of the document."
|
|||
(setq end-of-headers t
|
||||
url-http-end-of-headers 0
|
||||
old-http t)
|
||||
(when (re-search-forward "^\r*$" nil t)
|
||||
;; Blank line at end of headers.
|
||||
(when (re-search-forward "^\r?\n" nil t)
|
||||
(backward-char 1)
|
||||
;; Saw the end of the headers
|
||||
(url-http-debug "Saw end of headers... (%s)" (buffer-name))
|
||||
(setq url-http-end-of-headers (set-marker (make-marker)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,9 @@
|
|||
2013-02-16 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* inc/ms-w32.h (__STDC__): Fiddle with value only for MSVC.
|
||||
(Bug#9066)
|
||||
(chown, logb): Remove, unused.
|
||||
|
||||
2013-02-13 Juanma Barranquero <lekktu@gmail.com>
|
||||
|
||||
* config.nt: Sync with autogen/config.in.
|
||||
|
|
|
|||
|
|
@ -149,7 +149,6 @@ extern char *getenv ();
|
|||
#define chdir sys_chdir
|
||||
#undef chmod
|
||||
#define chmod sys_chmod
|
||||
#define chown sys_chown
|
||||
#undef close
|
||||
#define close sys_close
|
||||
#undef creat
|
||||
|
|
@ -222,7 +221,6 @@ typedef int pid_t;
|
|||
#define strtoll _strtoi64
|
||||
#endif
|
||||
#define isatty _isatty
|
||||
#define logb _logb
|
||||
#define _longjmp longjmp
|
||||
#define lseek _lseek
|
||||
#define popen _popen
|
||||
|
|
@ -265,8 +263,11 @@ struct timespec
|
|||
extern struct tm *gmtime_r (time_t const * restrict, struct tm * restrict);
|
||||
extern struct tm *localtime_r (time_t const * restrict, struct tm * restrict);
|
||||
|
||||
#ifdef _MSC_VER
|
||||
/* This is hacky, but is necessary to avoid warnings about macro
|
||||
redefinitions using the SDK compilers. */
|
||||
redefinitions using the MSVC compilers, since, when __STDC__ is
|
||||
undefined or zero, those compilers declare functions like fileno,
|
||||
lseek, and chdir, for which we defined macros above. */
|
||||
#ifndef __STDC__
|
||||
#define __STDC__ 1
|
||||
#define MUST_UNDEF__STDC__
|
||||
|
|
@ -278,6 +279,11 @@ extern struct tm *localtime_r (time_t const * restrict, struct tm * restrict);
|
|||
#undef __STDC__
|
||||
#undef MUST_UNDEF__STDC__
|
||||
#endif
|
||||
#else /* !_MSC_VER */
|
||||
#include <direct.h>
|
||||
#include <io.h>
|
||||
#include <stdio.h>
|
||||
#endif /* !_MSC_VER */
|
||||
|
||||
/* Defines that we need that aren't in the standard signal.h. */
|
||||
#define SIGHUP 1 /* Hang up */
|
||||
|
|
|
|||
|
|
@ -1,3 +1,20 @@
|
|||
2013-02-16 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* w32.c (sys_chown): Remove unused function.
|
||||
|
||||
* w32term.c <input_signal_count>: Declare 'volatile'
|
||||
unconditionally. (Bug#9066)
|
||||
|
||||
* w32.c (set_errno): Reset h_errno and don't set it to any other
|
||||
value. Set errno instead.
|
||||
(check_errno): Reset h_errno.
|
||||
(sys_socket, socket_to_fd, sys_bind, sys_connect)
|
||||
(sys_gethostname, sys_getservbyname, sys_getpeername)
|
||||
(sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
|
||||
(sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
|
||||
h_errno.
|
||||
(sys_gethostbyname): Set h_errno only errors detected.
|
||||
|
||||
2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
|
||||
|
|
|
|||
136
src/w32.c
136
src/w32.c
|
|
@ -3219,14 +3219,6 @@ sys_chmod (const char * path, int mode)
|
|||
return _chmod (path, mode);
|
||||
}
|
||||
|
||||
int
|
||||
sys_chown (const char *path, uid_t owner, gid_t group)
|
||||
{
|
||||
if (sys_chmod (path, S_IREAD) == -1) /* check if file exists */
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
sys_creat (const char * path, int mode)
|
||||
{
|
||||
|
|
@ -6092,35 +6084,39 @@ init_winsock (int load_now)
|
|||
|
||||
int h_errno = 0;
|
||||
|
||||
/* function to set h_errno for compatibility; map winsock error codes to
|
||||
normal system codes where they overlap (non-overlapping definitions
|
||||
are already in <sys/socket.h> */
|
||||
/* Function to map winsock error codes to errno codes for those errno
|
||||
code defined in errno.h (errno values not defined by errno.h are
|
||||
already in nt/inc/sys/socket.h). */
|
||||
static void
|
||||
set_errno (void)
|
||||
{
|
||||
if (winsock_lib == NULL)
|
||||
h_errno = EINVAL;
|
||||
else
|
||||
h_errno = pfn_WSAGetLastError ();
|
||||
int wsa_err;
|
||||
|
||||
switch (h_errno)
|
||||
h_errno = 0;
|
||||
if (winsock_lib == NULL)
|
||||
wsa_err = EINVAL;
|
||||
else
|
||||
wsa_err = pfn_WSAGetLastError ();
|
||||
|
||||
switch (wsa_err)
|
||||
{
|
||||
case WSAEACCES: h_errno = EACCES; break;
|
||||
case WSAEBADF: h_errno = EBADF; break;
|
||||
case WSAEFAULT: h_errno = EFAULT; break;
|
||||
case WSAEINTR: h_errno = EINTR; break;
|
||||
case WSAEINVAL: h_errno = EINVAL; break;
|
||||
case WSAEMFILE: h_errno = EMFILE; break;
|
||||
case WSAENAMETOOLONG: h_errno = ENAMETOOLONG; break;
|
||||
case WSAENOTEMPTY: h_errno = ENOTEMPTY; break;
|
||||
case WSAEACCES: errno = EACCES; break;
|
||||
case WSAEBADF: errno = EBADF; break;
|
||||
case WSAEFAULT: errno = EFAULT; break;
|
||||
case WSAEINTR: errno = EINTR; break;
|
||||
case WSAEINVAL: errno = EINVAL; break;
|
||||
case WSAEMFILE: errno = EMFILE; break;
|
||||
case WSAENAMETOOLONG: errno = ENAMETOOLONG; break;
|
||||
case WSAENOTEMPTY: errno = ENOTEMPTY; break;
|
||||
default: errno = wsa_err; break;
|
||||
}
|
||||
errno = h_errno;
|
||||
}
|
||||
|
||||
static void
|
||||
check_errno (void)
|
||||
{
|
||||
if (h_errno == 0 && winsock_lib != NULL)
|
||||
h_errno = 0;
|
||||
if (winsock_lib != NULL)
|
||||
pfn_WSASetLastError (0);
|
||||
}
|
||||
|
||||
|
|
@ -6232,7 +6228,7 @@ sys_socket (int af, int type, int protocol)
|
|||
|
||||
if (winsock_lib == NULL)
|
||||
{
|
||||
errno = h_errno = ENETDOWN;
|
||||
errno = ENETDOWN;
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
|
|
@ -6242,13 +6238,7 @@ sys_socket (int af, int type, int protocol)
|
|||
s = pfn_socket (af, type, protocol);
|
||||
|
||||
if (s != INVALID_SOCKET)
|
||||
{
|
||||
int retval = socket_to_fd (s);
|
||||
|
||||
if (retval == -1)
|
||||
errno = h_errno;
|
||||
return retval;
|
||||
}
|
||||
return socket_to_fd (s);
|
||||
|
||||
set_errno ();
|
||||
return -1;
|
||||
|
|
@ -6344,8 +6334,9 @@ socket_to_fd (SOCKET s)
|
|||
/* clean up */
|
||||
_close (fd);
|
||||
}
|
||||
else
|
||||
pfn_closesocket (s);
|
||||
h_errno = EMFILE;
|
||||
errno = EMFILE;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -6354,7 +6345,7 @@ sys_bind (int s, const struct sockaddr * addr, int namelen)
|
|||
{
|
||||
if (winsock_lib == NULL)
|
||||
{
|
||||
errno = h_errno = ENOTSOCK;
|
||||
errno = ENOTSOCK;
|
||||
return SOCKET_ERROR;
|
||||
}
|
||||
|
||||
|
|
@ -6366,7 +6357,7 @@ sys_bind (int s, const struct sockaddr * addr, int namelen)
|
|||
set_errno ();
|
||||
return rc;
|
||||
}
|
||||
errno = h_errno = ENOTSOCK;
|
||||
errno = ENOTSOCK;
|
||||
return SOCKET_ERROR;
|
||||
}
|
||||
|
||||
|
|
@ -6375,7 +6366,7 @@ sys_connect (int s, const struct sockaddr * name, int namelen)
|
|||
{
|
||||
if (winsock_lib == NULL)
|
||||
{
|
||||
errno = h_errno = ENOTSOCK;
|
||||
errno = ENOTSOCK;
|
||||
return SOCKET_ERROR;
|
||||
}
|
||||
|
||||
|
|
@ -6387,7 +6378,7 @@ sys_connect (int s, const struct sockaddr * name, int namelen)
|
|||
set_errno ();
|
||||
return rc;
|
||||
}
|
||||
errno = h_errno = ENOTSOCK;
|
||||
errno = ENOTSOCK;
|
||||
return SOCKET_ERROR;
|
||||
}
|
||||
|
||||
|
|
@ -6416,12 +6407,20 @@ int
|
|||
sys_gethostname (char * name, int namelen)
|
||||
{
|
||||
if (winsock_lib != NULL)
|
||||
return pfn_gethostname (name, namelen);
|
||||
{
|
||||
int retval;
|
||||
|
||||
check_errno ();
|
||||
retval = pfn_gethostname (name, namelen);
|
||||
if (retval == SOCKET_ERROR)
|
||||
set_errno ();
|
||||
return retval;
|
||||
}
|
||||
|
||||
if (namelen > MAX_COMPUTERNAME_LENGTH)
|
||||
return !GetComputerName (name, (DWORD *)&namelen);
|
||||
|
||||
errno = h_errno = EFAULT;
|
||||
errno = EFAULT;
|
||||
return SOCKET_ERROR;
|
||||
}
|
||||
|
||||
|
|
@ -6429,17 +6428,24 @@ struct hostent *
|
|||
sys_gethostbyname (const char * name)
|
||||
{
|
||||
struct hostent * host;
|
||||
int h_err = h_errno;
|
||||
|
||||
if (winsock_lib == NULL)
|
||||
{
|
||||
errno = h_errno = ENETDOWN;
|
||||
h_errno = NO_RECOVERY;
|
||||
errno = ENETDOWN;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
check_errno ();
|
||||
host = pfn_gethostbyname (name);
|
||||
if (!host)
|
||||
{
|
||||
set_errno ();
|
||||
h_errno = errno;
|
||||
}
|
||||
else
|
||||
h_errno = h_err;
|
||||
return host;
|
||||
}
|
||||
|
||||
|
|
@ -6450,7 +6456,7 @@ sys_getservbyname (const char * name, const char * proto)
|
|||
|
||||
if (winsock_lib == NULL)
|
||||
{
|
||||
errno = h_errno = ENETDOWN;
|
||||
errno = ENETDOWN;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -6466,7 +6472,7 @@ sys_getpeername (int s, struct sockaddr *addr, int * namelen)
|
|||
{
|
||||
if (winsock_lib == NULL)
|
||||
{
|
||||
errno = h_errno = ENETDOWN;
|
||||
errno = ENETDOWN;
|
||||
return SOCKET_ERROR;
|
||||
}
|
||||
|
||||
|
|
@ -6478,7 +6484,7 @@ sys_getpeername (int s, struct sockaddr *addr, int * namelen)
|
|||
set_errno ();
|
||||
return rc;
|
||||
}
|
||||
errno = h_errno = ENOTSOCK;
|
||||
errno = ENOTSOCK;
|
||||
return SOCKET_ERROR;
|
||||
}
|
||||
|
||||
|
|
@ -6487,7 +6493,7 @@ sys_shutdown (int s, int how)
|
|||
{
|
||||
if (winsock_lib == NULL)
|
||||
{
|
||||
errno = h_errno = ENETDOWN;
|
||||
errno = ENETDOWN;
|
||||
return SOCKET_ERROR;
|
||||
}
|
||||
|
||||
|
|
@ -6499,7 +6505,7 @@ sys_shutdown (int s, int how)
|
|||
set_errno ();
|
||||
return rc;
|
||||
}
|
||||
errno = h_errno = ENOTSOCK;
|
||||
errno = ENOTSOCK;
|
||||
return SOCKET_ERROR;
|
||||
}
|
||||
|
||||
|
|
@ -6508,7 +6514,7 @@ sys_setsockopt (int s, int level, int optname, const void * optval, int optlen)
|
|||
{
|
||||
if (winsock_lib == NULL)
|
||||
{
|
||||
errno = h_errno = ENETDOWN;
|
||||
errno = ENETDOWN;
|
||||
return SOCKET_ERROR;
|
||||
}
|
||||
|
||||
|
|
@ -6521,7 +6527,7 @@ sys_setsockopt (int s, int level, int optname, const void * optval, int optlen)
|
|||
set_errno ();
|
||||
return rc;
|
||||
}
|
||||
errno = h_errno = ENOTSOCK;
|
||||
errno = ENOTSOCK;
|
||||
return SOCKET_ERROR;
|
||||
}
|
||||
|
||||
|
|
@ -6530,7 +6536,7 @@ sys_listen (int s, int backlog)
|
|||
{
|
||||
if (winsock_lib == NULL)
|
||||
{
|
||||
errno = h_errno = ENETDOWN;
|
||||
errno = ENETDOWN;
|
||||
return SOCKET_ERROR;
|
||||
}
|
||||
|
||||
|
|
@ -6544,7 +6550,7 @@ sys_listen (int s, int backlog)
|
|||
fd_info[s].flags |= FILE_LISTEN;
|
||||
return rc;
|
||||
}
|
||||
errno = h_errno = ENOTSOCK;
|
||||
errno = ENOTSOCK;
|
||||
return SOCKET_ERROR;
|
||||
}
|
||||
|
||||
|
|
@ -6553,7 +6559,7 @@ sys_getsockname (int s, struct sockaddr * name, int * namelen)
|
|||
{
|
||||
if (winsock_lib == NULL)
|
||||
{
|
||||
errno = h_errno = ENETDOWN;
|
||||
errno = ENETDOWN;
|
||||
return SOCKET_ERROR;
|
||||
}
|
||||
|
||||
|
|
@ -6565,7 +6571,7 @@ sys_getsockname (int s, struct sockaddr * name, int * namelen)
|
|||
set_errno ();
|
||||
return rc;
|
||||
}
|
||||
errno = h_errno = ENOTSOCK;
|
||||
errno = ENOTSOCK;
|
||||
return SOCKET_ERROR;
|
||||
}
|
||||
|
||||
|
|
@ -6574,7 +6580,7 @@ sys_accept (int s, struct sockaddr * addr, int * addrlen)
|
|||
{
|
||||
if (winsock_lib == NULL)
|
||||
{
|
||||
errno = h_errno = ENETDOWN;
|
||||
errno = ENETDOWN;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -6586,11 +6592,7 @@ sys_accept (int s, struct sockaddr * addr, int * addrlen)
|
|||
if (t == INVALID_SOCKET)
|
||||
set_errno ();
|
||||
else
|
||||
{
|
||||
fd = socket_to_fd (t);
|
||||
if (fd < 0)
|
||||
errno = h_errno; /* socket_to_fd sets h_errno */
|
||||
}
|
||||
|
||||
if (fd >= 0)
|
||||
{
|
||||
|
|
@ -6599,7 +6601,7 @@ sys_accept (int s, struct sockaddr * addr, int * addrlen)
|
|||
}
|
||||
return fd;
|
||||
}
|
||||
errno = h_errno = ENOTSOCK;
|
||||
errno = ENOTSOCK;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -6609,7 +6611,7 @@ sys_recvfrom (int s, char * buf, int len, int flags,
|
|||
{
|
||||
if (winsock_lib == NULL)
|
||||
{
|
||||
errno = h_errno = ENETDOWN;
|
||||
errno = ENETDOWN;
|
||||
return SOCKET_ERROR;
|
||||
}
|
||||
|
||||
|
|
@ -6621,7 +6623,7 @@ sys_recvfrom (int s, char * buf, int len, int flags,
|
|||
set_errno ();
|
||||
return rc;
|
||||
}
|
||||
errno = h_errno = ENOTSOCK;
|
||||
errno = ENOTSOCK;
|
||||
return SOCKET_ERROR;
|
||||
}
|
||||
|
||||
|
|
@ -6631,7 +6633,7 @@ sys_sendto (int s, const char * buf, int len, int flags,
|
|||
{
|
||||
if (winsock_lib == NULL)
|
||||
{
|
||||
errno = h_errno = ENETDOWN;
|
||||
errno = ENETDOWN;
|
||||
return SOCKET_ERROR;
|
||||
}
|
||||
|
||||
|
|
@ -6643,7 +6645,7 @@ sys_sendto (int s, const char * buf, int len, int flags,
|
|||
set_errno ();
|
||||
return rc;
|
||||
}
|
||||
errno = h_errno = ENOTSOCK;
|
||||
errno = ENOTSOCK;
|
||||
return SOCKET_ERROR;
|
||||
}
|
||||
|
||||
|
|
@ -6654,7 +6656,7 @@ fcntl (int s, int cmd, int options)
|
|||
{
|
||||
if (winsock_lib == NULL)
|
||||
{
|
||||
errno = h_errno = ENETDOWN;
|
||||
errno = ENETDOWN;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -6673,11 +6675,11 @@ fcntl (int s, int cmd, int options)
|
|||
}
|
||||
else
|
||||
{
|
||||
h_errno = EINVAL;
|
||||
errno = EINVAL;
|
||||
return SOCKET_ERROR;
|
||||
}
|
||||
}
|
||||
errno = h_errno = ENOTSOCK;
|
||||
errno = ENOTSOCK;
|
||||
return SOCKET_ERROR;
|
||||
}
|
||||
|
||||
|
|
@ -7108,7 +7110,7 @@ sys_read (int fd, char * buffer, unsigned int count)
|
|||
pfn_ioctlsocket (SOCK_HANDLE (fd), FIONREAD, &waiting);
|
||||
if (waiting == 0 && nchars == 0)
|
||||
{
|
||||
h_errno = errno = EWOULDBLOCK;
|
||||
errno = EWOULDBLOCK;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -191,11 +191,7 @@ static Time last_mouse_movement_time;
|
|||
|
||||
/* Incremented by w32_read_socket whenever it really tries to read
|
||||
events. */
|
||||
#ifdef __STDC__
|
||||
static int volatile input_signal_count;
|
||||
#else
|
||||
static int input_signal_count;
|
||||
#endif
|
||||
|
||||
#ifdef CYGWIN
|
||||
int w32_message_fd = -1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue