The `format` arg has been mandatory for a while, but the backward
compatibility code that handled the case of a missing `format` arg
made it hard to notice when using the old calling convention.
* lisp/subr.el (with-demoted-errors): Warn on missing `format` arg.
* lisp/emacs-lisp/smie.el (smie-indent--separator-outdent): Don't abuse
`with-demoted-errors`.
(smie-indent-line, smie-auto-fill):
* test/lisp/emacs-lisp/ert-tests.el (ert-test-with-demoted-errors):
* lisp/vc/vc-hooks.el (vc-refresh-state):
* lisp/vc/vc-annotate.el (vc-annotate-background-mode):
* lisp/vc/diff-mode.el (diff-syntax-fontify-hunk):
* lisp/textmodes/reftex-toc.el (reftex-re-enlarge):
* lisp/progmodes/sh-script.el (sh-smie-sh-rules):
* lisp/progmodes/octave.el (inferior-octave-startup):
* lisp/pcmpl-gnu.el (pcmpl-gnu-make-all-targets):
* lisp/org/org-refile.el (org-refile):
* lisp/org/org-capture.el (org-capture-store-last-position):
* lisp/nxml/nxml-mode.el (nxml-mode):
* lisp/notifications.el (notifications-notify):
* lisp/gnus/mm-view.el (mm-display-inline-fontify):
* lisp/finder.el (finder-unload-function):
* lisp/files.el (safe-local-variable-p, backup-buffer-copy
* lisp/autorevert.el (auto-revert-notify-handler):
Pass `format` arg to `with-demoted-errors`.
* lisp/autorevert.el (global-auto-revert-mode): Always switch on
the non-file tracking.
(auto-revert--global-possibly-adopt-current-buffer): New function
to respect dynamically changing `global-auto-revert-non-file-buffers'.
* lisp/autorevert.el (auto-revert-mode):
* lisp/files.el (revert-buffer): Mention that there is
revert-buffer-with-fine-grain that is better suited for markers
preservation (bug#49661).
* lisp/autorevert.el (auto-revert--buffer-by-watch-descriptor):
Rename from `auto-revert--buffers-by-watch-descriptor'. Make it
an assoc list.
(auto-revert-notify-rm-watch, auto-revert-notify-add-watch)
(auto-revert-notify-handler): Adapt accordingly. Based on a
patch provided by Spencer Baugh <sbaugh@catern.com>. (Bug#44639)
* doc/lispref/display.texi (Displaying Messages): Explain the
behavior of using minibuffer-message if the minibuffer is active.
* src/editfns.c (Fmessage_in_echo_area): New function with body
copied from Fmessage.
(Fmessage): Call minibuffer-message in the active minibuffer,
otherwise call Fmessage_in_echo_area.
(message-in-echo-area): New variable.
* lisp/isearch.el (isearch--momentary-message, isearch-message):
* lisp/minibuffer.el (minibuffer-message, minibuffer-completion-help):
Use 'message-in-echo-area' instead of 'message' where necessary.
* lisp/autorevert.el (auto-revert-handler):
* lisp/man.el (Man-bgproc-sentinel):
* lisp/subr.el (do-after-load-evaluation):
Revert recent changes that replaced 'message' with 'minibuffer-message'.
This is not needed anymore since 'message' uses 'minibuffer-message'
in the active minibuffer.
* lisp/autorevert.el (auto-revert-handler): Use 'minibuffer-message'
instead of 'message'. Call it from the original window's buffer
that in case of the minibuffer should be current, so
minibuffer-message could add a message to it. (Bug#34614)
* lisp/emacs-lisp/ert-x.el (ert--make-message-advice): Add nil to
the list of values to not use for format-message, because
minibuffer-message calls 'message' with nil argument, and tests fail.
* 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.
Make `auto-revert-avoid-polling' have effect in global-auto-revert-mode.
Buffers actually handled by that mode are marked with a non-nil value
of `auto-revert--global-mode'. When global-auto-revert-mode is
entered, eligible buffers are marked in that way, and hooks are set up
to mark new buffers and take care of buffers whose file names change.
This way the existing poll-avoidance logic can be used, since the
entire set of buffers in auto-revert is known.
A new hook, `after-set-visited-file-name-hook', was added to handle
the case when the file name of a tracked buffer changes.
* lisp/autorevert.el (auto-revert-avoid-polling): Amend doc string.
(auto-revert--global-mode): New buffer-local variable.
(global-auto-revert-mode): Mark existing buffers and set up hooks when
mode is entered; do the opposite when exited.
(auto-revert--global-add-current-buffer)
(auto-revert--global-adopt-current-buffer)
(auto-revert--set-visited-file-name-advice): New functions.
(auto-revert--polled-buffers, auto-revert--need-polling-p)
(auto-revert-notify-handler)
(auto-revert-active-p): Modify logic to cover global-auto-revert-mode.
* lisp/files.el (after-set-visited-file-name-hook): New hook.
(set-visited-file-name-hook): Call new hook.
* test/lisp/autorevert-tests.el (top): Use lexical-binding.
(auto-revert-test--write-file, auto-revert-test--buffer-string)
(auto-revert-test--wait-for, auto-revert-test--wait-for-buffer-text)
(auto-revert-test05-global-notify): New test.
* doc/lispref/hooks.texi (Standard Hooks):
Mention new hook (in a comment, since it's unclear whether it should
actually be documented here)
* etc/NEWS (Changes in Specialized Modes and Packages): Update entry.
Allow non-file buffers to declare that notification on their
default-directory is sufficient to know when auto-revert updates are
required by setting the new variable `buffer-auto-revert-by-notification'
to non-nil. If nil, the default, then auto-revert will poll
those buffers instead. (bug#35418).
Currently, only Dired sets that variable.
* lisp/autorevert.el (auto-revert-buffers):
Modify condition for using notification.
* lisp/files.el (buffer-auto-revert-by-notification): New variable.
* lisp/dired.el (dired-mode): Set buffer-auto-revert-by-notification.
* doc/emacs/arevert-xtra.texi (Non-File Buffers): Document new variable.
* etc/NEWS (Changes in Specialized Modes and Packages): Describe new variable.
It is a waste to periodically poll files that use change notification
in auto-revert mode; stop doing that. If no files need polling,
turn off the periodic execution entirely to further avoid wasting power.
Use a timer to inhibit immediate reversion for some time after a
notification, for throttling.
This change does not apply to files in global-auto-revert-mode, where
polling is still necessary. It is disabled by default, and enabled by
setting `auto-revert-avoid-polling' to non-nil.
* lisp/autorevert.el
(toplevel): Require cl-lib.
(auto-revert-avoid-polling, auto-revert--polled-buffers)
(auto-revert--need-polling-p, auto-revert--lockout-interval)
(auto-revert--lockout-timer, auto-revert--end-lockout): New.
(global-auto-revert-mode): Keep notifiers for buffers in auto-revert mode.
(auto-revert-set-timer): Use auto-revert--need-polling-p.
(auto-revert-notify-handler): Restart polling if notification stopped.
Use new lockout timer.
(auto-revert-buffers):
Use auto-revert--polled-buffers and auto-revert--need-polling-p.
(auto-revert-buffers-counter, auto-revert-buffers-counter-lockedout):
Remove.
* etc/NEWS (Changes in Specialized Modes and Packages):
Describe the new auto-revert-avoid-polling variable.
* doc/emacs/files.texi (Reverting):
Add paragraph describing auto-revert-avoid-polling.
* lisp/autorevert.el
(auto-revert-notify-watch-descriptor-hash-list):
Rename to auto-revert--buffers-by-watch-descriptor. Improved doc string.
(auto-revert-notify-rm-watch, auto-revert-notify-add-watch,
auto-revert-notify-handler): Use new name.
* lisp/autorevert.el (auto-revert-notify-handler):
When getting a `stopped' event, deal with it for the buffers it applies to,
rather than for all buffers in auto-revert mode.
* lisp/autorevert.el (auto-revert-use-notify, auto-revert-mode,
global-auto-revert-mode, auto-revert-notify-rm-watch,
auto-revert-notify-add-watch, auto-revert-notify-handler,
auto-revert-notify-rm-watch-callback):
Don't remove a notify descriptor after receiving a `stopped' notification
event, because the descriptor is then already gone and any attempt to
remove it causes a recursive call to `auto-revert-notify-handler'.
0589de5 (origin/emacs-26) Fix markup of fake keys in the ELisp manual
82d4b98 Avoid errors in Auto Revert mode
a3b1935 Mention empty strings in file name expansion, emacs lisp refe...
a38da0d cc-mode.texi: Work around makeinfo alignment bug. Fix proble...
464ee80 Warn against recursive invocations of 'buffer-list-update-hoo...
60b5c10 Provide more details in doc-string of 'delete-windows-on' (Bu...
f0be0f1 Improve documentation of 'delete-windows-on'
f1bddc7 * lisp/frame.el (make-frame-command): Doc fix. (Bug#34715)
2848623 Avoid undefined behavior in gdb-mi.el
dbf1837 * lisp/window.el (fit-frame-to-buffer): Make doc-string more ...
099ef44 Minor spelling and grammar fixes (bug#34756)
52fd400 Minor improvement of documentation of '(when CONDITION . SPEC)'
f872b65 Improve documentation of 'auto-coding-functions'
04cad5e Fix visiting XML files with non-Unix EOL format
a89fabe Update example major mode code in Elisp manual
# Conflicts:
# lisp/autorevert.el
# lisp/window.el
* lisp/autorevert.el (auto-revert-buffers): Cancel
auto-revert-timer only if it is non-nil. This avoids errors
on first invocation of Auto-Revert mode.
* lisp/autorevert.el (auto-revert-buffers): Handle buffers with a
remote default-directory only, when they are connected. (Bug#34196)
* lisp/net/tramp-rclone.el (tramp-rclone-maybe-open-connection):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-maybe-open-connection):
Set "connected" property.
* lisp/net/tramp.el (tramp-process-actions): Revert change from
2019-02-04. Bug#34196 will be solved in autorevert.el.
* lisp/autorevert.el (auto-revert-notify-add-watch):
Assert that a key in `auto-revert-notify-watch-descriptor-hash-list'
is a valid file notification descriptor. (Bug#33556)
* lisp/autorevert.el (auto-revert-notify-add-watch):
Handle buffers with same descriptor properly.
(auto-revert-notify-handler): Handle all buffers with same
descriptor. (Bug#33194)
* lisp/filenotify.el (file-notify-callback): Simplify.