summaryrefslogtreecommitdiff
path: root/src/fileio.c
Commit message (Collapse)AuthorAge
* Fix insert-file-contents on /proc filesPaul Eggert2023-02-13
| | | | | | | | This should fix Bug#9800 (2011-10-19). * src/fileio.c (Finsert_file_contents): Do not trust st_size even on regular files, as the file might be a Linux /proc file, or it might be growing. Instead, always read to EOF when END is nil.
* Fix src/fileio.c commentPaul Eggert2023-02-13
| | | | | | * src/fileio.c (Finsert_file_contents): Fix comment. Since the code relies on st_size, it’s limited to regular files, not to seekable files.
* Don’t scan text twice to guess coding systemPaul Eggert2023-02-13
| | | | | | | | * src/fileio.c (Finsert_file_contents): If the file shrank below 4 KiB, don’t read duplicate text into READ_BUF. This also removes a use of SEEK_END, which Linux /proc file systems do not support (not that we should get here with /proc).
* Improve insert-file-contents on non-regular filesPaul Eggert2023-02-13
| | | | | | * src/fileio.c (Finsert_file_contents): If the file is not a regular file, check REPLACE and VISIT before doing further syscalls that won’t matter in this case.
* Improve insert-file-contents checkingPaul Eggert2023-02-13
| | | | | * src/fileio.c (Finsert_file_contents): Check BEG, END, REPLACE for validity before launching into opening files etc.
* Improve interactive file-saving performancePaul Eggert2023-01-02
| | | | | | * src/fileio.c (init_fileio): No longer any need to set write-region-inhibit-fsync here. (syms_of_fileio): Default write-region-inhibit-fsync to t (Bug#60474).
* Merge from origin/emacs-29Eli Zaretskii2023-01-01
|\ | | | | | | | | | | | | | | | | | | | | cae528457c ; Add 2023 to copyright years. b394359261 Improve documentation of 'isearch-open-overlay-temporary' ab3210e709 Document 'use-package' in the 2 main manuals # Conflicts: # etc/refcards/ru-refcard.tex # lib/explicit_bzero.c # m4/explicit_bzero.m4
| * ; Add 2023 to copyright years.Eli Zaretskii2023-01-01
| |
* | Merge from origin/emacs-29Stefan Kangas2022-12-22
|\| | | | | | | | | | | | | | | | | | | e59216d3be8 * Invoke spawed Emacs processes with '-Q' when native com... 777b383dd0f Fix Eshell electric slash when used from the root directo... c088cdad9e9 Fix the --without-all build with tree-sitter ec9fbad908d Fix write-region to null device on MS-Windows f35da111990 message: Do not default to eudc-capf-complete yet 98c16a8c883 ; * lisp/tab-bar.el: Remaining renaming of "fixed-width" ... d76d7a3bebf whitespace: Avoid mutating original buffer's markers in c...
| * Fix write-region to null device on MS-WindowsEli Zaretskii2022-12-21
| | | | | | | | | | | | * src/fileio.c (write_region) [WINDOWSNT]: Ignore EBADF errors from fsync -- this means fsync is not supported for this file. Happens, for example, with the null device. (Bug#59545)
* | Merge from origin/emacs-29Stefan Kangas2022-12-19
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 12e26cc0c1b ; * admin/git-bisect-start: Add mistakenly ommitted commi... 9a751e0a38b ruby-mode: Support endless singleton method definitions too ce7b7e5af3d Remove comment-start-skip preset in tree-sitter indentati... c1e015ae320 Fix recent change in tramp-smb.el cf1b771864a ; * etc/NEWS: Fix typos. 50d18bb6ea7 Make tramp-archive autoloads robust for older Emacs versions 3941cc29df3 ; Improve documentation of 'setopt' 6f88de109c8 ruby-mode: Support endless methods (bug#54702) 91dd893e343 ; * lisp/progmodes/sql.el (sql-product-interactive): Doc ... 138d9dc4cb0 * lisp/cus-edit.el (setopt--set): Warn instead of rasing ... d1e0542f336 Allow customising windmove user options with an empty prefix c2375e77914 Improve and extend admin/git-bisect-start 7cc2313eb0a Make 'rmail-summary-by-thread' faster 88e59b16cbe ; Improve documentation of installing tree-sitter and gra... 897f33bf316 Fix the MS-DOS build 660e941235d Avoid crashes in PGTK build due to signal in 'note_mouse_... 0fc5fb2d054 Fix MS-Windows build broken by recent treesit.c changes 5b2e6d04ce2 Fix wrong capture in typescript-ts-mode (bug#60167) cb8ccdd2670 Add rust-ts-mode (Bug#60136) 9fcf764dd73 Indentation fixes for jsx/tsx (bug#60169) 69f2c71135f Fix treesit-query-validate problem with view-mode 1fc7535546c Use cursor API in treesit-node-parent 5f0286c0afa Switch to use cursor API in treesit.c a275e436df4 Add treesit_assume_true and treesit_cursor_helper a54c7a8df0c Remove file-exists-in-trash-p 3e02029642c Update to Org 9.6-49-g47d129 4a8ff671b0e Don’t assume make-directory handler returns nil 44c83b239d3 Fix copy-directory bug when dest dir exists bef1edc9cac make-directory now returns t if dir already exists 8a9579ca29d Use make-directory handlers uniformly 627e7e0243d Improve documentation of 'file-exists-p' c9015ef55ff Fix resizing of mini-windows by 'set-minibuffer-message' 5a245bc786e Prevent Abort dialogs from async-compiling jobs on Windows 4d1e4a48938 Fix 'window-max-chars-per-line' when there are no fringes d65beb820cc ; Revert "; * lisp/subr.el (internal--with-narrowing): Si... 1c0b90e5f7d ruby-mode: Recognize instance or global var as first arg ... 3356c0cb163 Fix end-of-defun in ruby-mode # Conflicts: # etc/NEWS
| * Use make-directory handlers uniformlyPaul Eggert2022-12-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Formerly, the code supported both make-directory and make-directory-internal handlers. This led to confusion and meant than in a few cases (nnmaildir, ido) remote directories could not be used in some cases. Fix this by using only make-directory handlers. Perhaps there used to be a reason for why there were both make-directory and make-directory-internal handlers, but whatever that reason was, it seems to have vanished even before now. There is no longer any need for make-directory-internal handlers, as the few remaining callers that use make-directory-internal do so only when there are no handlers. However, this change keeps the existing make-directory-internal handlers for now, in case this code is ever used in older Emacs versions that still call those handlers. * lisp/gnus/nnmaildir.el (nnmaildir--mkdir): * lisp/ido.el (ido-file-internal): * lisp/net/tramp-smb.el (tramp-smb-handle-make-directory): Use make-directory, not make-directory-internal. * lisp/net/tramp-smb.el (tramp-smb-handle-make-directory-internal): Now obsolete. * src/fileio.c (Fmake_directory_internal): Do not look for or use a make-directory-internal handler. * test/lisp/files-tests.el: (files-tests-file-name-non-special-make-directory-internal): Remove, as this test incorrectly assumes that make-directory-internal must support handlers.
* | Improve rename-file fix (bug#34069)Paul Eggert2022-12-18
| | | | | | | | | | | | | | * src/fileio.c (Frename_file): No need for a special case to rename a fifo, since we already tried and failed to rename it. Also improve symlink handling, in that if readlink fails report an error rather than trying to treat the link as a regular file.
* | Don’t hang when copying FIFOsPaul Eggert2022-12-18
|/ | | | | | | * src/fileio.c (Fcopy_file): Open the input file with O_NONBLOCK. This prevents a hang if the input file is a FIFO. If it’s a regular file O_NONBLOCK has no effect; otherwise the file is soon rejected anyway.
* Merge remote-tracking branch 'origin/feature/noverlay'Stefan Monnier2022-10-28
|\
| * Merge 'master' into noverlayStefan Monnier2022-09-25
| |\
| * | Provide a new tree data-structure for overlays.Andreas Politz2017-10-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/itree.c (interval_generator_narrow, interval_generator_next) (interval_node_init, interval_node_begin) (interval_node_end, interval_node_set_region) (interval_tree_create, interval_tree_clear) (interval_tree_init, interval_tree_destroy) (interval_tree_size, interval_tree_insert) (interval_tree_contains, interval_tree_remove) (interval_tree_validate, interval_tree_iter_start) (interval_tree_iter_finish, interval_tree_iter_next) (interval_tree_iter_ensure_space, interval_tree_max_height) (interval_tree_insert_gap, interval_tree_delete_gap) (interval_generator_create, interval_generator_reset) (interval_generator_ensure_space, interval_node_intersects) (interval_generator_next, interval_generator_narrow) (interval_generator_destroy, interval_stack_create) (interval_stack_destroy, interval_stack_clear) (interval_stack_ensure_space, interval_stack_push) (interval_stack_push_flagged, interval_stack_pop) (interval_tree_update_limit, interval_tree_inherit_offset) (interval_tree_propagate_limit, interval_tree_rotate_left) (interval_tree_rotate_right, interval_tree_insert_fix) (interval_tree_remove_fix, interval_tree_transplant) (interval_tree_subtree_min): New file and new functions. * src/itree.h: New file. * configure.ac: Create Makefile for manual overlay tests. * src/Makefile.in: Add itree.o target. * src/alloc.c (build_overlay, mark_overlay, mark_buffer) (sweep_misc, sweep_buffers): Adapt to new tree data-structure. * src/buffer.c (overlays_in, overlays_at): Remove unused arguments prev_ptr and change_req, adapt to new data-structure and reuse code. (copy_overlays, drop_overlays, delete_all_overlays) (reset_buffer, kill-buffer, buffer-swap-text, next_overlay_change) (previous_overlay_change, mouse_face_overlay_overlaps) (disable_line_numbers_overlay_at_eob, overlay_touches_p) (overlay_strings, adjust_overlays_for_insert) (adjust_overlays_for_delete, overlayp, make-overlay, move-overlay) (delete-overlay, overlay-start, overlay-end, overlay-buffer) (overlay-properties, overlays-at, overlays-in) (next-overlay-change, previous-overlay-change, overlay-put) (overlay-get, report_overlay_modification, evaporate_overlays) (init_buffer_once): Adapt to changes and tree data-structure. (overlay-lists, overlay-recenter): Funtions are now obsolete, but kept anyway. (set_buffer_overlays_before, set_buffer_overlays_after) (recenter_overlay_lists,fix_start_end_in_overlays,fix_overlays_before) (unchain_overlay,): Removed functions of the old list data-structure. (swap_buffer_overlays, make_sortvec_item): New functions. (sort_overlays): Adapt to changes and tree data-structure. (sortvec): Moved to buffer.h . (make_lispy_interval_node, overlay_tree, overlay-tree) [ITREE_DEBUG]: New debugging functions. * src/buffer.h (overlays_before, overlays_after): Removed struct member of the list data-structure. (overlays): Added tree struct member. (sortvec): Moved here from buffer.c . (GET_OVERLAYS_AT): Adapt to changes. (set_buffer_intervals, OVERLAY_START, OVERLAY_END, OVERLAY_PLIST): Adapt to tree data-structure. (OVERLAY_POSITION): Removed macro of the list data-structure. (OVERLAY_REAR_ADVANCE_P, OVERLAY_FRONT_ADVANCE_P): New macros. (overlay_start, overlay_end) (set_overlay_region, maybe_alloc_buffer_overlays) (free_buffer_overlays, add_buffer_overlay) (remove_buffer_overlay, buffer_overlay_iter_start) (buffer_overlay_iter_next, buffer_overlay_iter_finish) (buffer_overlay_iter_narrow): New functions. (compare_overlays, make_sortvec_item): Export functions. * src/editfns.c (overlays_around): Reuse overlays_in. (get-pos-property): Adapt to tree data-structure. (transpose-regions): Remove call to deleted function. * src/fileio.c: (insert-file-contents): Remove references to deleted struct member. * src/fns.c (internal_equal): Adapt to tree data-structure. * src/indent.c (check_display_width): Adapt to tree data-structure. (skip_invisible): Remove call to deleted function. * src/insdel.c (adjust_markers_for_insert): Remove calls to deleted functions. * src/intervals.c (adjust_for_invis_intang): Adapt to tree data-structure. * src/keyboard.c (adjust_point_for_property): Adapt to tree data-structure. * src/lisp.h (Lisp_Overlay): Modified struct layout. * src/print.c (temp_output_buffer_setup, print_object): Adapt to tree data-structure. * src/textprop.c (get_char_property_and_overlay): Adapt to tree data-structure. Take advantage of the new data-structure. * src/window.h (overlay_matches_window): New function. * src/xdisp.h (next_overlay_change): Removed function. Use next-overlay-change, which does not use xmalloc anymore. (handle_single_display_spec, load_overlay_strings) (back_to_previous_visible_line_start, note_mouse_highlight): Adapt to tree data-structure. (move_it_to, display_line): Remove calls to deleted functions. * src/xfaces.c (face_at_buffer_position): Adapt to changes and tree data-structure. * test/src/buffer-tests.el: Many tests regarding overlays added. * test/manual/noverlay/itree-tests.c: New file with tests of the tree data-structure on the C level. * test/manual/noverlay/Makefile.in: New file. * test/manual/noverlay/check-sanitize.sh: New file. * test/manual/noverlay/emacs-compat.h: New file. * test/manual/noverlay/.gitignore: New file. * test/manual/noverlay/overlay-perf.el: New file providing performance tests. * test/manual/noverlay/many-errors.h: New file.
* | | ; Prefer HTTPS to HTTP in many URLsStefan Kangas2022-10-15
| | |
* | | Improve checks for recent "File exists" fixupPaul Eggert2022-10-13
| | | | | | | | | | | | * src/fileio.c (Finsert_file_contents): Add an assertion (bug#42431).
* | | Simplify recent "File exists" fixPaul Eggert2022-10-13
| | | | | | | | | | | | | | | * src/fileio.c (Finsert_file_contents): Simplify previous change that fixed bug#42431.
* | | Fix misleading "File exists, but cannot be read" in browse-url-emacsLars Ingebrigtsen2022-10-13
| |/ |/| | | | | | | | | | | * src/fileio.c (Finsert_file_contents): Don't signal an error about not being able to open the file when we're fetching things via handlers -- in that case, modtime isn't necessarily set, and if there's a handler, it should take care of this (bug#42431).
* | Abolish max-specpdl-size (bug#57911)Mattias Engdegård2022-09-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The max-lisp-eval-depth limit is sufficient to prevent unbounded stack growth including the specbind stack; simplify matters for the user by not having them to worry about two different limits. This change turns max-specpdl-size into a harmless variable with no effects, to keep existing code happy. * lisp/subr.el (max-specpdl-size): Define as an ordinary (but obsolete) dynamic variable. * admin/grammars/Makefile.in: * doc/lispintro/emacs-lisp-intro.texi (Loops & Recursion): * doc/lispref/control.texi (Cleanups): * doc/lispref/edebug.texi (Checking Whether to Stop): * doc/lispref/eval.texi (Eval): * doc/lispref/variables.texi (Local Variables): * doc/misc/calc.texi (Recursion Depth): Update documentation. * etc/NEWS: Announce. * src/eval.c (FletX): Use safe iteration to guard against circular bindings list. (syms_of_eval): Remove old max-specpdl-size definition. (init_eval_once, restore_stack_limits, call_debugger) (signal_or_quit, grow_specpdl_allocation): * leim/Makefile.in: * lisp/Makefile.in: * lisp/calc/calc-stuff.el (calc-more-recursion-depth) (calc-less-recursion-depth): * lisp/calc/calc.el (calc-do): * lisp/cedet/semantic/ede-grammar.el (ede-proj-makefile-insert-rules): * lisp/cedet/semantic/grammar.el (semantic-grammar-batch-build-one-package): * lisp/cus-start.el (standard): * lisp/emacs-lisp/comp.el (comp--native-compile): * lisp/emacs-lisp/edebug.el (edebug-max-depth): (edebug-read-and-maybe-wrap-form, edebug-default-enter): * lisp/emacs-lisp/regexp-opt.el (regexp-opt): * lisp/eshell/esh-mode.el (eshell-mode): * lisp/loadup.el (max-specpdl-size): * lisp/mh-e/mh-e.el (mh-invisible-headers): * lisp/net/shr.el (shr-insert-document, shr-descend): * lisp/play/hanoi.el (hanoi-internal): * lisp/progmodes/cperl-mode.el: * src/fileio.c (Fdo_auto_save): Remove references to and modifications of max-specpdl-size.
* | Prefer using DEFSYMs to intern with wrong_type_argumentStefan Kangas2022-09-18
| | | | | | | | | | | | | | | | | | | | * src/data.c (syms_of_data) <Qbooleanp>: * src/fileio.c (syms_of_fileio) <Qinserted_chars, Qfile_offset>: * src/font.c (syms_of_font) <Qfont_extra_type>: New DEFSYMs. * src/dbusbind.c (xd_signature, xd_append_arg): * src/fileio.c (file_offset, Finsert_file_contents): * src/font.c (Ffontp): Prefer using above new DEFSYMs to using intern directly.
* | Fix file-name-case-insensitive-p in ffap (bug#56443)Mattias Engdegård2022-07-08
| | | | | | | | | | | | | | | | | | | | | | Don't crash if the file name argument to file-name-case-insensitive-p, after expansion, doesn't have a parent directory. This occurs when calling ffap on something that looks like an email address. * src/fileio.c (Ffile_name_case_insensitive_p): Return nil if no file or parent directory could be found. * test/src/fileio-tests.el (fileio-tests--identity-expand-handler) (fileio--file-name-case-insensitive-p): New test.
* | Fix undo of changes in cloned indirect buffersEli Zaretskii2022-07-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/simple.el (primitive-undo): If the visited-modtime of the indirect buffer's file is bogus, use the modtime of the file visited by its base buffer. * src/undo.c (record_first_change): Call 'buffer_visited_file_modtime' with the correct buffer, instead of always calling 'Fvisited_file_modtime', which returns possibly bogus values for indirect buffers. * src/fileio.c (Fset_visited_file_modtime): Signal a meaningful error for indirect buffers. (buffer_visited_file_modtime): New function, with implementation taken from 'Fvisited_file_modtime'. (Fvisited_file_modtime): Call 'buffer_visited_file_modtime'. * src/lisp.h: Add prototype for 'buffer_visited_file_modtime'. (Bug#56397)
* | Use BASE_EQ instead of EQ where obviously safeMattias Engdegård2022-06-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/alloc.c (deadp): * src/buffer.c (reset_buffer_local_variables, candidate_buffer) (Fkill_buffer, Fbuffer_swap_text, Fmake_overlay, Fmove_overlay): * src/callint.c (Fcall_interactively): * src/coding.c (decode_coding_object, encode_coding_object) (code_convert_region, Ffind_operation_coding_system): * src/comp.c (Fcomp_el_to_eln_rel_filename): * src/conf_post.h (RE_TRANSLATE_P): * src/data.c (Fkill_local_variable, Fash, expt_integer): * src/dired.c (file_name_completion): * src/dispnew.c (set_window_cursor_after_update, update_frame_1) (Fframe_or_buffer_changed_p): * src/doc.c (Fdocumentation, Fdocumentation_property) (default_to_grave_quoting_style): * src/editfns.c (Fconstrain_to_field, save_excursion_save) (save_excursion_restore, Fngettext): * src/eval.c (Fautoload, un_autoload, specbind): * src/fileio.c (Fmake_temp_file_internal): * src/fns.c (string_char_to_byte, string_byte_to_char) (Fnthcdr, Fnreverse): * src/indent.c (vmotion): * src/inotify.c (add_watch): * src/keyboard.c (command_loop_1, read_char) (read_char_minibuf_menu_prompt): * src/lread.c (oblookup): * src/macfont.m (macfont_descriptor_entity, macfont_open): * src/minibuf.c (Finnermost_minibuffer_p, Ftry_completion) (Ftest_completion): * src/nsfns.m (ns_set_icon_name): * src/pdumper.c (dump_queue_dequeue): * src/pgtkfns.c (pgtk_set_icon_type, pgtk_set_icon_name): * src/process.c (Faccept_process_output): * src/textprop.c (set_text_properties): * src/w32fns.c (w32_set_icon_type, w32_set_icon_name): * src/w32select.c (validate_coding_system): * src/window.c (decode_next_window_args, window_loop) (save_window_save): * src/xdisp.c (wset_redisplay): * src/xfaces.c (Fx_family_fonts, resolve_face_name) (gui_supports_face_attributes_p): * src/xfns.c (x_set_icon_type, x_set_icon_name): * src/xselect.c (clean_local_selection_data): Use BASE_EQ instead of EQ where it is obvious that neither argument can be a symbol with properties or at least one argument is a non-symbol.
* | Merge from origin/emacs-28Stefan Kangas2022-06-16
|\ \ | | | | | | | | | | | | 4d7a936ac2 ; * src/fileio.c (Fset_file_modes): Improve previous change 32cff740e2 Describe 'set-file-modes' argument prompting
| * | ; * src/fileio.c (Fset_file_modes): Improve previous changeRobert Pluim2022-06-15
| | |
| * | Describe 'set-file-modes' argument promptingRobert Pluim2022-06-15
| | | | | | | | | | | | | | | * src/fileio.c (Fset_file_modes): Document that FILENAME is prompted for. (Bug#55984)
* | | ; * src/fileio.c (Finsert_file_contents): Fix a typo. (Bug#18370)Eli Zaretskii2022-06-11
| | |
* | | Allow inserting parts of /dev/urandom with insert-file-contentsLars Ingebrigtsen2022-06-11
| | | | | | | | | | | | | | | | | | * doc/lispref/files.texi (Reading from Files): Document it. * src/fileio.c (Finsert_file_contents): Allow specifying END for special files (bug#18370).
* | | ; Fix recent documentation changesEli Zaretskii2022-05-10
| | | | | | | | | | | | | | | | | | | | | | | | * src/fileio.c (Fdo_auto_save): * src/buffer.c (Fbuffer_modified_p, Frestore_buffer_modified_p): * doc/lispref/buffers.texi (Buffer Modification): Improve documentation of 'do-auto-save', 'buffer-modified-p' and 'restore-buffer-modified-p'.
* | | Reimplement recent with-silent-modifications auto-save changesLars Ingebrigtsen2022-05-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/buffers.texi (Buffer Modification): Document buffer-modified-p returning `autosaved'. * lisp/subr.el (with-silent-modifications): Use restore-buffer-modified-p instead of altering the buffer modiff (since this has other side effects like not updating after async `display' changes. * src/buffer.c (Fbuffer_modified_p): Allow returning whether the buffer has been autosaved after changes. (Frestore_buffer_modified_p): Allow adjusting whether the buffer has been autosaved after changes. * src/fileio.c (Fdo_auto_save): Refill the doc string.
* | | Don't hang on trying to rename FIFOs between file systemsLars Ingebrigtsen2022-05-08
| | | | | | | | | | | | | | | * src/fileio.c (Frename_file): Don't hang on trying to move FIFOs (bug#34069).
* | | Speed up comparisons between 2 fixnumsMattias Engdegård2022-04-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since <, <=, > and >= have their own byte-ops, the corresponding functions are mostly used as arguments to higher-order functions. This optimisation is particularly beneficial for sorting, where the comparison function is time-critical. * src/data.c (Flss, Fgtr, Fleq, Fgeq): * src/fileio.c (Fcar_less_than_car): Fast path for calls with 2 fixnum arguments.
* | | Omit unnecessary code when !HAVE_NATIVE_COMPPaul Eggert2022-03-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | * src/decompress.c (MD5_BLOCKSIZE, acc_buf, acc_size) (accumulate_and_process_md5, final_process_md5, md5_gz_stream): * src/dynlib.c (dynlib_open_for_eln, dynlib_close) [!WINDOWSNT]: * src/fileio.c (internal_delete_file_1, internal_delete_file): Define only if HAVE_NATIVE_COMP && WINDOWSNT, as they’re not used otherwise.
* | | Maintain end of specpdl instead of sizeMattias Engdegård2022-03-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Keep track of the end of specpdl explicitly since that is what we are comparing against on critical code paths. * src/eval.c (init_eval_once_for_pdumper, signal_or_quit) (grow_specpdl_allocation): * src/fileio.c (Fdo_auto_save): * src/lisp.h (grow_specpdl): * src/thread.c (run_thread, Fmake_thread): * src/thread.h (struct thread_state): Replace specpdl_size with specpdl_end, according to the equation specpdl_end = specpdl + specpdl_size.
* | | Replace ptrdiff_t with new specpdl_ref type for specpdl referencesMattias Engdegård2022-02-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The specpdl_ref type is just an alias for ptrdiff_t; the compiled code remains the same. All operations on specpdl_ref (arithmetic, comparison etc) now go through inline functions. The bulk of the change is almost completely mechanical. It is done to prepare for a type-safe representation and subsequent performance improvement. * src/lisp.h (specpdl_ref, specpdl_count_to_ref, specpdl_ref_to_count) (specpdl_ref_eq, specpdl_ref_lt, specpdl_ref_valid_p) (make_invalid_specpdl_ref, specpdl_ref_add, specpdl_ref_to_ptr): New. (SPECPDL_INDEX, struct handler, USE_SAFE_ALLOCA, safe_free) (safe_free_unbind_to): * src/alloc.c (run_finalizer_function, inhibit_garbage_collection) (garbage_collect, Fgarbage_collect, which_symbols): * src/bidi.c (bidi_at_paragraph_end, bidi_find_paragraph_start): * src/buffer.c (Fkill_buffer, Fset_buffer_major_mode, Fmove_overlay) (Fdelete_overlay): * src/bytecode.c (exec_byte_code): * src/callint.c (Ffuncall_interactively, Fcall_interactively): * src/callproc.c (Fcall_process, call_process, create_temp_file) (Fcall_process_region): * src/charset.c (load_charset_map_from_file): * src/coding.c (decode_coding_gap, decode_coding_object) (encode_coding_object, Fread_coding_system): * src/comp.c (emit_static_object, helper_unbind_n, load_comp_unit): * src/composite.c (update_compositions, autocmp_chars): * src/cygw32.c (conv_filename_to_w32_unicode) (conv_filename_from_w32_unicode): * src/data.c (notify_variable_watchers): * src/decompress.c (Fzlib_decompress_region): * src/dired.c (directory_files_internal, file_name_completion) (file_attributes): * src/dispnew.c (Fredisplay): * src/doc.c (get_doc_string, Fsnarf_documentation): * src/editfns.c (Fsave_excursion, Fsave_current_buffer) (Freplace_buffer_contents, Fsubst_char_in_region, Fsave_restriction) (styled_format): * src/emacs-module.c (Fmodule_load, funcall_module): * src/emacs.c (init_cmdargs, Fdump_emacs): * src/eval.c (call_debugger, do_debug_on_call, FletX, Flet) (Ffuncall_with_delayed_message, Funwind_protect) (internal_lisp_condition_case, signal_or_quit) (load_with_autoload_queue, Feval, grow_specpdl_allocation) (record_in_backtrace, eval_sub, Ffuncall, apply_lambda) (funcall_lambda, clear_unwind_protect, set_unwind_protect) (set_unwind_protect_ptr, unbind_to, Fbacktrace_eval): * src/fileio.c (Fmake_temp_file_internal, Fcopy_file, Frename_file) (Finsert_file_contents, write_region, Fdo_auto_save): * src/fns.c (Fyes_or_no_p, Frequire, hash_table_user_defined_call): * src/fringe.c (update_window_fringes): * src/gtkutil.c (xg_dialog_run): * src/haiku_io.c (c_specpdl_idx_from_cxx): * src/haiku_support.cc (be_popup_file_dialog): * src/haiku_support.h (c_specpdl_idx_from_cxx): * src/haikufns.c (haiku_create_frame, haiku_create_tip_frame) (haiku_hide_tip, Fx_show_tip, Fhaiku_read_file_name): * src/haikumenu.c (haiku_popup_dialog, set_frame_menubar): * src/image.c (slurp_file): * src/indent.c (line_number_display_width, Fvertical_motion): * src/insdel.c (signal_before_change, signal_after_change) (Fcombine_after_change_execute): * src/intervals.c (get_local_map): * src/json.c (lisp_to_json_nonscalar_1, Fjson_serialize, Fjson_insert) (Fjson_parse_string, Fjson_parse_buffer): * src/keyboard.c (recursive_edit_1, Frecursive_edit, cmd_error) (Finternal_track_mouse, command_loop_1, read_menu_command) (safe_run_hooks, read_event_from_main_queue, read_char, timer_check_2) (menu_item_eval_property, read_key_sequence, read_key_sequence_vs) (Fsuspend_emacs): * src/keymap.c (Fcurrent_active_maps, Fdescribe_vector) (Fhelp__describe_vector): * src/lread.c (Fload, save_match_data_load, readevalloop) (Feval_buffer, Feval_region, grow_read_buffer, read_integer, read1): * src/macros.c (Fexecute_kbd_macro): * src/menu.c (x_popup_menu_1): * src/minibuf.c (read_minibuf, set_minibuffer_mode) (read_minibuf_unwind, Fread_string, Fread_buffer): * src/nsfns.m (Fx_create_frame, Fx_show_tip): * src/nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog): * src/pdumper.c (Fdump_emacs_portable): * src/pgtkfns.c (Fx_create_frame, x_create_tip_frame, x_hide_tip) (Fx_show_tip, Fpgtk_print_frames_dialog, Fx_file_dialog, Fx_select_font): * src/pgtkmenu.c (set_frame_menubar, create_and_show_popup_menu) (pgtk_menu_show, create_and_show_dialog, pgtk_dialog_show) (pgtk_popup_dialog): * src/pgtkterm.c (pgtk_cr_export_frames): * src/print.c (PRINTPREPARE, temp_output_buffer_setup) (Fprin1_to_string, print_vectorlike): * src/process.c (Fmake_process, create_process, Fmake_pipe_process) (Fmake_serial_process, connect_network_socket, Fmake_network_process) (network_interface_info, server_accept_connection) (wait_reading_process_output, read_process_output, exec_sentinel): * src/regex-emacs.c (re_match_2_internal): * src/search.c (looking_at_1, fast_looking_at, search_buffer_re): * src/sound.c (Fplay_sound_internal): * src/sysdep.c (system_process_attributes): * src/term.c (tty_menu_show): * src/textprop.c (Fnext_single_char_property_change) (Fprevious_single_char_property_change, add_text_properties_1) (set_text_properties, set_text_properties_1, Fremove_text_properties) (Fremove_list_of_text_properties): * src/thread.c (Fmutex_lock, invoke_thread_function): * src/undo.c (truncate_undo_list): * src/w32fns.c (Fx_create_frame, w32_create_tip_frame, w32_hide_tip) (Fx_show_tip, Fx_file_dialog): * src/w32font.c (Fx_select_font): * src/w32menu.c (set_frame_menubar): * src/window.c (window_list, next_window, window_list_1) (run_window_configuration_change_hook, Frun_window_scroll_functions) (run_window_change_functions, set_window_buffer) (temp_output_buffer_show, window_scroll, scroll_command) (Fscroll_other_window, Fscroll_other_window_down): * src/xdisp.c (safe__call, handle_fontified_prop, handle_face_prop) (handle_single_display_spec, Fbuffer_text_pixel_size) (message_dolog, with_echo_area_buffer, setup_echo_area_for_printing) (display_echo_area, set_message, clear_message, echo_area_display) (gui_consider_frame_title, prepare_menu_bars, update_menu_bar) (update_tab_bar, update_tool_bar, redisplay_internal) (redisplay_preserve_echo_area, run_window_scroll_functions) (redisplay_window, extend_face_to_end_of_line) (display_count_lines_logically, display_count_lines_visually) (display_mode_lines, display_mode_line, Fformat_mode_line) (decode_mode_spec): * src/xfns.c (Fx_create_frame, x_create_tip_frame, x_hide_tip) (Fx_show_tip, Fx_file_dialog, Fx_select_font, Fx_print_frames_dialog): * src/xmenu.c (set_frame_menubar, create_and_show_popup_menu) (x_menu_show, create_and_show_dialog, x_dialog_show) (xw_popup_dialog): * src/xselect.c (x_get_local_selection, x_reply_selection_request) (x_handle_selection_request, wait_for_property_change): * src/xterm.c (x_cr_export_frames, x_connection_closed): Replace ptrdiff_t with specpdl_ref for referencing specpdl and use the corresponding functions instead of direct arithmetic.
* | | Merge from origin/emacs-28Eli Zaretskii2022-01-01
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year. 86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year ebe8772f65 ; Minor fixes related to copyright years 23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye... 8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t. 19dcb237b5 ; Add 2022 to copyright years. # Conflicts: # etc/NEWS # etc/refcards/ru-refcard.tex # lib/cdefs.h # lisp/erc/erc-dcc.el # lisp/erc/erc-imenu.el # lisp/erc/erc-replace.el # lisp/image-dired.el # lisp/progmodes/xref.el # m4/alloca.m4 # m4/byteswap.m4 # m4/errno_h.m4 # m4/getopt.m4 # m4/gnulib-common.m4 # m4/inttypes.m4 # m4/stddef_h.m4 # m4/stdint.m4 # m4/sys_socket_h.m4
| * | ; Add 2022 to copyright years.Eli Zaretskii2022-01-01
| | |
* | | New error symbol 'permission-denied'Eli Zaretskii2021-12-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/fileio.c (syms_of_fileio) <permission-denied>: Define the symbol and its 'err-conditions' and 'error-message' properties. (get_file_errno_data): Return permission-denied on EACCES. * test/src/filelock-tests.el (filelock-tests-file-locked-p-spoiled) (filelock-tests-unlock-spoiled) (filelock-tests-kill-buffer-spoiled): Adapt the tests to the new error symbol. * doc/lispref/errors.texi (Standard Errors): * etc/NEWS: Document 'permission-denied' error.
* | | Merge from origin/emacs-28Stefan Kangas2021-12-12
|\| | | | | | | | | | | | | | | | | 8a0734329a Avoid undefined behavior in 'send-process-region' (Bug#523... 30dd5c9acc Update to Org 9.5.1-25-g9ca3bc a374849926 Fix the DJGPP port
| * | Fix the DJGPP portPo Lu2021-12-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * config.bat: * msdos/sed1v2.inp: * msdos/sed2v2.inp: * msdos/sed3v2.inp: * msdos/sedlibmk.inp: Update for Emacs 28. * msdos/langinfo.h: New file. * lisp/loadup.el: Use correct path to temacs when dumping on MS-DOS. * src/callproc.c (environ) [MSDOS]: New declaration. (child_setup, emacs_spawn): Update MS-DOS parts for Emacs 28. * src/fileio.c (Fcopy_file): Don't use copy_file_range on MS-DOS. * src/msdos.c (initialize_msdos_display): Add `defined_color_hook'. (openat, fchmodat, futimens, utimensat): New functions. * src/msdos.h (FRAME_X_DISPLAY): New macro. * src/process.c: Make some more things conditional on subprocess support. (PIPECONN_P, PIPECONN1_P) [!subprocesses]: New placeholder macros. (Fnum_processors): Return 1 on MSDOS. (open_channel_for_module): Avoid subprocess specific code on MSDOS.
* | | Merge from origin/emacs-28Stefan Kangas2021-12-03
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9c222b9c1a Port to C compilers that lack size-0 arrays fed35a8951 Port emacsclient to Solaris 10 f35d6a9c73 * CONTRIBUTE: Improve commit message instructions e0ee1d003a Work around IBM XL C compiler bug 6b99b6eb8b * admin/make-tarball.txt: Various clarifications. bbf4140091 * admin/diff-tar-files: Don't assume .tar.gz. 0a50ad11db * lisp/tab-bar.el (tab-bar-close-other-tabs): Fix regression.
| * | Work around IBM XL C compiler bugPaul Eggert2021-12-02
| | | | | | | | | | | | | | | | | | | | | | | | * src/fileio.c (Fcopy_file): Work around a compiler bug in IBM XL C for AIX, V12.1 (5765-J02, 5725-C72). Without this patch, the compiler incorrectly complains “Initialization between types "int" and "struct timespec" is not allowed” and “Initialization between types "long" and "struct timespec" is not allowed”.
* | | Add support for the Haiku operating system and its window systemPo Lu2021-11-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * .gitignore: Add binaries specific to Haiku. * Makefie.in (HAVE_BE_APP): New variable. (install-arch-dep): Install Emacs and Emacs.pdmp when using Haiku. * configure.ac: Detect and configure for Haiku and various related configurations. (be-app, be-freetype, be-cairo): New options. (HAVE_BE_APP, HAIKU_OBJ, HAIKU_CXX_OBJ) (HAIKU_LIBS, HAIKU_CFLAGS): New variables. (HAIKU, HAVE_TINY_SPEED_T): New define. (emacs_config_features): Add BE_APP. * doc/emacs/Makefile.in (EMACSSOURCES): Add Haiku appendix. * doc/emacs/emacs.texi: Add Haiku appendix to menus and include it. * doc/emacs/haiku.texi: New Haiku appendix. * doc/lispref/display.texi (Defining Faces, Window Systems): Explain meaning of `haiku' as a window system identifier. (haiku-use-system-tooltips): Explain meaning of system tooltips on Haiku. * doc/lispref/frames.texi (Multiple Terminals): Explain meaning of haiku as a display type. (Frame Layout): Clarify section for Haiku frames. (Size Parameters): Explain limitations of fullwidth and fullheight on Haiku. (Management Parameters): Explain limitations of inhibiting double buffering on builds with Cairo, and the inability of frames with no-accept-focus to receive keyboard input on Haiku. (Font and Color Parameters): Explain the different font backends available on Haiku. (Raising and Lowering): Explain that lowering and restacking frames doesn't work on Haiku. (Child Frames): Explain oddities of child frame visibility on Haiku. * doc/lispref/os.texi (System Environment): Explain meaning of haiku. * etc/MACHINES: Add appropriate notices for Haiku. * etc/NEWS: Document changes. * etc/PROBLEMS: Document font spacing bug on Haiku. * lib-src/Makefile.in: Build be-resources binary on Haiku. (CXX, CXXFLAGS, NON_CXX_FLAGS, ALL_CXXFLAGS) (HAVE_BE_APP, HAIKU_LIBS, HAIKU_CFLAGS): New variables. (DONT_INSTALL): Add be-resources binary if on Haiku. (be-resources): New target. * lib-src/be_resources: Add helper binary for setting resources on the Emacs application. * lib-src/emacsclient.c (decode_options): Set alt_display to "be" on Haiku. * lisp/cus-edit.el (custom-button, custom-button-mouse) (custom-button-unraised, custom-button-pressed): Update face definitions for Haiku. * lisp/cus-start.el: Add haiku-debug-on-fatal-error and haiku-use-system-tooltips. * lisp/faces.el (face-valid-attribute-values): Clarify attribute comment for Haiku. (tool-bar): Add appropriate toolbar color for Haiku. * lisp/frame.el (haiku-frame-geometry) (haiku-mouse-absolute-pixel-position) (haiku-set-mouse-absolute-pixel-position) (haiku-frame-edges) (haiku-frame-list-z-order): New function declarations. (frame-geometry, frame-edges) (mouse-absolute-pixel-position) (set-mouse-absolute-pixel-position) (frame-list-z-order): Call appropriate window system functions on Haiku. (display-mouse-p, display-graphic-p) (display-images-p, display-pixel-height) (display-pixel-width, display-mm-height) (display-mm-width, display-backing-store) (display-save-under, display-planes) (display-color-cells, display-visual-class): Update type tests for Haiku. * lisp/international/mule-cmds.el (set-coding-system-map): Also prevent set-terminal-coding-system from appearing in the menu bar on Haiku. * lisp/loadup.el: Load Haiku-specific files when built with Haiku, and don't rename newly built Emacs on Haiku as BFS doesn't support hard links. * lisp/menu-bar.el (menu-bar-open): Add for Haiku. * lisp/mwheel.el (mouse-wheel-down-event): Expect wheel-up on Haiku. (mouse-wheel-up-event): Expect wheel-down on Haiku. (mouse-wheel-left-event): Expect wheel-left on Haiku. (mouse-wheel-right-event): Expect wheel-right on Haiku. * lisp/net/browse-url.el (browse-url--browser-defcustom-type): Add option for WebPositive. (browse-url-webpositive-program): New variable. (browse-url-default-program): Search for WebPositive. (browse-url-webpositive): New function. * lisp/net/eww.el (eww-form-submit, eww-form-file) (eww-form-checkbox, eww-form-select): Define faces appropriately for Haiku. * lisp/term/haiku-win.el: New file. * lisp/tooltip.el (menu-or-popup-active-p): New function declaration. (tooltip-show-help): Don't use tooltips on Haiku when a menu is active. * lisp/version.el (haiku-get-version-string): New function declaration. (emacs-version): Add Haiku version string if appropriate. * src/Makefile.in: Also produce binary named "Emacs" with Haiku resources set. (CXX, HAIKU_OBJ, HAIKU_CXX_OBJ, HAIKU_LIBS) (HAIKU_CFLAGS, HAVE_BE_APP, NON_CXX_FLAGS) (ALL_CXX_FLAGS): New variables. (.SUFFIXES): Add .cc. (.cc.o): New target. (base_obj): Add Haiku C objects. (doc_obj, obj): Split objects that should scanned for documentation into doc_obj. (SOME_MACHINE_OBJECTS): Add appropriate Haiku C objects. (all): Depend on Emacs and Emacs.pdmp on Haiku. (LIBES): Add Haiku libraries. (gl-stamp) ($(etc)/DOC): Scan doc_obj instead of obj (temacs$(EXEEXT): Use C++ linker on Haiku. (ctagsfiles3): New variable. (TAGS): Scan C++ files. * src/alloc.c (garbage_collect): Mark Haiku display. * src/dispextern.h (HAVE_NATIVE_TRANSFORMS): Also enable on Haiku. (struct image): Add fields for Haiku transforms. (RGB_PIXEL_COLOR): Define to unsigned long on Haiku as well. (sit_for): Also check USABLE_SIGPOLL. (init_display_interactive): Set initial window system to Haiku on Haiku builds. * src/emacs.c (main): Define Haiku syms and init haiku clipboard. (shut_down_emacs): Quit BApplication on Haiku and trigger debug on aborts if haiku_debug_on_fatal_error. (Vsystem_type): Update docstring. * src/fileio.c (next-read-file-uses-dialog-p): Enable on Haiku. * src/filelock.c (WTMP_FILE): Only define if BOOT_TIME is also defined. * src/floatfns.c (double_integer_scale): Work around Haiku libroot brain damage. * src/font.c (syms_of_font): Define appropriate font driver symbols for Haiku builds with various options. * src/font.h: Also enable ftcrfont on Haiku builds with Cairo. (font_data_structures_may_be_ill_formed): Also enable on Haiku builds that have Cairo. * src/frame.c (Fframep): Update doc-string for Haiku builds and return haiku if appropriate. (syms_of_frame): New symbol `haiku'. * src/frame.h (struct frame): Add output data for Haiku. (FRAME_HAIKU_P): New macro. (FRAME_WINDOW_P): Test for Haiku frames as well. * src/ftcrfont.c (RED_FROM_ULONG, GREEN_FROM_ULONG) (BLUE_FROM_ULONG): New macros. (ftcrfont_draw): Add haiku specific code for Haiku builds with Cairo. * src/ftfont.c (ftfont_open): Set face. (ftfont_has_char, ftfont_text_extents): Work around crash. (syms_of_ftfont): New symbol `mono'. * src/ftfont.h (struct font_info): Enable Cairo-specific fields for Cairo builds on Haiku. * src/haiku_draw_support.cc: * src/haiku_font_support.cc: * src/haiku_io.c: * src/haiku_select.cc: * src/haiku_support.cc: * src/haiku_support.h: * src/haikufns.c: * src/haikufont.c: * src/haikugui.h: * src/haikuimage.c: * src/haikumenu.c: * src/haikuselect.c: * src/haikuselect.h: * src/haikuterm.c: * src/haikuterm.h: Add new files for Haiku windowing support. * src/haiku.c: Add new files for Haiku operating system support. * src/image.c: Implement image transforms and native XPM support on Haiku. (GET_PIXEL, PUT_PIXEL, NO_PIXMAP) (PIX_MASK_RETAIN, PIX_MASK_DRAW) (RGB_TO_ULONG, RED_FROM_ULONG, GREEN_FROM_ULONG) (BLUE_FROM_ULONG, RED16_FROM_ULONG, GREEN16_FROM_ULONG) (BLUE16_FROM_ULONG): Define to appropriate values on Haiku. (image_create_bitmap_from_data): Add Haiku support. (image_create_bitmap_from_file): Add TODO on Haiku. (free_bitmap_record): Free bitmap on Haiku. (image_size_in_bytes): Implement for Haiku bitmaps. (image_set_transform): Implement on Haiku. (image_create_x_image_and_pixmap_1): Implement on Haiku, 24-bit or 1-bit only. (image_destroy_x_image, image_get_x_image): Use correct img and pixmap values on Haiku. (lookup_rgb_color): Use correct macro on Haiku. (image_to_emacs_colors): Implement on Haiku. (image_disable_image): Disable on Haiku. (image_can_use_native_api): Test for translator presence on Haiku. (native_image_load): Use translator on Haiku. (imagemagick_load_image): Add Haiku-specific quirks. (Fimage_transforms_p): Allow rotate90 on Haiku. (image_types): Enable native XPM support on Haiku. (syms_of_image): Enable XPM images on Haiku. * src/keyboard.c (kbd_buffer_get_event) (handle_async_input, handle_input_available_signal) (handle_user_signal, Fset_input_interrupt_mode) (init_keyboard): Check for USABLE_SIGPOLL along with USABLE_SIGIO. * src/lisp.h (pD): Work around broken Haiku headers. (HAVE_EXT_MENU_BAR): Define on Haiku. (handle_input_available_signal): Enable if we just have SIGPOLL as well. * src/menu.c (have_boxes): Return true on Haiku. (single_menu_item): Enable toolkit menus on Haiku. (find_and_call_menu_selection): Also enable on Haiku. * src/process.c (keyboard_bit_set): Enable with only usable SIGPOLL. (wait_reading_process_output): Test for SIGPOLL as well as SIGIO availability. * src/sound.c (sound_perror, vox_open) (vox_configure, vox_close): Enable for usable SIGPOLL as well. * src/sysdep.c (sys_subshell): Enable for usable SIGPOLL. (reset_sigio): Make conditional on F_SETOWN. (request_sigio, unrequest_sigio) (emacs_sigaction_init): Also handle SIGPOLLs. (init_sys_modes): Disable TCXONC usage on Haiku, as it doesn't have any ttys other than pseudo ttys, which don't support C-s/C-q flow control, and causes compiler warnings. (speeds): Disable high speeds if HAVE_TINY_SPEED_T. * src/termhooks.h (enum output_method): Add output_haiku. (struct terminal): Add Haiku display info. (TERMINAL_FONT_CACHE): Enable for Haiku. * src/terminal.c (Fterminal_live_p): Return `haiku' if appropriate. * src/verbose.mk.in (AM_V_CXX, AM_V_CXXLD): New logging variables. * src/xdisp.c (redisplay_internal) (note_mouse_highlight): Return on Haiku if a popup is activated. (display_menu_bar): Return on Haiku if frame is a Haiku frame. * src/xfaces.c (GCGraphicsExposures): Enable correctly on Haiku. (x_create_gc): Enable dummy GC code on Haiku. * src/xfns.c (x-server-version, x-file-dialog): Add Haiku specifics to doc strings. * src/xterm.c (syms_of_xterm): Add Haiku information to doc string.
* | | Correct patch from 2021-11-12 on src/fileio.cAlan Mackenzie2021-11-13
| | | | | | | | | | | | | | | | | | | | | * src/fileio.c (restore_window_points): Reverse commit 974192413f8a81171b8fd28dfd5c081ce06d3dec and instead replace a < by a <=. This ensures that if w->mpoint is at the top of the middle region being replaced, it gets adjusted and stays at the top after the reinsertion.
* | | In insert_file_contents, always set windows' point markers.Alan Mackenzie2021-11-12
|/ / | | | | | | | | | | | | | | | | This fixes bug #51776. * src/fileio.c (restore_window_points): Restore a w->mpoint even when that marker originally pointed into the unchanged area near BOB or EOB. This prevents that window's point being moved a long way from its starting place due to the removal of the central part of the buffer by insert_file_contents.
* | Check for null bytes in filenames in 'expand-file-name' (bug#49723)Federico Tedin2021-09-18
| | | | | | | | | | | | | | | | | | | | | | | | * src/fileio.c (expand-file-name): Check for null bytes for both NAME and DEFAULT-DIRECTORY arguments. Also check for null bytes in buffer-local default-directory, assuming it is used. * src/coding.c (encode_file_name): Use CHECK_STRING_NULL_BYTES. * src/lisp.h (CHECK_STRING_NULL_BYTES): Add function for checking for null bytes in Lisp strings. * test/src/fileio-tests.el (fileio-test--expand-file-name-null-bytes): Add test for new changes to expand-file-name. * etc/NEWS: Announce changes.
* | Fix expansion of non-ASCII $HOMEEli Zaretskii2021-09-02
| | | | | | | | | | * src/fileio.c (Fexpand_file_name): Make the file name multibyte if the value of $HOME is multibyte. (Bug#50266)