1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-15 09:47:20 +00:00

Merge from origin/emacs-27

df04f3e755 Fix a rare segfault in syntax.c
fd1fe1e1ec Add doc to syntax-propertize-function saying it must do a ...
fcd599bbea Minor copyedits of doc of 'with-silent-modifications'
759399cdb1 Improve documentation of 'max-mini-window-height'
3223302aa2 Use modern constant names for the NS pasteboard
985703d380 Fix doc string of 'toggle-menu-bar-mode-from-frame'
184a4977c7 Make vc-bzr tests work with brz 3.1 (bug#43314)

# Conflicts:
#	lisp/emacs-lisp/syntax.el
#	src/syntax.c
This commit is contained in:
Glenn Morris 2020-09-20 17:18:16 -07:00
commit 3675993d76
10 changed files with 70 additions and 35 deletions

View File

@ -596,8 +596,8 @@ and features that react to buffer modifications, use the
Execute @var{body} pretending it does not modify the buffer. This
includes checking whether the buffer's file is locked (@pxref{File
Locks}), running buffer modification hooks (@pxref{Change Hooks}),
etc. Note that if @var{body} actually modifies the buffer text, its
undo data may become corrupted.
etc. Note that if @var{body} actually modifies the buffer text (as
opposed to its text properties), its undo data may become corrupted.
@end defmac
@node Modification Time

View File

@ -2474,9 +2474,10 @@ changes size automatically. In that case the window resizing commands
@defopt max-mini-window-height
This option provides a maximum height for resizing minibuffer windows
automatically. A floating-point number specifies a fraction of the
frame's height; an integer specifies the maximum number of lines. The
default value is 0.25.
automatically. A floating-point number specifies the maximum height
as a fraction of the frame's height; an integer specifies the maximum
height in units of the frame's canonical character height
(@pxref{Frame Font}). The default value is 0.25.
@end defopt
Note that the values of the above two variables take effect at display

View File

@ -256,10 +256,11 @@ look in the standard syntax table to find the syntax of this
character.
@item Generic comment delimiters: @samp{!}
Characters that start or end a special kind of comment. @emph{Any}
generic comment delimiter matches @emph{any} generic comment
delimiter, but they cannot match a comment starter or comment ender;
generic comment delimiters can only match each other.
(This syntax class is also known as ``comment-fence''.) Characters
that start or end a special kind of comment. @emph{Any} generic
comment delimiter matches @emph{any} generic comment delimiter, but
they cannot match a comment starter or comment ender; generic comment
delimiters can only match each other.
This syntax class is primarily meant for use with the
@code{syntax-table} text property (@pxref{Syntax Properties}). You
@ -268,10 +269,11 @@ first and last characters of the range @code{syntax-table} properties
identifying them as generic comment delimiters.
@item Generic string delimiters: @samp{|}
Characters that start or end a string. This class differs from the
string quote class in that @emph{any} generic string delimiter can
match any other generic string delimiter; but they do not match
ordinary string quote characters.
(This syntax class is also known as ``string-fence''.) Characters
that start or end a string. This class differs from the string quote
class in that @emph{any} generic string delimiter can match any other
generic string delimiter; but they do not match ordinary string quote
characters.
This syntax class is primarily meant for use with the
@code{syntax-table} text property (@pxref{Syntax Properties}). You
@ -575,6 +577,15 @@ position before @var{end}. However, it should not call
@code{syntax-ppss-flush-cache}; so, it is not allowed to call
@code{syntax-ppss} on some position and later modify the buffer at an
earlier position.
@strong{Caution:} When this variable is non-@code{nil}, Emacs removes
@code{syntax-table} text properties arbitrarily and relies on
@code{syntax-propertize-function} to reapply them. Thus if this
facility is used at all, the function must apply @strong{all}
@code{syntax-table} text properties used by the major mode. In
particular, Modes derived from a CC Mode mode must not use this
variable, since CC Mode uses other means to apply and remove these
text properties.
@end defvar
@defvar syntax-propertize-extend-region-functions

View File

