1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-21 06:55:39 +00:00
Commit Graph

92830 Commits

Author SHA1 Message Date
Stefan Kangas
eb5a453a58 Set buffers-menu-max-size to 15 unconditionally
* lisp/menu-bar.el (buffers-menu-max-size): Set the default value to
15 unconditionally.  (Bug#64398)
2023-10-05 20:17:53 +02:00
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
Robert Pluim
095d64577c Use key-translate instead of keyboard-translate
As a consequence of the discussions in Bug#65735, move to using the
new key-translate function instead of the deprecated
keyboard-translate.

For future maintainers: ?\C-? or ?\177 do not mean "DEL" with
key-translate, you have to use "DEL".

* lisp/simple.el (normal-erase-is-backspace-mode): Use key-translate.
* lisp/term/bobcat.el (terminal-init-bobcat): Use key-translate.
2023-10-05 17:55:32 +02:00
Mattias Engdegård
ca9f0e75b1 Omit the omake compilation-mode rule by default
It keeps interfering with other rules, slowing everything down a
little bit and makes it harder to add or change other rules.  The rule
is still there and can easily be re-enabled by those who need it.

* etc/NEWS: Announce.
* lisp/progmodes/compile.el (compilation-error-regexp-alist):
Exclude `omake`.
* test/lisp/progmodes/compile-tests.el
(compile-tests--test-regexps-data):
Actually test the `cucumber` rule. Remove the `omake` test case.
(compile-test-error-regexps):
Test `omake` here.  Test other rules without `omake` included.
2023-10-05 12:25:57 +02:00
Spencer Baugh
5b019360d6 Make newly-created smerge-diff-buffers read-only
Buffers name *vc-diff* are usually created by vc, which makes them
read-only.  If we create such a buffer, let's make it read-only too.
If the buffer already exists, though, don't change that since the user
might have deliberately made it writable.

* lisp/vc/smerge-mode.el (smerge-diff): Make newly-created
smerge-diff-buffers read-only. (bug#64071)
2023-10-05 11:04:47 +03:00
Eli Zaretskii
a9c4994776 ' Improve wording of compilation-error messages
* lisp/progmodes/compile.el (compilation-next-error): Improve
wording of user-error text.  (Bug#65713)
2023-10-05 11:01:41 +03:00
Paul W. Rankin
60f3e9f5c9 Improve find-sibling-rules option type
* lisp/files.el (find-sibling-rules): More helpful rules.
2023-10-05 10:45:31 +03:00
Eli Zaretskii
511acc2ed8 ; * lisp/emacs-lisp/cl-print.el (cl-print-to-string-with-limit): Typo. 2023-10-04 20:04:53 +03:00
Juri Linkov
fbfdd1e0e3 * lisp/menu-bar.el (menu-bar-project-menu): Improve menu items.
Remove ellipsis from menu items that don't read arguments from the minibuffer.
2023-10-03 20:13:58 +03:00
Alan Mackenzie
849de5aa1a Correct the `cond' forms in cl-print-string-with-limit
In this function, calling with limit bound to t will cause an
error in any of the cond forms which set print-length, etc.
Correct them!

* lisp/emacs-lisp/cl-print.el (cl-print-string-with-limit):
Amend the doc string.  In the cond forms in the bindings for
print-length, etc., test the value t first.  Amend those for
print-length and print-level also to test for a zero value of
limit.
2023-10-03 10:22:26 +00:00
Michael Albinus
21c81f49e7 Ensure, that Tramp uses GNU style emulation when calling ls-lisp
* lisp/net/tramp-sh.el (tramp-sh-handle-insert-directory): Reorganize.

* lisp/net/tramp.el (ls-lisp-dirs-first, ls-lisp-emulation)
(ls-lisp-ignore-case, ls-lisp-verbosity): Declare.
(tramp-handle-insert-directory): Bind `ls-lisp-*' options.  Call
`ls-lisp-set-options'.
2023-10-03 10:02:52 +02:00
Jim Porter
498d31e9f0 Support Eshell iterative evaluation in the background
This really just generalizes Eshell's previous support for iterative
evaluation of a single current command to a list of multiple commands,
of which at most one can be in the foreground (bug#66066).

* lisp/eshell/esh-cmd.el (eshell-last-async-procs)
(eshell-current-command): Make obsolete in favor of...
(eshell-foreground-command): ... this
(eshell-background-commands): New variable.
(eshell-interactive-process-p): Make obsolete.
(eshell-head-process, eshell-tail-process): Use
'eshell-foreground-command'.
(eshell-cmd-initialize): Initialize new variables.
(eshell-add-command, eshell-remove-command)
(eshell-commands-for-process): New functions.
(eshell-parse-command): Make 'eshell-do-subjob' the outermost call.
(eshell-do-subjob): Call 'eshell-resume-eval' to split this command
off from its parent forms.
(eshell-eval-command): Use 'eshell-add-command'.
(eshell-resume-command): Use 'eshell-commands-for-process'.
(eshell-resume-eval): Take a COMMAND argument.  Return
':eshell-background' form for deferred background commands.
(eshell-do-eval): Remove check for 'eshell-current-subjob-p'.  This is
handled differently now.

* lisp/eshell/eshell.el (eshell-command): Wait for all processes to
exit when running synchronously.

* lisp/eshell/esh-mode.el (eshell-intercept-commands)
(eshell-watch-for-password-prompt):
* lisp/eshell/em-cmpl.el (eshell-complete-parse-arguments):
* lisp/eshell/em-smart.el (eshell-smart-display-move): Use
'eshell-foreground-command'.

* test/lisp/eshell/esh-cmd-tests.el
(esh-cmd-test/background/simple-command)
(esh-cmd-test/background/subcommand): New tests.
(esh-cmd-test/throw): Use 'eshell-foreground-command'.

* test/lisp/eshell/eshell-tests.el (eshell-test/queue-input): Use
'eshell-foreground-command'.

* test/lisp/eshell/em-script-tests.el
(em-script-test/source-script/background): Make the test script more
complex.

* test/lisp/eshell/eshell-tests.el
(eshell-test/eshell-command/pipeline-wait): New test.

* doc/misc/eshell.texi (Bugs and ideas): Remove implemented feature.
2023-10-02 20:49:41 -07:00
Jim Porter
8f2cfe15a7 Don't print subjob messages when running an Eshell script in the background
* lisp/eshell/esh-proc.el (eshell-subjob-messages): New variable...
(eshell-record-process-object)
(eshell-remove-process-entry): ... check it.

* lisp/eshell/em-script.el (eshell-source-file): Set
'eshell-subjob-messages' to nil.

* lisp/eshell/esh-cmd.el (eshell-do-subjob): Set
'eshell-subjob-messages' to t.

* test/lisp/eshell/em-script-tests.el
(em-script-test/source-script/background): New test.
2023-10-02 20:49:40 -07:00
F. Jason Park
3979f83cd6 Inhibit slash commands in erc--input-review-functions
* lisp/erc/erc.el (erc--input-review-functions): Add new review
function `erc--inhibit-slash-cmd-insertion'.
(erc--check-prompt-input-functions): Move
`erc--check-prompt-input-for-multiline-command' above
`erc--check-prompt-input-for-multiline-blanks'.
(erc--inhibit-slash-cmd-insertion): New "review" function to suppress
insertion of prompt input for slash commands.  Doesn't affect "meta"
slash commands like /SAY.
(erc--send-input-lines): Don't bother checking whether message is a
command.  Instead, trust verdict handed down by message-prep and
review functions.  This opens the door to optional insertion for
debugging purposes or when echoing command lines in a shell-like
fashion.
* test/lisp/erc/erc-tests.el (erc-send-whitespace-lines): clean up
portion dealing with trimming slash commands.  (Bug#66073)
2023-10-02 17:31:29 -07:00
F. Jason Park
a3c6ed0e36 Improve erc-warn-about-blank-lines behavior
* etc/ERC-NEWS: Mention more detailed feedback when option
`erc-warn-about-blank-lines' is non-nil.
* lisp/erc/erc-common.el (erc--input-split): Add `abortp' slot to
allow a premature exit while validating prompt input.
* lisp/erc/erc.el (erc-warn-about-blank-lines): Clarify meaning of
"blank lines" in doc string, and mention interaction with
companion option `erc-send-whitespace-lines'.
(erc-inhibit-multiline-input): Fix inaccurate description in doc
string.
(erc--input-review-functions): Move
`erc--discard-trailing-multiline-nulls' to end of list, after
`erc--run-input-validation-checks' so that the latter doesn't have to
resplit the original input string in order to issue feedback.
(erc--blank-in-multiline-input-p): Remove unused internal function
originally slated to be part of ERC 5.6.
(erc--check-prompt-input-for-something): New trivial validation
function to check if the input is empty.
(erc--count-blank-lines): New function that tallies up the number of
blank and whitespace-only lines in the current input.  One downside of
this design is that this function's conclusions aren't shared with
`erc--discard-trailing-multiline-nulls', which must decide on its own
how many lines to strip.
(erc--check-prompt-explanation): New variable.
(erc--check-prompt-input-for-multiline-blanks): Rework significantly
to provide more informative messages and more sensible behavior for
common cases with respect to relevant option values.
(erc--check-prompt-input-functions): Add new validation function
`erc--check-prompt-for-something'.
(erc--run-input-validation-checks): Set `abortp' slot of
`erc--input-split' when hooks return a non-string, rather than
generate an unhelpful fallback message.  Also print a message when
the variable `erc--check-prompt-explanation' is non-nil.
(erc-send-current-line): When the `abortp' slot of the current
`erc--input-split' object is non-nil, forgo normal input processing.
This fixes a regression in 5.6-git, which previously emitted an error
message when it should have just exited the command.
(erc--discard-trailing-multiline-nulls): Always run, regardless of
`erc-send-whitespace-lines', and leave a blank line behind when
stripping a message consisting of only blank lines.
(erc--run-send-hooks): Always run hooks and surrounding logic rather
than only when hooks are populated.
* test/lisp/erc/erc-tests.el (erc--refresh-prompt): Add assertion and
use default value for `erc--input-review-functions'.
(erc-ring-previous-command): Use default value for
`erc--input-review-functions' and ensure `erc-current-nick' does not
error.
(erc--blank-in-multiline-input-p): Remove obsolete test.
(erc--check-prompt-input-functions): Update expected message.
(erc--discard-trailing-multiline-nulls, erc--count-blank-lines): New
tests.
(erc-tests--check-prompt-input--expect,
erc-tests--check-prompt-input-messages): New helper variables.
(erc--check-prompt-input-for-multiline-blanks,
erc--check-prompt-input-for-multiline-blanks/explanations): New tests.
(erc-send-whitespace-lines): Expect hook-processing logic to pad empty
lines instead of deferring to `erc-send-input-line-function'.
(Bug#66073)
2023-10-02 17:31:29 -07:00
F. Jason Park
8db56235cb Prefer ticks/hz pairs for some ERC timestamps on 29+
* lisp/erc/erc-compat.el (erc-compat--current-lisp-time): New macro to
prefer ticks/hz pairs on newer Emacs versions because stamps of this
form are easier to compare at a glance when used as values for text
properties.
* lisp/erc/erc-stamp.el (erc-stamp--current-time): Use compat macro.
(Bug#60936)
2023-10-02 17:31:28 -07:00
F. Jason Park
06fb8b7620 Exempt text-scale-mode from erc-scrolltobottom-all
* lisp/erc/erc-goodies.el (erc--scrolltobottom-post-ignore-commands):
New variable, a list of commands that should not trigger a re-scroll.
(erc--scrolltobottom-on-post-command): Don't `recenter' when the
current command appears in `erc--scrolltobottom-post-ignore-commands'.
This fixes a bug that prevented managed recentering when disabling
`text-scale-mode'.  Thanks to Corwin Brust for reporting this.  Note
that this doesn't address any fill-related alignment issues involving
`text-scale-mode'.  Nor does it address likely problems involving the
erroneous restoration of point after the insertion of invisible lines.
(erc-keep-place-enable, erc-keep-place-mode): Adjust hook depth to
fall within reserved interval.
(erc-keep-place-indicator-enable, erc-keep-place-indicator-mode,
erc--keep-place-indicator-on-global-module): Lower hook depth to fall
within reserved interval.  Note that this hook has a buffer-local
value, so all members run after their global counterparts.
(Bug#66073)
2023-10-02 17:28:01 -07:00
F. Jason Park
ffd5d2f38d Fix wrong "User" column count in erc-ibuffer
(ibuffer-make-column-erc-members): Show tally of all server users for
non-target buffers, and show correct count for targets.  Thanks to
Mattias Engdegård for reporting this.
(erc-ibuffer-limit-map): Use "new" `define-ibuffer-filter'
API.  (Bug#66191)
2023-10-02 17:23:29 -07:00
F. Jason Park
019baf2859 Remove newline from erc-fill regexp
* lisp/erc/erc-fill.el (erc-fill): Remove newline from character
alternative in pattern for skipping past blank and whitespace-only
lines.  It seems that as of e61a0398 "regex.c: Consolidate the two
analysis functions", Emacs no longer sees a newline-dollar sequence as
matching an empty line.  Also lose `save-match-data', which doesn't
appear to serve any purpose here.
2023-10-02 17:21:26 -07:00
Po Lu
ad2bb3e9f3 Properly translate touch screen events into mouse drag ones
* doc/lispref/commands.texi (Drag Events): Correct misleading
example form and reword subsequent elaboration.

* lisp/touch-screen.el (touch-screen-handle-point-up)
<mouse-drag>: Set posns representing drag start and terminus to
mouse position lists, in lieu of pairs between windows and posns
employed previously.
2023-10-02 15:38:30 +08:00
Jim Porter
862e5effbf ; Adjust Eshell regression tests to avoid SIGPIPE
In batch mode, SIGPIPEs can cause Emacs to abort (bug#66186).

* lisp/eshell/esh-io.el (eshell-output-object-to-target): Update
comment.

* test/lisp/eshell/esh-proc-tests.el
(esh-proc-test/pipeline-connection-type/middle)
(esh-proc-test/pipeline-connection-type/last): Use '(ignore)', since
that causes no output when called with no arguments, thus avoiding a
risky 'process-send-string'.
2023-10-01 13:11:09 -07:00
Stefan Kangas
6b2219cd27 ; Add several "duplicate value in cond" FIXMEs
* lisp/gnus/gnus-cloud.el (gnus-cloud-decode-data):
* lisp/org/org.el (org-read-date-analyze):
* lisp/org/ox-html.el (org-html-latex-fragment):
Add several "duplicate value in `cond`" FIXMEs.
Found by Mattias Engdegård <mattias.engdegard@gmail.com>.
Ref: https://debbugs.gnu.org/51368#51
2023-10-01 19:00:26 +02:00
James Thomas
5d9dbf17cf Exclude current buffer from eww-switch-to-buffer
* lisp/net/eww.el (eww-switch-to-buffer): Exclude current buffer from
the completion list to avoid an extra cycling keystroke.  (Bug#65914)
2023-10-01 18:51:18 +02:00
Stefan Kangas
3df581972f ; Simplify recent change in cl-defstruct
* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Use bound-and-true-p.
Suggested by Robert Pluim <rpluim@gmail.com>.
2023-10-01 18:45:36 +02:00
Visuwesh
f0abc9bc0d Fix doc-view conversion indicator for svg images
* lisp/doc-view.el (doc-view-pdf->png-converter-mupdf): Show the
correct pdf->svg indicator when producing svg images.  (Bug#62713)
2023-10-01 14:58:48 +02:00
Ivan Sokolov
a96dc984dd Sort package-selected-packages on save 2023-10-01 14:25:13 +02:00
Michael Albinus
c9efecf1b0 Improve handling of "--dired" in Tramp
* lisp/net/tramp-sh.el (tramp-bsd-unames): New defconst.
(tramp-sh-handle-file-ownership-preserved-p)
(tramp-open-connection-setup-interactive-shell)
(tramp-get-ls-command): Use it.
(tramp-sh-handle-insert-directory): Improve handling of "--dired".
2023-10-01 11:27:41 +02:00
Michael Albinus
3fe843c684 ; Add missing GNU ELPA :core package statement 2023-10-01 11:27:01 +02:00
Mauro Aranda
7caa3f5499 Fix indentation in perl-mode (Bug#35925)
* lisp/progmodes/perl-mode.el (perl--format-regexp): New defconst.
(perl--end-of-format-p): New function.
(perl-continuation-line-p): Use it.
(perl-calculate-indent): Use it.  Make the lines of the formlist stay
at column 0.

* test/lisp/progmodes/cperl-mode-resources/cperl-bug-35925.pl: New
test file.

* test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-35925): New
test.
2023-10-01 04:13:17 +02:00
john muhl
6dd1565fcf Various fixes to lua-ts-mode font-locking
* lisp/progmodes/lua-ts-mode.el (lua-ts--font-lock-settings):
Identify functions and assignments in more places.  Use constant
face for goto/labels.  (Bug#66162)
2023-10-01 01:17:36 +02:00
Stefan Kangas
42423b6154 Bump buffers-menu-max-size to 15 on graphical displays
* lisp/menu-bar.el (buffers-menu-max-size): Bump default to 15 on
graphical displays.  (Bug#64398)
2023-10-01 01:08:17 +02:00
Stefan Kangas
820deac94b ; Add missing GNU ELPA :core package statements
* lisp/bind-key.el:
* lisp/emacs-lisp/map.el:
* lisp/erc/erc.el:
* lisp/external-completion.el:
* lisp/net/ntlm.el:
* lisp/net/soap-client.el:
* lisp/progmodes/python.el:
* lisp/svg.el:
* lisp/use-package/use-package.el: Add GNU ELPA :core package
statements.
2023-10-01 00:09:05 +02:00
Eli Zaretskii
46978fa1ef Merge from origin/emacs-29
4776d90c31 Add new Tramp test
ca5b48fd76 Fix tmm-mid-prompt :type (Bug#66179)
7447d3df94 Fix tree-sitter indentation conflict with multiple languages
bee18e5273 Fix bug#66093 in Tramp
7d5fee0fea Support regeneration of ja-dic.el under '--with-small-ja-...

Conflicts:
	make-dist
2023-09-30 13:50:07 -04:00
Eli Zaretskii
e6dd64aaba ; * lisp/progmodes/elixir-ts-mode.el (treesit-node-p): Declare. 2023-09-30 20:39:09 +03:00
Alan Mackenzie
01229fe009 Stop truncating strings too much in cl-print-string-with-limit
This fixes bug#65680, by introducing a new variable limiting
the length of a printed string, rather than abusing
print-length for that purpose.

* lisp/emacs-lisp/cl-print.el (cl-print-string-length): New
variable.
(cl-print-object <string>, cl-print--string-props): Use
cl-print-string-length rather than print-length here.
(cl-print-string-with-limit): bind cl-print-string-length based
on argument `limit'.  Decrement it by a quarter at each trial
iteration of printing.
2023-09-29 16:14:04 +00:00
Mattias Engdegård
6e4432673c Small clean-up of byte-compile-docstring-style-warn
* lisp/emacs-lisp/bytecomp.el (byte-compile-docstring-style-warn):
Make the code slightly cheaper.  It's still dominated by the
huge cost of `byte-compile--wide-docstring-p`, though.
2023-09-29 17:59:50 +02:00
Mattias Engdegård
5959a28cce Include all in byte-compile-warnings defcustom type
* lisp/emacs-lisp/bytecomp.el (byte-compile-warnings):
Let "All" mean `all`, not `t`.
2023-09-29 17:59:50 +02:00
Alan Mackenzie
688c893b18 CC Mode: Fix bug in whitespace scanning functions
c-forward-sws and c-backward-sws were scanning over spaces and
linefeeds marked with the string-fence syntax-table text
property.  Fix this by (i) removing the WS text properties
c-in-sws and c-is-sws from characters when setting the
string-fence on them; (ii) checking the syntax of "space"
characters when scanning over them.

* lisp/progmodes/cc-defs.el (c-skip-ws-chars-forward)
c-skip-ws-chars-backward, c-put-string-fence): New macros.

* lisp/progmodes/cc-awk.el
(c-awk-set-string-regexp-syntax-table-properties): Use
c-put-string-fence.

* lisp/progmodes/cc-engine.el (c-beginning-of-statement-1):
Correct the determination of macro-start.
(c-forward-sws, c-backward-sws): Replace skip-chars-forward by
c-skip-ws-chars-forward and skip-chars-backward by
c-skip-ws-chars-backward.
(c-unmark-<>-around-region, c-after-change-unmark-ml-strings)
(c-propertize-ml-string-opener): Use c-put-string-fence.

* lisp/progmodes/cc-mode.el (c-put-syn-tab): Use
c-put-string-fence when appropriate.
2023-09-29 12:07:32 +00:00
Eshel Yaron
8a635ac849 ; Substitute quotes in obsoletion notice in 'C-h f'
* lisp/help-fns.el (help-fns--obsolete): Substitute quotes in string
arguments to 'obsolete' declarations.

* lisp/emacs-lisp/advice.el (defadvice): Markup symbols in 'obsolete'
declaration.  (Bug#66240)
2023-09-28 21:44:09 +02:00
Stefan Kangas
cf4778a136 Simplify alist lookups in align-region
* lisp/align.el (align-region): Simplify alist lookup caching.
2023-09-28 21:44:09 +02:00
Juri Linkov
9cf1fc49e8 * lisp/tab-line.el: Move Touch screen support section to the better place. 2023-09-28 20:13:22 +03:00
Juri Linkov
0c15c7d946 ; * etc/NEWS: Demote outline 'describe-bindings-outline-rules' under Help.
* lisp/menu-bar.el (kill-this-buffer): Fix typo in comments.
2023-09-28 09:53:55 +03:00
Juri Linkov
3b831fe0f4 Unquote #'project-uniquify-dirname-transform in uniquify-dirname-transform.
* lisp/uniquify.el (uniquify-dirname-transform): Use , on #'.
2023-09-28 09:48:51 +03:00
Yuan Fu
e881a172d4
; * lisp/treesit.el (treesit--read-major-mode): Use string-suffix-p. 2023-09-27 21:52:59 -07:00
Sam Steingold
83e0442139 There are no file modes on windows and dos
* lisp/ls-lisp.el (ls-lisp-verbosity): Add `modes` on GNU & Unix
  (ls-lisp-format): When `modes` is not in `ls-lisp-verbosity',
   keep just the 1st character of `drwxrwxrwx`.
2023-09-27 22:33:47 -04:00
Stefan Monnier
dc2199de3e * lisp/calendar/todo-mode.el: Let-bind inhibit-read-only
rather than `buffer-read-only`.  Applied throughout the file.
(todo-date-pattern, todo-edit-item--header, todo-convert-legacy-date-time)
(todo-read-date): Remove redundant "" arg to `mapconcat`.
2023-09-27 18:52:00 -04:00
Juri Linkov
d813f71ffe * lisp/vc/diff-mode.el (diff-apply-buffer): New command (bug#66113).
(diff-mode-map): Bind 'diff-apply-buffer' to 'C-c C-m a'.
2023-09-27 20:39:33 +03:00
Juri Linkov
2d25f071b6 New commands to show replacements as diffs (bug#65854)
* lisp/dired-aux.el (dired-do-replace-regexp-as-diff): New command.

* lisp/misearch.el (multi-file-diff-unsaved): New user option.
(multi-file-replace-as-diff): New function.
(multi-file-replace-regexp-as-diff): New command.
(replace-regexp-as-diff): New command.
(multi-file-diff-no-select): New function.
2023-09-27 20:39:32 +03:00
Alan Mackenzie
6956382033 Revert "Don't use ellipses while cl-printing strings."
This reverts commit 761f8901ff.
2023-09-27 09:54:33 +00:00
Yuan Fu
a3a840c80a
Don't call font-lock-mode in treesit-major-mode-setup (bug#66223)
* lisp/treesit.el (treesit-major-mode-setup): Remove.
2023-09-27 00:21:40 -07:00