* lisp/help-fns.el (help-enable-variable-value-editing): New user
option.
(describe-variable): Tag values for editing.
(help-fns--editable-variable, help-fns-edit-variable): New
functions (bug#36826).
(help-fns--edit-value-mode-map, help-fns--edit-value-mode)
(help-fns-edit-mode-done): New mode and commands.
Make :filters run in the correct buffer in describe-buffer-bindings
* lisp/help.el (describe-map-tree): Take an optional buffer parameter.
(describe-map): Ditto, and use it to run `lookup-key' in the
correct buffer. This fixes problems of filters being run in the
wrong buffer (bug#39149).
* src/keymap.c (Fdescribe_buffer_bindings): Pass in BUFFER to
describe-map-tree.
Eli Zaretskii [Sun, 17 Apr 2022 14:20:03 +0000 (17:20 +0300)]
Fix 'restart-emacs' on MS-Windows
* src/w32.c (w32_reexec_emacs): New function, emulation of
'execvp' on Posix systems.
* src/w32.h (w32_reexec_emacs): Add prototype.
* src/emacs.c (main) [WINDOWSNT]: Save the original command line
and working directory.
(Fkill_emacs) [WINDOWSNT]: Call 'w32_reexec_emacs' instead of
'execvp'. (Bug#17036)
* rcirc.el (rcirc-reconnect-delay): Declare variable before it is
defined.
(rcirc-keepalive): Handle rcirc-closed-connection, respecting
rcirc-reconnect-delay.
(rcirc-closed-connection): Add new error type.
(rcirc-send-string): Throw rcirc-closed-connection instead of a
generic error.
Further improve buffer-match-p related documentation
* doc/lispref/buffers.texi (Buffer List): Add entries for
* buffer-match-p and match-buffers
* etc/NEWS: Give examples for buffer-match-p conditions
* lisp/window.el (display-buffer-assq-regexp): Mention what happens
when no entry in the alist satisfies a condition.
chunk-data = 1*OCTET ; a sequence of chunk-size octets
`url-http-chunked-encoding-after-change-function' is able to process
(and remove) that terminator IF AVAILABLE in the buffer when
processing the response, however it won't wait for it if it's not yet
there.
In other words:
| Bottom of the response buffer | Bottom of the full response |
| (visible to url-http) | (to be delivered to Emacs) |
| ------------------------------+-----------------------------|
| 0\r\n | 0\r\n |
| | \r\n |
If the last chunk is processed when the bottom of the response buffer
is as above (note that the whole response has not yet been delivered
to Emacs), url-http will call the user callback without waiting for
the final terminator to be read from the socket.
This is normally not an issue when doing one-shot requests, but it's
problematic when the connection is reused immediately. As there are 2
bytes from the request N that have not been dealt with, they'll be
considered as part of the response of the request N+1. On top, it
turns out that when processing the headers of request N+1,
`url-http-wait-for-headers-change-function' will consider the request
a "headerless malformed response" delivering it broken to the caller.
The proposed fix implements a state in which
`url-http-chunked-encoding-after-change-function` properly waits for
the very last element of the message preventing the problem explained
above from happening.
For additional context, this bug was found when debugging
magit/ghub (see [1] for details).
Po Lu [Sun, 17 Apr 2022 08:10:01 +0000 (08:10 +0000)]
Fix race conditions waiting for menu bar resize events on Haiku
* src/haikufns.c (haiku_create_frame, haiku_create_tip_frame)
(haiku_set_menu_bar_lines): Clear `wait_for_event_type'.
* src/haikumenu.c (set_frame_menubar): Wait for menu bar resize
event.
* src/haikuterm.c (haiku_wait_for_event): New function.
(haiku_read_socket): Handle waiting for MENU_BAR_RESIZE.
* src/haikuterm.h (struct haiku_output): New field
`wait_for_event_type'.
Po Lu [Sun, 17 Apr 2022 07:15:17 +0000 (07:15 +0000)]
Fix hangs when clicking on Haiku menu bar to activate frame
* src/haiku_io.c (haiku_len): Handle new event `MENU_BAR_CLICK'.
* src/haiku_support.cc (class EmacsWindow): Remove most of the
menu bar cv stuff.
(MessageReceived): Handle REPLAY_MENU_BAR message.
(EmacsWindow_signal_menu_update_complete): Delete function.
(be_replay_menu_bar_event): New function.
* src/haiku_support.h (enum haiku_event_type): New event type
`MENU_BAR_CLICK'.
(struct haiku_menu_bar_click_event): New struct.
* src/haikumenu.c (haiku_activate_menubar): New function.
* src/haikuterm.c (haiku_read_socket): Save a
MENU_BAR_ACTIVATE_EVENT and the menu bar click event instead of
handling the menu bar update synchronously.
(haiku_create_terminal): Set `activate_menubar_hook'.
(syms_of_haikuterm): Remove extraneous newline.
* src/haikuterm.h (struct haiku_output): New field
`saved_menu_event'.
Paul Eggert [Sun, 17 Apr 2022 08:06:46 +0000 (01:06 -0700)]
Fix GC bug in filelock.c
Fix a bug where if GC occurred at the wrong moment when locking a
file, the lock file’s name was trashed so file locking did not work.
This bug was introduced in Emacs 28.1. The bug sometimes caused
filelock-tests-detect-external-change test failures on Fedora 35
x86-64 in an en_US.utf8 locale.
* src/filelock.c (lock_file_1, current_lock_owner, lock_if_free)
(lock_file, unlock_file, Ffile_locked_p):
Use Lisp_Object, not char *, for string, so that GC doesn’t trash
string contents.
(make_lock_file_name): Return the encoded name, not the original.
All callers changed.
Jim Porter [Sat, 19 Mar 2022 19:41:13 +0000 (12:41 -0700)]
Add unit tests and documentation for Eshell predicates/modifiers
* lisp/eshell/esh-cmd.el (eshell-eval-argument): New function.
* lisp/eshell/esh-util.el (eshell-file-attributes): Pass original
value of FILE to 'file-attributes'.
* lisp/eshell/em-pred.el (eshell-predicate-alist): Change socket char
to '=', since 's' conflicts with setuid.
(eshell-modifier-alist): Fix 'E' (eval) modifier by using
'eshell-eval-argument'. Also improve performance of 'O' (reversed
sort) modifier.
(eshell-modifier-help-string): Fix documentation of global
substitution modifier.
(eshell-pred-substitute): Fix infinite loop in some global
substitutions.
(eshell-join-members): Fix joining with implicit " " delimiter.
(Bug#54470)
* test/lisp/eshell/em-pred-tests.el: New file.
* doc/misc/eshell.texi (Argument Predication): New section.
Jim Porter [Wed, 9 Mar 2022 01:07:26 +0000 (17:07 -0800)]
Add unit tests and documentation for Eshell pattern-based globs
* lisp/eshell/em-glob.el (eshell-extended-glob): Fix docstring.
(eshell-glob-entries): Refer to '**/' in error (technically, '**' can
end a glob, but it means the same thing as '*'). (Bug#54470)
Paul Eggert [Sun, 17 Apr 2022 01:48:51 +0000 (18:48 -0700)]
Document encode-time caveats
* doc/lispref/os.texi (Time of Day, Time Conversion):
Move the warnings about DST being -1 to closer to where DST is
discussed, and reword and improve the discussions and warnings.
Be more precise about years before 1969 (possible west of UTC) vs the
Epoch. Mention some problems due to leap seconds, leap years,
daylight saving transitions, and time zone changes. Modernize
discussion of OS timestamp range. Prefer secular ‘BCE’ to religious
‘BC’. Omit discussion of decoded-time-add and make-decoded-time, as
they are in a library and are not always available; instead, mention
the library. Warn about common mistakes when doing simple date
arithmetic.
* src/timefns.c (Fencode_time): In doc string, mention date
arithmetic and tighten up the wording a bit.
Max Nikulin [Sun, 17 Apr 2022 01:48:51 +0000 (18:48 -0700)]
Stress difference of new and old ways to call `encode-time'
* doc/lispref/os.texi (Time Conversion): Add a warning that blind
changing of code calling `encode-time' to use single list instead of
multiple values may cause deferred bugs since it is common to use nil
for ignored arguments such as DST in the old calling convention.
* src/timefns.c (encode-time): Mention the warning added to the elisp
reference in the docstring.
Refactoring related to `encode-time' caused (bug#54731), so it is better
to make apparent the difference between the recommended and the
obsolescent ways to call the function. More details concerning the
purpose and limitations of the DST field are added after discussion with
Paul Eggert in (bug#54764).
Earl Hyatt [Tue, 7 Dec 2021 02:04:27 +0000 (21:04 -0500)]
Add basic Texinfo support for Flymake.
* lisp/textmodes/texinfo.el (texinfo-flymake, texinfo--flymake-proc)
(texinfo-mode):
Add the functions texinfo-flymake and process variable
texinfo--flymake-proc. Modify texinfo-mode to automatically add this
function to the hook flymake-diagnostic-functions.
Eli Zaretskii [Sat, 16 Apr 2022 17:58:31 +0000 (13:58 -0400)]
Merge from origin/emacs-28
d53c999b4a Further vcs-cvs/rcs-responsible-p updates from master dc3d1628ec ; * src/sysdep.c: Fix mistake in previous commit 855e15dbf1 Fix builds on older versions of macOS 9da744e450 Fix documentation of Outline minor mode options a8bb12ab05 Improve discoverability of 'insert-directory-program' 3f166bdf44 ; * etc/PROBLEMS: Describe MS-Windows issues with fonts. ... 803ac857ee Fix cursor motion under truncate-lines with Flymake fringe...
Eli Zaretskii [Sat, 16 Apr 2022 17:46:04 +0000 (13:46 -0400)]
Merge from origin/emacs-28
b201823f63 Describe problems with invoking Python on MS-Windows 880f2734c9 A better fix for bug#54800 5ee959aa87 Add a comment about cl-concatenate ab2b822b9b Revert "Make cl-concatenate an alias of seq-concatenate"
Eli Zaretskii [Sat, 16 Apr 2022 17:45:50 +0000 (13:45 -0400)]
Merge from origin/emacs-28
5e47d6284b * lisp/gnus/mm-encode.el (mm-default-file-encoding): Fix "... e71c7a7c60 Fix default-directory of buffers visiting files in renamed... cccaa9c31d Fix a kill-append regression 33828e4818 * doc/misc/eww.texi (Advanced): Correct outdated info (bug... e8d2f40f41 Clean up the MSDOS port 338eda09d8 Fix typo in next-error-find-buffer-function
Eli Zaretskii [Sat, 16 Apr 2022 17:43:33 +0000 (13:43 -0400)]
Merge from origin/emacs-28
84a2857722 Fix scrolling of the stack window in Calc 9dd44505b1 ; * src/window.c (Fset_window_start): Clarify the effect o... 24a6c7c8c0 Update and fix instructions and scripts for updating the W... 886339747b Extend tramp-archive-test45-auto-load ff997ad786 Ensure local `default-directory' in Tramp when needed 4f27588a16 Clarify "idleness" in the ELisp manual
Eli Zaretskii [Sat, 16 Apr 2022 17:43:32 +0000 (13:43 -0400)]
; Merge from origin/emacs-28
The following commits were skipped:
71f51f1b9d Commit missing file from previous commit (Do not merge wit... 009e88e002 Merge with Tramp 2.5.2.3 (Do not merge with master) 4161a36849 cl-generic.el: Fix bug#46722
* lisp/help.el (view-emacs-news): Use emacs-news-view-mode.
* lisp/textmodes/emacs-news-mode.el (emacs-news-view-mode): Split
into own mode to avoid confusion.
This adds back macOS-specific code replaced earlier (bug#48548),
specifically to fix build errors on macOS 10.7.5. See discussion at
https://lists.gnu.org/archive/html/emacs-devel/2022-04/msg00779.html .
* src/sysdep.c (HAVE_RUSAGE_INFO_CURRENT, HAVE_PROC_PIDINFO): New.
(system_process_attributes): Use alternative code or exclude features
when building on older macOS versions.
Eli Zaretskii [Sat, 16 Apr 2022 10:18:47 +0000 (13:18 +0300)]
Improve support for the Brahmi script
* lisp/language/indian.el ("Brahmi"): New language environment.
Add composition rules for Brahmi.
* lisp/international/fontset.el (script-representative-chars)
(setup-default-fontset): Support Brahmi. (Bug#54914)
* etc/NEWS: Announce the new language environment.
This adds back macOS-specific code replaced earlier (bug#48548),
specifically to fix build errors on macOS 10.7.5. See discussion at
https://lists.gnu.org/archive/html/emacs-devel/2022-04/msg00779.html .
* src/sysdep.c (HAVE_RUSAGE_INFO_CURRENT, HAVE_PROC_PIDINFO): New.
(system_process_attributes): Use alternative code or exclude features
when building on older macOS versions.
* configure.ac (CHECK_LISP_OBJECT_TYPE): Disable
-Wimplicit-const-int-float-conversion and -Wint-in-bool-context, which
currently only have false positives.
Po Lu [Sat, 16 Apr 2022 08:48:02 +0000 (16:48 +0800)]
Protect windows from garbage collection when a ClientMessage is pending
* src/xterm.c (x_protect_window_for_callback)
(x_unprotect_window_for_callback): New functions.
(x_send_scroll_bar_event): Protect windows from garbage
collection before sending event containing pointer to window.
(handle_one_xevent): Unprotect after such a ClientMessage is
received and the window put in the keyboard buffer.
(x_term_init): Initialize protected windows list.
(x_delete_display): Free that list.
(mark_xterm): Mark the windows in that list.
* src/xterm.h (struct x_display_info): New fields for recording
a list of protected windows.