Commit graph

180443 commits

Author SHA1 Message Date
Christoph Wedler
37468d2449 Update progmodes/antlr-mode.el from v2.2c to v3.2.0
For the ChangeLog with timeline,
see https://sourceforge.net/projects/antlr-mode/files/

The following is the ChangeLog between v2.2c to v3.2.0
without (intermediate) version numbers and changes already in the Emacs
repository.

* antlr-mode.el: Command `antlr-run-tool' now runs on the file for
the current buffer by default.
(antlr-run-tool-on-buffer-file): New user option.
(antlr-run-tool-interactive): Use it.

* antlr-mode.el: Allow `antlr-tool-version' and `antlr-language'
be set in the Local Variables section of a file.
(antlr-hack-local-variables-hook): New function.
(antlr-set-tool-version-and-mode-line): Adapt
(antlr-delayed-mode-hook): Renamed from `antlr-after-body-hook'.
(antlr-font-lock-keywords): Correctly call `font-lock-value-in-major-mode'.

* antlr-mode.el: Miscellaneous corrections and other changes.
(antlr-insert-keyword-rule): Make it work in v2 and v4, too.
(antlr-indent-line): Correctly calculate beginning of action.
(antlr-grammar-header-regexp): Has a value which is valid for v3 and v4.
(antlr-v4-grammar-header-regexp, antlr-v3-grammar-header-regexp):
Delete.
(antlr-tool-version-variables): tool-dependent variable for
`antlr-grammar-header-regexp`' is optional.
(antlr-upcase-p): Delete XEmacs bug workaround.

* antlr-mode.el: Enhance options, add v4 language "Cpp".
(antlr-v4-language-list): Add "Cpp".
(antlr-v4-options-alists, antlr-v3-options-alists)
(antlr-v2-options-alists):  Do not hard-code languages.
(antlr-read-language): New function used instead.
(antlr-v4-options-alists): Add grammar option "contextSuperClass"
and Cpp-only "exportMacro".
(antlr-insert-option-do): Call the "right" antlr-mode for v4 grammars.
(antlr-option-spec): Delete function.
(antlr-insert-option-do): Do not use it.

* antlr-mode.el: Correct command `antlr-insert-options'.
(antlr-try-rule-or-grammar-option): New function.
(antlr-option-level): Use it, correcting v3 and v4 behavior.
(antlr-v2-options-alists): Correct "language" option.
(antlr-syntactic-grammar-depth): Correct calculation
(antlr-options-style): Make it really obsolete.
(antlr-read-value): Do not use it.

* antlr-mode.el: Disable command `antlr-show-makefile-rules' for
ANTLR v3 and v4, these have "-depend" to show Makefile deps.
(antlr-show-makefile-rules): User error when used with v3 or v4.

* antlr-mode.el: Adapt command `antlr-run-tool' to ANTLR v3 and
v4, do not calculate v2 option "-glib" for file dependencies.
(antlr-tool-command): Make it tool-version dependent
(antlr-v4-tool-command, antlr-v3-tool-command)
(antlr-v2-tool-command): New user option.
(antlr-run-tool-interactive): Only add "-glib" option with v2.
(antlr-directory-dependencies): Only calculate deps with v2.
(antlr-compilation-error-regexp-alist)
(antlr-v4-compilation-error-regexp-alist): New variable.
(antlr-tool-version-variables, antlr-run-tool): Use it.

* antlr-mode.el: Cleanup, miscellaneous.  Replace `match-string'
by `match-string-no-properties' (see vc history).
(antlr-grammar-file): New function.
(antlr-insert-keyword-rule): New command.
(antlr-mode-map): Use it.
(antlr-font-lock-late-keywords): Correct face name.

* antlr-mode.el: Allow to write a derived mode for grammars - like
for PEG.js - whose rule header and body is separated by an
operator other than ":" and other similar deviations.  Also
prepare for messages without file name in "*compilation*" buffer.
(antlr-rule-body-start-op): New variable.
(antlr-end-of-body, antlr-indent-line): Use it.
(antlr-grammar-file): New variable.
(antlr-run-tool): Set it local in *compilation*" to FILE.
(antlr-font-lock-attribute-regexp, antlr-ruleref-assign-regexp):
(antlr-v2-ruleref-assign-regexp, antlr-font-lock-negation-regexp):
(antlr-font-lock-syntax-spec): New variables.
(antlr-font-lock-additional-keywords):
(antlr-font-lock-late-keywords): Use them here.
(antlr-tool-version-variables): Add `antlr-ruleref-assign-regexp'.

* antlr-mode.el: Adaptation to Emacs-25.1, cleanup.
(antlr-insert-makefile-rules): Set variable properly.
(antlr-syntax-propertize-template-literals): Using << inside an
unclosed code block could lead to error during font-locking.
(antlr-slow-cache-enabling-symbol): Delete variable.

* antlr-mode.el: Adopt change below and other changes in the Emacs
repository to current antlr-mode version.

* antlr-mode.el: Use syntax-ppss.  Check "are we in the grammar or
action code?" does not use extra action syntax-table anymore, but
9th element of syntax-ppss / parse-partial-sexp, whose value is
"subject to change" but has not changed since decades.
(antlr-action-syntax-table): Delete variable.
(antlr-font-lock-defaults): Do not give parentheses symbol syntax.
(antlr-slow-context-cache): Delete variable.
(antlr-invalidate-context-cache): Delete function.
(antlr-syntactic-context): Use syntax-ppss, new optional arg PPSS.
Now returns nil instead 0 if in normal grammar code.
(antlr-syntax-propertize-template-literals, antlr-re-search-forward)
(antlr-search-result, antlr-syntax-propertize-charsets)
(antlr-electric-character): Simplify.
(antlr-do-syntax-propertize): New variable.

* antlr-mode.el: Code is not run under extra syntax table anymore.
(antlr-syntax-propertize-wholerule, antlr-indent-at-bol-alist)
(antlr-v4-grammar-header-regexp, antlr-v3-grammar-header-regexp)
(antlr-v2-grammar-header-regexp, antlr-rule-postlude-skip-regexp)
(antlr-skip-file-prelude, antlr-font-lock-additional-keywords)
(antlr-imenu-create-index-function, antlr-inside-rule-p)
(antlr-end-of-rule, antlr-beginning-of-rule antlr-end-of-body)
(antlr-hide-actions, antlr-insert-option, antlr-option-level)
(antlr-downcase-literals, antlr-file-dependencies)
(antlr-guess-tool-version, antlr-indent-line):
Do not call deleted function, do not use deleted variables, use
regexp \\_> instead \\>., use both \\s_ and \\sw.

* antlr-mode.el: Minor changes.
(antlr-action-face, antlr-symbol-face): New face.
(antlr-token-identifier-p): New variable.
(antlr-font-lock-late-keywords): Use it, use
antlr-grammar-header-regexp, use new faces.
(antlr-syntax-propertize-charsets): Ignore @actionscope::name when
searching for lexer rules.
(antlr-syntax-propertize-template-literals): Change handling if
the template literal does not end before eob.
(antlr-font-lock-keywords): Use font-lock-eval-keywords.
(antlr-rule-postlude-skip-regexp): Allow scope name to begin with
underscore.

