1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-01 01:41:01 -08:00
Commit graph

46041 commits

Author SHA1 Message Date
Stefan Monnier
71005decb4 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.
2022-04-19 08:25:19 -04:00
Po Lu
5fe75feafc 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.
2022-04-19 18:51:45 +08:00
Eli Zaretskii
237f4f9295 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.
2022-04-19 12:50:01 +03:00
Po Lu
d168decab4 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.
2022-04-19 15:49:27 +08:00
Po Lu
d78e446072 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.
2022-04-19 04:39:37 +00:00
Po Lu
92667cc2fb Fix last change for GTK 2
* src/xfns.c (x_set_alpha_background):
* src/xterm.c (x_update_opaque_region): Move some ifdefs around.
2022-04-19 11:18:25 +08:00
Po Lu
4dd47196f6 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.
2022-04-19 11:13:59 +08:00
Paul Eggert
9751250adb 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.
2022-04-18 19:47:37 -07:00
Paul Eggert
75dfc1e870 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.
2022-04-18 19:47:36 -07:00
Po Lu
ace1f32ac1 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.
2022-04-19 01:15:33 +00:00
Alan Third
fa91925e13 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.
2022-04-18 20:24:51 +01:00
Eli Zaretskii
a45c1c45a2 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.
2022-04-18 21:04:57 +03:00
Lars Ingebrigtsen
fac640ee86 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).
2022-04-18 12:59:03 +02:00
Po Lu
89a5aa4ca7 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.
2022-04-18 18:39:43 +08:00
Lars Ingebrigtsen
088cb6115f 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.
2022-04-18 11:31:28 +02:00
Lars Ingebrigtsen
9fc3b00373 Improve `restart-emacs' error reporting
* src/emacs.c (Fkill_emacs): Do better error reporting on restarting.
2022-04-18 11:02:55 +02:00
Lars Ingebrigtsen
e0009409b8 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.
2022-04-18 10:50:45 +02:00
Po Lu
736fd8b258 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.
2022-04-18 16:08:19 +08:00
Po Lu
96b21b8da1 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>.
2022-04-18 16:01:44 +08:00
Eli Zaretskii
2363366862 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.
2022-04-18 10:05:15 +03:00
Po Lu
5b5608c614 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.
2022-04-18 13:23:23 +08:00
Po Lu
a9b2206def ; Fix typo in last change
* src/xterm.c (x_wm_set_size_hint): Fix typo.
2022-04-18 09:26:12 +08:00
Po Lu
d1f315751d 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.
2022-04-18 09:24:36 +08:00
Paul Eggert
0bb8e127b0 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.
2022-04-17 17:55:45 -07:00
Po Lu
29bf6e64fd 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.
2022-04-18 00:50:15 +00:00
Po Lu
4b2b3c45d3 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.
2022-04-18 08:26:38 +08:00
Paul Eggert
6662079b90 Merge from origin/emacs-28
3cccf0a910 Don’t assume openat
2022-04-17 13:10:19 -07:00
Paul Eggert
3cccf0a910 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'.
2022-04-17 10:43:13 -07:00
Lars Ingebrigtsen
b49cca7012 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.
2022-04-17 18:06:26 +02:00
Eli Zaretskii
dd451a37dd ; 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.
2022-04-17 18:45:23 +03:00
Eli Zaretskii
5a63af876b 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)
2022-04-17 17:20:03 +03:00
Lars Ingebrigtsen
56d5a40794 Add a `restart-emacs' sanity check
* src/emacs.c (Fkill_emacs): Add a sanity check for argv.
2022-04-17 15:46:32 +02:00
Po Lu
ec025f22ef 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.
2022-04-17 21:25:25 +08:00
Lars Ingebrigtsen
b38c3fe863 Check whether we can restart in Fkill_emacs
* src/emacs.c (Fkill_emacs): Report an error if we can't restart.
2022-04-17 15:00:00 +02:00
Lars Ingebrigtsen
2136db067f Add new function `flush-standard-output'.
* doc/lispref/streams.texi (Output Functions): Document it.
* src/print.c (Fflush_standard_output): New function (bug#15180).
2022-04-17 14:06:25 +02:00
Lars Ingebrigtsen
5be9a9cacf 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.
2022-04-17 13:37:51 +02:00
Paul Eggert
0353c6fd08 * src/filelock.c (Fcreate_lockfiles): Doc string fix. 2022-04-17 01:50:59 -07:00
Paul Eggert
ff7bc01830 Merge from origin/emacs-28
4641bc1c55 Fix GC bug in filelock.c
2022-04-17 01:44:30 -07:00
Po Lu
5bc3ed492b 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'.
2022-04-17 08:14:06 +00:00
Po Lu
9a7430ce84 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'.
2022-04-17 08:14:06 +00:00
Po Lu
38d72d8d88 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'.
2022-04-17 08:14:06 +00:00
Po Lu
5a18cd8821 * src/haikufns.c (haiku_free_frame_resources): Free saved menu event. 2022-04-17 08:14:05 +00:00
Po Lu
e8b0808e20 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'.
2022-04-17 08:14:05 +00:00
Paul Eggert
4641bc1c55 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.
2022-04-17 01:08:21 -07:00
Po Lu
265f4ef702 Make sure the ftcr font driver is used on Haiku when Cairo is enabled
* src/haikufont.c (syms_of_haikufont): [USE_BE_CAIRO]: Make sure
`ftcr' superseeds `haiku'.
2022-04-17 04:07:07 +00:00
Paul Eggert
f1ba92448d 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.
2022-04-16 18:54:31 -07:00
Max Nikulin
15a5cf9a9a 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).
2022-04-16 18:54:30 -07:00
Po Lu
18ec3fcce9 Restore pending_signals at a point in the DND event loop
* src/xterm.c (x_dnd_begin_drag_and_drop): Restore
pending_signals after unblock_input.
2022-04-17 08:38:37 +08:00
Eli Zaretskii
44ba0270b7 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...

# Conflicts:
#	etc/PROBLEMS
#	lisp/outline.el
#	src/sysdep.c
2022-04-16 13:58:31 -04:00
Eli Zaretskii
8804dfdb1a 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

# Conflicts:
#	doc/misc/eww.texi
2022-04-16 13:45:50 -04:00