1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-04 11:00:45 -08:00

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
This commit is contained in:
Glenn Morris 2018-09-10 13:12:38 -07:00
commit 0407733ef3
16 changed files with 126 additions and 108 deletions

View file

@ -192,7 +192,7 @@ x_default_search_path=@x_default_search_path@
desktopdir=$(datarootdir)/applications desktopdir=$(datarootdir)/applications
# Where the etc/emacs.appdata.xml file is to be installed. # Where the etc/emacs.appdata.xml file is to be installed.
appdatadir=$(datarootdir)/appdata appdatadir=$(datarootdir)/metainfo
# Where the etc/emacs.service file is to be installed. # Where the etc/emacs.service file is to be installed.
# The system value (typically /usr/lib/systemd/user) can be # The system value (typically /usr/lib/systemd/user) can be

View file

@ -1076,9 +1076,10 @@ the current Emacs session. If a symbol has not yet been so used,
@cindex keyboard events @cindex keyboard events
There are two kinds of input you can get from the keyboard: ordinary There are two kinds of input you can get from the keyboard: ordinary
keys, and function keys. Ordinary keys correspond to characters; the keys, and function keys. Ordinary keys correspond to (possibly
events they generate are represented in Lisp as characters. The event modified) characters; the events they generate are represented in Lisp
type of a character event is the character itself (an integer); see as characters. The event type of a character event is the character
itself (an integer), which might have some modifier bits set; see
@ref{Classifying Events}. @ref{Classifying Events}.
@cindex modifier bits (of input character) @cindex modifier bits (of input character)
@ -1123,7 +1124,7 @@ for @kbd{%} plus
2**26 2**26
@end ifnottex @end ifnottex
(assuming the terminal supports non-@acronym{ASCII} (assuming the terminal supports non-@acronym{ASCII}
control characters). control characters), i.e.@: with the 27th bit set.
@item shift @item shift
The The
@ -1133,8 +1134,8 @@ The
@ifnottex @ifnottex
2**25 2**25
@end ifnottex @end ifnottex
bit in the character code indicates an @acronym{ASCII} control bit (the 26th bit) in the character event code indicates an
character typed with the shift key held down. @acronym{ASCII} control character typed with the shift key held down.
For letters, the basic code itself indicates upper versus lower case; For letters, the basic code itself indicates upper versus lower case;
for digits and punctuation, the shift key selects an entirely different for digits and punctuation, the shift key selects an entirely different
@ -1146,7 +1147,7 @@ character with a different basic code. In order to keep within the
@ifnottex @ifnottex
2**25 2**25
@end ifnottex @end ifnottex
bit for those characters. bit for those character events.
However, @acronym{ASCII} provides no way to distinguish @kbd{C-A} from However, @acronym{ASCII} provides no way to distinguish @kbd{C-A} from
@kbd{C-a}, so Emacs uses the @kbd{C-a}, so Emacs uses the
@ -1167,7 +1168,7 @@ The
@ifnottex @ifnottex
2**24 2**24
@end ifnottex @end ifnottex
bit in the character code indicates a character bit in the character event code indicates a character
typed with the hyper key held down. typed with the hyper key held down.
@item super @item super
@ -1178,7 +1179,7 @@ The
@ifnottex @ifnottex
2**23 2**23
@end ifnottex @end ifnottex
bit in the character code indicates a character bit in the character event code indicates a character
typed with the super key held down. typed with the super key held down.
@item alt @item alt
@ -1189,9 +1190,9 @@ The
@ifnottex @ifnottex
2**22 2**22
@end ifnottex @end ifnottex
bit in the character code indicates a character typed with the alt key bit in the character event code indicates a character typed with the
held down. (The key labeled @key{Alt} on most keyboards is actually alt key held down. (The key labeled @key{Alt} on most keyboards is
treated as the meta key, not this.) actually treated as the meta key, not this.)
@end table @end table
It is best to avoid mentioning specific bit numbers in your program. It is best to avoid mentioning specific bit numbers in your program.
@ -1949,6 +1950,10 @@ Here are some examples:
The modifiers list for a click event explicitly contains @code{click}, The modifiers list for a click event explicitly contains @code{click},
but the event symbol name itself does not contain @samp{click}. but the event symbol name itself does not contain @samp{click}.
Similarly, the modifiers list for an @acronym{ASCII} control
character, such as @samp{C-a}, contains @code{control}, even though
reading such an event via @code{read-char} will return the value 1
with the control modifier bit removed.
@end defun @end defun
@defun event-basic-type event @defun event-basic-type event
@ -2545,17 +2550,31 @@ right-arrow function key:
@end defun @end defun
@defun read-char &optional prompt inherit-input-method seconds @defun read-char &optional prompt inherit-input-method seconds
This function reads and returns a character of command input. If the This function reads and returns a character input event. If the
user generates an event which is not a character (i.e., a mouse click or user generates an event which is not a character (i.e., a mouse click or
function key event), @code{read-char} signals an error. The arguments function key event), @code{read-char} signals an error. The arguments
work as in @code{read-event}. work as in @code{read-event}.
In the first example, the user types the character @kbd{1} (@acronym{ASCII} If the event has modifiers, Emacs attempts to resolve them and return
code 49). The second example shows a keyboard macro definition that the code of the corresponding character. For example, if the user
calls @code{read-char} from the minibuffer using @code{eval-expression}. types @kbd{C-a}, the function returns 1, which is the @acronym{ASCII}
@code{read-char} reads the keyboard macro's very next character, which code of the @samp{C-a} character. If some of the modifiers cannot be
is @kbd{1}. Then @code{eval-expression} displays its return value in reflected in the character code, @code{read-char} leaves the
the echo area. unresolved modifier bits set in the returned event. For example, if
the user types @kbd{C-M-a}, the function returns 134217729, 8000001 in
hex, i.e.@: @samp{C-a} with the Meta modifier bit set. This value is
not a valid character code: it fails the @code{characterp} test
(@pxref{Character Codes}). Use @code{event-basic-type}
(@pxref{Classifying Events}) to recover the character code with the
modifier bits removed; use @code{event-modifiers} to test for
modifiers in the character event returned by @code{read-char}.
In the first example below, the user types the character @kbd{1}
(@acronym{ASCII} code 49). The second example shows a keyboard macro
definition that calls @code{read-char} from the minibuffer using
@code{eval-expression}. @code{read-char} reads the keyboard macro's
very next character, which is @kbd{1}. Then @code{eval-expression}
displays its return value in the echo area.
@example @example
@group @group
@ -2577,10 +2596,11 @@ the echo area.
@end defun @end defun
@defun read-char-exclusive &optional prompt inherit-input-method seconds @defun read-char-exclusive &optional prompt inherit-input-method seconds
This function reads and returns a character of command input. If the This function reads and returns a character input event. If the
user generates an event which is not a character, user generates an event which is not a character event,
@code{read-char-exclusive} ignores it and reads another event, until it @code{read-char-exclusive} ignores it and reads another event, until it
gets a character. The arguments work as in @code{read-event}. gets a character. The arguments work as in @code{read-event}. The
returned value may include modifier bits, as with @code{read-char}.
@end defun @end defun
None of the above functions suppress quitting. None of the above functions suppress quitting.

