<feed xmlns='http://www.w3.org/2005/Atom'>
<title>emacs/src/macfont.m, branch scratch/hash-table-perf</title>
<subtitle>Emacs is the extensible, customizable, self-documenting real-time display editor. 
</subtitle>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/'/>
<entry>
<title>Use key Qunbound instead of hash value hash_unused for free entries</title>
<updated>2024-01-12T14:06:14+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2023-11-21T21:12:08+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=8f608cb4a1c5ce87f8308aa93057eeef9aa62c29'/>
<id>8f608cb4a1c5ce87f8308aa93057eeef9aa62c29</id>
<content type='text'>
This allows us to change the hash representation to one that does not
have an unused value.

* src/lisp.h (hash_unused): Remove.
All uses adapted to calling hash_unused_entry_key_p on the key instead.
The hash values for unused hash table entries are now undefined; all
initialisation and assignment to hash_unused has been removed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This allows us to change the hash representation to one that does not
have an unused value.

* src/lisp.h (hash_unused): Remove.
All uses adapted to calling hash_unused_entry_key_p on the key instead.
The hash values for unused hash table entries are now undefined; all
initialisation and assignment to hash_unused has been removed.
</pre>
</div>
</content>
</entry>
<entry>
<title>Inlined and specialised hash table look-up</title>
<updated>2024-01-12T10:36:41+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2023-11-21T11:27:42+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=c98ba3d4fa62688b547646a26ffb5f9fcc8d2ac5'/>
<id>c98ba3d4fa62688b547646a26ffb5f9fcc8d2ac5</id>
<content type='text'>
This improves performance in several ways.  Separate functions are
used depending on whether the caller has a hash value computed or not.

* src/fns.c (hash_lookup_with_hash, hash_lookup_get_hash): New.
(hash_lookup): Remove hash return argument.
All callers adapted.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This improves performance in several ways.  Separate functions are
used depending on whether the caller has a hash value computed or not.

* src/fns.c (hash_lookup_with_hash, hash_lookup_get_hash): New.
(hash_lookup): Remove hash return argument.
All callers adapted.
</pre>
</div>
</content>
</entry>
<entry>
<title>Store hash values as integers instead of Lisp_Object</title>
<updated>2024-01-12T10:36:41+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2023-10-29T10:57:06+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=afd2185bfdb25b2624c8d3cbe9133d548d919549'/>
<id>afd2185bfdb25b2624c8d3cbe9133d548d919549</id>
<content type='text'>
This improves typing, saves pointless tagging and untagging, and
prepares for further changes. The new typedef hash_hash_t is an alias
for EMACS_UINT, and hash values are still limited to the fixnum range.
We now use hash_unused instead of Qnil to mark unused entries.

* src/lisp.h (hash_hash_t): New typedef for EMACS_UINT.
(hash_unused): New constant.
(struct hash_table_test): `hashfn` now returns
hash_hash_t.  All callers and implementations changed.
(struct Lisp_Hash_Table): Retype hash vector to an array of
hash_hash_t.  All code using it changed accordingly.
(HASH_HASH, hash_from_key):
* src/fns.c (set_hash_index_slot, hash_index_index)
(hash_lookup_with_hash, hash_lookup_get_hash, hash_put):
(hash_lookup, hash_put): Retype hash value arguments
and return values.  All callers adapted.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This improves typing, saves pointless tagging and untagging, and
prepares for further changes. The new typedef hash_hash_t is an alias
for EMACS_UINT, and hash values are still limited to the fixnum range.
We now use hash_unused instead of Qnil to mark unused entries.

