aboutsummaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'mouse-wheel-buttons'Stefan Monnier2024-04-092-12/+54
|\
| * (mouse-wheel-buttons): Map old-style wheel buttons to actual wheel eventsStefan Monnier2024-04-092-12/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the handling of the old X11 convention that uses mouse-4/5/6/7 events to represent wheel events: instead of asking downstream packages to use the `mouse-wheel-*-event` variables to know which events represent wheel events, use new var `mouse-wheel-buttons` to directly convert those events into the standard `wheel-up/down/left/right` events used everywhere else. This will simplify the work of packages which can thus just bind their commands to `wheel-up/down/left/right`. * lisp/mouse.el (mouse-wheel-buttons): New custom variable. * src/keyboard.c (make_lispy_event): Adjust for "wheel-clicks" on the tab-bar. * src/xterm.c (x_construct_mouse_click): Add `xi2` argument and obey `mouse-wheel-buttons` variable. (handle_one_xevent): Adjust calls accordingly. (syms_of_xterm): Define the `mouse-wheel-buttons` and the `wheel-up/down/left/right`symbols. * lisp/xt-mouse.el: Don't require `mwheel` any more. (xterm-mouse--same-button-p): Delete function. (xterm-mouse--read-event-sequence): Use `mouse-wheel-buttons`. * lisp/mwheel.el (mouse-wheel-up-event, mouse-wheel-down-event) (mouse-wheel-left-event, mouse-wheel-right-event): Make obsolete. (mouse-wheel-obey-old-style-wheel-buttons): Delete variable. * lisp/completion-preview.el (completion-preview--mouse-map): * lisp/progmodes/flymake.el (flymake--mode-line-counter-map): * lisp/edmacro.el (edmacro-fix-menu-commands): Silence warnings.
* | (Freplace_match): Fix bug#65451Stefan Monnier2024-04-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/search.c (Freplace_match): For ordering of *-change-functions. * test/src/editfns-tests.el (editfns-tests--before/after-change-functions): New test. (sanity-check--message, sanity-check-change-functions-error) (sanity-check-change-functions-check-size) (sanity-check-change-functions-before) (sanity-check-change-functions-after): New functions. (sanity-check--verbose, sanity-check-change-functions-beg) (sanity-check-change-functions-end) (sanity-check-change-functions-buffer-size) (sanity-check-change-functions-errors): New vars.
* | Enable relinquishing access to Android content directoriesPo Lu2024-04-055-4/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/emacs/android.texi (Android Document Providers): Document new command. * java/org/gnu/emacs/EmacsService.java (relinquishUriRights): New function. * src/Makefile.in (SOME_MACHINE_OBJECTS): Add androidvfs.c. * src/android.c (android_init_emacs_service): Link to new function. * src/android.h (struct android_emacs_service) <relinquish_uri_rights>: New field. * src/androidfns.c: * src/androidvfs.c (android_saf_tree_name) (android_saf_tree_opendir): Minor adjustments to commentary. (Fandroid_relinquish_directory_access): New function. (syms_of_androidvfs): Define new subr.
* | ; * src/json.c: Comment correctionMattias Engdegård2024-04-041-2/+2
| |
* | * src/json.c (make_symset_table): Fix over-large allocation size.Mattias Engdegård2024-04-041-1/+1
| | | | | | | | We multiplied when we should have added. Oops.
* | Remove redundant byte-swapping boundaryPo Lu2024-04-042-19/+3
| | | | | | | | | | | | | | * src/sfnt.c (sfnt_read_OS_2_table): * src/sfnt.h (struct sfnt_OS_2_table): Don't redundantly realign after s_family_class.
* | ; * src/haikufns.c (syms_of_haikufns): Fix indentation.Po Lu2024-04-041-2/+2
| |
* | New variable haiku-pass-control-tab-to-systemTor-björn Claesson2024-04-043-0/+23
|/ | | | | | | | | | | | | | Allow passing C-TAB on to the Haiku operating system, fixing window switching when an Emacs frame has focus (Bug#70138). * src/haiku_support.cc (DispatchMessage): Conditionally pass message to BWindow. * src/haiku_support.h: * src/haikufns.c (haiku_should_pass_control_tab_to_system): Add variable haiku-pass-control-tab-to-system, and C function haiku_should_pass_control_tab_to_system. Co-authored-by: Po Lu <luangruo@yahoo.com> Copyright-paperwork-exempt: yes
* ; * src/json.c (json_parse_array): Remove unused variable.Mattias Engdegård2024-04-031-3/+0
|
* ; * src/json.c (Fjson_insert): Fix typo in doc (bug#70156).Randy Taylor2024-04-031-1/+1
|
* ; * src/json.c (Fjson_insert): Doc fix.Eli Zaretskii2024-04-021-1/+2
|
* Fix json-insert unibyte buffer bug (bug#70007)Mattias Engdegård2024-04-021-39/+11
| | | | | | | | | | | Previously, a unibyte target buffer could be put in an incorrect state if json-insert was used to insert non-ASCII characters. * src/json.c (Fjson_insert): Simplify. Don't attempt to decode the data being inserted: it is guaranteed to be correct UTF-8 and is correct for both unibyte and multibyte buffers. * test/src/json-tests.el (json-serialize/roundtrip) (json-serialize/roundtrip-scalars): Extend tests.
* json-insert doc fixesMattias Engdegård2024-04-021-2/+3
| | | | | | * src/json.c (Fjson_insert): Precise the behaviour when the current buffer is multibyte and unibyte, respectively. * doc/lispref/text.texi (Parsing JSON): Refer to the right function.
* Update JSON codec doc stringsMattias Engdegård2024-04-011-48/+50
| | | | | | * src/json.c (Fjson_serialize, Fjson_insert, Fjson_parse_string) (Fjson_parse_buffer): Make the text more readable, fix minor errors and avoid terminology confusion.
* ; * src/json.c (json_parse_object): Call make_hash_table directly.Mattias Engdegård2024-04-011-2/+1
|
* ; json.c stylistic adjustmentsPo Lu2024-04-011-3/+4
| | | | * src/json.c (json_parse_string): Stylistic changes.
* Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacsEli Zaretskii2024-04-015-137/+111
|\
| * Don't signal `json-end-of-file` for short nonempty bad JSON inputsMattias Engdegård2024-04-011-3/+3
| | | | | | | | | | * src/json.c (json_parse_value): Generate a plain parse error. * test/src/json-tests.el (json-parse-string/short): Adapt test.
| * Faster JSON parsingMattias Engdegård2024-04-013-119/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Speed up JSON parsing substantially by only UTF-8-parsing string literals and only exactly once. Previously, json-parse-string always first parsed the entire input and copied it to a new string, and then validated each string literal twice. We no longer create an extra new string when interning an alist key, nor do we garble plist keys with Unicode characters. * src/lread.c (intern_c_multibyte): New. * src/json.c (json_encode): Remove. (utf8_error): New. (json_parse_string): Faster and more careful UTF-8 decoding. Create and return a new multibyte string or symbol without extra decoding. All callers adapted. (Fjson_parse_string): Skip expensive input pre-decoding. * test/src/json-tests.el (json-parse-string/object-unicode-keys) (json-parse-string/short): New. (json-parse-string/string, json-parse-string/invalid-unicode): Adapt tests. * etc/NEWS: Mentioned change in errors.
| * Fix listing of Android root directory when it is accessiblePo Lu2024-04-011-15/+10
| | | | | | | | | | | | | | * src/androidvfs.c (android_root_closedir, android_root_dirfd) (android_root_opendir): Allocate an ersatz file descriptor even if directory is non-NULL, so that at-funcs will properly return file status for virtual files in the root directory.
| * Fix wildcard signals in dbusbind.cMichael Albinus2024-03-311-0/+16
| | | | | | | | | | * src/dbusbind.c (xd_read_message_1): Handle registered signals with wildcards. (Bug#69926)
* | Add support for `ch' and `cw' dimension specifiers for imagesZajcev Evgeny2024-04-012-2/+22
|/ | | | | | | | | | * src/image.c (image_get_dimension, lookup_image): Handle `ch' and `cw' dimension specifiers in addition to `em'. * src/dispextern.h: Add new members `face_font_height' and `face_font_width' to `struct image'. * doc/lispref/display.texi (Image Descriptors): Document `ch' and `cw'.
* List special directories when reading root directory on AndroidPo Lu2024-03-311-3/+124
| | | | | | | | | | | | | | | * src/androidvfs.c (root_vfs_ops): Substitute android_root_opendir for android_root_opendir. (struct android_root_vdir): New structure. (root_fd, root_fd_references): New variables. (android_root_readdir, android_root_closedir, android_root_dirfd) (android_root_opendir): New functions. (android_fstatat_1): Test provided fd against root_fd, and if they match, prefix FILENAME with the name of the root directory. * lisp/ls-lisp.el (ls-lisp-insert-directory): If d-f-a-a signals an error while retrieving attributes, compile the alist of directory contents by hand.
* ; Another round of stylistic fixes in json.cEli Zaretskii2024-03-311-97/+71
| | | | | | | * src/json.c (json_parser_init, json_parse_object) (json_parse_value, Fjson_parse_string, json_parse) (json_create_float, json_create_integer, json_parse_args): Fix whitespace and indentation.
* ; json.c stylistic adjustmentsPo Lu2024-03-311-25/+32
| | | | | | * src/json.c (json_signal_error, json_parser_init) (json_parse_object, json_parse_value, syms_of_json): Tabify and wrap unacceptably long lines.
* ; json.c stylistic adjustmentsPo Lu2024-03-311-41/+45
| | | | | | * src/json.c (json_parse_args, json_out_t, symset_t, symset_size) (Fjson_serialize, Fjson_insert): Tabify and modify all sentences to be punctuated with two spaces.
* Fix the native JSON support codeEli Zaretskii2024-03-302-8/+12
| | | | | | | | * src/Makefile.in (base_obj): Add the missing json.o. Without this, we get link error. * src/json.c (json_serialize): Don't use too sophisticated C99 features, as they confuse make-docfile. Initialize all the members explicitly.
* Always enable native JSON support and remove Jansson referencesMattias Engdegård2024-03-304-21/+3
| | | | | | | | | | | | | | | | | | | | | * src/json.c (Fjson__available_p): Remove. * lisp/subr.el (json-available-p): Always return t. * admin/nt/dist-build/build-dep-zips.py: * configure.ac: * doc/lispref/text.texi (Parsing JSON): * java/INSTALL: * java/org/gnu/emacs/EmacsNative.java (EmacsNative): * lisp/term/w32-win.el (dynamic-library-alist): * m4/ndk-build.m4 (ndk_INIT): * msdos/sed1v2.inp: * nt/INSTALL: * nt/INSTALL.W64: * src/Makefile.in: * src/emacs.c (main): * src/lisp.h: Remove JSON configuration options and references to it and Jansson from documentation and build files. * etc/NEWS: Announce.
* New JSON encoder (bug#70007)Mattias Engdegård2024-03-304-530/+547
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It is in general at least 2x faster than the old encoder and does not depend on any external library. Using our own code also gives us control over translation details: for example, we now have full bignum support and tighter float formatting. * src/json.c (json_delete, json_initialized, init_json_functions) (json_malloc, json_free, init_json, json_out_of_memory) (json_releae_object, check_string_without_embedded_nulls, json_check) (json_check_utf8, lisp_to_json_nonscalar_1, lisp_to_json_nonscalar) (lisp_to_json, json_available_p, ensure_json_available, json_insert) (json_handle_nonlocal_exit, json_insert_callback): Remove. Remaining uses updated. * src/json.c (json_out_t, symset_t, struct symset_tbl) (symset_size, make_symset_table, push_symset, pop_symset) (cleanup_symset_tables, symset_hash, symset_expand, symset_add) (json_out_grow_buf, cleanup_json_out, json_make_room, JSON_OUT_STR) (json_out_str, json_out_byte, json_out_fixnum, string_not_unicode) (json_plain_char, json_out_string, json_out_nest, json_out_unnest) (json_out_object_cons, json_out_object_hash), json_out_array) (json_out_float, json_out_bignum, json_out_something) (json_out_to_string, json_serialize): New. (Fjson_serialize, Fjson_insert): New JSON encoder implementation. * test/src/json-tests.el (json-serialize/object-with-duplicate-keys) (json-serialize/string): Update tests.
* Merge from origin/emacs-29Eli Zaretskii2024-03-301-7/+10
|\ | | | | | | | | 38faacf353f Improve documentation of <Delete> in user manual 9d3d77f12da Fix documentation of 'other-window-for-scrolling'
| * Fix documentation of 'other-window-for-scrolling'Eli Zaretskii2024-03-251-7/+10
| | | | | | | | | | | | * src/window.c (Fother_window_for_scrolling): More accurate documentation of how "the other" window is looked for. Suggested by Karthik Chikmagalur <karthikchikmagalur@gmail.com>.
* | ; Fix last change in inclusion of byteswap.h headerEli Zaretskii2024-03-301-5/+4
| | | | | | | | | | * src/w32uniscribe.c (w32hb_get_font_table): Avoid warning due to redefinition of 'bswap_32'.
* | Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacsEli Zaretskii2024-03-302-1/+1
|\ \
| * | Fix implicit declaration of bswap_{32,64}Andreas Schwab2024-03-302-1/+1
| | | | | | | | | | | | | | | * src/data.c: Move include of <byteswap.h> ... * src/lisp.h: ... here.
* | | Clean up removal of libjansson parserEli Zaretskii2024-03-301-67/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/json.c (json_has_suffix, json_has_prefix): Remove unused functions. (json_object_key_to_iter, json_array_get, json_loads) (json_load_callback, json_object_iter, json_object_iter_value) (json_string_value, json_object_size, json_object_iter_key) (json_object_iter_next, json_real_value, json_string_length) (json_integer_value) [WINDOWSNT]: Don't DEF_DLL_FN, don't LOAD_DLL_FN, and don't define a macro for unused libjansson functions. (JSON_HAS_ERROR_CODE): Remove: not used.
* | | Replace libjansson JSON parser with a custom oneGéza Herman2024-03-301-242/+1122
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/json.c (json_parse_error, json_to_lisp) (json_read_buffer_callback): Remove functions. (struct json_parser): New struct. (json_signal_error, json_parser_init, json_parser_done) (json_make_object_workspace_for_slow_path) (json_make_object_workspace_for, json_byte_workspace_reset) (json_byte_workspace_put_slow_path, json_byte_workspace_put) (json_input_at_eof, json_input_switch_to_secondary) (json_input_get_slow_path, json_input_get) (json_input_get_if_possible, json_input_put_back) (json_skip_whitespace_internal, json_skip_whitespace) (json_skip_whitespace_if_possible, json_hex_value) (json_parse_unicode, json_handle_utf8_tail_bytes) (json_parse_string, json_create_integer, json_create_float) (json_parse_number, json_parse_array) (json_parse_object_member_value, json_parse_object) (json_is_token_char, json_parse_value, json_parse): New functions. (Fjson_parse_buffer, Fjson_parse_string): Adjust to changes in the parser. (syms_of_json): DEFSYM new symbols and define_error new errors.
* | Fix building the SFNT font driverPo Lu2024-03-301-2/+2
| | | | | | | | | | * src/sfntfont.c (sfntfont_list, sfntfont_list_family): Update calls to Fsort for the new calling convention.
* | * src/fns.c (Fvaluelt): More generous depth limit (20 -> 200).Mattias Engdegård2024-03-291-1/+1
| | | | | | | | This gives `value<` the same limit as `equal` which seems about right.
* | Faster non-destructive list sortingMattias Engdegård2024-03-291-30/+35
| | | | | | | | | | | | | | | | Postpone the creation of a new list to after sorting which turns out to be a lot faster (1.1x - 1.5x speedup). * src/fns.c (sort_list, sort_vector, Fsort): Create the new list when moving the data out from the temporary array.
* | Speed up `sort` by special-casing the `value<` orderingMattias Engdegård2024-03-292-44/+40
| | | | | | | | | | | | | | | | | | | | | | This gives a 1.5x-2x speed-up when using the default :lessp value, by eliminating the Ffuncall overhead. * src/sort.c (order_pred_lisp, order_pred_valuelt): New. (merge_state, inorder, binarysort, count_run, gallop_left, gallop_right) (merge_init, merge_lo, merge_hi, tim_sort): * src/fns.c (Fsort): When using value<, call it directly.
* | New `sort` keyword arguments (bug#69709)Mattias Engdegård2024-03-295-24/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the :key, :lessp, :reverse and :in-place keyword arguments. The old calling style remains available and is unchanged. * src/fns.c (sort_list, sort_vector, Fsort): * src/sort.c (tim_sort): Add keyword arguments with associated new features. All callers of Fsort adapted. * test/src/fns-tests.el (fns-tests--shuffle-vector, fns-tests-sort-kw): New test. * doc/lispref/sequences.texi (Sequence Functions): Update manual. * etc/NEWS: Announce.
* | Add back timsort key function handling (bug#69709)Mattias Engdegård2024-03-293-118/+309
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original timsort code did provide for a key (accessor) function along with the necessary storage management, but we dropped it because our `sort` function didn't need it. Now it's been put back since it seems that it will come in handy after all. * src/fns.c (sort_list, sort_vector, Fsort): Pass Qnil as key function to tim_sort. * src/sort.c (reverse_slice, sortslice_copy) (sortslice_copy_incr, sortslice_copy_decr, sortslice_memcpy) (sortslice_memmove, sortslice_advance): New functions. (sortslice): New type. (struct stretch, struct reloc, merge_state) (binarysort, merge_init, merge_markmem, cleanup_mem) (merge_register_cleanup, merge_getmem, merge_lo, merge_hi, merge_at) (found_new_run, reverse_sortslice, resolve_fun, tim_sort): Merge back previously discarded parts from the upstreams timsort code that dealt with key functions, and adapt them to fit in.
* | Add `value<` (bug#69709)Mattias Engdegård2024-03-293-45/+285
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's a general-purpose polymorphic ordering function, like `<` but for any two values of the same type. * src/data.c (syms_of_data): Add the `type-mismatch` error. (bits_word_to_host_endian): Move... * src/lisp.h (bits_word_to_host_endian): ...here, and declare inline. * src/fns.c (Fstring_lessp): Extract the bulk of this function to... (string_cmp): ...this 3-way comparison function, for use elsewhere. (bool_vector_cmp, value_cmp, Fvaluelt): New. * lisp/emacs-lisp/byte-opt.el (side-effect-free-fns, pure-fns): Add `value<`, which is pure and side-effect-free. * test/src/fns-tests.el (fns-value<-ordered, fns-value<-unordered) (fns-value<-type-mismatch, fns-value<-symbol-with-pos) (fns-value<-circle, ert-deftest fns-value<-bool-vector): New tests. * doc/lispref/sequences.texi (Sequence Functions): * doc/lispref/numbers.texi (Comparison of Numbers): * doc/lispref/strings.texi (Text Comparison): Document the new value< function. * etc/NEWS: Announce.
* | ; Fix recently-changed documentationEli Zaretskii2024-03-261-9/+12
| | | | | | | | | | | | * src/buffer.c (syms_of_buffer) <text-conversion-style>: * doc/lispref/commands.texi (Misc Events): Fix wording and punctuation of the documentation.
* | Prevent passwords from being recorded during text conversionPo Lu2024-03-264-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/commands.texi (Misc Events): Document new value of text-conversion-style. * java/org/gnu/emacs/EmacsService.java (EmacsService) <IC_MODE_PASSWORD>: New constant. * java/org/gnu/emacs/EmacsView.java (onCreateInputConnection): Set TYPE_TEXT_VARIATION_PASSWORD and IME_FLAG_FORCE_ASII if mode is IC_MODE_PASSWORD. * lisp/subr.el (read-passwd): Set text-conversion-style to `password'. * src/androidgui.h (enum android_ic_mode): New value ANDROID_IC_MODE_PASSWORD. * src/androidterm.c (android_reset_conversion): Handle `password'. * src/buffer.c (syms_of_buffer) <&BVAR (current_buffer, text_conversion_style)>: Update doc string. * src/textconv.c (syms_of_textconv) <Qpassword>: New DEFSYM. <Vtext_conversion_edits>: Fix typos in doc string.
* | * src/coding.c (produce_chars): Fix a thinko (bug#69966).Eli Zaretskii2024-03-231-2/+2
| |
* | Enable calling decode_coding_object with both SRC and DST_OBJECT QnilPo Lu2024-03-231-11/+23
| | | | | | | | | | | | | | * src/coding.c (growable_destination): A C destination is also reallocable. (produce_chars): Don't consider source and destination identical if they are EQ but Qnil.
* | Minor adjustments to last changePo Lu2024-03-231-11/+6
| | | | | | | | | | | | * src/androidvfs.c (android_vfs_convert_name): Simplify. (android_saf_tree_readdir, android_root_name): Remove redundant statements.
* | Correctly handle non-BMP characters in Android content file namesPo Lu2024-03-233-17/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/term/android-win.el (android-encode-jni) (android-decode-jni, android-jni): New coding system, for Android file names and runtime data. * src/androidterm.h (syms_of_androidvfs): New function. * src/androidvfs.c (struct android_special_vnode): New field special_coding_system. (android_saf_tree_readdir): Decode the file name using the android-jni coding system. (special_vnodes): <contents>: Specify a file name coding system. (android_vfs_convert_name): New function. (android_root_name): If a special coding system be specified for a special vnode, convert components to it before invoking its name function. (syms_of_androidvfs): New symbol Qandroid_jni. * src/emacs.c (android_emacs_init): Call syms_of_androidvfs.