commit 126c879df42f741fe486236aea538290a8c2ed64 (HEAD, refs/remotes/origin/master) Author: Lars Ingebrigtsen Date: Tue Nov 1 20:57:28 2016 +0100 Don't segfault on timed-out TLS connections * src/process.c (finish_after_tls_connection): Check that the file descriptor is still alive before proceeding (bug#24811). Also clean up the code slightly. diff --git a/src/process.c b/src/process.c index 8cf045c..d27b57d 100644 --- a/src/process.c +++ b/src/process.c @@ -3094,19 +3094,24 @@ finish_after_tls_connection (Lisp_Object proc) build_string ("The Network Security Manager stopped the connections"))); deactivate_process (proc); } - else + else if (p->outfd < 0) { - /* If we cleared the connection wait mask before we did - the TLS setup, then we have to say that the process - is finally "open" here. */ - if (! FD_ISSET (p->outfd, &connect_wait_mask)) - { - pset_status (p, Qrun); - /* Execute the sentinel here. If we had relied on - status_notify to do it later, it will read input - from the process before calling the sentinel. */ - exec_sentinel (proc, build_string ("open\n")); - } + /* The counterparty may have closed the connection (especially + if the NSM promt above take a long time), so recheck the file + descriptor here. */ + pset_status (p, Qfailed); + deactivate_process (proc); + } + else if (! FD_ISSET (p->outfd, &connect_wait_mask)) + { + /* If we cleared the connection wait mask before we did the TLS + setup, then we have to say that the process is finally "open" + here. */ + pset_status (p, Qrun); + /* Execute the sentinel here. If we had relied on status_notify + to do it later, it will read input from the process before + calling the sentinel. */ + exec_sentinel (proc, build_string ("open\n")); } } #endif commit c3640fcc96ed80368209c73d7ac9a0f0d1833d93 Author: Eli Zaretskii Date: Tue Nov 1 18:04:07 2016 +0200 Support 'TARGETS' in clipboard selections on MS-Windows * src/w32select.c (Fw32_selection_targets): New function. * lisp/term/w32-win.el (w32--get-selection): Call 'w32-selection-targets' to obtain the list of data formats available in the clipboard. diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el index f705ec1..d8cf5ef 100644 --- a/lisp/term/w32-win.el +++ b/lisp/term/w32-win.el @@ -400,11 +400,15 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") (put 'x-selections (or type 'PRIMARY) value))) (defun w32--get-selection (&optional type data-type) - (if (and (eq type 'CLIPBOARD) - (eq data-type 'STRING)) - (with-demoted-errors "w32-get-clipboard-data:%S" - (w32-get-clipboard-data)) - (get 'x-selections (or type 'PRIMARY)))) + (cond ((and (eq type 'CLIPBOARD) + (eq data-type 'STRING)) + (with-demoted-errors "w32-get-clipboard-data:%S" + (w32-get-clipboard-data))) + ((eq data-type 'TARGETS) + (if (eq type 'CLIPBOARD) + (w32-selection-targets type) + (if (get 'x-selections (or type 'PRIMARY)) '[STRING]))) + (t (get 'x-selections (or type 'PRIMARY))))) (defun w32--selection-owner-p (selection) (and (memq selection '(nil PRIMARY SECONDARY)) diff --git a/src/w32select.c b/src/w32select.c index a38a42c..1754534 100644 --- a/src/w32select.c +++ b/src/w32select.c @@ -1052,6 +1052,113 @@ frame's display, or the first available X display. */) return Qnil; } +/* Support enumerating available clipboard selection formats. */ + +DEFUN ("w32-selection-targets", Fw32_selection_targets, Sw32_selection_targets, + 0, 2, 0, + doc: /* Return a vector of data formats available in the specified SELECTION. +SELECTION should be the name of the selection in question, typically +one of the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'. +The symbol nil is the same as `PRIMARY', and t is the same as `SECONDARY'. + +TERMINAL should be a terminal object or a frame specifying the X +server to query. If omitted or nil, that stands for the selected +frame's display, or the first available X display. + +This function currently ignores TERMINAL, and only returns non-nil +for `CLIPBOARD'. The return value is a vector of symbols, each symbol +representing a data format that is currently available in the clipboard. */) + (Lisp_Object selection, Lisp_Object terminal) +{ + /* Xlib-like names for standard Windows clipboard data formats. + They are in upper-case to mimic xselect.c. A couple of the names + were changed to be more like their X counterparts. */ + static const char *stdfmt_name[] = { + "UNDEFINED", + "STRING", + "BITMAP", + "METAFILE", + "SYMLINK", + "DIF", + "TIFF", + "OEM_STRING", + "DIB", + "PALETTE", + "PENDATA", + "RIFF", + "WAVE", + "UTF8_STRING", + "ENHMETAFILE", + "FILE_NAMES", /* DND */ + "LOCALE", /* not used */ + "DIBV5" + }; + CHECK_SYMBOL (selection); + + /* Return nil for PRIMARY and SECONDARY selections; for CLIPBOARD, check + if the clipboard currently has valid text format contents. */ + + if (EQ (selection, QCLIPBOARD)) + { + Lisp_Object val = Qnil; + + setup_config (); + + if (OpenClipboard (NULL)) + { + UINT format = 0; + + /* Count how many formats are available. We ignore the + CF_LOCALE format, and don't put it into the vector we + return, because CF_LOCALE is automatically created by + Windows for any text in the clipboard, so its presence in + the value will simply confuse. */ + int fmtcount = 0; + while ((format = EnumClipboardFormats (format))) + if (format != CF_LOCALE) + fmtcount++; + + if (fmtcount > 0) + { + int i; + + /* We generate a vector because that's what xselect.c + does in this case. */ + val = Fmake_vector (make_number (fmtcount), Qnil); + /* Note: when stepping with GDB through this code, the + loop below terminates immediately because + EnumClipboardFormats for some reason returns with + "Thread does not have a clipboard open" error. */ + for (i = 0, format = 0; + (format = EnumClipboardFormats (format)) != 0; ) + { + const char *name; + + if (format == CF_LOCALE) + continue; + else if (format < CF_MAX) + name = stdfmt_name[format]; + else + { + char fmt_name[256]; + + if (!GetClipboardFormatName (format, fmt_name, + sizeof (fmt_name))) + continue; + name = fmt_name; + } + ASET (val, i, intern (name)); + i++; + } + } + CloseClipboard (); + } + return val; + } + /* For PRIMARY and SECONDARY we cons the values in w32--get-selection. */ + return Qnil; +} + /* One-time init. Called in the un-dumped Emacs, but not in the dumped version. */ @@ -1061,6 +1168,7 @@ syms_of_w32select (void) defsubr (&Sw32_set_clipboard_data); defsubr (&Sw32_get_clipboard_data); defsubr (&Sw32_selection_exists_p); + defsubr (&Sw32_selection_targets); DEFVAR_LISP ("selection-coding-system", Vselection_coding_system, doc: /* Coding system for communicating with other programs. commit 2664eb539416bf4cf3f87578726d849ec6560a76 Author: Glenn Morris Date: Tue Nov 1 06:18:02 2016 -0400 ; Auto-commit of loaddefs files. diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index 25a9c4f..97a941b 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -6853,7 +6853,7 @@ For further details, see info node `(emacs)Saving Emacs Sessions'. \(fn &optional ARG)" t nil) -(defvar desktop-locals-to-save '(desktop-locals-to-save truncate-lines case-fold-search case-replace fill-column overwrite-mode change-log-default-name line-number-mode column-number-mode size-indication-mode buffer-file-coding-system indent-tabs-mode tab-width indicate-buffer-boundaries indicate-empty-lines show-trailing-whitespace) "\ +(defvar desktop-locals-to-save '(desktop-locals-to-save truncate-lines case-fold-search case-replace fill-column overwrite-mode change-log-default-name line-number-mode column-number-mode size-indication-mode buffer-file-coding-system buffer-display-time indent-tabs-mode tab-width indicate-buffer-boundaries indicate-empty-lines show-trailing-whitespace) "\ List of local variables to save for each buffer. The variables are saved only when they really are local. Conventional minor modes are restored automatically; they should not be listed here.") @@ -15394,6 +15394,7 @@ different regions. With numeric argument ARG, behaves like (autoload 'describe-function "help-fns" "\ Display the full documentation of FUNCTION (a symbol). +When called from lisp, FUNCTION may also be a function object. \(fn FUNCTION)" t nil) @@ -20864,6 +20865,49 @@ is modified to remove the default indication. ;;;### (autoloads nil "misc" "misc.el" (0 0 0 0)) ;;; Generated autoloads from misc.el +(autoload 'copy-from-above-command "misc" "\ +Copy characters from previous nonblank line, starting just above point. +Copy ARG characters, but not past the end of that line. +If no argument given, copy the entire rest of the line. +The characters copied are inserted in the buffer before point. + +\(fn &optional ARG)" t nil) + +(autoload 'zap-up-to-char "misc" "\ +Kill up to, but not including ARGth occurrence of CHAR. +Case is ignored if `case-fold-search' is non-nil in the current buffer. +Goes backward if ARG is negative; error if CHAR not found. +Ignores CHAR at point. + +\(fn ARG CHAR)" t nil) + +(autoload 'mark-beginning-of-buffer "misc" "\ +Set mark at the beginning of the buffer. + +\(fn)" t nil) + +(autoload 'mark-end-of-buffer "misc" "\ +Set mark at the end of the buffer. + +\(fn)" t nil) + +(autoload 'upcase-char "misc" "\ +Uppercasify ARG chars starting from point. Point doesn't move. + +\(fn ARG)" t nil) + +(autoload 'forward-to-word "misc" "\ +Move forward until encountering the beginning of a word. +With argument, do this that many times. + +\(fn ARG)" t nil) + +(autoload 'backward-to-word "misc" "\ +Move backward until encountering the end of a word. +With argument, do this that many times. + +\(fn ARG)" t nil) + (autoload 'butterfly "misc" "\ Use butterflies to flip the desired bit on the drive platter. Open hands and let the delicate wings flap once. The disturbance @@ -20887,7 +20931,7 @@ The return value is always nil. \(fn &optional LOADED-ONLY-P BUFFER)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "misc" '("list-dynamic-libraries--" "backward-to-word" "forward-to-word" "upcase-char" "mark-" "zap-up-to-char" "copy-from-above-command"))) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "misc" '("list-dynamic-libraries--"))) ;;;*** @@ -22288,7 +22332,7 @@ closing requests for requests that are used in matched pairs. ;;;### (autoloads nil "ntlm" "net/ntlm.el" (0 0 0 0)) ;;; Generated autoloads from net/ntlm.el -(push (purecopy '(ntlm 2 0 0)) package--builtin-versions) +(push (purecopy '(ntlm 2 1 0)) package--builtin-versions) (if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ntlm" '("ntlm-"))) @@ -29253,7 +29297,7 @@ Like `mail' command, but display mail buffer in another frame. ;;;### (autoloads nil "seq" "emacs-lisp/seq.el" (0 0 0 0)) ;;; Generated autoloads from emacs-lisp/seq.el -(push (purecopy '(seq 2 18)) package--builtin-versions) +(push (purecopy '(seq 2 19)) package--builtin-versions) (if (fboundp 'register-definition-prefixes) (register-definition-prefixes "seq" '("seq-"))) @@ -32262,6 +32306,14 @@ use in that buffer. ;;;;;; 0 0)) ;;; Generated autoloads from emacs-lisp/testcover.el +(autoload 'testcover-start "testcover" "\ +Uses edebug to instrument all macros and functions in FILENAME, then +changes the instrumentation from edebug to testcover--much faster, no +problems with type-ahead or post-command-hook, etc. If BYTE-COMPILE is +non-nil, byte-compiles each function after instrumenting. + +\(fn FILENAME &optional BYTE-COMPILE)" t nil) + (autoload 'testcover-this-defun "testcover" "\ Start coverage on function under point. @@ -33782,7 +33834,7 @@ Discard Tramp from loading remote files. ;;;;;; 0)) ;;; Generated autoloads from net/tramp-compat.el -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "tramp-compat" '("tramp-compat-"))) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "tramp-compat" '("tramp-"))) ;;;*** commit 0575fd95d0b92a9a0ebff8df183a449190f74dbc Author: Thomas Fitzsimmons Date: Tue Nov 1 05:00:25 2016 -0400 Fix documentation for 'eudc-options-file' * doc/misc/eudc.texi (The Server Hotlist): Update the default value of 'eudc-options-file'. diff --git a/doc/misc/eudc.texi b/doc/misc/eudc.texi index 87cfab6..1bbb108 100644 --- a/doc/misc/eudc.texi +++ b/doc/misc/eudc.texi @@ -783,12 +783,11 @@ Add the current server to the hotlist of servers @end deffn @defvar eudc-options-file -The name of a file where EUDC stores its internal variables -(the hotlist and the current server). EUDC will try to load -that file upon initialization so, if you choose a file name -different from the defaults @file{~/.eudc-options}, be sure to set this -variable to the appropriate value @emph{before} EUDC is itself -loaded. +The name of a file where EUDC stores its internal variables (the +hotlist and the current server). EUDC will try to load that file upon +initialization so, if you choose a file name different from the +defaults @file{~/.emacs.d/eudc-options}, be sure to set this variable +to the appropriate value @emph{before} EUDC is itself loaded. @end defvar @menu commit 1fef1387c387d80f8ece326621539b89a6965702 Author: Tibor Csögör Date: Tue Nov 1 04:57:53 2016 -0400 Fix documentation of 'eudc-inline-expansion-format' * doc/misc/eudc.texi (Inline Query Expansion): Fix the default value of 'eudc-inline-expansion-format'. (Bug#24840) diff --git a/doc/misc/eudc.texi b/doc/misc/eudc.texi index 53f1beb..87cfab6 100644 --- a/doc/misc/eudc.texi +++ b/doc/misc/eudc.texi @@ -733,8 +733,7 @@ upon an inline expansion request. It is a list whose first element is a string passed to @code{format}. Remaining elements are symbols corresponding to directory attribute names. The corresponding attribute values are passed as additional arguments to @code{format}. Default is -@code{("%s" email)} but you may want to consider a value like @code{("%s -<%s>" name email)} +@code{("%s %s <%s>" firstname name email)}. @end defvar @defvar eudc-multiple-match-handling-method