View file

@ -556,13 +556,13 @@ brackets.
@defun text-char-description character @defun text-char-description character
This function returns a string describing @var{character} in the This function returns a string describing @var{character} in the
standard Emacs notation for characters that appear in text---like standard Emacs notation for characters that can appear in text---like
@code{single-key-description}, except that control characters are @code{single-key-description}, except that the argument must be a
represented with a leading caret (which is how control characters in valid character code that passes a @code{characterp} test
Emacs buffers are usually displayed). Another difference is that (@pxref{Character Codes}), control characters are represented with a
@code{text-char-description} recognizes the 2**7 bit as the Meta leading caret (which is how control characters in Emacs buffers are
character, whereas @code{single-key-description} uses the 2**27 bit usually displayed), and the 2**7 bit is treated as the Meta bit,
for Meta. whereas @code{single-key-description} uses the 2**27 bit for Meta.
@smallexample @smallexample
@group @group

View file

@ -1776,12 +1776,9 @@ flag may be one of the following values.
@table @code @table @code
@item nil @item nil
This specifies a @code{try-completion} operation. The function should This specifies a @code{try-completion} operation. The function should
return @code{t} if the specified string is a unique and exact match; return @code{nil} if there are no matches; it should return @code{t}
if there is more than one match, it should return the common substring if the specified string is a unique and exact match; and it should
of all matches (if the string is an exact match for one completion return the longest common prefix substring of all matches otherwise.
alternative but also matches other longer alternatives, the return
value is the string); if there are no matches, it should return
@code{nil}.
@item t @item t
This specifies an @code{all-completions} operation. The function This specifies an @code{all-completions} operation. The function

