From f120db63a34e7e9085d815c872049c9cacbbe971 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Mon, 20 Jun 2022 11:02:14 +0000 Subject: Fix running temacs on Haiku * src/emacs.c (main): Run init_haiku_select at the right place. --- src/emacs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/emacs.c') diff --git a/src/emacs.c b/src/emacs.c index 43b9901e081..236add1157d 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -2412,11 +2412,11 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem #if defined WINDOWSNT || defined HAVE_NTGUI globals_of_w32select (); #endif + } #ifdef HAVE_HAIKU - init_haiku_select (); + init_haiku_select (); #endif - } init_charset (); -- cgit v1.2.1 From 2eb738f2b8a3948b590ac7a6640f317a5cb12918 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 20 Jun 2022 19:04:06 +0300 Subject: Support builds configured with a separate --bindir * src/emacs.c (load_pdump): Don't overwrite the leading directories of the Emacs executable just because the pdumper file was not found in the expected directory relative to the binary. This is needed to support builds with a separate --bindir configure-time option and native-compilation. (Bug#55741) --- src/emacs.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'src/emacs.c') diff --git a/src/emacs.c b/src/emacs.c index ccc0dd269f4..0a90b0913be 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -940,20 +940,24 @@ load_pdump (int argc, char **argv) sprintf (dump_file, "%s%c%s%s", path_exec, DIRECTORY_SEP, argv0_base, suffix); #if !defined (NS_SELF_CONTAINED) - /* Assume the Emacs binary lives in a sibling directory as set up by - the default installation configuration. */ - const char *go_up = "../../../../bin/"; - needed += (strip_suffix ? strlen (strip_suffix) : 0) - - strlen (suffix) + strlen (go_up); - if (exec_bufsize < needed) - { - xfree (emacs_executable); - emacs_executable = xpalloc (NULL, &exec_bufsize, needed - exec_bufsize, - -1, 1); - } - sprintf (emacs_executable, "%s%c%s%s%s", - path_exec, DIRECTORY_SEP, go_up, argv0_base, - strip_suffix ? strip_suffix : ""); + if (!(emacs_executable && *emacs_executable)) + { + /* If we didn't find the Emacs binary, assume that it lives in a + sibling directory as set up by the default installation + configuration. */ + const char *go_up = "../../../../bin/"; + needed += (strip_suffix ? strlen (strip_suffix) : 0) + - strlen (suffix) + strlen (go_up); + if (exec_bufsize < needed) + { + xfree (emacs_executable); + emacs_executable = xpalloc (NULL, &exec_bufsize, + needed - exec_bufsize, -1, 1); + } + sprintf (emacs_executable, "%s%c%s%s%s", + path_exec, DIRECTORY_SEP, go_up, argv0_base, + strip_suffix ? strip_suffix : ""); + } #endif result = pdumper_load (dump_file, emacs_executable); -- cgit v1.2.1 From 73a384a98698ae1ef655c41a2b76a31b3f2c80fc Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 21 Jun 2022 15:04:27 +0200 Subject: Increase gc-cons-percentage in -batch Emacs * doc/lispref/os.texi (Batch Mode): Document it. * src/emacs.c (main): Use a gc-cons-percentage of 1.0 in noninteractive Emacsen. --- src/emacs.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/emacs.c') diff --git a/src/emacs.c b/src/emacs.c index 5098acd7225..c602157da16 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1944,6 +1944,12 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem if (!initialized) syms_of_comp (); + /* Do less garbage collection in batch mode (since these tend to be + more short-lived, and the memory is returned to the OS on exit + anyway). */ + if (noninteractive) + Vgc_cons_percentage = make_float (1.0); + no_loadup = argmatch (argv, argc, "-nl", "--no-loadup", 6, NULL, &skip_args); -- cgit v1.2.1 From 49137311a432a0c3c4afef1ae7d463cd4c3613ae Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 21 Jun 2022 15:11:28 +0200 Subject: Fix previous -batch change for gc-cons-percentage * src/emacs.c (main): Reset the default for gc-cons-percentage in interactive Emacs. --- src/emacs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/emacs.c') diff --git a/src/emacs.c b/src/emacs.c index c602157da16..37c6c76e7a3 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1947,8 +1947,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem /* Do less garbage collection in batch mode (since these tend to be more short-lived, and the memory is returned to the OS on exit anyway). */ - if (noninteractive) - Vgc_cons_percentage = make_float (1.0); + Vgc_cons_percentage = make_float (noninteractive? 1.0: 0.1); no_loadup = argmatch (argv, argc, "-nl", "--no-loadup", 6, NULL, &skip_args); -- cgit v1.2.1 From 0b4db66a9deae682dc7d444f4ab8d0e49f15c3b9 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Thu, 23 Jun 2022 13:38:30 +0800 Subject: Allow dropping more data types on PGTK * lisp/loadup.el (featurep): Load `pgtk-dnd'. * lisp/pgtk-dnd.el: New file. (pgtk-dnd-test-function, pgtk-dnd-types-alist) (pgtk-dnd-known-types, pgtk-dnd-use-offix-drop) (pgtk-dnd-current-state, pgtk-get-selection-internal) (pgtk-register-dnd-targets, pgtk-dnd-empty-state) (pgtk-dnd-init-frame, pgtk-dnd-get-state-cons-for-frame) (pgtk-dnd-get-state-for-frame, pgtk-dnd-default-test-function) (pgtk-dnd-current-type, pgtk-dnd-forget-drop) (pgtk-dnd-maybe-call-test-function, pgtk-dnd-save-state) (pgtk-dnd-handle-moz-url, pgtk-dnd-insert-utf8-text) (pgtk-dnd-insert-utf16-text, pgtk-dnd-insert-ctext) (pgtk-dnd-handle-uri-list, pgtk-dnd-handle-file-name) (pgtk-dnd-choose-type, pgtk-dnd-drop-data) (pgtk-dnd-handle-drag-n-drop-event, pgtk-update-drop-status) (pgtk-drop-finish, pgtk-dnd-handle-gdk, pgtk-dnd): New variables and functions and library. * lisp/term/pgtk-win.el (special-event-map): Load `drag-n-drop-event'. (after-make-frame-functions): Register DND after make frame functions. * src/emacs.c (main): Stop calling empty init_pgtkterm function. * src/pgtkselect.c (Fpgtk_register_dnd_targets, Fpgtk_drop_finish) (Fpgtk_update_drop_status): New functions. (syms_of_pgtkselect): Register new functions. * src/pgtkterm.c (struct event_queue_t): Fix coding style of definition. (symbol_to_drag_action, drag_action_to_symbol) (pgtk_update_drop_status, pgtk_finish_drop): New functions. (drag_data_received): Delete function. (pgtk_set_event_handler): Register for DND correctly. (syms_of_pgtkterm): New defsyms for DND types. (init_pgtkterm): Delete function. * src/pgtkterm.h: Update prototypes, fix prototype coding style. --- src/emacs.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/emacs.c') diff --git a/src/emacs.c b/src/emacs.c index 37c6c76e7a3..3c768412818 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1930,9 +1930,6 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem init_bignum (); init_threads (); init_eval (); -#ifdef HAVE_PGTK - init_pgtkterm (); /* Must come before `init_atimer'. */ -#endif running_asynch_code = 0; init_random (); init_xfaces (); -- cgit v1.2.1