]> git.eshelyaron.com Git - emacs.git/log
emacs.git
2 years agoImplement `below' z-group on Haiku
Po Lu [Wed, 20 Apr 2022 11:47:10 +0000 (11:47 +0000)]
Implement `below' z-group on Haiku

* src/haiku_support.cc (BWindow_set_z_group): Handle
Z_GROUP_BELOW by setting the B_AVOID_FRONT flag.

2 years agoEnsure forward progress in bibtex-map-entries
Lars Ingebrigtsen [Wed, 20 Apr 2022 11:07:34 +0000 (13:07 +0200)]
Ensure forward progress in bibtex-map-entries

* lisp/textmodes/bibtex.el (bibtex-map-entries): Ensure forward
progress (bug#55036).

2 years agoFix the outline level in the Emacs NEWS modes
Lars Ingebrigtsen [Wed, 20 Apr 2022 10:48:55 +0000 (12:48 +0200)]
Fix the outline level in the Emacs NEWS modes

* lisp/textmodes/emacs-news-mode.el (emacs-news--mode-common): Fix
the outline level (bug#54993).

2 years ago; Fix repeated lambda argnames in files-tests.el.
Basil L. Contovounesios [Wed, 20 Apr 2022 10:20:57 +0000 (13:20 +0300)]
; Fix repeated lambda argnames in files-tests.el.

2 years agoFix build for --enable-checking=structs
Basil L. Contovounesios [Wed, 20 Apr 2022 09:52:22 +0000 (12:52 +0300)]
Fix build for --enable-checking=structs

* src/pdumper.c (dump_subr): Update Lisp_Subr hash after last change
of 2022-04-18 "Port struct Lisp_Subr to C99".

2 years agoReset Motif DND protocol numbers when writing targets table
Po Lu [Wed, 20 Apr 2022 08:06:06 +0000 (16:06 +0800)]
Reset Motif DND protocol numbers when writing targets table

* src/xterm.c (xm_setup_dnd_targets): Set header.protocol to 0
when writing table.

2 years agoImplement `above' z-group on Haiku
Po Lu [Wed, 20 Apr 2022 07:37:19 +0000 (07:37 +0000)]
Implement `above' z-group on Haiku

* src/haiku_support.cc (class EmacsWindow): New field `z_group'.
(RecomputeFeel): New function.
(ParentTo, BWindow_set_override_redirect): Use that instead
instead of manually juggling the window feel around.
(BWindow_set_z_group): New function.

* src/haiku_support.h (enum haiku_z_group): New enum.
* src/haikufns.c (haiku_set_parent_frame): Clean up coding
style.
(haiku_set_z_group): New function.
(haiku_create_frame): Always set z group after window creation,
like on X.
(haiku_frame_parm_handlers): Add `haiku_set_z_group'.

2 years ago; Merge from origin/emacs-28
Stefan Kangas [Wed, 20 Apr 2022 04:30:27 +0000 (06:30 +0200)]
; Merge from origin/emacs-28

The following commit was skipped:

1030cc1897 Fix regression with multiple mode: entries in the prop line

2 years agoFix enabling menu bar multiple times on Haiku
Po Lu [Wed, 20 Apr 2022 03:06:58 +0000 (03:06 +0000)]
Fix enabling menu bar multiple times on Haiku

* src/haiku_support.cc (FrameResized): Adjust width and height
appropriately when sending menu bar resize event.
* src/haikufns.c (haiku_set_menu_bar_lines): Don't always reset
FRAME_MENU_BAR_LINES and FRAME_MENU_BAR_HEIGHT.
* src/haikumenu.c (free_frame_menubar): Clear Haiku menu bar.
(set_frame_menubar): Fix coding style.
* src/haikuterm.c (haiku_read_socket): Don't adjust height here
anymore.

2 years agoUpdate from gnulib
Paul Eggert [Wed, 20 Apr 2022 02:16:29 +0000 (19:16 -0700)]
Update from gnulib

2 years agoPacify gcc -std=c99 with printf %p
Paul Eggert [Wed, 20 Apr 2022 02:02:05 +0000 (19:02 -0700)]
Pacify gcc -std=c99 with printf %p

* src/print.c (print_vectorlike): Assign pointer-to-function
to void * before printing it with %p, as the C standard
doesn’t bless printing function pointers with %p.

2 years agoPacify gcc -std=c99
Paul Eggert [Wed, 20 Apr 2022 02:00:22 +0000 (19:00 -0700)]
Pacify gcc -std=c99

* src/sysdep.c (system_process_attributes): Use %llu instead of
%Lu for sscanf, as %llu is standard and %Lu is not, and the latter
can provoke warnings if gcc is used pedantically.

2 years agoCheck for integer overflow when writing Motif targets tables
Po Lu [Wed, 20 Apr 2022 01:10:48 +0000 (09:10 +0800)]
Check for integer overflow when writing Motif targets tables

* src/xterm.c (xm_setup_dnd_targets): Check for integer overflow
when adding list to target table.

2 years agoFix previous description of fallback order
Lars Ingebrigtsen [Tue, 19 Apr 2022 16:36:04 +0000 (18:36 +0200)]
Fix previous description of fallback order

* doc/emacs/custom.texi (Specifying File Variables): Document
fallback mode order.

2 years agoDocument how to specify fallback modes
Lars Ingebrigtsen [Tue, 19 Apr 2022 16:21:21 +0000 (18:21 +0200)]
Document how to specify fallback modes

* doc/emacs/custom.texi (Specifying File Variables): Document
fallback mode order.

2 years agoFix regression with multiple mode: entries in the prop line
Lars Ingebrigtsen [Tue, 19 Apr 2022 16:08:20 +0000 (18:08 +0200)]
Fix regression with multiple mode: entries in the prop line

* lisp/files.el (hack-local-variables): Fix regression with multiple
mode: entries in the prop line.

Do not merge to master.

2 years agoFix regression with multiple mode: entries in the prop line
Lars Ingebrigtsen [Tue, 19 Apr 2022 16:06:31 +0000 (18:06 +0200)]
Fix regression with multiple mode: entries in the prop line

* lisp/files.el (hack-local-variables--find-variables): Use the
final mode: line (which is the same as having several mode: bits
in the header line.

2 years agoAllow several mode: elements in the local variable section
Lars Ingebrigtsen [Tue, 19 Apr 2022 14:22:37 +0000 (16:22 +0200)]
Allow several mode: elements in the local variable section

* etc/NEWS (mode): Fall back on outline-mode in older Emacsen.
* lisp/files.el (hack-local-variables--find-variables): Use the
final mode: line (which is the same as having several mode: bits
in the header line.

2 years agoFix GCC warnings when CHECK_LISP_OBJECT_TYPE
Stefan Monnier [Tue, 19 Apr 2022 12:25:19 +0000 (08:25 -0400)]
Fix GCC warnings when CHECK_LISP_OBJECT_TYPE

* src/lisp.h (lisp_h_Qni): New macro.
(DEFUN): Use it.
* src/alloc.c (syms_of_alloc): Use it.

* src/bytecode.c (Fbyte_code): Fix Lisp_Object/int mixup.

2 years agoRevert prompting changes in viper-cmd
Lars Ingebrigtsen [Tue, 19 Apr 2022 11:48:06 +0000 (13:48 +0200)]
Revert prompting changes in viper-cmd

* lisp/emulation/viper-cmd.el (viper-quote-region)
(viper-read-string-with-history, viper-query-replace): Revert
prompting changes done in 50512e3 -- the way viper prompts in
command mode is special (bug#55007).

2 years agoBe more resilient against invalid headers in mml-generate-mime
Lars Ingebrigtsen [Tue, 19 Apr 2022 11:42:17 +0000 (13:42 +0200)]
Be more resilient against invalid headers in mml-generate-mime

* lisp/gnus/mml.el (mml-generate-mime): Don't bug out when called
with invalid headers (bug#55014).

2 years agoFix handling of intspecs as string by rcirc-define-command
Philip Kaludercic [Tue, 19 Apr 2022 11:16:51 +0000 (13:16 +0200)]
Fix handling of intspecs as string by rcirc-define-command

* rcirc.el (rcirc-define-command): Check if an interactive
  specification is a string, in which case it was to be wrapped in a
  list so that the result of its interpretation is passed as the first
  argument of the command resulting from the macro expansion.

2 years agoFix `x-mouse-click-focus-ignore-position' for odd coincidences across displays
Po Lu [Tue, 19 Apr 2022 10:51:28 +0000 (18:51 +0800)]
Fix `x-mouse-click-focus-ignore-position' for odd coincidences across displays

* src/xterm.c (handle_one_xevent): Save the display alongside
the next mouse click timeout.
(x_delete_display): Clear that display here if applicable.
(x_initialize): Likewise.

2 years agoFix dimensions of console window of restarted Emacs on MS-Windows
Eli Zaretskii [Tue, 19 Apr 2022 09:50:01 +0000 (12:50 +0300)]
Fix dimensions of console window of restarted Emacs on MS-Windows

* src/w32.c (get_console_font_size): New function.
(w32_reexec_emacs): Call 'get_console_font_size' to set up the
dimensions of the restarted Emacs's console window to the same
values as that of the original Emacs.

2 years agoDeal with Motif drag window related races
Po Lu [Tue, 19 Apr 2022 07:47:34 +0000 (15:47 +0800)]
Deal with Motif drag window related races

* src/xterm.c (xm_drag_window_error_handler): New function.
(xm_get_drag_window): If a drag window was created and we have
the temp display grabbed, use that instead.

2 years ago; Merge from origin/emacs-28
Stefan Kangas [Tue, 19 Apr 2022 04:51:47 +0000 (06:51 +0200)]
; Merge from origin/emacs-28

The following commits were skipped:

1b77362771 Avoid hangs in python-mode with debug-on-error set
4684b8e62f Fix major-mode setting regression when there's a mode: cookie

2 years agoMinor cleanups to Haiku menu code
Po Lu [Tue, 19 Apr 2022 04:39:37 +0000 (04:39 +0000)]
Minor cleanups to Haiku menu code

* src/haiku_draw_support.cc (BView_SetHighColorForVisibleBell):
Delete function.
* src/haiku_font_support.cc (BFont_dat): Rename to
`BFont_metrics'.
* src/haiku_support.cc (DrawContent): Use correct UI color for
control text.
* src/haiku_support.h (HAIKU_MODIFIER_ALT): Turn into enum.
(enum haiku_modifier_specification): New enum.
* src/haikufont.c (haikufont_open, haikufont_close): Fix coding
style.

2 years agoFix last change for GTK 2
Po Lu [Tue, 19 Apr 2022 03:18:25 +0000 (11:18 +0800)]
Fix last change for GTK 2

* src/xfns.c (x_set_alpha_background):
* src/xterm.c (x_update_opaque_region): Move some ifdefs around.

2 years agoFix opaque region treatment on GTK 3
Po Lu [Tue, 19 Apr 2022 03:13:11 +0000 (11:13 +0800)]
Fix opaque region treatment on GTK 3

* src/xfns.c (x_set_alpha_background):
* src/xterm.c (x_update_opaque_region): Update opaque region for
tooltip frames the correct way on GTK.

2 years agoPort struct Lisp_Subr to C99
Paul Eggert [Tue, 19 Apr 2022 02:44:03 +0000 (19:44 -0700)]
Port struct Lisp_Subr to C99

* src/lisp.h (struct Lisp_Subr): Don’t use an anonymous union,
a feature missing from C99 and not supported by older OS X.
All uses changed.

2 years agoPort module_bignum_count_max to strict C
Paul Eggert [Tue, 19 Apr 2022 02:29:49 +0000 (04:29 +0200)]
Port module_bignum_count_max to strict C

* src/emacs-module.c (module_bignum_count_max): Make
this a macro, not an enum, since it might not fit into
int as C99 requires.

2 years agoTell those using exclusively X not to use the PGTK port
Sean Whitton [Tue, 19 Apr 2022 02:43:32 +0000 (19:43 -0700)]
Tell those using exclusively X not to use the PGTK port

* INSTALL (Alternative window systems): Tell those using exclusively X
not to use the PGTK port.

2 years agoFix display of glyphless characters on Haiku
Po Lu [Tue, 19 Apr 2022 01:15:33 +0000 (01:15 +0000)]
Fix display of glyphless characters on Haiku

* src/haikuterm.c (haiku_draw_glyph_string_foreground): Fix pen
size when drawing composite string w/o font.
(haiku_draw_glyphless_glyph_string_foreground): Correctly
display glyphless character rectangle.

2 years agoUse "@code{nil}" in documentation
Paul Eggert [Mon, 18 Apr 2022 20:08:26 +0000 (13:08 -0700)]
Use "@code{nil}" in documentation

2 years agoRemove obsolete footnote
Paul Eggert [Mon, 18 Apr 2022 19:57:40 +0000 (12:57 -0700)]
Remove obsolete footnote

Emacs no longer warns about timestamps like (1 . 1000).

2 years agoFix glyphless glyph display on NS (bug#54970)
Alan Third [Sun, 17 Apr 2022 20:15:05 +0000 (21:15 +0100)]
Fix glyphless glyph display on NS (bug#54970)

* src/nsterm.m (ns_draw_glyphless_glyph_string_foreground): New
function.
(ns_draw_glyph_string): Use the new function.
* src/nsfont.m (nsfont_draw): Fix the location the glyphs are drawn,
and also which glyphs are drawn.
(ns_glyph_metrics): Reverse ascent and descent.

2 years ago; * doc/emacs/mini.texi (Completion Commands): Remove duplicate @findex.
Juri Linkov [Mon, 18 Apr 2022 19:16:17 +0000 (22:16 +0300)]
; * doc/emacs/mini.texi (Completion Commands): Remove duplicate @findex.

2 years agoMinor improvements in 'restart-emacs' on MS-Windows
Eli Zaretskii [Mon, 18 Apr 2022 18:04:57 +0000 (21:04 +0300)]
Minor improvements in 'restart-emacs' on MS-Windows

* src/w32.c (w32_reexec_emacs): Explicitly request a new console
for the restarted Emacs -nw, and specify its dimensions.  Specify
NULL instead of security attributes, per examples on the Internet.
* src/w32console.c (initialize_w32_display): Check errors in call
to GetConsoleCursorInfo.

2 years agoByte compiler: correct output warning message positions
Alan Mackenzie [Mon, 18 Apr 2022 15:16:54 +0000 (15:16 +0000)]
Byte compiler: correct output warning message positions

Correct the algorithm for determining the warning position to get the first
symbol-with-position in byte-compile--form-stack.

* lisp/emacs-lisp/bytecomp.el (byte-compile--first-symbol-with-pos): Function
renamed and amended from byte-compile--first-symbol.
(byte-compile--warning-source-offset): Call the new function above rather than
the old one.

2 years agoMake isearch-lax-whitespace a user option
Lars Ingebrigtsen [Mon, 18 Apr 2022 11:36:05 +0000 (13:36 +0200)]
Make isearch-lax-whitespace a user option

* lisp/isearch.el (isearch-lax-whitespace): Make into a defcustom
(bug#20351).

2 years agoAvoid hangs in python-mode with debug-on-error set
Lars Ingebrigtsen [Mon, 18 Apr 2022 11:17:32 +0000 (13:17 +0200)]
Avoid hangs in python-mode with debug-on-error set

* lisp/progmodes/python.el (python-nav-end-of-statement): Avoid
using cl-assert here, because this is called from the font-lock
machinery, and if debug-on-error is set here, we'll hang Emacs
(bug#54996).

Do not merge to master.

2 years agoAvoid hangs in python-mode with debug-on-error set
Lars Ingebrigtsen [Mon, 18 Apr 2022 11:17:32 +0000 (13:17 +0200)]
Avoid hangs in python-mode with debug-on-error set

* lisp/progmodes/python.el (python-nav-end-of-statement): Avoid
using cl-assert here, because this is called from the font-lock
machinery, and if debug-on-error is set here, we'll hang Emacs
(bug#54996).

2 years agoMake it easier to use Emacs as a script interpreter
Lars Ingebrigtsen [Mon, 18 Apr 2022 10:58:54 +0000 (12:58 +0200)]
Make it easier to use Emacs as a script interpreter

* doc/emacs/cmdargs.texi (Initial Options): Document -x.
* lisp/startup.el (command-line-1): Add new -scripteval.
(command-line--eval-script): New function.

* src/emacs.c (main): Transform -x to -scripteval.
(standard_args): Add -x (bug#20682).

2 years agoAdd missing Motif atoms
Po Lu [Mon, 18 Apr 2022 10:38:35 +0000 (18:38 +0800)]
Add missing Motif atoms

* src/xselect.c (symbol_to_x_atom):
(x_atom_to_symbol):
(syms_of_xselect): Optimize for XmTRANSFER_SUCCESS and
XmTRANSFER_FAILURE as well.

2 years agoByte compiler: remove symbol positions from byte-switch tables
Alan Mackenzie [Mon, 18 Apr 2022 10:19:54 +0000 (10:19 +0000)]
Byte compiler: remove symbol positions from byte-switch tables

This fixes bug #54990.

* lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode): Remove positions from
symbols with positions in byte-switch tables, by temporarily removing the
entries from the table, and reinserting them amended.

2 years agoClean up view-emacs-news code
Lars Ingebrigtsen [Mon, 18 Apr 2022 09:53:59 +0000 (11:53 +0200)]
Clean up view-emacs-news code

* lisp/help.el (view-emacs-news): Remove workaround after fixing
mode: cookie error.

2 years agoUnify local variable initialisation in url-http
Nacho Barrientos [Mon, 18 Apr 2022 09:36:52 +0000 (11:36 +0200)]
Unify local variable initialisation in url-http

* lisp/url/url-http.el (url-http-chunked-last-crlf-missing): Treat
url-http-chunked-last-crlf-missing as any other buffer variable by
declaring and initialising it the same way as the other related
ones (bug#54989).

Copyright-paperwork-exempt: yes

2 years agoMake `restart-emacs' work when Emacs is started with --chdir
Lars Ingebrigtsen [Mon, 18 Apr 2022 09:31:28 +0000 (11:31 +0200)]
Make `restart-emacs' work when Emacs is started with --chdir

* src/emacs.c (find_emacs_executable): Rename from
load_pdump_find_executable and always define.
(load_pdump): Return the executable.
(main): Store the executable.
(Fkill_emacs): Use the stored executable so that --chdir works
with relative executable names, and so that we attempt to restart
the same executable and not some other Emacs from PATH.

2 years agoImprove `restart-emacs' error reporting
Lars Ingebrigtsen [Mon, 18 Apr 2022 09:02:55 +0000 (11:02 +0200)]
Improve `restart-emacs' error reporting

* src/emacs.c (Fkill_emacs): Do better error reporting on restarting.

2 years agoMake "restart" erroring slightly more reliable
Lars Ingebrigtsen [Mon, 18 Apr 2022 08:50:45 +0000 (10:50 +0200)]
Make "restart" erroring slightly more reliable

* src/emacs.c (Fkill_emacs): Use emacs_perror for the "restart"
errors -- we've already shut down Emacs at this point, so the
normal erroring machinery isn't reliable.

2 years agoFix major-mode setting regression when there's a mode: cookie
Lars Ingebrigtsen [Mon, 18 Apr 2022 08:37:14 +0000 (10:37 +0200)]
Fix major-mode setting regression when there's a mode: cookie

* lisp/files.el (hack-local-variables): Fix regression in setting
the major mode when there are mode: cookies in the file (bug#54993).

Do not merge to master.

2 years agoFix major-mode setting regression when there's a mode: cookie
Lars Ingebrigtsen [Mon, 18 Apr 2022 08:36:32 +0000 (10:36 +0200)]
Fix major-mode setting regression when there's a mode: cookie

* lisp/files.el (hack-local-variables): Fix regression in setting
the major mode when there are mode: cookies in the file (bug#54993).

2 years agoStop skipping ShapeNotify events during DND on GTK+
Po Lu [Mon, 18 Apr 2022 08:08:19 +0000 (16:08 +0800)]
Stop skipping ShapeNotify events during DND on GTK+

* src/xterm.c (handle_one_xevent): Don't skip ShapeNotify events
because we can't send these events back to GDK manually.

2 years agoClarify computation of header line vpos
Po Lu [Mon, 18 Apr 2022 07:55:40 +0000 (15:55 +0800)]
Clarify computation of header line vpos

* src/dispnew.c (update_text_area): Test vpos is more than 1
only if is both a tab and header line.  Reported by Eli
Zaretskii <eliz@gnu.org>.

2 years agoFix 'restart-emacs' in -nw mode on MS-Windows
Eli Zaretskii [Mon, 18 Apr 2022 07:05:15 +0000 (10:05 +0300)]
Fix 'restart-emacs' in -nw mode on MS-Windows

* src/w32.c (openat): #ifdef away: not used.
(w32_reexec_emacs): Kludgey solution for restarting Emacs in the
"-nw" mode.

2 years agoFix glyph skipping optimization when a tab line is enabled
Po Lu [Mon, 18 Apr 2022 05:23:23 +0000 (13:23 +0800)]
Fix glyph skipping optimization when a tab line is enabled

* src/dispnew.c (update_text_area): Compute vpos of header line
correctly when window has tab line.

2 years ago; Fix typo in last change
Po Lu [Mon, 18 Apr 2022 01:26:12 +0000 (09:26 +0800)]
; Fix typo in last change

* src/xterm.c (x_wm_set_size_hint): Fix typo.

2 years agoMinor cleanups to PGTK code
Po Lu [Mon, 18 Apr 2022 01:21:45 +0000 (09:21 +0800)]
Minor cleanups to PGTK code

* src/gtkutil.c (xg_set_geometry):
(xg_frame_set_char_size):
(x_wm_set_size_hint): Rename to `xg_wm_set_size_hint'.  All
callers changed.
* src/gtkutil.h: Update prototypes.
* src/pgtkfns.c (unwind_create_frame):
(Fx_create_frame):
(compute_tip_xy):
* src/pgtkterm.c (x_free_frame_resources):
(x_destroy_window):
(x_calc_absolute_position):
(x_set_offset):
(pgtk_set_window_size):
(x_display_pixel_height):
(x_display_pixel_width):
(x_set_parent_frame): Rename `x_foo' functions to `pgtk_foo'.
Get rid of some copy-pasted code from various places.
(pgtk_create_terminal): Clean up coding style.
* src/pgtkterm.h: Update prototypes.

2 years agoPort sqlite.c to OS X 10.6.8 with Xcode 3.2.6
Paul Eggert [Mon, 18 Apr 2022 00:54:25 +0000 (17:54 -0700)]
Port sqlite.c to OS X 10.6.8 with Xcode 3.2.6

Problem reported by Keith David Bershatsky in:
https://lists.gnu.org/r/emacs-devel/2022-04/msg00923.html
* src/sqlite.c (Fsqlite_open): Don’t assume SQLITE_OPEN_MEMORY
is defined.

2 years agoFix Haiku menu bars when redisplay happens immediately after activation
Po Lu [Mon, 18 Apr 2022 00:50:15 +0000 (00:50 +0000)]
Fix Haiku menu bars when redisplay happens immediately after activation

* src/haiku_support.cc (MessageReceived): Make `REPLAY_MENU_BAR'
messages synchronous.
(be_replay_menu_bar_event): Return whether or not the menu bar
really opened.
* src/haiku_support.h: Update prototypes.
* src/haikumenu.c (haiku_activate_menubar): Immediately activate
menu bar after replaying event.

2 years agoSome minor fixes to Motif DND support
Po Lu [Mon, 18 Apr 2022 00:25:45 +0000 (08:25 +0800)]
Some minor fixes to Motif DND support

* src/xterm.c (xm_write_drag_initiator_info): Swap cardinal
values if wrong byteorder.
(xm_setup_dnd_targets): Read LONG_MAX amount of drag targets.

2 years agoMerge from origin/emacs-28
Paul Eggert [Sun, 17 Apr 2022 20:10:19 +0000 (13:10 -0700)]
Merge from origin/emacs-28

65c04e7115 Update to Org 9.5.2-38-g682ccd

2 years ago; Merge from origin/emacs-28
Paul Eggert [Sun, 17 Apr 2022 20:10:19 +0000 (13:10 -0700)]
; Merge from origin/emacs-28

The following commit was skipped:

c2f94f32b5 Revert "Don’t assume openat"

2 years agoMerge from origin/emacs-28
Paul Eggert [Sun, 17 Apr 2022 20:10:19 +0000 (13:10 -0700)]
Merge from origin/emacs-28

3cccf0a910 Don’t assume openat

2 years agoFix Eshell predicate tests when running from 'make check'
Jim Porter [Sun, 17 Apr 2022 19:51:17 +0000 (21:51 +0200)]
Fix Eshell predicate tests when running from 'make check'

* test/lisp/eshell/em-pred-tests.el (eshell-partial-let-func): Get
original function after macro-expansion.

2 years agoUpdate to Org 9.5.2-38-g682ccd
Kyle Meyer [Sun, 17 Apr 2022 19:30:39 +0000 (15:30 -0400)]
Update to Org 9.5.2-38-g682ccd

2 years agoRevert "Don’t assume openat"
Eli Zaretskii [Sun, 17 Apr 2022 19:03:52 +0000 (22:03 +0300)]
Revert "Don’t assume openat"

This reverts commit 3cccf0a9107d585173e527550bbc45253624ca2e.

This is a change with far-reaching effects on MS-Windows at the least,
where file-related APIs are shadowed to support transparent support
for UTF-8 encoded file names.  Making such changes on a stable branch
for the benefit of a proprietary platform with a 13-year old OS is a
tail wagging the dog.  Please don't do that without discussing first.

2 years agoMake desktop.el use local-minor-modes when saving
Lars Ingebrigtsen [Sun, 17 Apr 2022 18:21:40 +0000 (20:21 +0200)]
Make desktop.el use local-minor-modes when saving

* lisp/desktop.el (desktop-buffer-info): Use a more reliable way
to get minor modes (bug#29972).

2 years agoDon’t assume openat
Paul Eggert [Sun, 17 Apr 2022 17:41:17 +0000 (10:41 -0700)]
Don’t assume openat

Use openat only on platforms with O_PATH.
This ports to OS X 10.9 and earlier.
Problem reported by Keith David Bershatsky in:
https://lists.gnu.org/r/emacs-devel/2022-04/msg00805.html
* lib-src/emacsclient.c (local_sockname): Use open, not openat.
* src/sysdep.c (sys_openat): New static function,
which uses openat only if O_PATH is defined.
(emacs_openat): Use it instead of openat.
(emacs_openat_noquit): Remove.
(emacs_open_noquit): Reimplement as per the old emacs_openat_noquit,
but use plain 'open'.

2 years agoImprove the support for the Brahmi script
Eli Zaretskii [Sun, 17 Apr 2022 17:36:36 +0000 (20:36 +0300)]
Improve the support for the Brahmi script

* lisp/leim/quail/indian.el ("brahmi"): New input method.
* lisp/language/indian.el ("Brahmi"): Add sample-text and
input-method.  (Bug#54914)

* etc/NEWS: Mention the brahmi input method.
* etc/HELLO: Add a Brahmi greeting.

2 years agoFix fontifying type hints in python-mode
kobarity [Sun, 17 Apr 2022 17:28:15 +0000 (19:28 +0200)]
Fix fontifying type hints in python-mode

* lisp/progmodes/python.el
(python-font-lock-keywords-maximum-decoration): Avoid fontifying
type hints as variable names (bug#54992).

Copyright-paperwork-exempt: yes

2 years agoAllow editing variable values in *Help* buffers
Lars Ingebrigtsen [Sun, 17 Apr 2022 16:59:59 +0000 (18:59 +0200)]
Allow editing variable values in *Help* buffers

* 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.

2 years agoMake :filters run in the correct buffer in describe-buffer-bindings
Lars Ingebrigtsen [Sun, 17 Apr 2022 15:36:58 +0000 (17:36 +0200)]
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.

2 years ago; Minor fix for 'restart-emacs' on MS-Windows
Eli Zaretskii [Sun, 17 Apr 2022 15:45:23 +0000 (18:45 +0300)]
; Minor fix for 'restart-emacs' on MS-Windows

* src/w32.c (w32_reexec_emacs): Fail if in -nw session.
* src/emacs.c (Fkill_emacs): Fix a typo.

2 years ago; * lisp/language/indian.el ("Brahmi"): Fix display of vowels.
Eli Zaretskii [Sun, 17 Apr 2022 14:48:13 +0000 (17:48 +0300)]
; * lisp/language/indian.el ("Brahmi"): Fix display of vowels.

2 years agoFix 'restart-emacs' on MS-Windows
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)

2 years agoAdd a `restart-emacs' sanity check
Lars Ingebrigtsen [Sun, 17 Apr 2022 13:46:24 +0000 (15:46 +0200)]
Add a `restart-emacs' sanity check

* src/emacs.c (Fkill_emacs): Add a sanity check for argv.

2 years agoHandle bad actual actions during DND
Po Lu [Sun, 17 Apr 2022 13:23:35 +0000 (21:23 +0800)]
Handle bad actual actions during DND

* src/xterm.c (x_dnd_begin_drag_and_drop): Behave correctly when
the target gives us a bad atom.

2 years agoCheck whether we can restart in Fkill_emacs
Lars Ingebrigtsen [Sun, 17 Apr 2022 13:00:00 +0000 (15:00 +0200)]
Check whether we can restart in Fkill_emacs

* src/emacs.c (Fkill_emacs): Report an error if we can't restart.

2 years agoExplain what "pending" means in isearch
Lars Ingebrigtsen [Sun, 17 Apr 2022 12:23:00 +0000 (14:23 +0200)]
Explain what "pending" means in isearch

* doc/emacs/search.texi (Regexp Search): Explain what "Pending"
usually means (bug#10148).

2 years agoHandle connection errors in rcirc-keepalive
Philip Kaludercic [Sun, 17 Apr 2022 12:21:14 +0000 (14:21 +0200)]
Handle connection errors in rcirc-keepalive

* 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.

2 years agoAdd new function `flush-standard-output'.
Lars Ingebrigtsen [Sun, 17 Apr 2022 12:04:34 +0000 (14:04 +0200)]
Add new function `flush-standard-output'.

* doc/lispref/streams.texi (Output Functions): Document it.
* src/print.c (Fflush_standard_output): New function (bug#15180).

2 years ago; * subr.el (buffer-match-p): Ensure that (and) is always satisfied
Philip Kaludercic [Sun, 17 Apr 2022 12:03:33 +0000 (14:03 +0200)]
; * subr.el (buffer-match-p): Ensure that (and) is always satisfied

2 years agoFurther improve buffer-match-p related documentation
Philip Kaludercic [Sat, 16 Apr 2022 23:11:06 +0000 (01:11 +0200)]
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.

2 years agoAdd a new command `restart-emacs'
Lars Ingebrigtsen [Sun, 17 Apr 2022 11:37:51 +0000 (13:37 +0200)]
Add a new command `restart-emacs'

* doc/lispref/os.texi (Killing Emacs): Document it.

* lisp/files.el (save-buffers-kill-emacs): Add new RESTART parameter.
(restart-emacs): New function.

* src/emacs.c (terminate_due_to_signal, Fkill_emacs): Take an
optional RESTART parameter.

* test/lisp/files-tests.el
(files-tests-save-buffers-kill-emacs--confirm-kill-processes):
* src/xterm.c (x_connection_closed):
* src/xsmfns.c (Fhandle_save_session):
* src/keyboard.c (Fcommand_error_default_function, command_loop)
(command_loop_1, read_menu_command, read_event_from_main_queue)
(read_key_sequence, quit_throw_to_read_char):
* src/eval.c (process_quit_flag): Adjust Fkill_emacs callers.

2 years agoFix chunked encoding connections in url-http
Nacho Barrientos [Sun, 17 Apr 2022 11:00:12 +0000 (13:00 +0200)]
Fix chunked encoding connections in url-http

* lisp/url/url-http.el
(url-http-chunked-encoding-after-change-function): Ensure that chunked
encoding is interpreted correctly (bug#54989).

As per [0], the last chunk of 0 bytes is always accompanied by a last
CRLF that signals the end of the message:

     chunked-body   = *chunk
                      last-chunk
                      trailer-part
                      CRLF
                      ^ this one

     chunk          = chunk-size [ chunk-ext ] CRLF
                      chunk-data CRLF
     chunk-size     = 1*HEXDIG
     last-chunk     = 1*("0") [ chunk-ext ] CRLF

     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).

[0] https://datatracker.ietf.org/doc/html/rfc7230#section-4.1
[1] https://github.com/magit/ghub/issues/81

Copyright-paperwork-exempt: yes

2 years agoRemove duplicates from Info-read-node-name-2
Oleh Krehel [Sun, 17 Apr 2022 10:50:05 +0000 (12:50 +0200)]
Remove duplicates from Info-read-node-name-2

* lisp/info.el (Info-read-node-name-2): Remove duplicates from
completions (bug#20365).

2 years agoFix instructions on how to enable password-store
Lars Ingebrigtsen [Sun, 17 Apr 2022 10:39:41 +0000 (12:39 +0200)]
Fix instructions on how to enable password-store

* doc/misc/auth.texi (Help for users): Give the correct
instructions on how to enable password store (bug#30900).

2 years agoClarify setopt NEWS entry
Lars Ingebrigtsen [Sun, 17 Apr 2022 10:27:40 +0000 (12:27 +0200)]
Clarify setopt NEWS entry

2 years agoDo some NEWS tagging
Lars Ingebrigtsen [Sun, 17 Apr 2022 10:18:58 +0000 (12:18 +0200)]
Do some NEWS tagging

2 years agoAdd a doc string to xref-current-item
Lars Ingebrigtsen [Sun, 17 Apr 2022 10:17:30 +0000 (12:17 +0200)]
Add a doc string to xref-current-item

* lisp/progmodes/xref.el (xref-after-jump-hook): Link to it.
(xref-current-item): Add a doc string to the now-public variable.

2 years agoClarify emacs-news--heading-p logic
Lars Ingebrigtsen [Sun, 17 Apr 2022 10:11:36 +0000 (12:11 +0200)]
Clarify emacs-news--heading-p logic

* lisp/textmodes/emacs-news-mode.el (emacs-news--heading-p):
Clarify the logic.

2 years agoMove some entries around in the NEWS file
Lars Ingebrigtsen [Sun, 17 Apr 2022 09:06:23 +0000 (11:06 +0200)]
Move some entries around in the NEWS file

2 years agoFix up the NEWS entry for emacs-news*-mode
Lars Ingebrigtsen [Sun, 17 Apr 2022 09:00:08 +0000 (11:00 +0200)]
Fix up the NEWS entry for emacs-news*-mode

2 years ago* src/filelock.c (Fcreate_lockfiles): Doc string fix.
Paul Eggert [Sun, 17 Apr 2022 08:50:59 +0000 (01:50 -0700)]
* src/filelock.c (Fcreate_lockfiles): Doc string fix.

2 years agoMerge from origin/emacs-28
Paul Eggert [Sun, 17 Apr 2022 08:44:30 +0000 (01:44 -0700)]
Merge from origin/emacs-28

4641bc1c55 Fix GC bug in filelock.c

2 years agoFix race conditions waiting for menu bar resize events on Haiku
Po Lu [Sun, 17 Apr 2022 08:13:49 +0000 (08:13 +0000)]
Fix race conditions waiting for menu bar resize events on Haiku

* src/haikufns.c (haiku_create_frame, haiku_create_tip_frame):
Clear `wait_for_event_type'.
(haiku_set_menu_bar_lines): Clean up coding style.
* src/haikuterm.c (haiku_wait_for_event): New function.
(haiku_read_socket): Implement waiting for MENU_BAR_RESIZE
events.
* src/haikuterm.h (struct haiku_output): New field
`wait_for_event_type'.

2 years agoFix race conditions waiting for menu bar resize events on Haiku
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'.

2 years agoGet rid of unused flags on Haiku
Po Lu [Sun, 17 Apr 2022 07:29:36 +0000 (07:29 +0000)]
Get rid of unused flags on Haiku

* src/haikufns.c (haiku_free_frame_resources): Syntax fixes.
* src/haikumenu.c (set_frame_menubar, run_menu_bar_help_event):
* src/haikuterm.c (haiku_read_socket): Stop setting and
consulting `menu_up_to_date_p'.
* src/haikuterm.h (struct haiku_output): Delete
`menu_up_to_date_p'.

2 years ago* src/haikufns.c (haiku_free_frame_resources): Free saved menu event.
Po Lu [Sun, 17 Apr 2022 07:16:03 +0000 (07:16 +0000)]
* src/haikufns.c (haiku_free_frame_resources): Free saved menu event.