This patch also moves the internal/external browser logic from
shr to browse-url, where it belongs more naturally.
* doc/misc/eww.texi (Basics): Adjust to browse-url-external-browser.
* doc/misc/gnus.texi (Article Commands): Ditto.
* lisp/gnus/gnus-art.el (gnus-button-url-regexp): Default to
`browse-url-button-regexp', which has taken over the definition
previously enjoyed by this variable.
* lisp/net/browse-url.el (browse-url--browser-defcustom-type): New
internal variable...
(browse-url-browser-function, browse-url-external-browser): Used
by these two; the latter of which is a new variable.
(browse-url-botton-regexp): New variable.
(browse-url-button-map): New keymap.
(browse-url-button): New face.
(browse-url-add-buttons): New function to add clickable browse-url
buttons to almost any buffer.
(browse-url-button-open): New command.
(browse-url-button-copy): New command.
Alan Mackenzie [Sun, 28 Jul 2019 13:30:38 +0000 (13:30 +0000)]
CC Mode. Fix (c-beginning-of-defun -1) getting stuck with structs.
In particular, with an initialization such as struct foo {..} bar = {...};
* lisp/progmodes/cc-cmds.el (c-forward-to-nth-EOF-{): Rename to
c-forward-to-nth-EOF-\;-or-}, and when the starting (or ending) position is in
the "variable" part of a struct/class/union/enum/etc., move to after the
terminating semicolon. Adjust the counting such that N only gets decremented
on a successful movement over {..}.
(c-beginning-of-defun, c-end-of-defun): Rename the calls to
c-forward-to-nth-EOF-}, as above.
Have emacsbug only warn the user when sending to the bug address
* lisp/mail/emacsbug.el (report-emacs-bug-hook): Only ask for
confirmation if we're really sending the bug report to the bug
address. If the user is sending it somewhere else (to themselves,
for instance), the warning is misleading.
Allow the user to send a bug report after initially saying "no"
* lisp/mail/emacsbug.el (report-emacs-bug-hook): Don't remove the
address in the To: header (or the hook) after the user has said
"no" (bug#23799). This made it impossible for the user to do
touch-ups and then resent the bug report.
Always set the state of the "Show hidden files" gtk button
* src/gtkutil.c (xg_get_file_with_chooser): Always set the state
of the "Show hidden files" button (bug#23977). If not, the
visible state and the actual state get out of sync.
Make `ispell-change-dictionary' only list installed dictionaries
* lisp/textmodes/ispell.el (ispell-find-aspell-dictionaries): If
the backend (i.e., aspell/hunspell) provided a list of languages,
don't add the base list (bug#24050).
(ispell-set-spellchecker-params): Ditto.
* lisp/emacs-lisp/testcover.el (testcover-before)
(testcover-after, testcover-mark)
(testcover-analyze-coverage-edebug-after): Adjust usage of
`unknown' to `edebug-unknown' in testcover.el in addition to
edebug.el (bug#25471).
This fix was provided by Pip Cet <pipcet@gmail.com>. It tightens the
code that tries to recognize a bytecode sequence as being a simple
function call (to then decompile it), which occasionally misfired.
I added some minor changes found while investigating this issue.
(byte-compile): Handle corner case where byte-compile-top-level returns
a non-self-evaluating expression.
(byte-compile-out-toplevel): Remove support for `progn` and `t` values
of output-type which aren't used anywhere.
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'.