<feed xmlns='http://www.w3.org/2005/Atom'>
<title>emacs/src/fns.c, branch feature/auth-source-pass</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>Add PVSIZE function to return the size of a pseudovector.</title>
<updated>2017-04-10T18:35:13+00:00</updated>
<author>
<name>Lars Brinkhoff</name>
</author>
<published>2017-04-03T06:42:18+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=3ccd0ff1064a2836c379b13c2d5f4b11c5da1f88'/>
<id>3ccd0ff1064a2836c379b13c2d5f4b11c5da1f88</id>
<content type='text'>
* src/lisp.h (PVSIZE): New function.

* src/chartab.c (copy_char_table):
* src/data.c (Ftype_of, Finteractive_form, Faref, Faset):
* src/doc.c (Fdocumentation, store_function_docstring):
* src/eval.c (Fcommandp, funcall_lambda, lambda_arity, Ffetch_bytecode):
* src/fns.c (Flength, Fcopy_sequence):
* src/font.h (FONT_SPEC_P, FONT_ENTITY_P, FONT_OBJECT_P):
* src/lread.c (substitute_object_recurse):
* src/src/print.c (print_object):
  Use it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/lisp.h (PVSIZE): New function.

* src/chartab.c (copy_char_table):
* src/data.c (Ftype_of, Finteractive_form, Faref, Faset):
* src/doc.c (Fdocumentation, store_function_docstring):
* src/eval.c (Fcommandp, funcall_lambda, lambda_arity, Ffetch_bytecode):
* src/fns.c (Flength, Fcopy_sequence):
* src/font.h (FONT_SPEC_P, FONT_ENTITY_P, FONT_OBJECT_P):
* src/lread.c (substitute_object_recurse):
* src/src/print.c (print_object):
  Use it.
</pre>
</div>
</content>
</entry>
<entry>
<title>Deprecate copy-record in favor of copy-sequence</title>
<updated>2017-04-08T01:54:40+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2017-04-08T01:54:40+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=a2b3fea957440b8358d3632a4a05e41dee964b5d'/>
<id>a2b3fea957440b8358d3632a4a05e41dee964b5d</id>
<content type='text'>
Since copy-sequence seems to be needed anyway for records, have it
work on records, and remove copy-record as being superfluous.
* doc/lispref/records.texi (Records, Record Functions):
* lisp/emacs-lisp/cl-macs.el (cl-defstruct):
* lisp/emacs-lisp/eieio.el (make-instance, clone):
* test/src/alloc-tests.el (record-3):
Use copy-sequence, not copy-record, to copy records.
* doc/lispref/sequences.texi (Sequence Functions)
(Array Functions): Document that aref and copy-sequence
work on records.
* etc/NEWS: Omit copy-record.
* src/alloc.c (Fcopy_record): Remove.
* src/data.c (Faref): Document that arg can be a record.
* src/fns.c (Fcopy_sequence): Copy records, too.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since copy-sequence seems to be needed anyway for records, have it
work on records, and remove copy-record as being superfluous.
* doc/lispref/records.texi (Records, Record Functions):
* lisp/emacs-lisp/cl-macs.el (cl-defstruct):
* lisp/emacs-lisp/eieio.el (make-instance, clone):
* test/src/alloc-tests.el (record-3):
Use copy-sequence, not copy-record, to copy records.
* doc/lispref/sequences.texi (Sequence Functions)
(Array Functions): Document that aref and copy-sequence
work on records.
* etc/NEWS: Omit copy-record.
* src/alloc.c (Fcopy_record): Remove.
* src/data.c (Faref): Document that arg can be a record.
* src/fns.c (Fcopy_sequence): Copy records, too.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add record objects with user-defined types.</title>
<updated>2017-04-04T06:23:46+00:00</updated>
<author>
<name>Lars Brinkhoff</name>
</author>
<published>2013-01-06T13:27:44+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=a2c33430292c79ac520100b1d0e8e7c04dfe426a'/>
<id>a2c33430292c79ac520100b1d0e8e7c04dfe426a</id>
<content type='text'>
* src/alloc.c (allocate_record): New function.
(Fmake_record, Frecord, Fcopy_record): New functions.
(syms_of_alloc): defsubr them.
(purecopy): Work with records.