View file

@ -35724,19 +35724,12 @@ The default value of @code{calc-gregorian-switch} is @code{nil}.
@appendix Reporting Bugs @appendix Reporting Bugs
@noindent @noindent
If you find a bug in Calc, send e-mail to Jay Belanger, If you find a bug in Calc, send e-mail to @email{bug-gnu-emacs@@gnu.org}.
There is an automatic command @kbd{M-x report-emacs-bug} which helps
@example
jay.p.belanger@@gmail.com
@end example
@noindent
There is an automatic command @kbd{M-x report-calc-bug} which helps
you to report bugs. This command prompts you for a brief subject you to report bugs. This command prompts you for a brief subject
line, then leaves you in a mail editing buffer. Type @kbd{C-c C-c} to line, then leaves you in a mail editing buffer. Type @kbd{C-c C-c} to
send your mail. Make sure your subject line indicates that you are send your mail. Make sure your subject line indicates that you are
reporting a Calc bug; this command sends mail to the maintainer's reporting a Calc bug.
regular mailbox.
If you have suggestions for additional features for Calc, please send If you have suggestions for additional features for Calc, please send
them. Some have dared to suggest that Calc is already top-heavy with them. Some have dared to suggest that Calc is already top-heavy with
@ -35745,7 +35738,7 @@ them right in.
At the front of the source file, @file{calc.el}, is a list of ideas for At the front of the source file, @file{calc.el}, is a list of ideas for
future work. If any enthusiastic souls wish to take it upon themselves future work. If any enthusiastic souls wish to take it upon themselves
to work on these, please send a message (using @kbd{M-x report-calc-bug}) to work on these, please send a message (using @kbd{M-x report-emacs-bug})
so any efforts can be coordinated. so any efforts can be coordinated.
The latest version of Calc is available from Savannah, in the Emacs The latest version of Calc is available from Savannah, in the Emacs

View file

