1. 15 Jul, 2021 2 commits
    • Aidan Kehoe's avatar
      Expose keystrokes_since_auto_save to Lisp. · b27fcbcefc1c
      Aidan Kehoe authored
      src/ChangeLog addition:
      
      2021-07-15  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* event-stream.c:
      	* event-stream.c (vars_of_event_stream):
      	Expose keystrokes_since_auto_save to Lisp, to allow e.g. more
      	intelligent decisions made in pre-idle-hook about when to autosave.
      b27fcbcefc1c
    • Aidan Kehoe's avatar
      Improve, simplify minibuf handling of remote file names. · de9be7923482
      Aidan Kehoe authored
      lisp/ChangeLog addition:
      
      2021-07-15  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* files.el:
      	* files.el (file-remote-p):
      	If EFS is loaded, use efs-path-regexp to work out if FILE is remote.
      	* minibuf.el (minibuffer-complete-and-exit):
      	* minibuf.el (exit-minibuffer):
      	Fix some indentation in these two functions.
      	* minibuf.el (minibuffer-smart-mouse-tracker):
      	Ignore ange-ftp, long deprecated.
      	Trust that #'file-remote-p will recognise EFS pathnames if EFS is
      	loaded.
      	Use the newer #'test-completion, which always gives t for an exact
      	match, rather than the older #'try-completion, where this is not
      	guaranteed.
      	* minibuf.el (minibuffer-smart-select-kludge-filename):
      	ange-ftp is long deprecated, ignore it.
      	Use the new support of #'file-remote-p for EFS, don't implement
      	that ourselves.
      de9be7923482
  2. 09 Jul, 2021 1 commit
    • Aidan Kehoe's avatar
      Fix some bugs in the printing of extent plists. · 5ff067476825
      Aidan Kehoe authored
      src/ChangeLog addition:
      
      2021-07-09  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* extents.c (print_extent):
      	Fix some bugs in the printing of extent plists, put spaces between
      	the elements, only print the plist at all if there are any non-nil
      	elements.
      5ff067476825
  3. 29 Jun, 2021 1 commit
    • Aidan Kehoe's avatar
      Revert some incompatibilities with #'make-char, #'split-char, control-1 · f7bb1e9afe27
      Aidan Kehoe authored
      src/ChangeLog addition:
      
      2021-06-29  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* text.c (check_coerce_octet):
      	Fix an incompatibility introduced by Ben in the unicode-internal
      	code, OCTET1 can range from 0 to 31, inclusive, and from #x80 to
      	#x9f, inclusive. It cannot range from 32 to 63.
      	(internal_to_external_charset_codepoint):
      	Fix a related incompatibility in the result of #'split-char,
      	(split-char ?\x80) now gives (control-1 0) as it did in all
      	previous versions of XEmacs mule.
      	Thank you for the bug report regarding latin-unity, Henry
      	Thompson!
      
      tests/ChangeLog addition:
      
      2021-06-29  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* automated/mule-tests.el:
      	Test the range of the OCTET1 argument with (make-char 'control
      	...), there has been some incompatibility and confusion with it.
      	Test the output of #'split-char, there was a similar
      	incompatibility with it.
      f7bb1e9afe27
  4. 10 Jun, 2021 5 commits
    • Aidan Kehoe's avatar
      assoc_no_quit(), use ALIST_LOOP_4 rather than Fassoc(). · 4524d575de48
      Aidan Kehoe authored
      src/ChangeLog addition:
      
      2021-06-10  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* lisp.h (ALIST_LOOP_4): Correct a bug in this macro, the name of
      	the tail variable reflects _al4_tail_##car.
      	* sequence.c (assoc_no_quit):
      	Implement this using ALIST_LOOP_4() rather than inhibit-quit and
      	Fassoc().
      4524d575de48
    • Aidan Kehoe's avatar
      Remove hash.c, hash.h, prefer the Lisp hash table infrastructure instead · 8ac701c0f9db
      Aidan Kehoe authored
      src/ChangeLog addition:
      
      2021-06-10  Aidan Kehoe  <kehoea@parhasard.net>
      
      	Remove hash.h, hash.c, no longer used, since the Lisp hash tables
      	(elhash.[ch]) are preferred.
      
      	* font-mgr.c: Remove an #include for hash.h.
      	* gccache-x.c: Ditto.
      	* elhash.c (memory_hash): Move this here from hash.c, it is used
      	by the Lisp hash code.
      	* hash.c: Removed.
      	* hash.h: Removed.
      	* Makefile.in.in (objs): Remove hash.o from this list
      	* process-nt.c: Remove an #include for hash.h.
      	* process-unix.c: Ditto.
      	* process.c: Ditto.
      	* profile.c: Ditto.
      	* ui-gtk.c: Ditto.
      	* win32.c: Ditto.
      	* depend: Regenerate.
      8ac701c0f9db
    • Aidan Kehoe's avatar
      Fix the POSIX build, alloc.c · 9af1f6dacb8e
      Aidan Kehoe authored
      src/ChangeLog addition:
      
      2021-06-10  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* alloc.c: Wrap the #include "syswindows.h" with #ifdef
      	WIN32_NATIVE for the sake of the POSIX build.
      9af1f6dacb8e
    • Aidan Kehoe's avatar
      Implement the mswindows_read_link() cache as a normal Lisp hash table. · 85266ee3dde0
      Aidan Kehoe authored
      src/ChangeLog addition:
      
      2021-06-10  Aidan Kehoe  <kehoea@parhasard.net>
      
      	Implement the mswindows_read_link() cache as a normal Lisp hash
      	table.
      	Be more careful about the result of GetTickCount() wrapping round.
      
      	* alloc.c (disksave_object_finalization):
      	Clear Vmswindows_read_link_hash before dumping, we don't want the
      	path information for build time hanging around.
      	* syswindows.h:
      	Make Vmswindows_read_link_hash available to alloc.c
      	* win32.c:
      	* win32.c (mswindows_read_link_1):
      	Use intern_istring when looking up the cache entry for a given
      	file name, allowing us to use a normal Lisp hash table.
      	Be more careful about the tick count wrapping around.
      	Change the declaration of the function to take the length of
      	FNAME, since it is always calculated anyway.
      	* win32.c (mswindows_read_link):
      	Call mswindows_read_link_1() with its new calling convention.
      	* win32.c (vars_of_win32):
      	Initialise and staticpro() Vmswindows_read_link_hash.
      85266ee3dde0
    • Aidan Kehoe's avatar
      Fix a buggy regexp, #'cl-do-prettyprint · 3b5e0b17236b
      Aidan Kehoe authored
      lisp/ChangeLog addition:
      
      2021-06-10  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* cl-extra.el (cl-do-prettyprint):
      	Fix a bug in a regexp here, can't start a subexpression within a
      	character set.
      3b5e0b17236b
  5. 27 May, 2021 1 commit
    • Aidan Kehoe's avatar
      Move the main profiling hash table to being a Lisp hash table. · 12b8d2bcb8b9
      Aidan Kehoe authored
      src/ChangeLog addition:
      
      2021-05-27  Aidan Kehoe  <kehoea@parhasard.net>
      
      	Move the main profiling hash table to being a Lisp hash table, it
      	is safe to modify (but not to enlarge) this from a signal handler.
      
      	* gc.c:
      	No special marking for the profiling info now needed, remove the
      	call to mark_profiling_info().
      	* profile.c:
      	Vbig_profile_table is now a Lisp hash table, declare it as such.
      	* profile.c (create_profile_tables):
      	Move the body of create_timing_profile_table() in here, no need to
      	have it separate.
      
      	* profile.c (static const struct sized_memory_description
      	  hentry_description): Removed.
      	* profile.c (static const struct sized_memory_description
      	plain_hash_table_description): Removed.
      	These were never used and are not necessary now Vbig_profile_table
      	is a normal Lisp object.
      
      	* profile.c (profile_sow_backtrace):
      	Add entries for every function on the backtrace to
      	Vbig_profile_table, ensuring there won't be a need to add an entry
      	within sigprof_handler().
      	* profile.c (profile_record_about_to_call):
      	No need to pregrow_hash_table_if_necessary() here; do add zero entry
      	for *bt->function to Vbig_profile_table.
      	* profile.c (sigprof_handler):
      	Call inchash_eq() on the corresponding entry in
      	Vbig_profile_table; assert that the table hasn't been enlarged,
      	this code cannot handle that.
      	* profile.c (Fstart_profiling):
      	Use the Lisp hash table functions when dealing with
      	Vbig_profile_table.
      	* profile.c (Fclear_profiling_info):
      	Ditto.
      	* profile.c (get_profiling_info_timing_maphash): Ditto.
      	* profile.c (Fget_profiling_info): Ditto.
      	* profile.c (set_profiling_info_timing_maphash): Ditto.
      	* profile.c (Fset_profiling_info): Ditto.
      	* profile.c (mark_profiling_info_maphash): Removed. No longer
      	needed.
      	* profile.c (mark_profiling_info): Ditto.
      	* profile.c (vars_of_profile):
      	Just staticpro() Vbig_profile_table, don't dither about adding a
      	root block pointer.
      	* profile.h:
      	Remove the declaration of mark_profiling_info().
      
      man/ChangeLog addition:
      
      2021-05-27  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* internals/internals.texi (garbage_collect_1):
      	Remove documentation of special treatment of profiling info by GC,
      	something no longer done.
      	* internals/internals.texi (Profiling):
      	Document that we now use a Lisp hash table for the profiling
      	ticks, being careful to have sufficient space within it so that it
      	is never resized within a signal handler.
      12b8d2bcb8b9
  6. 26 May, 2021 3 commits
    • Aidan Kehoe's avatar
      close_process_descs(), loop through Vprocess_list rather than Vusid_to_process · da611c58288b
      Aidan Kehoe authored
      src/ChangeLog addition:
      
      2021-05-26  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* process-unix.c (close_process_descs):
      	Vusid_to_process is not used with event-Xt or event-gtk, loop
      	through Vprocess_list instead when closing descriptors in a
      	newly-forked subprocess.
      	* procimpl.h:
      	Now Vusid_to_process is no longer used outside of process.c,
      	remove it from this file.
      da611c58288b
    • Aidan Kehoe's avatar
      Move the USID (unique stream identifier) type to being Lisp_Object instead. · 41c7fb87b5a0
      Aidan Kehoe authored
      src/ChangeLog addition:
      
      2021-05-26  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* event-Xt.c (emacs_Xt_create_io_streams):
      	* event-Xt.c (emacs_Xt_delete_io_streams):
      	* event-Xt.c (debug_process_finalization):
      	* event-gtk.c (emacs_gtk_create_io_streams):
      	* event-gtk.c (emacs_gtk_delete_io_streams):
      	* event-gtk.c (debug_process_finalization):
      	* event-msw.c:
      	* event-msw.c (lisp_to_HANDLE):
      	* event-msw.c (NTPIPE_SLURP_STREAM_DATA):
      	* event-msw.c (mswindows_need_event):
      	* event-msw.c (emacs_mswindows_create_io_streams):
      	* event-msw.c (emacs_mswindows_delete_io_streams):
      	* event-stream.c (event_stream_create_io_streams):
      	* event-stream.c (event_stream_delete_io_streams):
      	* event-tty.c (emacs_tty_next_event):
      	* event-tty.c (emacs_tty_create_io_streams):
      	* event-tty.c (emacs_tty_delete_io_streams):
      	* event-unixoid.c (event_stream_unixoid_create_io_streams):
      	* event-unixoid.c (event_stream_unixoid_delete_io_streams):
      	* event-unixoid.c (init_event_unixoid):
      	* events.h:
      	* events.h (struct event_stream):
      	* general-slots.h:
      	* lisp.h:
      	* process-nt.c (nt_deactivate_process):
      	* process-unix.c (close_process_descs):
      	* process-unix.c (connect_to_file_descriptor):
      	* process-unix.c (unix_deactivate_process):
      	* process.c:
      	* process.c (get_process_from_usid):
      	* process.c (init_process_io_handles):
      	* process.c (Fprocess_send_eof):
      	* process.c (deactivate_process):
      	* process.c (init_xemacs_process):
      	* process.c (vars_of_process):
      	* process.h:
      	* procimpl.h:
      	* procimpl.h (struct process_methods):
      	Move the unique stream identifier (USID) type to being a
      	Lisp_Object rather than a C integer type.
      	Use the symbols Qdiscard, Qerror for USID_ERROR and USID_DONTHASH.
      	Use a weak list for the USID to process mapping, rather than a
      	native (non-Lisp) hash table, the number of streams will be
      	comfortably less than a hundred most of the time.
      	Provide lisp_to_HANDLE(), HANDLE_to_lisp() to this end in the
      	win32 code.
      
      man/ChangeLog addition:
      
      2021-05-26  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* internals/internals.texi (Stream Pairs):
      	* internals/internals.texi (Converting Events):
      	Update the documentation of the unique stream identifiers to
      	reflect that these are now Lisp objects.
      41c7fb87b5a0
    • Aidan Kehoe's avatar
      Correct a couple of assertions in the Win32 code. · 8fe0ddf71ba4
      Aidan Kehoe authored
      src/ChangeLog addition:
      
      2021-05-26  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* frame-msw.c (mswindows_init_frame_1):
      	* scrollbar-msw.c (mswindows_create_scrollbar_instance):
      	Correct a couple of assertions in these functions, avoid crashing
      	at startup on 32-bit Windows.
      8fe0ddf71ba4
  7. 19 May, 2021 1 commit
    • Aidan Kehoe's avatar
      Implement fc_intern() using a normal Lisp hash table, font-mgr.c · 779ea822c0ed
      Aidan Kehoe authored
      src/ChangeLog addition:
      
      2021-05-19  Aidan Kehoe  <kehoea@parhasard.net>
      
      	Implement fc_intern() using a normal Lisp hash table, warn if
      	debug-xft is non-zero and the property name is not recognized.
      	* font-mgr.c:
      	* font-mgr.c (fc_intern):
      	* font-mgr.c (vars_of_font_mgr):
      	Initialize Vfc_property_name_hash_table here, and staticpro it.
      	* font-mgr.c (reinit_vars_of_font_mgr):
      	Remove the make_string_hash_table() call here.
      779ea822c0ed
  8. 11 May, 2021 1 commit
    • Aidan Kehoe's avatar
      #'gtk-import-function-internal, use binary search rather than hash table · 0849b7b1ff06
      Aidan Kehoe authored
      src/ChangeLog addition:
      
      2021-05-11  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* emacs-marshals.c:
      	* emacs-marshals.c (FOR_ALL_MARSHALLERS): New.  Regenerate this
      	file, see ../lisp/gtk-marshal.el.
      	* ui-gtk.c:
      	Make the map from marshaller types to functions a compile-time
      	constant, avoiding the creation of a hash table the first time a
      	marshalled function is called.
      	* ui-gtk.c (find_marshaller):
      	Move this here from emacs-marshals.c.
      	* ui-gtk.c (Fgtk_import_function_internal):
      	No need to prepend "emacs_gtk_marshal_" to the argument passed to
      	find_marshaller().
      
      lisp/ChangeLog addition:
      
      2021-05-11  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* gtk-marshal.el (get-marshaller-type-info): New.
      	Summarize the type info (so return type and argument type) of RVAL
      	and ARGS as a string.
      	* gtk-marshal.el (get-marshaller-name): Implement this using
      	#'get-marshaller-type-info.
      	* gtk-marshal.el (define-marshaller):
      	Add a newline and appropriate indentation to the C definition of
      	the function.
      	Push the now-defined marshal function onto defined-marshallers.
      	* gtk-marshal.el:
      	When creating emacs-marshal.c, instead of creating a long list of
      	puthash() calls to be called the first time any function is
      	imported, create a table mapping the lower 16 bits of the type
      	string hash to the corresponding function, which is faster in my
      	testing (with 10,000 gtk-import-function-internal calls), and has
      	more predictable performance than the old approach.
      0849b7b1ff06
  9. 10 May, 2021 1 commit
    • Aidan Kehoe's avatar
      Error if NUMBER is a character or a marker, #'zerop · 42ec899a2069
      Aidan Kehoe authored
      lisp/ChangeLog addition:
      
      2021-05-10  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* subr.el (zerop):
      	Error if NUMBER is a character or a marker in this function, as
      	the C code did previously.
      
      tests/ChangeLog addition:
      
      2021-05-10  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* automated/lisp-tests.el (wrong-type-argument):
      	Check that #'zerop errors appropriately if supplied a character or
      	a marker.
      42ec899a2069
  10. 06 May, 2021 3 commits
    • Aidan Kehoe's avatar
      Use weak lists rather than hash tables, window saved point cache. · c32a0554581d
      Aidan Kehoe authored
      src/ChangeLog addition:
      
      2021-05-06  Aidan Kehoe  <kehoea@parhasard.net>
      
      	The window point and saved_window_start caches are very small,
      	much less than 100 elements, use weak lists rather than weak hash
      	tables.
      
      	* window.c (make_point_cache): New. Renamed from
      	make_saved_buffer_point_cache().
      	* window.c (get_point_cache): New.
      	* window.c (put_point_cache): New.
      
      	* window.c (allocate_window):
      	* window.c (unshow_buffer):
      	* window.c (Fdelete_window):
      	* window.c (Fset_window_buffer):
      	* window.c (make_dummy_parent):
      	Use the new interface in all these functions.
      c32a0554581d
    • Aidan Kehoe's avatar
      #'make-variable-buffer-local, don't needlessly store Fcurrent_buffer () · b9e401de31a6
      Aidan Kehoe authored
      src/ChangeLog addition:
      
      2021-05-06  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* symbols.c (Fmake_variable_buffer_local):
      	Don't store the current buffer in this function, this function
      	doesn't actually directly make the symbol have a buffer-local
      	value, and storing a buffer that isn't used leads to minor issues
      	with buffers not getting garbage-collected when they should.
      b9e401de31a6
    • Aidan Kehoe's avatar
      Fix a longstanding bug when #'easy-menu-remove called before #'easy-menu-add · 501c528f409f
      Aidan Kehoe authored
      lisp/ChangeLog addition:
      
      2021-05-06  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* easymenu.el (easy-menu-add):
      	* easymenu.el (easy-menu-remove):
      	In the normal course of events #'easy-menu-remove is called before
      	#'easy-menu-add, and so the code in the latter to save any
      	existing non-default mode-popup-menu fails. Add corresponding code
      	to #'easy-menu-remove too.
      501c528f409f
  11. 29 Apr, 2021 1 commit
    • Aidan Kehoe's avatar
      Remove gccache-gtk.[ch], they are no longer relevant with GTK3 · 7bdbe2e7fe29
      Aidan Kehoe authored
      src/ChangeLog addition:
      
      2021-04-29  Aidan Kehoe  <kehoea@parhasard.net>
      
      	Since GTK has moved to Cairo, it is no longer useful to attempt to
      	cache graphic contexts under that window system. Remove that code.
      
      	* console-xlike-inc.h: Remove those declarations and types
      	specific to the GC caching code.
      	* depend: Regenerate.
      	* gccache-gtk.c: Remove.
      	* gccache-gtk.h: Remove.
      	* gccache-x.h (X_SET_GC_FILL, X_SET_GC_PIXEL): Move these macros
      	here, rename from XLIKE_SET_GC_{FILL,PIXEL}.
      	* redisplay-x.c:
      	* redisplay-x.c (x_get_gc): Move this here from
      	redisplay-xlike-inc.c, renaming it from XLIKE_get_gc()
      	* redisplay-x.c (x_output_horizontal_line): Call it using the new
      	name. Use the X-specific GC masks.
      	* redisplay-x.c (x_output_vertical_divider): Ditto.
      	* redisplay-x.c (X_COLOR_TO_PIXEL): Add this, renamed from
      	XLIKE_COLOR_TO_PIXEL, moved from console-xlike-inc.h
      	* redisplay-x.c (x_flash): Use it, use the X-specific GC mask
      	names and function names.
      	* redisplay-x.c (x_output_blank): Ditto.
      	* redisplay-x.c (x_output_eol_cursor): Ditto.
      	* redisplay-x.c (x_output_xlike_pixmap): Ditto.
      	* redisplay-x.c (x_output_string): Ditto.
      	* redisplay-xlike-inc.c:
      	Move XLIKE_get_gc() to redisplay-x.c.
      	* redisplay-xlike-inc.c (XLIKE_output_blank):
      	Use the X-specific names when appropriate.
      	* redisplay-xlike-inc.c (XLIKE_output_pixmap):
      	Ditto.
      7bdbe2e7fe29
  12. 22 Apr, 2021 1 commit
    • Aidan Kehoe's avatar
      Move away from snprintf() to emacs_snprintf(), Mule-ize a few functions. · 3ee5188e182e
      Aidan Kehoe authored
      src/ChangeLog addition:
      
      2021-04-22  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* fontcolor-xlike-inc.c (FcResultToString):
      	* fontcolor-xlike-inc.c (FcTypeOfValueToString):
      	Use emacs_snprintf_ascbyte() in both these functions rather than
      	snprintf.
      	* gpmevent.c (turn_off_gpm):
      	Mule-ize this function.
      	* gpmevent.c (Fgpm_enabled_p):
      	Ditto.
      	* gpmevent.c (Fgpm_enable):
      	Ditto. Use emacs_snprintf() rather than snprintf(). Give a more
      	informative error when the current tty is not a Linux console.
      	* number-mp.c (bignum_set_long):
      	Use fixnum_to_string here rather than snprintf().
      	* process-unix.c (unix_open_network_stream):
      	Use emacs_snprintf() rather than snprintf() here. Check the
      	integer range for numeric ports.
      	* tls.c (tls_set_x509_key_file):
      	Use emacs_snprintf_ascbyte() here.
      3ee5188e182e
  13. 20 Apr, 2021 1 commit
    • Aidan Kehoe's avatar
      Remove redisplay_text_width_string(), no longer used. · 521182c3696a
      Aidan Kehoe authored
      src/ChangeLog addition:
      
      2021-04-20  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* redisplay.c (redisplay_text_width_string): Removed.
      	No longer used, and equivalent to
      	redisplay_window_text_width_string(). On inspection the only
      	difference appears to be the cachel updating, but r_w_t_w_s does
      	that too, see separate_textual_runs_mule.
      	* redisplay.h:
      	Remove its declaration.
      521182c3696a
  14. 17 Apr, 2021 2 commits
    • Aidan Kehoe's avatar
      Check for a bug just fixed with modeline display of current line number · 1b464322b6a7
      Aidan Kehoe authored
      tests/ChangeLog addition:
      
      2021-04-17  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* redisplay-tests.el (buffer):
      	Test a bug just fixed with display of line numbers in the modeline.
      1b464322b6a7
    • Aidan Kehoe's avatar
      Fix the last of the byte-char problems in window.c · 657519ff195a
      Aidan Kehoe authored
      src/ChangeLog addition:
      
      2021-04-17  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* redisplay.h:
      	Update the declaration of point_in_line_start_cache() here, to
      	reflect byte positions.
      	* window.c (Fwindow_displayed_text_pixel_height):
      	Use the buffer byte positions with point_in_line_start_cache(),
      	the last of the byte-char confusion in window.c
      657519ff195a
  15. 16 Apr, 2021 1 commit
  16. 15 Apr, 2021 1 commit
    • Aidan Kehoe's avatar
      Revise point_visible() to avoid recently-introduced scrolling problems · 13d6062cea8b
      Aidan Kehoe authored
      src/ChangeLog addition:
      
      2021-04-15  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* redisplay.c (point_visible):
      	end_pos[CURRENT_DISP] is now the inclusive upper bound on the
      	positions shown, not exclusive, revise this appropriately. Thank
      	you for the bug report, Stephen Turnbull!
      13d6062cea8b
  17. 14 Apr, 2021 2 commits
    • Aidan Kehoe's avatar
      Correct some further byte-char confusion, #'move-to-window-line. · df2bde42f558
      Aidan Kehoe authored
      src/ChangeLog addition:
      
      2021-04-14  Aidan Kehoe  <kehoea@parhasard.net>
      
      	Correct some further byte-char confusion, #'move-to-window-line.
      
      	* redisplay.h: line_at_center() returns a line number, so the
      	appropriate type is Charcount, declare it as such.
      	* redisplay.c (line_at_center): Update the definition accordingly.
      	* redisplay.c (point_at_center): Update a call to line_at_center()
      	accordingly.
      
      	* window.c (Fmove_to_window_line):
      	Call line_at_center(), point_at_center() with byte positions.
      df2bde42f558
    • Aidan Kehoe's avatar
      Never return an invalid buffer position, pixel_to_glyph_translation() · 26cba7e547be
      Aidan Kehoe authored
      src/ChangeLog addition:
      
      2021-04-14  Aidan Kehoe  <kehoea@parhasard.net>
      
      	When examining the redisplay display lines for the sake of
      	`event-point', `event-modeline-position' and friends, be certain
      	never to return an invalid buffer position.
      
      	* redisplay.c:
      	* redisplay.c (force_valid_bytebpos_or_zero): New.
      	* redisplay.c (force_valid_modeline_offset_or_negative): New.
      	* redisplay.c (pixel_to_glyph_translation): Use them.
      26cba7e547be
  18. 25 Mar, 2021 2 commits
    • Aidan Kehoe's avatar
      Init w->end_pos[DESIRED_DISP] early, redisplay_window() · 6923e721168f
      Aidan Kehoe authored
      src/ChangeLog addition:
      
      2021-03-25  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* redisplay.c (redisplay_window):
      	Init w->end_pos[DESIRED_DISP] early in this function, so the
      	modeline code always has it available.
      6923e721168f
    • Aidan Kehoe's avatar
      Don't enter redisplay recursively, Fwindow_end(), pixel_to_glyph_translation() · 0842571712dd
      Aidan Kehoe authored
      src/ChangeLog addition:
      
      2021-03-25  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* redisplay.c (point_visible):
      	No need to declare B, the window's buffer, here.
      	* redisplay.c (end_of_last_line_may_error): Removed. No longer
      	used.
      	* redisplay.c (pixel_to_glyph_translation):
      	Don't call end_of_last_line_may_error() from this, since that
      	enters redisplay and provokes a crash with error-checking turned
      	on. Use the position of (*w)->end_pos[CURRENT_DISP] instead.
      	* window.c:
      	* window.c (Fwindow_end):
      	Don't call end_of_last_line() if we're currently in redisplay,
      	redisplay is not re-entrant.
      	* signal.c (check_quit):
      	Go back to the old check for proper wrapping within redisplay
      	here, since we should no longer be entering redisplay
      	recursively.
      
      man/ChangeLog addition:
      
      2021-03-25  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* internals/internals.texi (Critical Redisplay Sections):
      	Document that the start_end_of_last_line() code is no longer
      	called if in redisplay.
      0842571712dd
  19. 24 Mar, 2021 1 commit
    • Aidan Kehoe's avatar
      Move window_end_pos[] to being an array of markers. · f994b43724ea
      Aidan Kehoe authored
      src/ChangeLog addition:
      
      2021-03-24  Aidan Kehoe  <kehoea@parhasard.net>
      
      	Move window_end_pos[] to being an array of markers.
      	This avoids problems maintaining byte-char correspondence.
      
      	* redisplay-output.c (redisplay_update_line):
      	No need to update window_end_pos[] here, insdel.c has done that
      	for us.
      	* redisplay-output.c (redisplay_output_window):
      	Copy the byte position of end_pos[DESIRED_DISP] to
      	end_pos[CURRENT_DISP] as appropriate.
      	* redisplay.c (real_current_modeline_height):
      	Set w->end_pos[CMOTION_DISP] as appropriate here.
      	* redisplay.c (regenerate_window):
      	Initial set w->end_pos[type] to start_pos, then, as the display
      	lines are processed, set it to the end of the last line
      	processed.
      	* redisplay.c (point_visible):
      	Use w->end_pos[type].
      	* redisplay.c (redisplay_window):
      	If dealing with the echo area, save the position of
      	w->end_pos[CURRENT_DISP] as we did with w->start[CURRENT_DISP],
      	and restore after calling Lisp.
      	* redisplay.c (decode_mode_spec):
      	Update this to reference w->end_pos[] rather than
      	w->window_end_pos[].
      	* window-impl.h (struct window):
      	Remove the Bytebpos window_end_pos[] elements from here.
      	* winslots.h:
      	Add end_pos as an array of window slots here, ensuring GC
      	protection.
      	* window.c (allocate_window):
      	Init the end_pos slots here.
      	* window.c (Fwindow_end):
      	Use w->end_pos[CURRENT_DISP] here, rather than the end_bytepos of
      	the last entry in the window display lines.
      	* window.c (Fdelete_window):
      	Unchain the end_pos[] markers here.
      	* window.c (Fset_window_buffer):
      	Initialise end_pos[CURRENT_DISP] here.
      	* window.c (temp_output_buffer_show):
      	Ditto.
      	* window.c (make_dummy_parent):
      	Ditto.
      	* window.c (window_displayed_height):
      	Use w->end_pos[] here.
      	* window.c (window_scroll):
      	Ditto.
      f994b43724ea
  20. 19 Mar, 2021 1 commit
    • Aidan Kehoe's avatar
      Stop triggering an assertion failure in redisplay_move_cursor() · 17cf6ee690c6
      Aidan Kehoe authored
      src/ChangeLog addition:
      
      2021-03-19  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* redisplay-output.c (ADJ_BYTEPOS):
      	* redisplay-output.c (redisplay_move_cursor):
      	ADJ_BYTEPOS can sometimes be zero, since runes' byte positions can
      	be initialised to that. Don't trigger an assertion failure within
      	set_marker_byte_position() when that happens. Thank you Stephen
      	Turnbull!
      17cf6ee690c6
  21. 18 Mar, 2021 1 commit
    • Aidan Kehoe's avatar
      Update tests/reproduce-crashes.el to reflect changes to the hash table functions · 7fbd557a1dd1
      Aidan Kehoe authored
      tests/ChangeLog addition:
      
      2021-03-18  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* reproduce-crashes.el (bug-hashtable): Removed.
      	* reproduce-crashes.el (bug-hash-table): New.
      	In the INITVALUE for this, call #'make-hash-table rather than the
      	obsolete #'make-hashtable.
      	Update the name of the variable for symmetry.
      
      	* reproduce-crashes.el (reproduce-bug):
      	* reproduce-crashes.el (describe-bug):
      	* reproduce-crashes.el (list-bugs):
      	* reproduce-crashes.el (defbug):
      	Use the new name for bug-hash-table in these functions.
      	Allow the byte compiler to compile BODY by quoting a lambda using
      	#'().
      7fbd557a1dd1
  22. 03 Mar, 2021 1 commit
    • Aidan Kehoe's avatar
      Introduce search-error-on-bad-match-data, ease debugging of bad match data. · 420403098793
      Aidan Kehoe authored
      src/ChangeLog addition:
      
      2021-03-03  Aidan Kehoe  <kehoea@parhasard.net>
      
      	Introduce search-error-on-bad-match-data, easing the debugging of
      	inconsistent match data.
      	* search.c:
      	* search.c (search_warn_or_error): New. Depending on the value of
      	search_error_on_bad_match_data, either error, or call
      	warn_when_safe()
      	* search.c (canonicalize_lisp_search_registers_for_replace): Use
      	it instead of warn_when_safe().
      	* search.c (Freplace_match): Ditto.
      	* search.c (match_limit): Ditto.
      	* search.c (Fmatch_string): Ditto.
      	* search.c (store_match_data_fixnums): Ditto.
      	* search.c (store_match_data_markers): Ditto.
      	* search.c (vars_of_search): Use DEFVAR_BOOL() to make it
      	available to Lisp.
      
      man/ChangeLog addition:
      
      2021-03-03  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* lispref/searching.texi (Simple Match Data):
      	Document the new search-error-on-bad-match-data variable, which
      	tells the search code to error rather than (more compatibly)
      	warning when it encounters inconsistent match data.
      420403098793
  23. 26 Feb, 2021 2 commits
    • Aidan Kehoe's avatar
      #define HAVE_UNIXOID_EVENT_LOOP for GTK too. · 4b75bc4cfb4b
      Aidan Kehoe authored
      src/ChangeLog addition:
      
      2021-02-26  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* config.h.in:
      	GTK uses select() to wait for events under the hood, #define
      	HAVE_UNIXOID_EVENT_LOOP with it too. This means that
      	init_event_unixoid() will be called at startup, which may improve
      	things with timeouts in GTK.
      4b75bc4cfb4b
    • Aidan Kehoe's avatar
      Get some of the GTK code compiling with C++. · b71c94c1f74d
      Aidan Kehoe authored
      src/ChangeLog addition:
      
      2021-02-26  Aidan Kehoe  <kehoea@parhasard.net>
      
      	Get some of the GTK code compiling with C++.
      	* frame-gtk.c (gtk_recompute_cell_sizes):
      	Cast geometry_mask to a GdkWindowHints.
      	* glyphs-gtk.c (gtk_xpm_instantiate):
      	Cast the first argument to emacs_asprintf() in this function.
      b71c94c1f74d
  24. 21 Feb, 2021 2 commits
    • Aidan Kehoe's avatar
      Test and warn when badly-ordered fixnums, markers in the match data · 58e56696b3bf
      Aidan Kehoe authored
      src/ChangeLog addition:
      
      2021-02-21  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* search.c (store_match_data_fixnums):
      	* search.c (store_match_data_markers):
      	Warn on encountering badly-ordered match end positions in both
      	these functions, they may well reflect corrupt saved match data.
      
      tests/ChangeLog addition:
      
      2021-02-21  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* automated/regexp-tests.el:
      	Test #'replace-match when the stored match data has its start and
      	end positions reversed, as Stephen describes happens for him and
      	as would have worked without problems in the previous
      	implementation, since #'substring, #'buffer-substring are not
      	strict about the order of the arguments they return.
      58e56696b3bf
    • Aidan Kehoe's avatar
      #'replace-match; update commments, be careful with saved non-extent matches · 29f260524b94
      Aidan Kehoe authored
      src/ChangeLog addition:
      
      2021-02-21  Aidan Kehoe  <kehoea@parhasard.net>
      
      	* search.c (Freplace_match):
      	Update some comments here.
      	Don't attempt to access the saved buffer context if match zero is
      	not an extent.
      	Be more careful about which syntax table to use.
      29f260524b94
  25. 19 Feb, 2021 1 commit
  26. 18 Feb, 2021 1 commit
    • Aidan Kehoe's avatar
      Pay attention to the order of the saved extent endpoints, search.c · 9c94f495c022
      Aidan Kehoe authored
      src/ChangeLog addition:
      
      2021-02-18  Aidan Kehoe  <kehoea@parhasard.net>
      
      	Attempt to address an assertion failure Stephen Turnbull is
      	seeing, thank you Stephen.
      
      	* search.c (store_match_data_fixnums):
      	Be careful that the first of the saved fixnums is less than the
      	second.
      	* search.c (store_match_data_markers):
      	Ditto.
      9c94f495c022