* src/data.c (Ftype_of): Return slot 0 for record objects, or type
name if record's type holds class.
(Frecordp): New function.
(syms_of_data): defsubr it.  Define `Qrecordp'.
(Faref, Faset): Work with records.

* src/fns.c (Flength): Work with records.

* src/lisp.h (prec_type): Add PVEC_RECORD.
(RECORDP, CHECK_RECORD, CHECK_RECORD_TYPE): New functions.

* src/lread.c (read1): Add syntax for records.

* src/print.c (PRINT_CIRCLE_CANDIDATE_P): Add RECORDP.
(print_object): Add syntax for records.

* test/lisp/emacs-lisp/cl-print-tests.el (cl-print-tests-2):
New test.

* test/src/alloc-tests.el (record-1, record-2, record-3):
New tests.

* doc/lispref/elisp.texi, doc/lispref/objects.texi,
doc/lispref/records.texi: Add documentation for records.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/alloc.c (allocate_record): New function.
(Fmake_record, Frecord, Fcopy_record): New functions.
(syms_of_alloc): defsubr them.
(purecopy): Work with records.

* src/data.c (Ftype_of): Return slot 0 for record objects, or type
name if record's type holds class.
(Frecordp): New function.
(syms_of_data): defsubr it.  Define `Qrecordp'.
(Faref, Faset): Work with records.

* src/fns.c (Flength): Work with records.

* src/lisp.h (prec_type): Add PVEC_RECORD.
(RECORDP, CHECK_RECORD, CHECK_RECORD_TYPE): New functions.

* src/lread.c (read1): Add syntax for records.

* src/print.c (PRINT_CIRCLE_CANDIDATE_P): Add RECORDP.
(print_object): Add syntax for records.

* test/lisp/emacs-lisp/cl-print-tests.el (cl-print-tests-2):
New test.

* test/src/alloc-tests.el (record-1, record-2, record-3):
New tests.

