* lisp/emacs-lisp/package.el (package-upgrade): Trigger error
redirecting user to use 'package-vc-upgrade'.
(package--upgradeable-packages): Exclude VC packages from list
of "upgradable" packages.
* lisp/vc/vc.el (vc-pull): Don't fail when called from buffers
visiting unregistered or ignored files so long as there is a
'pull' function available from the backend.
* lisp/vc/vc-hooks.el (vc-find-backend-function): Require vc for
default implementations (bug#80254). Report and fix due to
Daniel Mendler <mail@daniel-mendler.de>.
* lisp/emacs-lisp/vtable.el (vtable--insert-line): Do not
produce a divider after the final column. This thinko is more
noticeable on a tty.
(vtable--insert-header-line): On a tty, nullify indicator
padding.
(vtable-tty-char-pixel-width): New defconst.
(vtable--compute-width): On a tty, adjust column width specified
in pixels down by a factor of 'vtable-tty-char-pixel-width'.
(vtable--alter-column-width): On a tty, adjust column width in
characters, otherwise in pixels.
* lisp/vc/vc-hg.el (vc-hg--bookmarks): New function.
(vc-hg-trunk-or-topic-p):
* lisp/vc/vc-git.el (vc-git--branch-remotes)
(vc-git-trunk-or-topic-p): New optional BRANCH argument.
(vc-trunk-or-topic-p): Declare.
(vc-git-topic-outgoing-base): Consider only local trunks, if
there are any (bug#80006).
* lisp/vc/vc.el (trunk-or-topic-p): New optional BRANCH
argument.
(vc-trunk-or-topic-p): New function.
(vc--outgoing-base): Call it.
* lisp/net/shr.el (shr-dom-print): Escape these strings, as done
in `dom-print', to prevent producing an erroneous XML document.
* test/lisp/net/shr-tests.el (dom-print-escape): Add new test
(Bug#80383).
* lisp/textmodes/page-ext.el (pages-directory-revert-function): New
function.
(pages-directory-list-all-headers-p, pages-directory-count-lines-p)
(pages-directory-regexp): New variables to store the page directory
style. (Bug#80319)
* lisp/completion-preview.el (completion-preview-commands):
Allow the value t, which says that completion preview should
be attempted after any command.
* lisp/completion-preview.el
(completion-preview-require-certain-commands): Adapt.
* lisp/completion-preview.el
(completion-preview-inhibit-functions): New option.
(completion-preview--post-command): Respect it.
* etc/NEWS: Announce it.
* lisp/speedbar.el (speedbar-get-focus)
(speedbar-frame-or-window): Support for 'speedbar-prefer-window'
with fix of 'speedbar-window' trying to delete current frame.
(Bug#80392)
* lisp/vc/vc.el (vc-log-show-limit):
Change the default to 500 (bug#80037).
(vc-print-log-setup-buttons): Have the first button prompt and
propose 4X the current limit as the default.
(vc-print-fileset-branch-log):
Update the reference to the changed button text.
* lisp/vc/log-view.el (log-view-end-of-defun-1): Same.
* doc/emacs/maintaining.texi (VC Change Log): Also here.
The greedy regexp matching, broken scoring and broken highlight were
sources of frequent complaints about the 'flex' matching style. This
commit fixes that.
Inspired by the 'hotfuzz' style (available at
https://github.com/axelf4/hotfuzz) it uses a modified version of Gotoh's
1982 dynamic programming algorithm. It is strictly more correct than the
"old" flex. For example, when matching the pattern 'goto' to no longer
will 'eglot-format' be sorted before some hypothetical much better
'goobarbaz-goto'. And of course the highlighting is also correctly
placed on the 'goto', not scattered across the candidate.
Regarding performance, it is faster than the naive 'flex', primarily
because of the Elisp rewrite in minibuffer.el. The matching and costing
algorithm matters but is not the bottleneck.
The Elisp parts of the style were almost completely decoupled from the
pcm/substring styles in lisp/minibuffer.el. Only
'completion-flex-try-completion' uses some of pcm's code for pattern
augmentation.
* src/minibuf.c (completion--flex-cost-gotoh): New function.
* lisp/minibuffer.el (completion-flex--pattern-str): New variable.
(flex-score-match-tightness): Make obsolete.
(completion--flex-all-completions-1): New helper function.
(completion-flex-try-completion, completion-flex-all-completions): Rewrite.
(completion-substring--all-completions): No longer take transform-pattern-fn.
(completion--flex-adjust-metadata): Tweak.
(completion--flex-score, completion--flex-score-1)
(completion--flex-score-last-md, completion-flex--make-flex-pattern): Delete.
* test/lisp/minibuffer-tests.el (completion--sorted-flex-completions):
New helper function.
(completion-flex-test-non-ascii): New test.
(completion--pcm-score): Delete.
(completion-pcm-test-3, completion-pcm-test-4)
(completion-substring-test-1, completion-substring-test-2)
(completion-flex-test-2, completion-flex-test-3): Tweak.
* etc/NEWS: Describe change.
* lisp/emacs-lisp/package.el (package-dir-info): Do not check
files that do not satisfy 'file-regular-p' when trying to find
the file with the package metadata. (Bug#79742)
* lisp/emacs-lisp/package-activate.el (package--autosugest-line-format):
Remove variable and function.
(package--autosuggest-after-change-mode): Inject upgrade prompt
using ':propertize'. We can drop the condition testing if there
are any suggestions, as installing the package changes the major
mode and thus also 'mode-name'.
The composite DisplayDevice is meant to be presented to the user
only if it IsPresent. It is not entirely clear whether PowerSupply
implies IsPresent, so check both (bug#80229).
* lisp/battery.el (battery-upower): Skip hot-removable batteries
that are missing from the bay.
Now that battery--upower-subscribe registers to signals from
DisplayDevice (bug#80229), it is possible to react to more than just
State changes, including Percentage and IsPresent (although the
latter may already be covered by the DeviceAdded and DeviceRemoved
signals).
That means that it should be possible to disable polling via
battery-update-timer and still get timely mode line updates.
* etc/NEWS
(Changes in Specialized Modes and Packages in Emacs 31.1):
Announce new battery-update-interval :type.
* lisp/battery.el (battery-update-interval): Allow setting to nil.
(display-battery-mode): Do not create battery-update-timer then.
(battery-upower-display-device-path): New constant.
(battery--upower-subscribe): Use it.
(battery-upower-subscribe-properties): New variable.
(battery--upower-props-changed): Use it for more flexibility over
which DisplayDevice properties to react to.
(battery--upower-signal-handler): Call battery-update-handler
directly when there is no battery-update-timer.
* lisp/battery.el (battery--upower-props-changed): Check if the
"State" has changed.
(battery--upower-subscribe): Subscribe to state changes of the
"DisplayDevice" (bug#80229).
* lisp/emacs-lisp/package-activate.el (package-autosuggest-mode):
We don't need a special initializer for the minor mode, if we
are not enabling the option OOTB.
Apparently some people believe that a colspan can be fractional, and
produce HTML with such. Make it possible for SHR to render such HTML
by truncating colspan.
* lisp/net/shr.el (shr-make-table-1): Ensure 'colspan' is a fixnum.
(Bug#80354)
* lisp/net/newst-backend.el (newsticker--parse-text-container):
Only "xhtml" type contains inline XML nodes that need to be run
through 'newsticker--unxml' to serialize back to a string.
(Bug#80317)