* antlr-mode.el: Make antlr-mode more modular - allow to add new
target languages without changing existing code.
(antlr-language-variables, antlr-language-mode-name)
(antlr-java-language-mode-name, antlr-action-mode)
(antlr-java-action-mode, antlr-init-cc-mode)
(antlr-java-init-cc-mode, antlr-init-submode)
(antlr-indent-action-line, antlr-action-font-lock-keywords)
(antlr-java-action-font-lock-keywords, antlr-action-scope-names)
(antlr-action-names, antlr-java-action-names): New variables.
(antlr-c-language-mode-name, antlr-cpp-language-mode-name)
(antlr-objc-language-mode-name, antlr-c-action-mode)
(antlr-cpp-action-mode, antlr-objc-action-mode)
(antlr-c-init-cc-mode, antlr-cpp-init-cc-mode)
(antlr-obj-init-cc-mode, antlr-cpp-action-font-lock-keywords)
(antlr-c-action-font-lock-keywords)
(antlr-objc-action-font-lock-keywords)
(antlr-js-language-mode-name, antlr-js-action-mode)
(antlr-js-init-submode, antlr-js-action-font-lock-keywords)
(antlr-js-indent-action-line, antlr-delphi-language-mode-name)
(antlr-delphi-action-mode, antlr-delphi-init-submode)
(antlr-delphi-action-font-lock-keywords)
(antlr-delphi-indent-action-line, antlr-ruby-language-mode-name)
(antlr-ruby-action-mode, antlr-ruby-init-submode)
(antlr-ruby-action-font-lock-keywords)
(antlr-ruby-indent-action-line, antlr-python-language-mode-name)
(antlr-python-action-mode, antlr-python-action-font-lock-keywords)
(antlr-python-indent-action-line, antlr-python-init-submode): New
variables.
(antlr-init-js, antlr-js-indent-action-line, antlr-init-delphi)
(antlr-delphi-indent-action-line, antlr-init-ruby)
(antlr-ruby-indent-action-line, antlr-init-python)
(antlr-python-indent-action-line): New functions.
(antlr-font-lock-keywords-alist): Remove variable.
(antlr-guess-language): Rename from anlr-language-option, use
antlr-language-list, use cl function.

* antlr-mode.el: Make antlr-mode more modular - allow to add new
ANTLR versions/flavors without changing existing code.
(antlr-tool-version): Is a symbol now, default to nil = automatic.
For backward compatibility, numbers between 20000 and 29999 are
set to antlr-v2 in antlr-set-tool-version-and-mode-line.  This
variable should not be customized anymore - change :type spec.
(antlr-tool-version-variables, antlr-tool-mode-name)
(antlr-v4-tool-mode-name, antlr-v3-tool-mode-name)
(antlr-v2-tool-mode-name, antlr-language-list)
(antlr-v4-language-list, antlr-v3-language-list)
(antlr-v2-language-list, antlr-syntax-propertize)
(antlr-v4-syntax-propertize, antlr-v3-syntax-propertize)
(antlr-v2-syntax-propertize, antlr-v2-options-alist)
(antlr-v4-skip-line-regexp, antlr-v3-skip-line-regexp)
(antlr-font-lock-symbol-regexp)
(antlr-v4-font-lock-symbol-regexp)
(antlr-v3-font-lock-symbol-regexp)
(antlr-v4-grammar-header-regexp, antlr-v3-grammar-header-regexp)
New variables.
(antlr-options-alist): Make it tool-dependent.  Remove sub-version
specific settings for ANTLR v2.  Remove function.
(antlr-v2-grammar-header-regexp): Rename from
antlr-class-header-regexp.
(antlr-grammar-header-regexp): Make it tool-version dependent.
(antlr-mode-menu, antlr-insert-option-interactive)
(antlr-options-menu-filter, antlr-option-level)
(antlr-insert-option-do): Use tool specific variable.
(antlr-option-spec): ...and do not support sub versions.
(antlr-guess-tool-version): Rename from antlr-tool-version.
(antlr-set-local-variables): New function
(antlr-set-tool-version-and-mode-line): Use them.

* antlr-mode.el: Remove XEmacs and old Emacs compatibility code.
(require): require cl-lib instead cl at compile time.
(antlr-run-tool-interactive, antlr-insert-makefile-rules)
(antlr-set-tabs, antlr-next-rule, antlr-downcase-literals)
(antlr-file-dependencies): Use cl- prefix for cXXXr, cXXXXr, incf,
decf, list*.
(cond-emacs-xemacs, cond-emacs-xemacs-macfn, defunx)
(ignore-errors-x, save-buffer-state-x): Delete functions/macros.
(antlr-skip-sexps, antlr-hide-actions, antlr-option-kind): Adopt.
(antlr-mode-menu): Do not test for Emacs below 21.0.
(antlr-with-syntax-table): Delete, use with-syntax-table instead.
(antlr-imenu-create-index-function, antlr-inside-rule-p)
(antlr-end-of-rule, antlr-beginning-of-rule, antlr-end-of-body)
(antlr-downcase-literals, antlr-hide-actions)
(antlr-option-level, antlr-file-dependencies, antlr-indent-line)
(antlr-electric-character, antlr-tool-version): Adopt.
(antlr-default-directory): Delete function.  Actually XEmacs'
default-directory as a function is quite useful...
(antlr-run-tool-interactive, antlr-insert-makefile-rules): Adopt.
(antlr-read-shell-command): Delete, use read-shell-command.
(antlr-run-tool-interactive): Adopt.
(antlr-with-displaying-help-buffer): Delete.
(antlr-show-makefile-rules): Use with-output-to-temp-buffer.
(antlr-invalidate-context-cache)
(antlr-syntactic-context):  Remove XEmacs code.
(antlr-end-of-rule, antlr-beginning-of-rule, antlr-end-of-body)
(antlr-beginning-of-body): use interactive "^" for "_" in XEmacs.
(antlr-mode): Do not consider cc-mode below 5.30.

* antlr-mode.el: Scope references inside a v3 rule and import
statements in a v4 grammar do not confuse the navigation anymore.
(antlr-skip-line-regexp): New variable, contains regexp for v3
"scope" / v4 "import" up to the semicolon.
(antlr-set-tool-version-and-mode-line): Set it.
(antlr-search-result): New function.
(antlr-search-forward, antlr-search-backward): Use it.  Add extra
regexp parameter for occurrences which should be skipped.
(antlr-imenu-create-index-function, antlr-next-rule)
(antlr-beginning-of-rule, antlr-indent-line): Provide
`antlr-skip-line-regexp' when searching for ";".
(antlr-rule-postlude-skip-alist): Make it a `defconst',
re-compilation would use previous value.  Add "import".
(antlr-skip-rule-postlude): Allow function as SKIP.
(antlr-skip-import-statement): New function for postlude skip.

* antlr-mode.el: Correctly recognize ANTLR v4 lexer charsets,
[...], and v3 templates, <<...>>, as literals.
(antlr-syntax-propertize-wholerule)
(antlr-syntax-propertize-charsets)
(antlr-syntax-propertize-template-literals): New function
(antlr-set-tool-version-and-mode-line): Use them.
(antlr-imenu-create-index-function): Call `syntax-propertize'.

* antlr-mode.el (antlr-end-of-defun-is-next): New option.  If
non-nil, both `antlr-end-of-rule' and `antlr-end-of-rule' jump to
beginning of a rule with no or positive prefix arg, and to the end
of a rule with negative prefix arg.  Default nil means:
`antlr-end-of-rule' jumps to beginning of a rule,
`antlr-end-of-rule' jumps to end of a rule.
(antlr-end-of-rule): Use it.
(antlr-beginning-of-rule): Use it

