* lisp/emacs-lisp/comp-run.el
(native-comp-async-on-battery-power): New option.
(battery-status-function): Declare.
(native--compile-skip-on-battery-p): New function.
(comp--run-async-workers): Call it.
* etc/NEWS: Announce the new option.
* lisp/emacs-lisp/package-vc.el (package-vc--main-file)
(package-vc--unpack-1): Provide a fallback value if the package
specification has no :lisp-dir.
* lisp/emacs-lisp/package.el (package-unpack, package-dir-info):
Check the marked files if in a Dired buffer, and otherwise
fallback on the previous behaviour or if there was no selection.
(package-install-from-buffer): Document the feature.
* etc/NEWS: Mention the change.
(Bug#78017)
* lisp/emacs-lisp/package-vc.el (package-vc--main-file): Use
`expand-file-name' to support :lisp-dir entries outside of the
elpa directory.
(package-vc--unpack-1): Same as above.
(package-vc-install-from-checkout): Instead of creating a
symlink to the requested directory, create an empty directory
and use autoload indirections, analogously to checkouts with
Lisp code in a subdirectory.
(Bug#78017)
* lisp/register.el (frame-register, kmacro-register): Remove bogus deftypes.
(register--type) <oclosure>: Fix kmacro method and generalize it to
any OClosure.
(register--type) <frameset-register>: Fix method and move it to ...
* lisp/frameset.el (register--type) <frameset-register>: ... here,
where `frameset-register` is defined.
* lisp/emacs-lisp/cl-types.el (cl--type-parents): Make it a proper function.
(cl--type-children): Use `cl--class-children` and make it a `defsubst`.
(cl--type-dag): η-reduce and make it a `defsubst`.
(cl--type-undefine): Also reset `cl--type-error`.
(cl--type-deftype): Modify `cl--type-list` atomically so we never need
to restore it upon error. Don't test bogus parent here.
(cl-deftype2): Test bogus parent here instead. Also, better preserve
the declarations for the lambda.
(cl-types-of): Do less uncached work.
As presently under discussion in bug#77823, the intended new
functionality is not really about comments at all.
Remove it for now to allow us to redesign from a clean slate,
and to deal with the regression reported in bug#77823.
This reverts the following three changesets:
Author: Elías Gabriel Pérez <eg642616@gmail.com>
AuthorDate: Mon Mar 17 12:56:52 2025 -0600
New minor mode: `electric-block-comment-mode'
Author: Elías Gabriel Pérez <eg642616@gmail.com>
AuthorDate: Mon Mar 31 17:58:16 2025 -0600
Add block-comment-start and block-comment-end to supported modes
Author: Elías Gabriel Pérez <eg642616@gmail.com>
AuthorDate: Sun Apr 13 12:26:08 2025 -0600
Add block-comment variables to cc-mode
* lisp/emacs-lisp/eieio-base.el (make-instance) <eieio-named>:
Really skip backward compatibility when `eieio-backward-compatibility`
is nil and emit message if it's `warn`.
(eieio-persistent-make-instance): Warn when an obsolete name is used.
* lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility):
Change default to `warn`.
(eieio-defclass-internal): Warn when the *-list-p function is called
(eieio--slot-name-index): Warn when a initarg is used to access a slot.
* lisp/emacs-lisp/eieio.el (defclass): Warn when a class-slot is
accessed via the obsolete method.
(make-instance, clone) <eieio-default-superclass>: Really skip backward
compatibility when `eieio-backward-compatibility` is nil and emit
message if it's `warn`.
* lisp/emacs-lisp/cl-print.el (cl-print-expand-ellipsis): Bind
inhibit-read-only to t.
* lisp/vc/vc-dispatcher.el (require): Require cl-print at
compile time.
(vc-do-async-command): When printing command arguments that
contain multiple lines, use cl-prin1 with cl-print-string-length
bound in order to ellipse lines other than the first.
Switch the outer quotation marks to single quotation marks.
* lisp/emacs-lisp/warnings.el (warning-inhibit-types): New variable.
(display-warning): If TYPE matches 'warning-inhibit-types', don't
display the warning, even if it's emitted during startup.
* lisp/startup.el (normal-top-level):
* lisp/savehist.el (savehist-mode):
* lisp/url/url-cookie.el (url-cookie-parse-file):
* lisp/recentf.el (recentf-load-list):
* lisp/abbrev.el (read-abbrev-file): Bind 'warning-inhibit-types'
to avoid warning about missing lexbind cookie when loading files
that Emacs itself generates.
package-quickstart.el hardcodes many absolute file names, which
makes it break if user-emacs-directory moves, or in other
situations. To be slightly more robust to this, use relative
file names to packages that are located in the same directory as
package-quickstart.el.
* lisp/emacs-lisp/package.el (package--quickstart-dir,
package--quickstart-rel): Add.
(package-quickstart-refresh): Use package--quickstart-rel on
file names. (bug#77468)
* lisp/emacs-lisp/eieio.el (eieio--constructor-macro): Improve message.
(eieio-object-name-string): Avoid repeated class name in the output of
`eieio-object-name`.
(make-instance, clone): Improve message.
* lisp/emacs-lisp/eieio-core.el (eieio-defclass-autoload): Use the same
obsolescence warning as elsewhere.
We used to warn about unknown slots only in `oref`: add the same check
for `oset` and `slot-boundp`.
Similarly, we warned about obsolete name args only when calling the
constructors: add the same check to `make-instance`.
* lisp/emacs-lisp/eieio-core.el (eieio--check-slot-name): New function
extracted from the compiler-macro of `eieio-oref`.
(eieio-oref, eieio-oset): Use it.
* lisp/emacs-lisp/eieio.el (slot-boundp): Use it.
(eieio--constructor-macro): Add category to warning.
(make-instance): Add compiler-macro to warn about obsolete name.
* lisp/emacs-lisp/cl-macs.el (cl-flet, cl-labels): Recover the changes
made in commit 4764261681 and accidentally undone by a later merge of
commit 63adf9dcf5.
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.
(cherry picked from commit 53a5dada41)
* lisp/emacs-lisp/cl-macs.el (cl-with-accessors): New macro.
* doc/misc/cl.texi (Structures): Mention the new macro.
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-lib-struct-with-accessors):
New Test.
* etc/NEWS (New macro 'cl-with-accessors'.): Mention the macro.
This macro is useful when making repeated use of a structures accessor
functions, such as reading from a slot and then writing to a slot. It
is similar to 'with-slots' from EIEIO, but uses accessor functions
instead of slot names.
e6b4c0bceb lisp/emacs-lisp/cl-macs.el (cl-labels): Fix docstring (bu...
7a976d1aaf Fix minor issues in documentation of `use-package'
99ff59bd66 PHP should be in the PATH, either locally or remotely. (b...
26873d5028 Avoid warning when loading 'go-ts-mode'
a702f29a00 ; Fix package-version values
a1fbc51dc7 ; * lisp/which-key.el (which-key-idle-delay): Fix package...
# Conflicts:
# lisp/progmodes/php-ts-mode.el
# lisp/which-key.el
* lisp/minibuffer.el (completion--replace):
* lisp/emacs-lisp/cl-lib.el (cl--set-buffer-substring):
* lisp/subr.el (replace-string-in-region):
Use `replace-region-contents` instead of insert+delete.
* lisp/help-fns.el (help-fns--signature):
Use `replace-region-contents` instead of `cl--set-buffer-substring`.
* lisp/language/japan-util.el (japanese-replace-region):
Rewrite using `replace-region-contents` and mark obsolete.
(japanese-katakana-region, japanese-hankaku-region):
Use `replace-region-contents` instead.
* lisp/progmodes/flymake-proc.el (flymake-proc--replace-region):
Rewrite using `replace-region-contents` and mark obsolete.
(flymake-proc--check-patch-master-file-buffer):
Use `replace-region-contents` instead.
Swap the role of `replace-region-contents` and `replace-buffer-contents`,
so `replace-region-contents` is the main function, implemented in C,
and `replace-buffer-contents` is a mere wrapper (marked as obsolete).
Also remove the need to rely on narrowing and on describing the
new text as a function.
Finally, allow MAX-SECS==0 to require a cheap replacement, and
add an INHERIT argument.
* src/editfns.c: Include `coding.h`.
(Freplace_region_contents): Rename from `Freplace_buffer_contents`.
Change calling convention to that of `replace-region-contents`.
Add more options for the SOURCE argument. Add INHERIT argument.
Skip the costly algorithm if MAX-SECS is 0.
* src/insdel.c (replace_range): Allow NEW to be a buffer.
* lisp/subr.el (replace-buffer-contents): New implementation.
* lisp/emacs-lisp/subr-x.el (replace-region-contents): Delete.
* doc/lispref/text.texi (Replacing): Document new API for
`replace-region-contents`. Remove documentation of
`replace-buffer-contents`.
* test/src/editfns-tests.el (replace-buffer-contents-1)
(replace-buffer-contents-2, replace-buffer-contents-bug31837):
Use `replace-region-contents`.
(editfns--replace-region): Delete.
(editfns-tests--replace-region): Use `replace-region-contents`.
Adds tests for new types of SOURCE args.
This replaces open coded versions of the common idiom
(not (eq (gethash key table 'missing) 'missing))
with
(hash-table-contains-p key table)
in files where we can rely on features in Emacs 31.
* lisp/emacs-lisp/map.el (map-contains-key):
* lisp/external-completion.el (external-completion-table):
* lisp/mh-e/mh-utils.el (mh-sub-folders)
(mh-remove-from-sub-folders-cache):
* lisp/net/ange-ftp.el (ange-ftp-hash-entry-exists-p):
* lisp/password-cache.el (password-in-cache-p, password-cache-add):
* lisp/pcmpl-x.el (pcmpl-x-tlmgr-action-options):
* lisp/xdg.el (xdg-mime-apps): Use 'hash-table-contains-p'.
This function tests whether a given key is present in a hash table.
Emacs Lisp has long lacked a standard way to do this, leading users to
write one of:
(not (eq (gethash key table 'missing) 'missing))
or
(gethash key table)
This idiom is error-prone (when 'missing' or 'nil' are valid values),
and it obscures intent. The new function avoids such pitfalls,
improves readability, and makes the intent explicit:
(hash-table-contains-p key table)
The name 'hash-table-contains-p' exists in other Lisp dialects (e.g.,
SRFI-125), and follows the precedent of 'seq-contains-p'. Other
alternatives considered include `hash-table-has-key-p` and
`hash-table-key-exists-p`, but none were clearly better.
This was previously discussed in 2018, and all comments were positive,
but the proposed patch (implementing it in C) was never pushed:
https://lists.gnu.org/r/emacs-devel/2018-02/msg00424.html
* lisp/subr.el (hash-table-contains-p): New function.
* lisp/emacs-lisp/shortdoc.el (hash-table):
* doc/lispref/hash.texi (Other Hash): Document the new function.
* test/lisp/subr-tests.el (hash-table-contains-p): New test.
Show `help-at-pt' string via Eldoc as an alternative to the
`help-at-pt-display-when-idle' timer. The help-at-pt timer
competes with Eldoc for the echo area, such that the two
mechanisms do not work well together. Therefore when using
Eldoc, the setting `eldoc-help-at-pt' may be preferable.
* lisp/emacs-lisp/eldoc.el (eldoc-help-at-pt): New customization option.
(eldoc-show-help-at-pt): New Eldoc function.
(eldoc-documentation-functions): Register the new function.
* lisp/help-at-pt.el (help-at-pt-display-when-idle): Mention
`eldoc-help-at-pt' in the docstring.
* doc/emacs/help.texi: Document `eldoc-help-at-pt'.
* etc/NEWS: Announce the change. (Bug#77169)
* lisp/emacs-lisp/find-func.el (find-function-regexp-alist): Doc fix.
* doc/lispref/functions.texi (Finding Definitions): Fix wording
and markup.
* etc/NEWS: Move the new item where it belongs.
* doc/lispref/functions.texi (Finding Definitions): Document the
expanded definition-finding extension mechanism.
* etc/NEWS: Briefly describe the new feature.
* lisp/emacs-lisp/cl-generic.el
(cl--generic-find-defgeneric-regexp): Use defconst now that we
no longer have purespace.
(cl--generic-search-method-make-form-matcher): New function.
* lisp/emacs-lisp/find-func.el (find-function-regexp-alist)
(find-function-search-for-symbol): Parse out the new
factory function.
(find-function--search-by-expanding-macros): Try using it when
searching for definitions by expanding macros.
This is more robust since the time zone name is system-dependent.
* lisp/emacs-lisp/ert.el (ert--explain-time-equal-p): Use numeric time
zone suffix.
* test/lisp/emacs-lisp/ert-tests.el (ert-test-explain-time-equal-p):
Adapt test.
Consolidate the conversion from types to classes into
`built-in-class--make` instead of duplicating it in ever caller.
* lisp/emacs-lisp/cl-preloaded.el (built-in-class--make): Take list of
types rather than classes.
(cl--define-built-in-type): Simplify accordingly.
* lisp/emacs-lisp/bytecomp.el (byte-compile--reify-function): Hoist
subexpression out of `if`.
(byte-compile-variadic-numeric, byte-compile--cond-vars)
(byte-compile--cond-switch-prefix, byte-compile-file-form-defalias):
Obey `lexical-binding` when evaluating the code we're compiling.
(byte-compile--maybe-guarded): New function, extracted from
`byte-compile-maybe-guarded`.
(byte-compile-maybe-guarded): Use it so we can edebug the code.
0c32f7521b ; * admin/notes/spelling: More precisely qualify saying j...
bc51fabc10 Add a choice to 'dired-movement-style' to restore the pre...
10d534023a ; Fix some markup in doc/lispref/commands.texi.
c2c287b325 Improve docstring of should-error
* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Improve generated
docstring by not leaking the internal CL-X argument name, preferring X
instead. Set property 'document-generalized-variable', used below.
* lisp/help-fns.el (help-fns--generalized-variable): When function has
non-nil property 'document-generalized-variable', document it as a
generalized variable.