diff options
| author | Lars Ingebrigtsen | 2016-02-03 12:43:24 +1100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2016-02-03 12:43:24 +1100 |
| commit | 894e21df1e1a38244ad0c8179adf4b632b25a592 (patch) | |
| tree | f866b91e463d951061fc331249700740e179603b /src | |
| parent | eb597d40950d0b8f126641bf458af28fcab150d5 (diff) | |
| download | emacs-894e21df1e1a38244ad0c8179adf4b632b25a592.tar.gz emacs-894e21df1e1a38244ad0c8179adf4b632b25a592.zip | |
Doc fixes and refactorings based on comments from Eli Zaretskii
* doc/lispref/processes.texi (Network Processes): Clarify the
meaning of :tls-parameters.
* lisp/net/gnutls.el (open-gnutls-stream): Clarify :nowait.
* lisp/net/gnutls.el (gnutls-boot-parameters): Factor out into
own function.
(gnutls-negotiate): Use it.
(open-gnutls-stream): Ditto.
* src/eval.c (vformat_string): Refactor out the printing bits
from verror.
(verror): Use it.
* src/gnutls.c (boot_error): Mark failed processes with the
real error message.
* src/lisp.h: Declare vformat_string.
Diffstat (limited to 'src')
| -rw-r--r-- | src/eval.c | 15 | ||||
| -rw-r--r-- | src/gnutls.c | 2 | ||||
| -rw-r--r-- | src/lisp.h | 2 | ||||
| -rw-r--r-- | src/process.c | 6 |
4 files changed, 18 insertions, 7 deletions
diff --git a/src/eval.c b/src/eval.c index 6c912bc4762..c01dd09199f 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -1751,9 +1751,9 @@ find_handler_clause (Lisp_Object handlers, Lisp_Object conditions) | |||
| 1751 | } | 1751 | } |
| 1752 | 1752 | ||
| 1753 | 1753 | ||
| 1754 | /* Dump an error message; called like vprintf. */ | 1754 | /* Format and return a string; called like vprintf. */ |
| 1755 | void | 1755 | Lisp_Object |
| 1756 | verror (const char *m, va_list ap) | 1756 | vformat_string (const char *m, va_list ap) |
| 1757 | { | 1757 | { |
| 1758 | char buf[4000]; | 1758 | char buf[4000]; |
| 1759 | ptrdiff_t size = sizeof buf; | 1759 | ptrdiff_t size = sizeof buf; |
| @@ -1767,7 +1767,14 @@ verror (const char *m, va_list ap) | |||
| 1767 | if (buffer != buf) | 1767 | if (buffer != buf) |
| 1768 | xfree (buffer); | 1768 | xfree (buffer); |
| 1769 | 1769 | ||
| 1770 | xsignal1 (Qerror, string); | 1770 | return string; |
| 1771 | } | ||
| 1772 | |||
| 1773 | /* Dump an error message; called like vprintf. */ | ||
| 1774 | void | ||
| 1775 | verror (const char *m, va_list ap) | ||
| 1776 | { | ||
| 1777 | xsignal1 (Qerror, vformat_string (m, ap)); | ||
| 1771 | } | 1778 | } |
| 1772 | 1779 | ||
| 1773 | 1780 | ||
diff --git a/src/gnutls.c b/src/gnutls.c index fb3c3c22777..948a0c56f14 100644 --- a/src/gnutls.c +++ b/src/gnutls.c | |||
| @@ -1174,7 +1174,7 @@ boot_error (struct Lisp_Process *p, const char *m, ...) | |||
| 1174 | va_list ap; | 1174 | va_list ap; |
| 1175 | va_start (ap, m); | 1175 | va_start (ap, m); |
| 1176 | if (p->is_non_blocking_client) | 1176 | if (p->is_non_blocking_client) |
| 1177 | pset_status (p, Qfailed); | 1177 | pset_status (p, list2 (Qfailed, vformat_string (m, ap))); |
| 1178 | else | 1178 | else |
| 1179 | verror (m, ap); | 1179 | verror (m, ap); |
| 1180 | } | 1180 | } |
diff --git a/src/lisp.h b/src/lisp.h index 02b8078a9fd..e87f47510f8 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -3908,6 +3908,8 @@ extern Lisp_Object unbind_to (ptrdiff_t, Lisp_Object); | |||
| 3908 | extern _Noreturn void error (const char *, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2); | 3908 | extern _Noreturn void error (const char *, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2); |
| 3909 | extern _Noreturn void verror (const char *, va_list) | 3909 | extern _Noreturn void verror (const char *, va_list) |
| 3910 | ATTRIBUTE_FORMAT_PRINTF (1, 0); | 3910 | ATTRIBUTE_FORMAT_PRINTF (1, 0); |
| 3911 | extern Lisp_Object vformat_string (const char *, va_list) | ||
| 3912 | ATTRIBUTE_FORMAT_PRINTF (1, 0); | ||
| 3911 | extern void un_autoload (Lisp_Object); | 3913 | extern void un_autoload (Lisp_Object); |
| 3912 | extern Lisp_Object call_debugger (Lisp_Object arg); | 3914 | extern Lisp_Object call_debugger (Lisp_Object arg); |
| 3913 | extern void *near_C_stack_top (void); | 3915 | extern void *near_C_stack_top (void); |
diff --git a/src/process.c b/src/process.c index e4dd123574e..0c8fc43dd12 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -3454,8 +3454,10 @@ and MESSAGE is a string. | |||
| 3454 | :plist PLIST -- Install PLIST as the new process's initial plist. | 3454 | :plist PLIST -- Install PLIST as the new process's initial plist. |
| 3455 | 3455 | ||
| 3456 | :tls-parameters LIST -- is a list that should be supplied if you're | 3456 | :tls-parameters LIST -- is a list that should be supplied if you're |
| 3457 | opening a TLS connection. The first element is the TLS type, and the | 3457 | opening a TLS connection. The first element is the TLS type (either |
| 3458 | remaining elements should be a keyword list accepted by gnutls-boot. | 3458 | `gnutls-x509pki' or `gnutls-anon'), and the remaining elements should |
| 3459 | be a keyword list accepted by gnutls-boot (as returned by | ||
| 3460 | `gnutls-boot-parameters'). | ||
| 3459 | 3461 | ||
| 3460 | :server QLEN -- if QLEN is non-nil, create a server process for the | 3462 | :server QLEN -- if QLEN is non-nil, create a server process for the |
| 3461 | specified FAMILY, SERVICE, and connection type (stream or datagram). | 3463 | specified FAMILY, SERVICE, and connection type (stream or datagram). |