* src/lisp.h (hash_hash_t): New typedef for EMACS_UINT.
(hash_unused): New constant.
(struct hash_table_test): `hashfn` now returns
hash_hash_t.  All callers and implementations changed.
(struct Lisp_Hash_Table): Retype hash vector to an array of
hash_hash_t.  All code using it changed accordingly.
(HASH_HASH, hash_from_key):
* src/fns.c (set_hash_index_slot, hash_index_index)
(hash_lookup_with_hash, hash_lookup_get_hash, hash_put):
(hash_lookup, hash_put): Retype hash value arguments
and return values.  All callers adapted.
</pre>
</div>
</content>
</entry>
<entry>
<title>Change cursor color on NS port when it matches the face background</title>
<updated>2023-04-08T11:35:30+00:00</updated>
<author>
<name>Daniel Martín</name>
</author>
<published>2023-04-02T20:39:44+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=b36c21e27dc6fa96c7c09b0e3a8fe9dcbdcea78b'/>
<id>b36c21e27dc6fa96c7c09b0e3a8fe9dcbdcea78b</id>
<content type='text'>
* src/macfont.m (CG_SET_FILL_COLOR_WITH_FRAME_CURSOR): New macro.
(CG_SET_FILL_COLOR_WITH_FRAME_BACKGROUND): New macro.
(macfont_draw): When the cursor's color matches the face background,
set the fill color of the cursor to the face foreground.
* src/nsterm.m (ns_maybe_dumpglyphs_background): When dumping the
background of a glyph string, apply the logic mentioned
above.  (Bug#62573)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/macfont.m (CG_SET_FILL_COLOR_WITH_FRAME_CURSOR): New macro.
(CG_SET_FILL_COLOR_WITH_FRAME_BACKGROUND): New macro.
(macfont_draw): When the cursor's color matches the face background,
set the fill color of the cursor to the face foreground.
* src/nsterm.m (ns_maybe_dumpglyphs_background): When dumping the
background of a glyph string, apply the logic mentioned
above.  (Bug#62573)
</pre>
</div>
</content>
</entry>
<entry>
<title>; Add 2023 to copyright years.</title>
<updated>2023-01-01T10:31:12+00:00</updated>
<author>
<name>Eli Zaretskii</name>
</author>
<published>2023-01-01T10:31:12+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=cae528457cb862dc886a34240c9d4c73035b6659'/>
<id>cae528457cb862dc886a34240c9d4c73035b6659</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge from origin/emacs-28</title>
<updated>2022-07-31T04:30:25+00:00</updated>
<author>
<name>Stefan Kangas</name>
</author>
<published>2022-07-31T04:30:25+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=d9bd334ef367f3e16967ae2ed714ff419f2b5328'/>
<id>d9bd334ef367f3e16967ae2ed714ff419f2b5328</id>
<content type='text'>
eb11dae499 Improve documentation of column-related functions
c95a34c960 * src/macfont.m (macfont_open): Initialize font-&gt;space_wid...
31a6a37d45 Improve indexing of keymap variables
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
eb11dae499 Improve documentation of column-related functions
c95a34c960 * src/macfont.m (macfont_open): Initialize font-&gt;space_wid...
31a6a37d45 Improve indexing of keymap variables
</pre>
</div>
</content>
</entry>
<entry>
<title>* src/macfont.m (macfont_open): Initialize font-&gt;space_width.  (Bug#56808)</title>
<updated>2022-07-30T08:21:54+00:00</updated>
<author>
<name>YAMAMOTO Mitsuharu</name>
</author>
<published>2022-07-30T08:21:54+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=c95a34c96013aaba1cdf2166c4a1d0e2c5f3de6a'/>
<id>c95a34c96013aaba1cdf2166c4a1d0e2c5f3de6a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Use BASE_EQ instead of EQ where obviously safe</title>
<updated>2022-06-16T12:49:58+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2022-06-16T12:11:03+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=946d70a8910a827d74a384ff6421b9e952e0df2e'/>
<id>946d70a8910a827d74a384ff6421b9e952e0df2e</id>
<content type='text'>
* 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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix font weight reporting on macOS</title>
<updated>2022-05-05T09:01:53+00:00</updated>
<author>
<name>Po Lu</name>
</author>
<published>2022-05-05T09:01:53+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=30caeb789659441f8feb76b24f3d0b1f60125085'/>
<id>30caeb789659441f8feb76b24f3d0b1f60125085</id>
<content type='text'>
* src/macfont.m (macfont_store_descriptor_attributes): Fix
numeric values for the addition of `medium'.

* src/nsterm.m (ns_font_desc_to_font_spec): Adjust accordingly.
(ns_create_font_panel_buttons): Try to fix button width.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/macfont.m (macfont_store_descriptor_attributes): Fix
numeric values for the addition of `medium'.

* src/nsterm.m (ns_font_desc_to_font_spec): Adjust accordingly.
(ns_create_font_panel_buttons): Try to fix button width.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix nsmenu compilation under macOS 10.6</title>
<updated>2022-04-25T18:08:54+00:00</updated>
<author>
<name>Alan Third</name>
</author>
<published>2022-04-19T04:05:17+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=96ec2ac7d0bdb6b1193217b35f7d74d79b7c2033'/>
<id>96ec2ac7d0bdb6b1193217b35f7d74d79b7c2033</id>
<content type='text'>
* src/nsmenu.m ([EmacsMenu fillWithWidgetValue:]): Replace modern
shorthand dictionary and array definitions.
* src/nsterm.h (NSTextAlignmentRight): Redefine if necessary.
* src/macfont.m (mac_font_create_preferred_family_for_attributes):
isOperatingSystemAtLeastVersion is new in macOS 10.10, so it's
probably wrong to use it to check whether we're below 10.9.
(mac_font_copy_default_descriptors_for_language):
(mac_font_copy_default_name_for_charset_and_languages): It seems these
functions are only used on macOS 10.8 and below.
* src/nsterm.m ([NSColor colorUsingDefaultColorSpace]): Use the
generic colorspace.
(ns_parent_window_rect):
(ns_frame_scale_factor):
([EmacsWindow setParentChildRelationships]): Fix macOS version stuff.

Co-authored-by: Po Lu &lt;luangruo@yahoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/nsmenu.m ([EmacsMenu fillWithWidgetValue:]): Replace modern
shorthand dictionary and array definitions.
* src/nsterm.h (NSTextAlignmentRight): Redefine if necessary.
* src/macfont.m (mac_font_create_preferred_family_for_attributes):
isOperatingSystemAtLeastVersion is new in macOS 10.10, so it's
probably wrong to use it to check whether we're below 10.9.
(mac_font_copy_default_descriptors_for_language):
(mac_font_copy_default_name_for_charset_and_languages): It seems these
functions are only used on macOS 10.8 and below.
* src/nsterm.m ([NSColor colorUsingDefaultColorSpace]): Use the
generic colorspace.
(ns_parent_window_rect):
(ns_frame_scale_factor):
([EmacsWindow setParentChildRelationships]): Fix macOS version stuff.

Co-authored-by: Po Lu &lt;luangruo@yahoo.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
