Commit graph

170559 commits

Author SHA1 Message Date
Paul Eggert
b6ed79b71c Be more systematic about parens in C source code
Be more systematic about putting space before paren in calls,
and in avoiding unnecessary parentheses in macros.
This was partly inspired by my wading through gcc -E output
while debugging something else, and seeing too many parens.

This patch does not change the generated .o files on my platform.
2024-01-20 17:28:53 -08:00
Paul Eggert
0a47a5a4be Omit some parens
* src/lisp.h (XBARE_SYMBOL, XSYMBOL): Omit parentheses that are no
longer needed now that we have symbols with positions and these
symbols are never macros.
2024-01-20 17:28:53 -08:00
Paul Eggert
973c1b8a18 Pacify gcc -Wsuggest-attribute=malloc
* src/lisp.h (hash_table_alloc_bytes):
Declare with ATTRIBUTE_MALLOC_SIZE ((1)).
2024-01-20 17:28:52 -08:00
Paul Eggert
afc9cd1721 Fix autogen.sh’s spurious ‘git diff’ output
Problem reported by Gerd Möllmann (Bug#68464).
* .gitignore: Ignore files in exec that are now copied from build-aux.
* admin/merge-gnulib (avoided_flags): Instead of clearing
autom4te.cache here ...
* autogen.sh (do_git): ... clear it here.
Use config.guess, config.sub and install-sh from
the Emacs repository, as they are more likely to be up to date.
This avoids unnecessary differences among different builders,
and avoids unnecessary ‘git diff’ output after autogen.sh.
Also, copy these files from build-aux to exec since there
should be no difference between the two copies.
* exec/config.guess, exec/config.sub, exec/install-sh:
Remove from repository, as autogen.sh now copies them from build-aux.
2024-01-20 16:35:24 -08:00
Stefan Monnier
54d3de64e1 Merge branch 'mwheel-no-alts' 2024-01-20 15:04:12 -05:00
Stefan Monnier
998667f902 mwheel.el: Code clean to reduce duplication
* lisp/mwheel.el (mouse-wheel-obey-old-style-wheel-buttons): New var,
extracted from `mouse-wheel-*-event` definitions.
(mouse-wheel-down-event, mouse-wheel-up-event)
(mouse-wheel-left-event, mouse-wheel-right-event): Use it.
2024-01-20 15:03:26 -05:00
Stefan Monnier
18294854c7 mwheel.el: Remove mouse-wheel-*-alternate-event vars
Now that `wheel-DIR` events are hardcoded, we never need more than
one variable (which we actually never needed anyway, we could have
let `mouse-wheel-*-event` vars hold lists of events instead), so
remove the `mouse-wheel-*-alternate-event` vars by merging their
default value into that of the corresponding `mouse-wheel-*-event`.

* lisp/mwheel.el (mouse-wheel-down-event, mouse-wheel-up-event)
(mouse-wheel-left-event, mouse-wheel-right-event): Don't bother holding
`wheel-DIR` events since these are already handled anyway.
Hold the event that would have been held in
`mouse-wheel-DIR-alternate-event` instead.
(mouse-wheel-down-alternate-event, mouse-wheel-up-alternate-event)
(mouse-wheel-left-alternate-event, mouse-wheel-right-alternate-event):
Delete vars.
(mwheel--is-dir-p, mouse-wheel--setup-bindings):
* lisp/edmacro.el (edmacro-fix-menu-commands):
* lisp/completion-preview.el (completion-preview--mouse-map):
Don't use `mouse-wheel-up/down-alternate-event` any more.
* lisp/progmodes/flymake.el (flymake--mode-line-counter-map):
Do nothing, because it already ignored those vars.
2024-01-20 15:03:26 -05:00
Stefan Monnier
db8890b3c9 mwheel.el: Unconditionally use the wheel-up/down/... events
The `mouse-wheel-DIR-event` vars were introduced because under X11
we get different `mouse-N` events depending on the users' mouse and
those same events can be used for other things for other rodents, so we
can't unconditionally treat those events as mouse-wheel events.

But this does not apply to the `wheel-up/down/...` events.
So hard code them.

* lisp/mwheel.el (mwheel--is-dir-p): Always consider the `wheel-DIR` events.
(mouse-wheel--setup-bindings): Always bind the `wheel-DIR` events.

* lisp/completion-preview.el (completion-preview--mouse-map):
Unconditionally bind the `wheel-DIR` events.
* lisp/edmacro.el (edmacro-fix-menu-commands): Hard code the
`wheel-DIR` events as mouse events regardless of `mouse-wheel-*-event`s.
* lisp/progmodes/flymake.el (flymake--mode-line-counter-map):
Do nothing, because it's already been done in commit e5be6c7ae3.

* doc/lispref/commands.texi (Misc Events): Document the need to use
`wheel-up/down/left/right` unconditionally.
2024-01-20 15:03:26 -05:00
Stefan Monnier
82f71e106a * lisp/completion-preview.el: Fix use in non-GUI session
Fix loading in non-GUI sessions where `mwheel` is not preloaded.
Not requiring `mwheel` would be a lot more complex, since it would
require delaying the construction of `completion-preview--mouse-map`.

* lisp/completion-preview.el (<toplevel>): Require `mwheel`.
Remove correspondingly redundant `defvar`s.
(completion-preview--mouse-map): Use `key-description` rather than mimicking
it with `format`.
2024-01-20 15:03:26 -05:00
Stefan Monnier
eb779ae646 * lisp/keymap.el (define-keymap): Demote "duplicate def" to a warning
* test/src/keymap-tests.el (keymap-test-duplicate-definitions):
Adjust accordingly.
2024-01-20 15:03:05 -05:00
Paul Eggert
3add626f14 Update from Gnulib by running admin/merge-gnulib 2024-01-20 11:45:38 -08:00
Paul Eggert
d276996c4f Avoid Gnulib ‘access’ module
* admin/merge-gnulib (AVOIDED_MODULES): Add ‘access’,
since I don’t think Emacs cares about the Mac OS X 10.5
bug where faccessat ignores a trailing slash on a symlink
to a directory.  This will matter the next time we run
admin/merge-gnulib.
2024-01-20 11:45:37 -08:00
Eshel Yaron
412cc0212d Eldoc: play nice with mode-line-format-right-align (bug#68547)
* lisp/emacs-lisp/eldoc.el (eldoc-minibuffer-message): Avoid nesting
'mode-line-format', since that breaks 'mode-line-format-right-align'.
2024-01-20 06:00:21 -06:00
Eli Zaretskii
ce836aafaa ; Merge NEWS.29. 2024-01-20 06:40:54 -05:00
Eli Zaretskii
8bb5525b62 ; Fix merge snafus
* lisp/jsonrpc.el:
* lisp/progmodes/eglot.el: Fix merge snafus.
2024-01-20 06:37:09 -05:00
Eli Zaretskii
1b31a784bf Merge from origin/emacs-29
5bb5590dec Fix blunder in labeled_narrow_to_region
78ddb32fad Fix documentation of icon-elements
725a3f32f8 ; Fix typos in symbol names
6653ee66ca Improve two docstrings in ox-latex
7d869a0402 Doc fix in auth-source-read-char-choice
f149de223b Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/...
1f97a87879 Fix info-xref-tests
51f391998b Add @kindex in manuals for existing keybindings on 'C-x x...
2024-01-20 06:25:59 -05:00
Eshel Yaron
3a5ee06057 ; Use HTML entities for reserved characters in 'dom-print'
* lisp/dom.el (dom-print): Encode HTML reserved characters in strings.
* test/lisp/dom-tests.el (dom-tests-print): New test.  (Bug#68508)
2024-01-20 11:40:22 +02:00
Po Lu
b3e4fbe867 Round projs computed executing IP/ISECT instructions and improve IUP
* src/sfnt.c (sfnt_multiply_divide_rounded): New function.
(sfnt_multiply_divide_signed): Always round values, as fonts
which rely on IP to move points in concert with prior motion and
subsequently round such points with MDAP are sensitive to minor
deviations in the behavior of the former instruction.
(load_unscaled): New macro.
(IUP_SINGLE_PAIR, sfnt_interpret_iup_1): Compute ratio w/
unscaled points if possible.
2024-01-20 09:30:04 +08:00
Stefan Monnier
a34b76cd66 trace.el: Mention the last change in NEWS 2024-01-19 15:04:50 -05:00
Stefan Monnier
1293aac0df trace.el: Make it usable in batch mode as well
While at it, this fixes a bug where a traced function was not
able to set `deactivate-mark`.

* lisp/emacs-lisp/trace.el (trace--insert): New function, extracted
from `trace-make-advice`.  Output to stdout in batch mode.
(trace--entry-message): Rename from `trace-entry-message`.
Change calling convention.  Do the insertion directly from here.
(trace--exit-message): Rename from `trace-exit-message`.
Change calling convention.  Do the insertion directly from here.
(trace-make-advice, trace-values): Simplify accordingly.
2024-01-19 15:02:50 -05:00
Po Lu
bd5bfc2913 Fix another cause of superfluous inotify signals on Android
* src/android.c (android_select): If the event queue isn't
empty upon the initial check, clear all fdsets.
2024-01-19 20:51:24 +08:00
F. Jason Park
dd2caf1a76 Redo doc strings for ERC's entry point commands
* lisp/erc/erc.el: Bump Compat version in Package-Requires header to
29.1.4.4.
(erc-select-read-args): Revise doc string, and update name of internal
`--interactive-env--' entry-point parameter.
(erc, erc-tls): Don't use `&interactive-env' as a variable name, in
case it confuses persons or programs.  Overhaul doc string in response
to user complaints.  For `erc' specifically, include literal
`:keyword' symbols to help non-Emacs users understand the required
syntax, which isn't obvious without an example, like `erc-tls' has,
and with only "&key" and upcased metasynctatic variables to go by.
(erc--current-buffer-joined-p): Remove assertion.
* test/lisp/erc/erc-scenarios-keep-place-indicator.el
(erc-scenarios-keep-place-indicator--follow): Try waiting for
intermittently failing condition.
* test/lisp/erc/erc-tests.el (erc-select-read-args): Update name of
internal keyword variable.
2024-01-18 17:06:08 -08:00
F. Jason Park
13c7933a9d Add test for erc-extract-command-from-line
* lisp/erc/erc.el (erc-extract-command-from-line): Redo doc string.
* test/lisp/erc/erc-tests.el (erc--parse-isupport-value): Add case for
commonly seen escaped character ?=.
(erc-extract-command-from-line): New test.
; * test/lisp/erc/resources/erc-d/resources/basic.eld: Update.
; Don't send unnegotiated multi-prefixed userhost names.
; * test/lisp/erc/resources/erc-d/resources/dynamic-barnet.eld: Update.
; * test/lisp/erc/resources/erc-d/resources/dynamic-foonet.eld: Update.
; * test/lisp/erc/resources/erc-d/resources/dynamic.eld: Update.
; * test/lisp/erc/resources/erc-d/resources/eof.eld: Update.
; * test/lisp/erc/resources/erc-d/resources/fuzzy.eld: Update.
; * test/lisp/erc/resources/erc-d/resources/incremental.eld: Update.
; * test/lisp/erc/resources/erc-d/resources/linger.eld: Update.
; * test/lisp/erc/resources/erc-d/resources/no-block.eld: Update.
; * test/lisp/erc/resources/erc-d/resources/no-match.eld: Update.
; * test/lisp/erc/resources/erc-d/resources/unexpected.eld: Update.
2024-01-18 17:01:22 -08:00
Stefan Monnier
81a2212bd5 * lisp/international/quail.el (quail-input-method): Fix bug#68338 2024-01-18 18:28:54 -05:00
Stefan Monnier
a33f3947ea * lisp/progmodes/elisp-mode.el (elisp-completion-at-point): Fix bug#68514
Redo the commit 0db2126d71 to try and avoid selecting more than
a mere symbol.
2024-01-18 14:05:16 -05:00
Stefan Monnier
b07a86abb6 * test/lisp/emacs-lisp/comp-cstr-tests.el: Use macros in a simpler way
(comp-cstr-test-ts): Move out of `cl-eval-when`.
(comp-cstr-typespec-test): Delete.
(comp-cstr-synthesize-tests): Make it take the tests as an argument.
(comp-cstr-typespec-tests-alist): Delete var, pass its value to the
macro instead.
2024-01-18 14:00:54 -05:00
Mattias Engdegård
e7a6ce847f Don't use Qunbound as hash table key when printing (bug#68244)
This flaw could cause an assertion failure.

* src/print.c (PRINT_CIRCLE_CANDIDATE_P): Don't consider Qunbound a
print-circle candidate; it should never be seen by Lisp anyway.
2024-01-18 18:57:03 +01:00
Mattias Engdegård
ef01250ef9 Only use a hash index size of 1 for tables with size 0 (bug#68244)
This invariant was intended but insufficiently enforced which could
lead to an assertion failure.

* src/fns.c (hash_index_size): Assume size>0, and return a value >1.
(make_hash_table): Only use hash_index_size for size>0.
2024-01-18 18:56:26 +01:00
Eric Abrahamsen
2c887f497c Avoid font-lock reset in `gnus-message-citation-mode'
* lisp/gnus/gnus-cite.el (gnus-message-citation-mode): Use
`font-lock-add-keywords' and `font-lock-remove-keywords' instead of
modifying font-lock defaults.  Make no font-lock changes until
`font-lock-mode' is active.

Thanks to Morgan Willcock
2024-01-18 07:25:52 -08:00
Po Lu
d4d5830f8a ; * src/androidterm.c (handle_one_android_event): Fix typo. 2024-01-18 10:32:50 +08:00
Jim Porter
5f5faad249 ; Fix test failures from the fix for bug#67661
* test/lisp/eshell/em-cmpl-tests.el
  (em-cmpl-test/file-completion/non-unique): Make test more robust.
2024-01-17 09:32:18 -08:00
Andrea Corallo
c5031a52c5 * Update a comp test (bug#68523)
* test/src/comp-tests.el (comp-tests-ret-type-spec-71): Update a test
due to new 'sxhash-equal' behaviour.
2024-01-17 15:50:17 +01:00
Po Lu
daec3e7b41 Increase accuracy of IP instruction
* src/sfnt.c (sfnt_interpret_ip): Avoid precision loss by
retrieving original positions from the unscaled outline,
whenever possible.
2024-01-17 09:30:47 +08:00
Mattias Engdegård
f19f5604de Update pdumper hashes for buffer and Lisp_Hash_Table
* src/pdumper.c (dump_hash_table): Update for changes in recent
hash-table patch suites (bug#68244).
(dump_buffer): Update for case-fold-search changes (bug#66117).
2024-01-16 20:34:43 +01:00
Mattias Engdegård
dc404c5d0c More efficient hash table thawing
* src/fns.c (hash_table_thaw): Don't allocate anything for empty
tables.  Don't initialise the next vector twice.
(maybe_resize_hash_table): Factor out min_size constant.
2024-01-16 20:34:43 +01:00
Eli Zaretskii
0b8fe3c73c ; * etc/NEWS: Fix wording of recently-added entry. 2024-01-16 19:14:09 +02:00
Juri Linkov
6f75d0f36d New display action alist entry 'post-command-select-window' (bug#67993)
* doc/lispref/windows.texi (Buffer Display Action Alists):
Add 'post-command-select-window'.

* lisp/window.el (display-buffer): Add 'post-command-select-window'
to the docstring and handle at the end of function.
2024-01-16 18:54:04 +02:00
Po Lu
44fcab04f6 Enable the system's Arabic and Khmer fonts under Android
* lisp/international/fontset.el (setup-default-fontset): If
`android', search for Arabic or Khmer fonts with script tags,
not OTF features.
2024-01-16 11:08:37 +08:00
Mike Kupfer
e6a2901b1b Fix folder creation error (Bug#67361)
* lisp/mh-e/mh-funcs.el (mh-kill-folder), lisp/mh-e/mh-search.el
  (mh-index-new-folder), lisp/mh-e/mh-utils.el (mh-prompt-for-folder):
  Check for existence of speedbar-buffer rather than
  mh-speed-folder-map. The latter can exist if mh-speed has only been
  loaded but not displayed.
2024-01-15 17:34:18 -08:00
Stefan Monnier
27ff4d9c49 * lisp/help-fns.el (help-fns--parent-mode): Mention the extra parents
As suggested by Stefan Kangas in bug#68246.
2024-01-15 19:00:50 -05:00
Michael Albinus
2ef3111b13 * lisp/info-xref.el (info-xref-subfile-p): Avoid false positives. (Bug#68428) 2024-01-15 16:55:27 +01:00
João Távora
43612103c2 Jsonrpc: fix bug in jsonrpc--remove
* lisp/jsonrpc.el (jsonrpc--remove): Check timer before cancelling it.
(Version): Bump to 1.2.24

See https://github.com/joaotavora/eglot/issues/1342
2024-01-15 06:36:24 -06:00
Po Lu
c11cdf1858 ; * src/xterm.c (x_focus_frame): Insert missing unblock_input. 2024-01-15 14:32:26 +08:00
Stefan Monnier
314c939d1e (js-json-mode): Don't derive from js-mode (bug#67463)
* lisp/progmodes/js.el (js--mode-setup): New function, extracted from
`js-mode`.
(js-mode): Use it.
(js-json-mode): Use it instead of inheriting from `js-mode`.
2024-01-14 22:17:13 -05:00
Gregory Heytings
0d336507df ; * admin/git-bisect-start: Update failing commits 2024-01-15 00:53:36 +00:00
Gregory Heytings
5bb5590dec Fix blunder in labeled_narrow_to_region
* src/editfns.c (labeled_narrow_to_region): Record point before,
instead of after, calling narrow-to-region; otherwise point may
already have been changed.  Fixes bug#66764.
2024-01-14 21:59:21 +00:00
Daniel Martín
78ddb32fad Fix documentation of icon-elements
* lisp/emacs-lisp/icons.el (icon-elements): The plist key it returns
is `image', not `display'.  (Bug#68451)
2024-01-14 17:03:16 +02:00
Stefan Kangas
725a3f32f8 ; Fix typos in symbol names 2024-01-14 15:16:54 +01:00
Stefan Kangas
6653ee66ca Improve two docstrings in ox-latex
* lisp/org/ox-latex.el (org-latex-src-block-backend)
(org-latex-engraved-theme): Improve docstring; mention that
engrave-faces is a GNU ELPA package.
2024-01-14 14:52:17 +01:00
Stefan Kangas
7d869a0402 Doc fix in auth-source-read-char-choice
* lisp/auth-source.el (auth-source-read-char-choice): Don't
document 'dropdown-list', which was removed in 2011.
2024-01-14 14:47:39 +01:00