Skip to content
This repository has been archived by the owner on Apr 18, 2022. It is now read-only.

Commit

Permalink
Merge from origin/emacs-26
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rgmorris committed Sep 10, 2018
2 parents 6e05069 + 7efcdf7 commit 0407733
Show file tree
Hide file tree
Showing 16 changed files with 127 additions and 109 deletions.
2 changes: 1 addition & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ x_default_search_path=@x_default_search_path@
desktopdir=$(datarootdir)/applications

# 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.
# The system value (typically /usr/lib/systemd/user) can be
Expand Down
64 changes: 42 additions & 22 deletions doc/lispref/commands.texi
Original file line number Diff line number Diff line change
Expand Up @@ -1076,9 +1076,10 @@ the current Emacs session. If a symbol has not yet been so used,
@cindex keyboard events

There are two kinds of input you can get from the keyboard: ordinary
keys, and function keys. Ordinary keys correspond to characters; the
events they generate are represented in Lisp as characters. The event
type of a character event is the character itself (an integer); see
keys, and function keys. Ordinary keys correspond to (possibly
modified) characters; the events they generate are represented in Lisp
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}.

@cindex modifier bits (of input character)
Expand Down Expand Up @@ -1123,7 +1124,7 @@ for @kbd{%} plus
2**26
@end ifnottex
(assuming the terminal supports non-@acronym{ASCII}
control characters).
control characters), i.e.@: with the 27th bit set.

@item shift
The
Expand All @@ -1133,8 +1134,8 @@ The
@ifnottex
2**25
@end ifnottex
bit in the character code indicates an @acronym{ASCII} control
character typed with the shift key held down.
bit (the 26th bit) in the character event code indicates an
@acronym{ASCII} control character typed with the shift key held down.

For letters, the basic code itself indicates upper versus lower case;
for digits and punctuation, the shift key selects an entirely different
Expand All @@ -1146,7 +1147,7 @@ character with a different basic code. In order to keep within the
@ifnottex
2**25
@end ifnottex
bit for those characters.
bit for those character events.

However, @acronym{ASCII} provides no way to distinguish @kbd{C-A} from
@kbd{C-a}, so Emacs uses the
Expand All @@ -1167,7 +1168,7 @@ The
@ifnottex
2**24
@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.

@item super
Expand All @@ -1178,7 +1179,7 @@ The
@ifnottex
2**23
@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.

@item alt
Expand All @@ -1189,9 +1190,9 @@ The
@ifnottex
2**22
@end ifnottex
bit in the character code indicates a character typed with the alt key
held down. (The key labeled @key{Alt} on most keyboards is actually
treated as the meta key, not this.)
bit in the character event code indicates a character typed with the
alt key held down. (The key labeled @key{Alt} on most keyboards is
actually treated as the meta key, not this.)
@end table

It is best to avoid mentioning specific bit numbers in your program.
Expand Down Expand Up @@ -1949,6 +1950,10 @@ Here are some examples:

The modifiers list for a click event explicitly contains @code{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

@defun event-basic-type event
Expand Down Expand Up @@ -2545,17 +2550,31 @@ right-arrow function key:
@end defun

@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
function key event), @code{read-char} signals an error. The arguments
work as in @code{read-event}.

In the first example, 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.
If the event has modifiers, Emacs attempts to resolve them and return
the code of the corresponding character. For example, if the user
types @kbd{C-a}, the function returns 1, which is the @acronym{ASCII}
code of the @samp{C-a} character. If some of the modifiers cannot be
reflected in the character code, @code{read-char} leaves the
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
@group
Expand All @@ -2577,10 +2596,11 @@ the echo area.
@end defun

@defun read-char-exclusive &optional prompt inherit-input-method seconds
This function reads and returns a character of command input. If the
user generates an event which is not a character,
This function reads and returns a character input event. If the
user generates an event which is not a character event,
@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

None of the above functions suppress quitting.
Expand Down
14 changes: 7 additions & 7 deletions doc/lispref/help.texi
Original file line number Diff line number Diff line change
Expand Up @@ -556,13 +556,13 @@ brackets.

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