* antlr-mode.el: Options support for ANTLR v3 and v4.
(antlr-v3-options-alists): Correct prompts.
(antlr-v4-options-alists): New variable.
(antlr-options-alists): Use it.
(antlr-read-boolean): Use `y-or-n-p' without TABLE.
(antlr-mode-menu): Do not include empty option menus.
(antlr-option-level): Consider non-existent file/subrule options.
Correctly recognize v3/v4 grammar definitions.

* antlr-mode.el: Imenu and syntax-highlighting corrections.
(antlr-font-lock-late-keywords): Correct syntax-highlighting of
rule definitions with modifiers in same line.
(antlr-grammar-header-regexp): New regexp for v3 and v4.
(antlr-class-header-regexp): New function.
(antlr-imenu-create-index-function): Also collect v4 scanner
modes. Correctly scan fragment rules.

* antlr-mode.el: Correctly skip the part of the rule which comes
after the semicolon.  To simplify things, consider v2 class
preamble actions as belonging to the previous definition.
(antlr-skip-file-prelude): Skip final ACTION.
(antlr-rule-postlude-skip-alist)
(antlr-rule-postlude-skip-regexp): New variables.
(antlr-skip-rule-postlude): Use them.  Rename from
`antlr-skip-exception-part'.
(antlr-beginning-of-body): Tool version-dependent error message.
(antlr-options-alists): Consider v4 options.

* antlr-mode.el (antlr-indent-line): For indentation cycling in
Python, do not require a patched python.el anymore, but
prog-mode.el and python.el from Emacs-24.5.  Do not touch
multi-line python actions which do not start in its own line -
they are a bad idea anyway.

* antlr-mode.el: Experimental indentation cycling for Python
actions.  Requires a patched python.el.  Note: this patch is just
a first proposal by me - things will change.
(antlr-indent-line): Bind `python-submode-indentation-context'
while calling `python-indent-line'.

* antlr-mode.el: Use much less intrusive face settings, some minor
font-lock changes.
(antlr-syntax): Just inherit from `font-lock-keyword-face', face
is now only used for AST-relevant operators (!, ^, ->), not
parentheses, colons etc anymore - see below.
(antlr-keyword): Just inherit from `font-lock-keyword-face'.
(antlr-ruledef): Just inherit from `font-lock-function-name-face'.
(antlr-tokendef): Just inherit from `font-lock-function-name-face'.
(antlr-ruleref): Just inherit from `font-lock-type-face'.
(antlr-tokenref): Just inherit from `font-lock-constant-face'.
(antlr-attribute): Just inherit from `font-lock-preprocessor-face'.
(antlr-literal): Just inherit from `font-lock-string-face' and
specify :weight bold.
(antlr-grammardef-face): Delete variable introduced in v3.0.2.
(antlr-grammardef): Delete face, use `font-lock-type-face'.
(antlr-font-lock-late-keywords): Change according to semantic
change of `antlr-syntax', properly highlight scope definitions.
(antlr-font-lock-additional-keywords): Change highlighting
according to ANTLR change concerning grammar element labels, ANTLR
v3/v4 only.  Use `font-lock-negation-char-face' for ~, single dot.

* antlr-mode.el: Be more robust / fix bug introduced with v3.0.5 -
class definitions in ANTLR v2 grammars would look strange,
makefile dependencies would not work even with ANTLR v2 grammars.
(antlr-class-header-regexp): Revert accidentally change in regexp.
(antlr-insert-makefile-rules): Be more robust against incomplete
grammar files, i.e. those without any extracted dependency.

* antlr-mode.el: Indentation for non-cc-based languages:
JavaScript, Delphi, Ruby - Python actions are left as they are.
(antlr-indent-line): For a line starting with the closing brace of
bracket of an action / parameter section, use our own indentation
engine, not that of the grammar language.
(antlr-indent-line): Run indentation functions of `js-mode',
`opascal-mode' and `ruby-mode' with buffer restriction starts
after the opening brace/bracket.
(antlr-indent-command): Preparation for future support for
indentation cycling used by Python - do not insert a TAB with
repeated call of this command.
(antlr-set-tool-version-and-mode-line): Locally set indentation
offsets/levels of grammar language according to offset used in the
ANTLR grammar.

* antlr-mode.el: Correct indentation of rule headers.
(antlr-indent-line): When looking for the end of a rule header, do
not stop at colon if that is followed by another one, because this
the scope name of a preceeding grammar action.

* antlr-mode.el: Support more action languages.
(antlr-language-alist): Add entries for C, Delphi, JavaScript,
ObjC, Python and Ruby, additional to Java and Cpp.
(antlr-language-limit-n-regexp): Allow language name to contain
digits.
(antlr-font-lock-keywords-alist): Add font-lock specifications for
the newly supported languages.
(antlr-set-tool-version-and-mode-line): Handle non-cc-based
languages, currently hard-coded.

* antlr-mode.el: Preparation for non-cc-mode-based indentation.
(antlr-indent-line): With non-cc-based languages, do not touch
lines in braces and brackets, i.e. mainly actions.

* antlr-mode.el: Bug fixes and minor changes.
(antlr-indent-line): Introduced 3.0.4: lines starting with a colon
would be incorrectly indented.
(antlr-tool-version): v3 grammars with a class definition in a
header action or containing a rule called "header" or "class"
would be incorrectly categorized as v2 grammar.
(antlr-set-tool-version-and-mode-line, antlr-mode): Set
`indent-line-function' and friends after initializing cc-mode.
(antlr-java-action-names): Renamed from `antlr-action-names',
only include action names used with language Java.
(antlr-font-lock-late-keywords): Check action names only in Java.

* antlr-mode.el: Preparation for v3/v4 options support.
(antlr-v3-options-alists): New variable.
(antlr-options-alists): New function.
(antlr-insert-option-interactive, antlr-options-menu-filter)
(antlr-insert-option-do): Use it.
(antlr-option-spec): Allow options-alist not to specify ANTLR
subversions.

* antlr-mode.el: More flexible tool invocation.
(antlr-tool-path): New variable.
(antlr-run-tool): Use it.
(antlr-tool-command): Can now be a function.
(antlr-run-tool-interactive): Change accordingly.

* antlr-mode.el: Emacs-corrected and more flexible indentation.
(antlr-syntactic-context): Bind `parse-sexp-ignore-comments' to t,
parentheses inside comments would bring Emacs out of sync.
(antlr-base-offset-alist): New user option.
(antlr-indent-line): Use it.

* antlr-mode.el: Delay language recognition and tab settings.
(antlr-tool-version): Correctly recognize v2 grammars without
header{...}.
(antlr-set-tool-version-and-mode-line): Set language here.
(antlr-mode): Do not set language here.

* antlr-mode.el: Bug fixes.
(antlr-language-limit-n-regexp): Also recognize 'LANG'.
(antlr-imenu-create-index-function): in ANTLR v2 grammars,
`which-function-mode' would not work, classes would not appear.
(antlr-font-lock-checked-face): action names would not be
highlighted, the doc string was inserted at the wrong place...

