aboutsummaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* (backtrace-on-redisplay-error): Use `handler-bind`scratch/handler-bindStefan Monnier2023-12-284-66/+26
| | | | | | | | | | | | | | | | | | | | | | | | Reimplement `backtrace-on-redisplay-error` using `push_handler_bind`. This moves the code from `signal_or_quit` to `xdisp.c` and `debug-early.el`. * lisp/emacs-lisp/debug-early.el (debug-early-backtrace): Add `base` arg to strip "internal" frames. (debug--early): New function, extracted from `debug-early`. (debug-early, debug-early--handler): Use it. (debug-early--muted): New function, extracted (translated) from `signal_or_quit`; trim the buffer to a max of 10 backtraces. * src/xdisp.c (funcall_with_backtraces): New function. (dsafe_calln): Use it. (syms_of_xdisp): Defsym `Qdebug_early__muted`. * src/eval.c (redisplay_deep_handler): Delete var. (init_eval, internal_condition_case_n): Don't set it any more. (backtrace_yet): Delete var. (signal_or_quit): Remove special case for `backtrace_on_redisplay_error`. * src/keyboard.c (command_loop_1): Don't set `backtrace_yet` any more. * src/lisp.h (backtrace_yet): Don't declare.
* (signal_or_quit): Preserve error object identityStefan Monnier2023-12-282-38/+32
| | | | | | | | | | | | | | | | | | | | | Make sure we build the (ERROR-SYMBOL . ERROR-DATA) object only once when signaling an error, so that its `eq` identity can be used. It also gets us a tiny bit closer to having real "error objects" like in most other current programming languages. * src/eval.c (maybe_call_debugger): Change arglist to receive the error object instead of receiving the signal and the data separately. (signal_or_quit): Build the error object right at the beginning so it stays `eq` to itself. Rename the `keyboard_quit` arg to `continuable` so say what it does rather than what it's used for. (signal_quit_p): Change arg to be the error object rather than just the error-symbol. * src/keyboard.c (cmd_error_internal, menu_item_eval_property_1): Adjust calls to `signal_quit_p` accordingly. * test/src/eval-tests.el (eval-tests--error-id): New test.
* eval.c: Add new var `lisp-eval-depth-reserve`Stefan Monnier2023-12-281-23/+32
| | | | | | | | | | | | | | | | | | Rather than blindly increase `max-lisp-eval-depth` when entering the debugger or running `signal-hook-function`, use this new "reserve" to keep track of how much we have grown the stack for "debugger" purposes so that for example recursive calls to `signal-hook-function` can't eat up the whole C stack. * src/eval.c (max_ensure_room): Rewrite. (restore_stack_limits): Move before `max_ensure_room`. Rewrite. (call_debugger, signal_or_quit): Adjust calls accordingly. Also grow `max-lisp-eval-depth` for `hander-bind` handlers. (init_eval_once): Don't initialize `max_lisp_eval_depth` here. (syms_of_eval): Initialize it here instead. Add new var `lisp-eval-depth-reserve`. * doc/lispref/eval.texi (Eval): Add `lisp-eval-depth-reserve`.
* Move batch backtrace code to `top_level_2`Stefan Monnier2023-12-283-25/+27
| | | | | | | | | | | | | | | | | Move ad-hoc code meant to ease debugging of bootstrap (and batch mode) to `top_level_2` so it doesn't pollute `signal_or_quit`. * src/lisp.h (pop_handler, push_handler_bind): Declare. * src/keyboard.c (top_level_2): Setup an error handler to call `debug-early` when noninteractive. * src/eval.c (pop_handler): Not static any more. (signal_or_quit): Remove special case for noninteractive use. (push_handler_bind): New function, extracted from `Fhandler_bind_1`. (Fhandler_bind_1): Use it. (syms_of_eval): Declare `Qdebug_early__handler`. * lisp/emacs-lisp/debug-early.el (debug-early-backtrace): Weed out frames below `debug-early`. (debug-early--handler): New function.
* New special form `handler-bind`Stefan Monnier2023-12-272-17/+121
| | | | | | | | | | | | | | | | | | | | | | | AFAIK, this provides the same semantics as Common Lisp's `handler-bind`, modulo the differences about how error objects and conditions are represented. * lisp/subr.el (handler-bind): New macro. * src/eval.c (pop_handler): New function. (Fhandler_Bind_1): New function. (signal_or_quit): Handle new handlertypes `HANDLER` and `SKIP_CONDITIONS`. (find_handler_clause): Simplify. (syms_of_eval): Defsubr `Fhandler_bind_1`. * doc/lispref/control.texi (Handling Errors): Add `handler-bind`. * test/src/eval-tests.el (eval-tests--handler-bind): New test. * lisp/emacs-lisp/lisp-mode.el (lisp-font-lock-keywords): Move 'handler-bind' from CL-only to generic Lisp. (handler-bind): Remove indentation setting, it now lives in the macro definition.
* Revert e8df6c311fcf59bf23d31b9db2bb8fec9d78fbe7Yuan Fu2023-12-261-4/+7
|
* ; * src/ftfont.c (ftfont_glyph_metrics): Comment on advance rounding.Po Lu2023-12-261-0/+6
|
* Consistently round glyph advances in the SFNT font backendPo Lu2023-12-262-7/+12
| | | | | | | | | | | * src/sfnt.h (SFNT_ROUND_FIXED): New macro. * src/sfntfont.c (sfntfont_get_glyph_outline): Don't apply advance width distortion before the glyph is instructed or decomposed. Round advance width as measured between both phantom points subsequent to instruction code execution. (sfntfont_draw): Don't take the advance's ceiling when advancing origin point.
* Apply TTF advance width rounding to uninstructed glyphsPo Lu2023-12-252-12/+16
| | | | | | | | | * src/sfnt.c (sfnt_scale_metrics): * src/sfntfont.c (sfntfont_get_glyph_outline): Round advance and floor lbearing scaling glyph metrics. (sfntfont_measure_pcm): Don't round or truncate metrics which have already been.
* Optimize font edge filling loopPo Lu2023-12-251-54/+33
| | | | | | | * src/sfnt.c (sfnt_fedge_sort): Delete function. (sfnt_poly_edges_exact): Don't sort edges, iterate through each instead. (main): Adjust tests.
* * src/eval.c (signal_or_quit): Fix naming inconsistency with docsStefan Monnier2023-12-241-2/+2
| | | | | | The var's docstring and etc/NEWS refer to "*Redisplay-trace*", so better use that (which is also more in line with usual practice of Emacs buffer names).
* ; * src/eval.c (Fdefvar): Doc fix (bug#67991).Eli Zaretskii2023-12-241-2/+8
|
* ; * src/xdisp.c (draw_glyphs): Fix coding style.Po Lu2023-12-231-1/+1
|
* Merge from origin/emacs-29Eli Zaretskii2023-12-231-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a4751657389 * doc/man/emacsclient.1: Fix --tramp option. 1e5357d3d1f * doc/man/emacsclient.1: Add missing sections (bug#66598) fba7b9db397 Add explanation for extra parentheses in ELisp Introduction 77232826821 Add sample code to the "let*" section in "forward-paragraph" 7a00ca92c19 Fix treesit test (bug#67117) d220893216c Fix c++-ts-mode indentation (bug#67975) d386a8aa43f Recommend customizing eglot for python-base-mode bd0c7589715 Improve documentation of new native-compilation commands 1ad126c0f28 ; Fix typo 77678244b83 doc/lispintro: Don't mention `set` (bug#67734) cb3684e9dfa Fix script for some characters 2922d683b78 ; * src/treesit.c (treesit_traverse_child_helper): Fix co... 7b315e8a5c9 Fix an issue when searching subtree backward (bug#67117) 03625c2fefa Fix passive mode for tnftp client in ange-ftp.el. b6429b1c1c7 ; Improve documentation of ispell.el's dictionary database 75cc1593412 ; * etc/PROBLEMS: Update the "GnuPG hangs" entry. 67d9af1c074 Fix using disabled command without a docstring f68f3500236 Improve documentation of text properties handling when ya... 06c399914fa Eglot: Add Uiua language server
| * ; * src/treesit.c (treesit_traverse_child_helper): Fix comment.Eli Zaretskii2023-12-191-1/+1
| |
| * Fix an issue when searching subtree backward (bug#67117)Denis Zubarev2023-12-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | * src/treesit.c (treesit_traverse_child_helper): Do not call treesit_traverse_sibling_helper when the named node is required and the last child is the named node. Otherwise treesit_traverse_sibling_helper will move cursor to the previous sibling and last node will be skipped. * test/src/treesit-tests.el (treesit-search-subtree-forward-1): (treesit-search-subtree-backward-1): Add tests.
* | Respect mouse-face on SVG image glyphs (bug#67794)Manuel Giraud2023-12-233-1/+22
| | | | | | | | | | | | | | * src/dispextern.h: * src/image.c (image_spec_value): Export 'image_spec_value'. * src/xdisp.c (draw_glyphs): Maybe update SVG image glyphs with mouse face features before drawing.
* | ; * src/sfnt.c (sfnt_interpret_compound_glyph_2): Reword a comment.Eli Zaretskii2023-12-231-1/+1
| |
* | Use new safe_calln on NSGerd Möllmann2023-12-231-8/+4
| | | | | | | | | | * src/nsterm.m (ns_in_echo_area_1): Use safe_calln. ([EmacsView draggingUpdated:]): Use safe_calln.
* | Split safe_call between redisplay and non-redisplay versionsStefan Monnier2023-12-2318-169/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `safe_call/eval` family of functions started its life in `xdisp.c` for the needs of redisplay but quickly became popular outside of it. This is not ideal because despite their name, they are somewhat specific to the needs of redisplay. So we split them into `safe_call/eval` (in `eval.c`) and `dsafe_call/eval` (in `xdisp.c`). We took this opportunity to slightly change their calling convention to be friendly to the CALLN-style macros. While at it, we introduce a new `calln` macro as well which does all that `call[1-8]` used to do. * src/eval.c (safe_eval_handler, safe_funcall, safe_eval): New functions, Copied from `xdisp.c`. Don't obey `inhibit_eval_during_redisplay` any more. Adjust error message to not claim it happened during redisplay. * src/lisp.h (calln): New macro. (call1, call2, call3, call4, call5, call6, call7, call8): Turn them into aliases of `calln`. (safe_funcall): Declare. (safe_calln): New macro. (safe_call1, safe_call2): Redefine as compatibility macros. (safe_call, safe_call1, safe_call2): Delete. Replace all callers with calls to `safe_calln`. * src/xdisp.c (dsafe_eval_handler): Rename from `safe_eval_handler`. Adjust all users. (dsafe__call): Rename from `safe_call` and change calling convention to work with something like CALLMANY. Adjust all users. (safe_call, safe__call1, safe_call2): Delete functions. (SAFE_CALLMANY, dsafe_calln): New macros. (dsafe_call1, dsafe_eval): Rename from `safe_call1` and `safe_eval`, and rewrite using them. Adjust all users. (clear_message, prepare_menu_bars, redisplay_window): Use `dsafe_calln`. (run_window_scroll_functions): Don't let-bind `Qinhibit_quit` since `safe_run_hooks_2` does it for us.
* | Respect glyph metrics modified by instruction codePo Lu2023-12-233-51/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/sfnt.c (sfnt_read_glyph): Clear advance and origin distortion returning an empty glyph. (sfnt_build_instructed_outline): New parameter *ADVANCE_WIDTH, in which the glyph's advance width is saved. (sfnt_interpret_compound_glyph_1): Refine commentary. (sfnt_verbose, main): Adjust tests. * src/sfnt.h: Update prototypes correspondingly. * src/sfntfont.c (sfntfont_get_glyph_outline): If an instructed outline is available, derive the advance and lbearing from the measurements within. (sfntfont_probe_widths): Call sfntfont_measure_pcm to establish average widths. (sfntfont_open): Do so after instruction code initialization completes. (sfntfont_measure_pcm): Revise commentary.
* | Slight funcall_subr optimisationMattias EngdegÄrd2023-12-221-10/+8
| | | | | | | | | | | | | | * src/eval.c (funcall_subr): Help the compiler by reducing aliasing problems, and compensate for a missed-optimisation bug in LLVM where switches sometimes forget to use variable range information (reported in https://github.com/llvm/llvm-project/issues/76085).
* | Properly instruct compound glyphs with compound componentsPo Lu2023-12-221-24/+10
| | | | | | | | | | | | * src/sfnt.c (sfnt_interpret_compound_glyph_2): Don't grow the compound decomposition context for saving compound points into, since the space for them already exists.
* | Implement an undocumented TrueType "feature"Po Lu2023-12-211-1/+33
| | | | | | | | | | | | | | * src/sfnt.c (sfnt_move): Correct commentary. (sfnt_interpret_control_value_program): Reset dual projection, freedom and projection vectors, in addition to the reference points, zone pointers and loop counter.
* | * src/sfnt.c (GETINFO): Implement undocumented selector bit 5.Po Lu2023-12-211-2/+8
| |
* | Accept empty contours in glyphsPo Lu2023-12-211-2/+4
| | | | | | | | | | * src/sfnt.c (sfnt_decompose_glyph_1, sfnt_decompose_glyph_2): Accept empty contours, for they are not invalid, just redundant.
* | ; * src/eval.c (syms_of_eval) <debugger>: Doc fix.Eli Zaretskii2023-12-191-6/+6
| |
* | Improve efficiency of operations involving font interpreter scalePo Lu2023-12-191-20/+21
| | | | | | | | | | | | | | | | | | | | * src/sfnt.c (sfnt_mul_f26dot6_fixed): Correct rounding constant. (sfnt_make_interpreter, SSW, WCVTF, sfnt_compute_phantom_points) (sfnt_interpret_simple_glyph, sfnt_interpret_compound_glyph_1) (sfnt_vary_interpreter, sfnt_check_ssw): Account for the fractional bits in a f26dot6 when computing the interpreter scale factor.
* | Properly sign-extend freedom and projection vector valuesPo Lu2023-12-191-4/+4
| | | | | | | | * src/sfnt.c (GPV, GFV): Cast versors to int32_t.
* | Further corrections to font scalingPo Lu2023-12-192-38/+47
| | | | | | | | | | | | | | | | | | | | | | * src/sfnt.c (sfnt_dot_fix_14): Correct typo in final division. (sfnt_compute_phantom_points): New parameters S1 and S2, into which unrounded phantom point coordinates are saved. (sfnt_interpret_simple_glyph, sfnt_interpret_compound_glyph_2) (sfnt_interpret_compound_glyph_1): Adjust correspondingly. * src/sfntfont.c (sfntfont_get_glyph_outline): Delete redundant branch.
* | debug.el: Straighten the code that find the "base" of the backtraceStefan Monnier2023-12-181-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let the caller tell us clearly where is the base of the backtrace, if it's not `debug`. This is done by passing a new `:backtrace-base` keyword argument to `debug`. Then use this info systematically in all the places where we access the real C-level backtrace, to try and avoid inconsistencies and brittle code that tries to enumerate the expected frames we're in. * src/eval.c (get_backtrace_starting_at): Add support for offsets in the `base` argument. (Fbacktrace_debug): Add optional `base` argument. * lisp/emacs-lisp/debug.el (debug, debugger-frame, debugger-frame-clear): Use `debugger--backtrace-base` when calling `backtrace-debug`. (debugger-setup-buffer): Use `debugger--backtrace-base` when calling `backtrace-get-frames`. (debugger-frame-number): Drop `skip-base` arg, assume it's never nil. Add sanity check. (debugger--backtrace-base): Use the `:backtrace-base` info in `debugger-args`. (debugger-eval-expression): Adjust call to `debugger-frame-number`. (debug--implement-debug-on-entry): Pass appropriate `:backtrace-base`.
* | Further fixes for problems uncovered by the previous fixPo Lu2023-12-181-9/+14
| | | | | | | | | | | | | | * src/sfnt.c (sfnt_deltap): Enable deltap instructions again, since they now serve a purpose. (sfnt_compute_phantom_points): Round phantom points to match the behavior of other TrueType scalers.
* | ; * src/sfnt.c: Fix typo.Po Lu2023-12-181-1/+1
| |
* | * src/sfnt.c (sfnt_interpret_mdap): Correct MDAP opcode.Po Lu2023-12-181-4/+4
| |
* | Fix typo in earlier changesPo Lu2023-12-181-5/+5
| | | | | | | | | | | | * src/sfnt.c (sfnt_poly_edges_exact): Don't overwrite the remainder of an ascending edge with its covered height. (main): Adjust tests.
* | Enable the new font scalerPo Lu2023-12-183-30/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/sfnt.c (sfnt_curve_is_flat): Tighten threshold for flat curves. (sfnt_insert_raster_step): Rewrite loop for clarity. (sfnt_poly_set_steps): New function; fill small spans with a plain unexceptional loop rather than memset. (sfnt_poly_steps): Call that function. (sfnt_verbose, main): Adjust tests such that the scaler can be selected at runtime. * src/sfnt.h: Update prototypes. * src/sfntfont.c (sfntfont_get_glyph_raster) (syms_of_sfntfont) <sfnt_raster_glyphs_exactly>: New variable.
* | * src/sfnt.h (sfnt_coerce_fixed): New macro.Po Lu2023-12-171-1/+2
| |
* | ; * src/sfnt.c: Fix typos.Po Lu2023-12-171-2/+2
| |
* | Introduce the rudiments of a new font rasterizerPo Lu2023-12-171-14/+913
| | | | | | | | | | | | | | | | | | | | | | | | | | * src/sfnt.c (xzalloc): New function. (sfnt_poly_edges): Remove redundant statement. (sfnt_add, sfnt_sub, sfnt_mul): Move macro definitions above the new scaler. (sfnt_build_outline_fedges, sfnt_insert_raster_step) (sfnt_fedge_sort, sfnt_poly_edges_exact, sfnt_compute_fill) (sfnt_poly_steps, sfnt_raster_steps, sfnt_raster_edges_exact) (sfnt_raster_glyph_outline_exact): New functions, presently disabled. (sfnt_x_raster, main): Introduce new tests.
* | Silence warning in print.cStefan Kangas2023-12-171-1/+1
| | | | | | | | * src/print.c (print_bool_vector): Silence warning.
* | Merge from origin/emacs-29Eli Zaretskii2023-12-161-4/+3
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bf4ccb0be07 ; * lisp/term.el (term--xterm-paste): Fix last change. 0d9e2e448d9 ; * doc/lispref/functions.texi (Function Documentation): ... 791cc5065da Fix shaping of Sinhala text efcbf0b5abf Add use cases of (fn) documentation facility. c3331cb3659 Fix pasting into terminal-mode on term.el 5be94e2bce5 Fix opening directory trees from Filesets menu 6b6e770a1f5 Eglot: Add ruff-lsp as an alternative Python server ed8a8a5ba16 Fix symbol name in Multisession Variables examples 400ef15bdc3 js-ts-mode: Fix font-lock rules conflict c165247c300 Add indentation rules for bracketless statements in js-ts... 7f1bd69cd19 Fix c-ts-mode bracketless indentation for BSD style (bug#... e23068cb9a1 Add missing indent rules in c-ts-mode (bug#66152) d2c4b926ac2 Fix treesit-default-defun-skipper (bug#66711) 9874561f39e Fix treesit-node-field-name and friends (bug#66674) eace9e11226 python-ts-mode: Highlight default parameters 23c06c7c308 Update to Org 9.6.13
| * Fix treesit-node-field-name and friends (bug#66674)Yuan Fu2023-12-101-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So turns out ts_node_field_name_for_child takes a named node index, but we were passing it normal index that counts both named and anonymous nodes. That's what makes the field name all wrong in treesit explorer. * doc/lispref/parsing.texi: (Accessing Node Information): Update docstring. * lisp/treesit.el (treesit-node-index): Add some unrelated comment. (treesit-node-field-name): Get named node index rather than all node index. * src/treesit.c (Ftreesit_node_field_name_for_child): Update docstring, use ts_node_named_child_count.
* | ; * src/androidfns.c (syms_of_androidfns) <android-os-language>: Doc fix.Eli Zaretskii2023-12-161-6/+5
| |
* | ; * src/androidfns.c (syms_of_androidfns_for_pdumper): Fix crash.Po Lu2023-12-141-18/+23
| |
* | Respect Language & Input preferences under AndroidPo Lu2023-12-141-0/+203
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/emacs/android.texi (Android Environment): * doc/emacs/cmdargs.texi (General Variables): Mention the manner in which the default language environment is selected on Android. * lisp/startup.el (normal-top-level): If android and initial-window-system, call android-locale-for-system-language for the default locale name. * lisp/term/android-win.el (android-locale-for-system-language): New function. * src/androidfns.c (syms_of_androidfns_for_pdumper): New function. (syms_of_androidfns) <Vandroid_os_language>: New variable. Call syms_of_androidfns_for_pdumper both now and after loading the dump image.
* | Correct implementation of UTPPo Lu2023-12-111-1/+27
| | | | | | | | | | * src/sfnt.c (sfnt_interpret_utp): Derive which flags to reset from the freedom vector.
* | Merge from origin/emacs-29Eli Zaretskii2023-12-105-9/+9
|\ \ | |/ | | | | | | | | | | | | | | | | | | 2773cf9e013 ; Fix typos 020aff95fa3 ; Fix typos in ChangeLog files 5e03a621efc ; * lisp/progmodes/c-ts-mode.el (c-ts-mode--else-heuristi... f0734e1c0d1 Fix c-ts-mode indent heuristic (bug#67417) 08fc6bace20 Fix c-ts-mode indentation (bug#67357) 71bc2815ccd Add font-locking for hash-bang lines in typescript-ts-mode. db8347c8c87 Add font-locking for hash-bang lines in js-ts-mode 91f2ade57bb ruby-mode: Better detect regexp vs division (bug#67569)
| * ; Fix typosStefan Kangas2023-12-101-1/+1
| |
| * ; Fix typos in ChangeLog filesStefan Kangas2023-12-104-8/+8
| |
* | ; Fix a few more typosStefan Kangas2023-12-102-3/+3
| |