]> git.eshelyaron.com Git - emacs.git/log
emacs.git
2 weeks ago; * configure.ac: Minor simplification.
Stefan Kangas [Sun, 29 Dec 2024 18:39:41 +0000 (19:39 +0100)]
; * configure.ac: Minor simplification.

(cherry picked from commit f51e643a2fb3258abc921913a4d338eb9842d38f)

2 weeks agoDelete firstfile.c and lastfile.c
Stefan Kangas [Sat, 28 Dec 2024 20:35:07 +0000 (21:35 +0100)]
Delete firstfile.c and lastfile.c

With the removal of unexec and purespace, the definitions in these files
are no longer used.  Remove them.

* src/firstfile.c:
* src/lastfile.c: Delete unused files.
* configure.ac (PRE_ALLOC_OBJ, POST_ALLOC_OBJ, FIRSTFILE_OBJ):
Remove variables and dependent code.
* msdos/autogen/Makefile.in:
* msdos/sed1v2.inp:
* src/Makefile.in: Don't use above deleted variables.
* src/deps.mk: Remove lastfile.c dependencies.

(cherry picked from commit c70d595708cd0dc19e85e58148a75df21d80f9b2)

2 weeks ago; * nt/INSTALL: Delete reference to unexec build.
Stefan Kangas [Sat, 28 Dec 2024 12:08:14 +0000 (13:08 +0100)]
; * nt/INSTALL: Delete reference to unexec build.

(cherry picked from commit 305bd550cf28045505e76c2b23f51860da914310)

2 weeks ago* Make again `comp--finalize-container' compilable
Andrea Corallo [Wed, 18 Dec 2024 20:58:15 +0000 (21:58 +0100)]
* Make again `comp--finalize-container' compilable

* lisp/emacs-lisp/comp.el (comp--finalize-container): Don't emit
'--lambda-fixup' immediate in data relocations.

(cherry picked from commit b86e4747e66febd400055cb6279238fb95f8a59d)

2 weeks agoUse '--lambda-fixup' as native compiler fixup symbol for lambdas
Andrea Corallo [Wed, 18 Dec 2024 20:55:41 +0000 (21:55 +0100)]
Use '--lambda-fixup' as native compiler fixup symbol for lambdas

* src/comp.c (check_comp_unit_relocs, syms_of_comp): Rename
'Qlambda_fixup' to 'Q__lambda_fixup'.
* src/pdumper.c (dump_do_dump_relocation): Likewise.

(cherry picked from commit 9e99c43d2f5dc5dc2632ad616d224f3bd9cf63c4)

2 weeks ago* Revert "Remove check_comp_unit_relocs"
Andrea Corallo [Wed, 18 Dec 2024 20:27:14 +0000 (21:27 +0100)]
* Revert "Remove check_comp_unit_relocs"

This reverts commit 81fc23b5d6a60ca4f3d269ab2c88eb9a850bac4c as the
check is still useful but needs to be updated for the new reloc layout.

* src/comp.c (check_comp_unit_relocs): Re-add.
(load_comp_unit): Make use of.

(cherry picked from commit 4e11f9c96df98dd3f10c1153bc49209f2383a0ee)

2 weeks agoRemove check_comp_unit_relocs
Gerd Möllmann [Tue, 17 Dec 2024 14:28:14 +0000 (15:28 +0100)]
Remove check_comp_unit_relocs

* src/comp.c (check_comp_unit_relocs): Removed.
(load_comp_unit): Remove use.

(cherry picked from commit 81fc23b5d6a60ca4f3d269ab2c88eb9a850bac4c)

2 weeks ago; * src/fns.c (maybe_resize_hash_table): Remove debugging code.
Pip Cet [Mon, 16 Dec 2024 12:28:59 +0000 (12:28 +0000)]
; * src/fns.c (maybe_resize_hash_table): Remove debugging code.

(cherry picked from commit d140b5cabbbcc5368cfe8c38021d9f6e41a640d8)

2 weeks agoDon't define SYSTEM_PURESIZE_EXTRA
Stefan Kangas [Sun, 15 Dec 2024 18:35:48 +0000 (19:35 +0100)]
Don't define SYSTEM_PURESIZE_EXTRA

* nt/inc/ms-w32.h: Don't define SYSTEM_PURESIZE_EXTRA.

(cherry picked from commit 925431f030b6d6e095ed8f946243e144adcff54c)

2 weeks agoRemove some more references to pure space
Stefan Kangas [Sun, 15 Dec 2024 18:15:29 +0000 (19:15 +0100)]
Remove some more references to pure space

* lisp/auth-source.el (read-passwd-map):
* lisp/emacs-lisp/eldoc.el (eldoc-message-commands)
(eldoc-last-data): Remove some references to pure space.

(cherry picked from commit c729d224ca7bd55d9f49af9d730af45663a3f3d5)

2 weeks agoImprove purify-flag docstring
Stefan Kangas [Sun, 15 Dec 2024 18:14:04 +0000 (19:14 +0100)]
Improve purify-flag docstring

* src/alloc.c (syms_of_alloc): Improve purify-flag docstring.

(cherry picked from commit f818744cd4b1dddece0a221b06e6e83740e06e2d)

2 weeks agoDon't document removed SITELOAD_PURESIZE_EXTRA
Stefan Kangas [Sun, 15 Dec 2024 18:13:35 +0000 (19:13 +0100)]
Don't document removed SITELOAD_PURESIZE_EXTRA

* doc/lispref/internals.texi (Building Emacs): Don't document removed
constant SITELOAD_PURESIZE_EXTRA.

(cherry picked from commit d05ee2ba80b0961015eb543536266208afb57dff)

2 weeks agoRemove another purecopy call in files.el
Stefan Kangas [Sun, 15 Dec 2024 18:08:20 +0000 (19:08 +0100)]
Remove another purecopy call in files.el

* lisp/files.el (save-some-buffers-action-alist): Don't call purecopy.

(cherry picked from commit 526ef8950a98f2d040b9e4f143aa62538904a39f)

2 weeks agoFix a typo which caused test failures
Pip Cet [Sat, 14 Dec 2024 15:45:25 +0000 (15:45 +0000)]
Fix a typo which caused test failures

* lisp/progmodes/python.el (interpreter-mode-alist):
* lisp/progmodes/vera-mode.el (interpreter-mode-alist): Fix typo.

(cherry picked from commit 7024c66123e56501fd409a9b59522fceb5ce8cfd)

2 weeks agoMark pure-bytes-used as obsolete
Stefan Kangas [Tue, 10 Dec 2024 22:57:22 +0000 (23:57 +0100)]
Mark pure-bytes-used as obsolete

* lisp/subr.el (pure-bytes-used): Mark variable as obsolete.

(cherry picked from commit 28dadb6f10aa7a0c785d79bb10d77babb7502dee)

2 weeks agoDelete variable pure-space-overflow
Stefan Kangas [Tue, 10 Dec 2024 22:35:31 +0000 (23:35 +0100)]
Delete variable pure-space-overflow

* lisp/startup.el (pure-space-overflow): Make variable obsolete.
* lisp/loadup.el (pure-space-overflow): Do not set.  Remove call to
`garbage-collect', as that is done by `dump-emacs-portable'.

(cherry picked from commit e7926ab48604d4bdf7088014717b02dddfe9f190)

2 weeks agoMake 'purecopy' an obsolete function alias for 'identity'
Stefan Kangas [Tue, 10 Dec 2024 18:39:03 +0000 (19:39 +0100)]
Make 'purecopy' an obsolete function alias for 'identity'

* lisp/subr.el (purecopy): New obsolete function alias for 'identity'.
* src/alloc.c (purecopy): Remove function.
(Fpurecopy): Remove DEFUN.
(syms_of_alloc): Remove defsubr for above DEFUN.
* lisp/loadup.el (purify-flag): Don't set to hash table.

* doc/lispref/spellfile:
* doc/lispref/keymaps.texi (Tool Bar):
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Delete
references to 'purecopy'

(cherry picked from commit d6b05b128280cc23dc77a1a06194c4e69d1ac519)

2 weeks agoDelete obsolete comment about using purespace
Stefan Kangas [Tue, 10 Dec 2024 18:23:00 +0000 (19:23 +0100)]
Delete obsolete comment about using purespace

* src/alloc.c (Fmake_byte_code): Delete obsolete comment.

(cherry picked from commit b299a5d184542cdc66632b1a47947151a11c035e)

2 weeks agoDelete workaround for purespace in cl-generic
Stefan Kangas [Tue, 10 Dec 2024 11:34:34 +0000 (12:34 +0100)]
Delete workaround for purespace in cl-generic

