Stefan Monnier [Tue, 9 Jul 2019 21:04:07 +0000 (17:04 -0400)]
* src/fileio.c: Fix bug#36431
(decide_coding_unwind): Re-introduce. Move text back to the gap.
Return the new `inserted` via the unwind_data.
(Finsert_file_contents): Use it.
Make sure `inserted` is always 0 when we jump straight to `notfound`.
Don't insert the text in the buffer until we know it's properly decoded
for the byteness of the buffer.
* test/src/fileio-tests.el (fileio-tests--insert-file-interrupt):
Allow insert-file-contents to return an empty buffer in case of
non-local exit in set-auto-coding-function.
Paul Eggert [Tue, 9 Jul 2019 20:55:16 +0000 (13:55 -0700)]
Defend fingerprint against even-smarter LTO
* src/pdumper.c (Fdump_emacs_portable, pdumper_load):
Don’t cast volatile to non-volatile pointer, as that does not in
general suffice to prevent a compiler from optimizing away memcmp
and/or memcpy calls. Instead, copy the fingerprint by hand.
Paul Eggert [Tue, 9 Jul 2019 20:10:27 +0000 (13:10 -0700)]
Do not alter match data in Fcapitalize etc.
Without this patch, (capitalize "x") can alter the match data,
which is not what users expect. Problem found by running
morse-tests-unnato-region in a stripped-down Emacs.
Perhaps ‘load’ should also save and restore the match data?
That would be a simpler fix, though arguably incompatible.
* src/lread.c (save_match_data_load): New function.
* src/chartab.c (uniprop_table):
* src/doc.c (reread_doc_file):
* src/eval.c (Fautoload_do_load):
* src/fns.c (Frequire): Use it.
Paul Eggert [Tue, 9 Jul 2019 20:02:51 +0000 (13:02 -0700)]
Port image-type-from-file-header-test to non-SVG Emacs
Problem reported privately by Michael Albinus.
* test/lisp/image-tests.el (image-type-from-file-header-test):
Don’t assume svg is a supported image type.
* lisp/json.el (json-pretty-print-max-secs): Make obsolete.
(json-pretty-print): Pretty-print all JSON objects in the region
instead of just the first one (and then deleting all other
objects) (bug#34160).
* lisp/json.el (json-pretty-print-max-secs): Make obsolete.
(json-pretty-print): Pretty-print all JSON objects in the region
instead of just the first one (and then deleting all other
objects) (bug#34160).
Clarify json-read and json-encode parameters and return values
* lisp/json.el (json-read): Try to clarify what's returned (bug#34242).
(json-encode): Refer to `json-read' about what the input is and
say what error is signalled.
Fix alternative-email-as-from with empty To headers in Message
* lisp/gnus/message.el (message-use-alternative-email-as-from):
Don't add a "," at the start of the address if the To header
doesn't exist (bug#34293).
* lisp/emacs-lisp/checkdoc.el (checkdoc--next-docstring): Don't
bug out on malformed Emacs Lisp (bug#34760).
(checkdoc-file-comments-engine): Don't bug out on empty buffers.
* lisp/delim-col.el (delimit-columns-region): Make the doc string
say a bit more about what it does (bug#35651).
(delimit-columns-rectangle): Refer to the first function.
Don't set url-mime-charset-string from set-language-environment
* lisp/url/url-vars.el (url-set-mime-charset-string): Make
obsolete and don't add to set-language-environment-hook
(bug#36268). If you loaded url-vars before calling
set-language-environment, you would suddenly get an unusable long
url-mime-charset-string.
* lisp/net/sieve.el (sieve-edit-script, sieve-upload): Do not pass
arbitrary string as first argument to 'message' (bug#25764).
(sieve-help): Split long string across multiple lines.
(sieve-refresh-scriptlist): Use ngettext. Fix grammar.
Ken Brown [Mon, 8 Jul 2019 22:37:33 +0000 (18:37 -0400)]
Ensure that expand-file-name returns an absolute file name
* src/fileio.c (Fexpand_file_name): Don't directly use the current
buffer's default-directory if it is relative. Instead replace it
by its expansion relative to invocation-directory. (Bug#36502)
* test/src/fileio-tests.el
(fileio-tests--relative-default-directory): New test.
* lisp/emacs-lisp/bytecomp.el (byte-compile-cond-use-jump-table): Set
to nil. We can turn this back on again when Bug#36447 is solved and
we handle dumped hash tables correctly.
Remove mention of :group in define-minor-mode info
* doc/lispref/modes.texi (Defining Minor Modes): The :group stuff
in the example and documentation isn't correct since this is not a
global mode and `hunger-mode' therefore isn't customizable
(bug#36501).
Eric Abrahamsen [Mon, 8 Jul 2019 17:53:07 +0000 (10:53 -0700)]
Improvements to sieve script usability
* lisp/net/sieve-mode.el (sieve-mode-menu): Add
`sieve-upload-and-kill' to the mode menu.
* lisp/net/sieve.el (sieve-manage-mode-menu): Add `sieve-manage-quit'
to the mode menu.
(sieve-help): Mention quitting in mode help.
(sieve-manage-mode): Directly derive from special-mode.
(sieve-edit-script): Start off with unmodified buffer.
(sieve-upload): Set buffer unmodified after successful upload.
Changes are aimed at 1) increasing discoverability of commands and 2)
using buffer modification to help users understand what's happening.
Eric Abrahamsen [Sun, 7 Jul 2019 23:25:14 +0000 (16:25 -0700)]
Make sure gnus-group-set-info sets both the hashtable and alist
* lisp/gnus/gnus-group.el (gnus-group-set-info): Apparently this
method of updating the group info will only apply to the
gnus-newsrc-hashtb, not gnus-newsrc-alist. Do the alist explicitly.
Michael Albinus [Mon, 8 Jul 2019 12:03:17 +0000 (14:03 +0200)]
Allow chown/chgrp for remote directories on w32
* lisp/dired-aux.el (dired-do-chgrp, dired-do-chown):
Allow them for remote directories, even when run on w32. See
<https://emacs.stackexchange.com/questions/51477/chown-with-dired-over-tramp-from-windows-machine>.
Alan Mackenzie [Mon, 8 Jul 2019 09:24:29 +0000 (09:24 +0000)]
Fix bug #36474, such that CC Mode quotes work properly in electric-pair-mode
Also finishes the fix for bug #36423.
* lisp/progmodes/cc-mode.el (c-initialize-cc-mode): Add an `eval-after-load'
to set electric-pair-inhibit-predicate for existing CC Mode buffers when
elec-pair.elc gets loaded.
(c-basic-common-init): Set electric-pair-inhibit-predicate when a CC Mode mode
gets initialized.
(c-electric-pair-inhibit-predicate): New function.
Juri Linkov [Sun, 7 Jul 2019 22:35:35 +0000 (01:35 +0300)]
Handle scroll-error-top-bottom in follow.el and view.el (bug#21893)
* lisp/follow.el (follow-scroll-up-arg, follow-scroll-up-window):
Use scroll-up-command instead of scroll-up.
(follow-scroll-down-arg, follow-scroll-down-window):
Use scroll-down-command instead of scroll-down.
(follow-scroll-up, follow-scroll-down): Handle scroll-error-top-bottom.
* lisp/view.el (view-scroll-lines): Use scroll-down-command
instead of scroll-down and scroll-up-command instead of scroll-up.
(view-really-at-end): Handle scroll-error-top-bottom.
Paul Eggert [Sun, 7 Jul 2019 19:29:27 +0000 (12:29 -0700)]
Remove printmax_t etc.
printmax_t etc. were needed only for platforms that lacked
support for printing intmax_t. These platforms are now so
obsolete that they are no longer practical porting targets.
* src/image.c (gs_load): Fix unlikely buffer overrun
discovered while making these changes. It was introduced in
2011-07-17T00:34:43!eggert@cs.ucla.edu.
* src/lisp.h (printmax_t, uprintmax_t, pMd, pMu, pMx):
Remove. All uses replaced by their standard counterparts
intmax_t, uintmax_t, PRIdMAX, PRIuMAX, PRIxMAX.
Describe the rx notation in the elisp manual (bug#36496)
The additions are excluded from the print version to avoid making it
thicker.
* doc/lispref/elisp.texi (Top): New menu entry.
* doc/lispref/searching.texi (Regular Expressions): New menu entry.
(Regexp Example): Add rx form of the example.
(Rx Notation, Rx Constructs, Rx Functions): New nodes.
* doc/lispref/control.texi (pcase Macro): Describe the rx pattern.
Paul Eggert [Sun, 7 Jul 2019 00:41:52 +0000 (17:41 -0700)]
Don’t ignore stderr failure when ADDRESS_SANITIZER
* src/emacs.c (close_output_streams): Move from here ...
* src/sysdep.c: ... to here, where it really belongs anyway.
When ADDRESS_SANITIZER, fflush stderr and check for ferror,
to catch stderr output errors even in this case.
Noam Postavsky [Sat, 28 Oct 2017 19:48:17 +0000 (15:48 -0400)]
Use buffer's name for help-mode bookmarks (Bug#24573)
* lisp/help-mode.el (help-bookmark-make-record): Replace buffer
objects with their names in help-args, otherwise the bookmark won't be
readable from the bookmark save file.
Wilson Snyder [Sat, 6 Jul 2019 17:27:13 +0000 (13:27 -0400)]
Backout replacing manually crafted hex regexes with [:xdigit:].
* lisp/progmodes/verilog-mode.el (verilog-delay-re):
(verilog-type-font-keywords, verilog-read-always-signals-recurse):
(verilog-is-number): Backout replacing manually crafted hex regexes with
[:xdigit:] (Bug#36167). This repairs Verilog-mode regressions;
Verilog-mode maintains back-compatibility with Emacsen before this syntax
was supported.
* doc/misc/gnus.texi (Foreign Groups): Update description of
gnus-read-ephemeral-emacs-bug-group for multiple bug
IDs (bug#11961).
* lisp/gnus/gnus-group.el (gnus-bug-group-download-format-alist):
Use HTTPS for Debian's bug tracker.
(gnus-group--read-bug-ids): New function for reading multiple bug
IDs in the minibuffer. Improves on previous brittle approach of
word-at-point -> read-string -> string-to-number by a) defaulting to
the more accurate bug-reference-bug-regexp or number-at-point
without using the intrusive INITIAL-INPUT argument, and b) not
attempting to parse bug IDs.
(gnus-read-ephemeral-bug-group): Use it. Extend docstring and
commentary. Fix handling of multiple bug IDs as either numbers or
strings. Hoist some string consing out of inner loop. Delete
temporary file even on error. Throw more informative error when
url-insert-file-contents successfully returns an error (bug#36433).
(gnus-read-ephemeral-debian-bug-group): Use gnus-group--read-bug-ids
and fix docstring for multiple bug IDs. Accept optional WINDOW-CONF
like other ephemeral bug group commands.
(gnus-read-ephemeral-emacs-bug-group): Use gnus-group--read-bug-ids
and fix string/numeric ID conversions. Try loading debbugs-gnu
before testing for debbugs-gnu-summary-mode (bug#36433).
Stefan Kangas [Sat, 6 Jul 2019 14:27:05 +0000 (16:27 +0200)]
Add tests for text-property-search to check prop-match-value
* test/lisp/emacs-lisp/text-property-search-tests.el
(with-match-test): New macro.
(text-property-search-forward-prop-match-match-face-nil-nil)
(text-property-search-forward-prop-match-match-face-bold-t)
(text-property-search-forward-prop-match-match-face-bold-nil)
(text-property-search-backward-prop-match-match-face-nil-nil)
(text-property-search-backward-prop-match-match-face-italic-t)
(text-property-search-backward-prop-match-match-face-italic-nil):
Add test cases to also verify the value of prop-match-value
(bug#36486).