Visuwesh [Thu, 13 Feb 2025 11:13:06 +0000 (16:43 +0530)]
Make yank-media auto select the best mime type
* lisp/yank-media.el (yank-media-preferred-types): Add new
variable that holds the list of mime types in order of their
preference.
(yank-media-autoselect-function): Add new variable and function
to choose the most preferred media type.
(yank-media): Make 'yank-media' choose the most preferred mime
type by default.
* doc/emacs/killing.texi (Clipboard):
* doc/lispref/frames.texi (Yanking Media): Document the new
behaviour, and the new variables.
* etc/NEWS: Announce the change. (Bug#75116)
Mauro Aranda [Thu, 6 Feb 2025 11:01:08 +0000 (08:01 -0300)]
Speed up widget creation (Bug#53606)
* lisp/wid-edit.el (widget-default-create, widget-checklist-add-item)
(widget-radio-add-item, widget-editable-list-entry-create): Don't
insert format escapes into the buffer, only to delete them after.
This avoids calls to delete-char and makes widget creation about 3
times faster.
F. Jason Park [Sat, 15 Feb 2025 02:57:41 +0000 (18:57 -0800)]
Use .pem extension for client certs in ERC docs
* doc/misc/erc.texi (Connecting): Change file-name extensions to .pem in
all examples, and explain that the key and the cert can be combined into
one file.
(SASL): Use .pem extension for certs.
* lisp/erc/erc.el (erc--warn-once-before-connect): Revise doc.
(erc-tls): Use .pem extension for certs. (Bug#76278)
Stefan Kangas [Fri, 21 Feb 2025 17:48:12 +0000 (18:48 +0100)]
Delete note on Emacs 19 modes from comint.el
* lisp/comint.el: Delete note on how to convert pre-Emacs 20 modes to
use comint.el. Emacs 20 was released in 1997, so it's safe to assume
that any relevant code has been updated in the last three decades.
* lisp/progmodes/csharp-mode.el (csharp-ts-mode--indent-rules): Fix
indentation for using statements and multiline lambdas. (Bug#75883)
Patch based on bug report by Dino Chiesa <dpchiesa@hotmail.com>.
Stefan Kangas [Fri, 21 Feb 2025 16:40:12 +0000 (17:40 +0100)]
New user option checkdoc-allow-quoting-nil-and-t
* lisp/emacs-lisp/checkdoc.el (checkdoc-allow-quoting-nil-and-t):
New user option that allows turning off the warning for having nil
and t in quotes.
(checkdoc-this-string-valid-engine): Use above new option.
Michael Albinus [Fri, 21 Feb 2025 13:47:15 +0000 (14:47 +0100)]
Use a persistent directory as default directory in diff
* lisp/vc/diff.el (diff-no-select): Use `temporary-file-directory'
as default directory. Set default file permissions temporarily to
#o600. (Bug#69606)
Juri Linkov [Fri, 21 Feb 2025 07:55:54 +0000 (09:55 +0200)]
New variable 'treesit-aggregated-outline-predicate' (bug#76398)
* doc/lispref/modes.texi (Outline Minor Mode):
Add 'treesit-aggregated-outline-predicate'.
* lisp/treesit.el (treesit-aggregated-outline-predicate):
New buffer-local variable.
(treesit-outline--at-point):
Use 'treesit-aggregated-outline-predicate'.
(treesit-closest-parser-boundary): New function.
(treesit-outline-search): Use 'treesit-aggregated-outline-predicate'
and 'treesit-closest-parser-boundary'.
(treesit-outline-level): Use 'treesit-aggregated-outline-predicate'.
(treesit-major-mode-setup): Add 'treesit-aggregated-outline-predicate'.
Have 'submit-emacs-patch' insert maintainers into X-Debbugs-Cc
* lisp/mail/emacsbug.el (submit-emacs-patch): Go through all files
mentioned in the diff and check for maintainers.
(submit-emacs-patch-excluded-maintainers): Add constant. (Bug#69646)
Po Lu [Thu, 20 Feb 2025 06:04:59 +0000 (14:04 +0800)]
Port to modern GCC and pdumper on MS-DOS
* config.bat (mvOk): Protoize.
(djgppOk): Include sys/version.h for _DJGPP_MINOR.
* lisp/loadup.el: If system-type is ms-dos, dump bootstrap-emacs
as b-emacs.dmp.
* msdos/INSTALL: Document new versions of tools that have been
verified successfully to compile Emacs.
* msdos/emacs.djl: New linker script that arranges to link
symbols in `.subrs' in a contiguous part of data, as the DJGPP
runtime appears to treat any non-data and non-text section as
allocatable.
* msdos/sed1v2.inp (CFLAGS): Define to -O2 -g3.
(LDFLAGS): Provide the said linker script.
(HAVE_PDUMPER): Define to yes.
(UNEXEC_OBJ, PAXCTL_dumped, PAXCTL_notdumped): Delete.
(DUMPING): Set to pdumper.
(MAKE_PDUMPER_FINGERPRINT): Don't erase this variable.
Don't stubify or set minstack. Remove native-comp specific
directives. Don't remove temacs prior to copying and replace
`pdmp' extension with DOS-conformant `dmp'.
* msdos/sed2v2.inp (HAVE_UNEXEC): Remove definition.
(HAVE_PDUMPER): Define to 1.
Po Lu [Wed, 19 Feb 2025 12:40:12 +0000 (20:40 +0800)]
Fix remaining Android bugs reported over the past months
* java/org/gnu/emacs/EmacsActivity.java (attachWindow):
Guarantee that child windows promoted to toplevels receive
layout parameters that direct them to receive their parents'
dimensions. Otherwise, the size of the window as a child is
retained on Huawei HarmonyOS 4.2 and possibly other Android
distributions.
* java/org/gnu/emacs/EmacsService.java (updateCursorAnchorInfo):
Run anchor updates on the UI thread, as
`InputMethodManager#updateCursorAnchorInfo' is liable to call
`View#requestLayout'.
* java/org/gnu/emacs/EmacsView.java (onMeasure): Always call
`measureChildren', or child frames' onLayout handlers might not
be invoked after they request a layout cycle and are duly
processed in `onLayout'.
(swapBuffers): Delete erroneous commentary.
* java/org/gnu/emacs/EmacsWindow.java (viewLayout): If
overrideRedirect, don't inadvertently clear rect.left and
rect.top by recording the window's WM window-relative position.
Fix typos.
(reparentTo): Invalidate focus after transferring frame.
(translateCoordinates): Account for override-redirect windows.
Mostly important for mouse-drag-and-drop-region.
Stefan Monnier [Wed, 19 Feb 2025 03:27:08 +0000 (22:27 -0500)]
(json-pretty-print): Rework a bit
* lisp/json.el (json-pretty-print): Call 'replace-buffer-contents'
separately for each json object rather than once at the end, so
its work is easier. Use 'json--print' rather than 'json-encode' so as
to avoid creating yet more temp buffers.
* doc/lispintro/emacs-lisp-intro.texi (Lexical vs Dynamic Binding
Example): Use the lexical dialect also for the dynamic
scoping example.
* doc/lispref/edebug.texi (Edebug Eval): Remove long-obsolete mention
of Edebug support for `lexical-let`.
kobarity [Sun, 16 Feb 2025 10:07:04 +0000 (19:07 +0900)]
Improve completion in IPython/Python 3.13
IPython/Python 3.13 indirectly imports rlcompleter, and the
completer is set up to reference rlcompleter.__main__.
However, this rlcompleter.__main__ is different from the
__main__ in the REPL execution. Therefore, this completer
cannot correctly complete the REPL globals. To address this
issue, we override rlcompleter.__main__ with __main__ only in
the case of IPython.
Po Lu [Tue, 18 Feb 2025 12:58:32 +0000 (20:58 +0800)]
Don't access overriding-text-conversion-style when unbound
* lisp/replace.el (perform-replace): Don't access
overriding-text-conversion-style when unbound, and also avoid
needlessly polluting this symbol with a binding. (bug#76371)
john muhl [Tue, 5 Nov 2024 16:24:28 +0000 (10:24 -0600)]
Add MPD stats viewer to 'mpc' (Bug#76350)
* lisp/mpc.el (mpc-server-stats): New command.
(mpc-mode-menu): Add menu item.
(mpc--server-stats-date, mpc--server-stats-duration):
New variable.
(mpc--server-stats-date, mpc--server-stats-duration):
(mpc--server-stats-format): New function.
(mpc-song-viewer-value, mpc-song-viewer-tag):
(mpc-song-viewer-empty): Remove face.
(mpc-table-value, mpc-table-key, mpc-table-empty): New face.
(mpc-describe-song): Use new table face names.
* doc/lispref/modes.texi (Search-based Fontification): Fix
indentation of (MATCHER . FACESPEC) example.
* doc/misc/cc-mode.texi (Performance Issues): Index
defun-prompt-regexp under variables, not functions.
* lisp/progmodes/autoconf.el (autoconf--symbol, autoconf--macro):
New rx definitions.
(autoconf-definition-regexp): Use an optional second capture group
to indicate a function rather than variable definition. Detect
AC_DEFINE defining a function-like CPP macro. Skip more shell
syntax such as variable ${} expansion and command `` substitution in
AC_DEFINE_UNQUOTED variable. Match AH_VERBATIM, AM_CONDITIONAL, and
AM_MISSING_PROG as defining variables, and AC_DEFUN, AC_DEFUN_ONCE,
AU_ALIAS, and AU_DEFUN as defining functions. Document first
capture group in docstring.
(autoconf-font-lock-keywords): Use autoconf--macro to match more
Autoconf macros, such as those defined in the Autoconf Archive and
Gnulib. Reserve font-lock-function-name-face for function
definitions as determined by autoconf-definition-regexp, and use
font-lock-variable-name-face for the rest instead. Use Font Lock
face symbols directly in place of their corresponding variable.
Fontify M4 changequote primitive only as a standalone symbol.
(autoconf-imenu-generic-expression): Add commentary mentioning new
submenu possibility.
(autoconf-current-defun-function): Update docstring accuracy.
Replace line-end-position with pos-eol since there are no fields.
(autoconf-mode): Define defun-prompt-regexp in terms of
autoconf--macro to support more toplevel macros, such as those
defined in Autoheader, M4sh, etc. Set
open-paren-in-column-0-is-defun-start to nil to avoid false
positives when an Autoconf quote character is in column zero.
* test/lisp/progmodes/autoconf-resources/configure.ac: New file.
* test/lisp/progmodes/autoconf-tests.el
(autoconf-tests-current-defun-function-define)
(autoconf-tests-current-defun-function-subst): Replace character
motion with search.
(autoconf-tests-autoconf-mode-comment-syntax): Ditto. Test both dnl
and # comments. Use syntax-ppss-context.
(autoconf-tests-font-lock): New test.
Stefan Kangas [Mon, 17 Feb 2025 20:58:53 +0000 (21:58 +0100)]
New functions plusp and minusp
* lisp/emacs-lisp/cl-lib.el (cl-plusp, cl-minusp): Move from here...
* lisp/subr.el (plusp, minusp): ...to here. Make old names into
aliases, documented as deprecated. Add type declarations. Change from
defsubst to regular functions with compiler macros.
* lisp/obsolete/cl.el: Don't alias plusp and minusp.
* doc/lispref/numbers.texi (Predicates on Numbers): Document plusp
and minusp.
* doc/misc/cl.texi (Predicates on Numbers): Delete cl-plusp and
cl-minusp.
* lisp/emacs-lisp/shortdoc.el (number): Document plusp and minusp
instead of cl-plusp and cl-minusp.
Yuan Fu [Mon, 17 Feb 2025 21:27:52 +0000 (13:27 -0800)]
Rename treesit-simple-indent-modify-rules and fix docstring
* lisp/treesit.el (treesit-simple-indent-modify-rules): Rename
and fix docstring. It should be matcher, not anchor. Also
reword a little bit.
* etc/NEWS: Update.
* lisp/textmodes/mhtml-ts-mode.el:
(mhtml-ts-mode--treesit-indent-rules): Update accordingly.
Kévin Le Gouguec [Thu, 13 Feb 2025 22:52:06 +0000 (23:52 +0100)]
Test vc-git-dir-extra-headers directly (bug#76187)
* test/lisp/vc/vc-git-tests.el (vc-git-test--run): Make sure to
log output from failing Git commands.
(vc-git-test--dir-headers): Stop bothering with vc-dir
internals and just invoke the branch-munging and
header-formatting code we mean to test.
(vc-git-test-dir-branch-headers): Stop invoking vc-dir; just set
default-directory to be able to pass it to the backend function.
Pip Cet [Mon, 17 Feb 2025 15:21:16 +0000 (15:21 +0000)]
Fix compilation errors due to insufficient compiler safety (bug#63288)
The default safety level is 1. Restoring the default safety level to
1 after it was temporarily 0 should reset byte-compile-delete-errors
to nil, its default level. Failing to do that resulted in
miscompilation of code in highly-parallel builds.
* lisp/emacs-lisp/cl-macs.el (cl--do-proclaim): Change
'byte-compile-delete-errors' to become t only at 'safety' level 0, not
levels 1 or 2.