@ -3069,7 +3069,7 @@ construct each part with @code{propertize} and then combine them with
@code{buffer-substring-no-properties}, which copies text from the
buffer but does not copy its properties.
@findex with-silent-modifications
@findex with-silent-modifications, and changes in text properties
If you wish to add text properties to a buffer or remove them
without marking the buffer as modified, you can wrap the calls above
in the @code{with-silent-modifications} macro. @xref{Buffer

View File

@ -66,7 +66,12 @@ The specified function may call `syntax-ppss' on any position
before END, but if it calls `syntax-ppss' on some
position and later modifies the buffer on some earlier position,
then it is its responsability to call `syntax-ppss-flush-cache' to flush
the now obsolete ppss info from the cache.")
the now obsolete ppss info from the cache.
Note: When this variable is a function, it must apply _all_ the
`syntax-table' properties needed in the given text interval.
Using both this function and other means to apply these
properties won't work properly.")
(defvar syntax-propertize-chunk-size 500)

View File

@ -2485,7 +2485,7 @@ created in the future."
(put 'menu-bar-mode 'standard-value '(t))
(defun toggle-menu-bar-mode-from-frame (&optional arg)
"Toggle menu bar on or off, based on the status of the current frame.
"Toggle display of the menu bar of the current frame.
See `menu-bar-mode' for more information."
(interactive (list (or current-prefix-arg 'toggle)))
(if (eq arg 'toggle)

View File

@ -8610,7 +8610,7 @@ -(BOOL)performDragOperation: (id <NSDraggingInfo>) sender
while ( (file = [fenum nextObject]) )
strings = Fcons ([file lispString], strings);
}
else if ([type isEqualToString: NSURLPboardType])
else if ([type isEqualToString: NSPasteboardTypeURL])
{
NSURL *url = [NSURL URLFromPasteboard: pb];
if (url == nil) return NO;
@ -8619,8 +8619,8 @@ -(BOOL)performDragOperation: (id <NSDraggingInfo>) sender
strings = list1 ([[url absoluteString] lispString]);
}
else if ([type isEqualToString: NSStringPboardType]
|| [type isEqualToString: NSTabularTextPboardType])
else if ([type isEqualToString: NSPasteboardTypeString]
|| [type isEqualToString: NSPasteboardTypeTabularText])
{
NSString *data;

View File

@ -2542,20 +2542,23 @@ between them, return t; otherwise return nil. */)
bool fence_found = 0;
ptrdiff_t ini = from, ini_byte = from_byte;
while (1)
if (from > stop)
{
dec_both (&from, &from_byte);
UPDATE_SYNTAX_TABLE_BACKWARD (from);
c = FETCH_CHAR_AS_MULTIBYTE (from_byte);
if (SYNTAX (c) == Scomment_fence
&& !char_quoted (from, from_byte))
while (1)
{
fence_found = 1;
break;
dec_both (&from, &from_byte);
UPDATE_SYNTAX_TABLE_BACKWARD (from);
c = FETCH_CHAR_AS_MULTIBYTE (from_byte);
if (SYNTAX (c) == Scomment_fence
&& !char_quoted (from, from_byte))
{
fence_found = 1;
break;
}
else if (from == stop)
break;
rarely_quit (++quit_count);
}
else if (from == stop)
break;
rarely_quit (++quit_count);
}
if (fence_found == 0)
{

View File

@ -35009,8 +35009,10 @@ but does not change the fact they are interpreted as raw bytes. */);
DEFVAR_LISP ("max-mini-window-height", Vmax_mini_window_height,
doc: /* Maximum height for resizing mini-windows (the minibuffer and the echo area).
If a float, it specifies a fraction of the mini-window frame's height.
If an integer, it specifies a number of lines. */);
If a float, it specifies the maximum height in units of the
mini-window frame's height.
If an integer, it specifies the maximum height in units of the
mini-window frame's default font's height. */);
Vmax_mini_window_height = make_float (0.25);
DEFVAR_LISP ("resize-mini-windows", Vresize_mini_windows,

View File

@ -38,13 +38,26 @@
;; abort if they cannot. I could not figure out how to stop bzr
;; doing that, so just give it a temporary homedir for the duration.
;; http://bugs.launchpad.net/bzr/+bug/137407 ?
;;
;; Note that with bzr 2.x, this works:
;; mkdir /tmp/bzr
;; HOME=/nonexistent BZR_HOME=/tmp/bzr bzr status
;; but with brz 3.1, it complains:
;; "failed to open trace file: [Errno 13] Permission denied: '/nonexistent'"
;; which confuses vc-dir.
;; We can quieten brz by adding either BRZ_LOG=/dev/null, or
;; XDG_CACHE_HOME=/tmp/bzr (log defaults to XDG_CACHE_HOME/breezy/brz.log),
;; but it seems simpler to just set HOME to a newly created
;; temporary directory.
;; TODO does this means tests should be setting XDG_ variables (not
;; just HOME) to temporary values too?
(let* ((homedir (make-temp-file "vc-bzr-test" t))
(bzrdir (expand-file-name "bzr" homedir))
(ignored-dir (progn
(make-directory bzrdir)
(expand-file-name "ignored-dir" bzrdir)))
(default-directory (file-name-as-directory bzrdir))
(process-environment (cons (format "BZR_HOME=%s" homedir)
(process-environment (cons (format "HOME=%s" homedir)
process-environment)))
(unwind-protect
(progn
@ -81,7 +94,7 @@
(expand-file-name "subdir" bzrdir)))
(file (expand-file-name "file" bzrdir))
(default-directory (file-name-as-directory bzrdir))
(process-environment (cons (format "BZR_HOME=%s" homedir)
(process-environment (cons (format "HOME=%s" homedir)
process-environment)))
(unwind-protect
(progn
@ -119,7 +132,7 @@
(expand-file-name "foo.el" bzrdir)))
(default-directory (file-name-as-directory bzrdir))
(generated-autoload-file (expand-file-name "loaddefs.el" bzrdir))
(process-environment (cons (format "BZR_HOME=%s" homedir)
(process-environment (cons (format "HOME=%s" homedir)
process-environment)))
(unwind-protect
(progn