* doc/lispref/elisp.texi, doc/lispref/objects.texi,
doc/lispref/records.texi: Add documentation for records.
</pre>
</div>
</content>
</entry>
<entry>
<title>Some inotify cleanup</title>
<updated>2017-03-30T18:08:42+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2017-03-30T18:08:23+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=6ff870218dd4bc015cc4115ceb2febd8d807e57c'/>
<id>6ff870218dd4bc015cc4115ceb2febd8d807e57c</id>
<content type='text'>
This catches some problems with integer overflow and races
that I noticed in inotify.c after reviewing the changes
installed to fix Bug#26126.
* src/fns.c, src/lisp.h (equal_no_quit): Now extern.
* src/inotify.c (aspect_to_inotifymask):
Check for cycles and for improper lists.
(make_lispy_mask, lispy_mask_match_p): Remove.
All callers changed to use INTEGER_TO_CONS and CONS_TO_INTEGER.
(inotifyevent_to_event, add_watch):
Don’t assume watch descriptors and cookies fit in fixnums.
(add_watch): Use assoc_no_quit, not Fassoc.
Avoid integer overflow in (very!) long-running processes where
the Emacs watch ID could overflow.  Avoid some duplicate code.
(find_descriptor): New function.
(remove_descriptor): First arg is now the returned value from
find_descriptor, rather than the descriptor.  This way, the
value can be removed without calling Fdelete, which might quit.
Wait until the end (when watch_list is consistent) before signaling
any errors.
(remove_watch, inotify_callback):
Use find_descriptor to avoid the need for Fdelete.
(inotify_callback): Use simpler tests for ioctl failure.
Free temporary buffer if signaled, and put it on the stack if small.
Use ssize_t to index through read results, to avoid a cast.
(valid_watch_descriptor): New function, with a tighter check.
(Finotify_rm_watch, Finotify_valid_p): Use it.
(Finotify_valid_p): Use assoc_no_quit and ass_no_quit instead
of Fassoc.  Do not assume the first assoc succeeds.
* test/src/inotify-tests.el (inotify-valid-p-simple):
Add inotify-valid-p tests, some of which dump core without
the fixes noted above.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This catches some problems with integer overflow and races
that I noticed in inotify.c after reviewing the changes
installed to fix Bug#26126.
* src/fns.c, src/lisp.h (equal_no_quit): Now extern.
* src/inotify.c (aspect_to_inotifymask):
Check for cycles and for improper lists.
(make_lispy_mask, lispy_mask_match_p): Remove.
All callers changed to use INTEGER_TO_CONS and CONS_TO_INTEGER.
(inotifyevent_to_event, add_watch):
Don’t assume watch descriptors and cookies fit in fixnums.
(add_watch): Use assoc_no_quit, not Fassoc.
Avoid integer overflow in (very!) long-running processes where
the Emacs watch ID could overflow.  Avoid some duplicate code.
(find_descriptor): New function.
(remove_descriptor): First arg is now the returned value from
find_descriptor, rather than the descriptor.  This way, the
value can be removed without calling Fdelete, which might quit.
Wait until the end (when watch_list is consistent) before signaling
any errors.
(remove_watch, inotify_callback):
Use find_descriptor to avoid the need for Fdelete.
(inotify_callback): Use simpler tests for ioctl failure.
Free temporary buffer if signaled, and put it on the stack if small.
Use ssize_t to index through read results, to avoid a cast.
(valid_watch_descriptor): New function, with a tighter check.
(Finotify_rm_watch, Finotify_valid_p): Use it.
(Finotify_valid_p): Use assoc_no_quit and ass_no_quit instead
of Fassoc.  Do not assume the first assoc succeeds.
* test/src/inotify-tests.el (inotify-valid-p-simple):
Add inotify-valid-p tests, some of which dump core without
the fixes noted above.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix assoc_no_quit so that it does not quit</title>
<updated>2017-03-30T05:43:51+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2017-03-30T05:34:02+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=080a425db51e0b26b03f0f4bd06c814fc2b38578'/>
<id>080a425db51e0b26b03f0f4bd06c814fc2b38578</id>
<content type='text'>
The problem was that it called Fequal, which can quit.
* src/fns.c (enum equal_kind):
New enum, to be used in place of a boolean.
(equal_no_quit): New function.
(Fmemql, Feql): Use it to compare floats, as a minor tuneup.
(assoc_no_quit): Use it to avoid quitting, the main point here.
(internal_equal): Generalize bool to enum equal_kind arg, so that
there are now 3 possibilities instead of 2.  Do not signal an
error if EQUAL_NO_QUIT.  Put the arg before the depth, since depth
should be irrelevant if the arg is EQUAL_NO_QUIT.  All callers
changed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The problem was that it called Fequal, which can quit.
* src/fns.c (enum equal_kind):
New enum, to be used in place of a boolean.
(equal_no_quit): New function.
(Fmemql, Feql): Use it to compare floats, as a minor tuneup.
(assoc_no_quit): Use it to avoid quitting, the main point here.
(internal_equal): Generalize bool to enum equal_kind arg, so that
there are now 3 possibilities instead of 2.  Do not signal an
error if EQUAL_NO_QUIT.  Put the arg before the depth, since depth
should be irrelevant if the arg is EQUAL_NO_QUIT.  All callers
changed.
</pre>
</div>
</content>
</entry>
<entry>
<title>Restore XFLOATINT but with restricted args</title>
<updated>2017-03-02T21:50:03+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2017-03-02T21:48:47+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=56aaaf9bbaf9772ea714b16aa7ed2a9693ac92e3'/>
<id>56aaaf9bbaf9772ea714b16aa7ed2a9693ac92e3</id>
<content type='text'>
Turn instances of extract_float into XFLOAT_DATA when possible,
and to a resurrected XFLOATINT when the arg is a number.
The resurrected XFLOATINT is more like XFLOAT and XINT in
that is valid only if its arg is a number.  This clarifies
the ways in which floats can be extracted at the C level.
* src/editfns.c (styled_format):
* src/floatfns.c (extract_float, Fexpt):
Use XFLOATINT rather than open-coding it.
* src/fns.c (internal_equal):
* src/image.c (imagemagick_load_image):
* src/xdisp.c (resize_mini_window):
Prefer XFLOAT_DATA to extract_float on values known to be floats.
* src/frame.c (x_set_screen_gamma):
* src/frame.h (NUMVAL):
* src/image.c (x_edge_detection, compute_image_size):
* src/lread.c (read_filtered_event):
* src/window.c (Fset_window_vscroll):
* src/xdisp.c (handle_single_display_spec, try_scrolling)
(redisplay_window, calc_pixel_width_or_height, x_produce_glyphs)
(on_hot_spot_p):
Prefer XFLOATINT to extract_float on values known to be numbers.
* src/lisp.h (XFLOATINT): Bring back this function, except
it now assumes its argument is a number.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Turn instances of extract_float into XFLOAT_DATA when possible,
and to a resurrected XFLOATINT when the arg is a number.
The resurrected XFLOATINT is more like XFLOAT and XINT in
that is valid only if its arg is a number.  This clarifies
the ways in which floats can be extracted at the C level.
* src/editfns.c (styled_format):
* src/floatfns.c (extract_float, Fexpt):
Use XFLOATINT rather than open-coding it.
* src/fns.c (internal_equal):
* src/image.c (imagemagick_load_image):
* src/xdisp.c (resize_mini_window):
Prefer XFLOAT_DATA to extract_float on values known to be floats.
* src/frame.c (x_set_screen_gamma):
* src/frame.h (NUMVAL):
* src/image.c (x_edge_detection, compute_image_size):
* src/lread.c (read_filtered_event):
* src/window.c (Fset_window_vscroll):
* src/xdisp.c (handle_single_display_spec, try_scrolling)
(redisplay_window, calc_pixel_width_or_height, x_produce_glyphs)
(on_hot_spot_p):
Prefer XFLOATINT to extract_float on values known to be numbers.
* src/lisp.h (XFLOATINT): Bring back this function, except
it now assumes its argument is a number.
</pre>
</div>
</content>
</entry>
<entry>
<title>* src/fns.c (Fbuffer_hash): Doc fix.</title>
<updated>2017-03-01T08:15:21+00:00</updated>
<author>
<name>Leo Liu</name>
</author>
<published>2017-02-16T10:38:13+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=03f64ebbc685d803f9dcbb638c37501e0d6f8340'/>
<id>03f64ebbc685d803f9dcbb638c37501e0d6f8340</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Minor weak hash table performance tweaks</title>
<updated>2017-02-21T23:39:17+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2017-02-21T23:31:29+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=17af43ca76692c7e889c91d3fa9e6690349f0d57'/>
<id>17af43ca76692c7e889c91d3fa9e6690349f0d57</id>
<content type='text'>
* src/fns.c (make_hash_table): Omit unnecessary assignment to
h-&gt;next_weak when the hash table is not weak.
(copy_hash_table): Put the copy next to the original in the
weak_hash_tables list, as this should have better locality
when scanning the weak hash tables.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/fns.c (make_hash_table): Omit unnecessary assignment to
h-&gt;next_weak when the hash table is not weak.
(copy_hash_table): Put the copy next to the original in the
weak_hash_tables list, as this should have better locality
when scanning the weak hash tables.
</pre>
</div>
</content>
</entry>
<entry>
<title>Use float instead of Lisp_Object for rehash_size</title>
<updated>2017-02-21T23:39:17+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2017-02-21T23:31:29+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=83c9c6fc1cc943f239a021b42a8ca9b0e162198c'/>
<id>83c9c6fc1cc943f239a021b42a8ca9b0e162198c</id>
<content type='text'>
* src/alloc.c (purecopy_hash_table):
* src/fns.c (maybe_resize_hash_table, Fmake_hash_table):
(Fhash_table_rehash_size):
* src/lisp.h (struct Lisp_Hash_Table.rehash_size):
The rehash_size member of struct Lisp_Hash_Table is now a
float, not a Lisp_Object.
* src/alloc.c (purecopy_hash_table): Assign members in order.
* src/fns.c (make_hash_table): Use EMACS_INT for size and
float for rehash_size, instead of Lisp_Object for both.
All callers changed.
* src/lisp.h (DEFAULT_REHASH_SIZE): Now float, not double,
and 1 smaller.
* src/print.c (print_object): Simplify by calling
Fhash_table_rehash_size and Fhash_table_rehash_threshold.
Avoid unnecessary NILP.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/alloc.c (purecopy_hash_table):
* src/fns.c (maybe_resize_hash_table, Fmake_hash_table):
(Fhash_table_rehash_size):
* src/lisp.h (struct Lisp_Hash_Table.rehash_size):
The rehash_size member of struct Lisp_Hash_Table is now a
float, not a Lisp_Object.
* src/alloc.c (purecopy_hash_table): Assign members in order.
* src/fns.c (make_hash_table): Use EMACS_INT for size and
float for rehash_size, instead of Lisp_Object for both.
All callers changed.
* src/lisp.h (DEFAULT_REHASH_SIZE): Now float, not double,
and 1 smaller.
* src/print.c (print_object): Simplify by calling
Fhash_table_rehash_size and Fhash_table_rehash_threshold.
Avoid unnecessary NILP.
</pre>
</div>
</content>
</entry>
<entry>
<title>Use ptrdiff_t instead of Lisp_Object for collision</title>
<updated>2017-02-21T23:39:17+00:00</updated>
<author>
<name>Paul Eggert</name>
</author>
<published>2017-02-21T23:31:29+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=5cbdaa98f975c870c4afa24346630a18b55f27ab'/>
<id>5cbdaa98f975c870c4afa24346630a18b55f27ab</id>
<content type='text'>
* src/alloc.c (purecopy_hash_table): Assign, don’t purecopy.
* src/fns.c (set_hash_next_slot, set_hash_index_slot): Hash index
arg is now ptrdiff_t index (or -1 if empty), not Lisp_Object
integer (or Qnil if empty).  All callers changed.
(larger_vecalloc): New static function.
(larger_vector): Use it.
(HASH_NEXT, HASH_INDEX): Move here from lisp.h.  Return ptrdiff_t
index (or -1) not Lisp_Object integer (or Qnil).  All callers changed.
* src/fns.c (make_hash_table, maybe_resize_hash_table, hash_lookup)
(hash_put, hash_remove_from_table, hash_clear, sweep_weak_table):
* src/profiler.c (evict_lower_half, record_backtrace):
-1, not nil, is now the convention for end of collision list.
* src/fns.c (maybe_resize_hash_table): Avoid double-initialization
of the free list.  Reallocate H-&gt;next last, in case other
reallocations exhaust memory.
* src/lisp.h (struct Lisp_Hash_Table): ‘next_free’ is now
ptrdiff_t, not Lisp_Object.  Adjust commentary for ‘next’ and
‘index’, which no longer contain nil.
(HASH_NEXT, HASH_INDEX): Move to src/fns.c.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/alloc.c (purecopy_hash_table): Assign, don’t purecopy.
* src/fns.c (set_hash_next_slot, set_hash_index_slot): Hash index
arg is now ptrdiff_t index (or -1 if empty), not Lisp_Object
integer (or Qnil if empty).  All callers changed.
(larger_vecalloc): New static function.
(larger_vector): Use it.
(HASH_NEXT, HASH_INDEX): Move here from lisp.h.  Return ptrdiff_t
index (or -1) not Lisp_Object integer (or Qnil).  All callers changed.
* src/fns.c (make_hash_table, maybe_resize_hash_table, hash_lookup)
(hash_put, hash_remove_from_table, hash_clear, sweep_weak_table):
* src/profiler.c (evict_lower_half, record_backtrace):
-1, not nil, is now the convention for end of collision list.
* src/fns.c (maybe_resize_hash_table): Avoid double-initialization
of the free list.  Reallocate H-&gt;next last, in case other
reallocations exhaust memory.
* src/lisp.h (struct Lisp_Hash_Table): ‘next_free’ is now
ptrdiff_t, not Lisp_Object.  Adjust commentary for ‘next’ and
‘index’, which no longer contain nil.
(HASH_NEXT, HASH_INDEX): Move to src/fns.c.
</pre>
</div>
</content>
</entry>
</feed>
