Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/emacs-mirror/emacs into pgtk
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuuki Harano committed Nov 12, 2019
2 parents 0319351 + 555f5f7 commit 5f4d8a2
Show file tree
Hide file tree
Showing 113 changed files with 922 additions and 644 deletions.
48 changes: 27 additions & 21 deletions doc/lispref/minibuf.texi
Original file line number Diff line number Diff line change
Expand Up @@ -2020,29 +2020,27 @@ uses keyboard input. You can force use either of the mouse or of keyboard
input by binding @code{last-nonmenu-event} to a suitable value around
the call.

Strictly speaking, @code{yes-or-no-p} uses the minibuffer and
@code{y-or-n-p} does not; but it seems best to describe them together.
Both @code{yes-or-no-p} and @code{y-or-n-p} use the minibuffer.

@defun y-or-n-p prompt
This function asks the user a question, expecting input in the echo
area. It returns @code{t} if the user types @kbd{y}, @code{nil} if the
user types @kbd{n}. This function also accepts @key{SPC} to mean yes
and @key{DEL} to mean no. It accepts @kbd{C-]} to quit, like
@kbd{C-g}, because the question might look like a minibuffer and for
that reason the user might try to use @kbd{C-]} to get out. The answer
is a single character, with no @key{RET} needed to terminate it. Upper
and lower case are equivalent.

``Asking the question'' means printing @var{prompt} in the echo area,
This function asks the user a question, expecting input in the minibuffer.
It returns @code{t} if the user types @kbd{y}, @code{nil} if the user
types @kbd{n}. This function also accepts @key{SPC} to mean yes and
@key{DEL} to mean no. It accepts @kbd{C-]} and @kbd{C-g} to quit,
because the question uses the minibuffer and for that reason the user
might try to use @kbd{C-]} to get out. The answer is a single
character, with no @key{RET} needed to terminate it. Upper and lower
case are equivalent.

``Asking the question'' means printing @var{prompt} in the minibuffer,
followed by the string @w{@samp{(y or n) }}. If the input is not one of
the expected answers (@kbd{y}, @kbd{n}, @kbd{@key{SPC}},
@kbd{@key{DEL}}, or something that quits), the function responds
@samp{Please answer y or n.}, and repeats the request.

This function does not actually use the minibuffer, since it does not
allow editing of the answer. It actually uses the echo area (@pxref{The
Echo Area}), which uses the same screen space as the minibuffer. The
cursor moves to the echo area while the question is being asked.
This function actually uses the minibuffer, but does not allow editing
of the answer. The cursor moves to the minibuffer while the question
is being asked.

The answers and their meanings, even @samp{y} and @samp{n}, are not
hardwired, and are specified by the keymap @code{query-replace-map}
Expand All @@ -2053,10 +2051,6 @@ special responses @code{recenter}, @code{scroll-up},
@kbd{C-v}, @kbd{M-v}, @kbd{C-M-v} and @kbd{C-M-S-v} in
@code{query-replace-map}), this function performs the specified window
recentering or scrolling operation, and poses the question again.

@noindent
We show successive lines of echo area messages, but only one actually
appears on the screen at a time.
@end defun

@defun y-or-n-p-with-timeout prompt seconds default
Expand All @@ -2072,7 +2066,7 @@ minibuffer. It returns @code{t} if the user enters @samp{yes},
@code{nil} if the user types @samp{no}. The user must type @key{RET} to
finalize the response. Upper and lower case are equivalent.

@code{yes-or-no-p} starts by displaying @var{prompt} in the echo area,
@code{yes-or-no-p} starts by displaying @var{prompt} in the minibuffer,
followed by @w{@samp{(yes or no) }}. The user must type one of the
expected responses; otherwise, the function responds @samp{Please answer
yes or no.}, waits about two seconds and repeats the request.
Expand Down Expand Up @@ -2259,6 +2253,18 @@ Here is an example of using this function:
@end lisp
@end defun