* antlr-mode.el: Use "Antlr2"/"Antlr3"/"Antlr4" in mode line.
(antlr-tool-version): Set default value to nil = automatic.
(antlr-tool-version): New function.
(antlr-set-tool-version-and-mode-line): New function.
(antlr-after-body-hook): New variable.
(antlr-mode): Run it as mode hook.
(antlr-v4-mode): Do not update mode line anymore.

* antlr-mode.el: Minor font-lock changes.
(antlr-font-lock-literal-regexp): Also match strings surrounded by
single quotes, and symbols and punctuation.
(antlr-font-lock-late-keywords): Highlight regexp group 2 of that.

* antlr-mode.el: Preparation for further v3 and v4 support.
(antlr-v4-mode): New major mode for file suffix "g4".

* antlr-mode.el: Adopt imenu and navigation to ANTLR v3 and v4.
(antlr-imenu-create-index-function): Recognize fragment
specification and named actions.
(antlr-skip-exception-part): With v3 and v4, there is no
'exception' keyword, but an additional optional 'finally'.

* antlr-mode.el: Adopt font-lock to ANTLR v3 and v4.
(antlr-grammardef, antlr-attribute): New faces.
(antlr-action-names, antlr-action-scope-names): New variables
(antlr-font-lock-late-keywords): Recognize new elements.
(antlr-font-lock-additional-keywords): Changed font-lock for $attr
constructs.

* antlr-mode.el: Newer cc-mode fontification is very eager,
i.e. would overwrite that of antlr-mode.
(antlr-font-lock-late-keywords): New variable, also using
OVERRIDE in MATCH-HIGHLIGHT.
(antlr-font-lock-keywords): Add at end of keywords.
(antlr-font-lock-additional-keywords): Delete keywords here.

* antlr-mode.el: Checked ANTLR up to latest v2.
(antlr-tool-version): Set for ANTLR v2.7.7.
(antlr-options-alists): Added options introduced with ANTLR
v2.7.2, "classHeaderPrefix" and "noConstructors".

* antlr-mode.el: redisplay during font-lock could signal
"c-where-wrt-brace-construct: c-beginning-of-decl-1 returned
label".
(antlr-font-lock-defaults): Do not set `beginning-of-defun'.

* antlr-mode.el: Delete support for old cc-mode versions.
(antlr-c-init-language-vars): Delete function.
(antlr-mode): Do not call it anymore.
(antlr-mode-syntax-table): Adopt docstring to changed init.

* antlr-mode.el: imenu creation could signal
"c-where-wrt-brace-construct: c-beginning-of-decl-1 returned
label".
(antlr-slow-cache-diff-threshold): Delete variable.
(antlr-syntactic-context): Do not use it here, do not call
`beginning-of-defun' anymore.
(antlr-mode): Allow /// etc as `comment-start-skip'. Still set
`require-final-newline'.

* antlr-mode.el (antlr-electric-character): With Emacs, use
`last-command-event' instead `last-command-char'.