@smallexample
@group
Expand Down
9 changes: 3 additions & 6 deletions doc/lispref/minibuf.texi
Original file line number Diff line number Diff line change
Expand Up @@ -1776,12 +1776,9 @@ flag may be one of the following values.
@table @code
@item nil
This specifies a @code{try-completion} operation. The function should
return @code{t} if the specified string is a unique and exact match;
if there is more than one match, it should return the common substring
of all matches (if the string is an exact match for one completion
alternative but also matches other longer alternatives, the return
value is the string); if there are no matches, it should return
@code{nil}.
return @code{nil} if there are no matches; it should return @code{t}
if the specified string is a unique and exact match; and it should
return the longest common prefix substring of all matches otherwise.

@item t
This specifies an @code{all-completions} operation. The function
Expand Down
15 changes: 4 additions & 11 deletions doc/misc/calc.texi
Original file line number Diff line number Diff line change
Expand Up @@ -35724,19 +35724,12 @@ The default value of @code{calc-gregorian-switch} is @code{nil}.
@appendix Reporting Bugs

@noindent
If you find a bug in Calc, send e-mail to Jay Belanger,

@example
jay.p.belanger@@gmail.com
@end example

@noindent
There is an automatic command @kbd{M-x report-calc-bug} which helps
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
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
send your mail. Make sure your subject line indicates that you are
reporting a Calc bug; this command sends mail to the maintainer's
regular mailbox.
reporting a Calc bug.

If you have suggestions for additional features for Calc, please send
them. Some have dared to suggest that Calc is already top-heavy with
Expand All @@ -35745,7 +35738,7 @@ them right in.

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
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.

The latest version of Calc is available from Savannah, in the Emacs
Expand Down
16 changes: 3 additions & 13 deletions lisp/calc/calc-misc.el
Original file line number Diff line number Diff line change
Expand Up @@ -943,19 +943,9 @@ loaded and the keystroke automatically re-typed."
;;; Bug reporting

