Commit graph

156877 commits

Author SHA1 Message Date
Lars Ingebrigtsen
7b646e972c Regenerated ldefs-boot.el 2022-05-30 21:40:37 +02:00
Eli Zaretskii
c9e5e79ac2 Fix 'debug-timer-check' on MS-Windows
* src/w32proc.c (w32_raise): New function.
* src/atimer.c (raise) [WINDOWSNT]: Redirect to 'w32_raise'.
2022-05-30 20:51:19 +03:00
Juri Linkov
4132223d89 * lisp/progmodes/project.el: Improve file-reading history and default values.
(project-find-file): Use relative file name of the
currently visited file as an alternative default value.
(project-find-file-in, project-find-dir): Use 'file-name-history' (bug#55267).
2022-05-30 19:30:54 +03:00
Mattias Engdegård
b903507b36 Nonrecursive Lisp reader (bug#55676)
Restructure the reader to be nonrecursive so that it is not limited by
the C stack or crashes Emacs when reading deeply nested data.
This also improves performance.
A few minor bugs were fixed:

- (a .{NBSP}b) where {NBSP} is a non-breaking space (U+00A0) is now
  the dotted pair (a . b), not the 3-element list (a \. b), since U+00A0
  is treated as whitespace everywhere else.
- #_ with no symbol following is now equivalent to ## (empty interned
  symbol), not #: (empty uninterned symbol).

* src/alloc.c (garbage_collect): Call mark_lread.
* src/lread.c (readevalloop): Use read0 instead of read_list.
(stackbufsize): Increase to 1024, now that read0 isn't recursive.
(invalid_radix_integer): Buffer overflow check.
(read1, read_list, read_vector): Remove.
(read_char_literal, read_string_literal)
(hash_table_from_plist, record_from_list, vector_from_rev_list)
(bytecode_from_rev_list, char_table_from_rev_list)
(sub_char_table_from_rev_list, string_props_from_rev_list)
(read_bool_vector, skip_lazy_string, symbol_char_span)
(skip_space_and_comments)
(enum read_entry_type, struct read_stack_entry, struct read_stack)
(rdstack, mark_lread, read_stack_top, read_stack_pop)
(read_stack_empty_p, grow_read_stack, read_stack_push): New.
(read0): Rewrite to be nonrecursive.
* test/src/lread-tests.el (lread-deeply-nested, lread-misc): New tests.
2022-05-30 15:56:59 +02:00
Mattias Engdegård
169797a300 Fix atimer setting and overdue expiration (bug#55628)
* src/atimer.c (set_alarm): If the atimer has already expired, signal
it right away instead of postponing it further.  Previously this could
occur repeatedly, blocking atimers indefinitely.
Also only use `alarm` as fallback if `setitimer` is unavailable, not
both at the same time (which makes no sense, and they both typically
use the same mechanism behind the curtains).

* test/src/eval-tests.el (eval-tests/funcall-with-delayed-message):
New test, verifying proper functioning of funcall-with-delayed-message
which also serves as test for this bug (which also caused
debug-timer-check to fail, but that test is only run when Emacs is
built with enable-checking).
2022-05-30 15:52:02 +02:00
Eli Zaretskii
78e8893f5d Add more subscript and superscript characters to "C-x 8"
* lisp/international/iso-transl.el (iso-transl-char-map): Add more
numerical superscript and subscript characters.  (Bug#55722)
2022-05-30 15:58:38 +03:00
समीर सिंह Sameer Singh
004e6ae3f4 Add support for the Rejang script (bug#55718)
* lisp/language/indonesian.el ("Rejang"): New language environment.
Add composition rules for Rejang.  Add sample text and input
method.
* lisp/international/fontset.el (script-representative-chars)
(setup-default-fontset): Support Rejang.
* lisp/leim/quail/indonesian.el ("rejang"): New input method.

* etc/HELLO: Add a Rejang greeting.
* etc/NEWS: Announce the new language environment.
2022-05-30 15:43:35 +03:00
Po Lu
774880c84c Get rid of `defvar-keymap' in flymake.el
* lisp/progmodes/flymake.el (flymake-mode-map)
(flymake-diagnostics-buffer-mode-map): Stop using
`defvar-keymap', since Flymake only requires Emacs 26.1.
2022-05-30 18:09:41 +08:00
Po Lu
f81065a91b Fix `dnd-indicate-insertion-point' on Mac OS
* lisp/term/ns-win.el (ns-handle-drag-motion): Remove debugging
code.

* src/nsterm.m ([EmacsView draggingUpdated:]): Redisplay here
instead.
2022-05-30 16:03:11 +08:00
Po Lu
3eca30bc50 Update frame positions on Haiku after changing Z group
* src/haiku_support.cc (EmacsScreenChangeMonitor): Fix comment.
* src/haikufns.c (haiku_set_z_group): Ask for a position update,
since changing the Z group might change the feel of the window.
2022-05-30 07:55:13 +00:00
Po Lu
d8adce56a0 Fix cursor flushing inside minibuffers on NS
* src/nsterm.m (EV_TRAILER): Fix coding style.
(ns_flush_display): New function.
(ns_redisplay_interface): Register `flush_display'.
2022-05-30 15:06:55 +08:00
Po Lu
fd510f1239 Fix hangs when x-get-selection is called inside a popup menu
* src/xselect.c (wait_for_property_change):
(x_get_foreign_selection): Use `x_wait_for_cell_change' if input
is blocked.  (bug#22214)
* src/xterm.c (x_wait_for_cell_change): New function.
* src/xterm.h: Update prototypes.
2022-05-30 14:05:30 +08:00
Stefan Kangas
52d41f2750 Merge from origin/emacs-28
1b7b69e764 Some Tramp cleanup on MS Windows
2022-05-30 06:30:24 +02:00
Po Lu
48ef8ab15f Try to implement `dnd-indicate-insertion-point' on macOS
* lisp/term/ns-win.el (ns-handle-drag-motion): New function.
* src/nsterm.m ([EmacsView draggingUpdated:]): Call that
function instead.
(syms_of_nsterm): Clean up old style defvars and add new
defvar for the DND drag function.
2022-05-30 10:36:43 +08:00
Po Lu
5b770b60f4 Further clean up DND target handling
* src/xfns.c (Fx_begin_drag): Alloca target list.

* src/xterm.c (x_set_dnd_targets): Copy the given targets list.
(x_dnd_begin_drag_and_drop): Record freeing the targets list on
the specpdl.
(handle_one_xevent, x_dnd_cleanup_drag_and_drop)
(x_connection_closed, x_delete_terminal): Stop calling
`x_set_dnd_targets' manually to free the targets list.
2022-05-30 09:25:03 +08:00
Po Lu
e2e232933c Fix crash when loading Postscript images
* src/xterm.c (handle_one_xevent): Catch errors around
`x_kill_gs_process'.
2022-05-30 09:07:27 +08:00
Po Lu
b6a4766388 Use XDrawPoint to clear relief rect corners
* xterm.c (x_clear_point): New function.
(x_draw_relief_rect): Use that instead.
2022-05-30 08:49:24 +08:00
Paul Eggert
7f7acf3956 Document decoded-time-string issue on 6-elt args
* lisp/simple.el: Document problematic use of decoded-time-dst on
6-element args.
2022-05-29 15:01:55 -07:00
Paul Eggert
b40009e2f9 ISO 8601 strings sans "Z" don’t specify DST flag
* lisp/calendar/iso8601.el (iso8601--zone-dst): New function.
(iso8601-parse, iso8601-parse-time): Use it.
(iso8601--decoded-time): Default dst to -1, not nil.
* test/lisp/calendar/iso8601-tests.el (test-iso8601-combined)
(standard-test-time-of-day-zone): Adjust to new behavior.
2022-05-29 15:01:55 -07:00
Paul Eggert
4b44eaa1f9 Doc fix for dst flag
* doc/lispref/os.texi (Time Conversion): Note Common Lisp dst differs.
2022-05-29 15:01:55 -07:00
Stefan Monnier
aa955dc569 * lisp/shell.el (shell): Fix last change
Wrap the file-name prompt within `with-connection-local-variables` as
it was before the previous change.
While at it, make sure we set the `default-directory` of
the actual shell buffer after querying the user.
2022-05-29 13:37:44 -04:00
Eli Zaretskii
e1eab9b496 ; Fix Batak greeting
* etc/HELLO:
* lisp/language/indonesian.el ("Batak"): Fix greeting.
2022-05-29 20:12:56 +03:00
Eli Zaretskii
f02a8374d5 ; Fix last change (bug#55694)
* etc/HELLO ("Batak"): Add one more greeting.

* lisp/language/indonesian.el ("Batak"): Fix doc string and add
one more greeting.
2022-05-29 19:35:15 +03:00
समीर सिंह Sameer Singh
230ed406aa Add support for the Batak script (bug #55694)
* lisp/language/indonesian.el ("Batak"): New language environment.
Add composition rules for Batak.  Add sample text and input
method.
* lisp/international/fontset.el (script-representative-chars)
(setup-default-fontset): Support Batak.
* lisp/leim/quail/indonesian.el ("batak"): New input method.
Rename TITLE of balinese, javanese and sundanese in
("quail-define-package").

* etc/HELLO: Add a Batak greeting.
* etc/NEWS: Announce the new language environment and its
input method.
2022-05-29 19:27:35 +03:00
Lars Ingebrigtsen
e06d600b49 Fix hfy-etags-cmd type
* lisp/htmlfontify.el (hfy-etags-cmd): Fix the type -- this
variable usually ends up being nil.
2022-05-29 16:40:53 +02:00
Daniel Martín
f7324b7a64 Fix reference to help-enable-variable-value-editing
* lisp/help-mode.el (help-mode): Fix docstring to reference the
correct variable name.
* lisp/ldefs-boot.el (help-mode): Ditto (bug#55705).
2022-05-29 16:31:38 +02:00
Po Lu
fe8a127de2 * etc/tutorial/TUTORIAL.cn (INSTALLING PACKAGES): Translate from English. 2022-05-29 20:14:21 +08:00
Michael Albinus
1b7b69e764 Some Tramp cleanup on MS Windows
* lisp/net/tramp.el (tramp-restricted-shell-hosts-alist): Do not add
localhost when `tramp-encoding-shell' is a POSIX shell.

* test/lisp/net/tramp-tests.el (tramp-test31-interrupt-process):
Skip on MS Windows.
2022-05-29 13:31:32 +02:00
Mattias Engdegård
f0bf7f03f8 ; * lisp/leim/quail/indonesian.el: Remove ineffective backslashes. 2022-05-29 10:54:25 +02:00
Mattias Engdegård
c9aff6fe5a Traverse record literals in byte-compile--first-symbol-with-pos
* lisp/emacs-lisp/bytecomp.el (byte-compile--first-symbol-with-pos):
Traverse record literals as well as vectors.  Either is rather
pointless but there were some strong feelings about it.
2022-05-29 10:52:09 +02:00
Po Lu
96d056b3aa * admin/alloc-colors.c: Fix missing declaration. 2022-05-29 16:35:55 +08:00
Eli Zaretskii
232a6ee9c6 ; * etc/NEWS: Fix last change. 2022-05-29 11:00:36 +03:00
Manuel Giraud
460d5fd971 Make `count-words' count sentences.
* lisp/textmodes/paragraphs.el (count-sentences): New function.
* lisp/simple.el (count-words--format): Update format for showing
sentences.
(count-words): Also count sentences.

* lisp/simple.el (count-words):
* etc/NEWS:
* doc/emacs/basic.texi (Position Info): Update documentation for
sentence counting.
2022-05-29 10:58:13 +03:00
Po Lu
6f8e856ada Keep display mm width and height up to date after changes
* src/xfns.c (Fx_display_mm_width, Fx_display_mm_height): Use
new fields if they are set.
* src/xterm.c (handle_one_xevent): Set new fields on RRNotify if
the screen is correct.
* src/xterm.h (struct x_display_info): New fields
`screen_mm_width', `screen_mm_height'.
2022-05-29 15:49:48 +08:00
Po Lu
22a3e92dc6 Make DND target list lifecycle a little clearer
* src/xfns.c (Fx_begin_drag): Pass target atoms and ntargets to
x_dnd_begin_drag_and_drop instead.
* src/xterm.c (x_set_dnd_targets): Make static.
(x_clear_dnd_targets): Delete function.
(x_dnd_begin_drag_and_drop): Adjust to set targets here instead.
* src/xterm.h: Update prototypes.
2022-05-29 12:56:37 +08:00
Stefan Kangas
6303cb7e9f Merge from origin/emacs-28
f9ee83bfb9 do_switch_frame: before leaving mini-window, check other (...
908e2e09d0 Fix commands used to produce on-line HTML docs
fff770fb97 Fix a bad cross-reference in elisp.pdf
ebea3415b0 Fix documentation of 'string-pad'
2022-05-29 06:30:21 +02:00
Po Lu
c92d73d271 Fix pending window changes in haiku_set_window_size
* src/haikuterm.c (haiku_set_window_size): Wait for
FRAME_RESIZED events, then call `do_pending_window_change'.
(haiku_read_socket): Allow waiting for FRAME_RESIZED events.
2022-05-29 01:05:54 +00:00
Po Lu
28d4952d42 Improve error trapping on X
* xterm.c (x_uncatch_errors, x_had_errors_p): Don't sync if no
request was made since the error trap was installed.
2022-05-29 08:51:17 +08:00
kobarity
1e66c8af40 Fix Python Hideshow problem with backslash escaped newlines
* lisp/progmodes/python.el (python-rx)
(python-nav-beginning-of-defun-regexp): Allow
python-nav-*-defun to handle backslash escaped newlines
(bug#55690).
2022-05-28 18:51:01 +02:00
Visuwesh
5d8b6ba89e pp--insert-lisp: Don't bug out on certain forms at beginning of buffer
* pp.el (pp--insert): Check if point is in beginning of buffer before
calling `looking-back' (bug#55677).
2022-05-28 18:39:43 +02:00
Stefan Monnier
2301f13a67 with-connection-local-variables: Avoid code duplication
Move the bulk of the code of `with-connection-local-variables` into
a separate function, which both avoids duplicating that code but also
avoids duplicating the code passed as the body of
a `with-connection-local-variables`.  Also makes it easier to
debug the code, or change the implementation of
`with-connection-local-variables` without having to recompile all
the users.

* lisp/files-x.el (with-connection-local-variables-1): New function,
extracted from `with-connection-local-variables`.
(with-connection-local-variables): Use it.
2022-05-28 12:02:15 -04:00
Alan Mackenzie
f9ee83bfb9 do_switch_frame: before leaving mini-window, check other (mru) window is live
This fixes bug#55684.  There, with a minibuffer-only frame at start up,
Emacs tried to switch to this frame, whose selected window was the
mini-window.  There is no other active window in this frame, so the
attempt to swith to another window failed.

* src/frame.c (do_switch_frame): On switching to a frame whose selected
window is as above, before selecting the most recently used window, check
this ostensible window is an actual live window.  Otherwise leave the
mini-window selected.
2022-05-28 12:55:32 +00:00
Eli Zaretskii
908e2e09d0 Fix commands used to produce on-line HTML docs
* admin/admin.el (manual-meta-string): Only include the first
line, and move the rest...
(manual-links-string): ...to this new string.
(manual-html-fix-headers): Don't remove the '<meta name=' elements
produced by makeinfo, especially not the 'name="viewport"' one,
which is essential for viewing the docs on mobile devices.
Reported by "Facundo Lander via RT" <webmasters-comment@gnu.org>,
see gnu.org ticket #1840138.
2022-05-28 14:57:55 +03:00
Valenoern
f65536015b Support html template tag in shr
* lisp/net/shr.el: Add shr-tag-template as a dummy tag.
Copyright-paperwork-exempt: yes
2022-05-28 12:43:20 +02:00
Lars Ingebrigtsen
9707613ddb Fix native-comp of trampolines after previous change
* lisp/emacs-lisp/comp.el (comp--native-compile): Don't delete the
explicitly specified output file, just temp files.
2022-05-28 12:32:01 +02:00
Eli Zaretskii
b8a204e81e ; * lisp/leim/quail/indonesian.el ("sundanese"): Fix whitespace. 2022-05-28 13:16:04 +03:00
समीर सिंह Sameer Singh
fb6484e3d0 Add support for the Sundanese script (bug#55686)
* lisp/language/indonesian.el ("Sundanese"): New language environment.
Add composition rules for Sundanese.  Add sample text and input
method.
Improve composition rules for Balinese and Javanese.
* lisp/international/fontset.el (script-representative-chars)
(setup-default-fontset): Support Sundanese.
* lisp/leim/quail/indonesian.el ("sundanese"): New input method.

* etc/HELLO: Add a Sundanese greeting.
* etc/NEWS: Announce the new language environment and its
input method.
2022-05-28 13:12:12 +03:00
Eli Zaretskii
fff770fb97 Fix a bad cross-reference in elisp.pdf
* doc/lispref/control.texi (pcase Macro): Fix a conditional
cross-reference (bug#55689).
2022-05-28 11:51:15 +03:00
Po Lu
6f1d5e59f3 Fix dired drag-and-drop for certain Motif programs
* lisp/dired.el (dired-mouse-drag): Announce _DT_NETFILE in
targets list as well.
* lisp/select.el (xselect--encode-string): New arg
`prefer-string-to-c-string'.
(xselect-convert-to-filename): Convert to TEXT instead of
C_STRING, but use STRING if the type would otherwise be
C_STRING.
(xselect-dt-netfile-available-p, xselect-tt-net-file)
(xselect-convert-to-dt-netfile): New functions.
(selection-converter-alist): New selection converter.
2022-05-28 16:49:56 +08:00
Eli Zaretskii
ebea3415b0 Fix documentation of 'string-pad'
* doc/lispref/strings.texi (Creating Strings): Fix description of
'string-pad'.  (Bug#55688)
2022-05-28 10:55:01 +03:00