* lisp/emacs-lisp/cl-generic.el (cl-generic-define-method): Delete
purespace workaround.

(cherry picked from commit 52dcc032067381f50d658dc43bf7088f1782c7af)

2 weeks agoRemove unused function my_heap_start
Stefan Kangas [Tue, 10 Dec 2024 10:43:54 +0000 (11:43 +0100)]
Remove unused function my_heap_start

* src/alloc.c (my_heap_start) [DOUG_LEA_MALLOC && GNU_LINUX]:
Remove unused function.  Update callers.

(cherry picked from commit ad9adab04284213aefc3872a610779dc633ff541)

2 weeks agoRemove check for working malloc_set_state
Stefan Kangas [Tue, 10 Dec 2024 10:07:01 +0000 (11:07 +0100)]
Remove check for working malloc_set_state

This check was added to 'malloc_initialize_hook' in order to "insulate
Emacs better from configuration screwups" (commit b4788b9394f3).  With
unexec gone, we no longer use 'malloc_set_state', and thus don't need
this check.

Note that this patch removes the last uses of the deprecated glibc
functions 'malloc_set_state' and 'malloc_get_state' from our code.

* src/alloc.c (malloc_initialize_hook) [DOUG_LEA_MALLOC]:
Remove check for working 'malloc_set_state'.
(alloc_unexec_pre) [DOUG_LEA_MALLOC]: Delete unused function.
(alloc_unexec_post) [DOUG_LEA_MALLOC]: Delete function.
(malloc_state_ptr) [DOUG_LEA_MALLOC]: Delete variable.
* configure.ac (emacs_cv_var_doug_lea_malloc): Don't check for
malloc_set_state and malloc_get_state.

(cherry picked from commit 892be3b3d7a459808ee47709d0f4e7f65566a6e5)

2 weeks agoRemove purespace fix from cl-preloaded.el
Stefan Kangas [Mon, 9 Dec 2024 20:34:57 +0000 (21:34 +0100)]
Remove purespace fix from cl-preloaded.el

* lisp/emacs-lisp/cl-preloaded.el (cl-struct-define): Remove fix for
purespace.  This effectively reverts Stefan Monnier's commit
e785c74d3a88.

(cherry picked from commit bb64e9464c584bace441f60678b80f41ddc6e2a3)

2 weeks agoDelete remaining calls to purecopy
Stefan Kangas [Mon, 9 Dec 2024 20:26:25 +0000 (21:26 +0100)]
Delete remaining calls to purecopy

* lisp/button.el (default-button):
* lisp/calendar/holidays.el (holiday-solar-holidays)
(holiday-bahai-holidays, holiday-islamic-holidays)
(holiday-christian-holidays, holiday-hebrew-holidays)
(holiday-oriental-holidays, holiday-general-holidays):
* lisp/comint.el (comint-file-name-prefix):
* lisp/composite.el (unicode-category-table):
* lisp/cus-face.el (custom-declare-face):
* lisp/custom.el (custom-add-load, custom-add-package-version)
(custom-add-version, custom-add-link, custom-declare-group)
(custom-declare-variable):
* lisp/dired.el (dired-listing-switches):
* lisp/epa-hook.el (epa-file-name-regexp):
* lisp/faces.el (x-font-regexp, x-font-regexp-head)
(x-font-regexp-slant, x-font-regexp-weight, )
(set-face-attribute, set-face-documentation, face-x-resources)
(face-font-registry-alternatives, face-font-family-alternatives)
(term-file-prefix):
* lisp/find-file.el (ff-special-constructs):
* lisp/format.el (format-alist):
* lisp/help.el (help-for-help):
* lisp/image-file.el (image-file-name-extensions):
* lisp/info.el:
* lisp/isearch.el (isearch-help-for-help-internal)
(search-whitespace-regexp):
* lisp/jka-cmpr-hook.el (jka-compr-load-suffixes)
(jka-compr-mode-alist-additions)
(jka-compr-compression-info-list, jka-compr-build-file-regexp):
* lisp/language/ethiopic.el (font-ccl-encoder-alist):
* lisp/language/korea-util.el (default-korean-keyboard):
* lisp/language/tibetan.el (tibetan-precomposition-rule-regexp)
(tibetan-precomposed-regexp):
* lisp/locate.el (locate-ls-subdir-switches):
* lisp/lpr.el (lpr-command):
* lisp/mail/rmail.el (rmail-secondary-file-regexp)
(rmail-secondary-file-directory, rmail-highlighted-headers)
(rmail-ignored-headers, rmail-spool-directory, rmail-file-name):
* lisp/mail/sendmail.el (mail-default-directory)
(mail-signature-file, mail-citation-prefix-regexp)
(mail-personal-alias-file, mail-header-separator):
* lisp/menu-bar.el (yank-menu):
* lisp/net/eudc.el (eudc-tools-menu):
* lisp/newcomment.el (comment-padding, comment-end):
* lisp/obsolete/autoload.el (autoload-generate-file-autoloads):
* lisp/progmodes/hideshow.el (hs-special-modes-alist):
* lisp/ps-print.el (ps-page-dimensions-database):
* lisp/rfn-eshadow.el (file-name-shadow-tty-properties):
* lisp/shell.el (shell-dumb-shell-regexp):
* lisp/simple.el (overwrite-mode-binary, overwrite-mode-textual)
(mark-inactive, shell-command-switch)
(next-error-overlay-arrow-position):
* lisp/subr.el (package--builtin-versions, eval-after-load):
* lisp/tab-bar.el ([tab-bar]):
* lisp/term/pgtk-win.el (x-gtk-stock-map):
* lisp/term/x-win.el (x-gtk-stock-map):
* lisp/tool-bar.el ([tool-bar]):
* lisp/widget.el (define-widget): Remove calls to purecopy.

(cherry picked from commit d6aeb1a2606e1dece860f2b35623245d9eb865c3)

2 weeks agoDon't call purecopy in mouse.el
Stefan Kangas [Mon, 9 Dec 2024 20:19:21 +0000 (21:19 +0100)]
Don't call purecopy in mouse.el

* lisp/mouse.el (context-menu-entry, mouse-buffer-menu-mode-groups)
(x-fixed-font-alist): Remove calls to purecopy.

(cherry picked from commit 5afc27335468ae4b6d99be91e37b3557f1bfddc8)

2 weeks agoDon't call purecopy in emacs-lisp/*.el
Stefan Kangas [Mon, 9 Dec 2024 20:17:09 +0000 (21:17 +0100)]
Don't call purecopy in emacs-lisp/*.el

* lisp/emacs-lisp/byte-run.el (define-obsolete-face-alias)
(make-obsolete-variable, make-obsolete):
* lisp/emacs-lisp/cl-extra.el (cl-type-definition):
* lisp/emacs-lisp/cl-preloaded.el (cl-assertion-failed):
* lisp/emacs-lisp/cl-print.el (help-byte-code):
* lisp/emacs-lisp/derived.el (define-derived-mode):
* lisp/emacs-lisp/easy-mmode.el (define-minor-mode):
* lisp/emacs-lisp/eldoc.el (eldoc-minor-mode-string):
* lisp/emacs-lisp/gv.el (make-obsolete-generalized-variable):
* lisp/emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression):
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--parse-file):
* lisp/emacs-lisp/warnings.el (warning-type-format):
Remove calls to purecopy.

(cherry picked from commit 8da7086be6d0b0387c3ffbede062c4349045af70)

2 weeks agoDon't call purecopy in dnd.el
Stefan Kangas [Mon, 9 Dec 2024 20:11:45 +0000 (21:11 +0100)]
Don't call purecopy in dnd.el

* lisp/dnd.el (dnd-protocol-alist):
* lisp/pgtk-dnd.el (pgtk-dnd-types-alist, pgtk-dnd-known-types):
* lisp/x-dnd.el (x-dnd-types-alist, x-dnd-known-types):
Remove calls to purecopy.

(cherry picked from commit b0afe306b748a3fa140cde580239d0f99669850a)

2 weeks agoDon't call purecopy in vc/*.el
Stefan Kangas [Mon, 9 Dec 2024 19:44:23 +0000 (20:44 +0100)]
Don't call purecopy in vc/*.el

* lisp/vc/diff.el (diff-command, diff-switches):
* lisp/vc/ediff-hook.el (menu-bar-ediff-misc-menu)
(menu-bar-epatch-menu, menu-bar-ediff-merge-menu)
(menu-bar-ediff-menu):
* lisp/vc/pcvs-defs.el (cvs-global-menu):
* lisp/vc/vc-hooks.el (vc-menu-entry)
(vc-directory-exclusion-list):
* lisp/vc/vc-rcs.el (vc-rcs-master-templates):
* lisp/vc/vc-sccs.el (vc-sccs-master-templates):
* lisp/vc/vc-src.el (vc-src-master-templates): Remove calls to purecopy.