If you need a function to read a character like @code{read-char} or
@code{read-char-choice} (@pxref{Reading One Event}) but using the
minibuffer, use @code{read-char-from-minibuffer}.

@defun read-char-from-minibuffer prompt &optional chars history
This function uses the minibuffer to read and return a single
character. Optionally, it ignores any input that is not a member of
@var{chars}, a list of accepted characters. The @var{history}
argument specifies the history list symbol to use; if is omitted or
@code{nil}, it doesn't use the history.
@end defun

@node Reading a Password
@section Reading a Password
@cindex passwords, reading
Expand Down
4 changes: 2 additions & 2 deletions doc/lispref/modes.texi
Original file line number Diff line number Diff line change
Expand Up @@ -2738,11 +2738,11 @@ This function should make sure the region between @var{beg} and
accessible portion. Calls the function specified by
@code{font-lock-ensure-function}.

@item font-lock-refontify
@item font-lock-debug-fontify
This is a convenience command meant to be used when developing font
locking for a mode, and should not be called from Lisp code. It
recomputes all the relevant variables and then calls
@code{font-lock-ensure} on the entire buffer.
@code{font-lock-fontify-region} on the entire buffer.
@end ftable

There are several variables that control how Font Lock mode highlights
Expand Down
8 changes: 6 additions & 2 deletions doc/lispref/numbers.texi
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,12 @@ considered to be valid as a character. @xref{Character Codes}.
Floating-point numbers are useful for representing numbers that are
not integral. The range of floating-point numbers is
the same as the range of the C data type @code{double} on the machine
you are using. On all computers currently supported by Emacs, this is
double-precision @acronym{IEEE} floating point.
you are using. On all computers supported by Emacs, this is
@acronym{IEEE} binary64 floating point format, which is standardized by
@url{https://standards.ieee.org/standard/754-2019.html,,IEEE Std 754-2019}
and is discussed further in David Goldberg's paper
``@url{https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html,
What Every Computer Scientist Should Know About Floating-Point Arithmetic}''.

The read syntax for floating-point numbers requires either a decimal
point, an exponent, or both. Optional signs (@samp{+} or @samp{-})
Expand Down
41 changes: 33 additions & 8 deletions doc/misc/cc-mode.texi
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ expression, to some statements, or perhaps to whole functions, the
syntactic recognition can be wrong. @ccmode{} manages to figure it
out correctly most of the time, though.

Some macros, when invoked, ''have their own semicolon''. To get the
Some macros, when invoked, ``have their own semicolon''. To get the
next line indented correctly, rather than as a continuation line,
@xref{Macros with ;}.

Expand Down Expand Up @@ -1149,7 +1149,9 @@ find useful while writing new code or editing old code:
@table @asis
@item comment style
This specifies whether comment commands (such as @kbd{M-;}) insert
block comments or line comments.
block comments or line comments@footnote{You can emphasize
non-default style comments in your code by giving their delimiters
@code{font-lock-warning-face}. @xref{Wrong Comment Style}.}.
@item electric mode
When this is enabled, certain visible characters cause reformatting as
they are typed. This is normally helpful, but can be a nuisance when
Expand Down Expand Up @@ -1866,6 +1868,7 @@ sections apply to the other languages.
* Font Locking Preliminaries::
* Faces::
* Doc Comments::
* Wrong Comment Style::
* Misc Font Locking::
* AWK Mode Font Locking::
@end menu
Expand Down Expand Up @@ -2069,7 +2072,7 @@ since those aren't syntactic errors in themselves.


@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@node Doc Comments, Misc Font Locking, Faces, Font Locking
@node Doc Comments, Wrong Comment Style, Faces, Font Locking
@comment node-name, next, previous, up
@section Documentation Comments
@cindex documentation comments
Expand Down Expand Up @@ -2149,7 +2152,29 @@ If you add support for another doc comment style, please consider
contributing it: send a note to @email{bug-cc-mode@@gnu.org}.

@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@node Misc Font Locking, AWK Mode Font Locking, Doc Comments, Font Locking
@node Wrong Comment Style, Misc Font Locking, Doc Comments, Font Locking
@comment node-name, next, previous, up
@section Marking ``Wrong'' style comments
@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Most languages supported by @ccmode{} have two styles of comments,
namely block comments and line comments. Your project may have such a
strong preference for one of them, that you wish ``wrong'' style
comments to be clearly marked.

You can get @ccmode{} to do this by setting the default comment style,
if necessary, (@pxref{Minor Modes}) and setting the customizable
option @code{c-mark-wrong-style-of-comment} to non-@code{nil}.

@defvar c-mark-wrong-style-of-comment
@vindex mark-wrong-style-of-comment (c-)
When this customizable option is non-@code{nil}, comment delimiters
which aren't of the default style will be fontified with
@code{font-lock-warning-face}.
@end defvar

@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@node Misc Font Locking, AWK Mode Font Locking, Wrong Comment Style, Font Locking
@comment node-name, next, previous, up
@section Miscellaneous Font Locking
@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Expand Down Expand Up @@ -2885,11 +2910,11 @@ should not be changed directly; use @code{c-add-style} instead.

Instead of specifying a style, you can get @ccmode{} to @dfn{guess}
your style by examining an already formatted code buffer. @ccmode{}
then determines the ''most frequent'' offset (@pxref{c-offsets-alist})
then determines the ``most frequent'' offset (@pxref{c-offsets-alist})
for each of the syntactic symbols (@pxref{Indentation Engine Basics})
encountered in the buffer, and the ''most frequent'' value of
encountered in the buffer, and the ``most frequent'' value of
c-basic-offset (@pxref{Customizing Indentation}), then merges the
current style with these ''guesses'' to form a new style. This
current style with these ``guesses'' to form a new style. This
combined style is known as the @dfn{guessed style}.

To do this, call @code{c-guess} (or one of the other 5 guessing
Expand Down Expand Up @@ -6927,7 +6952,7 @@ is @code{nil}, all lines inside macro definitions are analyzed as
Because a macro can expand into anything at all, near where one is
invoked @ccmode{} can only indent and fontify code heuristically.
Sometimes it gets it wrong. Usually you should try to design your
macros so that they ''look like ordinary code'' when you invoke them.
macros so that they ``look like ordinary code'' when you invoke them.
However, two situations are so common that @ccmode{} handles them
specially: that is when certain macros needn't (or mustn't) be
followed by a @samp{;}, and when certain macros (or compiler
Expand Down
54 changes: 24 additions & 30 deletions doc/misc/cl.texi
Original file line number Diff line number Diff line change
Expand Up @@ -3113,48 +3113,42 @@ function that must be called before the parameters can be used.
@defun cl-float-limits
This function makes sure that the Common Lisp floating-point parameters
like @code{cl-most-positive-float} have been initialized. Until it is
called, these parameters will be @code{nil}.
@c If this version of Emacs does not support floats, the parameters will
@c remain @code{nil}.
called, these parameters have unspecified values.
If the parameters have already been initialized, the function returns
immediately.

The algorithm makes assumptions that will be valid for almost all
machines, but will fail if the machine's arithmetic is extremely
unusual, e.g., decimal.
@end defun

Since true Common Lisp supports up to four different kinds of floating-point
numbers, it has families of constants like
@code{most-positive-single-float}, @code{most-positive-double-float},
@code{most-positive-long-float}, and so on. Emacs has only one
kind of floating-point number, so this package just uses single constants.
@code{most-positive-long-float}, and so on. This package uses just
one set of constants because Emacs has only one kind of
floating-point number, namely the IEEE binary64 floating-point format.
@xref{Float Basics,,,elisp,GNU Emacs Lisp Reference Manual}.

@defvar cl-most-positive-float
This constant equals the largest value a Lisp float can hold.
For those systems whose arithmetic supports infinities, this is
the largest @emph{finite} value. For IEEE machines, the value
is approximately @code{1.79e+308}.
This constant equals the largest finite value a Lisp float can hold.
For IEEE binary64 format, this equals @code{(- (expt 2 1024) (- 2
971))}, which equals @code{1.7976931348623157e+308}.
@end defvar

@defvar cl-most-negative-float
This constant equals the most negative value a Lisp float can hold.
(It is assumed to be equal to @code{(- cl-most-positive-float)}.)
This constant equals the most negative finite value a Lisp float can hold.
For IEEE binary64 format, this equals @code{(- cl-most-positive-float)}.
@end defvar

@defvar cl-least-positive-float
This constant equals the smallest Lisp float value greater than zero.
For IEEE machines, it is about @code{4.94e-324} if denormals are
supported or @code{2.22e-308} if not.
@defvar cl-least-positive-normalized-float
This constant equals the smallest positive Lisp float that is
@dfn{normalized}, i.e., that has full precision.
For IEEE binary64 format, this equals @code{(expt 2 -1022)},
which equals @code{2.2250738585072014e-308}.
@end defvar

@defvar cl-least-positive-normalized-float
This constant equals the smallest @emph{normalized} Lisp float greater
than zero, i.e., the smallest value for which IEEE denormalization
will not result in a loss of precision. For IEEE machines, this
value is about @code{2.22e-308}. For machines that do not support
the concept of denormalization and gradual underflow, this constant
will always equal @code{cl-least-positive-float}.
@defvar cl-least-positive-float
This constant equals the smallest Lisp float value greater than zero.
For IEEE binary64 format, this equals @code{5e-324} (which equals
@code{(expt 2 -1074)}) if subnormal numbers are supported, and
@code{cl-least-positive-normalized-float} otherwise.
@end defvar

@defvar cl-least-negative-float
Expand All @@ -3169,14 +3163,14 @@ This constant is the negative counterpart of
@defvar cl-float-epsilon
This constant is the smallest positive Lisp float that can be added
to 1.0 to produce a distinct value. Adding a smaller number to 1.0
will yield 1.0 again due to roundoff. For IEEE machines, epsilon
is about @code{2.22e-16}.
will yield 1.0 again due to roundoff. For IEEE binary64 format, this
equals @code{(expt 2 -52)}, which equals @code{2.220446049250313e-16}.
@end defvar

@defvar cl-float-negative-epsilon
This is the smallest positive value that can be subtracted from
1.0 to produce a distinct value. For IEEE machines, it is about
@code{1.11e-16}.
1.0 to produce a distinct value. For IEEE binary64 format, this
equals @code{(expt 2 -53)}, which equals @code{1.1102230246251565e-16}.
@end defvar

@node Sequences
Expand Down
18 changes: 18 additions & 0 deletions etc/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,9 @@ list the contents of such directories when completing file names.

** Minibuffer

*** Scrolling and recentering commands in the minibuffer are invoked
on the original window (that was selected before activating the minibuffer).

+++
*** A new user option, 'minibuffer-beginning-of-buffer-movement', has
been introduced to allow controlling how the 'M-<' command works in
Expand All @@ -720,6 +723,12 @@ the minibuffer. If non-nil, point will move to the end of the prompt
*** Minibuffer now uses 'minibuffer-message' to display error messages
at the end of the active minibuffer.

+++
*** 'y-or-n-p' now uses the minibuffer to read 'y' or 'n' answer.

*** Some commands that previously used read-char-choice now read
a character using the minibuffer by read-char-from-minibuffer.

** map.el
*** Now also understands plists.
*** Now defined via generic functions that can be extended via 'cl-defmethod'.
Expand Down Expand Up @@ -2264,6 +2273,14 @@ file-local variable, you may need to update the value.
*** Declare 'define-overload' and 'define-child-mode' as obsolete
*** Rename several internal functions to use a ''mode-local-' prefix

** CC Mode

+++
*** You can now flag "wrong style" comments with font-lock-warning-face.
To do this, use c-toggle-comment-style, if needed, to set the desired
default comment style (block or line); then set the option
c-mark-wrong-style-of-comment to non-nil.


* New Modes and Packages in Emacs 27.1

Expand Down Expand Up @@ -2556,6 +2573,7 @@ This macro works like 'progn', but messages how long it takes to
evaluate the body forms. The value of the last form is the return
value.

+++
** New function 'read-char-from-minibuffer'.
This function works like 'read-char', but uses 'read-from-minibuffer'
to read a character, so it maintains a history that can be navigated
Expand Down
3 changes: 2 additions & 1 deletion lisp/autorevert.el
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,8 @@ This is an internal function used by Auto-Revert Mode."
(when revert
(when (and auto-revert-verbose
(not (eq revert 'fast)))
(message "Reverting buffer `%s'." (buffer-name)))
(with-current-buffer (window-buffer (old-selected-window))
(minibuffer-message "Reverting buffer `%s'." (buffer-name))))
;; If point (or a window point) is at the end of the buffer, we
;; want to keep it at the end after reverting. This allows one
;; to tail a file.
Expand Down
4 changes: 2 additions & 2 deletions lisp/calendar/cal-dst.el
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ list and for correcting times of day in the solar and lunar calculations.
For example, if daylight saving time is mandated to start on October 1,
you would set `calendar-daylight-savings-starts' to
'(10 1 year)
(10 1 year)
If it starts on the first Sunday in April, you would set it to
'(calendar-nth-named-day 1 0 4 year)
(calendar-nth-named-day 1 0 4 year)
If the locale never uses daylight saving time, set this to nil."
:type 'sexp
Expand Down
4 changes: 2 additions & 2 deletions lisp/calendar/cal-tex.el
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
(defcustom cal-tex-which-days '(0 1 2 3 4 5 6)
"The days of the week that are displayed on the portrait monthly calendar.
Sunday is 0, Monday is 1, and so on. The default is to print from Sunday to
Saturday. For example, use '(1 3 5) to only print Monday, Wednesday, Friday."
Saturday. For example, (1 3 5) prints only Monday, Wednesday, Friday."
:type '(repeat integer)
:group 'calendar-tex)

Expand Down Expand Up @@ -109,7 +109,7 @@ date in the weekly calendars, and in the top center of daily calendars.
The default is ordinal day number of the year and the number of
days remaining. As an example, setting this to
'(calendar-hebrew-date-string date)
(calendar-hebrew-date-string date)
will put the Hebrew date at the bottom of each day."
:type 'sexp
Expand Down
6 changes: 3 additions & 3 deletions lisp/cedet/cedet-cscope.el
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@
(defun cedet-cscope-search (searchtext texttype type scope)
"Perform a search with CScope, return the created buffer.
SEARCHTEXT is text to find.
TEXTTYPE is the type of text, such as 'regexp, 'string, 'tagname,
'tagregexp, or 'tagcompletions.
TEXTTYPE is the type of text, such as `regexp', `string', `tagname',
`tagregexp', or `tagcompletions'.
TYPE is the type of search, meaning that SEARCHTEXT is compared to
filename, tagname (tags table), references (uses of a tag) , or
symbol (uses of something not in the tag table.)
SCOPE is the scope of the search, such as 'project or 'subdirs."
SCOPE is the scope of the search, such as `project' or `subdir'."
;; CScope is an interactive program. It uses number flags
;; in order to perform command line searches. Useful for this
;; tool are:
Expand Down
Loading

0 comments on commit 5f4d8a2

Please sign in to comment.