* antlr-mode.el: imenu creation could signal
"c-where-wrt-brace-construct: c-beginning-of-decl-1 returned
label".
(antlr-slow-cache-diff-threshold): Deletia.
(antlr-syntactic-context): Do not use it here, do not call
`beginning-of-defun' anymore.
2025-12-09 07:52:20 +01:00
Paul Eggert
d10a649e1b Pacify -Wunused-function re get_conversion_field
* src/textconv.c (get_conversion_field): Define only if HAVE_ANDROID,
since it is unused on non-Android.
2025-12-08 18:32:01 -08:00
Paul Eggert
4990849514 Move Gnulib configuration back to where it was
* configure.ac: Move the gl_INIT call back to where it was,
as Mattias Engdegård reported the following problem:
  checking whether pthread_sigmask is a macro... no
  ./configure: line 32767: test: =: unary operator expected
because moving gl_INIT up made the check for pthread_sigmask’s
availability appear later than Gnulib’s check whether it’s a macro.
Instead of moving gl_INIT up, call gl_ALIGNASOF earlier,
as that’s the only part of gl_INIT that is needed earlier.
2025-12-08 18:19:41 -08:00
Po Lu
238c2dc3b6 ; * src/keyboard.c (make_lispy_event): Remove unused variable. 2025-12-09 09:49:23 +08:00
Po Lu
a9018ee498 Fix builds without toolkit menu bars
* src/keyboard.c (make_lispy_event): Call x_y_to_column_row when
building internal menu bar events.

* src/xdisp.c (x_y_to_column_row): Provide DX and DY parameters
to x_y_to_column_row.
2025-12-09 09:48:53 +08:00
João Távora
6caf598ac4 Jsonrpc: defend against very large stderr lines
In https://github.com/joaotavora/rassumfrassum/issues/1 we found
a language server that emits very large single-line messages
(5MB): that eventually end up in Eglot's stderr.  With the
output arriving in chunks into the stderr buffer, this creates a
significant slowdown of '[stderr] nil' lines, which eventually
clogs up the stdout JSONRPC communication.

This fix exits the `jsonrpc--forwarding-buffer` function early
if the forward-line call didn't actually move to a new line.

* lisp/jsonrpc.el (jsonrpc--forwarding-buffer): Fix.
(Version): Bump to 1.0.27.
2025-12-08 21:41:31 +00:00
Elías Gabriel Pérez
74348a722a ; * lisp/progmodes/hideshow.el (hs-block-positions): Fix throw tag. 2025-12-08 21:16:03 +02:00
Paul Eggert
1c43511dbc Fix xmenu.c USE_X_TOOLKIT duplication
* src/xmenu.c (Fx_menu_bar_open_internal):
Don’t say ‘#ifdef USE_X_TOOLKIT’ inside an #if where
it is already known that USE_X_TOOLKIT is defined.
2025-12-08 10:41:50 -08:00
Paul Eggert
855ad6d870 Fix some C symbol extern visibility
Make some C symbols static if they don’t need to be extern.
Also, remove a couple of functions that were discovered to be
unused as a result of this process, and mark two extern
functions intended to be usable from GDB.
* src/buffer.c (previous_overlay_change):
* src/composite.c (composition_lisp_table):
* src/fileio.c (file_name_directory):
* src/frame.c (check_tty):
* src/insdel.c (adjust_markers_for_insert):
* src/keyboard.c (unread_switch_frame, read_char)
(requeued_events_pending_p):
* src/sysdep.c (renameat_noreplace) [!HAVE_ANDROID]:
* src/textconv.c (get_conversion_field) [!HAVE_ANDROID]:
* src/treesit.c (TREESIT_BOB_LINECOL, TREESIT_TS_POINT_1_0)
(treesit_buf_tracks_linecol_p, make_treesit_parser)
(make_treesit_node):
* src/xdisp.c (x_y_to_hpos_vpos):
* src/xfaces.c (load_color) [!MSDOS]:
* src/xfns.c (x_real_pos_and_offsets):
* src/xterm.c (x_dnd_do_unsupported_drop):
Now static.  Move up if necessary.
* src/coding.c (utf8_string_p):
* src/keyboard.c (detect_input_pending_ignore_squeezables):
Remove; unused.
* src/frame.c (gui_set_alpha):
* src/textconv.c (start_batch_edit, end_batch_edit, commit_text)
(finish_composing_text, set_composing_text)
(set_composing_region, textconv_set_point_and_mark)
(delete_surrounding_text, request_point_update)
(textconv_barrier, replace_text, get_extracted_text)
(get_surrounding_text):
* src/xdisp.c (gui_union_rectangles):
* src/xterm.c (xi_frame_selected_for):
Define only if needed.
* src/treesit.c (treesit_debug_print_parser_list)
(treesit_debug_print_linecol): Declare EXTERNALLY_VISIBLE.
* src/xdisp.c (x_y_to_column_row): New function, defined
only if needed.  All external callers to x_y_to_hpos_vpos changed.
2025-12-08 10:41:50 -08:00
Przemysław Kryger
777622682f Fix package-vc-tests
* lisp/emacs-lisp/package-vc.el (package-vc--make): Use same
format for buffer as `package-vc--build-documentation'.
* test/lisp/emacs-lisp/package-vc-tests.el
(message-auto-save-directory): Silence byte compiler.
(package-vc-with-tests-environment): Initialize package archives
after setting a temporary `package-user-dir'.  Set up
`package-gnupghome-dir'.  Remove `default-directory' binding.
(package-vc-tests-environment-tear-down): Fix argument order in
`package-vc-tests-log-buffer-name' call.
(package-vc-tests-with-installed): Rename from
`package-vc-with-installed-tests'.
(package-vc-test-deftest): Use
`package-vc-tests-with-installed'.
(prepare-patch): Bind `message-auto-save-directory' to
`package-vc-tests-dir'.
* test/lisp/package-vc-tests.el: Rename to
test/lisp/emacs-lisp/package-vc-tests.el
* test/lisp/package-vc-resources/Makefile.in: Rename to
test/lisp/emacs-lisp/package-vc-resources/Makefile.in
* test/lisp/package-vc-resources/test-package-SUFFIX-inc.texi.in:
Rename to
test/lisp/emacs-lisp/package-vc-resources/test-package-SUFFIX-inc.texi.in
* test/lisp/package-vc-resources/test-package-SUFFIX-lib-v0.1.el.in:
Rename to
test/lisp/emacs-lisp/package-vc-resources/test-package-SUFFIX-lib-v0.1.el.in
* test/lisp/package-vc-resources/test-package-SUFFIX-lib-v0.2.el.in:
Rename to
test/lisp/emacs-lisp/package-vc-resources/test-package-SUFFIX-lib-v0.2.el.in
* test/lisp/package-vc-resources/test-package-SUFFIX-v0.1.el.in:
Rename to
test/lisp/emacs-lisp/package-vc-resources/test-package-SUFFIX-v0.1.el.in
* test/lisp/package-vc-resources/test-package-SUFFIX-v0.2.el.in:
Rename to
test/lisp/emacs-lisp/package-vc-resources/test-package-SUFFIX-v0.2.el.in
* test/lisp/package-vc-resources/test-package-SUFFIX.texi.in:
Rename to
test/lisp/emacs-lisp/package-vc-resources/test-package-SUFFIX.texi.in
2025-12-08 18:48:09 +01:00
Sean Whitton
70d24d0dd5 ; Improve documentation of the User Lisp directory. 2025-12-08 16:53:16 +00:00
Sean Whitton
154d6f0a15 ; package-vc-install-from-checkout: Fix 'obsolete' declaration. 2025-12-08 16:49:13 +00:00
Sean Whitton
44d47caa86 New 'R' code letter for 'interactive' forms
* src/callint.c (callint_argfuns): Add use-region-beginning and
use-region-end.
(syms_of_callint): Protect use-region-beginning and
use-region-end.  Add DEFSYM for Quse_region_p.
(Fcall_interactively): New 'R' code letter.
* lisp/textmodes/paragraphs.el (repunctuate-sentences):
* lisp/vc/diff-mode.el (diff-delete-other-hunks, diff-apply-hunk)
(diff-revert-and-kill-hunk, diff-apply-buffer):
* lisp/vc/log-view.el (log-view-mark-entry)
(log-view-unmark-entry): Use it.
* doc/lispref/commands.texi (Interactive Codes):
* doc/lispref/markers.texi (The Region):
* etc/NEWS:
* lisp/simple.el (use-region-beginning, use-region-end)
(use-region-p):
* src/callint.c (Finteractive): Document it.
2025-12-08 15:01:50 +00:00
Stefan Monnier
5fcafba4e3 lisp/help-fns.el (describe-symbol): Don't silently do nothing 2025-12-08 09:51:52 -05:00
Stefan Monnier
ad72596067 (loaddefs-generate--make-autoload): Obey expand-macro at each step
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--make-autoload):
Perform one macro expansion at a time.
2025-12-08 09:48:06 -05:00
Robert Pluim
37d398dd0d ; * etc/NEWS (Note): Grammar fix. 2025-12-08 15:26:22 +01:00
Robert Pluim
27130d3af6 Improve 'auth-source-ignore-non-existing-file' doc
* doc/misc/auth.texi (Help for users): Improve
'auth-source-ignore-non-existing-file' description.  Include
warning about storing cleartext in .authinfo.
2025-12-08 15:26:22 +01:00
Robert Pluim
ecf42e6a59 * doc/misc/auth.texi (Help for users): Warn about use of .authinfo 2025-12-08 15:26:22 +01:00
David Caldwell
15d9af4f5e NS: Fix compilation on pre macOS 11 macs
* src/nsterm.m ([EmacsWindow initWithEmacsFrame:fullscreen:screen:]):
Add a compile check around setToolbarStyle since it is not available
until macOS 11.0 and a run-time check in case it was compiled on
macOS >= 11.0 but run on an earlier version.  (Bug#79951)
2025-12-08 16:22:42 +02:00
Eli Zaretskii
d50fde57ba ; Fix commentary in xfaces.c
* src/xfaces.c (face_at_buffer_position)
(face_at_string_position): Fix commentary.
2025-12-08 16:19:59 +02:00
Jeremy Bryant
22bf7158a5 ; * src/.gdbinit: Improve comments of .gdbinit helper functions (bug#79932)
xgetptr: Improve comment describing helper function.
xgetint: Add comment describing helper function.
xgettype: Add comment describing helper function.
xgetsym: Add comment describing helper function.
xprintstr: Add comment describing helper function.

Co-authored-by: Eli Zaretskii <eliz@gnu.org>
2025-12-08 16:11:50 +02:00
Paul Eggert
24297f6d9a Simplify conv_sockaddr_to_lisp via strnlen
* src/process.c (conv_sockaddr_to_lisp):
Use strnlen rather than a circumlocution.
2025-12-07 23:40:12 -08:00
Elías Gabriel Pérez
ddf297068c * lisp/textmodes/bibtex.el (bibtex-mode): Fix hs variables (bug#79934). 2025-12-08 09:20:48 +02:00
Elías Gabriel Pérez
8773933816 Fix 'treesit-hs-block-end' and 'treesit-hs-inside-comment-p' (Bug#79934)
* lisp/treesit.el (treesit-hs-block-end): Properly get the block
end.
(treesit-hs-inside-comment-p): Add support for single-line
comments.
2025-12-08 09:20:40 +02:00
Elías Gabriel Pérez
a582f2bb57 hideshow: Deep cleaning. (Bug#79934)
This is just a refactoring change, simplifying most of the code
and commentaries and removing/deprecating redundant code.

* etc/NEWS: Announce changes.
* lisp/progmodes/hideshow.el (hs-hide-hook, hs-show-hook): Use
'defcustom' instead of 'defvar'.
(hs-block-end-regexp, hs-forward-sexp-function)
(hs-adjust-block-beginning-function)
(hs-adjust-block-end-function, hs-find-block-beginning-function)
(hs-find-next-block-function)
(hs-looking-at-block-start-predicate)
(hs-inside-comment-predicate): Update docstring.
(hs-discard-overlays): Simplify.
(hs-life-goes-on): Update docstring.
(hs-hideable-region-p): Revert previous changes.
(hs-overlay-at): Simplify.
(hs-make-overlay): Fix performance.
(hs-block-positions): Rework.
(hs--add-indicators): Fix performance.
(hs-isearch-show-temporary): Simplify.
(hs-looking-at-block-start-p): Rename ...
(hs-looking-at-block-start-p--default): ... to this.
(hs-forward-sexp, hs-hide-comment-region): Mark as obsolete.
(hs-hide-block-at-point): Rework.
(hs-get-first-block): Rename ...
(hs-get-first-block-on-line): ... to this.
(hs-inside-comment-p--default): Rework.
(hs-find-block-beginning): Rename ...
(hs-find-block-beg-fn--default): ... to this.
(hs-find-next-block): Rename ...
(hs-find-next-block-fn--default): ... to this.
(hs-hide-level-recursive): Rework.
(hs-find-block-beginning-match): Remove function.
(hs-already-hidden-p): Simplify.
(hs-c-like-adjust-block-beginning): Mark as obsolete.
(hs-hide-all, hs-show-all, hs-hide-block, hs-show-block)
(hs-hide-level, hs-hide-initial-comment-block, hs-cycle):
Simplify.
* test/lisp/progmodes/hideshow-tests.el (hideshow-hide-level-1)
(hideshow-hide-level-2):
* test/lisp/progmodes/python-tests.el
(python-hideshow-hide-levels-3, python-hideshow-hide-levels-4):
* test/lisp/progmodes/hideshow-tests.el (hideshow-hide-level-1)
(hideshow-hide-level-2):
* test/lisp/progmodes/python-tests.el
(python-hideshow-hide-levels-3, python-hideshow-hide-levels-4):
Update tests.
2025-12-08 09:20:29 +02:00
Po Lu
15f9050ce5 Fix the DJGPP port
* msdos/sed2v2.inp (ALIGNOF_EMACS_INT): Define to 4.

* msdos/sedlibmk.inp (OMIT_GNULIB_MODULE_fchmodat)
(OMIT_GNULIB_MODULE_issymlinkat, OMIT_GNULIB_MODULE_issymlink)
(OMIT_GNULIB_MODULE_lchmod): Define to true.

* src/gmalloc.c (__morecore, __after_morecore_hook)
(__malloc_initialize_hook): Don't declare till stddef.h has been
included for `ptrdiff_t'.
2025-12-08 10:06:29 +08:00
Paul Eggert
b211e5489b Update from Gnulib by running admin/merge-gnulib
* admin/merge-gnulib (AVOIDED_MODULES): Add strncpy, as Emacs is not
likely to exercise the FreeBSD 15 strncpy bug that this module fixes.
* lib/issymlinkat.h: New file, taken from Gnulib.
2025-12-07 15:45:20 -08:00
Paul Eggert
0d43f2a562 Align config.h better to src/lisp.h
This is mostly a cleanup patch to fix growing discrepancies
between src/lisp.h and configure.ac in terms of how they deduce
how EMACS_INT aligns.  The patch includes a static check that the
two methods now agree.  It also speeds up ‘configure’ a bit.
* configure.ac (ALIGNOF_INT, ALIGNOF_LONG, ALIGNOF_LONG_LONG):
Remove; no longer used.
(ALIGNOF_EMACS_INT): New macro.
(system_malloc): Set to 'no' more consistently with what’s
in src/lisp.h.
* src/lisp.h (ALIGNOF_EMACS_INT): Do not define here, as config.h
defines it now.  Check that config.h’s definition equals the
actual alignof (EMACS_INT).
(USE_USB_TAG): Set more consistently with what’s in configure.ac.
(alignas): Don’t second-guess Gnulib.
2025-12-07 15:45:20 -08:00
Paul Eggert
f766e8a36b Work around GCC bug 123042
* src/ccl.c: The bug occurs in GCC versions after GCC 13.
2025-12-07 15:45:20 -08:00
Paul Eggert
2b7261d7f5 Include malloc.h early in alloc.c
* src/alloc.c, src/gmalloc.c: Include <malloc.h> before <stdlib.h>.
This mimics include patterns elsewhere, and avoids a problem if
malloc.h declares realloc (i.e., rpl_realloc) early as extern,
whereas Gnulib stdlib.h declares it later as inline which means it
is extern inline, which clashes with gmalloc’s definition of
rpl_realloc when gmalloc.o is used.  Problem discovered when
building Emacs on Ubuntu 25.10 with "./configure CC='gcc -m32'
emacs_cv_struct_alignment=no gl_cv_header_working_stdalign_h=no".
2025-12-07 15:45:20 -08:00
Paul Eggert
caf0941e56 Pacify -Werror=null-dereference in ralloc.c
* src/ralloc.c (find_heap, update_heap_bloc_correspondence):
Omit unnecessary comparisons to NULL that cause GCC to warn.
2025-12-07 15:45:19 -08:00
Paul Eggert
a8b9364949 Move Gnulib configuration up in configure.ac
This is so that later patches can fix some near-duplication errors
in the malloc configuration.
* configure.ac: Move Gnulib configuration earlier.
2025-12-07 15:45:19 -08:00
Paul Eggert
2203fac659 Remove some obsolete C89, C99, Automake cruft
These have not been needed for some time in configure.ac.
* configure.ac (_AC_PROG_CC_C89): Don’t bother redefining to empty.
(gl_PROG_CC_C99, AC_PROG_CC_C_O): Remove; no longer needed.
2025-12-07 15:45:19 -08:00
Amin Bandali
4dbf78c118 ; * doc/emacs/custom.texi (User Lisp Directory): Small tweaks. 2025-12-07 18:00:45 -05:00
Philip Kaludercic
7a66362c25
Make 'package-vc-install-from-checkout' as obsolete
See https://mail.gnu.org/archive/html/emacs-devel/2025-11/msg00039.html.

