Skip to content

Commit 5f4d8a2

Browse files
author
Yuuki Harano
committed
Merge branch 'master' of https://github.com/emacs-mirror/emacs into pgtk
2 parents 0319351 + 555f5f7 commit 5f4d8a2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+922
-644
lines changed

doc/lispref/minibuf.texi

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2020,29 +2020,27 @@ uses keyboard input. You can force use either of the mouse or of keyboard
20202020
input by binding @code{last-nonmenu-event} to a suitable value around
20212021
the call.
20222022

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

20262025
@defun y-or-n-p prompt
2027-
This function asks the user a question, expecting input in the echo
2028-
area. It returns @code{t} if the user types @kbd{y}, @code{nil} if the
2029-
user types @kbd{n}. This function also accepts @key{SPC} to mean yes
2030-
and @key{DEL} to mean no. It accepts @kbd{C-]} to quit, like
2031-
@kbd{C-g}, because the question might look like a minibuffer and for
2032-
that reason the user might try to use @kbd{C-]} to get out. The answer
2033-
is a single character, with no @key{RET} needed to terminate it. Upper
2034-
and lower case are equivalent.
2035-
2036-
``Asking the question'' means printing @var{prompt} in the echo area,
2026+
This function asks the user a question, expecting input in the minibuffer.
2027+
It returns @code{t} if the user types @kbd{y}, @code{nil} if the user
2028+
types @kbd{n}. This function also accepts @key{SPC} to mean yes and
2029+
@key{DEL} to mean no. It accepts @kbd{C-]} and @kbd{C-g} to quit,
2030+
because the question uses the minibuffer and for that reason the user
2031+
might try to use @kbd{C-]} to get out. The answer is a single
2032+
character, with no @key{RET} needed to terminate it. Upper and lower
2033+
case are equivalent.
2034+
2035+
``Asking the question'' means printing @var{prompt} in the minibuffer,
20372036
followed by the string @w{@samp{(y or n) }}. If the input is not one of
20382037
the expected answers (@kbd{y}, @kbd{n}, @kbd{@key{SPC}},
20392038
@kbd{@key{DEL}}, or something that quits), the function responds
20402039
@samp{Please answer y or n.}, and repeats the request.
20412040

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

20472045
The answers and their meanings, even @samp{y} and @samp{n}, are not
20482046
hardwired, and are specified by the keymap @code{query-replace-map}
@@ -2053,10 +2051,6 @@ special responses @code{recenter}, @code{scroll-up},
20532051
@kbd{C-v}, @kbd{M-v}, @kbd{C-M-v} and @kbd{C-M-S-v} in
20542052
@code{query-replace-map}), this function performs the specified window
20552053
recentering or scrolling operation, and poses the question again.
2056-
2057-
@noindent
2058-
We show successive lines of echo area messages, but only one actually
2059-
appears on the screen at a time.
20602054
@end defun
20612055

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

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

2256+
If you need a function to read a character like @code{read-char} or
2257+
@code{read-char-choice} (@pxref{Reading One Event}) but using the
2258+
minibuffer, use @code{read-char-from-minibuffer}.
2259+
2260+
@defun read-char-from-minibuffer prompt &optional chars history
2261+
This function uses the minibuffer to read and return a single
2262+
character. Optionally, it ignores any input that is not a member of
2263+
@var{chars}, a list of accepted characters. The @var{history}
2264+
argument specifies the history list symbol to use; if is omitted or
2265+
@code{nil}, it doesn't use the history.
2266+
@end defun
2267+
22622268
@node Reading a Password
22632269
@section Reading a Password
22642270
@cindex passwords, reading

doc/lispref/modes.texi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2738,11 +2738,11 @@ This function should make sure the region between @var{beg} and
27382738
accessible portion. Calls the function specified by
27392739
@code{font-lock-ensure-function}.
27402740

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

27482748
There are several variables that control how Font Lock mode highlights

