* lisp/net/eww.el (eww): Use 'completing-read' when prompting for a URL
or keywords.
(eww-minibuffer-url-keymap): New keymap for use in the URL/keyword
prompt.
* etc/NEWS (EWW): Add NEWS entry for the change. (Bug#62800)
* doc/misc/tramp.texi (Inline methods): Add flatpak.
* etc/NEWS: Add new Tramp method "flatpak". Fix typos.
* lisp/net/tramp-container.el (tramp-flatpak-program): New defcustom.
(tramp-flatpak-method): New defconst.
(tramp-flatpak--completion-function): New defun. Set it for "flatpak".
(tramp-methods) <flatpak>: Add.
(tramp-container-connection-local-default-flatpak-variables):
New defconst. Set respective connection-local variables.
* lisp/progmodes/python.el (python-indent-block-paren-deeper): New
user option.
(python-indent-context): Add a new context :inside-paren-from-block.
(python-indent--calculate-indentation): Modify according to
`python-indent-block-paren-deeper' and :inside-paren-from-block.
* test/lisp/progmodes/python-tests.el
(python-indent-inside-paren-block-1)
(python-indent-inside-paren-block-2)
(python-indent-inside-paren-block-3)
(python-indent-inside-paren-block-4): New tests.
(python-indent-inside-paren-5, python-indent-dedenters-8): Modify
according to the new context.
* etc/NEWS: Document the new user option. (Bug#62696)
Make `defvaralias` signal an error upon attempts to create variable
alias cycles. This detects errors earlier and makes the alias
traversal during execution simpler and faster since no cycle detection
is needed elsewhere.
Now variable and function aliases are handled identically in these
respects.
* src/lisp.h (indirect_variable): Remove declaration.
* src/data.c (indirect_variable): Remove.
(Findirect_variable): Update doc string. Simplify alias resolution.
(Fboundp, find_symbol_value, set_internal, default_value)
(set_default_internal, Fmake_variable_buffer_local)
(Fmake_local_variable, Fkill_local_variable, Flocal_variable_p)
(Flocal_variable_if_set_p, Fvariable_binding_locus):
* src/buffer.c (buffer_local_value):
* src/eval.c (specbind): Simplify variable alias resolution.
(Fdefvaralias): Update doc string. Check for cycles.
* doc/lispref/variables.texi (Variable Aliases):
Mention that `defvaralias` can signal `cyclic-variable-indirection`
but `indirect-variable` cannot.
* etc/NEWS: Announce the change.
* test/src/eval-tests.el (eval-tests-defvaralias): New test.
Some editors have this. Depending on your preference, this can either
be wildly distracting and easily confused with actual code, or a
significant early aid that relieves you from moving around or reaching
for the mouse to consult an error message. To be safe, hide this
behind a customization variable and keep it disabled.
Personally, I find it less obstrusive and more helpful than expected.
* lisp/progmodes/flymake.el (flymake--delete-overlay): New helper.
(flymake--highlight-line): Handle flymake-show-diagnostics-at-end-of-line.
(flymake--clear-foreign-diags): Use flymake--delete-overlay.
(flymake--publish-diagnostics): Use flymake--delete-overlay.
(flymake-mode): Use flymake--delete-overlay.
(flymake-error-echo)
(flymake-warning-echo, flymake-note-echo): New faces.
(flymake-show-diagnostics-at-end-of-line): New option.
(Version): Bump to 1.3.4
* doc/misc/flymake.texi:
(Finding diagnostics): Mention flymake-show-diagnostics-at-end-of-line.
(Customizable variables): Mention
flymake-show-diagnostics-at-end-of-line and a few more relevant faces.
* etc/NEWS (Flymake): Mention flymake-show-diagnostics-at-end-of-line.
Warn when the return value of certain functions is unused. Previously
this was only done for side-effect-free functions, and for `mapcar`.
These are functions where the return value is important for correct
usage or where ignoring it is likely to indicate a mistake. The exact
set of functions is tentative and will be modified as we gain a better
understanding of which ones to include.
The current set comprises higher order functions such as `mapcar`
which are not primarily called for the effects of their function
arguments, and list-mutating functions like `nreverse` whose return
value is essential.
* lisp/emacs-lisp/bytecomp.el (byte-compile-form): Add list of
functions to warn about when their value is ignored.
* etc/NEWS: Announce.
* lisp/simple.el (inhibit-auto-fill): New var.
(internal-auto-fill): Obey it.
(newline): Use it instead of binding `auto-fill-function`, so
as to avoid messing up the state if something wants to enable/disable
`auto-fill-mode` during the course of the let binding (bug#62419).
* lisp/shell.el (shell-get-old-input-include-continuation-lines): New
defcustom (default nil).
(shell-get-old-input): New function. Like
'comint-get-old-input-default' but include all continuation lines if
'shell-get-old-input-include-continuation-lines' is non-nil.
(shell-mode): Install shell-get-old-input. (Bug#61069)
* etc/NEWS: Advertise the new defcustom.
`unwind-protect` without unwind forms is not just pointless but often
indicates a mistake where the intended unwind part is misplaced, as in
(unwind-protect (progn PROT-FORMS UNWIND-FORMS)) ; oops
or
(unwind-protect PROT-FORM) UNWIND-FORMS ; also oops
or entirely forgotten for that matter. Warning about this makes
sense, and the warning can always be silenced by removing the
`unwind-protect` altogether if it shouldn't be there in the first
place.
* lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Implement
warning.
* etc/NEWS: Announce.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-test--with-suppressed-warnings): Add test case.
* lisp/emacs-lisp/package-vc.el (package-vc-register-as-project): Add
new option.
(project-remember-projects-under): Declare function for usage in
'package-vc--clone'.
(package-vc--clone): Respect 'package-vc-register-as-project'.
* etc/NEWS: Document the feature.
* doc/misc/tramp.texi (Ssh setup): Use tramp-use-connection-share.
Describe its settings for PuTTY.
(Remote processes): Use tramp-use-connection-share.
* etc/NEWS: Renamed user option tramp-use-connection-share.
* lisp/net/tramp-integration.el
(tramp-compile-disable-ssh-controlmaster-options):
Use `tramp-use-connection-share'.
* lisp/net/tramp-sh.el (tramp-use-connection-share):
Rename from `tramp-use-ssh-controlmaster-options'. Make it a
defvaralias to `tramp-use-ssh-controlmaster-options'.
(tramp-ssh-controlmaster-options): Adapt docstring.
(tramp-methods) <plink, plinkx, pscp, psftp>: Adapt.
(tramp-ssh-controlmaster-options): Add plink implementation.
There is no particular requirement for safe-copy-tree so let's make it
internal for now. The new implementation is faster and more correct.
* doc/lispref/lists.texi (Building Lists):
* etc/NEWS: Remove doc and announcement.
* lisp/subr.el (safe-copy-tree--seen, safe-copy-tree--1)
(safe-copy-tree): Remove old version.
* lisp/emacs-lisp/bytecomp.el (bytecomp--copy-tree-seen)
(bytecomp--copy-tree-1, bytecomp--copy-tree): Add new version.
(byte-compile-initial-macro-environment): Use it.
* test/lisp/subr-tests.el (subr--safe-copy-tree):
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp--copy-tree):
Move and improve tests.
* etc/NEWS: Mention the new mode.
* lisp/progmodes/heex-ts-mode.el: New file.
* test/lisp/progmodes/heex-ts-mode-tests.el: New file.
* test/lisp/progmodes/heex-ts-mode-resources/indent.erts: New file.
* admin/notes/tree-sitter/build-module/batch.sh:
* admin/notes/tree-sitter/build-module/build.sh: Add HEEx support.
* lisp/emacs-lisp/shortdoc.el (shortdoc-help-fns-examples-function)
(shortdoc-function-examples): Fix compilation warning and add an
empty line before the examples.
* lisp/emacs-lisp/shortdoc.el (shortdoc--insert-group-in-buffer)
(shortdoc-function-examples)
(shortdoc-help-fns-examples-function):
* etc/NEWS:
* doc/lispref/help.texi (Documentation Groups):
* doc/emacs/help.texi (Name Help): Improve documentation of
the last change. (Bug#61877)
* lisp/emacs-lisp/shortdoc.el (shortdoc--display-function): Add
a new shortdoc-example text property so that ELisp examples can
be searched for later.
(shortdoc--insert-group-in-buffer): New function extracted from
the buffer insertion code in 'shortdoc-display-group'.
(shortdoc-display-group): Implement in terms of
'shortdoc--insert-group-in-buffer'.
(shortdoc-function-examples): New function that returns an alist
of Emacs Lisp examples from shortdoc.
(shortdoc-help-fns-examples-function): New function to insert
Emacs Lisp function examples in *Help* buffers, if added to
'help-fns-describe-function-functions'.
*
test/lisp/emacs-lisp/shortdoc-tests.el (shortdoc-function-examples-test):
Test it.
* doc/emacs/help.texi (Name Help): Document in the user manual.
* doc/lispref/help.texi (Documentation Groups): Document it.
* etc/NEWS: Advertise it. (Bug#61877)
This fixes bug #61962.
* lisp/subr.el (safe-copy-tree): New function.
* lisp/emacs-lisp/bytecomp.el (byte-compile-initial-macro-environment): Amend
the entry for eval-and-compile to use safe-copy-tree and
byte-run-strip-symbol-positions for the eval part.
* doc/lispref/lists.texi (Building Lists): Document safe-copy-tree.
* etc/NEWS: Note the new function safe-copy-tree.
* lisp/man.el (Man-getpage-in-background): Add new defcustom
Man-prefer-synchronous-call and modify #'Man-getpage-in-background.
Only call #'start-process when 'make-process satisfies #'fboundp AND
Man-prefer-synchronous-call is bound to nil. (Bug#61552)
Copyright-paperwork-exempt: yes
* lisp/progmodes/grep.el (grep-heading-regexp): New user option.
(grep-heading): New face (bug#59888).
(grep--heading-format, grep--heading-state, grep--heading-filter):
Filter function for grep processes and supporting variables.
(grep-use-headings): New user option.
(grep-mode): Use the above, if applicable.
Omitting handlers from a `condition-case` form makes it useless
since no errors are caught.
* lisp/emacs-lisp/macroexp.el (macroexp--expand-all): New warning.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-test--with-suppressed-warnings): Add test case.
* etc/NEWS: Announce.
Make `fset` and `defalias` signal an error on attempts to create
circular alias chains. This is more effective, efficient and
convenient than permitting alias loops to be created and trying to
detect them at run time each time a function is called, which is what
we have been doing until now, badly.
* lisp/help-fns.el (help-fns--analyze-function):
Don't pass obsolete argument.
* lisp/subr.el (function-alias-p):
* src/data.c (indirect_function, Findirect_function): Simplify.
Now error-free, second argument obsolete.
(Ffset): Detect loops.
* test/lisp/help-fns-tests.el (help-fns--analyze-function-recursive):
* test/lisp/subr-tests.el (test-alias-p):
Adapt tests.
* test/src/data-tests.el (data-tests-fset, data-tests-defalias): New.
* doc/lispref/eval.texi (Function Indirection):
* doc/lispref/functions.texi (Defining Functions, Function Cells):
Update manual.
* etc/NEWS: Announce.
* etc/NEWS: Announce the new face for the 'display-time-format'.
* lisp/time.el (display-time-time-and-date-indicator): Define new face.
(display-time-string-forms): Use the new face. (Bug#61567)
Allows specifying the switches to use when ignoring whitespace for
those of us who don't like "-b".
* lisp/vc/diff-mode.el (diff-ignore-whitespace-switches): New defcustom.
(diff-refresh-hunk): Use it when ignoring whitespace.
* doc/emacs/files.texi (Diff Mode): Describe the new option.
* etc/NEWS: Announce the new option.
This implements the request from Bug#58516.
* lisp/vc/diff-mode.el (diff--ignore-whitespace-all-hunks): New
function. Iterate over all hunks, regenerate ignoring whitespace
changes.
(diff-ignore-whitespace-hunk): Call `diff--ignore-whitespace-all-hunks'
when called with a prefix arg.
* doc/emacs/files.texi (Diff Mode): Describe new functionality.
* etc/NEWS: Announce the change.
* configure.ac (HAVE_TEXT_CONVERSION): Define on X.
* etc/NEWS: Announce new change.
* src/emacs.c (main): Always call init_xterm.
* src/frame.c (do_switch_frame): Use `fset_selected_window'.
* src/insdel.c (struct safe_del_range_context): New structure.
(safe_del_range_1, safe_del_range_2, safe_del_range): New
functions.
* src/lisp.h: Export new functions.
* src/window.c (run_window_change_functions): Report selected
window and buffer changes so that the input method can be reset.
* src/xfns.c (XICCallback, Xxic_preedit_caret_callback)
(Xxic_preedit_done_callback, Xxic_preedit_start_callback)
(Xxic_preedit_draw_callback): Fix coding style.
(Xxic_string_conversion_callback): New callback.
(create_frame_xic): Register string conversion callback.
(struct x_xim_text_conversion_data): New field `size'.
(x_encode_xim_text_1, x_encode_xim_text): New functions.
(xic_string_conversion_callback): New function.
* src/xterm.c (x_reset_conversion): New function.
(text_conversion_interface): New variable.
(init_xterm): Initialize text conversion interface.
* lisp/eshell/esh-util.el (eshell-integer-regexp): New defvar.
* lisp/eshell/esh-var.el (eshell-parse-indices): Expand docstring.
(eshell-parse-index): New function.
(eshell-apply-indices): Use 'eshell-parse-index' to determine whether
to treat the first index as a regexp. Simplify the implementation a
bit.
(eshell-index-range): New pcase macro...
(eshell-index-value): ... use it, and restructure the implementation.
* test/lisp/eshell/esh-var-tests.el (esh-var-test/interp-var-indices):
New function...
(esh-var-test/interp-var-indices/list)
(esh-var-test/interp-var-indices/vector)
(esh-var-test/interp-var-indices/ring)
(esh-var-test/interp-var-indices/split): ... use it.
(esh-var-test/interp-var-string-split-indices)
(esh-var-test/interp-var-regexp-split-indices)
(esh-var-test/interp-var-assoc): Expand tests to cover things that
look like numbers or ranges, but aren't.
* doc/misc/eshell.texi (Variables): Describe how to get all arguments
of the last command.
(Dollars Expansion): Explain negative indices and index ranges.
(Bugs and ideas): Remove now-implemented ideas.
* etc/NEWS: Announce this change.
This implements Bug#60312
* src/fns.c (syms_of_fns): Define `yes-or-no-prompt' Lisp variable.
(Fyes_or_no_p): Use `yes-or-no-prompt' instead of a hard-coded string.
* lisp/cus-start.el (standard): Add custom specification for it.
* doc/emacs/mini.texi (Yes or No Prompts): Document `yes-or-no-prompt'
* doc/lispref/minibuf.texi (Yes-or-No Queries): And here.
* etc/NEWS: Announce the new option.
go-ts-mode is extended with command go-ts-mode-docstring which adds
docstring comment to the defun at point. If a comment already exists,
the point is instead moved to the top-most comment line. The command
is bound to "C-c C-d".
* lisp/progmodes/go-ts-mode.el (go-ts-mode): Extend docstring.
(go-ts-mode-docstring): New function.
(go-ts-mode--comment-on-previous-line-p): New function.
(go-ts-mode-map): New map variable.
* etc/NEWS: Mention the change.
(bug#60805)