@ -943,19 +943,9 @@ loaded and the keystroke automatically re-typed."
;;; Bug reporting ;;; Bug reporting
;;;###autoload ;;;###autoload
(defun report-calc-bug () (define-obsolete-function-alias 'report-calc-bug 'report-emacs-bug "26.2")
"Report a bug in Calc, the GNU Emacs calculator.
Prompts for bug subject. Leaves you in a mail buffer."
(interactive)
(let ((reporter-prompt-for-summary-p t))
(reporter-submit-bug-report calc-bug-address "Calc"
nil nil nil
"Please describe exactly what actions triggered the bug and the
precise symptoms of the bug. If possible, include a backtrace by
doing `\\[toggle-debug-on-error]', then reproducing the bug.
" )))
;;;###autoload ;;;###autoload
(defalias 'calc-report-bug 'report-calc-bug) (define-obsolete-function-alias 'calc-report-bug 'report-emacs-bug "26.2")
(provide 'calc-misc) (provide 'calc-misc)

View file

@ -486,8 +486,8 @@ to be identified as that note."
"Face used to show the selected portion of a formula." "Face used to show the selected portion of a formula."
:group 'calc) :group 'calc)
(defvar calc-bug-address "emacs-devel@gnu.org" (define-obsolete-variable-alias 'calc-bug-address 'report-emacs-bug-address
"Address of the maintainer of Calc, for use by `report-calc-bug'.") "26.2")
(defvar calc-scan-for-dels t (defvar calc-scan-for-dels t
"If t, scan keymaps to find all DEL-like keys. "If t, scan keymaps to find all DEL-like keys.

View file

@ -627,7 +627,7 @@ Here are the editing keys:
These operators are pre-defined: These operators are pre-defined:
* `+' `-' `*' `/' the common binary operators * `+' `-' `*' `/' the common binary operators
* `\\' `%' integer division and reminder * `\\' `%' integer division and remainder
* `_' `;' postfix unary negation and reciprocal * `_' `;' postfix unary negation and reciprocal
* `^' `L' binary operators for x^y and log(x) in base y * `^' `L' binary operators for x^y and log(x) in base y
* `Q' `!' unary square root and factorial * `Q' `!' unary square root and factorial

View file

@ -711,6 +711,8 @@ since it could result in memory overflow and make Emacs crash."
(put symbol 'risky-local-variable (cadr prop))) (put symbol 'risky-local-variable (cadr prop)))
(if (setq prop (memq :set rest)) (if (setq prop (memq :set rest))
(put symbol 'custom-set (cadr prop))) (put symbol 'custom-set (cadr prop)))
;; This is used by describe-variable.
(if version (put symbol 'custom-version version))
;; Don't re-add to custom-delayed-init-variables post-startup. ;; Don't re-add to custom-delayed-init-variables post-startup.
(unless after-init-time (unless after-init-time
;; Note this is the _only_ initialize property we handle. ;; Note this is the _only_ initialize property we handle.
@ -731,7 +733,6 @@ since it could result in memory overflow and make Emacs crash."
(custom-add-to-group group symbol 'custom-variable)) (custom-add-to-group group symbol 'custom-variable))
;; Set the type. ;; Set the type.
(put symbol 'custom-type type) (put symbol 'custom-type type)
(if version (put symbol 'custom-version version))
(while rest (while rest
(setq prop (car rest) (setq prop (car rest)
propval (cadr rest) propval (cadr rest)

View file

@ -1954,7 +1954,6 @@ For definition of that list see `tramp-set-completion-function'."
;; The method related defaults. ;; The method related defaults.
(cdr (assoc method tramp-completion-function-alist)))) (cdr (assoc method tramp-completion-function-alist))))
;;; Fontification of `read-file-name': ;;; Fontification of `read-file-name':
(defvar tramp-rfn-eshadow-overlay) (defvar tramp-rfn-eshadow-overlay)
@ -1964,11 +1963,11 @@ For definition of that list see `tramp-set-completion-function'."
"Set up a minibuffer for `file-name-shadow-mode'. "Set up a minibuffer for `file-name-shadow-mode'.
Adds another overlay hiding filename parts according to Tramp's Adds another overlay hiding filename parts according to Tramp's
special handling of `substitute-in-file-name'." special handling of `substitute-in-file-name'."
(when (symbol-value 'minibuffer-completing-file-name) (when minibuffer-completing-file-name
(setq tramp-rfn-eshadow-overlay (setq tramp-rfn-eshadow-overlay
(make-overlay (minibuffer-prompt-end) (minibuffer-prompt-end))) (make-overlay (minibuffer-prompt-end) (minibuffer-prompt-end)))
;; Copy rfn-eshadow-overlay properties. ;; Copy rfn-eshadow-overlay properties.
(let ((props (overlay-properties (symbol-value 'rfn-eshadow-overlay)))) (let ((props (overlay-properties rfn-eshadow-overlay)))
(while props (while props
;; The `field' property prevents correct minibuffer ;; The `field' property prevents correct minibuffer
;; completion; we exclude it. ;; completion; we exclude it.
@ -1986,6 +1985,13 @@ special handling of `substitute-in-file-name'."
(defun tramp-rfn-eshadow-update-overlay-regexp () (defun tramp-rfn-eshadow-update-overlay-regexp ()
(format "[^%s/~]*\\(/\\|~\\)" tramp-postfix-host-format)) (format "[^%s/~]*\\(/\\|~\\)" tramp-postfix-host-format))
;; Package rfn-eshadow is preloaded in Emacs, but for some reason,
;; it only did (defvar rfn-eshadow-overlay) without giving it a global
;; value, so it was only declared as dynamically-scoped within the
;; rfn-eshadow.el file. This is now fixed in Emacs>26.1 but we still need
;; this defvar here for older releases.
(defvar rfn-eshadow-overlay)
(defun tramp-rfn-eshadow-update-overlay () (defun tramp-rfn-eshadow-update-overlay ()
"Update `rfn-eshadow-overlay' to cover shadowed part of minibuffer input. "Update `rfn-eshadow-overlay' to cover shadowed part of minibuffer input.
This is intended to be used as a minibuffer `post-command-hook' for This is intended to be used as a minibuffer `post-command-hook' for
@ -1993,26 +1999,25 @@ This is intended to be used as a minibuffer `post-command-hook' for
been set up by `rfn-eshadow-setup-minibuffer'." been set up by `rfn-eshadow-setup-minibuffer'."
;; In remote files name, there is a shadowing just for the local part. ;; In remote files name, there is a shadowing just for the local part.
(ignore-errors (ignore-errors
(let ((end (or (overlay-end (symbol-value 'rfn-eshadow-overlay)) (let ((end (or (overlay-end rfn-eshadow-overlay)
(minibuffer-prompt-end))) (minibuffer-prompt-end)))
;; We do not want to send any remote command. ;; We do not want to send any remote command.
(non-essential t)) (non-essential t))
(when (when
(tramp-tramp-file-p (tramp-tramp-file-p
(buffer-substring-no-properties end (point-max))) (buffer-substring-no-properties end (point-max)))
(save-excursion (save-restriction
(save-restriction (narrow-to-region
(narrow-to-region (1+ (or (string-match
(1+ (or (string-match (tramp-rfn-eshadow-update-overlay-regexp)
(tramp-rfn-eshadow-update-overlay-regexp) (buffer-string) end)
(buffer-string) end) end))
end)) (point-max))
(point-max)) (let ((rfn-eshadow-overlay tramp-rfn-eshadow-overlay)
(let ((rfn-eshadow-overlay tramp-rfn-eshadow-overlay) (rfn-eshadow-update-overlay-hook nil)
(rfn-eshadow-update-overlay-hook nil) file-name-handler-alist)
file-name-handler-alist) (move-overlay rfn-eshadow-overlay (point-max) (point-max))
(move-overlay rfn-eshadow-overlay (point-max) (point-max)) (rfn-eshadow-update-overlay)))))))
(rfn-eshadow-update-overlay))))))))
(add-hook 'rfn-eshadow-update-overlay-hook (add-hook 'rfn-eshadow-update-overlay-hook
'tramp-rfn-eshadow-update-overlay) 'tramp-rfn-eshadow-update-overlay)
@ -4666,8 +4671,6 @@ Only works for Bourne-like shells."
;; strange when doing zerop, we should kill the process and start ;; strange when doing zerop, we should kill the process and start
;; again. (Greg Stark) ;; again. (Greg Stark)
;; ;;
;; * Make shadowfile.el grok Tramp filenames. (Bug#4526, Bug#4846)
;;
;; * I was wondering if it would be possible to use tramp even if I'm ;; * I was wondering if it would be possible to use tramp even if I'm
;; actually using sshfs. But when I launch a command I would like ;; actually using sshfs. But when I launch a command I would like
;; to get it executed on the remote machine where the files really ;; to get it executed on the remote machine where the files really

View file

@ -1780,9 +1780,10 @@ static char *magick[] = {
(defvar gdb-control-commands-regexp (defvar gdb-control-commands-regexp
(concat (concat
"^\\(" "^\\("
"commands\\|if\\|while\\|define\\|document\\|" "comm\\(a\\(n\\(ds?\\)?\\)?\\)?\\|if\\|while"
"\\|def\\(i\\(ne?\\)?\\)?\\|doc\\(u\\(m\\(e\\(nt?\\)?\\)?\\)?\\)?\\|"
gdb-python-guile-commands-regexp gdb-python-guile-commands-regexp
"\\|while-stepping\\|stepping\\|ws\\|actions" "\\|while-stepping\\|stepp\\(i\\(ng?\\)?\\)?\\|ws\\|actions"
"\\)\\([[:blank:]]+\\([^[:blank:]]*\\)\\)?$") "\\)\\([[:blank:]]+\\([^[:blank:]]*\\)\\)?$")
"Regexp matching GDB commands that enter a recursive reading loop. "Regexp matching GDB commands that enter a recursive reading loop.
As long as GDB is in the recursive reading loop, it does not expect As long as GDB is in the recursive reading loop, it does not expect

View file

@ -132,9 +132,7 @@ system, `file-name-shadow-properties' is used instead."
;; An overlay covering the shadowed part of the filename (local to the ;; An overlay covering the shadowed part of the filename (local to the
;; minibuffer). ;; minibuffer).
(defvar rfn-eshadow-overlay) (defvar-local rfn-eshadow-overlay nil)
(make-variable-buffer-local 'rfn-eshadow-overlay)
;;; Hook functions ;;; Hook functions

View file

@ -2216,10 +2216,12 @@ push_key_description (EMACS_INT ch, char *p)
DEFUN ("single-key-description", Fsingle_key_description, DEFUN ("single-key-description", Fsingle_key_description,
Ssingle_key_description, 1, 2, 0, Ssingle_key_description, 1, 2, 0,
doc: /* Return a pretty description of command character KEY. doc: /* Return a pretty description of a character event KEY.
Control characters turn into C-whatever, etc. Control characters turn into C-whatever, etc.
Optional argument NO-ANGLES non-nil means don't put angle brackets Optional argument NO-ANGLES non-nil means don't put angle brackets
around function keys and event symbols. */) around function keys and event symbols.
See `text-char-description' for describing character codes. */)
(Lisp_Object key, Lisp_Object no_angles) (Lisp_Object key, Lisp_Object no_angles)
{ {
USE_SAFE_ALLOCA; USE_SAFE_ALLOCA;
@ -2293,11 +2295,12 @@ push_text_char_description (register unsigned int c, register char *p)
/* This function cannot GC. */ /* This function cannot GC. */
DEFUN ("text-char-description", Ftext_char_description, Stext_char_description, 1, 1, 0, DEFUN ("text-char-description", Ftext_char_description, Stext_char_description, 1, 1, 0,
doc: /* Return a pretty description of file-character CHARACTER. doc: /* Return the description of CHARACTER in standard Emacs notation.
Control characters turn into "^char", etc. This differs from CHARACTER must be a valid character code that passes the `characterp' test.
`single-key-description' which turns them into "C-char". Control characters turn into "^char", the 2**7 bit is treated as Meta, etc.
Also, this function recognizes the 2**7 bit as the Meta character, This differs from `single-key-description' which accepts character events,
whereas `single-key-description' uses the 2**27 bit for Meta. and thus doesn't enforce the `characterp' condition, turns control
characters into "C-char", and uses the 2**27 bit for Meta.
See Info node `(elisp)Describing Characters' for examples. */) See Info node `(elisp)Describing Characters' for examples. */)
(Lisp_Object character) (Lisp_Object character)
{ {

View file

@ -741,10 +741,14 @@ read_filtered_event (bool no_switch_frame, bool ascii_required,
} }
DEFUN ("read-char", Fread_char, Sread_char, 0, 3, 0, DEFUN ("read-char", Fread_char, Sread_char, 0, 3, 0,
doc: /* Read a character from the command input (keyboard or macro). doc: /* Read a character event from the command input (keyboard or macro).
It is returned as a number. It is returned as a number.
If the character has modifiers, they are resolved and reflected to the If the event has modifiers, they are resolved and reflected in the
character code if possible (e.g. C-SPC -> 0). returned character code if possible (e.g. C-SPC yields 0 and C-a yields 97).
If some of the modifiers cannot be reflected in the character code, the
returned value will include those modifiers, and will not be a valid
character code: it will fail the `characterp' test. Use `event-basic-type'
to recover the character code with the modifiers removed.
If the user generates an event which is not a character (i.e. a mouse If the user generates an event which is not a character (i.e. a mouse
click or function key event), `read-char' signals an error. As an click or function key event), `read-char' signals an error. As an
@ -791,10 +795,14 @@ floating-point value. */)
} }
DEFUN ("read-char-exclusive", Fread_char_exclusive, Sread_char_exclusive, 0, 3, 0, DEFUN ("read-char-exclusive", Fread_char_exclusive, Sread_char_exclusive, 0, 3, 0,
doc: /* Read a character from the command input (keyboard or macro). doc: /* Read a character event from the command input (keyboard or macro).
It is returned as a number. Non-character events are ignored. It is returned as a number. Non-character events are ignored.
If the character has modifiers, they are resolved and reflected to the If the event has modifiers, they are resolved and reflected in the
character code if possible (e.g. C-SPC -> 0). returned character code if possible (e.g. C-SPC yields 0 and C-a yields 97).
If some of the modifiers cannot be reflected in the character code, the
returned value will include those modifiers, and will not be a valid
character code: it will fail the `characterp' test. Use `event-basic-type'
to recover the character code with the modifiers removed.
If the optional argument PROMPT is non-nil, display that as a prompt. If the optional argument PROMPT is non-nil, display that as a prompt.
If the optional argument INHERIT-INPUT-METHOD is non-nil and some If the optional argument INHERIT-INPUT-METHOD is non-nil and some

View file

@ -3331,11 +3331,9 @@ static void
connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos, connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos,
Lisp_Object use_external_socket_p) Lisp_Object use_external_socket_p)
{ {
ptrdiff_t count = SPECPDL_INDEX ();
int s = -1, outch, inch; int s = -1, outch, inch;
int xerrno = 0; int xerrno = 0;
int family; int family;
struct sockaddr *sa = NULL;
int ret; int ret;
ptrdiff_t addrlen UNINIT; ptrdiff_t addrlen UNINIT;
struct Lisp_Process *p = XPROCESS (proc); struct Lisp_Process *p = XPROCESS (proc);
@ -3354,6 +3352,11 @@ connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos,
/* Do this in case we never enter the while-loop below. */ /* Do this in case we never enter the while-loop below. */
s = -1; s = -1;
struct sockaddr *sa = NULL;
ptrdiff_t count = SPECPDL_INDEX ();
record_unwind_protect_nothing ();
ptrdiff_t count1 = SPECPDL_INDEX ();
while (!NILP (addrinfos)) while (!NILP (addrinfos))
{ {
Lisp_Object addrinfo = XCAR (addrinfos); Lisp_Object addrinfo = XCAR (addrinfos);
@ -3366,9 +3369,8 @@ connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos,
#endif #endif
addrlen = get_lisp_to_sockaddr_size (ip_address, &family); addrlen = get_lisp_to_sockaddr_size (ip_address, &family);
if (sa) sa = xrealloc (sa, addrlen);
free (sa); set_unwind_protect_ptr (count, xfree, sa);
sa = xmalloc (addrlen);
conv_lisp_to_sockaddr (family, ip_address, sa, addrlen); conv_lisp_to_sockaddr (family, ip_address, sa, addrlen);
s = socket_to_use; s = socket_to_use;
@ -3530,7 +3532,7 @@ connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos,
#endif /* !WINDOWSNT */ #endif /* !WINDOWSNT */
/* Discard the unwind protect closing S. */ /* Discard the unwind protect closing S. */
specpdl_ptr = specpdl + count; specpdl_ptr = specpdl + count1;
emacs_close (s); emacs_close (s);
s = -1; s = -1;
if (0 <= socket_to_use) if (0 <= socket_to_use)
@ -3601,6 +3603,7 @@ connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos,
Lisp_Object data = get_file_errno_data (err, contact, xerrno); Lisp_Object data = get_file_errno_data (err, contact, xerrno);
pset_status (p, list2 (Fcar (data), Fcdr (data))); pset_status (p, list2 (Fcar (data), Fcdr (data)));
unbind_to (count, Qnil);
return; return;
} }
@ -3620,7 +3623,7 @@ connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos,
p->outfd = outch; p->outfd = outch;
/* Discard the unwind protect for closing S, if any. */ /* Discard the unwind protect for closing S, if any. */
specpdl_ptr = specpdl + count; specpdl_ptr = specpdl + count1;
if (p->is_server && p->socktype != SOCK_DGRAM) if (p->is_server && p->socktype != SOCK_DGRAM)
pset_status (p, Qlisten); pset_status (p, Qlisten);
@ -3681,6 +3684,7 @@ connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos,
} }
#endif #endif
unbind_to (count, Qnil);
} }
/* Create a network stream/datagram client/server process. Treated /* Create a network stream/datagram client/server process. Treated

View file

@ -5075,7 +5075,7 @@ frame_geometry (Lisp_Object frame, Lisp_Object attribute)
int menu_bar_height = 0, menu_bar_width = 0; int menu_bar_height = 0, menu_bar_width = 0;
int tool_bar_height = 0, tool_bar_width = 0; int tool_bar_height = 0, tool_bar_width = 0;
if (FRAME_INITIAL_P (f) || !FRAME_X_P (f)) if (FRAME_INITIAL_P (f) || !FRAME_X_P (f) || !FRAME_OUTER_WINDOW (f))
return Qnil; return Qnil;
block_input (); block_input ();