diff options
| author | Glenn Morris | 2018-09-10 13:12:38 -0700 |
|---|---|---|
| committer | Glenn Morris | 2018-09-10 13:12:38 -0700 |
| commit | 0407733ef3d4e8e133e91917097dbc9bcc688b47 (patch) | |
| tree | 9223757d1d54460b3ca0e7867636072a51cd55f2 /src | |
| parent | 6e050694f247671e67c1eabace36cf9792ab4451 (diff) | |
| parent | 7efcdf7b3e70f0334caa328cbb5b05a4e30099bd (diff) | |
| download | emacs-0407733ef3d4e8e133e91917097dbc9bcc688b47.tar.gz emacs-0407733ef3d4e8e133e91917097dbc9bcc688b47.zip | |
Merge from origin/emacs-26
7efcdf7 (origin/emacs-26) Clarify completion text in the ELisp manual
30b0b0e Fix handling of abbreviated control command in gdb-mi.el
5cf282d Clarify documentation of functions reading character events
96281c5 Record :version for built-in variables while dumping
82160cf * src/process.c (connect_network_socket): Fix memory leak. (...
6c616e4 * Makefile.in (appdatadir): Use the non-obsolete location "me...
9618e16 Better fix for bug#32550
30d94e4 Fix Bug#32550
57bcdc7 Don't call XGetGeometry for frames without outer X window (Bu...
82fc6b6 * lisp/calculator.el: Fix doc typo.
ddc7c64 Standardize calc bug reporting instructions
Conflicts:
lisp/cus-start.el
Diffstat (limited to 'src')
| -rw-r--r-- | src/keymap.c | 17 | ||||
| -rw-r--r-- | src/lread.c | 20 | ||||
| -rw-r--r-- | src/process.c | 18 | ||||
| -rw-r--r-- | src/xfns.c | 2 |
4 files changed, 36 insertions, 21 deletions
diff --git a/src/keymap.c b/src/keymap.c index 79dce15a812..e405ed8c827 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -2216,10 +2216,12 @@ push_key_description (EMACS_INT ch, char *p) | |||
| 2216 | 2216 | ||
| 2217 | DEFUN ("single-key-description", Fsingle_key_description, | 2217 | DEFUN ("single-key-description", Fsingle_key_description, |
| 2218 | Ssingle_key_description, 1, 2, 0, | 2218 | Ssingle_key_description, 1, 2, 0, |
| 2219 | doc: /* Return a pretty description of command character KEY. | 2219 | doc: /* Return a pretty description of a character event KEY. |
| 2220 | Control characters turn into C-whatever, etc. | 2220 | Control characters turn into C-whatever, etc. |
| 2221 | Optional argument NO-ANGLES non-nil means don't put angle brackets | 2221 | Optional argument NO-ANGLES non-nil means don't put angle brackets |
| 2222 | around function keys and event symbols. */) | 2222 | around function keys and event symbols. |
| 2223 | |||
| 2224 | See `text-char-description' for describing character codes. */) | ||
| 2223 | (Lisp_Object key, Lisp_Object no_angles) | 2225 | (Lisp_Object key, Lisp_Object no_angles) |
| 2224 | { | 2226 | { |
| 2225 | USE_SAFE_ALLOCA; | 2227 | USE_SAFE_ALLOCA; |
| @@ -2293,11 +2295,12 @@ push_text_char_description (register unsigned int c, register char *p) | |||
| 2293 | /* This function cannot GC. */ | 2295 | /* This function cannot GC. */ |
| 2294 | 2296 | ||
| 2295 | DEFUN ("text-char-description", Ftext_char_description, Stext_char_description, 1, 1, 0, | 2297 | DEFUN ("text-char-description", Ftext_char_description, Stext_char_description, 1, 1, 0, |
| 2296 | doc: /* Return a pretty description of file-character CHARACTER. | 2298 | doc: /* Return the description of CHARACTER in standard Emacs notation. |
| 2297 | Control characters turn into "^char", etc. This differs from | 2299 | CHARACTER must be a valid character code that passes the `characterp' test. |
| 2298 | `single-key-description' which turns them into "C-char". | 2300 | Control characters turn into "^char", the 2**7 bit is treated as Meta, etc. |
| 2299 | Also, this function recognizes the 2**7 bit as the Meta character, | 2301 | This differs from `single-key-description' which accepts character events, |
| 2300 | whereas `single-key-description' uses the 2**27 bit for Meta. | 2302 | and thus doesn't enforce the `characterp' condition, turns control |
| 2303 | characters into "C-char", and uses the 2**27 bit for Meta. | ||
| 2301 | See Info node `(elisp)Describing Characters' for examples. */) | 2304 | See Info node `(elisp)Describing Characters' for examples. */) |
| 2302 | (Lisp_Object character) | 2305 | (Lisp_Object character) |
| 2303 | { | 2306 | { |
diff --git a/src/lread.c b/src/lread.c index e43929a8c6a..73e38d89954 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -741,10 +741,14 @@ read_filtered_event (bool no_switch_frame, bool ascii_required, | |||
| 741 | } | 741 | } |
| 742 | 742 | ||
| 743 | DEFUN ("read-char", Fread_char, Sread_char, 0, 3, 0, | 743 | DEFUN ("read-char", Fread_char, Sread_char, 0, 3, 0, |
| 744 | doc: /* Read a character from the command input (keyboard or macro). | 744 | doc: /* Read a character event from the command input (keyboard or macro). |
| 745 | It is returned as a number. | 745 | It is returned as a number. |
| 746 | If the character has modifiers, they are resolved and reflected to the | 746 | If the event has modifiers, they are resolved and reflected in the |
| 747 | character code if possible (e.g. C-SPC -> 0). | 747 | returned character code if possible (e.g. C-SPC yields 0 and C-a yields 97). |
| 748 | If some of the modifiers cannot be reflected in the character code, the | ||
| 749 | returned value will include those modifiers, and will not be a valid | ||
| 750 | character code: it will fail the `characterp' test. Use `event-basic-type' | ||
| 751 | to recover the character code with the modifiers removed. | ||
| 748 | 752 | ||
| 749 | If the user generates an event which is not a character (i.e. a mouse | 753 | If the user generates an event which is not a character (i.e. a mouse |
| 750 | click or function key event), `read-char' signals an error. As an | 754 | click or function key event), `read-char' signals an error. As an |
| @@ -791,10 +795,14 @@ floating-point value. */) | |||
| 791 | } | 795 | } |
| 792 | 796 | ||
| 793 | DEFUN ("read-char-exclusive", Fread_char_exclusive, Sread_char_exclusive, 0, 3, 0, | 797 | DEFUN ("read-char-exclusive", Fread_char_exclusive, Sread_char_exclusive, 0, 3, 0, |
| 794 | doc: /* Read a character from the command input (keyboard or macro). | 798 | doc: /* Read a character event from the command input (keyboard or macro). |
| 795 | It is returned as a number. Non-character events are ignored. | 799 | It is returned as a number. Non-character events are ignored. |
| 796 | If the character has modifiers, they are resolved and reflected to the | 800 | If the event has modifiers, they are resolved and reflected in the |
| 797 | character code if possible (e.g. C-SPC -> 0). | 801 | returned character code if possible (e.g. C-SPC yields 0 and C-a yields 97). |
| 802 | If some of the modifiers cannot be reflected in the character code, the | ||
| 803 | returned value will include those modifiers, and will not be a valid | ||
| 804 | character code: it will fail the `characterp' test. Use `event-basic-type' | ||
| 805 | to recover the character code with the modifiers removed. | ||
| 798 | 806 | ||
| 799 | If the optional argument PROMPT is non-nil, display that as a prompt. | 807 | If the optional argument PROMPT is non-nil, display that as a prompt. |
| 800 | If the optional argument INHERIT-INPUT-METHOD is non-nil and some | 808 | If the optional argument INHERIT-INPUT-METHOD is non-nil and some |
diff --git a/src/process.c b/src/process.c index ebaaf33e57f..4d96e469767 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -3331,11 +3331,9 @@ static void | |||
| 3331 | connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos, | 3331 | connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos, |
| 3332 | Lisp_Object use_external_socket_p) | 3332 | Lisp_Object use_external_socket_p) |
| 3333 | { | 3333 | { |
| 3334 | ptrdiff_t count = SPECPDL_INDEX (); | ||
| 3335 | int s = -1, outch, inch; | 3334 | int s = -1, outch, inch; |
| 3336 | int xerrno = 0; | 3335 | int xerrno = 0; |
| 3337 | int family; | 3336 | int family; |
| 3338 | struct sockaddr *sa = NULL; | ||
| 3339 | int ret; | 3337 | int ret; |
| 3340 | ptrdiff_t addrlen UNINIT; | 3338 | ptrdiff_t addrlen UNINIT; |
| 3341 | struct Lisp_Process *p = XPROCESS (proc); | 3339 | struct Lisp_Process *p = XPROCESS (proc); |
| @@ -3354,6 +3352,11 @@ connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos, | |||
| 3354 | /* Do this in case we never enter the while-loop below. */ | 3352 | /* Do this in case we never enter the while-loop below. */ |
| 3355 | s = -1; | 3353 | s = -1; |
| 3356 | 3354 | ||
| 3355 | struct sockaddr *sa = NULL; | ||
| 3356 | ptrdiff_t count = SPECPDL_INDEX (); | ||
| 3357 | record_unwind_protect_nothing (); | ||
| 3358 | ptrdiff_t count1 = SPECPDL_INDEX (); | ||
| 3359 | |||
| 3357 | while (!NILP (addrinfos)) | 3360 | while (!NILP (addrinfos)) |
| 3358 | { | 3361 | { |
| 3359 | Lisp_Object addrinfo = XCAR (addrinfos); | 3362 | Lisp_Object addrinfo = XCAR (addrinfos); |
| @@ -3366,9 +3369,8 @@ connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos, | |||
| 3366 | #endif | 3369 | #endif |
| 3367 | 3370 | ||
| 3368 | addrlen = get_lisp_to_sockaddr_size (ip_address, &family); | 3371 | addrlen = get_lisp_to_sockaddr_size (ip_address, &family); |
| 3369 | if (sa) | 3372 | sa = xrealloc (sa, addrlen); |
| 3370 | free (sa); | 3373 | set_unwind_protect_ptr (count, xfree, sa); |
| 3371 | sa = xmalloc (addrlen); | ||
| 3372 | conv_lisp_to_sockaddr (family, ip_address, sa, addrlen); | 3374 | conv_lisp_to_sockaddr (family, ip_address, sa, addrlen); |
| 3373 | 3375 | ||
| 3374 | s = socket_to_use; | 3376 | s = socket_to_use; |
| @@ -3530,7 +3532,7 @@ connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos, | |||
| 3530 | #endif /* !WINDOWSNT */ | 3532 | #endif /* !WINDOWSNT */ |
| 3531 | 3533 | ||
| 3532 | /* Discard the unwind protect closing S. */ | 3534 | /* Discard the unwind protect closing S. */ |
| 3533 | specpdl_ptr = specpdl + count; | 3535 | specpdl_ptr = specpdl + count1; |
| 3534 | emacs_close (s); | 3536 | emacs_close (s); |
| 3535 | s = -1; | 3537 | s = -1; |
| 3536 | if (0 <= socket_to_use) | 3538 | if (0 <= socket_to_use) |
| @@ -3601,6 +3603,7 @@ connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos, | |||
| 3601 | Lisp_Object data = get_file_errno_data (err, contact, xerrno); | 3603 | Lisp_Object data = get_file_errno_data (err, contact, xerrno); |
| 3602 | 3604 | ||
| 3603 | pset_status (p, list2 (Fcar (data), Fcdr (data))); | 3605 | pset_status (p, list2 (Fcar (data), Fcdr (data))); |
| 3606 | unbind_to (count, Qnil); | ||
| 3604 | return; | 3607 | return; |
| 3605 | } | 3608 | } |
| 3606 | 3609 | ||
| @@ -3620,7 +3623,7 @@ connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos, | |||
| 3620 | p->outfd = outch; | 3623 | p->outfd = outch; |
| 3621 | 3624 | ||
| 3622 | /* Discard the unwind protect for closing S, if any. */ | 3625 | /* Discard the unwind protect for closing S, if any. */ |
| 3623 | specpdl_ptr = specpdl + count; | 3626 | specpdl_ptr = specpdl + count1; |
| 3624 | 3627 | ||
| 3625 | if (p->is_server && p->socktype != SOCK_DGRAM) | 3628 | if (p->is_server && p->socktype != SOCK_DGRAM) |
| 3626 | pset_status (p, Qlisten); | 3629 | pset_status (p, Qlisten); |
| @@ -3681,6 +3684,7 @@ connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos, | |||
| 3681 | } | 3684 | } |
| 3682 | #endif | 3685 | #endif |
| 3683 | 3686 | ||
| 3687 | unbind_to (count, Qnil); | ||
| 3684 | } | 3688 | } |
| 3685 | 3689 | ||
| 3686 | /* Create a network stream/datagram client/server process. Treated | 3690 | /* Create a network stream/datagram client/server process. Treated |
diff --git a/src/xfns.c b/src/xfns.c index e19fcff9b05..c4cf59d9b27 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -5075,7 +5075,7 @@ frame_geometry (Lisp_Object frame, Lisp_Object attribute) | |||
| 5075 | int menu_bar_height = 0, menu_bar_width = 0; | 5075 | int menu_bar_height = 0, menu_bar_width = 0; |
| 5076 | int tool_bar_height = 0, tool_bar_width = 0; | 5076 | int tool_bar_height = 0, tool_bar_width = 0; |
| 5077 | 5077 | ||
| 5078 | if (FRAME_INITIAL_P (f) || !FRAME_X_P (f)) | 5078 | if (FRAME_INITIAL_P (f) || !FRAME_X_P (f) || !FRAME_OUTER_WINDOW (f)) |
| 5079 | return Qnil; | 5079 | return Qnil; |
| 5080 | 5080 | ||
| 5081 | block_input (); | 5081 | block_input (); |