`decoded-time-set-defaults' refactored out from iso8601 code
* lisp/calendar/iso8601.el (iso8601--encode-time):
* lisp/calendar/time-date.el (decoded-time-set-defaults):
Refactor out from `iso8601--encode-time', because it's helpful
in other contexts.
Michael Albinus [Wed, 31 Jul 2019 19:22:48 +0000 (21:22 +0200)]
Call file notification actions properly in filenotify-tests.el
* test/lisp/filenotify-tests.el (file-notify--test-wait-for-events):
Rename from `file-notify--wait-for-events'. Adapt all callees.
(file-notify--test-cleanup): Reset also `file-notify--test-event'
and `file-notify--test-file nil'.
(file-notify--test-event-desc, file-notify--test-event-action):
New accessor functions.
(file-notify-test02-rm-watch, file-notify--test-event-test)
(file-notify--test-with-actions-check)
(file-notify--test-with-actions-explainer): Use them.
(file-notify--test-with-actions-check)
(file-notify--test-with-actions-explainer)
(file-notify--test-with-actions): Rename them from *-events-*.
Rename also internal variables accordingly. Adapt all callees.
Michael Albinus [Wed, 31 Jul 2019 19:22:05 +0000 (21:22 +0200)]
Distinguish different file notification events
* lisp/filenotify.el (file-notify--watch): Add docstring.
(file-notify-descriptors, file-notify--rm-descriptor)
(file-notify--pending-rename): Adapt docstring.
(file-notify): New defstruct.
(file-notify-handle-event): Rename argument to OBJECT. Use
accessor functions of the defstruct.
Stefan Monnier [Wed, 31 Jul 2019 15:19:39 +0000 (11:19 -0400)]
* src/lread.c (infile): Set/reset it like a dynamically scoped variable
I've seen segfaults where `infile` is nil when we get to
readbyte_from_file, presumably because Fload set it to NULL (via
close_infile_unwind) just before returning to its caller which was
probably itself within another read/load and for some reason
readevalloop didn't get to re-set `infile` like it used to do at every
iteration. I was not able to really track down the bug, but the way
`infile` was set/reset seemed fragile and managing it like a standard
dynamically-scoped var seems both safer (and more efficient since we
don't need readevalloop to constantly re-set it).
(readchar): Assert that `infile` is set if using a function the depends on it.
(readbyte_from_file): Assert that `infile` is set.
(close_infile_unwind): Reset `infile` to its previous value rather than
to NULL.
(Fload): Remember the previous value of `infile` before chaning it.
(readevalloop): Don't set `infile` any more.
* doc/lispref/positions.texi (List Motion): Remove xref, the text it
references was removed in 2018-02-15 "Document
open-paren-in-column-0-is-defun-start being of less importance".
Stefan Monnier [Tue, 30 Jul 2019 20:37:01 +0000 (16:37 -0400)]
* lisp/gnus/message.el: Reduce redundancy with send-mail-function
(message-send-mail-function) <function>: Remove `local-library` tests
for libs distributed with Emacs.
(message-use-send-mail-function): New function.
(message-default-send-mail-function): Default to it, and remove cases
already handled by it.
(message--default-send-mail-function): New function.
(message-send-mail-function) <variable>: Use it as new default.
(message-sendmail-f-is-evil): Obey mail-specify-envelope-from if available.
(message-check, message-with-reply-buffer): Use `declare`.
(message-smtpmail-send-it): smtpmail accepts mail-header-separator,
so simplify and declare obsolete.
(message-send-mail-with-mailclient): Declare obsolete.
(message-check-news-body-syntax): Don't presume that the checksum is
a fixnum.
Guard against flymake-no-changes-timeout being nil
* test/lisp/progmodes/flymake-tests.el
(flymake-tests--wait-for-backends): Guard against
flymake-no-changes-timeout being nil (in personal configurations)
to help when running tests interactively.
* lisp/gnus/gnus-sum.el (gnus-summary-widget-forward)
(gnus-summary-button-forward, gnus-summary-widget-backward)
(gnus-summary-button-backward, gnus-collect-urls-primary-text)
(gnus-collect-urls, gnus-summary-browse-url): Stop using widgets
and star using button.el buttons instead.
* lisp/gnus/mm-decode.el (mm-shr, mm-handle-filename): Don't
convert shr buttons into widgets.
* doc/lispref/display.texi (Button Buffer Commands)
(Button Buffer Commands): Document this.
* lisp/button.el (backward-button, forward-button): Accept a
NO-ERROR parameter.
(button-activate): Make it possible to have specific data in the
callback action.
* doc/emacs/programs.texi (Left Margin Paren): Add index for "\( in
strings".
* doc/lispref/positions.texi (List Motion): Add index, and cross
reference.
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.