aboutsummaryrefslogtreecommitdiffstats
path: root/src/term.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ; Add 2026 to copyright years.Sean Whitton2026-01-011-1/+1
|
* Variable to control overshoot and backup for TTY cursor motionManuel Giraud2025-08-091-0/+9
| | | | | | | | * src/term.c (syms_of_term): New variable. * src/cm.c (calccost): Control overshooting with new variable. * etc/NEWS: Document new variable. * lisp/term/rxvt.el (terminal-init-rxvt): Force no TAB+BS for rxvt. (Bug#78474)
* Don't write to bottom-right cell on ttys with AutoWrap (bug#77233)Gerd Möllmann2025-03-271-2/+12
| | | | | * src/term.c (tty_write_glyphs): Handle case of writing only one character in the last column.
* Fix the DJGPP buildPo Lu2025-03-251-0/+4
| | | | | | | | | | | * msdos/emacs.djl (.bss): Guarantee that lread.o is 8-byte aligned. * msdos/sed2v2.inp (ALIGNOF_INT, ALIGNOF_LONG) (ALIGNOF_LONG_LONG): Correct typos. * src/term.c (tty_free_frame_resources): Synchronize with non-DOS variant.
* Avoid rare crashes due to "C-g C-g" on TTY framesEli Zaretskii2025-03-231-2/+8
| | | | | * src/term.c (tty_send_additional_strings): Don't use SBYTES, as this function could be called in the middle of GC. (Bug#77205)
* Implement dragging and resizing of tty child framesMartin Rudalics2025-03-171-2/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/faces.el (face-spec-recalc): Don't set scroll-bar-foreground and scroll-bar-background parameters on ttys. * lisp/mouse.el (mouse-drag-frame-resize) (mouse-drag-frame-move): On ttys call 'mouse-position-in-root-frame' to get position of child frame to resize or drag. * lisp/xt-mouse.el (xterm-mouse-event): Handle events on child frame decorations as if they happened on the internal border to find out whether a user wants to drag or resize a child frame. * src/frame.c (frame_internal_border_part): Define for ttys too. (Fmouse_position_in_root_frame): New function. * src/frame.h (internal_border_part): Define for ttys too. * src/keyboard.c (internal_border_parts): Define for ttys too. (frame_border_side): New enum. (make_lispy_position): Handle events on tty child frames. (Fposn_at_x_y): Accept -1 for Y so we can handle a position on the top decoration of a tty child frame. * src/term.c (tty_frame_at): Handle case where X and Y denote a position on a tty child frame's decoration. * src/window.c (Fwindow_at): Handle case where X and Y denote a position on the decoration of a tty child frame which we pretend as belonging to that child frame (and not to its root).
* Fix drawing to the bottom-right corner of terminalsGerd Möllmann2025-03-091-8/+26
| | | | | | | * src/term.c (tty_write_glyphs_1): Renamed from tty_write_glyphs. Don't check if writing the bottom-right corner. (tty_write_glyphs): New function handling case of writing to the bottom-right corner, and otherwise calling tty_write_glyphs_1.
* Fix 'etc/DOC' for a few functions/variablesEli Zaretskii2025-03-041-1/+1
| | | | | | | | | * src/term.c (Ftty_frame_at): * src/menu.c (syms_of_menu) <x-popup-menu-function>: * src/dispnew.c (Fredisplay): Fix "doc:". The extra blank was preventing 'make-docfile' from recognizing the functions and variables and extracting their documentation to 'etc/DOC'. (Bug#76722)
* ; Whitespace fixes to silence git hooksStefan Kangas2025-02-261-1/+1
|
* Enforce redisplay when deleting a child frame (bug#76406)Gerd Möllmann2025-02-231-1/+7
| | | | | | * src/term.c (tty_free_frame_resources): When deleting a child mark its root frame to garbaged. * src/dispnew.c (prepare_desired_root_row): Add a check for GLYPH_DEBUG.
* Handle mouse highlighting in the presence of tty child framesGerd Möllmann2025-02-031-21/+74
| | | | | * src/term.c (tty_draw_row_with_mouse_face): Draw only parts of the highlighted text that are not covered by other frames.
* Don’t use garbage after tty_frame_at returns nilPaul Eggert2025-01-311-2/+2
| | | | | | | | | * src/term.c (handle_one_term_event): Don’t access possibly uninitialized storage if frame is nil. This fixes an issue introduced in commit 5eae7f5227c7789dea45cef26fec17c057024670 dated 2025-01-26 14:43:51 -0800. Issue caught by --enable-gcc-warnings, which enables -Wanalyzer-use-of-uninitialized-value with gcc (GCC) 14.2.1 20250110 (Red Hat 14.2.1-7).
* Fix clicking in child frames with GPMjared2025-01-271-2/+4
| | | | | * src/term.c (handle_one_term_event): Store child frame coordinates in event.
* Fix the Android portPo Lu2025-01-271-0/+2
| | | | | | | * src/term.c (tty_frame_at) [HAVE_ANDROID]: Always return nil. * src/terminal.c (cursor_to, raw_cursor_to) [HAVE_ANDROID]: Don't call root_xy.
* Replace is_frame_ancestor with frame_ancestor_pGerd Möllmann2025-01-251-1/+1
| | | | | | | | * src/dispnew.c (is_frame_ancestor): Removed. (frame_z_order_cmp): Use frame_ancestor_p. (copy_child_glyphs): Ditto. * src/dispextern.h: Declaration removed. * src/term.c (mouse_get_xy): Use frame_ancestor_p.
* ; * src/term.c (handle_one_term_event): Fix last change.Eli Zaretskii2025-01-251-1/+2
|
* Reapply "Fix mouse position handling for nested tty child frames"Gerd Möllmann2025-01-251-12/+19
| | | | This reverts commit e2cc52dbcd196f95cc79c6c6d899b9e86e696fe5.
* Reapply "Fix tty-frame-at for nested tty child frames"Gerd Möllmann2025-01-251-2/+4
| | | | This reverts commit 9ad28959d6895720865c0718bf60f4b7b0b144f3.
* Reapply "Simplify absolute (x, y) computation on ttys"Gerd Möllmann2025-01-251-4/+3
| | | | This reverts commit 13fdcd730ff63bf79caace9a6e46aff5f944b1b7.
* Revert "Simplify absolute (x, y) computation on ttys"Gerd Möllmann2025-01-251-3/+4
| | | | This reverts commit 5e132835ad320be1d5c45ffbf83d67d16fc7bf96.
* Revert "Fix tty-frame-at for nested tty child frames"Gerd Möllmann2025-01-251-4/+2
| | | | This reverts commit 9693f2a95ad14bf0caa34e60d72722d4dd4d85c9.
* Revert "Fix mouse position handling for nested tty child frames"Gerd Möllmann2025-01-251-19/+12
| | | | This reverts commit f37559a1ee035d184bc4db6e4f597281d3ac6879.
* Fix mouse position handling for nested tty child framesGerd Möllmann2025-01-251-12/+19
| | | | | | | | | | * src/dispnew.c (child_xy): New function. * src/dispextern.h: Declare it. * src/term.c (tty_frame_at): Return child-relative (x, y) in output parameters. (Ftty_frame_at): Return a list (FRAME CHILD-X CHILD-Y). (handle_one_term_event): Adapt use of tty_frame_at. * lisp/xt-mouse.el (xterm-mouse-event): Use new tty-frame-at.
* Fix tty-frame-at for nested tty child framesGerd Möllmann2025-01-251-2/+4
| | | | | * src/term.c (tty_frame_at): Translate child frame origin to absolute coordinates.
* Simplify absolute (x, y) computation on ttysGerd Möllmann2025-01-251-4/+3
| | | | | | | | * src/dispnew.c (root_xy): New function. (frame_pos_abs): Removed. (frame_rect_abs, abs_cursor_pos): Use root_xy. * src/dispextern.h: Declare root_xy. * src/term.c (mouse_get_xy): Use it.
* Handle tty menus overlapping child framesGerd Möllmann2025-01-231-10/+7
| | | | | | | * src/dispnew.c (frame_pos_abs, is_frame_ancestor): Make externally visible. * src/dispextern.h: Declare above functions. * src/term.c (mouse_get_xy): Handle mouse movement over child frames.
* ; * src/term.c (term_mouse_position): Fix 'fp' pointer.Juri Linkov2025-01-111-1/+1
|
* ; * src/term.c (tty_frame_at, term_mouse_position): Fix last change.Eli Zaretskii2025-01-111-2/+6
|
* Support TTY child frames with GPM mouseJared Finder2025-01-111-12/+58
| | | | | | | | | | | | | | * lisp/frame.el (x-list-fonts): Delete `frame-at', to move to C implementation. * lisp/xt-mouse.el (xterm-mouse-event): Call new `tty-frame-at'. * src/term.c (tty_frame_at, Ftty_frame_at): New C function, replacing `frame-at' only for TTYs. (term_mouse_position): Use last_mouse_frame when it is set. (handle_one_term_event): Call tty_frame_at to get frame under mouse, store it in last_mouse_frame. Alter event coordinates based on mouse frame. (syms_of_term): Add tty-frame-at, last_mouse_frame. * src/termhooks.h: Make Gpm_Event parameter const.
* Update copyright year to 2025Paul Eggert2025-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright".
* ; Fix compilation warnings in term.cEli Zaretskii2024-12-191-7/+7
| | | | | | | * src/term.c (Ftty_frame_geometry, Ftty_frame_edges) (Ftty_frame_list_z_order, Ftty_frame_restack) (Ftty_display_pixel_width, Ftty_display_pixel_height): Doc fixes. (Ftty_frame_restack): Make it "noreturn".
* Signal errors for unimplemented featuresGerd Möllmann2024-12-121-0/+1
| | | | | * src/frame.c (make_terminal_frame): Error for minibuffer-only frames. * src/term.c (Ftty_frame_restack): Signal error.
* TTY menus: handle saved state referencing dead framesGerd Möllmann2024-11-051-4/+18
| | | | | | * src/term.c (restore_desired_matrix): If a tty menu saves a current matrix that contains glyphs from a child frame, handle the case that that child frame dies before the saved state is restored.
* Don't work around a corner case once observedGerd Möllmann2024-10-281-17/+8
| | | | | * src/term.c (tty_write_glyphs): Refactor a bit. Don't check for null glyph frame.
* * src/term.c (tty_display_dimension): Avoid warnings.Eli Zaretskii2024-10-221-0/+1
|
* Fix commenting conventions.Eli Zaretskii2024-10-221-2/+2
|
* Initial child frames based on masterGerd Möllmann2024-10-221-32/+234
| | | | | | | This is based on a diff from 2024-10-15 which still applied. Since then, I've inadvertantly modified the igc branch so that it is no longer possible to get a clean diff of what has changed since I created the branch.
* Re-enable TTY glyph production for batch mode frames on AndroidPo Lu2024-06-101-11/+8
| | | | | | | | * lisp/org/ob-core.el (org-babel-execute-src-block): Revert previous change. * src/term.c (tty_append_glyph, produce_glyphs) [HAVE_ANDROID]: Re-enable suppressed code.
* Replace calls to intern with a constant string with DEFSYMsPo Lu2024-05-091-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/alloc.c (display_malloc_warning, syms_of_alloc): * src/buffer.c (Fmake_indirect_buffer, Fbuffer_local_variables) (Frename_buffer, Fkill_buffer, Fset_buffer_major_mode) (Fset_buffer_multibyte, syms_of_buffer): * src/callint.c (read_file_name, Fcall_interactively) (syms_of_callint): * src/callproc.c (call_process, create_temp_file) (syms_of_callproc): * src/charset.c (Fdefine_charset_internal, syms_of_charset): * src/cmds.c (internal_self_insert, syms_of_cmds): * src/coding.c (record_conversion_result) (Fdefine_coding_system_internal, syms_of_coding): * src/dbusbind.c (xd_signature, Fdbus_message_internal) (syms_of_dbusbind): * src/dispnew.c (init_faces_initial): * src/doc.c (Fsnarf_documentation, syms_of_doc): * src/dosfns.c (system_process_attributes, syms_of_dosfns): * src/emacs.c (init_cmdargs, Fdump_emacs, decode_env_path) (syms_of_emacs): * src/eval.c (call_debugger, Fdefvaralias, syms_of_eval): * src/fileio.c (barf_or_query_if_file_exists) (Finsert_file_contents, auto_save_error, Fdo_auto_save) (syms_of_fileio): * src/filelock.c (lock_file_1, syms_of_filelock): * src/fontset.c (fontset_from_font, syms_of_fontset): * src/frame.c (make_frame_without_minibuffer, syms_of_frame): * src/gnutls.c (emacs_gnutls_certificate_details) (Fgnutls_peer_status_warning_describe, Fgnutls_peer_status) (gnutls_verify_boot, syms_of_gnutls): * src/gtkutil.c (style_changed_cb, find_rtl_image): * src/image.c (imagemagick_filename_hint, gs_load) (syms_of_image): * src/keyboard.c (command_loop_1, read_char, timer_start_idle) (read_char_minibuf_menu_prompt, Fsuspend_emacs) (syms_of_keyboard): * src/keymap.c (Fmap_keymap, Flookup_key, Fdescribe_vector) (describe_vector, syms_of_keymap): * src/lread.c (Fread, Fread_positioning_symbols, syms_of_lread): * src/minibuf.c (Fabort_minibuffers, Fread_buffer) (Fcompleting_read, syms_of_minibuf): * src/msdos.c (XMenuActivate, run_msdos_command, syms_of_msdos): * src/nsfns.m (Fx_display_backing_store, Fx_display_visual_class) (Fns_hide_emacs, Fsystem_move_file_to_trash, ns_create_tip_frame) (x_hide_tip, Fx_show_tip, syms_of_nsfns): * src/nsfont.m (ns_spec_to_descriptor, ns_descriptor_to_entity) (syms_of_nsfont): * src/pdumper.c (Fdump_emacs_portable): * src/pgtkfns.c (Fx_display_visual_class, x_create_tip_frame) (Fx_show_tip, syms_of_pgtkfns): * src/pgtkterm.c (syms_of_pgtkterm, pgtk_cr_export_frames): * src/term.c (term_get_fkeys_1, set_tty_color_mode, Fsuspend_tty) (Fresume_tty, tty_menu_activate, syms_of_term): * src/terminal.c (create_terminal, syms_of_terminal): * src/w32fns.c (Fx_display_backing_store) (Fx_display_visual_class, Fset_message_beep, Fx_open_connection) (Fx_show_tip, Fx_file_dialog, Fsystem_move_file_to_trash) (Fw32_toggle_lock_key, syms_of_w32fns): * src/w32font.c (w32_enumfont_pattern_entity, syms_of_w32font): * src/w32term.c (w32_bitmap_icon, syms_of_w32term): * src/xdisp.c (message_dolog, define_frame_cursor1) (syms_of_xdisp): * src/xfaces.c (tty_lookup_color, syms_of_xfaces): * src/xml.c (make_dom, syms_of_xml): * src/xterm.c (syms_of_xterm): * src/xwidget.c (store_xwidget_download_callback_event) (store_xwidget_js_callback_event, syms_of_xwidget): Define symbols for symbols interned with `intern' from a constant string, delete duplicate DEFSYM directives, and substitute them for such calls to intern. This excludes only those symbols which are interned and referenced only once during Emacs's initialization, the timing of whose interning is inconsequential, and symbols in w32.c, which would need to be transferred to a new syms_of_w32 function that I cannot test.
* Fix implementation of the --terminal command-line switchEli Zaretskii2024-05-041-5/+5
| | | | | | | | | | | | It sounds like this has been broken ever since multi-tty was added to Emacs. * src/keyboard.c (dev_tty): New global variable. * src/keyboard.h: Declare 'dev_tty'. * src/emacs.c (main): Initialize 'dev_tty'. * src/term.c (Fcontrolling_tty_p, Fresume_tty, init_tty): * src/process.c (dissociate_controlling_tty): * src/keyboard.c (handle_interrupt_signal, handle_interrupt) (Fset_quit_char): Use 'dev_tty' instead of 'DEV_TTY'. (Bug#70519)
* ; * src/term.c (turn_on_face): Fix coding style.Po Lu2024-04-281-3/+3
|
* Add support for colored and styled underlines on tty framesMohsin Kaleem2024-04-271-4/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/dispextern.h (face, face_underline_type, syms_of_xfacse) (internal-set-lisp-face-attribute) (gui_supports_face_attributes_p): Add definitions for new underline styles of Double-line, Dots and Dashes. Rename FACE_UNDER_LINE and FACE_UNDER_WAVE to make definitions consistent. Delete tty_underline_p from the face struct and use just underline going forward. Add a flag to check whether styled underlines are available. * lisp/cus-face.el (custom-face-attributes): Add entries for Double-line, Dots and Dashes so they can be set through `customize'. * src/termchar.c (tty_display_info): Add an entry for the escape sequence to set the underline style and color on terminal frames. * src/term.c (init_tty, tty_capable_p, turn_on_face): Read and save the underline style escape sequence from the Smulx termcap (alternatively if the Su flag is set use a default sequence). Allow checking for support of styled underlines in the current terminal frame. Output the necessary escape sequences to activate a styled underline on turn_on_face; this is currently only used for the new special underline styles, a default straight underline will still use the "us" termcap. Output escape sequence to set underline color when set in the face and supported by the tty. Save a default value for this sequence on init_tty when styled underlines are supported. * src/xfaces.c (tty_supports_face_attributes_p, realize_tty_face) (map_tty_color): Assert whether styled underlines are supported by the current terminal on display-supports-face-attributes-p checks. Populate the correct underline style and color in the face spec when realizing a face. Allow map_tty_color to map underline colors alongside foreground and background. The interface of map_tty_color was amended to allow the caller to supply the underline color instead of accessing it through the face attributes. (bug#62994) * src/xterm.c (x_draw_glyph_string): Updated to use renamed FACE_UNDERLINE_SINGLE and FACE_UNDERLINE_WAVE face_underline_type enumerations.
* * src/term.c (produce_glyphs): Synchronize with gui_produce_glyphs.Po Lu2024-02-011-1/+12
|
* Prevent continuation from affecting tab width in/after line prefixPo Lu2024-02-011-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | * src/dispextern.h (struct it) <wrap_prefix_width>: New field, synchronized with current_x when producing glyphs for wrap prefixes, and subtracted from it->current_x when computing tab widths. * src/term.c (produce_glyphs): Set wrap_prefix_width. * src/xdisp.c (start_display, display_min_width, move_it_to) (move_it_vertically_backward, move_it_by_lines) (window_text_pixel_size, display_tab_bar_line) (display_tool_bar_line, redisplay_internal, redisplay_window) (try_window_id, insert_left_trunc_glyphs) (extend_face_to_end_of_line, display_line) (Fmove_point_visually): Set or clear wrap_prefix_width as appropriate. (gui_produce_glyphs): Set or clear it->wrap_prefix_width. When computing the base position of a tab character, do not subtract the continuation line width if a line prefix is the current iterator method. Subtract the wrap_prefix_width otherwise, in order that the width of the tab is computed free of influence from the wrap prefix.
* Be more systematic about parens in C source codePaul Eggert2024-01-201-5/+6
| | | | | | | | | 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.
* Merge from savannah/emacs-29Po Lu2024-01-021-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dc4e6b13296 ; Update copyright years in more files 64b37776318 ; Run set-copyright from admin.el 8e1c56ae467 ; Add 2024 to copyright years # Conflicts: # doc/misc/modus-themes.org # doc/misc/texinfo.tex # etc/NEWS # etc/refcards/ru-refcard.tex # etc/themes/modus-operandi-theme.el # etc/themes/modus-themes.el # etc/themes/modus-vivendi-theme.el # lib/alloca.in.h # lib/binary-io.h # lib/c-ctype.h # lib/c-strcasecmp.c # lib/c-strncasecmp.c # lib/careadlinkat.c # lib/cloexec.c # lib/close-stream.c # lib/diffseq.h # lib/dup2.c # lib/filemode.h # lib/fpending.c # lib/fpending.h # lib/fsusage.c # lib/getgroups.c # lib/getloadavg.c # lib/gettext.h # lib/gettime.c # lib/gettimeofday.c # lib/group-member.c # lib/malloc.c # lib/md5-stream.c # lib/md5.c # lib/md5.h # lib/memmem.c # lib/memrchr.c # lib/nanosleep.c # lib/save-cwd.h # lib/sha1.c # lib/sig2str.c # lib/stdlib.in.h # lib/strtoimax.c # lib/strtol.c # lib/strtoll.c # lib/time_r.c # lib/xalloc-oversized.h # lisp/auth-source-pass.el # lisp/emacs-lisp/lisp-mnt.el # lisp/emacs-lisp/timer.el # lisp/info-look.el # lisp/jit-lock.el # lisp/loadhist.el # lisp/mail/rmail.el # lisp/net/ntlm.el # lisp/net/webjump.el # lisp/progmodes/asm-mode.el # lisp/progmodes/project.el # lisp/progmodes/sh-script.el # lisp/textmodes/flyspell.el # lisp/textmodes/reftex-toc.el # lisp/textmodes/reftex.el # lisp/textmodes/tex-mode.el # lisp/url/url-gw.el # m4/alloca.m4 # m4/clock_time.m4 # m4/d-type.m4 # m4/dirent_h.m4 # m4/dup2.m4 # m4/euidaccess.m4 # m4/fchmodat.m4 # m4/filemode.m4 # m4/fsusage.m4 # m4/getgroups.m4 # m4/getloadavg.m4 # m4/getrandom.m4 # m4/gettime.m4 # m4/gettimeofday.m4 # m4/gnulib-common.m4 # m4/group-member.m4 # m4/inttypes.m4 # m4/malloc.m4 # m4/manywarnings.m4 # m4/mempcpy.m4 # m4/memrchr.m4 # m4/mkostemp.m4 # m4/mktime.m4 # m4/nproc.m4 # m4/nstrftime.m4 # m4/pathmax.m4 # m4/pipe2.m4 # m4/pselect.m4 # m4/pthread_sigmask.m4 # m4/readlink.m4 # m4/realloc.m4 # m4/sig2str.m4 # m4/ssize_t.m4 # m4/stat-time.m4 # m4/stddef_h.m4 # m4/stdint.m4 # m4/stdio_h.m4 # m4/stdlib_h.m4 # m4/stpcpy.m4 # m4/strnlen.m4 # m4/strtoimax.m4 # m4/strtoll.m4 # m4/time_h.m4 # m4/timegm.m4 # m4/timer_time.m4 # m4/timespec.m4 # m4/unistd_h.m4 # m4/warnings.m4 # nt/configure.bat # nt/preprep.c # test/lisp/register-tests.el
| * ; Add 2024 to copyright yearsPo Lu2024-01-021-1/+1
| |
* | Split safe_call between redisplay and non-redisplay versionsStefan Monnier2023-12-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Minor adjustments to Android port stubsPo Lu2023-09-051-11/+14
| | | | | | | | | | | | | | | | | | | | | | * src/androidfns.c (Fx_display_backing_store): Return `when-mapped' in place of `always', since the former better reflects Android port behavior. (syms_of_androidfns) <always>: Delete defsym. <when-mapped>: New defsym. * src/term.c (Fsuspend_tty, Fresume_tty): Properly signal errors on Android rather than quietly disregarding calls.
* | Update Android portPo Lu2023-07-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac (ANDROID_STUBIFY): Add androidvfs.o when building libemacs.so. * doc/emacs/android.texi (Android): Add `Android Document Providers'. (Android Startup): Update the location of the content identifier directory. (Android File System): Describe access to document provider directories. (Android Document Providers): New node. * doc/emacs/emacs.texi (Top): Update the menu for the Android appendix. * java/Makefile.in (filename, install_temp/assets/build_info): Make directory-tree depend on build_info. * java/org/gnu/emacs/EmacsActivity.java (onActivityResult): New function. When a document tree is accepted, persist access to it. * java/org/gnu/emacs/EmacsDirectoryEntry.java (EmacsDirectoryEntry): New struct. * java/org/gnu/emacs/EmacsOpenActivity.java (checkReadableOrCopy): Use EmacsService.buildContentName. * java/org/gnu/emacs/EmacsService.java (getEmacsView, openContentUri) (checkContentUri): Remove excessive debug logging. (buildContentName, getDocumentAuthorities, requestDirectoryAccess) (getDocumentTrees, decodeFileName, documentIdFromName, getTreeUri) (statDocument, accessDocument, openDocumentDirectory, readDirectoryEntry) (openDocument, createDocument): New functions. * lib-src/asset-directory-tool.c: Improve commentary by illustrating the difference between directory and ordinary files. * src/android.c (ANDROID_THROW, enum android_fd_table_entry_flags) (struct android_emacs_service, android_extract_long) (android_scan_directory_tree, android_is_directory) (android_get_asset_name, android_url_encode, android_content_name_p) (android_get_content_name, android_check_content_access, android_fstat) (android_fstatat, android_file_access_p, android_hack_asset_fd_fallback) (android_detect_ashmem, android_hack_asset_fd, android_close_on_exec) (android_open, android_close, android_fclose, android_create_lib_link) (android_faccessat, struct android_dir, android_opendir, android_dirfd) (android_readdir, android_closedir, android_lookup_asset_directory_fd) (android_exception_check_3, android_get_current_api_level) (android_open_asset, android_close_asset, android_asset_read_quit) (android_asset_read, android_asset_lseek, android_asset_fstat): Move content and asset related functions to androidvfs.c. (android_init_emacs_service): Obtain handles for new JNI functions. (initEmacsParams): Initialize the VFS layer. (android_request_directory_access): New function. (android_display_toast): Remove unused function. * src/android.h (android_get_current_api_level): Assume that this function never returns less than __ANDROID_API__. (struct android_emacs_service): Move `struct android_emacs_service' here. * src/androidfns.c (Fandroid_request_directory_access): New interactive function. (syms_of_androidfns): Register new subr. * src/androidvfs.c (struct android_vdir, struct android_vops) (struct android_vnode, struct android_special_vnode) (enum android_vnode_type, struct android_cursor_class) (struct emacs_directory_entry_class) (struct android_parcel_file_descriptor_class) (android_init_cursor_class, android_init_entry_class) (android_init_fd_class, android_vfs_canonicalize_name) (struct android_unix_vnode, struct android_unix_vdir, unix_vfs_ops) (android_unix_name, android_unix_vnode, android_unix_open) (android_unix_close, android_unix_unlink, android_unix_symlink) (android_unix_rmdir, android_unix_rename, android_unix_stat) (android_unix_access, android_unix_mkdir, android_unix_readdir) (android_unix_closedir, android_unix_dirfd, android_unix_opendir) (android_extract_long, android_scan_directory_tree) (android_is_directory, android_init_assets) (android_hack_asset_fd_fallback, android_detect_ashmem) (android_hack_asset_fd, struct android_afs_vnode) (struct android_afs_vdir, struct android_afs_open_fd, afs_vfs_ops) (android_afs_name, android_afs_initial, android_close_on_exec) (android_afs_open, android_afs_close, android_afs_unlink) (android_afs_symlink, android_afs_rmdir, android_afs_rename) (android_afs_stat, android_afs_access, android_afs_mkdir) (android_afs_readdir, android_afs_closedir, android_afs_dirfd) (android_afs_opendir, android_afs_get_directory_name) (struct android_content_vdir, content_vfs_ops) (content_directory_contents, android_content_name) (android_content_open, android_content_close) (android_content_unlink, android_content_symlink) (android_content_rmdir, android_content_rename) (android_content_stat, android_content_access) (android_content_mkdir, android_content_readdir) (android_content_closedir, android_content_dirfd) (android_content_opendir, android_content_get_directory_name) (android_content_initial, android_get_content_name) (android_check_content_access, struct android_authority_vnode) (authority_vfs_ops, android_authority_name, android_authority_open) (android_authority_close, android_authority_unlink) (android_authority_symlink, android_authority_rmdir) (android_authority_rename, android_authority_stat) (android_authority_access, android_authority_mkdir) (android_authority_opendir, android_authority_initial) (struct android_saf_root_vnode, struct android_saf_root_vdir) (saf_root_vfs_ops, android_saf_root_name, android_saf_root_open) (android_saf_root_close, android_saf_root_unlink) (android_saf_root_symlink, android_saf_root_rmdir) (android_saf_root_rename, android_saf_root_stat) (android_saf_root_access, android_saf_root_mkdir) (android_saf_root_readdir, android_saf_root_closedir) (android_saf_root_dirfd, android_saf_root_opendir) (android_saf_root_initial, android_saf_root_get_directory) (android_saf_stat, android_saf_access) (struct android_saf_tree_vnode, struct android_saf_tree_vdir) (saf_tree_vfs_ops, android_document_id_from_name) (android_saf_tree_name, android_saf_tree_open) (android_saf_tree_close, android_saf_tree_unlink) (android_saf_tree_symlink, android_saf_tree_rmdir) (android_saf_tree_rename, android_saf_tree_stat) (android_saf_tree_access, android_saf_tree_mkdir) (android_saf_tree_opendir_1, android_saf_tree_readdir) (android_saf_tree_closedir, android_saf_tree_dirfd) (android_saf_tree_opendir, android_saf_tree_from_name) (android_saf_tree_get_directory, android_saf_file_vnode) (saf_file_vfs_ops, android_saf_file_name, android_saf_file_open) (android_saf_file_unlink, android_saf_file_rmdir) (android_saf_file_opendir, android_close_parcel_fd) (android_saf_new_vnode, android_saf_new_name, android_saf_new_open) (android_saf_new_unlink, android_saf_new_symlink) (android_saf_new_rmdir, android_saf_new_rename) (android_saf_new_stat, android_saf_new_access) (android_saf_new_mkdir, android_saf_new_opendir, root_vfs_ops) (special_vnodes, android_root_name, android_name_file) (android_vfs_init, android_open, android_unlink, android_symlink) (android_rmdir, android_mkdir, android_renameat_noreplace) (android_rename, android_fstat, android_fstatat_1, android_fstatat) (android_faccessat, android_fdopen, android_close, android_fclose) (android_open_asset, android_close_asset, android_asset_read_quit) (android_asset_read, android_asset_lseek, android_asset_fstat) (android_opendir, android_dirfd, android_readdir) (android_closedir): Move file system emulation routines here. Introduce a new ``VFS'' layer for translating between Emacs-specific file names and the various disparate interfaces for accessing files on Android. * src/callproc.c (delete_temp_file): * src/charset.c (load_charset_map_from_file): * src/dired.c: * src/emacs.c (Fkill_emacs): * src/fileio.c (check_mutable_filename, Fcopy_file) (Fmake_directory_internal, Fdelete_directory_internal) (Fdelete_file, Frename_file, Fadd_name_to_file) (Fmake_symbolic_link, file_accessible_directory_p, Fset_file_modes) (Fset_file_times, write_region): * src/filelock.c (get_boot_time, rename_lock_file) (create_lock_file, current_lock_owner, unlock_file): * src/image.c (slurp_file, png_load_body, jpeg_load_body): * src/keyboard.c (Fopen_dribble_file): * src/lisp.h: * src/lread.c (Fload): * src/process.c (handle_child_signal): * src/sysdep.c (init_standard_fds, emacs_fopen, emacs_fdopen) (emacs_unlink, emacs_symlink, emacs_rmdir, emacs_mkdir) (emacs_renameat_noreplace, emacs_rename): * src/term.c (Fresume_tty, init_tty): Use and add new wrappers for fopen, fdopen, unlink, symlink, rmdir, mkdir, renameat_norepalce and rename.