(cherry picked from commit 8bd246d87ea9cf02cab0a229e89b1648e9462c2e)

2 weeks agoDon't call purecopy in help-mode.el
Stefan Kangas [Mon, 9 Dec 2024 19:40:56 +0000 (20:40 +0100)]
Don't call purecopy in help-mode.el

* lisp/help-mode.el (help-function, help-variable, help-type)
(help-face, help-coding-system, help-input-method)
(help-character-set, help-symbol, help-back, help-forward)
(help-info-variable, help-info, help-man)
(help-customization-group, help-url, help-customize-variable)
(help-customize-face, help-function-def, help-function-cmacro)
(help-variable-def, help-face-def, help-package)
(help-package-def, help-theme-def, help-theme-edit)
(help-dir-local-var-def, help-news, help-back-label)
(help-forward-label, help-xref-symbol-regexp)
(help-xref-info-regexp, help-xref-man-regexp)
(help-xref-customization-group-regexp, help-xref-url-regexp):
Remove calls to purecopy.

(cherry picked from commit 065b6f2fa7a75fda446dc755edfee555b6e6d704)

2 weeks agoDon't call purecopy in textmodes/*.el
Stefan Kangas [Mon, 9 Dec 2024 02:47:37 +0000 (03:47 +0100)]
Don't call purecopy in textmodes/*.el

* lisp/textmodes/bibtex.el (bibtex-url, bibtex-search-crossref):
* lisp/textmodes/fill.el (adaptive-fill-regexp)
(adaptive-fill-first-line-regexp):
* lisp/textmodes/ispell.el (ispell-menu-map)
(ispell-skip-region-alist, ispell-tex-skip-alists):
* lisp/textmodes/rst.el (auto-mode-alist):
* lisp/textmodes/texinfo.el (texinfo-open-quote):
* lisp/textmodes/tex-mode.el (tex-directory, tex-run-command)
(latex-run-command, slitex-run-command, tex-start-options)
(tex-start-commands, tex-bibtex-command, tex-dvi-print-command)
(tex-alt-dvi-print-command, tex-dvi-view-command)
(tex-show-queue-command, tex-open-quote, tex-close-quote):
* lisp/textmodes/texinfo.el (texinfo-open-quote)
(texinfo-close-quote): Remove calls to purecopy.

(cherry picked from commit e44b1bf5cca00edb87452f864e9c450116d8f830)

2 weeks agoDon't call purecopy in progmodes/*.el
Stefan Kangas [Mon, 9 Dec 2024 02:39:56 +0000 (03:39 +0100)]
Don't call purecopy in progmodes/*.el

* lisp/progmodes/compile.el (compile-command):
* lisp/progmodes/etags.el (tags-compression-info-list):
* lisp/progmodes/grep.el (grep-program, find-program, xargs-program):
* lisp/progmodes/js.el (interpreter-mode-alist):
* lisp/progmodes/python.el (interpreter-mode-alist):
* lisp/progmodes/ruby-mode.el (auto-mode-alist, interpreter-mode-alist):
* lisp/progmodes/vera-mode.el: Remove calls to purecopy.

(cherry picked from commit 04408e198f1acc2eeae2ca299de994ba38116d1a)

2 weeks agoDon't call purecopy in bindings.el
Stefan Kangas [Mon, 9 Dec 2024 02:28:30 +0000 (03:28 +0100)]
Don't call purecopy in bindings.el

* lisp/bindings.el (mode-line-input-method-map)
(mode-line-coding-system-map, mode-line-mule-info, mode-line-client)
(mode-line-modified, mode-line-remote)
(mode-line-window-dedicated-keymap, propertized-buffer-identification)
(completion-ignored-extensions): Remove calls to purecopy.

(cherry picked from commit a4e38cc3753ac416181c0ead758d174093eb3526)

2 weeks agoDon't call purecopy in common-win.el
Stefan Kangas [Fri, 23 Aug 2024 18:24:01 +0000 (20:24 +0200)]
Don't call purecopy in common-win.el

* lisp/term/common-win.el: Remove calls to purecopy.

(cherry picked from commit d121953b971f2bee5d75e37355fd2bd5e1d12784)

2 weeks agoDon't call purecopy in international/*.el
Stefan Kangas [Fri, 23 Aug 2024 18:21:41 +0000 (20:21 +0200)]
Don't call purecopy in international/*.el

* lisp/international/fontset.el (font-encoding-alist,)
(x-pixel-size-width-font-regexp, vertical-centering-font-regexp)
(face-font-rescale-alist, standard-fontset-spec):
* lisp/international/latexenc.el (latex-inputenc-coding-alist):
* lisp/international/mule-cmds.el (help-xref-mule-regexp-template)
(set-language-info-internal, set-language-info-alist)
(register-input-method, locale-language-names)
(locale-charset-language-names, locale-preferred-coding-systems)
(define-char-code-property):
* lisp/international/mule-conf.el (file-coding-system-alist):
* lisp/international/mule-diag.el (sort-listed-character-sets):
* lisp/international/mule.el (define-charset, load-with-code-conversion)
(put-charset-property, define-coding-system)
(ctext-non-standard-encodings-alist)
(ctext-non-standard-encodings-regexp, auto-coding-alist)
(auto-coding-regexp-alist):
* lisp/international/quail.el (quail-keyboard-layout-button):
(quail-keyboard-customize-button): Remove calls to purecopy.

(cherry picked from commit 833037fadd3533a50eb07406f058ee695c72fb9a)

2 weeks agoRemove purecopy calls from files.el
Stefan Kangas [Fri, 23 Aug 2024 18:05:15 +0000 (20:05 +0200)]
Remove purecopy calls from files.el

* lisp/files.el (null-device, file-name-invalid-regexp)
(locate-dominating-stop-dir-regexp, auto-mode-alist)
(interpreter-mode-alist, inhibit-local-variables-regexps)
(auto-mode-interpreter-regexp, magic-fallback-mode-alist)
(save-some-buffers-action-alist, list-directory-brief-switches)
(list-directory-verbose-switches, insert-directory-program)
(directory-free-space-program, directory-free-space-args)
(directory-listing-before-filename-regexp)
(file-name-handler-alist): Remove all purecopy calls.

(cherry picked from commit 538a2428983c3aaf300bba920bc9f7e4d718982e)

2 weeks agoAvoid compiler warning in process_mark_stack
Pip Cet [Thu, 22 Aug 2024 05:49:33 +0000 (05:49 +0000)]
Avoid compiler warning in process_mark_stack

* src/alloc.c (process_mark_stack): Only declare and assign to 'po' if
it's needed.
Problem reported by: Stefan Kangas <stefankangas@gmail.com>.

(cherry picked from commit c951fd415cd243eeda3caf2e536967a762bd0ffe)

2 weeks agoUpdate pdumper hashes
Pip Cet [Thu, 22 Aug 2024 05:48:43 +0000 (05:48 +0000)]
Update pdumper hashes

* src/pdumper.c (dump_symbol, dump_hash_table): Update hashes.

(cherry picked from commit 00a1152fad510d56cec813ba008f854cfceb163e)

2 weeks agoMake bindings--define-key obsolete
Stefan Kangas [Wed, 21 Aug 2024 22:09:51 +0000 (00:09 +0200)]
Make bindings--define-key obsolete

It used to be like 'define-key', but was used for making pure copies of
as much of a menu's data as possible.  With purespace now gone, it can
be replaced by 'define-key'.

* lisp/bindings.el (bindings--define-key): Make into obsolete
alias for 'define-key'.  Update all callers.

(cherry picked from commit 1de87314c4c3cd01526e31bb805e2857fe749485)

2 weeks agoPurecopy removal: Lisp code
Pip Cet [Wed, 21 Aug 2024 19:13:23 +0000 (19:13 +0000)]
Purecopy removal: Lisp code

* lisp/emacs-lisp/bytecomp.el (byte-compile-cond-jump-table): Don't
request our hash tables be purecopied.  Adjust comment.
* lisp/progmodes/elisp-mode.el (elisp--local-variables-completion-table):
Use 'defconst' rather than 'defvar' now the purespace problem is gone
* lisp/rfn-eshadow.el (file-name-shadow-properties): Remove obsolete
comment.

(cherry picked from commit 5b471384d1805bfb9e78314f8cb1f4d09aa378f7)