* lisp/emacs-lisp/package-vc.el (package-vc-install-from-checkout):
Obsolete it.
2025-12-07 22:42:29 +01:00
Przemysław Kryger
3b0dcb0b1b
Add tests for package-vc
* test/lisp/package-vc-tests.el
(package-vc-tests-preserve-artefacts): When non nil then
preserve temporary test files and buffers.
(package-vc-tests-dir, package-vc-tests-packages)
(package-vc-tests-repository): Silence byte compiler.
(package-vc-tests-packages): Define packages to test.
(package-vc-tests-add): Copy a an in file template, update
SUFFIX in it and add it to index.
(package-vc-tests-create-repository): Create a package git
repository with a test package's source.
(package-vc-tests-package-desc): Retrieve a `package-desc' for
tested package.
(package-vc-tests-package-spec): Retrieve a pkg-spec for tested
package.
(package-vc-tests-package-lisp-dir): Determine a lisp directory
for a package.
(package-vc-tests-package-main-file): Calculate expected
location of package's main file.
(package-vc-tests-load-history-marker): Create a load history
marker.
(package-vc-tests-load-history-pattern): Create a regexp pattern
to search in `load-history'.
(package-vc-tests-load-history-position): Calculate a position
in `load-history'.
(package-vc-tests-load-history-interesting-entries): Return
`load-history' entries related to the current
`package-vc-tests-dir'.
(package-vc-tests-explain-load-history-position): Return ERT
explanation for load history position failures.
(package-vc-tests-log-buffer-name): Return name of a log buffer
used to build package or its documentation.
(package-vc-tests-log-buffer-exists): Return non-nil when a log
buffer used to build package or its documentation exists.
(package-vc-tests-explain-log-buffer): Print contents of log
buffer used to build package or its documentation and return ERT
explanation for the failure.
(package-vc-tests-elc-files): Check that there are elc files and
that there is no compiled autoloads file amongst them.
(package-vc-tests-assert-delete-elc): Assert that .elc files are
present for a package.
(package-vc-tests-assert-package-alist): Assert that
`package-alist' contains a `package-desc' for package, and that
the `package-desc' has correct slot `version' and slot
`dir'.:(package-vc-tests-reset-head^): Reset head of checkout of
tested packages to HEAD^.
(package-vc-tests-packages-head): Return current checkout
revision.
(package-vc-tests-make-spec): Make a new test spec for a test
package.
(with-package-vc-tests-environment): Setup test environment.
(package-vc-tests-environment-tear-down): Tear down test
environment.
(with-package-vc-tests-installed): Withing a test environment,
install package, evaluate test body, and then tear down the test
environment.
(package-vc-tests-install-from-elpa)
(package-vc-tests-install-from-spec): Install a test package.
(package-vc-tests-checkout-from-elpa-install-from-checkout)
(package-vc-tests-checkout-with-git-install-from-checkout):
Checkout and install a test package.
(package-vc-tests-package-vc-async-wait): Wait for an
asynchronous VC command to finish.
(package-vc-tests-deftest): Define series tests for each package
in `package-vc-tests-under-test'.
(install-post-conditions): Tests that after installing a test
package the `load-history' entries, package's main file, commit,
elc files, and `package-alist' entry are correct.
(require): Test that after calling `require' the `load-history'
entries are correct.
(upgrade, upgrade-all): Test that after calling
`package-vc-upgrade'/`package-vc-upgrade-all' the `load-history'
entries, package's elc files, commit, and `package-alist' entry
are correct.
(upgrade-after-require, upgrade-all-after-require): Test that
after calling `require' followed by
`package-vc-upgrade'/`package-vc-upgrade-all' the `load-history'
entries, commit, package's elc files, and `package-alist' entry
are correct.
(rebuild): Test that after calling `package-vc-rebuild' on an
old version of a package, the package's old function, old macro,
elc files, and `package-alist' entry are correct.
(rebuild-after-require): Test that after calling `require'
followed by `package-vc-rebuild' on an old version of a package,
the package's old function, old macro, elc files, and
`package-alist' entry are correct.
(prepare-patch): Test that after calling
`package-vc-prepare-patch' the message buffer is correct.
(log-incoming): Test that after calling
`package-vc-log-incoming' the log buffer is correct.
(pkg-spec-doc-make-shell-command): Test that :doc, :make, and
:shell-command slots in a pkg spec execute.
* test/lisp/package-vc-resources/test-package-SUFFIX-v0.1.el.in:
* test/lisp/package-vc-resources/test-package-SUFFIX-lib-v0.1.el.in:
Code template of version 0.1 of a test package.
* test/lisp/package-vc-resources/test-package-SUFFIX-v0.2.el.in:
* test/lisp/package-vc-resources/test-package-SUFFIX-lib-v0.2.el.in:
Code template of code of version 0.2 of a test package.
* test/lisp/package-vc-resources/test-package-SUFFIX-inc.texi.in:
* test/lisp/package-vc-resources/test-package-SUFFIX.texi.in:
Documentation template of a test package.
* test/lisp/package-vc-resources/Makefile.in: Makefile template of
a test package.

Co-developed-by: Philip Kaludercic <philipk@posteo.net>

(Bug#79188)
2025-12-07 22:27:13 +01:00
Philip Kaludercic
dba1c734bf
Store VC checkout dir in 'package-desc-extras'
* lisp/emacs-lisp/package-vc.el (package-vc--url-scheme): Remove constant.
(package-vc--checkout-dir): Check 'package-desc-extras'.
(package-vc--save-selected-packages): Remove single-use function.
(package-vc--unpack): (Re-)inline 'package-vc--save-selected-packages'.
(package-vc-install-from-checkout): Set :vc-dir entry in
'package-desc-extras' if necessary.  (Bug#79188)
2025-12-07 22:24:09 +01:00
Przemysław Kryger
573acd97e5
Fix upgrading, rebuilding, and logging of VC packages
There are a few issues addressed in this patch:

1.  Compilation (including native compilation) should happen in
directory that contains package's Lisp code.

2.  After installing a package with
`package-vc-install-from-checkout' and subsequently upgrading it
with `package-vc-upgrade' the pkg-desc for the package becomes
corrupted.  After the upgrade the pkg-desc's dir (a.k.a
`pkg-dir') points to checkout directory.  This will cause the
subsequent `package-delete' to delete the checkout directory and
leaving incorrect forwarding autoloads file in
`package-user-directory'.

