info-lookup-symbol: Fix the suggested default value in Custom buffers
* lisp/info-look.el (info-lookup-maybe-add-help 'Custom-mode): Don't
pass info-lookup-guess-custom-symbol as the :parse-rule, since we
don't need it anymore. (Bug#41905)
(info-lookup-guess-custom-symbol): Now unused, mark as obsolete.
(info-lookup-interactive-arguments): Get rid of text properties before
passing the default value to completing-read.
* lisp/progmodes/cperl-mode.el (cperl-init-faces): Fontify hashes
and arrays (%foo and @foo) before the keywords, since the keyword
regexps are "wider" and the hash/array regexp just match those two
things (bug#22867).
Preserve user customizations after disabling a theme
* lisp/custom.el (enable-theme): Since we are enabling the theme, bind
custom--inhibit-theme-enable to nil. Then rely on custom-push-theme
to do the right thing with the theme settings and prior user settings,
instead of manipulating the property here. This way, when disabling a
theme, we restore user preferences, even when the values were changed
outside of customize.
(disable-theme): Call custom-push-theme instead of handling theme
settings directly.
(custom-push-theme): Avoid another instance of Bug#28904: we don't
need the changed theme when the value recorded for it is going to be
the same as the recorded for the user theme.
* test/lisp/custom-tests.el (custom--test-theme-variables): Get rid of
a portion of the test that will always fail, because the user theme
has priority over every other theme. Expect the test to pass now that
we preserve user customizations after disabling a theme (bug#34027).
Andrew G Cohen [Sat, 5 Sep 2020 08:47:06 +0000 (16:47 +0800)]
; Document new gnus-summary-line-format items
* lisp/gnus/gnus.el (gnus-summary-line-format): Include %Z, %G, and %g
in the docstring.
* doc/misc/gnus.texi (Summary Buffer Lines): Document %Z, %G, and %g
specifications.
Andrew G Cohen [Sat, 5 Sep 2020 00:46:43 +0000 (08:46 +0800)]
Introduce nnselect backend for gnus
This new backend allows gnus to handle arbitrary sets of messages
spanning multiple groups, even when these groups are from different
backends and different servers. All gnus glue is removed from
nnir (leaving only the backend search functions) and gnus
search-related processing is done through nnselect. In appropriate
places 'nnir' has been replaced by 'nnselect' or 'search'.
* etc/NEWS: Document the change.
* doc/misc/gnus.texi: New documentation for nnselect and update
searching and thread-referral sections.
* lisp/gnus/nnselect.el: New file.
* lisp/gnus/nnir.el: Remove all gnus glue, leaving only searching
capability. Improve documentation strings.
* lisp/gnus/gnus-group.el (gnus-group-read-ephemeral-search-group,
gnus-group-make-search-group): New functions.
* lisp/gnus/gnus-msg.el (gnus-setup-message, gnus-group-news,
gnus-summary-news-other-window): Update to work for nnselect. Fix
gnus-newsgroup-name wrangling.
*lisp/gnus/gnus-registry.el
(gnus-registry-action,gnus-registry-ignore-group-p): Make work from nnselect.
* lisp/gnus/nnheader.el (nnheader-parse-head, nnheader-parse-nov):
Rework and consolidate header parsing.
* lisp/gnus/gnus-agent.el (gnus-agent-regenerate-group):
* lisp/gnus/gnus-cache.el (gnus-possibly-enter-article):
* lisp/gnus/gnus-cloud.el (gnus-cloud-available-chunks):
* lisp/gnus/gnus-msg.el (gnus-inews-yank-articles):
* lisp/gnus/gnus-sum. (gnus-get-newsgroup-headers):
* lisp/gnus/nndiary.el (nndiary-parse-head):
* lisp/gnus/nnfolder.el (nnfolder-parse-head):
* lisp/gnus/nnmaildir.el (nnmaildir--update-nov):
* lisp/gnus/nnml.el (nnml-parse-head):
* lisp/gnus/nnspool.el (nnspool-insert-nov-head):
Use new header parsing.
* lisp/gnus/gnus-start.el (gnus-read-active-for-groups): Rescan on
activation by default.
* lisp/gnus/gnus-sum.el (gnus-summary-line-format-alist): New specs
for virtual groups.
(gnus-article-sort-by-rsv, gnus-thread-sort-by-rsv): New functions to
allow sorting by search RSV.
Do not remove unbound variables or faces when modifying a custom-theme
* lisp/cus-theme.el (custom-theme-write-variables
custom-theme-write-faces): Remove check for a bound symbol or for a
face name, so saving a theme does not remove not yet defined variables
or faces (bug#24727).
Michael Albinus [Fri, 4 Sep 2020 13:09:08 +0000 (15:09 +0200)]
Extend dbus.el by error messages, and :write access type
* doc/misc/dbus.texi (Receiving Method Calls): Describe how to
produce D-Bus error messages.
(Receiving Method Calls): Support :write access type.
* lisp/net/dbus.el (dbus-error-dbus, dbus-error-failed)
(dbus-error-access-denied, dbus-error-invalid-args)
(dbus-error-property-read-only): New defconsts.
(dbus-method-error-internal): Add arg ERROR-NAME.
(dbus-register-method): Adapt docstring.
(dbus-handle-event): Handle error messages returned from the handler.
(dbus-get-this-registered-property)
(dbus-get-other-registered-property): New defuns.
(dbus-register-property): Support :write access type.
(dbus-property-handler): Submit proper D-Bus error messages.
Handle several paths at the same interface.
* src/dbusbind.c (Fdbus_message_internal): Improve handling of
DBUS_MESSAGE_TYPE_ERROR.
Document :type-error property for customization types
* doc/lispref/customize.texi (Type Keywords): Document :type-error, so
Lisp programs can display a more correct message when the value of a
user option doesn't match its type (bug#23975).
Robert Pluim [Fri, 4 Sep 2020 04:28:21 +0000 (06:28 +0200)]
Show log suppression buttons in display-warning buffer
* etc/NEWS: Describe 'display-warning' button change (bug#30757).
* lisp/emacs-lisp/warnings.el (warning-suppress-warning):
Define button.
(warning-suppress-action): New function.
(warning-suppress-log-warning): Define button.
(warning-suppress-log-action): New function.
(display-warning): Show buttons to allow permanent
modification of warning-suppress-types and
warning-suppress-log-types per warning.
wdired-do-renames: Speed up for long Emacs sessions
`dired-rename-file' calls unconditionally `dired-rename-subdir'.
The second function performs performs a loop on all the Emacs
buffers; this step is only needed if FILE is a directory (bug#32899).
In a long lived Emacs session, this can make a difference
when renaming a bunch of files with `wdired'.
For instance, in my 40 days old Emacs session, with ~ 700 buffers,
this patch increases the speed to rename 2000 files a factor ~ 15.
* lisp/dired-aux.el (dired-rename-file): Call `dired-rename-subdir'
iif FILE is a directory. Add docstring.
(dired-rename-subdir, dired-remove-entry)
(dired-remove-file): Add docstring.
(dired-remove-entry): Move definition into `dired.el'.
* lisp/wdired.el (wdired-do-renames): Use a progress-reporter.
* lisp/dired.el (dired-delete-entry):
Use `dired-remove-entry'. Add docstring.
(dired-buffers-for-dir, dired-fun-in-all-buffers):
Change comment into docstring.
(dired-fun-in-all-buffers): Prefer `when' and `push' here.
Harald Jörg [Fri, 4 Sep 2020 03:13:43 +0000 (05:13 +0200)]
Fix infloop when indenting in cperl-mode
* lisp/progmodes/cperl-mode.el (cperl-indent-exp): Fix (Bug#10483)
Perl expressions (e.g. function calls) ending in ")" without
statement terminator on the same line no longer loop endlessly.
Stefan Monnier [Fri, 4 Sep 2020 02:03:46 +0000 (22:03 -0400)]
* lisp/mail/mspools.el: Use lexical-scoping. Autoload `mspools-show`.
(mspools-mode-map): Remove bindings made redundant by `special-mode-map`.
(mspools-show): Autoload. Use `erase-buffer`.
(mspools-visit-spool): Use `inhibit-read-only`; simplify a bit.
(mspools-get-spool-files): Avoid `setq`. Use `pcase-dolist`.
(mspools-revert-buffer): Make (unused) args optional.
(mspools-help, mspools-show-again, mspools-quit): Declare obsolete.
As soon as we get a response from any of the user functions/sources in
eldoc-documentation-functions, we must make sure to call the
display-doc local function, just like in the other strategies.
That is even if that response produced nil, meaning that there's no
doc coming from that source. Failure to do so when none of the
sources produced non-nil would keep stale documentation displaying.
First reported in https://github.com/joaotavora/eglot/issues/503
* lisp/emacs-lisp/eldoc.el (eldoc--invoke-strategy): Fix
:enthusiast strategy.
(Version): Bump to 1.10.0
Harald Jörg [Thu, 3 Sep 2020 20:11:47 +0000 (22:11 +0200)]
Fix freeze in cperl-mode when editing a regexp
* lisp/progmodes/cperl-mode.el (cperl-forward-group-in-re): Make
sure that an error is reported back to the caller (Bug#16368).
* test/lisp/progmodes/cperl-mode-tests.el (cperl-mode-test-bug-16368):
Tests for balanced (no error) and unbalanced (caught exception)
cases of `cperl-forward-group-in-re'.
Paul Eggert [Thu, 3 Sep 2020 19:10:26 +0000 (12:10 -0700)]
Revert recent GC-related changes (Bug#43152)
* src/alloc.c (live_string_holding, live_cons_holding)
(live_symbol_holding, live_large_vector_holding)
(live_small_vector_holding):
Go back to old approach of treating every would-be pointer to any
byte in the object (though not to just past the object end) as
addressing the object.
(live_float_p): Require that the would-be float point
to the start of the Lisp_Float, and not anywhere else.
(live_vector_pointer, live_float_holding, mark_objects):
Remove. All uses removed.
(mark_maybe_object, mark_maybe_objects):
Bring back these functions.
* src/lisp.h (SAFE_ALLOCA_LISP_EXTRA): Do not clear the
new slots, as they're now checked via mark_maybe_objects,
not via mark_objects.
Eli Zaretskii [Thu, 3 Sep 2020 17:16:33 +0000 (20:16 +0300)]
Fix 'expand-file-name' for remote files
This reverts most of commit 14fb657ba82da346d36f05f88da26f1c5498b798
and its followup fixes, and instead fixes the original bugs in a
different manner that doesn't affect any unrelated use cases. As
part of this, the code which caused 'expand-file-name' to enforce
a trailing slash on expanded directories is removed, as this kind
of semantic processing is outside of 'expand-file-name's scope.
* src/fileio.c (Fexpand_file_name): If expanding default_directory
yields a remote file name, call its handlers. (Bug#26911)
(Bug#34834)
* doc/lispref/files.texi (File Name Expansion): Remove the
requirement that expanding a directory name yields a directory
name, i.e. that the expansion must end in a slash.
* etc/NEWS: Remove the announcement of the changed behavior of
'expand-file-name' wrt trailing slashes.
* test/src/fileio-tests.el (fileio-tests--HOME-trailing-slash)
(fileio-tests--expand-file-name-trailing-slash): Remove tests.
* test/lisp/net/tramp-tests.el (tramp-test05-expand-file-name): No
need to expect different results in Emacs 28 and later.
Stefan Kangas [Thu, 3 Sep 2020 15:19:15 +0000 (17:19 +0200)]
Fix my previous change to cancel world-clock timer
* lisp/time.el (subr-x): Require when compiling.
(world-clock): Set 'kill-buffer-hook' buffer locally only.
(world-clock-update): Break out timer cancellation from here...
(world-clock-cancel-timer): ...to here, and don't rely on variable to
find the timer to cancel.
(world-clock-timer): Delete now superfluous variable.
Eli Zaretskii [Thu, 3 Sep 2020 12:59:46 +0000 (15:59 +0300)]
Fix vertical cursor motion when 'visual-line-mode' is in effect
* src/xdisp.c (move_it_in_display_line_to): Fix a logic error made
as part of introducing the 'word-wrap-by-category' feature; that
error brought back bug#8155.
Stefan Kangas [Thu, 3 Sep 2020 12:30:53 +0000 (14:30 +0200)]
Support bookmarking Eshell buffers
* lisp/eshell/esh-mode.el (eshell-bookmark-name)
(eshell-bookmark-make-record, eshell-bookmark-jump): New defuns.
(eshell-mode): Set up bookmark handler.
Stefan Kangas [Thu, 3 Sep 2020 10:54:30 +0000 (12:54 +0200)]
Cancel timer when world-clock buffer is killed
* lisp/time.el (world-clock-timer): New variable.
(world-clock-cancel-timer): New defun.
(world-clock): Add 'world-clock-cancel-timer' to 'kill-buffer-hook'.
Stefan Kangas [Wed, 2 Sep 2020 21:10:27 +0000 (23:10 +0200)]
Simplify mwheel-mode by using alist instead of two variables
* lisp/mwheel.el (mouse-wheel--remove-bindings): Update call
signature to take no arguments. Doc fix.
(mouse-wheel--add-binding): Break out from...
(mouse-wheel-mode): ...here. Simplify by using above functions.
(mouse-wheel--installed-bindings-alist): New variable.
(mwheel-installed-bindings): Make obsolete.
(mwheel-installed-text-scale-bindings): Make obsolete.
* test/lisp/mwheel-tests.el (mwheel-test-enable/disable):
New test.
Stefan Kangas [Wed, 2 Sep 2020 20:54:47 +0000 (22:54 +0200)]
Fix binding mouse wheel with modifiers in buffer area
* test/lisp/mwheel-tests.el (mwheel-test--create-scroll-keys): Fix
binding mouse wheel with modifiers in buffer area, while ignoring them
for fringes, margins, etc. My previous change mistakenly ignored all
modifiers in `mouse-wheel-scroll-amount'.
* lisp/mwheel.el (mouse-wheel--create-scroll-keys): Fix test to
reflect the above.
Michael Albinus [Wed, 2 Sep 2020 17:50:14 +0000 (19:50 +0200)]
Fix bug in dbus.el
* lisp/net/dbus.el (dbus-register-property)
(dbus-property-handler): Handle properties of the same interface
at different object paths properly. (Bug#43146)
Stefan Kangas [Wed, 2 Sep 2020 03:02:18 +0000 (05:02 +0200)]
Use lexical-binding in pcmpl-linux.el and add tests
* lisp/pcmpl-linux.el: Use lexical-binding.
(pcmpl-linux-fs-modules-path-format)
(pcmpl-linux-mtab-file): New constants.
(pcmpl-linux-fs-types, pcmpl-linux-mounted-directories): Use above
new constants.
* test/lisp/pcmpl-linux-resources/fs/ext4/.keep:
* test/lisp/pcmpl-linux-resources/mtab:
* test/lisp/pcmpl-linux-tests.el: New files.
Glenn Morris [Mon, 31 Aug 2020 17:45:54 +0000 (10:45 -0700)]
Merge from origin/emacs-27
f20169399d (origin/emacs-27) Fix typo in Introduction to Emacs Lisp 7605060d51 Update Elisp Manual reference to which-function-mode 29708cbde7 Some precisions to bug handling dddc971f0e CC Mode: Fix processing for when c-multiline-string-start-... 4a73fb9668 Fix description of %-constructs in 'mode-line-format'
Make quoted-printable-encode-region work in multibyte buffers
* lisp/mail/qp.el (quoted-printable-encode-region): If we're in a
multibyte buffer (that has been encoded with some coding system),
then get-byte will get the correct byte value.
Paul Eggert [Mon, 31 Aug 2020 06:40:11 +0000 (23:40 -0700)]
Remove mark_maybe_object
* src/alloc.c (mark_maybe_object, mark_maybe_objects): Remove.
(mark_objects): New function.
* src/eval.c (mark_specpdl): Use mark_objects instead of
mark_maybe_objects, since the array now has only valid Lisp objects.
* src/lisp.h (SAFE_ALLOCA_LISP_EXTRA): When allocating a large
array, clear it so that it contains only valid Lisp objects. This
is simpler and safer, and does not hurt performance significantly
on my usual benchmark as the code is executed so rarely.
Paul Eggert [Mon, 31 Aug 2020 06:40:11 +0000 (23:40 -0700)]
Avoid some false matches in mark_maybe_pointer
This lets Emacs avoid marking some garbage as if it were in use.
On one test platform (RHEL 7.8, Intel Xeon Silver 4116) it
sped up ‘cd lisp; make compile-always’ by a bit over 1%.
* src/alloc.c (live_string_holding, live_cons_holding)
(live_symbol_holding, live_large_vector_holding)
(live_small_vector_holding):
Count only pointers that point to a struct component,
or are a tagged pointer to the start of the struct.
Exception: for non-bool-vector pseudovectors,
count any pointer past the header, since it’s too much
of a pain to write code for every pseudovector.
(live_vector_pointer): New function.
Paul Eggert [Mon, 31 Aug 2020 06:40:11 +0000 (23:40 -0700)]
Omit no-longer-needed stack mark_maybe_object
* src/alloc.c (mark_memory): Do not bother using mark_maybe_object
on the stack, since mark_maybe_pointer now marks everything that
mark_maybe_object would.
Paul Eggert [Mon, 31 Aug 2020 06:40:11 +0000 (23:40 -0700)]
Fix GC bug with Lisp floats and --with-wide-int
On --with-wide-int platforms where Lisp_Object can be
put into non-adjacent registers, mark_maybe_pointer failed
to mark a float whose only reference was as a tagged pointer.
* src/alloc.c (live_float_holding): New function,
a generalization of the old live_float_p.
(live_float_p): Use it.
(mark_maybe_pointer): Use live_float_holding, not live_float_p.
Stefan Kangas [Sun, 30 Aug 2020 16:21:11 +0000 (18:21 +0200)]
Various life.el improvements
* lisp/play/life.el (life): New defgroup.
(life-step-time): New defcustom (lower default from 1 to 0.5).
(life): Use above new variable. Make prefix arguments set step time
in tenths of a second instead of whole seconds.
(life-expand-plane-if-needed): Rename argument to step-time.
(life-setup): Fix running `M-x life' with existing buffer.
Mauro Aranda [Sun, 30 Aug 2020 13:55:19 +0000 (15:55 +0200)]
Respect :must-match for file types in customization buffers
* lisp/wid-edit.el (file widget): Add a :match and a :validate
function to the 'file widget, to be able to check if the widget
value is an existent file, when required (bug#25678).
João Távora [Sat, 29 Aug 2020 15:39:47 +0000 (16:39 +0100)]
Place flymake-eldoc-function at the end of eldoc-documentation-functions
Having it placed in the beginning of that hook meant it was mostly
impossible to track the args to a function call while writing it from
scratch, since most compilers issue a diagnostic about incorrect
number of arguments.
See bug#43103.
* lisp/progmodes/flymake.el (flymake-mode): Lower priority of
flymake-eldoc-function.