1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-23 07:19:15 +00:00
Commit Graph

160567 Commits

Author SHA1 Message Date
Stefan Kangas
0c7024d0d9 * doc/misc/Makefile.in (INFO_COMMON): Add eglot. 2022-10-20 11:02:19 +02:00
João Távora
20d4477120 Remove spurious trailing ':' in doc/misc/eglot.texi
* doc/misc/eglot.texi (Customizing Eglot): Remove spurious ':'.
2022-10-19 13:23:14 +01:00
João Távora
7a551e9200 Tweak some node names in doc/misc/eglot.texi
"Shutting Down LSP Server" -> "Shutting Down LSP Servers"
"Setting Up LSP Server" -> "Setting Up LSP Servers"

* doc/misc/eglot.texi: Rework node names.
2022-10-19 13:21:40 +01:00
João Távora
c681f37478 More minor fixes to doc/misc/eglot.texi
Most, if not all of these, were previously discussed with Eli.

* doc/misc/eglot.texi (Setting Up LSP Server): Fix repetition of
"This variable".
(Setting Up LSP Server): Explain that single a running instance
supports multiple major modes.
(Starting Eglot, Eglot and Buffers): Correctly describe mode-line indication.
(Eglot Features): Suggest that company-mode is just one of the
possible packages.  Explain that Eglot arranges for the completion
package to "instantiate" snippets.  Could have used "expand".
Mention benefits of having the popular markdown-mode available.
(Eglot Commands): Explain how eglot-reconnect and
eglot-clear-status are useful.
(Eglot Variables): Clarify when eglot-autoreconnect is useful.
Clarify how eglot-sync-connect and eglot-connect-timeout relate to
each other.  Clarify semantics of
eglot-confirm-server-initiated-edits.
2022-10-18 14:46:27 +01:00
João Távora
b92a517493 Minor stylistic fixes to introduction of doc/misc/eglot.texi
* doc/misc/eglot.texi (title): Add "the".
(Top): Fix sentence structure in top-level
introduction.
2022-10-18 12:46:48 +01:00
Eli Zaretskii
3e5856b21a Add new Texinfo manual for the Eglot LSP client
* doc/misc/eglot.texi: New file.
2022-10-18 12:17:51 +01:00
Alan Mackenzie
baa39e4849 * lisp/progmodes/cc-defs.el Remove setting of inhibit-point-motion-hooks 2022-10-18 10:00:26 +00:00
Lars Ingebrigtsen
9c67e8e56d Regenerate ldefs-boot.el 2022-10-18 11:18:16 +02:00
Andrea Corallo
1a8015b837 * Prevent potential native compilation infinite recursions
* lisp/emacs-lisp/comp.el (comp-no-spawn): New var.
(comp-subr-trampoline-install, comp-final, comp-run-async-workers)
(comp--native-compile): Update.
2022-10-18 10:42:13 +02:00
Jim Porter
0954689cb3 ; Fix some invalid Eshell syntax in an example
* doc/misc/eshell.texi (Expansion):
* etc/NEWS: Fix invalid Eshell syntax.
2022-10-17 21:25:37 -07:00
Jim Porter
fd4992d356 Print the correct $PATH when Eshell's 'which' fails to find a command
* lisp/eshell/esh-cmd.el (eshell/which): Use 'eshell-get-path'
(bug#20008).
2022-10-17 18:48:52 -07:00
Jim Porter
cee1cbfd54 Improve handling of $PATH in Eshell for remote directories
* lisp/eshell/esh-util.el (eshell-path-env, eshell-parse-colon-path):
Make obsolete.
(eshell-path-env-list): New variable.
(eshell-connection-default-profile): New connection-local profile.
(eshell-get-path): Reimplement using 'eshell-path-env-list'; add
LITERAL-P argument.
(eshell-set-path): New function.

* lisp/eshell/esh-var.el (eshell-variable-aliases-list): Add entry for
$PATH.
(eshell-var-initialize): Add 'eshell-path-env-list' to
'eshell-subcommand-bindings'.

* lisp/eshell/esh-ext.el (eshell-search-path): Use 'file-name-concat'
instead of 'concat'.
(eshell/addpath): Use 'eshell-get-path' and 'eshell-set-path'.

* lisp/net/tramp-integration.el: Only apply Eshell hooks when
'eshell-path-env-list' is unbound.

* test/lisp/eshell/esh-var-tests.el
(esh-var-test/path-var/local-directory)
(esh-var-test/path-var/remote-directory, esh-var-test/path-var/set)
(esh-var-test/path-var/set-locally)
(esh-var-test/path-var-preserve-across-hosts): New tests.

* test/lisp/eshell/esh-ext-tests.el: New file.

* test/lisp/eshell/eshell-tests-helpers.el
(with-temp-eshell): Set 'eshell-last-dir-ring-file-name' to nil.
(eshell-tests-remote-accessible-p, eshell-last-input)
(eshell-last-output): New functions.
(eshell-match-output, eshell-match-output--explainer): Use
'eshell-last-input' and 'eshell-last-output'.

* doc/misc/eshell.texi (Variables): Document $PATH.

* etc/NEWS: Announce this change (bug#57556).
2022-10-17 18:48:52 -07:00
Jim Porter
7c41016fca Allow setting the values of variable aliases in Eshell
This makes commands like "COLUMNS=40 some-command" work as expected.

* lisp/eshell/esh-cmd.el (eshell-subcommand-bindings): Remove
'process-environment' from here...

* lisp/eshell/esh-var.el (eshell-var-initialize): ... and add to here,
along with 'eshell-variable-aliases-list'.
(eshell-inside-emacs): Convert to a 'defvar-local' to make it settable
in a particular Eshell buffer.
(eshell-variable-aliases-list): Make $?, $$, and $* read-only and
update docstring.
(eshell-set-variable): New function...
(eshell-handle-local-variables, eshell/export, eshell/unset): ... use
it.
(eshell/set, pcomplete/eshell-mode/set): New functions.
(eshell-get-variable): Get the variable alias's getter function when
appropriate and use a safer method for checking function arity.

* test/lisp/eshell/esh-var-tests.el (esh-var-test/set/env-var)
(esh-var-test/set/symbol, esh-var-test/unset/env-var)
(esh-var-test/unset/symbol, esh-var-test/setq, esh-var-test/export)
(esh-var-test/local-variables, esh-var-test/alias/function)
(esh-var-test/alias/function-pair, esh-var-test/alias/string)
(esh-var-test/alias/string/prefer-lisp, esh-var-test/alias/symbol)
(esh-var-test/alias/symbol-pair, esh-var-test/alias/export)
(esh-var-test/alias/local-variables): New tests.

* doc/misc/eshell.texi (Built-ins): Add 'set' and update 'unset'
documentation.
(Variables): Expand documentation of how to get/set variables.
2022-10-17 18:48:52 -07:00
Jim Porter
f1caa10f04 ; Obsolete 'eshell/define'
* lisp/eshell/esh-var.el (eshell/define): Make obsolete, and explain
its current state.

* doc/misc/eshell.texi (Built-ins): Remove 'define'.
2022-10-17 18:48:52 -07:00
Jim Porter
2c82530f47 ; Allow ignoring errors when calling 'eshell-match-command-output'
* test/lisp/eshell/eshell-tests-helpers.el
(eshell-match-command-output): New argument IGNORE-ERRORS.

* test/lisp/eshell/esh-var-tests.el
(esh-var-test/last-status-var-lisp-command)
(esh-var-test/last-status-var-lisp-form)
(esh-var-test/last-status-var-lisp-form-2): Ignore errors when calling
'eshell-match-command-output'.
2022-10-17 18:48:52 -07:00
Jim Porter
3cc356abfe Add helpers to dynamically assign connection-local values
* lisp/files-x.el (connection-local-criteria)
(connection-local-profile-name-for-setq): New variables.
(with-connection-local-variables-1): ... let-bind them here.
(connection-local-update-profile-variables)
(connection-local-profile-name-for-criteria): New functions.
(with-connection-local-application-variables, setq-connection-local):
New macros.

* test/lisp/files-x-tests.el: Require 'tramp-integration'
(files-x-test--variable5, remote-lazy-var): New variables.
(files-x-test-hack-connection-local-variables-apply): Expand checks.
(files-x-test-with-connection-local-variables): Remove
'hack-connection-local-variables-apply' check (it belongs in the above
test), and expand some other checks.
(files-x-test--get-lazy-var, files-x-test--set-lazy-var): New
functions.
(files-x-test-connection-local-update-profile-variables)
(files-x-test-setq-connection-local): New tests.

* doc/lispref/variables.texi (Connection Local Variables): Split into
two subsections and document the new features.

* etc/NEWS: Announce 'setq-connection-local'.
2022-10-17 18:48:52 -07:00
Jim Porter
1beb389e47 ; Remove over-quoting of :application values in connection-local variables
* test/lisp/files-x-tests.el (files-x-test--application)
(files-x-test--another-application):
* doc/lispref/variables.texi (Connection Local Variables): Remove
extra quotes.
2022-10-17 18:48:52 -07:00
Paul Eggert
f4442d49f6 Improve ‘random’ doc re nonces
* doc/lispref/numbers.texi (Random Numbers): Improve coverage of
random seed, entropy pools, and why one shouldn’t use ‘random’ for
nonces.  See Bug#58472.
2022-10-17 18:35:31 -07:00
Po Lu
0dbd1dbe7d Fix bug#58584
* src/xterm.c (x_handle_selection_monitor_event): Return if
selection event is one Emacs asked for.
(handle_one_xevent): In that case, drop the event and don't let
it reach GTK.
2022-10-18 08:53:43 +08:00
Dmitry Gutov
be3d9f717d ; Fix comment 2022-10-18 02:49:21 +03:00
Dmitry Gutov
5e77265523 Follow-up fixes for vc-default-checkin-patch
* lisp/vc/vc.el (vc-default-checkin-patch):
Call vc-revert-file on buffer-file-name (vc-backend failed on
relative name sometimes).  Delete the tmp dir after copying all
files back, not just the first one.  Bug#52349,
https://lists.gnu.org/archive/html/emacs-devel/2022-10/msg01446.html.
2022-10-18 02:35:05 +03:00
Alan Mackenzie
c2b79d9148 CC Mode: Don't fontify as types variables with the same names as struct tags
This fixes bug #58534.

* lisp/progmodes/cc-engine.el (c-forward-type): Only regard "struct" keywords
which create self contained types (e.g. C++'s "typename") as creating found
types.

* lisp/progmodes/cc-langs.el (c-self-contained-typename-kwds
(c-self-contained-typename-key): New language consts and variable.
2022-10-17 20:33:26 +00:00
Stefan Kangas
1e9341672d Prefer defvar-keymap in fortran.el
* lisp/progmodes/fortran.el (fortran-mode-map): Prefer
defvar-keymap.
2022-10-17 20:24:55 +02:00
Stefan Kangas
1dd6ad6990 Update version information in Gnus manual
* doc/misc/gnus.texi (Gnus Versions): Update with some information
from https://www.gnus.org/history.html
(Ma Gnus): Explain that Gnus is now developed together with
Emacs.  (Bug#58161)
2022-10-17 20:13:22 +02:00
Basil L. Contovounesios
dd7f1bb3a1 Silence recent comp-tests.el lexvar warnings
* test/lisp/emacs-lisp/comp-tests.el: Mark used native-compile
variables as special to pacify unknown lexvar warnings in the
default build.
(with-test-native-compile-prune-cache): Instrument macro arguments
for debugging and indent conventionally.  Reindent all callers.
(test-native-compile-prune-cache/dont-delete-in-parent-of-cache):
Simplify file name expansion.
2022-10-17 21:02:26 +03:00
Stefan Kangas
eff4a4f49a Improve native-compile-prune-cache messages
* lisp/emacs-lisp/comp.el (native-compile-prune-cache): Quote name of
pruned directory.
2022-10-17 15:28:25 +02:00
Stefan Kangas
40b734c500 Don't prune *.eln files in parent of eln-load-path
* lisp/emacs-lisp/comp.el (native-compile-prune-cache): Don't
prune *.eln files in parent directory of `native-comp-eln-load-path'.
* test/lisp/emacs-lisp/comp-tests.el
(test-native-compile-prune-cache/dont-delete-in-parent-of-cache):
New test.
2022-10-17 15:26:34 +02:00
Stefan Kangas
24b85b10e3 Add tests for native-compile-prune-cache
* test/lisp/comp-tests.el: New file.
2022-10-17 15:26:34 +02:00
Po Lu
abf683bb03 Fix pieces of code being too expensive over slow network connections
* lisp/menu-bar.el (menu-bar-edit-menu): Test buffer-read-only
before gui-backend-selection-exists-p.  This places the less
expensive condition before the more expensive one.
* src/xfns.c (compute_tip_xy): Use cached monitor attributes
whenever available.
(Fx_show_tip): Remove code that really did nothing.
(Fx_backspace_delete_keys_p): Do not download the entire keymap
from the server upon creating a frame.
* src/xmenu.c (create_and_show_popup_menu): Use
x_translate_coordinates_to_root.
(x_menu_show): Use x_translate_coordinates_to_root.
* src/xselect.c (Fx_selection_exists_p): If a temporary
selection owner can be found, use it.
* src/xterm.c (x_translate_coordinates_to_root)
(x_handle_selection_monitor_event, x_find_selection_owner): New
functions.  These functions try to avoid downloading data from
the X server in places that are called very often (i.e. during
tool bar updates.)
(handle_one_xevent): Handle selection notify events.  Also catch
some mistakes found.  Fetch all kinds of key names as well.
(x_create_special_window): New function.
(x_term_init, x_delete_display): Ask for all key names.  Also,
passively monitor selections that are given to
`x-selection-exists-p' during redisplay, so we do not have to
ask the server about them upon each redisplay.
(syms_of_xterm): New variable `x-fast-selection-list'.
* src/xterm.h (struct x_monitored_selection): New structure.
(X_INVALID_WINDOW): New define.
(struct x_display_info): New fields for selection monitoring.
Also, record the fixes extension base.
2022-10-17 21:00:09 +08:00
Lars Ingebrigtsen
b9aff5fdb8 Fix spurious "Compilation finished" native-comp messages
* lisp/emacs-lisp/comp.el (native--compile-async): Don't start the
async compilation if we didn't add anything.  This avoids spurious
"Compilation finished" messages in the *Async* buffer when it
turned out that all the files we considered nativecomping were
skipped.
2022-10-17 14:30:54 +02:00
Lars Ingebrigtsen
5176d00611 Avoid having the async compile log saying it's compiling loaddefs
* lisp/loadup.el (featurep): Define the hash table in nativecomp
builds (but not otherwise).  A more natural place to define this
would be in comp.el, but comp.el isn't loaded yet when we load the
.elc file that updates comp--no-native-compile.  We could change
the load order and move the definition to comp.el, though.

* lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Allow
inhibiting nativecomp earlier (bug#57627).

* lisp/emacs-lisp/comp.el (native-compile-async-skip-p): Use the data.
2022-10-17 10:48:20 +02:00
Stefan Kangas
44541c7854 Make `message-canlock-generate' faster
* lisp/gnus/message.el (message-canlock-generate): Improve performance
by several orders of magnitude.
2022-10-17 08:03:00 +02:00
Dmitry Gutov
4a6ad6e18f Add default implementation for 'checkin-patch'
* lisp/vc/vc.el (vc-default-checkin-patch):
Add default implementation for 'checkin-patch' (bug#52349).
The first attempt was here:
https://lists.gnu.org/archive/html/emacs-devel/2022-08/msg01464.html
2022-10-17 02:46:02 +03: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
kobarity
0e5fc2345d Move and rename Python completion ERTs
* test/lisp/progmodes/python-tests.el
(python-shell-completion-at-point-1)
(python-shell-completion-at-point-native-1)
(python-completion-at-point-1)
(python-completion-at-point-2, python-completion-at-point-pdb-1)
(python-completion-at-point-native-1)
(python-completion-at-point-native-2)
(python-completion-at-point-native-with-ffap-1)
(python-completion-at-point-native-with-eldoc-1): Renamed tests
(bug#58565).
2022-10-16 15:26:49 +02:00
Stefan Kangas
494ccec94e Prefer defvar-keymap in ansi-osc.el
* lisp/ansi-osc.el (ansi-osc-hyperlink-map): Prefer defvar-keymap.
2022-10-16 13:53:37 +02:00
Stefan Kangas
d4244ec8cc Make help-for-help echo key on failure
* lisp/help-macro.el (make-help-screen): Echo key on failure.
2022-10-16 13:03:59 +02:00
Stefan Kangas
77d5be5877 Bind "home"/"end" in help-for-help
* lisp/help-macro.el (make-help-screen): Bind "home"/"end" keys to
scrolling up/down.
2022-10-16 13:03:59 +02:00
Stefan Kangas
82257951e9 Don't ding when exiting help-for-help with C-g
* lisp/help-macro.el (make-help-screen): Don't ding on "C-g".
2022-10-16 13:03:59 +02:00
Lars Ingebrigtsen
0164d5e71d Clear misleading message in help-quit-or-quick
* lisp/help.el (help-quit-or-quick): Clear misleading message
(bug#58542).
2022-10-16 11:53:03 +02:00
Philip Kaludercic
cb968b48cb
; * lisp/vc/vc.el (vc-prepare-patch): Fix pluralisation 2022-10-16 11:37:51 +02:00
Philip Kaludercic
d8624ad519
; * lisp/vc/vc.el (vc-prepare-patch): Remove 'exit-recursive-edit' 2022-10-16 11:37:50 +02:00
kobarity
cb975c6183 Fix invalid search bound error in python-shell-completion-at-point
* lisp/progmodes/python.el (python-shell-completion-at-point): Add
check if point is before line-start.
* test/lisp/progmodes/python-tests.el (python-shell-completion-shell-buffer-1)
(python-shell-completion-shell-buffer-native-1): New tests
(bug#58548).
2022-10-16 11:26:29 +02:00
Daniel Martín
f9726408f6 Signal an error in dictionary lookup if there's no word at point
* lisp/net/dictionary.el (dictionary-lookup-definition): Signal an
error when there is no word at point (bug#58552).
2022-10-16 11:25:17 +02:00
kobarity
45aabe6eda Disable completion when PDB is active in Python Shell buffer
* lisp/progmodes/python.el (python-shell-completion-at-point): Disable
completion in Python buffer when PDB is active in Python Shell buffer.
* test/lisp/progmodes/python-tests.el (python-shell-completion-pdb-1):
New test (bug#58562).
2022-10-16 11:15:30 +02:00
Stefan Kangas
07222447b6 Merge from origin/emacs-28
067361f3a2 ; Improve documentation of 'C-M-i'
fdb6f7cf26 ; Fix documentation of 'comp-enable-subr-trampolines'
be30369e01 ; Avoid incorrect indentation in an @example.
4bd3dd505e Document how to control where the *.eln files are written
b7d7c2d9e9 Add cross-reference to alternative syntaxes for Unicode

# Conflicts:
#	doc/emacs/custom.texi
2022-10-16 08:27:16 +02:00
Stefan Kangas
c4c4a60f71 Expand 'random' testsuite
* test/src/fns-tests.el (ert): Require.
(fns-tests-random): Expand test.
2022-10-16 08:23:55 +02:00
Po Lu
cf19743aca Adapt last change to Haiku port
* src/haikuterm.c (haiku_frame_up_to_date):
(haiku_clear_frame):
(haiku_update_begin):
(haiku_flush):
(haiku_flush_dirty_back_buffer_on):
(haiku_read_socket):
* src/haikuterm.h (struct haiku_output):
(FRAME_COMPLETE_P): Synchronize logic with X.
2022-10-16 06:19:12 +00:00
Eli Zaretskii
067361f3a2 ; Improve documentation of 'C-M-i'
* doc/emacs/programs.texi (Symbol Completion): Remove redundant
text, rephrase, and improve indexing and markup.
2022-10-16 09:10:14 +03:00
Po Lu
da6778d1ce Fix multiple sources of flicker under X
Fix three kinds of flicker.  The first is if you do:

  (while t (sit-for 1) (redraw-display))

and press a key, the frame will turn blank until you C-g.  The
second is where handling async input happens in the middle of
drawing and causes a buffer flip to happen.  The third is where
unmapping the hourglass window causes exposures.

* src/dispnew.c (redraw_frame): Garbage the frame if it is a
window system frame.
* src/xterm.c (x_update_begin): Clear complete flag.
(x_flip_and_flush, XTframe_up_to_date): Set complete flag.
(x_show_hourglass): Fix hourglass window class.
(flush_dirty_back_buffer_on): Rename to
x_flush_dirty_back_buffer_on.
(x_flush_dirty_back_buffer_on): Check if the frame is complete
before trying to flip.
(handle_one_xevent): Flush frames in a more detailed fashion.
* src/xterm.h (struct x_output): New flag `complete'.
(FRAME_X_COMPLETE_P): New macro.
2022-10-16 14:02:31 +08:00