doc/lispref/numbers.texi

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,12 @@ considered to be valid as a character. @xref{Character Codes}.
218218
Floating-point numbers are useful for representing numbers that are
219219
not integral. The range of floating-point numbers is
220220
the same as the range of the C data type @code{double} on the machine
221-
you are using. On all computers currently supported by Emacs, this is
222-
double-precision @acronym{IEEE} floating point.
221+
you are using. On all computers supported by Emacs, this is
222+
@acronym{IEEE} binary64 floating point format, which is standardized by
223+
@url{https://standards.ieee.org/standard/754-2019.html,,IEEE Std 754-2019}
224+
and is discussed further in David Goldberg's paper
225+
``@url{https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html,
226+
What Every Computer Scientist Should Know About Floating-Point Arithmetic}''.
223227

224228
The read syntax for floating-point numbers requires either a decimal
225229
point, an exponent, or both. Optional signs (@samp{+} or @samp{-})

doc/misc/cc-mode.texi

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ expression, to some statements, or perhaps to whole functions, the
669669
syntactic recognition can be wrong. @ccmode{} manages to figure it
670670
out correctly most of the time, though.
671671

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

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

20702073

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

21512154
@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2152-
@node Misc Font Locking, AWK Mode Font Locking, Doc Comments, Font Locking
2155+
@node Wrong Comment Style, Misc Font Locking, Doc Comments, Font Locking
2156+
@comment node-name, next, previous, up
2157+
@section Marking ``Wrong'' style comments
2158+
@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2159+
2160+
Most languages supported by @ccmode{} have two styles of comments,
2161+
namely block comments and line comments. Your project may have such a
2162+
strong preference for one of them, that you wish ``wrong'' style
2163+
comments to be clearly marked.
2164+
2165+
You can get @ccmode{} to do this by setting the default comment style,
2166+
if necessary, (@pxref{Minor Modes}) and setting the customizable
2167+
option @code{c-mark-wrong-style-of-comment} to non-@code{nil}.
2168+
2169+
@defvar c-mark-wrong-style-of-comment
2170+
@vindex mark-wrong-style-of-comment (c-)
2171+
When this customizable option is non-@code{nil}, comment delimiters
2172+
which aren't of the default style will be fontified with
2173+
@code{font-lock-warning-face}.
2174+
@end defvar
2175+
2176+
@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2177+
@node Misc Font Locking, AWK Mode Font Locking, Wrong Comment Style, Font Locking
21532178
@comment node-name, next, previous, up
21542179
@section Miscellaneous Font Locking
21552180
@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -2885,11 +2910,11 @@ should not be changed directly; use @code{c-add-style} instead.
28852910

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

28952920
To do this, call @code{c-guess} (or one of the other 5 guessing
@@ -6927,7 +6952,7 @@ is @code{nil}, all lines inside macro definitions are analyzed as
69276952
Because a macro can expand into anything at all, near where one is
69286953
invoked @ccmode{} can only indent and fontify code heuristically.
69296954
Sometimes it gets it wrong. Usually you should try to design your
6930-
macros so that they ''look like ordinary code'' when you invoke them.
6955+
macros so that they ``look like ordinary code'' when you invoke them.
69316956
However, two situations are so common that @ccmode{} handles them
69326957
specially: that is when certain macros needn't (or mustn't) be
69336958
followed by a @samp{;}, and when certain macros (or compiler

doc/misc/cl.texi

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3113,48 +3113,42 @@ function that must be called before the parameters can be used.
31133113
@defun cl-float-limits
31143114
This function makes sure that the Common Lisp floating-point parameters
31153115
like @code{cl-most-positive-float} have been initialized. Until it is
3116-
called, these parameters will be @code{nil}.
3117-
@c If this version of Emacs does not support floats, the parameters will
3118-
@c remain @code{nil}.
3116+
called, these parameters have unspecified values.
31193117
If the parameters have already been initialized, the function returns
31203118
immediately.
3121-
3122-
The algorithm makes assumptions that will be valid for almost all
3123-
machines, but will fail if the machine's arithmetic is extremely
3124-
unusual, e.g., decimal.
31253119
@end defun
31263120

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

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

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

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

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

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

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

31823176
@node Sequences

etc/NEWS

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,9 @@ list the contents of such directories when completing file names.
710710

711711
** Minibuffer
712712

713+
*** Scrolling and recentering commands in the minibuffer are invoked
714+
on the original window (that was selected before activating the minibuffer).
715+
713716
+++
714717
*** A new user option, 'minibuffer-beginning-of-buffer-movement', has
715718
been introduced to allow controlling how the 'M-<' command works in
@@ -720,6 +723,12 @@ the minibuffer. If non-nil, point will move to the end of the prompt
720723
*** Minibuffer now uses 'minibuffer-message' to display error messages
721724
at the end of the active minibuffer.
722725

726+
+++
727+
*** 'y-or-n-p' now uses the minibuffer to read 'y' or 'n' answer.
728+
729+
*** Some commands that previously used read-char-choice now read
730+
a character using the minibuffer by read-char-from-minibuffer.
731+
723732
** map.el
724733
*** Now also understands plists.
725734
*** Now defined via generic functions that can be extended via 'cl-defmethod'.
@@ -2264,6 +2273,14 @@ file-local variable, you may need to update the value.
22642273
*** Declare 'define-overload' and 'define-child-mode' as obsolete
22652274
*** Rename several internal functions to use a ''mode-local-' prefix
22662275

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

22682285
* New Modes and Packages in Emacs 27.1
22692286

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

2576+
+++
25592577
** New function 'read-char-from-minibuffer'.
25602578
This function works like 'read-char', but uses 'read-from-minibuffer'
25612579
to read a character, so it maintains a history that can be navigated

lisp/autorevert.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,8 @@ This is an internal function used by Auto-Revert Mode."
815815
(when revert
816816
(when (and auto-revert-verbose
817817
(not (eq revert 'fast)))
818-
(message "Reverting buffer `%s'." (buffer-name)))
818+
(with-current-buffer (window-buffer (old-selected-window))
819+
(minibuffer-message "Reverting buffer `%s'." (buffer-name))))
819820
;; If point (or a window point) is at the end of the buffer, we
820821
;; want to keep it at the end after reverting. This allows one
821822
;; to tail a file.

lisp/calendar/cal-dst.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ list and for correcting times of day in the solar and lunar calculations.
6161
For example, if daylight saving time is mandated to start on October 1,
6262
you would set `calendar-daylight-savings-starts' to
6363
64-
'(10 1 year)
64+
(10 1 year)
6565
6666
If it starts on the first Sunday in April, you would set it to
6767
68-
'(calendar-nth-named-day 1 0 4 year)
68+
(calendar-nth-named-day 1 0 4 year)
6969
7070
If the locale never uses daylight saving time, set this to nil."
7171
:type 'sexp

lisp/calendar/cal-tex.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
(defcustom cal-tex-which-days '(0 1 2 3 4 5 6)
7272
"The days of the week that are displayed on the portrait monthly calendar.
7373
Sunday is 0, Monday is 1, and so on. The default is to print from Sunday to
74-
Saturday. For example, use '(1 3 5) to only print Monday, Wednesday, Friday."
74+
Saturday. For example, (1 3 5) prints only Monday, Wednesday, Friday."
7575
:type '(repeat integer)
7676
:group 'calendar-tex)
7777

@@ -109,7 +109,7 @@ date in the weekly calendars, and in the top center of daily calendars.
109109
The default is ordinal day number of the year and the number of
110110
days remaining. As an example, setting this to
111111
112-
'(calendar-hebrew-date-string date)
112+
(calendar-hebrew-date-string date)
113113
114114
will put the Hebrew date at the bottom of each day."
115115
:type 'sexp

lisp/cedet/cedet-cscope.el

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@
3939
(defun cedet-cscope-search (searchtext texttype type scope)
4040
"Perform a search with CScope, return the created buffer.
4141
SEARCHTEXT is text to find.
42-
TEXTTYPE is the type of text, such as 'regexp, 'string, 'tagname,
43-
'tagregexp, or 'tagcompletions.
42+
TEXTTYPE is the type of text, such as `regexp', `string', `tagname',
43+
`tagregexp', or `tagcompletions'.
4444
TYPE is the type of search, meaning that SEARCHTEXT is compared to
4545
filename, tagname (tags table), references (uses of a tag) , or
4646
symbol (uses of something not in the tag table.)
47-
SCOPE is the scope of the search, such as 'project or 'subdirs."
47+
SCOPE is the scope of the search, such as `project' or `subdir'."
4848
;; CScope is an interactive program. It uses number flags
4949
;; in order to perform command line searches. Useful for this
5050
;; tool are:

0 commit comments

Comments
 (0)