Extract last source package release from local VCS data
* lisp/emacs-lisp/package-vc.el (package-vc-archive-spec-alist):
Unmention :release-rev
(package-vc-desc->spec): Fall back on other archives if a
specification is missing.
(package-vc-main-file): Add new function, copying the behaviour of
elpa-admin.el.
(package-vc-generate-description-file): Use 'package-vc-main-file'.
(package-vc-unpack): Handle special value ':last-release'.
(package-vc-release-rev): Add new function using 'last-change'.
(package-vc-install): Pass ':last-release' as REV instead of a
release.
* lisp/vc/vc-git.el (vc-git-last-change): Add Git 'last-change'
implementation.
* lisp/vc/vc.el (vc-default-last-change): Add default 'last-change'
implementation.
This attempts to replicate the behaviour of elpa-admin.el's
"elpaa--get-last-release-commit".
Explicitly handle :vc-backend in a package specification
* lisp/emacs-lisp/package-vc.el (package-vc-archive-spec-alist):
Document the feature.
(package-vc-unpack): Check for :vc-backend in both PKG-SPEC and the
archive specification data.
Ensure that package specifications are always fetched
* lisp/emacs-lisp/package-vc.el (package-vc--archives-initialize): Add
new function, extending 'package--archives-initialize'.
(package-vc-install): Use new function.
(package-vc-link-directory): Use new function.
Add support for :release-rev in 'package-vc-archive-spec-alist'
* lisp/emacs-lisp/package-vc.el (package-vc-archive-spec-alist):
Update docstring.
(package-vc-install): Use :release-rev if invoked with a prefix argument.
Extract separate function 'package-vc-guess-backend'
* lisp/emacs-lisp/package-vc.el (package-vc-guess-backend): New
function.
(package-vc-unpack): Use it.
(package-vc-sourced-packages-list): Use it.
(package-vc-install): Use it.
* lisp/emacs-lisp/package-vc.el (package-vc-build-documentation): Add
function to build a documentation file.
(package-vc-unpack-1): Use 'package-vc-build-documentation'.
João Távora [Thu, 20 Oct 2022 10:42:25 +0000 (11:42 +0100)]
Revert "eglot.texi: Make example more realistic"
This quest for realism ignores the fact that a previous example for a
hypothetical language Foo and a language server "fools" already
exists. It also undermines the intended generality of the
instructions.
João Távora [Thu, 20 Oct 2022 10:20:30 +0000 (11:20 +0100)]
Fix Eglot manual's description of eglot-workspace-configuration
* doc/misc/eglot.texi (Customizing Eglot)
(eglot-workspace-configuration): Explain that plist may be
arbitrarily complex and correctly identify nil as the Elisp
equivalent to JSON null.
Mauro Aranda [Thu, 20 Oct 2022 10:34:38 +0000 (07:34 -0300)]
Improve HERE document detection in perl-mode
* lisp/progmodes/perl-mode.el (perl-syntax-propertize-function):
Detect indented HERE documents when using a bare identifier.
(perl--syntax-exp-intro-keywords): Recognize HERE documents that come
after die, warn and eval.
(perl--syntax-exp-intro-regexp): Identify HERE documents when printing
to a filehandle with printf? and when they appear after a fat comma.
* test/lisp/progmodes/cperl-mode-resources/here-docs.pl: Add more tests.
Alan Mackenzie [Wed, 19 Oct 2022 14:52:14 +0000 (14:52 +0000)]
CC Mode: Cease adding types to found-types too eagerly
This fixes bug #58537 and bug #58539.
* lisp/progmodes/cc-engine.el (c-forward-type): Remove trailing whitespace
from an identifier before passing it to c-add-type.
(c-forward-decl-or-cast-1): CASE 3: Do not recognize two consecutive
identifiers as type + variable/function unless certain conditions are met.
CASE 10: Do not recognize the "type" as a found type unless certain condtions
are met. (Near end): Do not recognize the identifier in a cast as a type
unless certain conditions are met.
* lisp/progmodes/cc-fonts.el (c-get-fontification-context): Recognize being
in declaration parens when there is a syntactially wrong "foo ((bar))"
preceding the match position.
* lisp/progmodes/cc-mode.el (c-update-new-id): Set c-new-id-is-type
unconditionally to nil to prevent a second identifier being wrongly marked as
a type.
Po Lu [Wed, 19 Oct 2022 13:31:54 +0000 (21:31 +0800)]
Fix various builds
* src/xterm.c (x_handle_selection_monitor_event): Adjust for
build without XInput2.
(x_maybe_clear_preedit, xim_destroy_callback): Make conditional
on Release 6 XIM.
(x_get_keyboard_modifiers): Adjust for build without XCB.
* lisp/emacs-lisp/package-vc.el (package-vc-default-backend): Add new
option.
(package-vc-archive-spec-alist): Add new variable to store the
contents of 'elpa-packages' for each archive.
(pacakge-vc-desc->spec): Add function to query package specifications.
(package-vc--read-archive-data): Add a 'package-read-archive-hook'
implementation.
(package-vc--download-and-read-archives): Add a
'package-refresh-contents-hook' implementation.
(package-vc-main-file): Remove function.
(package-vc-generate-description-file): Use package specifications.
(package-vc-unpack-1): Adapt to previous changes.
(package-vc-unpack): Adapt to previous changes.
(package-vc-sourced-packages-list): Adapt to previous changes.
(package-vc-install): Adapt to previous changes.
* lisp/emacs-lisp/package.el (package-read-archive-hook): Allow
extending 'package-read-all-archive-contents' using a hook.
(package-read-all-archive-contents): Use 'package-read-archive-hook'.
(package-refresh-contents-hook): Allow extending
'package-refresh-contents' using a hook.
(package-refresh-contents): Use 'package-refresh-contents-hook'.
Juri Linkov [Tue, 18 Oct 2022 18:13:29 +0000 (21:13 +0300)]
* lisp/outline.el (outline-minor-mode-insert-buttons): New defvar-local.
(outline--make-button-overlay, outline--insert-open-button)
(outline--insert-close-button): Insert button when
outline-minor-mode-insert-buttons is non-nil, otherwise
put an overlay with before-string. (bug#57813)
* lisp/help.el (describe-bindings): Set buffer-local
outline-minor-mode-insert-buttons to t.
* lisp/textmodes/emacs-news-mode.el (emacs-news--mode-common):
Set buffer-local outline-minor-mode-use-margins to t. Don't set
outline-regexp for leading spaces because now spaces are not added
in the NEWS buffer.
Juri Linkov [Tue, 18 Oct 2022 18:05:15 +0000 (21:05 +0300)]
* lisp/outline.el: Use one character wide strings for margins (bug#57813)
(outline-open-in-margins, outline-close-in-margins)
(outline-close-rtl-in-margins): Add 1-char emoji, symbol, text
for margins that are 1-column wide.
(outline-minor-mode): Force display of margins only for the selected buffer.
João Távora [Tue, 18 Oct 2022 13:46:27 +0000 (14:46 +0100)]
More minor fixes to doc/misc/eglot.texi
Most, if not all of these, were previously discussed with Eli.
* doc/misc/eglot.texi (Setting Up LSP Server): Fix repetition of
"This variable".
(Setting Up LSP Server): Explain that single a running instance
supports multiple major modes.
(Starting Eglot, Eglot and Buffers): Correctly describe mode-line indication.
(Eglot Features): Suggest that company-mode is just one of the
possible packages. Explain that Eglot arranges for the completion
package to "instantiate" snippets. Could have used "expand".
Mention benefits of having the popular markdown-mode available.
(Eglot Commands): Explain how eglot-reconnect and
eglot-clear-status are useful.
(Eglot Variables): Clarify when eglot-autoreconnect is useful.
Clarify how eglot-sync-connect and eglot-connect-timeout relate to
each other. Clarify semantics of
eglot-confirm-server-initiated-edits.
Jim Porter [Thu, 15 Sep 2022 19:24:37 +0000 (12:24 -0700)]
Improve handling of $PATH in Eshell for remote directories
* lisp/eshell/esh-util.el (eshell-path-env, eshell-parse-colon-path):
Make obsolete.
(eshell-path-env-list): New variable.
(eshell-connection-default-profile): New connection-local profile.
(eshell-get-path): Reimplement using 'eshell-path-env-list'; add
LITERAL-P argument.
(eshell-set-path): New function.
* lisp/eshell/esh-var.el (eshell-variable-aliases-list): Add entry for
$PATH.
(eshell-var-initialize): Add 'eshell-path-env-list' to
'eshell-subcommand-bindings'.
* lisp/eshell/esh-ext.el (eshell-search-path): Use 'file-name-concat'
instead of 'concat'.
(eshell/addpath): Use 'eshell-get-path' and 'eshell-set-path'.
* lisp/net/tramp-integration.el: Only apply Eshell hooks when
'eshell-path-env-list' is unbound.
* test/lisp/eshell/esh-var-tests.el
(esh-var-test/path-var/local-directory)
(esh-var-test/path-var/remote-directory, esh-var-test/path-var/set)
(esh-var-test/path-var/set-locally)
(esh-var-test/path-var-preserve-across-hosts): New tests.
* test/lisp/eshell/esh-ext-tests.el: New file.
* test/lisp/eshell/eshell-tests-helpers.el
(with-temp-eshell): Set 'eshell-last-dir-ring-file-name' to nil.
(eshell-tests-remote-accessible-p, eshell-last-input)
(eshell-last-output): New functions.
(eshell-match-output, eshell-match-output--explainer): Use
'eshell-last-input' and 'eshell-last-output'.
Jim Porter [Mon, 26 Sep 2022 04:47:26 +0000 (21:47 -0700)]
Allow setting the values of variable aliases in Eshell
This makes commands like "COLUMNS=40 some-command" work as expected.
* lisp/eshell/esh-cmd.el (eshell-subcommand-bindings): Remove
'process-environment' from here...
* lisp/eshell/esh-var.el (eshell-var-initialize): ... and add to here,
along with 'eshell-variable-aliases-list'.
(eshell-inside-emacs): Convert to a 'defvar-local' to make it settable
in a particular Eshell buffer.
(eshell-variable-aliases-list): Make $?, $$, and $* read-only and
update docstring.
(eshell-set-variable): New function...
(eshell-handle-local-variables, eshell/export, eshell/unset): ... use
it.
(eshell/set, pcomplete/eshell-mode/set): New functions.
(eshell-get-variable): Get the variable alias's getter function when
appropriate and use a safer method for checking function arity.
Jim Porter [Wed, 12 Oct 2022 05:11:04 +0000 (22:11 -0700)]
Add helpers to dynamically assign connection-local values
* lisp/files-x.el (connection-local-criteria)
(connection-local-profile-name-for-setq): New variables.
(with-connection-local-variables-1): ... let-bind them here.
(connection-local-update-profile-variables)
(connection-local-profile-name-for-criteria): New functions.
(with-connection-local-application-variables, setq-connection-local):
New macros.
* test/lisp/files-x-tests.el: Require 'tramp-integration'
(files-x-test--variable5, remote-lazy-var): New variables.
(files-x-test-hack-connection-local-variables-apply): Expand checks.
(files-x-test-with-connection-local-variables): Remove
'hack-connection-local-variables-apply' check (it belongs in the above
test), and expand some other checks.
(files-x-test--get-lazy-var, files-x-test--set-lazy-var): New
functions.
(files-x-test-connection-local-update-profile-variables)
(files-x-test-setq-connection-local): New tests.
* doc/lispref/variables.texi (Connection Local Variables): Split into
two subsections and document the new features.