Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebasing to emacs master #13

Open
wants to merge 10,000 commits into
base: json-rpc
Choose a base branch
from

Conversation

hypotrochoid
Copy link

@hypotrochoid hypotrochoid commented Feb 4, 2024

I rebased the json-rpc branch onto emacs master, just opening PR here to make it available to others who want it updated.
I was unable to compile the version in json-rpc directly, but this one seems to work fine for me. I haven't put any effort however into debugging the base branch.

monnier and others added 30 commits January 14, 2024 22:17
* lisp/progmodes/js.el (js--mode-setup): New function, extracted from
`js-mode`.
(js-mode): Use it.
(js-json-mode): Use it instead of inheriting from `js-mode`.
* lisp/jsonrpc.el (jsonrpc--remove): Check timer before cancelling it.
(Version): Bump to 1.2.24

See joaotavora/eglot#1342
This simplification is symmetrical to 01fb898.

* src/editfns.c: (Finternal__labeled_widen): Add a call to
'Fwiden', and rename from 'internal--unlabel-restriction'.
(unwind_labeled_narrow_to_region): Use the renamed function, and
remove the call to 'Fwiden'.
(syms_of_editfns): Rename the symbol.

* lisp/subr.el (internal--without-restriction): Use the renamed
function.

(cherry picked from commit 9e9e116)
* lisp/mh-e/mh-funcs.el (mh-kill-folder), lisp/mh-e/mh-search.el
  (mh-index-new-folder), lisp/mh-e/mh-utils.el (mh-prompt-for-folder):
  Check for existence of speedbar-buffer rather than
  mh-speed-folder-map. The latter can exist if mh-speed has only been
  loaded but not displayed.
* lisp/international/fontset.el (setup-default-fontset): If
`android', search for Arabic or Khmer fonts with script tags,
not OTF features.
* lisp/mh-e/mh-funcs.el (mh-kill-folder)
* lisp/mh-e/mh-search.el (mh-index-new-folder)
* lisp/mh-e/mh-utils.el (mh-prompt-for-folder):
Check for existence of 'speedbar-buffer' rather than
'mh-speed-folder-map'.  The latter can exist if
'mh-speed' has only been loaded but not displayed.

(cherry picked from commit e6a2901)
* doc/lispref/windows.texi (Buffer Display Action Alists):
Add 'post-command-select-window'.

* lisp/window.el (display-buffer): Add 'post-command-select-window'
to the docstring and handle at the end of function.
* src/fns.c (hash_table_thaw): Don't allocate anything for empty
tables.  Don't initialise the next vector twice.
(maybe_resize_hash_table): Factor out min_size constant.
* src/pdumper.c (dump_hash_table): Update for changes in recent
hash-table patch suites (bug#68244).
(dump_buffer): Update for case-fold-search changes (bug#66117).
* src/sfnt.c (sfnt_interpret_ip): Avoid precision loss by
retrieving original positions from the unscaled outline,
whenever possible.
* test/src/comp-tests.el (comp-tests-ret-type-spec-71): Update a test
due to new 'sxhash-equal' behaviour.
* test/lisp/eshell/em-cmpl-tests.el
  (em-cmpl-test/file-completion/non-unique): Make test more robust.
* lisp/vc/diff-mode.el (diff-vc-deduce-fileset):
Remove nil elements from the result (bug#68443).
* README:
* configure.ac:
* nt/README.W32:
* msdos/sed2v2.inp: Bump Emacs version to 29.2.
* README:
* configure.ac:
* nt/README.W32:
* msdos/sed2v2.inp:
* etc/NEWS: Bump Emacs version to 29.2.50.
* lisp/gnus/gnus-cite.el (gnus-message-citation-mode): Use
`font-lock-add-keywords' and `font-lock-remove-keywords' instead of
modifying font-lock defaults.  Make no font-lock changes until
`font-lock-mode' is active.

Thanks to Morgan Willcock
This invariant was intended but insufficiently enforced which could
lead to an assertion failure.

* src/fns.c (hash_index_size): Assume size>0, and return a value >1.
(make_hash_table): Only use hash_index_size for size>0.
This flaw could cause an assertion failure.

* src/print.c (PRINT_CIRCLE_CANDIDATE_P): Don't consider Qunbound a
print-circle candidate; it should never be seen by Lisp anyway.
Eli-Zaretskii and others added 30 commits January 30, 2024 16:15
* lisp/progmodes/vhdl-mode.el (vhdl-speedbar-insert-hierarchy):
Rename a variable to avoid shadowing a global.  (Bug#68810)
Take this code as an example:

1 class Foo
2 {
3     /**
4      * Block comment
5      */
6     function foo($c) {
7     }
8 }

Suppose the block comment is covered by a local parser.  When we
indent line 3, treesit--indent-1 will try to get the local parser at
the BOL, and it'll get the local parser.  But it shouldn't use the
local parser to indent this line, it should use the host parser of
that local parser instead.

So now, if treesit--indent-1 gets a local parser, but the local
parser's root node's start coincides with BOL, treesit--indent-1 will
use the host parser to indent this line.

We also need to make treesit--update-ranges-local to save the host
parser along with the local parser, and make
treesit-local-parsers-at/on extract and return the host parser.

I also switch the two cases in the cond form in treesit--indent-1:
(null (treesit-parser-list)) and (car local-parsers), (car
local-parsers) now takes precedence.

* lisp/treesit.el (treesit-local-parsers-at):
(treesit-local-parsers-on): Add WITH-HOST parameter.
(treesit--update-ranges-local): Save the host parser to the local
overlay.
(treesit--indent-1): If the root node of the local parser is at BOL,
use the host parser instead.
This fixes a hang that would frequently rear its ugly head while
displaying messages in the `telega.el' instant messenger client,
which inserts images approaching the width of the window with
line and wrap prefixes.

