Make description of text properties on the form `(string ...)' work
* lisp/descr-text.el (describe-property-list): Don't special-case
for symbols that have widget properties here (bug#22957). It's
not documented that this function should do that, and looking at
the code, it doesn't seem like this function is actually used for
doing that, either. This makes describing some text properties
that are on the form `(string ...)' work.
* lisp/profiler.el (profiler--xref-backend): New function (bug#23455).
(profiler-report-mode): Use it to use the elisp xref handler when
hitting `M-.' in profiler buffers.
Stefan Monnier [Mon, 29 Jul 2019 18:59:26 +0000 (14:59 -0400)]
* lisp/progmodes/vhdl-mode.el: Use cl-lib when available
(vhdl--pushnew): New macro. Use it instead of `pushnew`.
(emacs-major-version): Don't bother checking (featurep 'xemacs)
since that is always (< emacs-major-version 25) as well.
Use it to improve the docstring of the accessor functions.
* doc/misc/cl.texi: Rename menu entry to "CL-Lib".
(Structures): Add ':documentation' and mention ':type' as well,
which we don't completely ignore any more.
* lisp/gnus/mm-decode.el (mm-display-external): Don't delete other
buffers when displaying parts (bug#22861) because that should be
up to the user, probably.
Add support for dealing with decoded time structures
* doc/lispref/os.texi (Time Conversion): Document the new
functions that work on decoded time.
(Time Calculations): Document new date/time functions.
* lisp/simple.el (decoded-time-second, decoded-time-minute)
(decoded-time-hour, decoded-time-day, decoded-time-month)
(decoded-time-year, decoded-time-weekday, decoded-time-dst)
(decoded-time-zone): New accessor functions for decoded time values.
* lisp/calendar/time-date.el (date-days-in-month)
(date-ordinal-to-time): New functions.
(decoded-time--alter-month, decoded-time--alter-day)
(decoded-time--alter-second, make-decoded-time): New functions
added to manipulate decoded time structures.
* src/timefns.c (Fdecode_time): Mention the new accessors.
* test/lisp/calendar/time-date-tests.el: New file to test the
decoded time functions and the other new functions.
* lisp/mh-e/mh-speed.el (mh-speed-parse-flists-output):
* lisp/mh-e/mh-search.el (mh-index-parse-search-regexp): Avoid
warning about `values-list' by using `cl-values-list' insead.
* lisp/net/rcirc.el (rcirc-kill-buffer-hook): Delete the process
in the buffer when killing server buffers to avoid triggering
errors from the sentinel (bug#23168).
Juri Linkov [Sun, 28 Jul 2019 22:45:36 +0000 (01:45 +0300)]
Move some uncontroversial char-folding pairs from test data to default values
* lisp/char-fold.el (char-fold--default-include)
(char-fold--default-exclude): Add some default values.
* test/lisp/char-fold-tests.el (char-fold--test-without-customization)
(char-fold--test-with-customization): Move some test data to
default values. Add more data for tests to pass. (Bug#35689)
Fix when calling prettify-symbols-mode more than once
* lisp/progmodes/prog-mode.el (prettify-symbols-mode): Allow
calling this mode several times without the earlier symbol alist
shadowing the newer (bug#23255).
* lisp/iimage.el (iimage-mode-buffer): Scale images down to the
width/height of the buffer (bug#23434). Also add `image-map' to
the images so that they can be further scaled.
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.