;;;###autoload
(defun report-calc-bug ()
"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
(defalias 'calc-report-bug 'report-calc-bug)
(define-obsolete-function-alias 'report-calc-bug 'report-emacs-bug "26.2")
;;;###autoload
(define-obsolete-function-alias 'calc-report-bug 'report-emacs-bug "26.2")

(provide 'calc-misc)

Expand Down
4 changes: 2 additions & 2 deletions lisp/calc/calc.el
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,8 @@ to be identified as that note."
"Face used to show the selected portion of a formula."
:group 'calc)

(defvar calc-bug-address "emacs-[email protected]"
"Address of the maintainer of Calc, for use by `report-calc-bug'.")
(define-obsolete-variable-alias 'calc-bug-address 'report-emacs-bug-address
"26.2")

(defvar calc-scan-for-dels t
"If t, scan keymaps to find all DEL-like keys.
Expand Down
2 changes: 1 addition & 1 deletion lisp/calculator.el
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ Here are the editing keys:
These operators are pre-defined:
* `+' `-' `*' `/' the common binary operators
* `\\' `%' integer division and reminder
* `\\' `%' integer division and remainder
* `_' `;' postfix unary negation and reciprocal
* `^' `L' binary operators for x^y and log(x) in base y
* `Q' `!' unary square root and factorial
Expand Down
3 changes: 2 additions & 1 deletion lisp/cus-start.el
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,8 @@ since it could result in memory overflow and make Emacs crash."
(put symbol 'risky-local-variable (cadr prop)))
(if (setq prop (memq :set rest))
(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.
(unless after-init-time
;; Note this is the _only_ initialize property we handle.
Expand All @@ -731,7 +733,6 @@ since it could result in memory overflow and make Emacs crash."
(custom-add-to-group group symbol 'custom-variable))
;; Set the type.
(put symbol 'custom-type type)
(if version (put symbol 'custom-version version))
(while rest
(setq prop (car rest)
propval (cadr rest)
Expand Down
41 changes: 22 additions & 19 deletions lisp/net/tramp.el
Original file line number Diff line number Diff line change
Expand Up @@ -1954,7 +1954,6 @@ For definition of that list see `tramp-set-completion-function'."
;; The method related defaults.
(cdr (assoc method tramp-completion-function-alist))))


;;; Fontification of `read-file-name':

(defvar tramp-rfn-eshadow-overlay)
Expand All @@ -1964,11 +1963,11 @@ For definition of that list see `tramp-set-completion-function'."
"Set up a minibuffer for `file-name-shadow-mode'.
Adds another overlay hiding filename parts according to Tramp's
special handling of `substitute-in-file-name'."
(when (symbol-value 'minibuffer-completing-file-name)
(when minibuffer-completing-file-name
(setq tramp-rfn-eshadow-overlay
(make-overlay (minibuffer-prompt-end) (minibuffer-prompt-end)))
;; Copy rfn-eshadow-overlay properties.
(let ((props (overlay-properties (symbol-value 'rfn-eshadow-overlay))))
(let ((props (overlay-properties rfn-eshadow-overlay)))
(while props
;; The `field' property prevents correct minibuffer
;; completion; we exclude it.
Expand All @@ -1986,33 +1985,39 @@ special handling of `substitute-in-file-name'."
(defun tramp-rfn-eshadow-update-overlay-regexp ()
(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 ()
"Update `rfn-eshadow-overlay' to cover shadowed part of minibuffer input.
This is intended to be used as a minibuffer `post-command-hook' for
`file-name-shadow-mode'; the minibuffer should have already
been set up by `rfn-eshadow-setup-minibuffer'."
;; In remote files name, there is a shadowing just for the local part.
(ignore-errors
(let ((end (or (overlay-end (symbol-value 'rfn-eshadow-overlay))
(let ((end (or (overlay-end rfn-eshadow-overlay)
(minibuffer-prompt-end)))
;; We do not want to send any remote command.
(non-essential t))
(when
(tramp-tramp-file-p
(buffer-substring-no-properties end (point-max)))
(save-excursion
(save-restriction
(narrow-to-region
(1+ (or (string-match
(tramp-rfn-eshadow-update-overlay-regexp)
(buffer-string) end)
end))
(point-max))
(let ((rfn-eshadow-overlay tramp-rfn-eshadow-overlay)
(rfn-eshadow-update-overlay-hook nil)
file-name-handler-alist)
(move-overlay rfn-eshadow-overlay (point-max) (point-max))
(rfn-eshadow-update-overlay))))))))
(save-restriction
(narrow-to-region
(1+ (or (string-match
(tramp-rfn-eshadow-update-overlay-regexp)
(buffer-string) end)
end))
(point-max))
(let ((rfn-eshadow-overlay tramp-rfn-eshadow-overlay)
(rfn-eshadow-update-overlay-hook nil)
file-name-handler-alist)
(move-overlay rfn-eshadow-overlay (point-max) (point-max))
(rfn-eshadow-update-overlay)))))))

(add-hook 'rfn-eshadow-update-overlay-hook
'tramp-rfn-eshadow-update-overlay)
Expand Down Expand Up @@ -4666,8 +4671,6 @@ Only works for Bourne-like shells."
;; strange when doing zerop, we should kill the process and start
;; 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
;; actually using sshfs. But when I launch a command I would like
;; to get it executed on the remote machine where the files really
Expand Down
5 changes: 3 additions & 2 deletions lisp/progmodes/gdb-mi.el
Original file line number Diff line number Diff line change
Expand Up @@ -1780,9 +1780,10 @@ static char *magick[] = {
(defvar gdb-control-commands-regexp
(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
"\\|while-stepping\\|stepping\\|ws\\|actions"
"\\|while-stepping\\|stepp\\(i\\(ng?\\)?\\)?\\|ws\\|actions"
"\\)\\([[:blank:]]+\\([^[:blank:]]*\\)\\)?$")
"Regexp matching GDB commands that enter a recursive reading loop.
As long as GDB is in the recursive reading loop, it does not expect
Expand Down
4 changes: 1 addition & 3 deletions lisp/rfn-eshadow.el
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,7 @@ system, `file-name-shadow-properties' is used instead."

;; An overlay covering the shadowed part of the filename (local to the
;; minibuffer).
(defvar rfn-eshadow-overlay)
(make-variable-buffer-local 'rfn-eshadow-overlay)

(defvar-local rfn-eshadow-overlay nil)

;;; Hook functions

Expand Down
Loading

0 comments on commit 0407733

Please sign in to comment.