This does not change behavior.
* src/emacs.c (follow_if_symlink): New static function, as a
vehicle for commentary explaining the deal with readlink and realpath.
(find_emacs_executable): Use it.
The new 'borders-respect-alpha-background' frame parameter, when
set to 't', will make window dividers and internal borders
respect the 'alpha-background' frame parameter. This allows
transparent gaps between windows.
* doc/lispref/frames.texi (Font and Color Parameters):
Document the change.
* src/frame.c (frame_parm_table, syms_of_frame)
(gui_set_borders_respect_alpha_background):
* src/frame.h (struct frame): Add frame parameter.
* src/androidfns.c (x_create_frame, android_create_tip_frame)
(android_frame_parm_handlers):
* src/haikufns.c (haiku_create_frame, haiku_create_tip_frame)
(haiku_frame_parm_handlers):
* src/nsfns.m (ns_frame_parm_handlers, x_create_frame):
* src/w32fns.c (x_create_frame, w32_create_tip_frame)
(w32_frame_parm_handlers): Add dummy parameters for backends
that don't support opacity.
* src/pgtkfns.c (pgtk_frame_parm_handlers, x_create_frame)
(pgtk_create_tip_frame):
* src/pgtkterm.c (pgtk_draw_window_divider):
* src/xfns.c (x_create_frame, x_create_tip_frame)
(x_frame_parm_handlers)
* src/xterm.c (x_draw_window_divider)
(x_clear_under_internal_border): Implement parameter on backends
that support opacity.
* src/nsterm.m (ns_draw_fringe_bitmap): Move the call to ns_focus out of
the if for overlay_p and rename the rect from clearRect to bmpRect to
make it's purpose clearer.
* src/nsterm.m (ns_define_fringe_bitmap): Replace the fringe bitmap
"tracing" method to a true tracing method. This should make the
resulting vector simpler and therefore faster to draw.
* src/nsterm.m (selectedRange): Implement to fix dictation.
* etc/NEWS: Announce regression fix.
* etc/PROBLEMS: Help users recover from rejected permission.
* src/callproc.c (init_callproc): Don’t bother testing for the
existence of ../src/ and NEWS if installation-directory is
non-nil, because in that case we will test for ../etc/NEWS anyway.
Simplify by using AUTO_STR.
* src/lisp.h (AUTO_STR, AUTO_STR_WITH_LEN): New macros.
Long ago this sort of thing would have been a no-no
because we needed to GCPRO the strings.
However, GCPRO went away a decade ago.
When PATH is unset or empty, use the system default,
to be consistent with GNU/Linux and with POSIX.
If there is no system default do not default to "."
as that can be dangerous.
* src/callproc.c (init_callproc_1, init_callproc):
Default PATH to the null pointer, not the empty string.
* src/emacs.c (default_PATH): New function.
(find_emacs_executable, decode_env_path): Be consistent with POSIX
and with glibc about what to do when PATH is unset or empty.
* src/emacs.c (find_emacs_executable): If the executable name
contains a slash, use the same optimization for symlink resolution
that we already use when the executable name has no slash.
* src/fileio.c (Finsert_file_contents): Don’t give up finding the
file’s end merely because SEEK_END fails. Try a small test read
anyway. This might work in non-POSIX file systems where SEEK_END
is not allowed, and trying is easy and simplifies the code.
* src/nsterm.m ([EmacsView updateCollectionBehavior]):
Use NSWindowCollectionBehaviorFullScreenAuxiliary for non-native
tooltips which are not child frames.
This fixes some longstanding bugs, along with bugs recently
introduced as part of fixes for Bug#77315.
* src/fileio.c (Finsert_file_contents): Arrange for END_OFFSET
to never be less than BEG_OFFSET, to simplify the code.
Do not go past END_OFFSET when sampling or optimizing reading.
Avoid a few unnecessary lseeks.
This is related to recent fixes for Bug#77315.
* src/fileio.c (Finsert_file_contents): Defend against
a file shrinking to be smaller than its initial offset.
This can happen only on platforms like Solaris where
the initial offset can be positive.
This increases the max read size from 0.25 to 1 MiB, which is a
bit better for Emacs in my measurements. The old value was taken
from coreutils, but was for a different purpose.
* src/fileio.c (INSERT_READ_SIZE_MAX): New constant, replacing
IO_BUFSIZE. All uses changed.
(Finsert_file_contents): Do not use a read buffer that is larger
than INSERT_READ_SIZE_MAX.
This partially reverts 55f41ca3aa,
which was a partial fix for Bug#77315.
* src/fileio.c (Finsert_file_contents): Go back to accepting
partial reads when doing the optimized way when code conversion is
not needed. This avoids an unlikely bug when END happens to lie
at a buffer boundary, causing an infloop. For consistency, do the
same when doing code conversion (though there’s no bug in then),
as there’s not a real need for emacs_full_read there either.
* src/emacs.c (read_full):
Simplify by assuming MAX_RW_COUNT is defined.
* src/lisp.h (MAX_RW_COUNT): Move here from src/sysdep.c.
* src/pdumper.c (dump_read_all):
Use MAX_RW_COUNT rather than defining our own equivalent.
* src/fileio.c (Finsert_file_contents): Be more conservative
when reading from seekable non-regular files when END is given.
The code assumed that in this case, reads would succeed or fail
quickly so there was no need to call internal_condition_case_1.
However, in some cases, e.g., /dev/random, it could take a while.
This fixes a glitch introduced in commit
cb4579ed6b dated 2022-06-11.
This fixes a potential (albeit quite unlikely) bug
introduced during recent fixes to Bug#77315.
* src/fileio.c (union read_non_regular.s.inserted):
Bring back this member.
(read_non_regular, Finsert_file_contents): Work in the unlikely
case when internal_condition_case_1 relocates the buffer before
calling read_non_regular.
This improves on recent fixes to Bug#77315.
When sampling the first 1 KiB and last 3 KiB, do not seek before
BEG if given. Instead, sample starting at BEG, to be consistent
with the non-optimized version.
* src/fileio.c (xlseek): Return POS, for convenience.
(Finsert_file_contents): Sample the first 1 KiB correctly when BEG.
In a CURPOS local, keep track of the input file offset, or for
nonseekable files the number of bytes read, while this value is
important. This lets us avoid some unnecessary seeks. Report an
error earlier if the file is not seekable and BEG is nonzero,
to save work and simplify the code. When sampling, discard less
data, as this is simpler and there’s little point to discarding it.
* src/fileio.c (xlseek): New function.
(Finsert_file_contents): Use it instead of doing things by hand.
(write_region): Match diagnostic wording to xlseek’s.
This improves on recent fixes to Bug#77315.
* src/fileio.c (Finsert_file_contents): When optimizing
do not seek to 0 if the initial file offset is positive,
as that causes the optimized code to behave differently
from the nonoptimized.
This improves on recent fixes to Bug#77315.
* src/fileio.c (Finsert_file_contents):
Do not give up on seeking merely because SEEK_END fails.
On some files (/proc/cpuinfo, say) SEEK_END can fail
even though SEEK_SET and SEEK_CUR succeed, and the
code still works in this case.
* src/fileio.c (Finsert_file_contents): Store st_size,
not file_size_hint, into current_buffer->modtime_size,
since modtime_size is compared to a later st_size, not
to the actual file size. Simplify buffer overflow detection
from file size, since this occurred only on regular files.
Don't do a full lookup if the argument is a symbol, and only compute the
hash index once. Fix a bug that occurred when there is another symbol
whose shorthand is equal to the true name of the symbol being removed.
* src/lread.c (Funintern): Rewrite for speed and correctness.
(oblookup_last_bucket_number, oblookup): Remove now unused variable.
* test/src/lread-tests.el (lread-unintern): New test.
It has been ineffective since 2002.
Suggested by Lynn Winebarger.
* src/lread.c (Fload, readevalloop_1, readevalloop, Feval_buffer)
(Feval_region, syms_of_lread): Remove the variable and its propagation.
* etc/NEWS: Announce.
* lisp/emacs-lisp/comp.el (comp--native-compile): Avoid `%s`
on objects that may not have names.
* src/data.c (Ffset): Don't compute trampoline for no-op `fset`.
Problem reported by Zhengyi Fu (Bug#79031).
* src/fileio.c (Finsert_file_contents): Do not read more than
requested, even when the gap is so small that we use a local buffer.
In commit 61a8ce0280 I mistakenly
focused on overlap in the buffer. The code also needs to check
for overlap in the inserted file data.
Problem reported by Gerd Möllmann (Bug#79020).
* src/fileio.c (Finsert_file_contents): Prevent overlap in both
the buffer head and tail, and in the inserted file’s head and tail.
Also, shrink the file’s head if the file shrank to be smaller
than its head.
The redisplay code is not re-entrant. To allow running ELisp code
from within redisplay, we have some hacks (e.g. `inhibit-redisplay`)
that try to avoid the resulting breakage.
This commit adds another one of those hacks, which tries
to get closer to the core of the problem, thereby making it "safe"
to override `inhibit-redisplay`, e.g. to debug jit-lock code.
* src/dispextern.h (redisplay_counter): Declare.
* src/xdisp.c (redisplay_counter): Define.
(redisplay_internal) Increment it.
(dsafe__call): Use it, in case `inhibit-redisplay` is overridden.
* src/eval.c (call_debugger): Use it as well to refine the test
we already had.