3. The detection of package's Lisp directory has been not
effective for packages installed with `package-vc-install' and
not existent for packages installed with
`package-install-from-checkout'.

4. Deduction of VC backend has been not working when called from
outside of deducing context.

5. Extract maintainers and store them in a package description
file when installing a package from a checkout.

* lisp/emacs-lisp/package-vc.el (package-vc--checkout-dir): New
function to determine the real checkout of a VC
package.
(package-vc--url-scheme): Define scheme for `:url' property.
(package-vc--generate-description-file): Extract maintainers
from main package file and store them in generated description
file.
(package-vc--save-selected-packages): Refactor new helper
function out of 'package-vc--unpack' to modify
'package-vc-selected-packages'.
(package-vc--checkout-dir): Use `pcase' to extract checkout
directory from `pkg-spec'.  Detect standard lisp sub directory
if called with non-nil `lisp-dir'.
(package-vc-commit, package-vc--main-file)
(package-vc--build-documentation, package-vc-prepare-patch): Use
'package-vc--checkout-dir'.
(package-vc--unpack-1): Remove superfluous `pkg-dir' argument.
Remove elc files before compilation.  Use a `package' with
`:dir' pointing to where package code is.  When `checkout-dir'
is different than `pkg-dir' then call `package--add-info-node'
and after calling `package-activate-1' reload source files in
case when `lisp-dir' is a sub directory.  Use the right
directories in the right places.
(package-vc-install-from-checkout): Remove superfluous
`package-vc-selected-packages' binding.  Remove `pkg-dir'
argument from `package-vc--unpack-1' calls.
(package-vc--unpack): Remove `lisp-dir' variable and convert to
`let*'.  Remove superfluous Lisp code sub directory detection -
logic moved to `package-vc--checkout-dir'.  Remove `pkg-dir'
argument from `package-vc--unpack-1' call. Use
'package-vc--save-selected-packages'.
(package-vc-upgrade, package-vc-rebuild): Remove `pkg-dir'
argument from `package-vc--unpack-1' calls. Use
'package-vc--checkout-dir'.
(package-vc-log-incoming): Set `vc-deduce-backend-nonvc-modes'
to t.  Use 'package-vc--checkout-dir'.
* lisp/emacs-lisp/package.el (package--add-info-node): New
function to install info node for package.  Extracted from
`package-activate-1'.
(package-activate-1): Call `package--add-info-node'.

