* lisp/progmodes/xref.el (xref--xref-buffer-mode):
Use `outline-button-cover-text`. Unconditionally enable
`outline-minor-mode`.
(xref--insert-xrefs): Add a marker char for groups, for outline's benefit.
* lisp/outline.el (outline-minor-mode-use-buttons): De-advertize `insert`.
(outline-button-cover-text): New variable.
(outline--button-icons): Adjust var docstring.
(outline-minor-mode): Flush the button icons memoization table.
(outline--button-icons): Fill the memoization var lazily.
Rename function from `outline--create-button-icons`. Add 2 args.
Use the `location` arg to determine what to return instead of relying
on `outline-minor-mode-use-buttons`.
(outline--insert-button): Adjust calls accordingly.
It's important not to hide buffer text modifications from
`after/after-change-functions` since it can break other packages'
assumptions.
* lisp/outline.el (outline--insert-button): Don't silence
buffer text modification.
(outline--fix-up-all-buttons): Save buffer's modified state instead.
* lisp/outline.el (outline-minor-mode): Use jit-lock instead of
`after-change-functions`.
(outline-flag-region): Run `outline--fix-buttons` since jit-lock
won't be triggered.
(outline--fix-up-all-buttons): Make the args mandatory.
(outline--fix-buttons): Rename from `outline--fix-buttons-after-change`.
Fix the END calculation. Return the affected bounds, for jit-lock.
In Xref, enabling+disabling `outline-minor-mode` left two spaces
in front of every heading (a.k.a "group") line.
* lisp/outline.el (outline--remove-buttons): New function.
(outline-minor-mode, outline--fix-buttons-after-change): Use it.
(outline-after-change-functions): Improve docstring.
* 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.
* lisp/files.el (locate-dominating-file): Do not call
file-directory-p each time through a loop ascending the directory
hierarchy, as the file must be a directory after the first loop
iteration. Instead, call file-directory-p just once, before the
loop starts, and do this only if the file name is not already that
of a directory.
* lisp/view.el (view-mode-exit): When view-read-only is non-nil,
don't exit View mode if doing so would leave behind a read-only
buffer not in View mode.
(View-exit): Bind view-read-only to nil to override the above.
* lisp/vc/vc-git.el (vc-git--empty-tree): New constant.
(vc-git-diff): When REV1 and REV2 are both nil and there are no
commits yet, diff against the empty tree object (bug#78987).
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.
* lisp/scroll-lock.el (scroll-lock-next-line-always-scroll)
(scroll-lock-next-line, scroll-lock-previous-line)
(scroll-lock-forward-paragraph, scroll-lock-backward-paragraph):
Make them support shift-translation, like the commands remapped to
them do. (Bug#79022)
Move two 'setq' expressions from the RefTeX label selection loop
to the body of the major mode definition, so to make it easier
to adjust the settings of the buffer via the mode hook.
* lisp/textmodes/reftex-ref.el (reftex-offer-label-menu): Move
two 'setq' expressions from here...
* lisp/textmodes/reftex-sel.el (reftex-select-label-mode): ...to
here. (bug#77335)
Give more control over ordering when linearizing the
parent graph and avoid pathological misbehavior (such as
placing `t` in the middle of the linearization instead of the
end) when we can't "do it right".
* lisp/subr.el (merge-ordered-lists): Degrade more gracefully in case
of inconsistent hierarchies and don't do it silently.
* lisp/emacs-lisp/cl-preloaded.el (cl--class-allparents): Use the local
ordering to break ties, as in the C3 algorithm.
* lisp/textmodes/tex-mode.el (tex--prettify-symbols-alist): Remove
entry for "\\newline", which resulted in an invisible display.
Prettify "\\ " with OPEN BOX instead of BOTTOM SQUARE BRACKET.
(tex--prettify-symbols-compose-p): Skip composition when the
control backslash is itself escaped (bug#78752).
* test/src/thread-tests.el (threads-thread-sleeps): New helper
function.
(threads-join-error): Fix to work as intended, and remove the
'unstable' tag. (Bug#40823)
This change makes insert-file-contents-literally 30% faster on my
platform, when inserting xdisp.c.
* src/fileio.c (READ_BUF_SIZE): Remove, replacing with ...
(IO_BUFSIZE): ... this new constant from Coreutils.
All uses of READ_BUF_SIZE changed to either MAX_ALLOCA or
IO_BUFSIZE.
* src/fileio.c (union read_non_regular):
New members buf and bufsize replace inserted and trytry.
(read_non_regular): Adjust to this new, simpler interface.
(Finsert_file_contents): If the gap is smaller than read_buf
and we want to read more than the gap, read into read_buf
first, to avoid lots of tiny reads from /proc files.
* src/fileio.c (emacs_full_read): New function.
(Fcopy_file, Finsert_file_contents): Use it.
(Finsert_file_contents): Check for partial reads when scanning
backwards through the file’s tail, as this indicates the file
shrank while we read it. Also, use emacs_full_read in other
situations where it’s simpler and should be a bit faster.
* src/fileio.c (Finsert_file_contents): Use ptrdiff_t, not int, to
store results returned by emacs_fd_read, which return ptrdiff_t.
This doesn’t fix any bugs since the values happen to fit in int,
but is a bit clearer and may simplify future changes.