Alan Mackenzie [Sat, 27 Jul 2019 16:28:48 +0000 (16:28 +0000)]
Java Mode: Fix handling of nested generics ending in >>>.
This fixes bug #24671.
* lisp/progmodes/cc-langs.el (c-multichar->-op-not->>-regexp): remove,
transforming into ...
(c-multichar->-op-not->>->>>-regexp) New lang const/var.
* lisp/progmodes/cc-engine.el (c-forward-<>-arglist-recur): use the new
c-multichar->-op-not->>->>>-regexp in place of the old
c-multichar->-op-not->>-regexp.
Eric Abrahamsen [Sat, 27 Jul 2019 16:11:04 +0000 (09:11 -0700)]
Adjust location of Gnus group split setup process
Updating group splits requires the gnus-newsrc-hashtb to be
initialized. Previously this failed silently, now it errors.
* lisp/gnus/gnus-mlspl.el (gnus-group-split-setup): Don't call the
update when loading the user's init file, that's too early. Use
appropriate hooks depending on AUTO-UPDATE.
* doc/misc/gnus.texi (Group Mail Splitting): Change mention in docs.
* lisp/leim/quail/latin-ltx.el: Map all the \\long.*arrow inputs
to the long characters instead of the normal ones (i.e., LONG
RIGHTWARDS ARROW instead of RIGHTWARDS ARROW) (bug#24302).
* lisp/dired.el (dired-socket): New face for pipes and sockets
(bug#24547).
(dired-re-socket): New regexp to match them.
(dired-font-lock-keywords): Use them.
Only insert XML declarations in nxml-mode when the buffer is empty
* lisp/nxml/nxml-mode.el (nxml-mode): Don't insert the XML
declaration unless it's an empty buffer (bug#24978). This avoids
the problem of the declaration being inserted by mistake when
opening XML files from archives and the like -- the file doesn't
exist on the file system there, either, so it would typically lead
to doubled XML declarations.
Pip Cet [Mon, 22 Jul 2019 02:40:35 +0000 (02:40 +0000)]
Use the CSS convention for #RGB colors (bug#36304)
* src/xterm.c (x_parse_color): Change interpretation of #RGB color
triplets to match CSS rather than X conventions.
* lisp/term/tty-colors.el (tty-color-standard-values): Change
interpretation of #RGB color triplets to match CSS rather than X
conventions. Allow upper-case digits. Fix rgb:R/G/B
interpretation.
* doc/emacs/display.texi (Colors): Specify the convention used for
"#RGB" color triplets.
Allow global-auto-revert-ignore-buffer to be a predicate function
* lisp/autorevert.el (global-auto-revert-ignore-buffer): Allow
this to be a predicate function (bug#25277).
(auto-revert--global-add-current-buffer): Use it.
* lisp/url/url-http.el (url-handle-content-transfer-encoding): Modify
the message headers as well as the message body to reflect
decompression.
* lisp/mail/mail-utils.el (mail-fetch-field): Add DELETE argument, to
delete header lines included in the result.
Rename coverage symbols in edebug to avoid collisions
* lisp/emacs-lisp/edebug.el (edebug-clear-coverage): Use
edebug-unknown and edebug-ok-coverage instead of unknown and
ok-coverage to avoid naming collisions with packages that use
those two symbols (bug#25471).
(edebug--update-coverage, edebug-display-freq-count): Ditto.
Stefan Monnier [Fri, 26 Jul 2019 18:59:15 +0000 (14:59 -0400)]
Don't dump the `hash` vector if it will need to be recomputed anyway
* src/fns.c (hash_table_rehash): Only set `hash` field at the end.
(sweep_weak_table): Only set slot of `hash` vector when that vector exists.
(Fhash_table_count): No need to hash_rehash_if_needed any more.
* src/lisp.h (hash_rehash_needed_p): Test the presence of `hash` instead.
* src/pdumper.c (check_hash_table_rehash, dump_hash_table):
Set `hash` to nil to indicate that the table needs to be rehashed.
Stefan Monnier [Fri, 26 Jul 2019 18:24:02 +0000 (14:24 -0400)]
* src/fns.c: Use `EQ (key, Qunbound)` to check if a slot is in use
(make_hash_table): Use Qunbound for the key_and_value table.
(maybe_resize_hash_table): Set new key_and_value slots to Qunbound.
(hash_table_rehash): Don't bother copying the old table of hashes since
we're recomputing it completely.
(hash_table_rehash): Use hash_rehash_needed_p more.
(hash_put): Add assertion that the slot was indeed considered empty.
(hash_remove_from_table, hash_clear, sweep_weak_table): Set empty
slot's key to Qunbound.
(Fmaphash): Use `EQ (key, Qunbound)` to check if a slot is in use.
Alan Mackenzie [Fri, 26 Jul 2019 17:48:45 +0000 (17:48 +0000)]
CC Mode. Create lang vars for certain skipping expressions at compile time
This saves repeated calculations at run time.
* lisp/progmodes/cc-langs.el (c-stmt-boundary-skip-chars)
(c-stmt-boundary-skip-list, c-stmt-boundary-skip-chars-with-comma)
(c-stmt-boundary-skip-list-with-comma): New lang constants/variables.
* lisp/progmodes/cc-engine.el (c-commas-bound-stmts): New variable
(c-beginning-of-statement-1): Set c-commas-bound-stmts rather than
c-stmt-delim-chars.
(c-crosses-statement-barrier-p): Remove the now unneeded calculations of
c-stmt-delim-chars. Set skip chars to one of the new lang variables, and
later to a substring of it.
(c-at-statement-start-p): Set c-syntactic-skip-backward from the new
variables.
(c-at-expression-start-p): Bind c-commas-bound-stmts. Use
c-stmt-delim-chars-with-comma rather than c-stmt-delim-chars in a backward
scan.
(c-guess-basic-syntax): Bind c-commas-bound-stmts rather than
c-stmt-delim-chars to itself. Bind c-commas-bound-stmts to t at another place
rather than setting c-stmt-delim-chars to c-stmt-delim-chars-with-comma.
Paul Eggert [Fri, 26 Jul 2019 16:46:18 +0000 (09:46 -0700)]
Fix recently-introduced file-name-absolute-p typo
Fix a bug introduced in 2019-07-24T21:28:13!eggert@cs.ucla.edu.
* src/fileio.c (file_name_absolute_p):
~/foo is also absolute (Bug#36809).
* test/src/fileio-tests.el (fileio-tests--file-name-absolute-p):
Rename from fileio-tests--no-such-user and add more tests.
Paul Eggert [Fri, 26 Jul 2019 16:41:30 +0000 (09:41 -0700)]
Fix ‘make check’ failure
Problem introduced in 2019-07-26T07:08:40!larsi@gnus.org.
* lisp/emacs-lisp/ert.el (ert-summarize-tests-batch-and-exit):
Don’t count "0 unexpected" as unexpected.
* lisp/gnus/gnus-sum.el (gnus-summary-browse-url): Don't force
article conf, because the command may be called from the article
buffer (which may be the only buffer displayed).
* lisp/dired.el (dired-pop-to-buffer): `dired-mark-pop-up' doesn't
seem to have anything to do with this function, so saying that
it's a replacement seems misleading (bug#26243).
Don't infloop in url.el when sending invalid basic auth
* lisp/url/url-http.el (url-http-handle-authentication): Bail out
if the wrong credentials were passed to the server instead of
inflooping (bug#27022).
* lisp/emacs-lisp/package.el (package-check-signature): Don't run
gpg on startup, but just default to `allow-unsigned'.
(package-check-signature): New function to check whether a OpenPGP
configuration is found when `allow-unsigned'.
(package--check-signature-content, package--check-signature)
(package--download-one-archive, package-refresh-contents)
(package-install-from-archive): Use function instead of variable
throughout.
* doc/emacs/package.texi (Package Installation): Document this.
Paul Eggert [Fri, 26 Jul 2019 06:17:52 +0000 (23:17 -0700)]
Minor pdumper tweaks
* src/pdumper.c (dump_hash_table_stable_p):
Bool vectors and bignums are also stable keys.
(decode_emacs_reloc, drain_reloc_list, Fdump_emacs_portable):
(dump_bitset_clear): Simplify use of memset.
Make cl-destructuring-bind errors a bit more understandable
* lisp/emacs-lisp/cl-macs.el (cl-destructuring-bind): Make errors
when giving the wrong number of arguments to the bindings form
more informational (bug#29345).
Tweak the sizing of the shr placeholder images on HiDPI screens
* lisp/net/shr.el (shr-make-placeholder-image): We have already
computed the size of the placeholder including the scale, so force
the automatic scale to 1. This will make the placeholder the
correct size on HiDPI screen.
Make `C-u w' in the Gnus Summary buffer open externally
* doc/misc/gnus.texi (Article Commands): Document new behaviour.
* lisp/gnus/gnus-sum.el (gnus-shorten-url): New function.
(gnus-summary-browse-url): Change function to make `C-u' use the
external browser (as Gnus does when you hit URLs manually). Don't
use an initial input.
Fix setting fill-paragraph-function in footnote-mode
* lisp/mail/footnote.el (footnote--local-advice): New macro
refactored out from the code used to advice
footnote--adaptive-fill-function in footnote-mode.
(footnote-mode): Use it to advice both that variable and
fill-paragraph-function (the latter to avoid overwriting the major
mode's value) (bug#27775)
(footnote--fill-paragraph): Adjust calling convention now that
it's an :around advice.
Eli Zaretskii [Thu, 25 Jul 2019 16:47:56 +0000 (19:47 +0300)]
Fix HarfBuzz support on MS-Windows
* src/w32uniscribe.c [HAVE_HARFBUZZ]: Include hb-ot.h.
(fn_hb_ot_font_set_funcs, hb_ot_font_set_funcs): Define.
(w32hb_get_font): Call hb_ot_font_set_funcs after creating the
hb_font_t object, to make the code work with versions of
HarfBuzz before 2.0.0. Problem reported by Stephen Leake
<stephen_leake@stephe-leake.org>. Solution suggested by
Khaled Hosny <dr.khaled.hosny@gmail.com> in
https://lists.freedesktop.org/archives/harfbuzz/2019-July/007412.html.
Clarify in the manual when to use function-key-map
* doc/misc/efaq.texi (No Escape key):
* doc/emacs/msdos-xtra.texi (MS-DOS Keyboard): Change back to
function-key-map from local-function-key-map, because these
bindings apply to all terminals.
* doc/lispref/keymaps.texi (Translation Keymaps): Clarify in what
circumstances you may still want to use function-key-map.
Paul Eggert [Wed, 24 Jul 2019 21:28:13 +0000 (14:28 -0700)]
Do not treat ~nosuchuser as an absolute file name
Derived from Ken Brown’s patch (Bug#36502#97).
* doc/lispref/files.texi (Relative File Names):
* etc/NEWS: Document this.
* src/fileio.c (user_homedir): New function.
(Fexpand_file_name, file_name_absolute_p): Use it.
(search_embedded_absfilename): Simplify via file_name_absolute_p.
* test/src/fileio-tests.el (fileio-tests--no-such-user): New test.
Sam Steingold [Wed, 24 Jul 2019 20:44:03 +0000 (16:44 -0400)]
Add `gnus-collect-urls-primary-text'
* lisp/gnus/gnus-sum.el (gnus-collect-urls-primary-text): Add defcustom.
(gnus-collect-urls): Use it.
(gnus-summary-browse-url): Mention it in the docstring.
Paul Eggert [Wed, 24 Jul 2019 18:28:48 +0000 (11:28 -0700)]
Port double-slash test to z/OS
* admin/merge-gnulib (GNULIB_MODULES): Add double-slash-root.
Emacs was already using this Gnulib module indirectly, so this
is merely noting that there is now a direct dependency.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* src/fileio.c (search_embedded_absfilename):
Use DOUBLE_SLASH_IS_DISTINCT_ROOT instead of (WINDOWSNT || CYGWIN).
Simplify.
* doc/misc/edt.texi (Changes):
* doc/emacs/custom.texi (Terminal Init): Use input-decode-map
instead of local-function-key-map, according to Stefan Monnier.
Use defstruct instead of list for filenotify pending-rename
* lisp/filenotify.el (file-notify--rename): New defstruct.
(file-notify--pending-rename): Changed type.
(file-notify--handle-event): Adapt to new type.
Split callback code into backend-specific and general parts. Refactor
pending event, which is always a rename, to include relevant
information only. General clean-up.
* lisp/filenotify.el (file-notify--pending-event): Rename.
(file-notify--event-watched-file, file-notify--event-file-name)
(file-notify--event-file1-name, file-notify--event-cookie): Remove.
(file-notify--rename, file-notify--expand-file-name)
(file-notify--callback-inotify, file-notify--callback-kqueue)
(file-notify--callback-w32notify, file-notify--callback-gfilenotify)
(file-notify--call-handler, file-notify--handle-event): New.
(file-notify-callback): Split general parts into
file-notify--call-handler and file-notify--handle-event.
(file-notify--add-watch-inotify, file-notify--add-watch-kqueue)
(file-notify--add-watch-w32notify)
(file-notify--add-watch-gfilenotify): Use new callbacks.
* test/lisp/filenotify-tests.el
(file-notify--test-file, file-notify--test-add-watch): New.
(file-notify--test-event-test, file-notify--test-event-handler)
(file-notify-test02-rm-watch, file-notify-test03-events)
(file-notify-test05-file-validity, file-notify-test07-many-events)
(file-notify-test08-backup, file-notify-test09-watched-file-in-watched-dir):
Avoid using the internal `file-notify--event-watched-file' so that it
can be removed from filenotify.el.
Instead, pass the file name to the callback as an extra argument;
use `file-notify--test-add-watch' instead of `file-notify-add-watch'.
* test/lisp/filenotify-tests.el (file-notify--test-event-file)
(file-notify--test-event-file1, file-notify--test-event-test)
(file-notify--test-event-handler):
Define accessors locally, so that they can be removed from filenotify.el.
* lisp/char-fold.el (char-fold--default-include)
(char-fold--default-exclude, char-fold--default-symmetric)
(char-fold--previous): New defconsts.
(char-fold-include, char-fold-exclude, char-fold-symmetric):
New defcustoms.
(char-fold-make-table): Use them.
(char-fold-update-table): New function called at top-level.
* test/lisp/char-fold-tests.el (char-fold--test-no-match-exactly)
(char-fold--permutation): New functions.
(char-fold--test-without-customization)
(char-fold--test-with-customization): New tests.
Paul Eggert [Tue, 23 Jul 2019 18:18:16 +0000 (11:18 -0700)]
Merge pdumper.c and alloc.c builtin symbol tests
* src/alloc.c (c_symbol_p): Move from here ...
* src/lisp.h (c_symbol_p): ... to here, and make it more portable
to hypothetical platforms where pointers are wider than ptrdiff_t.
* src/pdumper.c (dump_builtin_symbol_p): Use c_symbol_p.
Make "Compiling" in the mode line a clickable command
* lisp/progmodes/compile.el (compilation-goto-in-progress-buffer):
New command.
(compilation-in-progress): Don't put the in-progress mode-line
marker among the minor modes (because it's not a minor mode), and
add a command that allows you to switch to the in-progress
compilation buffer (bug#27252).
Robert Pluim [Mon, 22 Jul 2019 18:27:59 +0000 (20:27 +0200)]
Follow decomposition chains when constructing char-fold-table
* lisp/char-fold.el (char-fold-make-table): Decompose the
decomposition of each character, adding equivalences to the original
character, until no more decompositions are left.
Refer to local-function-key-map in various manuals
* doc/misc/viper.texi (Key Bindings):
* doc/misc/efaq.texi (X key translations for Emacs)
(No Escape key):
* doc/misc/edt.texi (Changes):
* doc/emacs/msdos-xtra.texi (MS-DOS Keyboard):
* doc/emacs/custom.texi (Terminal Init): Refer to
local-function-key-map instead of function-key-map, since the
latter isn't supposed to be changed (bug#27490).
Paul Eggert [Tue, 23 Jul 2019 16:19:09 +0000 (09:19 -0700)]
Improve pdumper doc; say unexec is deprecated
Say that pdumping cannot redump unless -batch is used. Say that
the traditional unexec dumping method is by default not available,
and is deprecated. Don't call dump files "portable", as dump files
are not any more portable than the Emacs executables themselves.
Just call them "dump files". Similar, prefer "portable dumper"
(since the dumper code is portable) to "portable dumping" (since
the dump file is not). Be more systematic about calling them
"dump files" instead of "dumped images" or whatnot.
Alan Mackenzie [Tue, 23 Jul 2019 09:55:49 +0000 (09:55 +0000)]
Fix problems in CC Mode with " being entered into a comment at EOB.
* lisp/progmodes/cc-engine.el (c-full-lit-near-cache): Amend the definition
such that an element's END element will be nil if the pertinent literal is
open at EOB.
(c-full-pp-to-literal): Before setting the aforementioned END element, check
that we're no longer in a literal. (c-literal-limits): When
c-full-pp-to-literal returns a list with a nil END element, replace this by
(point-max) to keep the interface of c-literal-limits unchanged.
* lisp/progmodes/cc-mode.el (c-after-change-mark-abnormal-strings): Having
found a string quote, check it is not inside an unterminated comment (i.e. one
at EOB).
Paul Eggert [Tue, 23 Jul 2019 08:42:32 +0000 (01:42 -0700)]
Support "%x" etc. formats on more floats
* doc/lispref/strings.texi (Formatting Strings): Document this.
* src/editfns.c (styled_format): Support %o, %x, and %X on
finite floats less than zero or greater than UINTMAX_MAX.
* test/src/editfns-tests.el (format-%x-large-float)
(read-large-integer, format-%o-negative-float):
Adjust tests to match extended behavior.
Rename the latter test from format-%o-invalid-float,
since the float is no longer invalid.
* test/src/editfns-tests.el (format-%x-large-float)
(read-large-integer): Test this.
Paul Eggert [Tue, 23 Jul 2019 04:27:33 +0000 (21:27 -0700)]
Avoid overexposing fixnums for hash codes
Following a suggestion by Stefan Monnier in:
https://lists.gnu.org/r/emacs-devel/2019-07/msg00530.html
* doc/lispref/hash.texi (Creating Hash, Defining Hash):
* src/fns.c (Fsxhash_eq, Fsxhash_eql, Fsxhash_equal, Fmake_hash_table):
Don’t insist that hash codes be fixnums, reverting
the recent doc changes to the contrary.
* src/bytecode.c (exec_byte_code): Special-case only the eq case,
as the others aren’t worth tuning now that we treat bignum hashes
like fixnums.
* src/fns.c (hashfn_user_defined): If the hash code is a bignum,
reduce its hash down to a fixnum.