2 weeks agoUnexec removal: Build system
Pip Cet [Wed, 21 Aug 2024 08:50:02 +0000 (08:50 +0000)]
Unexec removal: Build system

* configure.ac (CYGWIN_OBJ): Remove comment.
* src/Makefile.in (PAXCTL, SETFATTR, PAXCTL_dumped, PAXCTL_notdumped):
Remove definitions.
(emacs$(EXEEXT), temacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
* src/deps.mk: Remove 'unexec'-specific code.

(cherry picked from commit a54ff8c18fa9b97b737d0de1a5e160b454ac294d)

2 weeks agoUnexec removal: Documentation adjustments
Pip Cet [Wed, 21 Aug 2024 08:45:13 +0000 (08:45 +0000)]
Unexec removal: Documentation adjustments

* doc/lispref/internals.texi (Building Emacs):
* doc/lispref/os.texi (Command-Line Arguments): Remove documentation for
'unexec'-specific code and arguments.
* etc/PROBLEMS: Remove unexec-specific problems.

(cherry picked from commit 0e37b11e659dd58c520d557820b006a8d03c71e6)

2 weeks agoDon't recognize "bootstrap" option for --temacs
Pip Cet [Wed, 21 Aug 2024 08:44:14 +0000 (08:44 +0000)]
Don't recognize "bootstrap" option for --temacs

This option only makes sense for unexec dumping.

* src/emacs.c (main): Recognize "pbootstrap" only, not "bootstrap".

(cherry picked from commit 9a0728af9df7c208a7e93f8e970b7348b1273fee)

2 weeks agoPure storage removal: Documentation
Pip Cet [Wed, 21 Aug 2024 08:59:25 +0000 (08:59 +0000)]
Pure storage removal: Documentation

* etc/NEWS: Document removal of unexec dumper.
* etc/PROBLEMS: Remove pure space problems.

(cherry picked from commit 1c495735b4fd7411bca39161b45e0115d0d377b9)

2 weeks agoPure storage removal: Bump nativecomp ABI
Pip Cet [Tue, 20 Aug 2024 19:16:58 +0000 (19:16 +0000)]
Pure storage removal: Bump nativecomp ABI

Use "9" as MPS builds use "7" and "8".

* src/comp.c (ABI_VERSION): Bump.

(cherry picked from commit 647f6aa4c06f681df8d2ab6520d8bcd273dff1a8)

2 weeks agoPure storage removal: Remove documentation
Pip Cet [Tue, 20 Aug 2024 19:15:16 +0000 (19:15 +0000)]
Pure storage removal: Remove documentation

As pure storage is now gone, it no longer needs to be documented.

* doc/lispref/elisp.texi (Top):
* doc/lispref/internals.texi (GNU Emacs Internals): Remove "Pure
Storage" section.
(Building Emacs, Garbage Collection, Writing Emacs Primitives):
* doc/lispref/symbols.texi (Standard Properties): Remove references to
pure storage.
* src/alloc.c (Fgarbage_collect): Remove docstring text referring to
pure storage.

(cherry picked from commit c9ab3258760c5ef2baf3ecf2a2a0051fc3fb4612)

2 weeks agoPure storage removal: Adjust nativecomp code
Pip Cet [Tue, 20 Aug 2024 19:09:14 +0000 (19:09 +0000)]
Pure storage removal: Adjust nativecomp code

* lisp/emacs-lisp/comp.el (comp-curr-allocation-class, comp-ctxt)
(comp--emit-for-top-level, comp--emit-lambda-for-top-level)
(comp--finalize-relocs): Remove 'd-impure' allocation class.
* src/comp.c (PURE_RELOC_SYM, DATA_RELOC_IMPURE_SYM)
(TEXT_DATA_RELOC_IMPURE_SYM): Remove definitions.
(comp_t): Remove 'pure_ptr', 'check_impure', 'data_relocs_impure',
'd_impure_idx'.
(helper_link_table): Remove 'pure_write_error'.
(obj_to_reloc): Adjust to removal of 'data_relocs_impure'.
(emit_PURE_P): Remove function.
(declare_imported_data, declare_runtime_imported_funcs)
(emit_ctxt_code): Adjust to removed fields.
(define_setcar_setcdr): Don't call 'CHECK_IMPURE'.
(define_CHECK_IMPURE): Remove function.
(Fcomp__compile_ctxt_to_file0, check_comp_unit_relocs, load_comp_unit)
(Fcomp__register_lambda): Adjust to removed allocation class 'd-impure'.
(syms_of_comp): Don't define 'd-impure'.
* src/comp.h (struct Lisp_Native_Comp_Unit): Drop support for allocation
class 'd-impure'.
* src/lisp.h (allocate_native_comp_unit):
* src/pdumper.c (dump_do_dump_relocation): Adjust to struct change.

(cherry picked from commit bd2b59f07337c4f5980666875207bf877634b1b3)

2 weeks agoPure storage removal: Remove docstring hack
Pip Cet [Tue, 20 Aug 2024 19:08:33 +0000 (19:08 +0000)]
Pure storage removal: Remove docstring hack

This should no longer be needed.

* src/eval.c (Fautoload): Don't try to work around pure storage bug.

(cherry picked from commit 69fea4f29a1390912e4140a3ebacc50b7338db6f)

2 weeks agoPure storage removal: Remove purecopy hash table flag
Pip Cet [Tue, 20 Aug 2024 19:04:44 +0000 (19:04 +0000)]
Pure storage removal: Remove purecopy hash table flag

* lisp/emacs-liqsp/comp.el (comp--jump-table-optimizable): Adjust
comment.
* src/category.c (hash_get_category_set):
* src/emacs-module.c (syms_of_module):
* src/fns.c (make_hash_table): Remove 'purecopy' flag and update
docstring.
(Fmake_hash_table): Ignore ':purecopy' argument.
* src/frame.c (make_frame):
* src/image.c (xpm_make_color_table_h):
* src/lisp.h (struct Lisp_Hash_Table): Drop 'purecopy' flag.
* src/pdumper.c (dump_hash_table): Don't dump 'purecopy' flag.
* src/print.c (print_object): Don't print 'purecopy' flag

* src/json.c (json_parse_object):
* src/lread.c (readevalloop, read_internal_start):
* src/pgtkterm.c (syms_of_pgtkterm):
* src/profiler.c (export_log):
* src/xfaces.c (syms_of_xfaces):
* src/xterm.c (syms_of_xterm): Adjust calls to 'make_hash_table'.

(cherry picked from commit afd61deaaeb5e5e6845bdf995ac5ee9a3479599c)

2 weeks agoPure storage removal: Remove support for pinned objects
Pip Cet [Tue, 20 Aug 2024 19:02:29 +0000 (19:02 +0000)]
Pure storage removal: Remove support for pinned objects

* src/alloc.c (symbol_block_pinned): Remove variable.
(init_symbol): Don't initialize 'pinned flag'.
(pinned_objects): Remove variable.
(mark_pinned_objects, mark_pinned_symbols): Remove functions.
(garbage_collect): Don't call 'mark_pinned_objects',
'mark_pinned_symbols'.
* src/lisp.h (struct Lisp_Symbol): Remove 'pinned' flag.
* src/pdumper.c (dump_symbol): Remove 'pinned' flag from dump.

(cherry picked from commit e1e101c6c10b6e5110c2c47946d477a752828a78)

2 weeks agoPure storage removal: Replace calls to removed functions
Pip Cet [Tue, 20 Aug 2024 19:00:20 +0000 (19:00 +0000)]
Pure storage removal: Replace calls to removed functions

* src/alloc.c (string_bytes, pin_string, valid_lisp_object_p)
(process_mark_stack, survives_gc_p, syms_of_alloc):
* src/androidterm.c (android_term_init): Replace call to
'build_pure_c_string'.
* src/buffer.c (init_buffer_once, syms_of_buffer):
* src/bytecode.c (exec_byte_code):
* src/callint.c (syms_of_callint):
* src/callproc.c (syms_of_callproc):
* src/category.c (Fdefine_category):
* src/coding.c (syms_of_coding):
* src/comp.c (Fcomp__compile_ctxt_to_file0)
(maybe_defer_native_compilation, syms_of_comp):
* src/data.c (Fsetcar, Fsetcdr, Fdefalias, Faset, syms_of_data):
* src/dbusbind.c (syms_of_dbusbind):
* src/doc.c (Fsnarf_documentation):
* src/emacs-module.c (syms_of_module):
* src/eval.c (Finternal__define_uninitialized_variable)
(Fdefconst_1, define_error, syms_of_eval):
* src/fileio.c (syms_of_fileio):
* src/fns.c (Ffillarray, Fclear_string, check_mutable_hash_table):
* src/fontset.c (syms_of_fontset):
* src/frame.c (make_initial_frame):
* src/haikufns.c (syms_of_haikufns):
* src/intervals.c (create_root_interval):
* src/keyboard.c (syms_of_keyboard):
* src/keymap.c (Fmake_sparse_keymap, Fset_keymap_parent)
(store_in_keymap, syms_of_keymap):
* src/lisp.h:
* src/lread.c (Fload, read0, intern_c_string_1, define_symbol)
(Fintern, defsubr, syms_of_lread):
* src/pdumper.c (Fdump_emacs_portable):
* src/pgtkfns.c (syms_of_pgtkfns):
* src/pgtkterm.c (syms_of_pgtkterm):
* src/process.c (syms_of_process):
* src/search.c (syms_of_search):
* src/sqlite.c (syms_of_sqlite):
* src/syntax.c (syms_of_syntax):
* src/treesit.c (syms_of_treesit):
* src/w32fns.c (syms_of_w32fns):
* src/xdisp.c (syms_of_xdisp):
* src/xfaces.c (syms_of_xfaces):
* src/xfns.c (syms_of_xfns):
* src/xftfont.c (syms_of_xftfont):
* src/xterm.c (syms_of_xterm): Remove calls to 'PURE_P', 'CHECK_IMPURE',
'Fpurecopy', and replace calls to 'build_pure_c_string', 'pure_list',
'pure_listn', etc., by impure equivalents.

(cherry picked from commit 5ec86966638885a0f8df8afa28a01ca103ad2a49)

2 weeks agoPure storage removal: Main part
Pip Cet [Tue, 20 Aug 2024 18:52:35 +0000 (18:52 +0000)]
Pure storage removal: Main part

* src/alloc.c (pure, PUREBEG, purebeg, pure_size)
(pure_bytes_used_before_overflow, pure_bytes_used_lisp)
(pure_bytes_used_non_lisp): Remove definitions.
(init_strings): Make empty strings impure.
(cons_listn): Drop 'cons' argument.
(pure_listn): Remove function.
(init_vectors): Allocate zero vector manually to avoid freelist issues.
(pure_alloc, check_pure_size, find_string_data_in_pure)
(make_pure_string, make_pure_c_string, pure_cons, make_pure_float)
(make_pure_bignum, make_pure_vector, purecopy_hash_table): Remove
functions.
(purecopy): Reduce to hash consing our argument.
(init_alloc_once_for_pdumper): Adjust to lack of pure space.
(pure-bytes-used): Adjust docstring to mark as obsolete.
(purify-flag): Keep for hash consing, but adjust docstring.
* src/bytecode.c:
* src/comp.c: Don't include "puresize.h".
* src/conf_post.h (SYSTEM_PURESIZE_EXTRA): Remove definition.
* src/data.c (pure_write_error): Remove function.
* src/deps.mk: Remove puresize.h dependency throughout.
* src/emacs.c:
* src/fns.c:
* src/intervals.c:
* src/keymap.c: Don't include "puresize.h".
* src/lisp.h (struct Lisp_Hash_Table): Adjust comment.
(pure_listn, pure_list, build_pure_c_string): Remove.
* src/w32heap.c (FREEABLE_P): Don't do use 'dumped_data'.
(malloc_before_dump, realloc_before_dump, free_before_dump): Remove
functions.
* src/w32heap.h: Adjust prototype.
* lisp/loadup.el:
* lisp/startup.el: Remove purespace code.

(cherry picked from commit f84ccff5a6275782a37534ed55b706db35f228ac)

2 weeks agoPure storage removal: Delete puresize.h
Pip Cet [Tue, 20 Aug 2024 18:52:04 +0000 (18:52 +0000)]
Pure storage removal: Delete puresize.h

* puresize.h: Delete file.

(cherry picked from commit d359858b5d02e60c1d46c26750e5510c2606916a)

2 weeks agoUnexec removal: Adjust and simplify W32-specific code
Pip Cet [Tue, 20 Aug 2024 18:48:42 +0000 (18:48 +0000)]
Unexec removal: Adjust and simplify W32-specific code

* src/emacs.c (main): Unconditionally call 'init_heap' without an
argument.  Adjust comment.
* src/w32heap.c (dumped_data, DUMPED_HEAP_SIZE): Remove definitions.
(heap): Remove variable.
(dumped_data_commit): Remove function.
(init_heap): Drop unexec-specific code.

(cherry picked from commit aab5a2fe4c4164019b8b5bf09cce835b2aa8549c)

2 weeks agoUnexec removal: Remove HYBRID_MALLOC support
Pip Cet [Tue, 20 Aug 2024 18:40:29 +0000 (18:40 +0000)]
Unexec removal: Remove HYBRID_MALLOC support

* src/gmalloc.c (gdefault_morecore): Remove HYBRID_MALLOC code.
(allocated_via_gmalloc, hybrid_malloc, hybrid_calloc, hybrid_free_1)
(hybrid_free, hybrid_aligned_alloc, hybrid_realloc): Remove functions.

* msdos/sed1v2.inp:
* msdos/sedlibmk.inp:
* src/alloc.c (GC_MALLOC_CHECK, USE_ALIGNED_ALLOC)
(refill_memory_reserve, aligned_alloc):
* src/emacs.c (main):
* src/lastfile.c (my_edata):
* src/lisp.h:
* src/ralloc.c:
* src/sysdep.c (get_current_dir_name_or_unreachable):
* src/xdisp.c (decode_mode_spec): Remove HYBRID_MALLOC conditions.

* configure.ac (hybrid_malloc, HYBRID_MALLOC): Remove variables and
dependent code.
* src/conf_post.h (hybrid_malloc, hybrid_calloc, hybrid_free)
(hybrid_aligned_alloc, hybrid_realloc): Remove conditional prototypes.
* src/Makefile.in (HYBRID_MALLOC): Remove variable.
(base_obj): Remove sheap.o
(LIBEGNU_ARCHIVE):
* lib/Makefile.in (libgnu_a_OBJECTS): Remove libegnu.a support.

(cherry picked from commit b2bc337a5f8d84978029873ce8e51b8d3d53121a)

2 weeks agoUnexec removal: Main part
Pip Cet [Tue, 20 Aug 2024 18:31:05 +0000 (18:31 +0000)]
Unexec removal: Main part

* configure.ac: Remove unexec-specific parts.
(EMACS_CONFIG_FEATURES): Always report that we do not have the UNEXEC
feature.
(AC_ECHO): No longer display a line about the unexec feature.
* lisp/loadup.el:
* lisp/startup.el: Remove unexec-specific code.
* src/Makefile.in (base_obj): Drop 'UNEXEC_OBJ'.
* src/alloc.c (staticvec): Never initialize this variable.
(BLOCK_ALIGN): Always allow large blocks.
(mmap_lisp_allowed_p): Remove unexec-specific code.
* src/buffer.c (init_buffer):
* src/conf_post.h (ADDRESS_SANITIZER):
* src/emacs.c (load_pdump, main): Remove unexec-specific code.
(Fdump_emacs): Remove function.
(syms_of_emacs): Remove 'Fdump_emacs'.
* src/lastfile.c: Remove unexec-specific code.
* src/lisp.h (gflags): Remove unexec-specific flags.
(will_dump_p, will_bootstrap_p, will_dump_with_unexec_p)
(dumped_with_unexec_p, definitely_will_not_unexec_p): Remove or adjust
predicates.
(SUBR_SECTION_ATTRIBUTE): Remove unexec-specific definition.
* src/pdumper.c (Fdump_emacs_portable): Remove unexec-specific warning.
* src/process.c (init_process_emacs): Remove !unexec condition
* src/sysdep.c (maybe_disable_address_randomization): Adjust comment.
(init_signals):
* src/timefns.c (init_timefns): Remove unexec-specific code.
* src/w32heap.c (report_temacs_memory_usage): Remove function.
* src/w32heap.h: Adjust comment.
* src/w32image.c (globals_of_w32image): Remove unexec-specific code.

(cherry picked from commit 15e2b14f03796467fab8e8086d293a5813afaa5b)

2 weeks agoUnexec removal: Remove obsolete files
Pip Cet [Tue, 20 Aug 2024 18:29:53 +0000 (18:29 +0000)]
Unexec removal: Remove obsolete files

* src/sheap.c, src/sheap.h, src/unexec.h, src/unexaix.c, unexcoff.c:
* src/unexcw.c, src/unexelf.c, src/unexhp9k800.c, src/unexmacosx.c:
* src/unexsol.c, src/unexw32.c: Remove files.

(cherry picked from commit 7ce34a3bcf5ed277ef37aa75e1ccbd858543b6cf)

3 weeks ago; * lisp/progmodes/python.el (treesit-node-prev-sibling): Declare.
Eli Zaretskii [Thu, 30 Jan 2025 12:03:20 +0000 (14:03 +0200)]
; * lisp/progmodes/python.el (treesit-node-prev-sibling): Declare.

(cherry picked from commit f2e97338eb96739711f9d4cb308219ed3df46c06)

3 weeks ago; * src/pdumper.c (dump_do_fixup): Pacify GCC.
Eli Zaretskii [Thu, 30 Jan 2025 09:02:47 +0000 (11:02 +0200)]
; * src/pdumper.c (dump_do_fixup): Pacify GCC.

(cherry picked from commit a99ba59aa02ef8cfd314737950b6cd8d97015925)

3 weeks agoTramp cleanup
Michael Albinus [Thu, 30 Jan 2025 07:40:34 +0000 (08:40 +0100)]
Tramp cleanup

* doc/misc/tramp.texi (Predefined connection information):
Mention also "androidsu" as special case of "tmpdir".
(Remote processes): Signals are not delivered to remote direct
async processes.  Say, that there are restrictions for transfer of
binary data to remote direct async processes.

* lisp/net/tramp-compat.el (tramp-compat-temporary-file-directory):
Simplify.

(cherry picked from commit 6b3d69b16ed50c8a4dea1e3f1f9f231657e66590)

3 weeks agoFix tree-sitter language remapping
Yuan Fu [Thu, 30 Jan 2025 07:20:38 +0000 (23:20 -0800)]
Fix tree-sitter language remapping

* src/treesit.c (resolve_language_symbol): Move forward.
(treesit_ensure_query_compiled): Resolve language remapping
here.
(Ftreesit_parser_list): Don't resolve language remaping here,
because there's no need: parsers now carries the remapped
language.
(Ftreesit_query_compile): Don't resolve language remapping here,
because we resolve language remapping when actually compiling
the query.  Also we want the query to carry the unmapped
language.

(cherry picked from commit 3be04f3dab85348006a8567e172c3dcb0a6831a4)

3 weeks agoAdd back tree-sitter declare-function for python.el (bug#75526)
Yuan Fu [Tue, 28 Jan 2025 02:00:16 +0000 (18:00 -0800)]
Add back tree-sitter declare-function for python.el (bug#75526)

treesit-declare-unavailable-functions is not available for old
emacs versions, but python.el is a core package available on
ELPA.

Remove the treesit-declare-unavailable-functions until compat.el
releases a new version that contains it.

* lisp/progmodes/python.el: Remove
treesit-declare-unavailable-functions and add back
declare-function forms.

(cherry picked from commit c81b50aaf520daa2c9c8b45715f75149bc254014)

3 weeks agoFurther fixes for cursor positioning (bug#75056)
Gerd Möllmann [Wed, 29 Jan 2025 12:42:40 +0000 (13:42 +0100)]
Further fixes for cursor positioning (bug#75056)

* src/dispnew.c (write_matrix): Don't set the cursor here. Parameter to
set the cursor or not removed.
(combine_updates_for_frame): Call tty_set_cursor here, depending on
whether or not the selected frame is related to the updated frame.
(update_frame_with_menu): Adapt to change of write_matrix.

(cherry picked from commit 782be196e52f8912c3e26c646f04fe48cf703aca)

3 weeks agoReplace two macros with functions in dispnew.c (bug#75056)
Gerd Möllmann [Wed, 29 Jan 2025 07:34:43 +0000 (08:34 +0100)]
Replace two macros with functions in dispnew.c (bug#75056)

* src/dispnew.c (WINDOW_TO_FRAME_VPOS, WINDOW_TO_FRAME_VPOS): Macros
removed.
(window_to_frame_vpos, window_to_frame_vpos): Always define, and use
them instead of the removed macros.

(cherry picked from commit 7aacefba6bfe4c0e658f09d2ac7f025f9a9a827f)

3 weeks agoDon't use selected frame in tty_set_cursor (bug#75056)
Gerd Möllmann [Wed, 29 Jan 2025 07:28:58 +0000 (08:28 +0100)]
Don't use selected frame in tty_set_cursor (bug#75056)

* src/dispnew.c (tty_set_cursor): Add frmae parameter.
(write_matrix): Pass to the updated frame to tty_set_cursor.

(cherry picked from commit 6cf479931d1adc03661116ef827f77fdc615db22)

3 weeks agoCC Mode: Don't propertize parens in macros incorrectly
Alan Mackenzie [Wed, 29 Jan 2025 18:35:31 +0000 (18:35 +0000)]
CC Mode: Don't propertize parens in macros incorrectly

Parentheses in macros were getting incorrectly propertized with
the '(1) (punctuation) syntax-table text property.  This was
due to a typo in the patch "CC Mode: Rationalize and optimize
cache invalidation (1)" from 2024-10-06.  Correct this.

* lisp/progmodes/cc-mode.el (c-depropertize-CPP): Move the
first c-clear-syntax-table-with-value-trim-caches invocation
from inside the enclosing `when' form to after it.

(cherry picked from commit b34c069d8250e9557d5ef5e7997a5a7e370c7ad2)

3 weeks agoFix args in treesit-beginning-of-defun and treesit-end-of-defun
Juri Linkov [Wed, 29 Jan 2025 17:58:10 +0000 (19:58 +0200)]
Fix args in treesit-beginning-of-defun and treesit-end-of-defun

* lisp/treesit.el (treesit-beginning-of-defun): Set arg to 1 when nil.
(treesit-end-of-defun): Fix arg names in docstring.

(cherry picked from commit 6a92f674fe5123742b2c1bc890bab7b3743582c8)

3 weeks ago; Remove duplicate defvar in comp-run.el.
Basil L. Contovounesios [Wed, 29 Jan 2025 13:15:44 +0000 (14:15 +0100)]
; Remove duplicate defvar in comp-run.el.

* lisp/emacs-lisp/comp-run.el (comp-async-compilations): Remove
duplicate definition (bug#75925).

(cherry picked from commit 25c254aa417baa9a5f8fd987e3467bd7a5f0de5b)

3 weeks ago; Fix Cygw32 build
Eli Zaretskii [Wed, 29 Jan 2025 15:55:58 +0000 (17:55 +0200)]
; Fix Cygw32 build

(cherry picked from commit cb62a47896bb21420a709c655034e8acfcb08082)

3 weeks agoEglot: don't auto-shutdown when reverting of single managed buffer
João Távora [Wed, 29 Jan 2025 08:37:37 +0000 (08:37 +0000)]
Eglot: don't auto-shutdown when reverting of single managed buffer

When eglot-autoshutdown is t and the only reason we're
considering it is because of a revert (which tears down Eglot's
minor mode as if by killing), detect that situation and
purposedly cancel the shutdown.

* lisp/progmodes/eglot.el (eglot--managed-mode): Tweak.

(cherry picked from commit 142fe5ace4e5d4ed667505f73fc95757a764d530)

3 weeks agoEglot: in eglot-code-action-indications, make 'margin' interactive
João Távora [Wed, 29 Jan 2025 08:33:54 +0000 (08:33 +0000)]
Eglot: in eglot-code-action-indications, make 'margin' interactive

Didn't know it was possible, thanks to Ergus <spacibba@aol.com> for the
tip about binding [left-margin mouse-2] in the keymap.

The technique adopted in 'eglot-mouse-call' possibly still doesn't work
very well if the margin thing we're clicking on is not on the line point
is currently on.  But we don't have that problem (yet?) because LSP
action suggestions function mostly on a "at point" basis.

* lisp/progmodes/eglot.el (eglot-code-action-indications): Adjust docstring.
(eglot--mouse-call): Don't go anywhere except in text area.
(eglot-diagnostics-map): Bind eglot-mouse-actions to left-margin.

(cherry picked from commit e2ff77052da91e662bbd3cb19a742604db742d32)

3 weeks agoHideshow support for tree-sitter in hs-minor-mode (bug#75609)
Juri Linkov [Tue, 28 Jan 2025 19:07:16 +0000 (21:07 +0200)]
Hideshow support for tree-sitter in hs-minor-mode (bug#75609)

* lisp/progmodes/hideshow.el (hs-inside-comment-p-func):
New buffer-local variable.
(hs-hide-block-at-point): Check if 'hs-block-end-regexp' is
a string or a function.
(hs-inside-comment-p): Move body to 'hs-inside-comment-p--default'.
Call 'hs-inside-comment-p-func' if it's a function.
(hs-inside-comment-p--default): New function with body from
'hs-inside-comment-p'.
(hs-hide-all): Don't use 'hs-block-start-regexp' when it's not a string.
(hs-minor-mode): Don't call 'hs-grok-mode-type' when
'hs-inside-comment-p-func' already has a buffer-local value.

* lisp/treesit.el (treesit-hs-block-end)
(treesit-hs-find-block-beginning, treesit-hs-find-next-block)
(treesit-hs-looking-at-block-start-p)
(treesit-hs-inside-comment-p): New functions.
(treesit-major-mode-setup): Set hs-minor-mode buffer-local variables.

(cherry picked from commit 2e3b085d447bc2cd1a0e779145be9cab9a15d7af)

3 weeks ago* lisp/treesit.el: Use default display behavior for treesit-explore.
Juri Linkov [Tue, 28 Jan 2025 18:49:52 +0000 (20:49 +0200)]
* lisp/treesit.el: Use default display behavior for treesit-explore.

(treesit-explorer-switch-parser, treesit-explore):
Revert to previous behavior (bug#75079).

(cherry picked from commit cd6aed5c9e905a8fc7608a172a689e99ff27fe25)

3 weeks agoFix two more drawings in windows.texi
Martin Rudalics [Tue, 28 Jan 2025 17:46:31 +0000 (18:46 +0100)]
Fix two more drawings in windows.texi

* doc/lispref/windows.texi (Changing Window Layouts): Fix two more
drawings.

(cherry picked from commit af033548aa7900c02c01ae8c5a13720eb50742e3)

3 weeks ago; Fix last change
Eli Zaretskii [Tue, 28 Jan 2025 16:18:24 +0000 (18:18 +0200)]
; Fix last change

* src/buffer.c (Fother_buffer):
* lisp/frame.el (make-frame):
* doc/lispref/frames.texi (Creating Frames): Fix em-dash.

(cherry picked from commit 8c4a4b4eab8ac4dc26e65d552821f3f0b49c79c4)

3 weeks agoNew variable 'expose-hidden-buffer' (Bug#75828)
Martin Rudalics [Tue, 28 Jan 2025 15:59:45 +0000 (16:59 +0100)]
New variable 'expose-hidden-buffer' (Bug#75828)

* src/frame.c (make_frame): Handle 'expose-hidden-buffer'.
(expose-hidden-buffer): New variable to handle hidden buffers.
* src/buffer.c (Fother_buffer): Mention that it does not return
a hidden buffer.
* lisp/frame.el (make-frame): In doc-string describe handling
of hidden buffers.
* doc/lispref/frames.texi (Creating Frames): Explain handling
of hidden buffers in description of 'make-frame'.

(cherry picked from commit 7f01dd8906cbc8839ffecc55cfa7ff789f3fa298)

3 weeks ago; * admin/MAINTAINERS: Remove Bastien Guerry.
Bastien Guerry [Tue, 28 Jan 2025 13:25:22 +0000 (14:25 +0100)]
; * admin/MAINTAINERS: Remove Bastien Guerry.

(cherry picked from commit c400ac680f4db86686126876e2d709b1e6099544)

3 weeks agoEglot: allow customizing the mode line (bug#71823)
João Távora [Tue, 28 Jan 2025 10:39:25 +0000 (10:39 +0000)]
Eglot: allow customizing the mode line (bug#71823)

* lisp/progmodes/eglot.el (eglot-code-action-indications): Adjust docstring.
(eglot--mode-line-props): Tweak.
(eglot--mode-line-format): Delete.
(eglot-mode-line-format): New defcustom.
(eglot-mode-line-menu, eglot-mode-line-session)
(eglot-mode-line-error, eglot-mode-line-pending-requests)
(eglot-mode-line-progress, eglot-mode-line-action-suggestion): New
constants.
(mode-line-misc-info): Adjust setting

* etc/EGLOT-NEWS: Mention new feature.

* doc/misc/eglot.texi (Customization Variables): Mention new variable.

(cherry picked from commit b4e9115f4fcfc174a9c3b974bf414ae4af060ae7)

3 weeks agoEglot: suggest code actions at point
João Távora [Sun, 26 Jan 2025 23:26:51 +0000 (23:26 +0000)]
Eglot: suggest code actions at point

* lisp/progmodes/eglot.el (eglot-code-action-indicator-face): New face.
(eglot-code-action-indications, eglot-code-action-indicator): New defcustoms.
(eglot--highlights): Move up here.
(eglot--managed-mode): Rework.
(eglot--server-menu-map, eglot--main-menu-map): Extract maps into
variables (avoids odd mode-line bug).
(eglot--mode-line-format): Rework.
(eglot--code-action-params): New helper.
(eglot-code-actions): Rework.
(eglot--read-execute-code-action): Tweak.
(eglot-code-action-suggestion): New function.

* etc/EGLOT-NEWS: Mention new feature.

* doc/misc/eglot.texi (Eglot Features): Mention new feature.
(Customization Variables): Mention new variables.

(cherry picked from commit d6a502fc7a69dfa11aa100da5966a6962a82f613)

3 weeks agoEglot: introduce eglot-advertise-cancellation
João Távora [Tue, 14 Jan 2025 15:58:57 +0000 (15:58 +0000)]
Eglot: introduce eglot-advertise-cancellation

Setting this variable to true causes Eglot to send special
cancellation notification for certain stale client request.

This may help some LSP servers avoid doing costly but ultimately useless
work on behalf of the client, improving overall performance.

Request cancellation is described in

   https://microsoft.github.io/language-server-protocol/
      specifications/lsp/3.17/specification/#cancelRequest

* lisp/jsonrpc.el (jsonrpc-request): Accept function as value for
CANCEL-ON-INPUT.

* lisp/progmodes/eglot.el (eglot--request): Rework.

* doc/misc/eglot.texi (Customizing Eglot): Mention
eglot-advertise-cancellation.

(cherry picked from commit 7f0ef9655cdc28c3b8055e32c9e84ea57339b139)

3 weeks agoEglot: restructure and overhaul documentation
João Távora [Tue, 28 Jan 2025 10:37:41 +0000 (10:37 +0000)]
Eglot: restructure and overhaul documentation

* doc/misc/eglot.texi (Starting Eglot): Tweak.
(Using Eglot): Remove link to 'Eglot Variables'.
(Eglot Features): Rework.
(Eglot and Buffers): Rework.
(Eglot Commands): Rework.
(Customizing Eglot): New chapter.
(Customization Variables): Now contains what 'Eglot Variables'
used to contain.
(Other Variables): New section.
(More Customization): New section.
(...elsewhere...): Apply 'fill-paragraph'.

(cherry picked from commit 9e4b626f7eea788966a1ad92d4af76f8b0a2573f)

3 weeks agoEglot: symbol highlighting now done in eldoc-documentation-functions
João Távora [Fri, 24 Jan 2025 22:51:54 +0000 (22:51 +0000)]
Eglot: symbol highlighting now done in eldoc-documentation-functions

Even though highlighting the thing at point isn't really producing
documentation at point, theory and practice have shown that using
eldoc-documentation-functions for this is a feasible way to avoid
reimplementing all the idle timer logic for such functionality.

In fact, we were already using ElDoc for this purpose, but this commit
makes it so the new eglot-highlight-eldoc-function is a first class
citizen in eldoc-documentation-functions, so users can manipulate it if
so desired.

* lisp/progmodes/eglot.el (eglot--managed-mode): Use
eglot-highlight-eldoc-function
(eglot-hover-eldoc-function): Don't mix highlighting with hover.
(eglot-highlight-eldoc-function): Rename and rework from
eglot--highlight-piggyback

(cherry picked from commit 60166a419f601b413db86ddce186cc387e8ec269)

3 weeks agoFix previous commit for Changing Window Layouts
Martin Rudalics [Tue, 28 Jan 2025 09:00:50 +0000 (10:00 +0100)]
Fix previous commit for Changing Window Layouts

* doc/lispref/windows.texi (Changing Window Layouts): Remove wrong
example.  Change some indentations.

(cherry picked from commit 33827bed049e348da7544489903c7d6870f1500a)

3 weeks agoFix frame-visible-p for tty root frames
Gerd Möllmann [Tue, 28 Jan 2025 03:37:56 +0000 (04:37 +0100)]
Fix frame-visible-p for tty root frames

* src/frame.c (Fframe_visible_p): Don't unconditionally return t for tty
root frames.

(cherry picked from commit d60198d7a49acd8cd2c250625ac57deef484cee2)

3 weeks agoAvoid some make_formatted_string mallocs
Paul Eggert [Tue, 28 Jan 2025 01:15:47 +0000 (17:15 -0800)]
Avoid some make_formatted_string mallocs

* src/alloc.c (make_formatted_string):
Grow the local buffer from 64 to MAX_ALLOCA bytes.

(cherry picked from commit 1f1088188e8b9319f60141a093431f1f85c2b03c)

3 weeks agoMake vmessage a bit safer
Paul Eggert [Tue, 28 Jan 2025 01:13:02 +0000 (17:13 -0800)]
Make vmessage a bit safer

* src/xdisp.c (vmessage): Avoid undefined behavior if
FRAME_MESSAGE_BUF_SIZE (f) is zero, or if doprnt generates output
containing only encoding errors.  Although it’s not clear whether
either is possible, it is better to be safe.  Also, clarify via a
new local message_bufsize.

(cherry picked from commit 8e7588a2675655b88dc3ac5b7ed46ab6f1b891ec)

3 weeks agoAvoid printing NUL characters in 'message' (bug#75900)
Pip Cet [Mon, 27 Jan 2025 21:06:27 +0000 (13:06 -0800)]
Avoid printing NUL characters in 'message' (bug#75900)

* src/xdisp.c (vmessage): Increase buffer size to fit an extra
multibyte character.  On buffer overflow, drop the last multibyte
character to determine an accurate byte length.

(cherry picked from commit 8812f526cfb145e00ee4cb74eac05b25953da02c)

3 weeks agoFix buffer overflows in doprnt (bug#75900)
Pip Cet [Mon, 27 Jan 2025 21:05:07 +0000 (13:05 -0800)]
Fix buffer overflows in doprnt (bug#75900)

* src/doprnt.c (doprnt): Clear rest of buffer on multibyte overflow.
Always decrement bufsize when writing a byte.

(cherry picked from commit 0ed913cf46a8b07a39b065216272a7aa07123282)

3 weeks agodoprnt %X support
Paul Eggert [Mon, 27 Jan 2025 21:01:47 +0000 (13:01 -0800)]
doprnt %X support

* src/doprnt.c (doprnt): Also support %X, since callers
now use %X.

(cherry picked from commit 9b2e230c063f3e716c08a31685e16dff91130f4d)

3 weeks agoDon't use obsolete face variables in lisp-mode.el
Stefan Kangas [Mon, 27 Jan 2025 21:48:28 +0000 (22:48 +0100)]
Don't use obsolete face variables in lisp-mode.el

* lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-1)
(lisp-cl-font-lock-keywords-1, lisp-el-font-lock-keywords-2)
(lisp-cl-font-lock-keywords-2): Don't use obsolete face variables.

(cherry picked from commit ba60fa3deaa030eb4815caa8c180ac841709e86a)

3 weeks ago; Skip commit 29c6dad78db6d599108612f120cd0fb1fb18e105
Eshel Yaron [Thu, 30 Jan 2025 18:08:30 +0000 (19:08 +0100)]
; Skip commit 29c6dad78db6d599108612f120cd0fb1fb18e105

3 weeks ago; Skip commit 2d386fc4490c8e61ed05384ec486ef0d5e7164b1
Eshel Yaron [Thu, 30 Jan 2025 18:08:28 +0000 (19:08 +0100)]
; Skip commit 2d386fc4490c8e61ed05384ec486ef0d5e7164b1

3 weeks agoFix clicking in child frames with GPM
jared [Sun, 26 Jan 2025 22:43:51 +0000 (14:43 -0800)]
Fix clicking in child frames with GPM

* src/term.c (handle_one_term_event): Store child frame
coordinates in event.

(cherry picked from commit 5eae7f5227c7789dea45cef26fec17c057024670)

3 weeks ago; Fix workaround for xt-mouse-tests
Gerd Möllmann [Mon, 27 Jan 2025 09:21:08 +0000 (10:21 +0100)]
; Fix workaround for xt-mouse-tests

* lisp/xt-mouse.el (xterm-mouse-event): For running this in batch mode,
fix computation of x and y.

(cherry picked from commit 59050c3e8c500e216ec7214195c9441ecb4a031c)

3 weeks agoIn Elisp manual document new functions for changing window layouts
Martin Rudalics [Mon, 27 Jan 2025 09:06:51 +0000 (10:06 +0100)]
In Elisp manual document new functions for changing window layouts

* doc/lispref/windows.texi (Changing Window Layouts): New section
to document the new functions for changing window layouts.
* doc/lispref/elisp.texi (Top): Add entry for new section.

(cherry picked from commit 827dfe5a72f36cb6b61b435a85d50ac725616a09)

3 weeks ago; Fix byte-compilation warnings
Stefan Kangas [Mon, 27 Jan 2025 07:50:35 +0000 (08:50 +0100)]
; Fix byte-compilation warnings

(cherry picked from commit d2ffa0fa488fcfec26c042d30d125915eb558444)

3 weeks agoPacify -Wanalyzer-use-of-uninitialized-value
Paul Eggert [Mon, 27 Jan 2025 07:04:21 +0000 (23:04 -0800)]
Pacify -Wanalyzer-use-of-uninitialized-value

With ‘configure --enable-gcc-warnings’,
gcc (GCC) 14.2.1 20250110 (Red Hat 14.2.1-7) on x86-64
complained, as it apparently did not want to assume that enum
variables have one of the listed values.
Work around the problem by using tables rather than
switch statements.  This gives up a little static
checking but I don’t see any other easy way to pacify
GCC without disabling the warnings entirely.
* src/pdumper.c (dump_fwd_int, dump_fwd_bool, dump_fwd_obj)
(dump_fwd_buffer_obj, dump_fwd_kboard_obj):
Last arg is now void const * so that these functions’ addresses
can all be put into the same array.
(dump_fwd, dump_anonymous_allocate_posix, dump_map_file_posix):
Use an array rather than a switch.
(mem_prot_posix_table): New static constant table.

(cherry picked from commit 1ed769a3cb753a86badba8a2878fa788a6fdc1f8)

3 weeks agoFix unlikely eassert failure in invalid_radix_integer
Paul Eggert [Mon, 27 Jan 2025 06:15:50 +0000 (22:15 -0800)]
Fix unlikely eassert failure in invalid_radix_integer

* src/lread.c (invalid_radix_integer):
Simplify by using sprintf with a big-enough buffer.

(cherry picked from commit a5c47258ffe6d037e3e3c3665ca82a18661cc82c)

3 weeks agoFix unlikely eassert failure in xg_set_widget_bg
Paul Eggert [Mon, 27 Jan 2025 06:15:50 +0000 (22:15 -0800)]
Fix unlikely eassert failure in xg_set_widget_bg

* src/gtkutil.c (xg_set_widget_bg): Simplify by using
sprintf with a big-enough buffer.

(cherry picked from commit f809302fe5543e20ff7f06a81c263fd29f3ff995)

3 weeks agoFix unlikely eassert failure in pgtk_enumerate_devices
Paul Eggert [Mon, 27 Jan 2025 06:15:50 +0000 (22:15 -0800)]
Fix unlikely eassert failure in pgtk_enumerate_devices

* src/pgtkterm.c (pgtk_enumerate_devices): Prefer
make_formatted_string to snprintf + build_string + eassert, as
it’s simpler and won’t crash Emacs if the eassert fails.

(cherry picked from commit 901659bb7046bef4ca10490cf47644fb2bc6d753)

3 weeks agoMinor format_string tuneup
Paul Eggert [Mon, 27 Jan 2025 06:15:50 +0000 (22:15 -0800)]
Minor format_string tuneup

* src/comp.c (format_string): Prefer strcpy to doing things by hand
in a place where strcpy is easier to read, generates
more-efficient code, and similar parts of Emacs do strcpy.

(cherry picked from commit f8b8dddce90f5cbf6ca0be2e72b4e11cdcf581fe)

3 weeks agoIgnore -fanalyzer-null-argument in pgtkterm.c
Paul Eggert [Mon, 27 Jan 2025 06:15:49 +0000 (22:15 -0800)]
Ignore -fanalyzer-null-argument in pgtkterm.c

* src/pgtkterm.c: Ignore -Wanalyzer-null-dereference.
I don’t have time to look into all the diagnostics,
but the ones I checked seemed to be false alarms with
gcc -std=gnu23 on x86-64, and we are ignoring this
diagnostic in other modules.  This is GCC 14.2.1
20250110 (Red Hat 14.2.1-7).

(cherry picked from commit 8d8272d02e38ee3624cd3f16767f3c60fb3383ea)