* src/xdisp.c (move_it_in_display_line_to): If a line or wrap
prefix is set in place, do not generate continuation lines until
a minimum of one glyph has been produced outside that prefix.
(move_it_to): Remove the previous workaround that could not
recover from errors caused by display strings.
(display_line): Synchronize with move_it_in_display_line_to;
remove old workaround that only provided for oversized wrap
prefixes comprising `space' display objects.
Hash tables using different user-defined tests defined identically
sometimes ended up using the wrong test (bug#68668).

* src/fns.c (get_hash_table_user_test): Take test name into account
when matching the test object.
* test/src/fns-tests.el (fns--define-hash-table-test): New.
The obsolete lazy-loaded bytecode feature, enabled by
`byte-compile-dynamic`, slows down Lisp execution even when not in use
because every call to a bytecode function has to check that function
for laziness.

This change forces up-front loading of all lazy bytecode so that we
can remove all those checks.  (Dynamically loaded doc strings are not
affected.)

There is no point in generating lazy bytecode any more so we stop
doing that; this simplifies the compiler.  `byte-compile-dynamic` now
has no effect.

This is a fully compatible change; the few remaining users of
`byte-compile-dynamic` should not notice any difference.

* src/lread.c (bytecode_from_rev_list): Force eager loading of
lazy bytecode.
* src/bytecode.c (exec_byte_code): Remove lazy bytecode checks.
* src/eval.c (fetch_and_exec_byte_code, Ffetch_bytecode): Remove.
(funcall_lambda): Call exec_byte_code directly, avoiding checks.
* lisp/subr.el (fetch-bytecode): New definition, obsolete no-op.
* lisp/emacs-lisp/disass.el (disassemble-1):
* lisp/emacs-lisp/bytecomp.el (byte-compile-unfold-bcf):
Remove calls to fetch-bytecode.
(byte-compile-dynamic): Update doc string.
(byte-compile-close-variables, byte-compile-from-buffer)
(byte-compile-insert-header, byte-compile-output-file-form)
(byte-compile--output-docform-recurse, byte-compile-output-docform)
(byte-compile-file-form-defmumble):
Remove effects of byte-compile-dynamic.
* doc/lispref/compile.texi (Dynamic Loading): Remove node now that
the entire `byte-compile-dynamic` facility has been rendered inert.
* etc/NEWS: Announce changes.
* src/bytecode.c (exec_byte_code):
Only use fast-path optimisations for calls and dynamic variable
reference and setting where the symbol is plain, which is much faster.
* doc/emacs/basic.texi (Continuation Lines):

* etc/NEWS:

* lisp/visual-wrap.el (visual-wrap-prefix-mode): Document this
new global minor mode.
(global-visual-wrap-prefix-mode): New global minor mode.
* src/dispextern.h (struct it) <wrap_prefix_width>: New field,
synchronized with current_x when producing glyphs for wrap
prefixes, and subtracted from it->current_x when computing tab
widths.

* src/term.c (produce_glyphs): Set wrap_prefix_width.

* src/xdisp.c (start_display, display_min_width, move_it_to)
(move_it_vertically_backward, move_it_by_lines)
(window_text_pixel_size, display_tab_bar_line)
(display_tool_bar_line, redisplay_internal, redisplay_window)
(try_window_id, insert_left_trunc_glyphs)
(extend_face_to_end_of_line, display_line)
(Fmove_point_visually): Set or clear wrap_prefix_width as
appropriate.
(gui_produce_glyphs): Set or clear it->wrap_prefix_width.  When
computing the base position of a tab character, do not subtract
the continuation line width if a line prefix is the current
iterator method.  Subtract the wrap_prefix_width otherwise, in
order that the width of the tab is computed free of influence
from the wrap prefix.
* lisp/net/shr.el (shr-correct-attribute-case): New constant.
(shr-correct-dom-case): New function to correct SVG attribute case.
(shr-tag-svg): Correct SVG attribute cases before using them.
* src/macfont.m (mac_font_get_glyphs_for_variants)
(macfont_variation_glyphs): Fix width values.  (Bug#64013)
* lisp/textmodes/yaml-ts-mode.el (yaml-ts-mode--fill-paragraph):
Avoid 'fill-paragraph' when outside of block_scalar or comment
nodes.  (Bug#68781)
* lisp/woman.el (woman-if-body): Avoid signaling an error
if "el }" is not found.  (Bug#68852)
Bring together all the conditions for well-formedness of the resulting
bytecode object.
…rty.

Add `read-only' to the list of text properties removed from history items
(bug#68847).
Monitors are wider now than when these defaults were first set, and it
is useful to take better advantage of that, to fit text on fewer lines.
Yet, it has repeatedly been shown that overly long lines reduce
readability:
   "A reasonable guideline would be 55 to 75 characters per line."[1]

We also don't want to disfavor narrow displays, like mobile phones; a
more promising direction here might be to automatically word wrap
docstrings and make their maximum width customizable.  That might
require a new docstring format, however.

Bumping it by 7 characters, from 65 to 72, seems a reasonable compromise
for now.  Consideration was given to increasing it to 70 or 75, but 72
happens to be a commonly recommended maximum line width elsewhere (see
Fortran 66, Python docstrings, commit message recommendations, etc.),
and we might as well do the same.

This change was discussed in:
https://lists.gnu.org/r/emacs-devel/2022-07/msg00217.html

[1] "Optimal Line Length in Reading — A Literature Review", Nanavati and
    Bias, Visible Language, Vol. 39 No. 2 (2005).
    https://journals.uc.edu/index.php/vl/article/view/5765

* lisp/emacs-lisp/lisp-mode.el (emacs-lisp-docstring-fill-column):
* .dir-locals.el (fill-column, emacs-lisp-docstring-fill-column):
Bump default to 72.
* lisp/sort.el (sort-on): New function.  Patch by John Wiegley
<[email protected]>.

* etc/NEWS:
* doc/lispref/sequences.texi (Sequence Functions): Document
'sort-on'.
* doc/lispref/sequences.texi (Sequence Functions): Improve
indexing of last change
previously, state->done would randomly evaluate to
true, causing freshly spawned language servers to
exit immediately
random values of state->error_buffer_read might otherwise
cause memory corruption as we write beyond the stderr receive
buffer, or (if state->error_buffer_read > ERROR_BUFFER_SIZE),
the size argument to recv might overflow to very large unsigned
values, causing the recv call to fail (and hence causing spsupr
to reattempt reading from the stderr fd indefinitely)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.