Commit graph

261 commits

Author SHA1 Message Date
Jens Schmidt
86e8f31505 Silence macro expansion during completion at point
* lisp/emacs-lisp/macroexp.el (macroexp-inhibit-compiler-macros): Add
variable.
(macroexp--compiler-macro): Inspect that new variable and, if it is
non-nil, return the input form unchanged.
* lisp/progmodes/elisp-mode.el (elisp--local-variables): Silence
messages.  Avoid compiler macros.  (Bug#58148)
2023-10-05 14:00:36 -04:00
Alan Mackenzie
f931cebce7 Insert symbol `debug' into two condition-case handlers
This fixes bug#65622.  Also correct a mismatch between a
function to which advice is added, and that from which it is
removed.

* lisp/emacs-lisp/macroexp.el (internal-macroexpand-for-load):
Add a `debug' to the condition-case handler for `error', so
that a useful backtrace will be produced on a macro expansion
error.

* lisp/progmodes/elisp-mode.el (elisp--local-variables): Add
`debug' to a condition-case handler, as above.  In the
advice-remove call, give the same function, macroexpand-1, as
in the corresponding advice-add call.
2023-09-20 15:51:17 +00:00
Stefan Monnier
ecb1e6c713 (elisp--local-variables): Fix recent regression
While at it, make it work when completing code within `eval-when-compile`
and friends, where it failed in sometimes spectacular ways.

* lisp/progmodes/elisp-mode.el (elisp--local-macroenv): New var.
(elisp--local-variables): Use it.  Also, advice `macroexpand-1` since
`macroexpand-all` doesn't use `macroexpand` any more.
(prin1-char): Remove redundant "" arg.
(elisp--eval-defun-1): Align the `eval` call to what's used in
`custom-initialize-set`.
2023-08-26 15:44:28 -04:00
Eli Zaretskii
3fc9793a26 Merge from origin/emacs-29
842dbf500e * Fix `batch-byte+native-compile' target directory.
8dbd5aa1ee Avoid crashes in 'display_count_lines' when current buffe...
47b4f4cf78 ; * doc/emacs/mini.texi (Completion Commands): Fix a typo...
78999d5213 Update csharp tree-sitter support due to upstream changes
556cb01b48 Substitute command keys in 'ielm-header' at use time
99367078e5 ; * etc/PROBLEMS: Add entry about XIM problems (bug#65205).
03e897c08f Fix rare crashes in redisplay due to problems with fontsets
b1ba06a1e4 Fix a typo in 'leuven-dark-theme.el'
e80a9dcabb ; * admin/git-bisect-start: Update failing commits
9091f42784 ; * admin/git-bisect-start: Update failing commits
344ac529ca ; * etc/PROBLEMS: Fix typo.
bccf848b26 Adapt Tramp test
71bc060e40 Properly expand the JSX indentation rules in 'js-ts-mode'
889cfb42ed * Add `emacs-lisp-native-compile' to easy-menu.
4535aafa8a * lisp/progmodes/elisp-mode.el (emacs-lisp-mode-menu): Si...
173af0cad5 * Introduce `emacs-lisp-native-compile'.
063d7d89d7 Fix the -x switch in non-X builds
5a7fb0b39b Document that `set-mouse-color' does not work everywhere
d06fc72496 ; * doc/emacs/dired.texi (Misc Dired Features): Fix last ...
97b8ac376b Fix the effects and documentation of 'dired-free-space'
75c72e59f6 ; Fix typo
6d11b7b300 Fix cross-reference to eldoc in eglot manual
913e50aba6 Add native-compilation to Emacs Lisp mode menu
b93107c20b Fix emacs-lisp-native-compile-and-load eln target directo...
2023-08-12 13:50:38 -04:00
Andrea Corallo
889cfb42ed * Add `emacs-lisp-native-compile' to easy-menu.
* lisp/progmodes/elisp-mode.el (emacs-lisp-mode-menu): Add menu
item for emacs-lisp-native-compile.
2023-08-10 10:39:14 +02:00
Andrea Corallo
4535aafa8a * lisp/progmodes/elisp-mode.el (emacs-lisp-mode-menu): Simplify condition. 2023-08-10 10:34:01 +02:00
Andrea Corallo
173af0cad5 * Introduce `emacs-lisp-native-compile'.
* lisp/progmodes/elisp-mode.el (emacs-lisp-native-compile): New command.
(emacs-lisp-native-compile-and-load): Make use of.
2023-08-10 10:32:02 +02:00
Eli Zaretskii
913e50aba6 Add native-compilation to Emacs Lisp mode menu
* lisp/progmodes/elisp-mode.el (emacs-lisp-mode-menu): Add menu
item for emacs-lisp-native-compile-and-load.
2023-08-09 17:35:24 +03:00
Mattias Engdegård
6b9510d94f Prefix syntax for ,@ in elisp-mode (bug#44418)
* lisp/progmodes/elisp-mode.el (elisp-mode-syntax-propertize):
Use prefix syntax for ,@ to avoid the @ becoming part of a symbol
that follows.
* test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-with-normal-env):
Propertise inserted Lisp code to keep the test working.
2023-06-21 18:00:26 +02:00
Eli Zaretskii
acfd261a61 Merge from origin/emacs-29
0d8b69e0ad Don't ding when completion succeeded
f11e2d3699 ; * admin/git-bisect-start: Update failing commits
9855a3ea74 ; * src/xdisp.c (redisplay_tool_bar): Fix a typo in a com...
f4ee696b88 Improve documentation of color-related functions
90eadc3e23 Revert "* package.el (package--get-activatable-pkg): Pref...
65f355ea0a ; Update my mail address
a3a69ec234 Fix connection-local user options handling (bug#63300)
240803cc3e Document 'startup-redirect-eln-cache'
026afb2298 ; * etc/PROBLEMS: Entry about crashes due to anti-virus (...
bcc222251e Fix `emacs-lisp-native-compile-and-load' for C-h f (bug#5...
07c8211ca3 Add 'infer' as a keyword to typescript-ts-mode (bug#63880)
dd2d8ff2f5 ; * etc/NEWS: Mention the issue with PGTK on WSL (bug#633...
fa8135f891 Revert changes to the order in which package descs are lo...
27fcfa2c0a ; * etc/NEWS: Improve instructions for grammar libraries.
2a84ab905c Handle point in last file-name component in minibuffer co...
05f25238b7 Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/...
4bc043ff45 Avoid asking redundant question in emacsbug.el
2eadf328d0 * test/infra/Dockerfile.emba (emacs-base): Don't install ...
583ba1db7e typescript-ts-mode: Add a rule for function_signature

# Conflicts:
#	etc/NEWS
#	lisp/minibuffer.el
2023-06-10 06:42:43 -04:00
Andrea Corallo
bcc222251e Fix `emacs-lisp-native-compile-and-load' for C-h f (bug#58314)
* lisp/emacs-lisp/comp.el (comp-write-bytecode-file): New function
spilling code from `batch-byte+native-compile'.
(batch-byte+native-compile): Make use of.
* lisp/progmodes/elisp-mode.el
(emacs-lisp-native-compile-and-load): Produce the elc file and ask
to have it loaded.
2023-06-06 12:21:43 +02:00
Stefan Kangas
8179555730 Merge from origin/emacs-29
bd07cec844 Fix regression in Fido mode (bug#62015)
0e3c7ac13d * Fix `emacs-lisp-native-compile-and-load' for (bug#61917)
4a7e657389 * lisp/emacs-lisp/comp.el (comp-prettyformat-insn): Fix (...
8a8a994cfa Revert "Fix configuration of webp libraries"
de4277af00 Fix configuration of webp libraries
2023-03-07 06:30:10 +01:00
Andrea Corallo
0e3c7ac13d * Fix `emacs-lisp-native-compile-and-load' for (bug#61917)
* lisp/progmodes/elisp-mode.el (emacs-lisp-native-compile-and-load):
Don't load if no compialtion happened.
2023-03-06 17:29:36 +01:00
Stefan Kangas
580bb8f46c Merge from origin/emacs-29
3cae0e3d96 python-ts-mode: Fix single-quote string fontification
68d753e371 ; * etc/NEWS: Fix typos.
ab0cc4e781 Fix infloop in bidi.c
3b8b23f66d ; Fix doc string of 'emacs-lisp-byte-compile'

# Conflicts:
#	etc/NEWS
2023-02-26 06:30:12 +01:00
Eli Zaretskii
3b8b23f66d ; Fix doc string of 'emacs-lisp-byte-compile'
* lisp/progmodes/elisp-mode.el (emacs-lisp-byte-compile): Doc
fix.  (Bug#61784)
2023-02-25 15:51:04 +02:00
Eric Abrahamsen
cac13e3605 Help Elisp xref recognize defclass parent classes
* lisp/progmodes/elisp-mode.el (elisp--xref-infer-namespace):
Handle defclass parents (bug#61640).

* test/lisp/progmodes/elisp-mode-tests.el (elisp-mode-infer-namespace):
New case in the test.
2023-02-20 03:01:41 +02:00
Andrea Corallo
8d8464bd5a Rename native-comp-deferred-compilation into native-comp-jit-compilation
* src/comp.c (maybe_defer_native_compilation, syms_of_comp):
	Rename native-comp-deferred-compilation into
	native-comp-jit-compilation.

	* lisp/subr.el (native-comp-deferred-compilation): Mark
	native-comp-deferred-compilation as obsolete.

	* lisp/startup.el (native-comp-deferred-compilation)
	(normal-top-level): Rename native-comp-deferred-compilation into
	native-comp-jit-compilation.

	* lisp/progmodes/elisp-mode.el
	(emacs-lisp-native-compile-and-load): Likewise.

	* lisp/emacs-lisp/generate-lisp-file.el
	(generate-lisp-file-trailer): Likewise.
2023-02-13 17:04:22 +01:00
Andrea Corallo
c0681cd347 Revert "Add new variable 'inhibit-native-compilation'"
This reverts commit 5fec9182db.
2023-02-13 10:19:31 +01:00
Andrea Corallo
3969a34fa1 Revert "Rename to inhibit-automatic-native-compilation"
This reverts commit f97993ee66.
2023-02-13 10:15:33 +01:00
Eli Zaretskii
cae528457c ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
Juri Linkov
4bc9fe33af Rename 'elisp-eval-buffer' to 'elisp-eval-region-or-buffer' (bug#59350)
* lisp/progmodes/elisp-mode.el (elisp-eval-region-or-buffer):
Rename recently added command 'elisp-eval-buffer' to support active region.
(emacs-lisp-mode-map, lisp-interaction-mode-map): Rebind 'C-c C-e'
from elisp-eval-buffer to elisp-eval-region-or-buffer.
2022-11-20 20:10:45 +02:00
Stefan Kangas
ba485eb949 ; Fix typos 2022-11-18 16:02:19 +01:00
Eli Zaretskii
5df1fd19ba ; * lisp/progmodes/elisp-mode.el (eval-defun): Doc fix. 2022-11-17 12:34:06 +02:00
Eli Zaretskii
69d1278527 ; Fix some doc strings in elisp-mode.el
* lisp/progmodes/elisp-mode.el (elisp-enable-lexical-binding)
(elisp--local-variables-1, elisp--expect-function-p)
(eval-print-last-sexp, eval-last-sexp, elisp--eval-defun-1)
(eval-defun, elisp--eldoc-last-data, elisp-eldoc-funcall)
(elisp-eldoc-var-docstring)
(elisp-eldoc-var-docstring-with-value)
(elisp-get-fnsym-args-string)
(elisp--highlight-function-argument): Doc fixes.
2022-11-15 19:58:52 +02:00
Stefan Monnier
13d6e8fa54 cl-generic: Fix advertised-calling-convention declarations
* lisp/emacs-lisp/cl-generic.el (cl-generic-define-method):
Preserve the `advertised-calling-convention`, if any (bug#58563).

* lisp/subr.el (declare): Warn when we hit this.

* lisp/emacs-lisp/byte-run.el (get-advertised-calling-convention): New fun.
* lisp/progmodes/elisp-mode.el (elisp-get-fnsym-args-string):
* lisp/help-fns.el (help-fns--signature):
* lisp/emacs-lisp/bytecomp.el (byte-compile-fdefinition): Use it.

* test/lisp/emacs-lisp/cl-generic-tests.el (cl-generic-tests--acc): New fun.
(cl-generic-tests--advertised-calling-convention-bug58563): New test.
2022-10-16 12:01:47 -04:00
Lars Ingebrigtsen
f97993ee66 Rename to inhibit-automatic-native-compilation
* src/comp.c (maybe_defer_native_compilation):
(syms_of_comp):
* lisp/subr.el (native-comp-deferred-compilation):
* lisp/startup.el (inhibit-native-compilation):
(normal-top-level):
* lisp/progmodes/elisp-mode.el (emacs-lisp-native-compile-and-load):
* lisp/emacs-lisp/comp.el (comp-trampoline-compile):
* etc/NEWS:
* doc/lispref/compile.texi (Native-Compilation Variables): Rename
inhibit-native-compilation to inhibit-automatic-native-compilation.
2022-10-03 19:50:03 +02:00
Lars Ingebrigtsen
5fec9182db Add new variable 'inhibit-native-compilation'
* doc/lispref/compile.texi (Native-Compilation Variables):
Document it.

* lisp/startup.el (normal-top-level): Set
inhibit-native-compilation from environment variable.

* lisp/subr.el (native-comp-deferred-compilation): Make obsolete.

* lisp/emacs-lisp/comp.el (comp-trampoline-compile): Don't write
trampolines to disk.

* lisp/progmodes/elisp-mode.el
(emacs-lisp-native-compile-and-load): Adjust.

* src/comp.c (syms_of_comp): New variable
inhibit-native-compilation.
(maybe_defer_native_compilation): Use it.
2022-10-03 15:26:13 +02:00
Daniel Martín
dbec115948 Fix instrumented eval-defun not printing "Edebug:" to the echo area
* lisp/progmodes/elisp-mode.el (elisp--eval-defun): Determine if we're
instrumenting a function and call eval-region with PRINTFLAG set to
nil if so (Bug#50245).

* test/lisp/progmodes/elisp-mode-tests.el
(eval-defun-prints-edebug-when-instrumented): Add a new test.
2022-08-25 14:37:36 +02:00
Stefan Monnier
3b72b47cbd * lisp/progmodes/elisp-mode.el (elisp--local-variables-1): Fix bug#50034
Don't burp if the arg list of a function is not actually a list.
2022-08-23 10:16:05 -04:00
Stefan Kangas
b7e867b841 Make point-at-eol and point-at-bol obsolete
* lisp/subr.el (point-at-eol, point-at-bol): Make XEmacs compat
aliases obsolete in favor of `pos-bol'/'line-beginning-position' or
'pos-eol'/'line-end-position'.  Update callers.
Ref: https://lists.gnu.org/r/emacs-devel/2022-08/msg00853.html
2022-08-23 04:54:57 +02:00
Lars Ingebrigtsen
3a4c408a7b Fix elisp-byte-compile-buffer requirements
* lisp/progmodes/elisp-mode.el (elisp-byte-compile-buffer):
Require bytecomp so that byte-compile-dest-file-function is
defined.  (The byte compiler didn't catch this, because it's
defined in bytecomp.)
2022-07-01 13:19:31 +02:00
Lars Ingebrigtsen
a6a92b8e4d Also add elisp-eval/byte-compile-buffer to lisp-interaction-mode
* lisp/progmodes/elisp-mode.el (lisp-interaction-mode-map): Also
add elisp-eval-buffer and elisp-byte-compile-buffer to this map.
2022-06-30 14:46:04 +02:00
Lars Ingebrigtsen
6f773186e3 Fix typo in previous elisp-byte-compile-buffer change
* lisp/progmodes/elisp-mode.el (elisp-byte-compile-buffer): Make
warnings point to the correct place.
2022-06-30 14:29:49 +02:00
Lars Ingebrigtsen
3015af515e Fix up warning links in elisp-byte-compile-buffer
* lisp/progmodes/elisp-mode.el (elisp-byte-compile-buffer): Make
warnings point to the correct place.
2022-06-30 14:29:12 +02:00
Lars Ingebrigtsen
7b9d755b81 Add new commands to elisp mode for eval/compilation
* lisp/progmodes/elisp-mode.el (emacs-lisp-mode-map): Add new
keystrokes.
(elisp-eval-buffer, elisp-byte-compile-file)
(elisp-byte-compile-buffer): New commands.
2022-06-30 12:00:49 +02:00
Lars Ingebrigtsen
4d41bb7847 Improve the eval-defun doc string
* lisp/progmodes/elisp-mode.el (eval-defun): Document what the
command actually does w.r.t. finding a form to evaluate
(bug#47747).
2022-06-29 13:05:46 +02:00
Lars Ingebrigtsen
2f346b0ab1 Re-fix build warnings about subr-x defsubsts
* lisp/term/haiku-win.el (require):
* lisp/progmodes/elisp-mode.el (require):
* lisp/isearch.el (require): Require subr-x at compile time, since
these use defsubsts/macros from there.

* lisp/emacs-lisp/subr-x.el (string-empty-p): Move from here...
* lisp/simple.el (string-empty-p): ... to here.  This is to help
with a build problem where files.el is using the defsubst, but
requiring subr-x.el at compile time leads to load errors.
2022-06-25 12:20:05 +02:00
Lars Ingebrigtsen
b6238a26c9 Revert "Fix some byte-compilation warnings about subr-x"
This reverts commit cd479aa8bd.

This led to build failures when doing bootstraps.
2022-06-25 00:19:23 +02:00
Lars Ingebrigtsen
cd479aa8bd Fix some byte-compilation warnings about subr-x
* lisp/term/haiku-win.el (require):
* lisp/replace.el (require):
* lisp/progmodes/elisp-mode.el (require):
* lisp/isearch.el (require):
* lisp/files.el (require): Require subr-x when compiling.
2022-06-24 14:35:23 +02:00
Stefan Kangas
81e58d1ce5 Merge from origin/emacs-28
a772c0b852 ; Fix typos: prefer US spelling.

# Conflicts:
#	doc/misc/modus-themes.org
2022-06-24 13:52:51 +02:00
Stefan Kangas
a772c0b852 ; Fix typos: prefer US spelling. 2022-06-23 22:03:50 +02:00
Dmitry Gutov
cb0c697e21 elisp-completion-at-point: Replace last usage of 'read'
* lisp/progmodes/elisp-mode.el (elisp-completion-at-point):
Replace the last remaining usage of 'read' (bug#55491).
2022-06-11 03:45:46 +03:00
Lars Ingebrigtsen
efe9940567 Revert "Give ,@ a prefix syntax in elisp-mode"
This reverts commit d003848b5e.

This leads to hangs in edebug-tests.
2022-06-08 14:27:14 +02:00
Lars Ingebrigtsen
d003848b5e Give ,@ a prefix syntax in elisp-mode
* lisp/progmodes/elisp-mode.el (elisp-mode-syntax-propertize):
Give ,@ a prefix syntax so that we can properly identify symbols
that follow it, i.e., ,@foo (bug#44418).
2022-06-07 20:28:05 +02:00
Štěpán Němec
47e0b86611 ; Fix up doc of recent elisp-eldoc-var-docstring-with-value addition 2022-05-26 10:58:22 +02:00
Štěpán Němec
8420d7cce7 Add elisp-eldoc-var-docstring-with-value function
* lisp/progmodes/elisp-mode.el
(elisp-eldoc-var-docstring-with-value): New function (bug#55096).
2022-05-24 14:55:03 +02:00
Lars Ingebrigtsen
9e338b7456 Make completion in emacs-lisp-mode intern fewer symbols
* lisp/progmodes/elisp-mode.el (elisp-completion-at-point): Don't
intern the string before point just to check whether we're looking
at `ignore-error' (bug#55491).
2022-05-20 02:02:12 +02:00
Eli Zaretskii
6308f0738d Fix Flymake diagnostics reporting in non-UTF-8 locales
* lisp/progmodes/elisp-mode.el (elisp-flymake-byte-compile)
(elisp-flymake--batch-compile-for-flymake): Bind I/O encoding to
UTF-8, instead of relying on the locale's defaults.  This is
needed because ELisp files use UTF-8 by default, but Flymake
doesn't know about that, since it isn't specific to ELisp.
2022-05-19 11:00:36 +03:00
Eli Zaretskii
640e52d8fa ; Fix mistakes in 'declare function' forms
* lisp/progmodes/gdb-mi.el (tooltip-show):
* lisp/vc/vc-git.el (grep-expand-template):
* lisp/cedet/semantic/imenu.el (pulse-momentary-highlight-one-line):
* lisp/mail/feedmail.el (smtpmail-via-smtp):
* lisp/mail/rmail.el (rmail-mime-entity-truncated):
* lisp/mail/rmailsum.el (rmail-cease-edit):
* lisp/progmodes/gud.el (speedbar-toggle-line-expansion)
(speedbar-edit-line):
* lisp/autoinsert.el (sgml-tag):
* lisp/comint.el (url-host, url-type, url-filename):
* lisp/progmodes/elisp-mode.el (xref-make, xref-item-location):
* lisp/vc/vc-hooks.el (vc-responsible-backend):
* lisp/cedet/semantic/complete.el (tooltip-show):
* lisp/doc-view.el (tooltip-show):
* lisp/follow.el (mwheel-scroll):
* lisp/term/pgtk-win.el (pgtk-set-resource):
* lisp/progmodes/cperl-mode.el (Info-find-node):
* lisp/lpr.el (print-region-function):
* lisp/w32-fns.el (w32-version, w32-read-registry):
* lisp/emacs-lisp/checkdoc.el (ispell-correct-p, checkdoc-dired):
* lisp/progmodes/xref.el (apropos-parse-pattern):
* lisp/cus-edit.el (apropos-parse-pattern):
* lisp/obsolete/gs.el (x-change-window-property):
* lisp/x-dnd.el (x-change-window-property):
* lisp/xwidget.el (make-xwidget):
* lisp/transient.el (info, Man-find-section, Man-next-section)
(Man-getpage-in-background):
* lisp/frame.el (x-device-class, pgtk-device-class):
* lisp/textmodes/texinfo.el (flymake--log-1):
* lisp/term/x-win.el (x-internal-focus-input-context): Fix
'declare function' errors uncovered by 'check-declare'.
2022-05-14 16:19:12 +03:00
Lars Ingebrigtsen
499f5f062e Make elisp-mode-syntax-propertize tighter to reflect syntax
* lisp/progmodes/elisp-mode.el (elisp-mode-syntax-propertize): ?\N
and #s are case sensitive, so don't case-fold.  (And adjust regexps.)
2022-05-06 22:13:41 +02:00