1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-21 18:23:59 +00:00

Merge from origin/emacs-26

63ba73a Fix documentation of ':propertize' in mode-line-format
22aa665 Reject invalid 5-byte sequences when detecting UTF-8 encoding
0d3c358 Fix 'replace-buffer-contents' in multibyte buffers
c79a627 Update etc/NEWS for mail-source-movemail-program change
63f1dc4 Improve movemail default
0b1a2ae Delete description of deleted Customize functions
fcd66d0 Keep vc-print-log from putting point at buffer end (Bug#31764)

Conflicts:
	etc/NEWS
This commit is contained in:
Glenn Morris 2018-06-18 12:14:25 -07:00
commit b455a1b2a8
9 changed files with 63 additions and 27 deletions

View File

@ -416,20 +416,14 @@ Use the @code{:set} function to initialize the variable, if it is
already set or has been customized; otherwise, just use
@code{set-default}.
@item custom-initialize-safe-set
@itemx custom-initialize-safe-default
These functions behave like @code{custom-initialize-set}
(@code{custom-initialize-default}, respectively), but catch errors.
If an error occurs during initialization, they set the variable to
@code{nil} using @code{set-default}, and signal no error.
These functions are meant for options defined in pre-loaded files,
where the @var{standard} expression may signal an error because some
required variable or function is not yet defined. The value normally
gets updated in @file{startup.el}, ignoring the value computed by
@code{defcustom}. After startup, if one unsets the value and
reevaluates the @code{defcustom}, the @var{standard} expression can be
evaluated without error.
@item custom-initialize-delay
This functions behaves like @code{custom-initialize-set}, but it
delays the actual initialization to the next Emacs start. This should
be used in files that are preloaded (or for autoloaded variables), so
that the initialization is done in the run-time context rather than
the build-time context. This also has the side-effect that the
(delayed) initialization is performed with the @code{:set} function.
@xref{Building Emacs}.
@end table
@item :risky @var{value}

View File

@ -1839,10 +1839,13 @@ recursion.
@item (:propertize @var{elt} @var{props}@dots{})
A list whose first element is the symbol @code{:propertize} says to
process the mode line construct @var{elt} recursively, then add the text
properties specified by @var{props} to the result. The argument
process the mode line construct @var{elt} recursively, then add the
text properties specified by @var{props} to the result. The argument
@var{props} should consist of zero or more pairs @var{text-property}
@var{value}.
@var{value}. If @var{elt} is or produces a string with text
properties, all the characters of that string should have the same
properties, or else some of them might be removed by
@code{:propertize}.
@item (@var{symbol} @var{then} @var{else})
A list whose first element is a symbol that is not a keyword specifies

View File

@ -37,6 +37,16 @@ in its NEWS.)
* Changes in Specialized Modes and Packages in Emacs 26.2
** Gnus
---
*** Mailutils movemail will now be used if found at runtime.
The default value of mail-source-movemail-program is now "movemail".
This ensures that the movemail program from GNU Mailutils will be used
if found in 'exec-path', even if it was not found at build time. To
use a different program, customize mail-source-movemail-program to the
absolute file name of the desired executable.
** Shell mode
---

View File

@ -301,9 +301,9 @@ number."
:group 'mail-source
:type 'number)
(defcustom mail-source-movemail-program nil
(defcustom mail-source-movemail-program "movemail"
"If non-nil, name of program for fetching new mail."
:version "22.1"
:version "26.2"
:group 'mail-source
:type '(choice (const nil) string))
@ -682,12 +682,16 @@ Deleting old (> %s day(s)) incoming mail file `%s'." diff bfile)
(setq errors (generate-new-buffer " *mail source loss*"))
(let ((default-directory "/"))
(setq result
;; call-process looks in exec-path, which
;; contains exec-directory, so will find
;; Mailutils movemail if it exists, else it will
;; find "our" movemail in exec-directory.
;; Bug#31737
(apply
'call-process
(append
(list
(or mail-source-movemail-program
(expand-file-name "movemail" exec-directory))
mail-source-movemail-program
nil errors nil from to)))))
(when (file-exists-p to)
(set-file-modes to mail-source-default-file-modes))

View File

@ -2244,8 +2244,9 @@ earlier revisions. Show up to LIMIT entries (non-nil means unlimited)."
(vc-call-backend bk 'print-log files-arg buf shortlog
(when is-start-revision working-revision) limit))
(lambda (_bk _files-arg ret)
(vc-print-log-setup-buttons working-revision
is-start-revision limit ret))
(save-excursion
(vc-print-log-setup-buttons working-revision
is-start-revision limit ret)))
;; When it's nil, point really shouldn't move (bug#15322).
(when working-revision
(lambda (bk)

View File

@ -57,7 +57,8 @@ INLINE_HEADER_BEGIN
/* Minimum leading code of multibyte characters. */
#define MIN_MULTIBYTE_LEADING_CODE 0xC0
/* Maximum leading code of multibyte characters. */
/* Maximum leading code of multibyte characters. Note: this must be
updated if we ever increase MAX_CHAR above. */
#define MAX_MULTIBYTE_LEADING_CODE 0xF8
/* Unicode character values. */

View File

@ -1225,7 +1225,10 @@ detect_coding_utf_8 (struct coding_system *coding,
ONE_MORE_BYTE (c4);
if (c4 < 0 || ! UTF_8_EXTRA_OCTET_P (c4))
break;
if (UTF_8_5_OCTET_LEADING_P (c))
if (UTF_8_5_OCTET_LEADING_P (c)
/* If we ever need to increase MAX_CHAR, the below may need
to be reviewed. */
&& c < MAX_MULTIBYTE_LEADING_CODE)
{
nchars++;
continue;

View File

@ -3315,8 +3315,17 @@ buffer_chars_equal (struct context *ctx,
eassert (pos_b >= BUF_BEGV (ctx->buffer_b));
eassert (pos_b < BUF_ZV (ctx->buffer_b));
return BUF_FETCH_CHAR_AS_MULTIBYTE (ctx->buffer_a, pos_a)
== BUF_FETCH_CHAR_AS_MULTIBYTE (ctx->buffer_b, pos_b);
ptrdiff_t bpos_a =
NILP (BVAR (ctx->buffer_a, enable_multibyte_characters))
? pos_a
: buf_charpos_to_bytepos (ctx->buffer_a, pos_a);
ptrdiff_t bpos_b =
NILP (BVAR (ctx->buffer_b, enable_multibyte_characters))
? pos_b
: buf_charpos_to_bytepos (ctx->buffer_b, pos_b);
return BUF_FETCH_CHAR_AS_MULTIBYTE (ctx->buffer_a, bpos_a)
== BUF_FETCH_CHAR_AS_MULTIBYTE (ctx->buffer_b, bpos_b);
}

View File

@ -288,6 +288,17 @@
(buffer-string)
"foo bar baz qux"))))))
(ert-deftest replace-buffer-contents-bug31837 ()
(switch-to-buffer "a")
(insert-char (char-from-name "SMILE"))
(insert "1234")
(switch-to-buffer "b")
(insert-char (char-from-name "SMILE"))
(insert "5678")
(replace-buffer-contents "a")
(should (equal (buffer-substring-no-properties (point-min) (point-max))
(concat (string (char-from-name "SMILE")) "1234"))))
(ert-deftest delete-region-undo-markers-1 ()
"Make sure we don't end up with freed markers reachable from Lisp."
;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=30931#40