* src/lisp.h (struct Lisp_Fwd): With the predicate enum, we can now pack
the offset and the predicate into a one-word struct.
(XBUFFER_OFFSET): Use the new field name.
* src/buffer.c (DEFVAR_PER_BUFFER): Create the one-word struct.
* src/data.c (store_symval_forwarding): Use the new field name.
Using an enum instead of a symbol makes it obvious that this field is
of no concern to the GC.
* src/lisp.h (enum Lisp_Fwd_Predicate): New.
(struct Lisp_Fwd): Use it instead of a symbol.
* src/buffer.c (DEFVAR_PER_BUFFER): Create the necessary enum constant
instead of a symbol.
* src/data.c (check_fwd_predicate, check_choice): New helpers.
(store_symval_forwarding): Use it.
* src/lisp.h (struct Lisp_Buffer_Objfwd): Deleted.
(struct Lisp_Fwd): Add the fields bufoffset and bufpredicate.
Make the type a 1-byte bitfield so that the entire struct still
fits in two words.
(XBUFFER_OFFSET): Renamed from XBUFFER_OBJFWD.
* src/buffer.c (DEFVAR_PER_BUFFER, defvar_per_buffer)
(buffer_local_value): Update accordingly.
* src/data.c (do_symval_forwarding, store_symval_forwarding)
(set_internal, default_value, set_default_internal)
(Fmake_local_variable, Fkill_local_variable, Flocal_variable_): Use
XBUFFER_OFFSET.
* src/lisp.h (struct Lisp_Kboard_Objfwd): Deleted ...
(struct Lisp_Fwd): ... replaced with field kbdoffset.
(DEFVAR_KBOARD): Use new field.
* src/data.c (XKBOARD_OFFSET): Renamed from XKBOARD_OBJFWD.
(do_symval_forwarding, store_symval_forwarding
(set_default_internal): Use it .
* src/lisp.h (struct Lisp_Objfwd): Deleted.
(struct Lisp_Fwd): Replace it with objvar field.
(DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_LISP_NOPROX): Use the field.
* src/lread.c (defvar_lisp): Updated as needed.
* src/pdumper.c (dump_field_fwd): Use the field.
* src/data.c (XOBJVAR): Renamed and updated from XOBJFWD.
(do_symval_forwarding, store_symval_forwarding): Use it.
* src/lisp.h (struct Lisp Boolfwd): Deleted
(struct Lisp_Fwd): Replaced it with a boolvar field.
(DEFVAR_BOOL): Update.
* src/data.c (XBOOLVAR): Renamed from XBOOLFWD.
(do_symval_forwarding, store_symval_forwarding): Use it.
* src/pdumper.c (dump_field_fwd): Use boolvar field.
It was a struct with a single field.
* src/lisp.h (struct Lisp_Intfwd): Deleted.
(struct Lisp_Fwd): Add an intvar field instead.
(DEFVAR_INT): Update accordingly.
* src/data.c (XINTVAR): Updated and renamed from XFIXNUMFWD.
(do_symval_forwarding, store_symval_forwarding): Use it.
This contains the type and an union of Lisp_Objfwd, Lisp_Intfwd etc.
lispfwd is now a pointer to a struct Lisp_Fwd; the void *fwdptr field is
gone.
* src/lisp.h (struct Lisp_Fwd): New.
(Lisp_Intfwd, Lisp_Boolfwd, Lisp_Objfwd, Lisp_Buffer_Objfwd)
(Lisp_Kboard_Objfwd): The type is in in Lisp_Fwd.
(lispwfd): Is now a pointer to struct Lisp_Fwd.
(SYMBOL_BLV, SET_SYMBOL_FWD, XFWDTYPE, BUFFER_OBJFWDP): Update
accordingly.
(defvar_lisp, defvar_lisp_nopro, defvar_bool, defvar_int)
(defvar_kboard): These all take now a Lisp_Fwd.
(DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL, DEFVAR_INT)
(DEFVAR_KBOARD): Update for new types.
* src/lread.c (defvar_int, defvar_bool, defvar_lisp_nopro)
(defvar_lisp, defvar_kboard): Update for new types.
* src/pdumper.c (dump_field_fwd, dump_blv): Update accordingly.
(dump_fwd_int, dump_fwd_bool, dump_fwd_obj, dump_fwd_buffer_obj)
(dump_fwd): Deleted.
* src/buffer.c (DEFVAR_PER_BUFFER, defvar_per_buffer, buffer_local_value)
(set_buffer_internal_1): Update accordingly for new types.
* src/data.c (XBOOLFWD, XKBOARD_OBJFWD, XFIXNUMFWD, XOBJFWD, boundp)
(store_symval_forwarding, swap_in_global_binding)
(swap_in_symval_forwarding, find_symbol_value, set_internal)
(default_value, set_default_internal, make_blv, Fmake_local_variable):
Update accordingly.
The predicate field is always a builtin symbol. That means we know the
bit pattern at compile-time and they don't change at runtime.
* src/buffer.c (DEFVAR_PER_BUFFER): Create a const struct.
(defvar_per_buffer): Remove predicate and address arguments.
(syms_of_buffer): Instead of &BVAR (current_buffer, foo) use a plain foo
as argument to DEFVAR_PER_BUFFER.
* src/pdumper.c (dump_field_fwd): No more relocs needed for
Lisp_Fwd_Buffer_Obj and we can't apply them in the .rodata section.
The forwarding structs already exist in the data or bss section.
They are all created with DEFVAR_INT and similar macros. Instead
of creating new structs in the dump, create relocs to the data section.
* src/pdumper.c (dump_field_fwd): New.
(dump_blv, dump_symbol): Use it.
(dump_pre_dump_symbol): Don't dump fwd objects.
This restores the original behavior of 'overlays_in'. Changes in
this behavior had been made for cases of narrowing, but this
resulted in a regression with uses of 'remove-overlays'.
* src/buffer.c (overlays_in): Change all occurrences of ZV to Z.
* test/src/buffer-tests.el (test-overlays-in-2)
(test-remove-overlays): Adjust expected results to accommodate
changes in 'overlays_in'.
Accommodate NS Emacs on a headless system.
Add error checking for failed calls to NSColorList writeToURL
and writeToFile.
* src/nsterm.m (ns_term_init): Move color initialization to
nsfns.m.
* src/nsfns.m (ns_init_colors): New function.
(Fns_list_colors): Call ns_init_colors.
Apparently some people believe that a colspan can be fractional, and
produce HTML with such. Make it possible for SHR to render such HTML
by truncating colspan.
* lisp/net/shr.el (shr-make-table-1): Ensure 'colspan' is a fixnum.
(Bug#80354)
* lisp/net/newst-backend.el (newsticker--parse-text-container):
Only "xhtml" type contains inline XML nodes that need to be run
through 'newsticker--unxml' to serialize back to a string.
(Bug#80317)
* lisp/language/indian.el (devanagari-composable-pattern): Account
for contextual positioning of punctuation signs when preceded by
a character. (Bug#80368)
Improve the Devanagari composition rules to account for contextual
positioning of punctuation signs when preceded by a character.
* lisp/help-fns.el (describe-mode--minor-modes): Add argument `buffer`.
(describe-mode): Use it to fix call to `documentation` so the
docstrings are computed in the right buffer and thus show
correctly when bindings are shadowed by minor modes.
Fix a typo in the documentation for the expected arguments when
calling smie-rules-function to set the indentation offset of
function arguments.
* doc/lispref/modes.texi (SMIE Indentation):
* lisp/emacs-lisp/smie.el (smie-rules-function): Fix typo in
documentation for smie-rules-function arguments.
* lisp/progmodes/make-mode.el (makefile-make-font-lock-keywords)
(makefile-makepp-font-lock-keywords): Use `font-lock-*-face`
faces rather than variables.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
Always evaporate 'prog1' when the tail is effect-free, even
when the value expression isn't.
* lisp/icomplete.el (icomplete-ret): No longer conditionalize on
icomplete-show-matches-on-no-input.
Suggested by Juri Linkov <juri@linkov.net> in bug#62108.
(icomplete-show-matches-on-no-input, icomplete-ret):
* etc/NEWS: Improve documentation.
* lisp/emacs-lisp/cond-star.el (cond*-non-exit-clause-p)
(cond*-non-exit-clause-substance): Don't consider a bind-and*
clause without ':non-exit' to be a non-exit clause (bug#80376).
(cond*):
* doc/lispref/control.texi (cond* Macro): Fix docs accordingly.
This package provides platform-neutral interfaces to block your
system from entering idle sleep and a hook to process pre-sleep
and post-wake events.
Implementations are for D-Bus on GNU/Linux, macOS/GNUstep, and
MS-Windows.
* lisp/system-sleep.el: New package.
* src/fns.c: Qpre_sleep, Qpost_wake: New DEFSYM.
* src/nsfns.m (Fns_block_system_sleep, Fns_unblock_system_sleep)
(syms_of_nsfns): New functions.
* src/nsterm.m (applicationDidFinishLaunching): Subscribe to
pre-sleep and post-wake notifications.
(systemWillSleep, systemDidWake): New function.
* src/w32fns.c (Fw32_block_system_sleep)
(Fw32_unblock_system_sleep, Fw32_system_sleep_block_count)
(sleep_notification_callback)
(w32_register_for_sleep_notifications): New function.
(syms_of_w32fns): Sw32_unblock_system_sleep
Sw32_block_system_sleep Sw32_system_sleep_block_count: New
defsubr.
* src/w32term.h (Fw32_block_system_sleep): New extern.
* src/w32term.c (w32_initialize): Call
w32_register_for_sleep_notifications.
* doc/lispref/os.texi: Document the system-sleep package.
* doc/lispref/commands.texi: Update sleep-event special
documentation.
* etc/NEWS: Announce the new package.
* lisp/progmodes/project.el: Describe the new cache in Commentary,
the "VC-aware project" section.
(project-vc-cache-timeout)
(project-vc-non-essential-cache-timeout): New variables.
(project--get-cached, project--set-cached):
New functions.
(project-try-vc, project--value-in-dir): Use them.
(project--read-dir-locals): New function, extracted from the
above. Return the full alist, to be saved to cache at once.
(project--clear-cache): New function.
(project-remember-projects-under)
(project-forget-zombie-projects, project-forget-projects-under):
Use it.
(project-uniquify-dirname-transform, project-mode-line-format):
Bind 'non-essential' to choose the longer caching strategy.
(project-name-cache-timeout, project-name-cached): Remove.
(project-mode-line-format): Switch to calling 'project-name'
directly, with the new caching in use.
Co-authored-by: Juri Linkov <juri@linkov.net>
* lisp/progmodes/project.el (project--remove-from-project-list):
Don't call 'abbreviate-file-name', expect it to be abbreviated
already. The file might be on an inaccessible filesystem.
(project-current): Call abbreviate-file-name here (bug#80340).
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--print-form):
Remove the "\\\n" hack we used to use together with
`src/lread.c` code to avoid allocating heap space for docstrings
that were going to be replaced by `Snarf-documentation`.
We don't keep ELisp docstrings in DOC any more anyway.
* lisp/gnus/gnus-topic.el (gnus-group-sort-selected-topic): New
function to sort selected groups into topic.
(gnus-topic-mode): Use it as sort selected function in topic
mode.
* etc/NEWS: Announce the change.
Fix some misuses of `defconst` and `%s`, avoid uses of the old
dynbound dialect of `eval`, delete redundant `:group` arguments,
and prefer #' to quote function names.
And stop creating alists for completion tables since lists of
strings work just as well.
* lisp/calendar/appt.el: Delete redundant `:group` arguments.
Prefer #' to quote function names.
* lisp/calendar/cal-hebrew.el (solar-time-string): Declare function.
(calendar-hebrew-read-date, calendar-hebrew-list-yahrzeits):
* lisp/calendar/cal-persia.el (calendar-persian-read-date):
* lisp/calendar/cal-mayan.el (calendar-mayan-read-haab-date)
(calendar-mayan-read-tzolkin-date):
* lisp/calendar/cal-julian.el (calendar-julian-goto-date):
* lisp/calendar/cal-islam.el (calendar-islamic-read-date):
* lisp/calendar/cal-coptic.el (calendar-coptic-read-date):
* lisp/calendar/cal-bahai.el (calendar-bahai-read-date):
Completion tables can be lists of strings for decades.
* lisp/calendar/cal-china.el: Delete redundant `:group` arguments.
(calendar-chinese-zodiac-sign-on-or-after)
(calendar-chinese-new-moon-on-or-after): Use lexical dialect also
for `eval`.
* lisp/calendar/cal-dst.el: Delete redundant `:group` arguments.
Use lexical dialect also for `eval`.
* lisp/calendar/cal-html.el: Delete redundant `:group` arguments.
* lisp/calendar/cal-menu.el: Prefer #' to quote function names.
* lisp/calendar/cal-tex.el: Delete redundant `:group` arguments.
(cal-tex-weekly-common): Use lexical dialect also for `eval`.
* lisp/calendar/calendar.el (calendar-mode-map):
Prefer #' to quote function names.
* lisp/calendar/diary-icalendar.el (di:rrule-sexp-to-recurrence)
(di:other-sexp-to-recurrence): Use lexical dialect also for `eval`.
* lisp/calendar/diary-lib.el: Delete redundant `:group` arguments.
Prefer #' to quote function names.
(diary-sexp-entry, diary-offset, diary-remind): Use lexical dialect
also for `eval`.
* lisp/calendar/icalendar-macs.el (ical:define-param): Fix misuse of
`%s` in `format`.
* lisp/calendar/icalendar-parser.el (ical:value-types)
(ical:param-types, ical:property-types, ical:component-types):
Don't use `defconst` on variables we mutate.
* lisp/calendar/icalendar-recur.el (icr:current-tz-to-vtimezone)
(icr:current-tz-to-vtimezone): Use lexical dialect also for `eval`.
* lisp/calendar/icalendar.el: Delete redundant `:group` arguments.
* lisp/calendar/lunar.el: Prefer #' to quote function names.
* lisp/calendar/solar.el (solar-sunrise-sunset-string)
(calendar-sunrise-sunset-month): Use lexical dialect also for `eval`.
* lisp/calendar/timeclock.el: Prefer #' to quote function names.