Co-developed-by: Philip Kaludercic <philipk@posteo.net>

(Bug#79188)
2025-12-07 22:24:09 +01:00
Jens Schmidt
8a0217ebbc
Use a consistent package description
Ensure that the long description of a package is the same regardless of
originating package archive and package installation state.

* lisp/emacs-lisp/package.el: Add documentation on additional files that
Emacs creates during package installation.
(package-desc): Update incomplete description of slot `kind'.
(package-install-from-archive): Download '*-readme.txt' from the archive
and save it as 'README-elpa' to avoid the issues described in bug#79411.
* test/lisp/emacs-lisp/package-resources/multi-file-readme.txt:
* test/lisp/emacs-lisp/package-resources/simple-single-readme.txt:
Update readmes to mark them as "server readmes" and distinguish them
from what the packages themselves provide in their documentation.
* test/lisp/emacs-lisp/package-tests.el (package-test-install-singlefile)
(package-test-describe-installed-with-ws-only-readme): Add tests.
(package-test-install-multifile): Test more files for presence.
(package-test-describe-package)
(package-test-describe-installed-multi-file-package)
(package-test-describe-non-installed-package)
(package-test-describe-non-installed-multi-file-package): Test for
server readme being used as long description. (Bug#79411)
2025-12-07 22:24:09 +01:00
Jens Schmidt
3a2a3a618e
; Fix a test-relevant typo
* test/lisp/emacs-lisp/package-tests.el (package-test-install-file): Fix
a test-relevant typo.  (Bug#79411)
2025-12-07 22:24:09 +01:00
Jens Schmidt
b71e8f6e86
Brush up macro with-package-test and related tests
* test/lisp/emacs-lisp/package-tests.el (with-package-test): Remove
unused keyword :update-news and its implementation.  Add documentation
for remaining keywords, since in particular :basedir was being overused.
Eliminate code redundancy by reimplementing keyword :upload-base in
terms of equivalent macro `ert-with-temp-directory' macro.  Implement
other minor improvements.
(package-test-install-file, package-test-bug58367, package-test-bug65475)
(package-test-install-file-EOLs, package-test-install-multifile): Remove
superfluous :basedir keyword from `with-package-test' calls to not give
future developers bad example.
(package-test-install-multifile): Move file tests out of
`with-temp-buffer', as they are independent of current buffer.  (Bug#79411)
2025-12-07 22:24:09 +01:00
Philip Kaludercic
1b931fbe42
Prepare and load user scripts at startup
* doc/emacs/custom.texi (Early Init File): Document feature and
related user options.
* etc/NEWS: Mention new feature.
* lisp/startup.el (user-lisp-auto-scrape, user-lisp-directory)
(user-lisp-ignored-directories): New user options.
(prepare-user-lisp): New command.
(command-line): Invoke 'prepare-user-lisp' during startup if a
user-lisp directory exists and if not disabled per
'user-lisp-auto-scrape'.
2025-12-07 22:24:09 +01:00
David Fussner
3f54ff95d8
Fix package-vc to find the GNU "make" executable
* lisp/emacs-lisp/package-vc.el (package-vc--make): Improve heuristic
for finding the name of GNU "make" on the system.
(package-vc-make-program): New defcustom to allow the user to specify
the name of GNU "make" in case auto-detection doesn't work. (Bug#79729)
2025-12-07 22:24:09 +01:00
Sean Whitton
fab0bfc78f vc-dir-headers: Set a delayed message during vc--count-outgoing
* lisp/vc/vc-dir.el (vc-dir-headers): Set a delayed message
during vc--count-outgoing.
2025-12-07 15:19:23 +00:00
Sean Whitton
459ecb3d26 ; vc-test-exec-after-3: Delete unused FAILS local value. 2025-12-07 15:04:34 +00:00
Sean Whitton
0391b3f94e Check for successful exit when parsing output with vc-exec-after
When using vc-exec-after to parse program output, check that the
program didn't die to a signal or exit with an error exit code
before attempting the parse.  Continue to use plain
vc-run-delayed where we aren't parsing output, because in these
cases it doesn't matter to CODE if the output is incomplete.

* lisp/vc/vc-dispatcher.el (vc-exec-after): <process-status>:
Treat PROC dying to a signal the same as PROC exiting non-zero.

(vc-exec-after): <accept-process-output>: Restore making a
nonblocking call, for the case of vc-exec-after called from a
process sentinel.  diff-hl *does* require this.

(vc-exec-after): <OKSTATUS>: New parameter, replacing SUCCESS,
which never worked as documented.
* test/lisp/vc/vc-tests/vc-test-misc.el (vc-test-exec-after-3):
Test it.

(vc-run-delayed-success): New macro.
* lisp/vc/vc-git.el (vc-git-dir-status-goto-stage):
* lisp/vc/vc-hg.el (vc-hg-dir-status-files):
* lisp/vc/vc.el (vc-pull-and-push): Use it.

* lisp/obsolete/vc-arch.el (vc-exec-after):
* lisp/obsolete/vc-mtn.el (vc-exec-after):
* lisp/vc/vc-bzr.el (vc-exec-after):
* lisp/vc/vc-cvs.el (vc-exec-after):
* lisp/vc/vc-git.el (vc-exec-after):
* lisp/vc/vc-hg.el (vc-exec-after):
* lisp/vc/vc-svn.el (vc-exec-after): Update declarations.
2025-12-07 15:00:13 +00:00
Alan Mackenzie
3d4fe70ee5 Eliminate possible confusion in comments in registry.el.
This will prevent any recurrence of bug#79870 (whose cause has
not been established).

* lisp/registry.el (Header comments): Replace ";; version: a
float" with ";; version - a float", etc., to prevent ";;
version:" being wrongly recognized by
loaddefs-generate--parse-file.
2025-12-07 12:41:45 +00:00
Eli Zaretskii
300c6dc2f9 Allow volume control of system audio device on MS-Windows
* src/sound.c (Fw32_sound_volume): New function.

* etc/NEWS: Announce it.
2025-12-07 11:31:40 +02:00
Gerd Möllmann
2d459d8377 * src/comp.c (emit_EQ): Make a declaration an assignment (bug#79722) 2025-12-07 03:43:51 +01:00
Roi Martin
5e0414b05c ; Improve documentation of fill-region-as-paragraph-semlf
* lisp/textmodes/fill.el (fill-region-as-paragraph-semlf): Create
hyperlinks to URLs.
2025-12-06 18:48:38 +02:00