Andrew G Cohen [Wed, 9 Sep 2020 09:01:44 +0000 (17:01 +0800)]
Make Gnus cache work with nnselect
* lisp/gnus/gnus-cache.el (gnus-cache-possibly-enter-article)
(gnus-cache-possibly-remove-articles)
(gnus-cache-possibly-remove-article): Use originating article info for
nnselect groups.
Andrew G Cohen [Wed, 9 Sep 2020 01:58:39 +0000 (09:58 +0800)]
Add Gnus function to make a persistent group from a search result
* lisp/gnus/gnus-sum.el (gnus-summary-make-group-from-search): New
command (bound to C-c C-p in summary buffers).
* doc/misc/gnus.texi (What is nnir?): Document it. Correct previous
errors.
* etc/NEWS (Gnus): Mention it.
* doc/lispref/minibuf.texi (Text from Minibuffer): Document it.
* lisp/minibuffer.el (format-prompt): Allow DEFAULT to be a list
(and use the first element). This is how many of the prompting
functions interpret their default parameters.
Daniel Martín [Tue, 8 Sep 2020 12:18:17 +0000 (14:18 +0200)]
Use mouse-wheel-up-event in mwheel-tests.el
Enabling mouse-wheel-mode binds two different mouse events, depending
on the operating system. The correct way to check for those events is
by checking mouse-wheel-up-event, as explained in the ELisp manual.
* test/lisp/mwheel-tests.el (mwheel-test-enable/disable): Check
mouse-wheel-up-event instead of mouse-4 to make the test work
irrespective of the platform it's running.
Michael Albinus [Tue, 8 Sep 2020 14:24:11 +0000 (16:24 +0200)]
Implement typed D-Bus properties (Bug#43252)
* doc/misc/dbus.texi (Properties and Annotations)
(Receiving Method Call): Document optional type symbol in
`dbus-set-property' and `dbus-register-property'.
* lisp/net/dbus.el (dbus-error-unknown-interface)
(dbus-error-unknown-method, dbus-error-unknown-object)
(dbus-error-unknown-property): New defconsts.
(dbus-peer-handler): Improve error handling.
(dbus-introspect-get-signature): Handle also properties.
(dbus-set-property, dbus-register-property): Allow optional TYPE
symbol for VALUE. (Bug#43252)
(dbus-property-handler): Implement property types. Improve error
handling.
Alex Bochannek [Tue, 8 Sep 2020 09:47:28 +0000 (11:47 +0200)]
Introduce a new Gnus scoring method (for article age)
* doc/misc/gnus.texi (Score File Format): Document it.
* lisp/gnus/gnus-score.el (gnus-score-check-syntax): Add support
for the new date methods < and > (bug#43270).
(gnus-score-date): Allow scoring on dates by age.
Reuben Thomas [Mon, 7 Sep 2020 19:56:58 +0000 (20:56 +0100)]
Fix Enchant dictionary finding routine
* lisp/textmodes/ispell.el (ispell-find-enchant-dictionaries): Don’t
pass `buffer-string' to enchant-lsmod. Remove zero-length substrings
from the split output of `enchant-lsmod`, as the output ends with a
separator. Pass the current language to
`ispell--get-extra-word-characters', so we get the result for the
current language, not the default language. (Patch from Jorge P. de
Morais Neto.)
* test/lisp/custom-tests.el (custom--test-theme-variables): "make
check" in the main directory didn't work because the path was
wrong. Use EMACS_TEST_DIRECTORY to find the test directory
instead.
Daniel Martín [Mon, 7 Sep 2020 15:10:30 +0000 (17:10 +0200)]
Add support for horizontal scrolling in tab-line
* lisp/tab-line.el ([tab-line wheel-left]): Bind left and right tab
line scrolling to the 'wheel-left' and 'wheel-right' mouse events.
([tab-line S-wheel-right]): Analogous change for the functions that
switch tabs.
* etc/NEWS: Announce the new feature (bug#43224).
Copyright-paperwork-exempt: yes
Show the status of signed + encrypted S/MIME messages in Gnus
* lisp/gnus/mm-decode.el (mm-possibly-verify-or-decrypt): Use the
data to tell the caller (i.e., Gnus) something about the
validation of signed + encrypted S/MIME messages.
* lisp/gnus/mm-view.el (mm-view-pkcs7-verify): Pass along details
about whether we could validate the signature or not (bug#42637).
Andrew G Cohen [Mon, 7 Sep 2020 00:58:42 +0000 (08:58 +0800)]
Add aliases for recent Gnus nnselect changes
* lisp/org/ol-gnus.el (org-gnus-store-link): Change 'nnir to
'nnselect.
* lisp/gnus/gnus-group.el: Define obsolete function alias for
'gnus-group-make-nnir-group to
'gnus-group-read-ephemeral-search-group.
* lisp/gnus/gnus-sum.el: Define obsolete variable alias for
'gnus-refer-thread-use-nnir to 'gnus-refer-thread-use-search.
* lisp/gnus/nnselect.el: Define obsolete variable alias for
'nnir-retrieve-headers-override-function to
'nnselect-retrieve-headers-override-function.
* lisp/gnus/nnir.el: Restore definition of 'nnir-summary-line-format
and mark obsolete.
* lisp/net/eww.el (eww--limit-string-pixelwise)
(eww--pixel-column): New functions.
(eww-update-header-line-format): Use variable pitch fonts in the
header line.
* lisp/progmodes/prolog.el (prolog-help-on-predicate):
* lisp/cmuscheme.el (scheme-trace-procedure):
* lisp/calendar/todo-mode.el (todo-convert-legacy-files): Use
format-prompt in some read-string calls (that have default values).
* lisp/printing.el (pr-interactive-regexp): No need to use "" as
the default value, because that's the default default value.
(pr-interactive-n-up): Use read-number instead of read-string and
then parsing the string.
Use format-prompt in calls to read-from-minibuffer with default value
* lisp/tab-bar.el (tab-bar-rename-tab)
(tab-bar-rename-tab-by-name):
* lisp/simple.el (next-matching-history-element): Use
format-prompt in calls to read-from-minibuffer with at default
value.
Stefan Kangas [Sun, 6 Sep 2020 15:56:26 +0000 (17:56 +0200)]
Add autoload cookie to eshell-bookmark-jump
* lisp/eshell/esh-mode.el (eshell-bookmark-jump): Add autoload
cookie, so we can jump to bookmarks before having used eshell.
Problem noted by Stefan Monnier.
Michael Albinus [Sun, 6 Sep 2020 18:45:29 +0000 (20:45 +0200)]
More work on D-Bus error messages
* lisp/net/dbus.el (dbus-get-property): Adapt docstring.
(dbus-set-property): Handle case of `:write' access type.
(dbus-get-other-registered-properties): Rename from
`dbus-get-other-registered-property'.
(dbus-property-handler): Fix thinkos.
* src/dbusbind.c (xd_read_message_1): Add error_name to event args
in case of DBUS_MESSAGE_TYPE_ERROR.
* test/lisp/net/dbus-tests.el (dbus--test-enabled-session-bus)
(dbus--test-enabled-system-bus): Make them defconst.
(dbus--test-service, dbus--test-path, dbus--test-interface):
New defconst. Replace all occurences of `dbus-service-emacs' by
`dbus--test-service'.
(dbus--test-method-handler): New defun.
(dbus-test04-register-method, dbus-test05-register-property): New tests.
Use format-prompt in calls to completing-read with a default value
* lisp/textmodes/rst.el (rst-insert-list-new-item):
* lisp/tab-bar.el (tab-bar-switch-to-tab):
* lisp/profiler.el (profiler-start):
* lisp/frame.el (set-frame-font):
* lisp/erc/erc.el (erc-join-channel):
* lisp/emacs-lock.el (emacs-lock--set-mode):
* lisp/emacs-lisp/elp.el (elp-set-master):
* lisp/emacs-lisp/checkdoc.el ()
(checkdoc-this-string-valid-engine):
* lisp/calendar/todo-mode.el (todo-find-filtered-items-file):
* lisp/calendar/calendar.el (calendar-set-date-style): Use
`format-prompt' in calls to completing-read that has a default
value, but didn't mention that in the prompt.
* lisp/net/eww.el (eww-change-select): Use a popup menu for the
select (bug#43218).
(eww--form-items): New utility function.
(eww-select-map): Allow using a mouse to click on select buttons.
Make C-h S in Customize buffers work more reliably
* lisp/cus-edit.el (custom-unlispify-menu-entry): Put a property
on the returned string so that we can determine what the symbol
was after the fact.
* lisp/info-look.el (info-lookup-guess-default*): Allow lambda
forms as rules.
(:mode): Use the stored symbol.
(info-lookup-guess-custom-symbol): No longer used; mark as
obsolete (bug#41905).
João Távora [Sun, 6 Sep 2020 07:35:53 +0000 (08:35 +0100)]
Don't resort Icomplete candidates when default already on top
Fixes: bug#43222
Icomplete mode re-sorts candidates, bubbling the default to top if
it's found somewhere down the list. This is done according to two
criteria: exact match and prefix match. Before this fix, it didn't
take into account the possibility that the exact match for the default
would already be on top, and would incorrectly bubble a prefixing
completion down the list to the top. This commit fixes that.
Paul Eggert [Sat, 5 Sep 2020 19:13:32 +0000 (12:13 -0700)]
Reinstall recent GC-related changes
The report that they broke macOS was a false alarm, as the
previous commit was also broken (Bug#43152#62).
* src/alloc.c (live_string_holding, live_cons_holding)
(live_symbol_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_float_holding, live_vector_pointer):
New functions, which are similar about counting pointers.
(live_float_p, live_large_vector_holding)
(live_small_vector_pointer, mark_maybe_pointer): Use them.
(mark_maybe_object, mark_maybe_objects): Remove,
and remove all callers; mark_maybe_pointer now suffices.
(mark_objects): New function.
* src/alloc.c (mark_vectorlike, mark_face_cache):
* src/eval.c (mark_specpdl):
* src/fringe.c (mark_fringe_data):
* src/keyboard.c (mark_kboards):
Simplify by using mark_objects.
* src/lisp.h (SAFE_ALLOCA_LISP_EXTRA):
Clear any Lisp_Object arrays large enough to not fit into the stack,
so that GC need not worry about whether they contain objects.
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.