diff options
author | Glenn Morris <rgm@gnu.org> | 2020-09-20 17:18:16 -0700 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2020-09-20 17:18:16 -0700 |
commit | 3675993d76cc6db43703240d0ff0fd892abf1b41 (patch) | |
tree | 2615512bfb3d569b679efb09711dad1cea7536cc | |
parent | 15c594c282176cf8e29072de2934a046922053b1 (diff) | |
parent | df04f3e755f3001ebb9cc428faa7fa46059e636b (diff) | |
download | emacs-3675993d76cc6db43703240d0ff0fd892abf1b41.tar.gz |
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
-rw-r--r-- | doc/lispref/buffers.texi | 4 | ||||
-rw-r--r-- | doc/lispref/minibuf.texi | 7 | ||||
-rw-r--r-- | doc/lispref/syntax.texi | 27 | ||||
-rw-r--r-- | doc/lispref/text.texi | 2 | ||||
-rw-r--r-- | lisp/emacs-lisp/syntax.el | 7 | ||||
-rw-r--r-- | lisp/menu-bar.el | 2 | ||||
-rw-r--r-- | src/nsterm.m | 6 | ||||
-rw-r--r-- | src/syntax.c | 25 | ||||
-rw-r--r-- | src/xdisp.c | 6 | ||||
-rw-r--r-- | test/lisp/vc/vc-bzr-tests.el | 19 |
10 files changed, 70 insertions, 35 deletions
diff --git a/doc/lispref/buffers.texi b/doc/lispref/buffers.texi index 33528fc7fec..28603436284 100644 --- a/doc/lispref/buffers.texi +++ b/doc/lispref/buffers.texi @@ -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 diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index da27805f86d..d00acd0ded3 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi @@ -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 diff --git a/doc/lispref/syntax.texi b/doc/lispref/syntax.texi index 9eb99a0ac92..b99b5de0b31 100644 --- a/doc/lispref/syntax.texi +++ b/doc/lispref/syntax.texi @@ -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 diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 3a4cf6b5723..722c044b1a1 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -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 diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el index ce495af95bc..487faacd738 100644 --- a/lisp/emacs-lisp/syntax.el +++ b/lisp/emacs-lisp/syntax.el @@ -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) diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index fa60cb3b120..1556ee290f1 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -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) diff --git a/src/nsterm.m b/src/nsterm.m index f6a36c8fdcb..5e5d09f058b 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -8610,7 +8610,7 @@ not_in_argv (NSString *arg) 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 @@ not_in_argv (NSString *arg) strings = list1 ([[url absoluteString] lispString]); } - else if ([type isEqualToString: NSStringPboardType] - || [type isEqualToString: NSTabularTextPboardType]) + else if ([type isEqualToString: NSPasteboardTypeString] + || [type isEqualToString: NSPasteboardTypeTabularText]) { NSString *data; diff --git a/src/syntax.c b/src/syntax.c index 7f0fc341f6e..e6af8a377bb 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -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) { diff --git a/src/xdisp.c b/src/xdisp.c index 615f0ca7cf8..49225c56fe3 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -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, diff --git a/test/lisp/vc/vc-bzr-tests.el b/test/lisp/vc/vc-bzr-tests.el index f738da7f41f..b68a6945129 100644 --- a/test/lisp/vc/vc-bzr-tests.el +++ b/test/lisp/vc/vc-bzr-tests.el @@ -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 |