Alan Mackenzie [Thu, 6 Apr 2023 09:14:56 +0000 (09:14 +0000)]
CC Mode: Miscellaneous coding fixes in c-forward-type
This fixes bug #62339.
* lisp/progmodes/cc-engine.el (c-forward-type): In the implicit int handling,
respect the setting of the parameter stop-at-end. In the case "normal
identifier", insert a missing (c-forward-syntactic-ws); this fixes the bug.
Here, correct the wrong return value `prefix' to t.
Alan Mackenzie [Wed, 5 Apr 2023 13:02:12 +0000 (13:02 +0000)]
CC Mode: Fix fontification problems shown by test file templates-20.cc
Also fix one problem evident in test file decls-10.cc.
* lisp/progmodes/cc-engine.el (c-brace-stack-at): Bind
c-record-type-identifiers to nil to prevent called functions recording
identifiers spuriously.
(c-forward-<>-arglist-recur): Revert the ill-advised optimization from autumn
2022 which attempted to avoid re-marking c-type text properties inside angle
bracket arglists.
(c-forward-decl-or-cast-1): Accept the semicolon at the end of "t8 * id;" as
sufficient evidence to fontify as a declaration (not a multiplication).
* lisp/progmodes/cc-fonts.el (c-font-lock-c++-using): No longer fontify the
last component of foo::bar with c-reference-face-name.
Yuan Fu [Sat, 1 Apr 2023 23:22:50 +0000 (16:22 -0700)]
Modify chevron icons and add some more
* etc/images/symbols/chevron_left_16.svg:
* etc/images/symbols/chevron_right_16.svg: Make them shorter so that
they appear roughly the same size as up and down chevrons.
* etc/images/symbols/cross_circle_fill_16.svg:
* etc/images/symbols/heart_16.svg:
* etc/images/symbols/heart_fill_16.svg:
* etc/images/symbols/heart_half_16.svg:
* etc/images/symbols/minus_circle_fill_16.svg:
* etc/images/symbols/plus_circle_fill_16.svg: New icons.
João Távora [Sun, 2 Apr 2023 22:31:10 +0000 (23:31 +0100)]
Eglot: load built-in GNU ELPA dependencies explicitly
Because of outstanding bug#62576, it's way to easy for users to get
confused by the M-x package-install process for Eglot.
Whenever an Eglot release depends on a new version of a GNU ELPA :core
package which is _also_ provided built-in, M-x package-install will
install that dependency, but will not always load it on top of the
built-in one.
The solution is to not use "require" for now. This may potentially
lead to double "loads", but that should in principle be idempotent.
João Távora [Wed, 29 Mar 2023 18:30:04 +0000 (19:30 +0100)]
Eglot: improve caching in eglot-completion-at-point
When answering the :textDocument/completion request, LSP servers
provide a :isIncomplete flag in the response, which allows Eglot to
know if "further typing should result in recomputing [the completions]
list.
If :isIncomplete is false (i.e. the full set was returned), Eglot
caches the response in a global variable eglot--capf-cache that
persists for the duration of the "completion session", taken to be the
interval between two calls to completion-in-region-mode.
If the cache has been set, and Eglot detects that "further typing" has
happened, it is safe to use the cache instead of making a request to
the server.
Thus eglot--capf-cache-flush, added to completion-in-region-mode-hook,
is used to flush this cache. Since the popular Company completion
package doesn't use completion-in-region-mode, eglot--capf-cache-flush
is also added to its company-after-completion-hook.
* lisp/progmodes/eglot.el (eglot--managed-mode): Set
'completion-in-region-mode-hook and company-after-completion-hook.
(eglot--capf-cache): New variable.
(eglot--capf-cache-flush): New function.
(eglot-completion-at-point): Rework.
João Távora [Wed, 29 Mar 2023 21:48:54 +0000 (22:48 +0100)]
Eglot: remove hacky advice of jsonrpc-request
The vast majority of Eglot sync requests to the server need to inform
the server of any pending changes to the buffer beforehand, so that
the server has up-to-date information to do its job.
But doing so at the expense of ugly advice of jsonrpc-request is ill
advised. Introduce eglot--request helper instead and use that.
Use this opportunity to conduct a review of Eglot sync requests and
come to the conclusion that all need to send any changes beforehand.
Nevertheless, an IMMEDIATE kwarg to eglot--request was added to
bypassing this.
* lisp/progmodes/eglot.el
(eglot--request): New helper.
(eglot-shutdown)
(eglot-execute-command)
(eglot-workspace-configuration)
(eglot--signal-textDocument/willSave)
(eglot--workspace-symbols)
(eglot--lsp-xrefs-for-method)
(xref-backend-apropos)
(eglot-format)
(eglot-completion-at-point)
(eglot-imenu)
(eglot-rename)
(eglot-code-actions): Use eglot--request.
Jim Porter [Fri, 31 Mar 2023 02:38:30 +0000 (19:38 -0700)]
Use the 'interactive' spec to set arguments for 'eshell-command'
* lisp/eshell/eshell.el (eshell-read-command): New function...
(eshell-command): ... use it. Additionally, require the COMMAND
argument, and rename ARG to TO-CURRENT-BUFFER.
Jim Porter [Fri, 31 Mar 2023 02:31:30 +0000 (19:31 -0700)]
Fix using background commands in 'eshell-command'
This regressed due to the patch for bug#53715, which changed how
Eshell pipelines return the processes in the pipeline (bug#62556).
* lisp/eshell/esh-cmd.el (eshell-parse-command): When creating
background commands, wrap the process(es) in a cons cell whose CAR is
':eshell-background'. This lets us use fewer heuristics...
(eshell-eval-command): ... here. Additionally, keep the result and
the incomplete delimiter separate.
* lisp/eshell/eshell.el (eshell-command): Check ':eshell-background'
and use a more-robust method for setting the output target.
* test/lisp/eshell/eshell-tests.el (eshell-test/eshell-command/simple)
(eshell-test/eshell-command/pipeline)
(eshell-test/eshell-command/background)
(eshell-test/eshell-command/background-pipeline): New tests.
Stefan Monnier [Sun, 2 Apr 2023 21:54:02 +0000 (17:54 -0400)]
lisp/simple.el (inhibit-auto-fill): New var
* lisp/simple.el (inhibit-auto-fill): New var.
(internal-auto-fill): Obey it.
(newline): Use it instead of binding `auto-fill-function`, so
as to avoid messing up the state if something wants to enable/disable
`auto-fill-mode` during the course of the let binding (bug#62419).
Stefan Monnier [Sun, 2 Apr 2023 21:45:58 +0000 (17:45 -0400)]
src/eval.c: Fix bug#62419
Yup, almost 40 years after ELisp first combined them, buffer-local
and let bindings still don't work quite right :-(
The "automatically buffer-local if set" semantics should follow the
principle that it becomes buffer-local iff the var's current binding
refers to the top-level/global/non-let binding.
Jim Porter [Sat, 1 Apr 2023 04:32:44 +0000 (21:32 -0700)]
; Add tests for synchronous processes in Eshell
Normally, Eshell only uses synchronous processes on MS-DOS, so this is
hard to test. To get around this, let the tests explicitly request
synchronous processes.
* lisp/eshell/esh-proc.el (eshell-supports-asynchronous-processes):
New variable...
(eshell-gather-process-output): ... use it, and remove some incorrect
code updating Eshell's internal markers (the async code path doesn't
do this, so neither should the sync path).
* lisp/eshell/esh-cmd.el (eshell-execute-pipeline): Use
'eshell-supports-asynchronous-processes'.
* test/lisp/eshell/esh-proc-tests.el
(esh-proc-test/emacs-command): New function.
(esh-proc-test/emacs-echo, esh-proc-test/emacs-upcase): New variables.
(esh-proc-test/synchronous-proc/simple/interactive)
(esh-proc-test/synchronous-proc/simple/command-result)
(esh-proc-test/synchronous-proc/pipeline/interactive)
(esh-proc-test/synchronous-proc/pipeline/command-result): New tests.
Jim Porter [Sun, 19 Mar 2023 02:18:28 +0000 (19:18 -0700)]
Avoid shadowing variables in some Eshell command forms
* lisp/eshell/esh-cmd.el (eshell-rewrite-for-command): Make
'for-items' an uninterned symbol.
(eshell-as-subcommand): Correct docstring.
(eshell-do-command-to-value): Mark obsolete.
(eshell-command-to-value): Move binding of 'value' outside of the
macro's result, and remove call to 'eshell-do-command-to-value'.
Andrew G Cohen [Thu, 9 Mar 2023 08:05:31 +0000 (16:05 +0800)]
Reset 'gnus-current-window-configuration' on edit-form exit.
* lisp/gnus/gnus.el: New variable gnus-prev-cwc.
* lisp/gnus/gnus-art.el (gnus-article-edit-mode):
New local variable gnus-prev-cwc.
(gnus-article-edit-article): Store original
gnus-current-window-configuration as gnus-prev-cwc.
(gnus-article-edit-done, gnus-article-edit-exit): Restore
gnus-current-window-configuration from gnus-prev-cwc.
* lisp/gnus/gnus-eform.el (gnus-edit-form-mode):
New local variable gnus-prev-cwc.
(gnus-edit-form): Store original
gnus-current-window-configuration as gnus-prev-cwc.
(gnus-edit-form-done, gnus-edit-form-exit): Restore
gnus-current-window-configuration from gnus-prev-cwc.
Andrew G Cohen [Sun, 13 Mar 2022 23:59:25 +0000 (07:59 +0800)]
Use completion when mark limiting in gnus summary buffers
* lisp/gnus/gnus-sum.el (gnus-summary-limit-to-marks)
(gnus-summary-limit-exclude-marks): Use completing-read to complete on
marks in the current summary buffer.
Andrew G Cohen [Sun, 13 Mar 2022 23:47:39 +0000 (07:47 +0800)]
Track article while moving between gnus groups
* lisp/gnus/gnus-sum.el (gnus-current-move-article): New variable to
track article while moving.
(gnus-summary-move-article): Set gnus-current-move-article when
moving/copying/crossposting or respooling.
Use memcpy for loading unaligned words on platforms where this can be
done efficiently. This guards against problems arising from future
compiler autovectorisation improvements that might cause instructions
that require aligned addresses to be emitted, and should also work
with an address sanitiser enabled.
* src/fns.c (HAVE_FAST_UNALIGNED_ACCESS): Only define when optimising.
(load_unaligned_size_t): New.
(Fstring_lessp): Use load_unaligned_size_t.
* src/lisp.h (UNALIGNED_LOAD_SIZE): Remove now unused macro.
Bob Rogers [Fri, 31 Mar 2023 07:57:32 +0000 (09:57 +0200)]
Allow old input to include continuation lines in shell-mode
* lisp/shell.el (shell-get-old-input-include-continuation-lines): New
defcustom (default nil).
(shell-get-old-input): New function. Like
'comint-get-old-input-default' but include all continuation lines if
'shell-get-old-input-include-continuation-lines' is non-nil.
(shell-mode): Install shell-get-old-input. (Bug#61069)
João Távora [Thu, 30 Mar 2023 22:52:27 +0000 (23:52 +0100)]
Eglot: unbreak eglot-extend-to-xref on w32
Because of a drive-letter casing mismatch between 'buffer-file-name'
and the return value of 'url-generic-parse-url', the hash-table test
'equal' in 'eglot-current-server' failed.
This failed to recognize that the file xref landed us on really is
managed by the language server that facilitated that jump.
The function w32-long-file-name seems to convert "C:/Users/" to
"c:/Users" consistently and so is a good addition to
eglot--uri-to-path.
* lisp/progmodes/eglot.el (eglot--uri-to-path): Use
w32-long-file-name.
Eli Zaretskii [Thu, 30 Mar 2023 13:34:41 +0000 (16:34 +0300)]
; Clarify documentation of 'cursor' text property
* doc/lispref/text.texi (Special Properties): Clarify that
'cursor' property is only considered when the overlay hides buffer
text on display. (Bug#62540)
Yuan Fu [Fri, 24 Mar 2023 23:45:15 +0000 (16:45 -0700)]
Add two typescript-ts-mode faces (bug#62429)
* lisp/progmodes/typescript-ts-mode.el:
(typescript-ts-mode-jsx-tag-face)
(typescript-ts-mode-jsx-attribute-face): New faces.
(typescript-ts-mode--font-lock-settings): Use new faces.
(tsx-ts-mode): Mention the new faces in the docstring.
Shynur [Wed, 29 Mar 2023 17:29:17 +0000 (01:29 +0800)]
Fix scrolling window when point moves up
This fixes the case when both 'scroll-conservatively' and
'scroll-step' are customized to non-default values.
* src/xdisp.c (try_scrolling): Fix precedence between
'scroll-step' and 'scroll-conservatively' when scrolling with
'previous-line'. (Bug#62530)
Andrea Corallo [Wed, 29 Mar 2023 16:02:30 +0000 (18:02 +0200)]
Comp fix calls to redefined primtives with op-bytecode (bug#61917)
* test/src/comp-tests.el (61917-1): New test.
* src/comp.c (syms_of_comp): New variable.
* lisp/loadup.el: Store primitive arities before dumping.
* lisp/emacs-lisp/comp.el (comp--func-arity): New function.
(comp-emit-set-call-subr): Make use of `comp--func-arity'.
Michael Albinus [Wed, 29 Mar 2023 18:22:04 +0000 (20:22 +0200)]
Rework zeroconf integration into tramp-gvfs.el
* lisp/net/tramp-gvfs.el (tramp-gvfs-enabled): Do not check for
:system bus.
(tramp-gvfs-mounttypes): New defconst.
(tramp-gvfs-maybe-open-connection): Use it.
(top): Call zeroconf only when :system bus is available.
(unwind-protect PROT-FORM) UNWIND-FORMS ; also oops
or entirely forgotten for that matter. Warning about this makes
sense, and the warning can always be silenced by removing the
`unwind-protect` altogether if it shouldn't be there in the first
place.
Dmitry Gutov [Tue, 28 Mar 2023 22:08:55 +0000 (01:08 +0300)]
ruby-ts-mode: Rehash which nodes should be treated as sexps
* lisp/progmodes/ruby-ts-mode.el (ruby-ts-mode): Recognize smaller
syntactic elements as sexps too (bug#62416). Also do that for
heredocs, regexps and symbol arrays. But drop binary expressions
(including assignments) since they led to non-intuitive behavior.
Jim Porter [Tue, 21 Mar 2023 00:25:54 +0000 (17:25 -0700)]
Avoid parsing some Eshell forms when performing completion
During completion, we want to evaluate most Eshell forms
(e.g. variable references), but skip others (e.g. globbing,
subcommands). For globbing, we want to pass the literal glob to
Pcomplete so it can use the glob for selecting completion candidates.
For subcommands (including Lisp forms), we especially want to avoid
evaluation, since they can produce arbitary side effects! (Bug#50470)
* lisp/eshell/esh-cmd.el (eshell-allow-commands): New variable...
(eshell-commands-forbidden): New error...
(eshell-named-command, eshell-lisp-command): ... use them.
* lisp/eshell/em-cmpl.el (eshell-complete--eval-argument-form):
Disallow command forms and handle errors ourselves.
(eshell-complete-parse-arguments): Don't parse glob characters.
* test/lisp/eshell/em-cmpl-tests.el
(em-cmpl-test/parse-arguments/unevaluated-subcommand)
(em-cmpl-test/parse-arguments/unevaluated-lisp-form)
(em-cmpl-test/parse-arguments/unevaluated-inner-subcommand)
(em-cmpl-test/file-completion/glob, em-cmpl-test/command-completion)
(em-cmpl-test/subcommand-completion): New tests.
(em-cmpl-test/parse-arguments/pipeline): Remove superfluous
let-binding.
(em-cmpl-test/file-completion/after-list): Use a list variable rather
than a subexpression; the latter is no longer evaluated during
completion.
(em-cmpl-test/lisp-function-completion): Check "$(func)" syntax.
Jim Porter [Tue, 21 Mar 2023 00:25:24 +0000 (17:25 -0700)]
Simplify parsing subcommands slightly
This mainly reduces some overly-deep indentation, but also fixes some
minor issues with the "$<subcmd>" form: it unnecessarily added " >
TEMP" (we already set this later via 'eshell-create-handles'), and it
didn't properly unescape inner double quotes.
Eli Zaretskii [Tue, 28 Mar 2023 18:08:12 +0000 (21:08 +0300)]
Improve documentation of 'read-choice' and related symbols
* doc/lispref/commands.texi (Reading One Event):
* lisp/subr.el (read-char-choice-use-read-key, read-char-choice)
(read-char-choice-with-read-key, y-or-n-p-use-read-key): Improve
documentation of these functions and variables.
Eli Zaretskii [Tue, 28 Mar 2023 11:08:29 +0000 (14:08 +0300)]
; Fix incompatibility in 'display-buffer-assq-regexp'
* lisp/window.el (display-buffer-assq-regexp): Make it accept a
buffer's name again, as it did in Emacs 28. This makes computing
the buffer's name inside the function unnecessary.
(display-buffer): Always pass the buffer's name to
'display-buffer-assq-regexp'. (Bug#62417)
Jim Porter [Tue, 28 Mar 2023 03:58:55 +0000 (20:58 -0700)]
Fix expansion of globs that contain a ~USER reference
This regressed from the fix to bug#28064, and was discovered here:
<https://lists.gnu.org/archive/html/bug-gnu-emacs/2023-03/msg01744.html>.
* lisp/eshell/em-dirs.el (eshell-expand-user-reference): Let FILE be a
list, and move the implementation to...
(eshell-expand-user-reference-1): ... here.
* lisp/eshell/em-glob.el (eshell-add-glob-modifier): Remove special
handling for expanding user references; it's better to keep it in
"em-dirs.el".
Ken Brown [Sun, 26 Mar 2023 19:02:30 +0000 (15:02 -0400)]
Enable ASLR for dynamic libraries on Cygwin
This seems to avoid the fork failures described in etc/PROBLEMS
("Fork failures in a build with native compilation").
* lisp/treesit.el (treesit--install-language-grammar-1):
* lisp/emacs-lisp/comp.el (native-comp-driver-options): Add the
linker flag "-Wl,-dynamicbase" on Cygwin.
Stefan Monnier [Mon, 27 Mar 2023 21:16:59 +0000 (17:16 -0400)]
Merge from origin/emacs-29
edc460e3b6c Fix accidental backward-incompatible change (bug#62417) cbef1422fe3 ruby-ts-mode: Fix/simplify Imenu index generation a0d5fba74a6 (ruby-ts--align-chain): Use 'equal' to check for an exact...
Stefan Monnier [Mon, 27 Mar 2023 21:16:58 +0000 (17:16 -0400)]
Merge from origin/emacs-29
b08bf828605 ; Fix :version of the new defcustom d941666d859 ; Fix last change e19b7da7b09 Add 'eww-default-download-directory'. 564c26bdbeb ; Fix edebug spec for 'gv-define-simple-setter' (bug#62256)