commit e0198986d25487acc7b4f4d77451d5e6789e310c (HEAD, refs/remotes/origin/master) Author: Lars Ingebrigtsen Date: Sat Feb 12 09:04:14 2022 +0100 Add documentation on how to delete files from Trash * doc/emacs/files.texi (Misc File Ops): Note trick to make `D' work in Trash directories (bug#44059). diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index 84eb7275da..c5cb6fd17b 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi @@ -1828,6 +1828,22 @@ argument to @kbd{M-x delete-file} or @kbd{M-x delete-directory} makes them delete outright, instead of using the Trash, regardless of @code{delete-by-moving-to-trash}. + If you have @code{delete-by-moving-to-trash} set, and you want to +delete files manually in Emacs from the Trash directory, using +commands like @kbd{D} (@code{dired-do-delete}) doesn't work well in +the Trash directory (it'll just give the file a new name, but won't +delete anything). If you want to be able to do this, you should +create a @code{.dir-locals.el} file containing something like the +following in the Trash directory: + +@example +((dired-mode . ((delete-by-moving-to-trash . nil)))) +@end example + + Note, however, if you use the system ``empty trash'' command, it's +liable to also delete this @code{.dir-locals.el} file, so this should +only be done if you delete files from the Trash directory manually. + @ifnottex If a file is under version control (@pxref{Version Control}), you should delete it using @kbd{M-x vc-delete-file} instead of @kbd{M-x commit c4da0d331291d531dddc08e7fef1548e638c4663 Author: Lars Ingebrigtsen Date: Sat Feb 12 08:40:30 2022 +0100 Improve interaction between track-mouse and edebug * lisp/emacs-lisp/edebug.el (edebug--display-1): Work around `track-mouse' oddity (bug#675). diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 1720393b3e..a7e71d2ed2 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -2577,6 +2577,13 @@ See `edebug-behavior-alist' for implementations.") ;; Let's at least show a backtrace so the user can figure out ;; which function we're talking about. (debug)) + ;; If we're in a `track-mouse' setting, then any previous mouse + ;; movements will make `input-pending-p' later return true. So + ;; discard the inputs in that case. (And `discard-input' doesn't + ;; work here.) + (when track-mouse + (while (input-pending-p) + (read-event))) ;; Setup windows for edebug, determine mode, maybe enter recursive-edit. ;; Uses local variables of edebug-enter, edebug-before, edebug-after ;; and edebug-debugger. commit 2b97e83cc1bffdaa923c9ebb877da2e25051e1a9 Author: Lars Ingebrigtsen Date: Sat Feb 12 08:07:42 2022 +0100 Fix off-by-one file size formatting in ls-lisp * lisp/ls-lisp.el (ls-lisp-format, ls-lisp-format-file-size): The human-readable file sizes can be 7 characters wide (e.g., "1016.1k") (bug#53937). diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el index e7118a2a37..7a4be3c7e4 100644 --- a/lisp/ls-lisp.el +++ b/lisp/ls-lisp.el @@ -784,7 +784,7 @@ SWITCHES and TIME-INDEX give the full switch list and time data." ;; In GNU ls, -h affects the size in blocks, displayed ;; by -s, as well. (if (memq ?h switches) - (format "%6s " + (format "%7s " (file-size-human-readable ;; We use 1K as "block size", although ;; most Windows volumes use 4KB to 8KB @@ -881,7 +881,7 @@ All ls time options, namely c, t and u, are handled." ls-lisp-filesize-f-fmt ls-lisp-filesize-d-fmt) file-size) - (format " %6s" (file-size-human-readable file-size)))) + (format " %7s" (file-size-human-readable file-size)))) (defun ls-lisp-unload-function () "Unload ls-lisp library." commit 53ef883b52c5836184a8a32536d022b9085100c7 Author: Lars Ingebrigtsen Date: Fri Feb 11 07:22:52 2022 +0100 Cross-link message-expand-name-standard-ui-relevant doc strings * lisp/gnus/message.el (message-expand-name-standard-ui): Mention the other relevant variables in the doc string (bug#50667). diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index a6c6a16653..869ab3f82b 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -8369,7 +8369,11 @@ regular text mode tabbing command." (defcustom message-expand-name-standard-ui nil "If non-nil, use the standard completion UI in `message-expand-name'. -E.g. this means it will obey `completion-styles' and other such settings." +E.g. this means it will obey `completion-styles' and other such settings. + +If this variable is non-nil and `message-mail-alias-type' is +`ecomplete', `message-self-insert-commands' should probably be +set to nil." :version "27.1" :type 'boolean) commit 4c6a4281a41ca2b3ab76339292aac24d8470efe5 Author: Po Lu Date: Sat Feb 12 04:42:42 2022 +0000 Implement visual bell on Haiku like on X * src/haiku_draw_support.cc (BView_FillRectangleForVisibleBell): Delete function. (BView_InvertRect): New function. * src/haiku_support.cc (class EmacsView): Delete field `visible_bell_color' and visible bell related methods. (EmacsView_do_visible_bell): Delete function. * src/haiku_support.h: Update prototypes. * src/haikuterm.c (haiku_flash): Implement using `BView_InvertRect'. (haiku_beep): Use `haiku_flash' instead. diff --git a/src/haiku_draw_support.cc b/src/haiku_draw_support.cc index 270a619b89..f8df298958 100644 --- a/src/haiku_draw_support.cc +++ b/src/haiku_draw_support.cc @@ -479,10 +479,9 @@ BView_SetHighColorForVisibleBell (void *view, uint32_t color) } void -BView_FillRectangleForVisibleBell (void *view, int x, int y, int width, int height) +BView_InvertRect (void *view, int x, int y, int width, int height) { - BView *vw = (BView *) view; - BRect rect = BRect (x, y, x + width - 1, y + height - 1); + BView *vw = get_view (view); - vw->FillRect (rect); + vw->InvertRect (BRect (x, y, x + width - 1, y + height - 1)); } diff --git a/src/haiku_support.cc b/src/haiku_support.cc index 71aa323b07..28bf2ac8b6 100644 --- a/src/haiku_support.cc +++ b/src/haiku_support.cc @@ -1174,7 +1174,6 @@ class EmacsMenuBar : public BMenuBar class EmacsView : public BView { public: - uint32_t visible_bell_color = 0; uint32_t previous_buttons = 0; int looper_locked_count = 0; BRegion sb_region; @@ -1313,30 +1312,12 @@ class EmacsView : public BView } } - void - Pulse (void) - { - visible_bell_color = 0; - SetFlags (Flags () & ~B_PULSE_NEEDED); - Window ()->SetPulseRate (0); - Invalidate (); - } - void Draw (BRect expose_bounds) { struct haiku_expose_event rq; EmacsWindow *w = (EmacsWindow *) Window (); - if (visible_bell_color > 0) - { - PushState (); - BView_SetHighColorForVisibleBell (this, visible_bell_color); - FillRect (Frame ()); - PopState (); - return; - } - if (w->shown_flag && offscreen_draw_view) { PushState (); @@ -1372,18 +1353,6 @@ class EmacsView : public BView } } - void - DoVisibleBell (uint32_t color) - { - if (!LockLooper ()) - gui_abort ("Failed to lock looper during visible bell"); - visible_bell_color = color | (255 << 24); - SetFlags (Flags () | B_PULSE_NEEDED); - Window ()->SetPulseRate (100 * 1000); - Invalidate (); - UnlockLooper (); - } - void FlipBuffers (void) { @@ -3054,14 +3023,6 @@ be_app_quit (void) } } -/* Temporarily fill VIEW with COLOR. */ -void -EmacsView_do_visible_bell (void *view, uint32_t color) -{ - EmacsView *vw = (EmacsView *) view; - vw->DoVisibleBell (color); -} - /* Zoom WINDOW. */ void BWindow_zoom (void *window) diff --git a/src/haiku_support.h b/src/haiku_support.h index 369a4b6bb4..e50d347009 100644 --- a/src/haiku_support.h +++ b/src/haiku_support.h @@ -472,10 +472,6 @@ extern "C" extern void BView_SetHighColorForVisibleBell (void *view, uint32_t color); - extern void - BView_FillRectangleForVisibleBell (void *view, int x, int y, int width, - int height); - extern void BView_SetLowColor (void *view, uint32_t color); @@ -538,6 +534,9 @@ extern "C" int vx, int vy, int vwidth, int vheight, uint32_t color); + extern void + BView_InvertRect (void *view, int x, int y, int width, int height); + extern void * BBitmap_transform_bitmap (void *bitmap, void *mask, uint32_t m_color, double rot, int desw, int desh); @@ -794,9 +793,6 @@ extern "C" extern void c_unbind_to_nil_from_cxx (ptrdiff_t idx); - extern void - EmacsView_do_visible_bell (void *view, uint32_t color); - extern void BWindow_zoom (void *window); diff --git a/src/haikuterm.c b/src/haikuterm.c index 117d8df2e5..3de215bc88 100644 --- a/src/haikuterm.c +++ b/src/haikuterm.c @@ -3380,6 +3380,94 @@ haiku_free_pixmap (struct frame *f, Emacs_Pixmap pixmap) BBitmap_free (pixmap); } +static void +haiku_flash (struct frame *f) +{ + /* Get the height not including a menu bar widget. */ + int height = FRAME_PIXEL_HEIGHT (f); + /* Height of each line to flash. */ + int flash_height = FRAME_LINE_HEIGHT (f); + /* These will be the left and right margins of the rectangles. */ + int flash_left = FRAME_INTERNAL_BORDER_WIDTH (f); + int flash_right = FRAME_PIXEL_WIDTH (f) - FRAME_INTERNAL_BORDER_WIDTH (f); + int width = flash_right - flash_left; + void *view = FRAME_HAIKU_VIEW (f); + struct timespec delay, wakeup, current, timeout; + + delay = make_timespec (0, 150 * 1000 * 1000); + wakeup = timespec_add (current_timespec (), delay); + + BView_draw_lock (view); + BView_StartClip (view); + /* If window is tall, flash top and bottom line. */ + if (height > 3 * FRAME_LINE_HEIGHT (f)) + { + BView_InvertRect (view, flash_left, + (FRAME_INTERNAL_BORDER_WIDTH (f) + + FRAME_TOP_MARGIN_HEIGHT (f)), + width, flash_height); + + BView_InvertRect (view, flash_left, + (height - flash_height + - FRAME_INTERNAL_BORDER_WIDTH (f)), + width, flash_height); + } + else + /* If it is short, flash it all. */ + BView_InvertRect (view, flash_left, FRAME_INTERNAL_BORDER_WIDTH (f), + width, height - 2 * FRAME_INTERNAL_BORDER_WIDTH (f)); + BView_EndClip (view); + BView_draw_unlock (view); + + flush_frame (f); + + if (EmacsView_double_buffered_p (view)) + haiku_flip_buffers (f); + + /* Keep waiting until past the time wakeup or any input gets + available. */ + while (!detect_input_pending ()) + { + current = current_timespec (); + + /* Break if result would not be positive. */ + if (timespec_cmp (wakeup, current) <= 0) + break; + + /* How long `select' should wait. */ + timeout = make_timespec (0, 10 * 1000 * 1000); + + /* Try to wait that long--but we might wake up sooner. */ + pselect (0, NULL, NULL, NULL, &timeout, NULL); + } + + BView_draw_lock (view); + BView_StartClip (view); + /* If window is tall, flash top and bottom line. */ + if (height > 3 * FRAME_LINE_HEIGHT (f)) + { + BView_InvertRect (view, flash_left, + (FRAME_INTERNAL_BORDER_WIDTH (f) + + FRAME_TOP_MARGIN_HEIGHT (f)), + width, flash_height); + + BView_InvertRect (view, flash_left, + (height - flash_height + - FRAME_INTERNAL_BORDER_WIDTH (f)), + width, flash_height); + } + else + /* If it is short, flash it all. */ + BView_InvertRect (view, flash_left, FRAME_INTERNAL_BORDER_WIDTH (f), + width, height - 2 * FRAME_INTERNAL_BORDER_WIDTH (f)); + BView_EndClip (view); + BView_draw_unlock (view); + + flush_frame (f); + if (EmacsView_double_buffered_p (view)) + haiku_flip_buffers (f); +} + static void haiku_beep (struct frame *f) { @@ -3389,21 +3477,7 @@ haiku_beep (struct frame *f) if (view) { block_input (); - BView_draw_lock (view); - if (!EmacsView_double_buffered_p (view)) - { - BView_SetHighColorForVisibleBell (view, FRAME_FOREGROUND_PIXEL (f)); - BView_FillRectangleForVisibleBell (view, 0, 0, FRAME_PIXEL_WIDTH (f), - FRAME_PIXEL_HEIGHT (f)); - SET_FRAME_GARBAGED (f); - expose_frame (f, 0, 0, 0, 0); - } - else - { - EmacsView_do_visible_bell (view, FRAME_FOREGROUND_PIXEL (f)); - haiku_flip_buffers (f); - } - BView_draw_unlock (view); + haiku_flash (f); unblock_input (); } } commit 9de7b3f3355cec3b36dd16af66d0110240bebfb8 Author: Po Lu Date: Sat Feb 12 10:33:14 2022 +0800 Fix compatibility with ancient versions of libXi * src/xmenu.c (popup_get_selection): Don't rely on xev->display being non-NULL. diff --git a/src/xmenu.c b/src/xmenu.c index 745a80ade1..eaec6efc26 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -318,7 +318,7 @@ popup_get_selection (XEvent *initial_event, struct x_display_info *dpyinfo, copy.xbutton.type = ButtonRelease; copy.xbutton.serial = xev->serial; copy.xbutton.send_event = xev->send_event; - copy.xbutton.display = xev->display; + copy.xbutton.display = dpyinfo->display; copy.xbutton.window = xev->event; copy.xbutton.root = xev->root; copy.xbutton.subwindow = xev->child; @@ -363,7 +363,7 @@ popup_get_selection (XEvent *initial_event, struct x_display_info *dpyinfo, copy.xkey.type = KeyPress; copy.xkey.serial = xev->serial; copy.xkey.send_event = xev->send_event; - copy.xkey.display = xev->display; + copy.xkey.display = dpyinfo->display; copy.xkey.window = xev->event; copy.xkey.root = xev->root; copy.xkey.subwindow = xev->child; commit 7c37f5fd698227f1d0f1ebb40b004bc021028cae Author: Po Lu Date: Sat Feb 12 10:23:51 2022 +0800 Be less strict about which PointerEmulated button events to ignore * src/xterm.c (handle_one_xevent): Ignore all PointerEmulated button events. diff --git a/src/xterm.c b/src/xterm.c index e7736f741a..22c1438076 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -11242,11 +11242,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, #ifdef XIPointerEmulated /* Ignore emulated scroll events when XI2 native scroll events are present. */ - if (((dpyinfo->xi2_version == 1 - && xev->detail >= 4 - && xev->detail <= 8) - || (dpyinfo->xi2_version >= 2)) - && xev->flags & XIPointerEmulated) + if (xev->flags & XIPointerEmulated) { *finish = X_EVENT_DROP; goto XI_OTHER; commit f622034fa565a50f9c210301aba2545b2521f356 Author: Po Lu Date: Sat Feb 12 09:20:53 2022 +0800 Never set opaque region without an alpha channel * src/xfns.c (x_set_alpha_background): Don't modify opaque region if the visual has no alpha channel. diff --git a/src/xfns.c b/src/xfns.c index 849fa72f39..6226f4063a 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -746,6 +746,9 @@ x_set_alpha_background (struct frame *f, Lisp_Object arg, Lisp_Object oldval) f->alpha_background != 1.0); #endif + if (!FRAME_DISPLAY_INFO (f)->alpha_bits) + return; + if (f->alpha_background != 1.0) { XChangeProperty (FRAME_X_DISPLAY (f), commit 3fb68b3d25c5318b818d820aa79bd60c3ced0186 Author: Mattias Engdegård Date: Fri Feb 11 21:41:11 2022 +0100 Modernise byte-compilation chapters in manual * doc/lispref/compile.texi (Speed of Byte-Code): More representative numbers for byte code; the difference is much greater today. (Compilation Functions, Disassembly): Example output for lexbind bytecode. diff --git a/doc/lispref/compile.texi b/doc/lispref/compile.texi index 2b6ec849d2..3670225dc4 100644 --- a/doc/lispref/compile.texi +++ b/doc/lispref/compile.texi @@ -61,7 +61,7 @@ Here is an example: @group (silly-loop 50000000) -@result{} 10.235304117202759 +@result{} 5.200886011123657 @end group @group @@ -71,12 +71,12 @@ Here is an example: @group (silly-loop 50000000) -@result{} 3.705854892730713 +@result{} 0.6239290237426758 @end group @end example - In this example, the interpreted code required 10 seconds to run, -whereas the byte-compiled code required less than 4 seconds. These + In this example, the interpreted code required more than 5 seconds to run, +whereas the byte-compiled code required less than 1 second. These results are representative, but actual results may vary. @node Compilation Functions @@ -135,10 +135,10 @@ definition of @var{symbol} (@pxref{Byte-Code Objects}). @group (byte-compile 'factorial) @result{} -#[(integer) - "^H\301U\203^H^@@\301\207\302^H\303^HS!\"\207" - [integer 1 * factorial] - 4 "Compute factorial of INTEGER."] +#[257 + "\211\300U\203^H^@@\300\207\211\301^BS!_\207" + [1 factorial] 4 + "Compute factorial of INTEGER.\n\n(fn INTEGER)"] @end group @end example @@ -688,11 +688,11 @@ Lisp source; these do not appear in the output of @code{disassemble}. (disassemble 'factorial) @print{} byte-code for factorial: doc: Compute factorial of an integer. - args: (integer) + args: (arg1) @end group @group -0 varref integer ; @r{Get the value of @code{integer} and} +0 dup ; @r{Get the value of @code{integer} and} ; @r{push it onto the stack.} 1 constant 1 ; @r{Push 1 onto stack.} @end group @@ -707,9 +707,9 @@ Lisp source; these do not appear in the output of @code{disassemble}. 7 return ; @r{Return the top element of the stack.} @end group @group -8:1 varref integer ; @r{Push value of @code{integer} onto stack.} +8:1 dup ; @r{Push value of @code{integer} onto stack.} 9 constant factorial ; @r{Push @code{factorial} onto stack.} -10 varref integer ; @r{Push value of @code{integer} onto stack.} +10 stack-ref 2 ; @r{Push value of @code{integer} onto stack.} 11 sub1 ; @r{Pop @code{integer}, decrement value,} ; @r{push new value onto stack.} 12 call 1 ; @r{Call function @code{factorial} using first} @@ -717,9 +717,9 @@ Lisp source; these do not appear in the output of @code{disassemble}. ; @r{push returned value onto stack.} @end group @group -13 mult ; @r{Pop top two values off stack, multiply} +13 mult ; @r{Pop top two values off stack, multiply} ; @r{them, and push result onto stack.} -14 return ; @r{Return the top element of the stack.} +14 return ; @r{Return the top element of the stack.} @end group @end example @@ -740,7 +740,7 @@ The @code{silly-loop} function is somewhat more complex: (disassemble 'silly-loop) @print{} byte-code for silly-loop: doc: Return time before and after N iterations of a loop. - args: (n) + args: (arg1) @end group @group @@ -749,24 +749,21 @@ The @code{silly-loop} function is somewhat more complex: @end group @group 1 call 0 ; @r{Call @code{current-time-string} with no} - ; @r{argument, push result onto stack.} + ; @r{argument, push result onto stack as @code{t1}.} @end group @group -2 varbind t1 ; @r{Pop stack and bind @code{t1} to popped value.} -@end group -@group -3:1 varref n ; @r{Get value of @code{n} from the environment} +2:1 stack-ref 1 ; @r{Get value of the argument @code{n}} ; @r{and push the value on the stack.} -4 sub1 ; @r{Subtract 1 from top of stack.} +3 sub1 ; @r{Subtract 1 from top of stack.} @end group @group -5 dup ; @r{Duplicate top of stack; i.e., copy the top} +4 dup ; @r{Duplicate top of stack; i.e., copy the top} ; @r{of the stack and push copy onto stack.} -6 varset n ; @r{Pop the top of the stack,} - ; @r{and bind @code{n} to the value.} +5 stack-set 3 ; @r{Pop the top of the stack,} + ; @r{and set @code{n} to the value.} -;; @r{(In effect, the sequence @code{dup varset} copies the top of the stack} -;; @r{into the value of @code{n} without popping it.)} +;; @r{(In effect, the sequence @code{dup stack-set} copies the top of} +;; @r{the stack into the value of @code{n} without popping it.)} @end group @group @@ -781,16 +778,15 @@ The @code{silly-loop} function is somewhat more complex: ; @r{else continue.} @end group @group -12 varref t1 ; @r{Push value of @code{t1} onto stack.} +12 dup ; @r{Push value of @code{t1} onto stack.} 13 constant current-time-string ; @r{Push @code{current-time-string}} ; @r{onto the top of the stack.} 14 call 0 ; @r{Call @code{current-time-string} again.} @end group @group -15 unbind 1 ; @r{Unbind @code{t1} in local environment.} -16 list2 ; @r{Pop top two elements off stack, create a} +15 list2 ; @r{Pop top two elements off stack, create a} ; @r{list of them, and push it onto stack.} -17 return ; @r{Return value of the top of stack.} +16 return ; @r{Return value of the top of stack.} @end group @end example commit 645694ccdb1526ccf78ea95df7fe505e93231202 Author: Po Lu Date: Fri Feb 11 20:26:04 2022 +0800 ; * config.bat: Fix typo. diff --git a/config.bat b/config.bat index d647ad5e67..758e462138 100644 --- a/config.bat +++ b/config.bat @@ -312,7 +312,7 @@ sed -f ../msdos/sedlibmk.inp < gnulib.tmp > gnulib.mk rm -f gnulib.tmp Rem Create directorys in lib/ that MKDIR_P is supposed to create Rem but I have no idea how to do that on MS-DOS. -mkdir lib\sys +mkdir sys Rem Create .d files for new files in lib/ and lib/malloc/ If Not Exist deps\stamp mkdir deps for %%f in (*.c) do @call ..\msdos\depfiles.bat %%f commit f0f58cc5c753d4bf9225bfe320ba5f213b3aca5c Merge: f726ca161c bced4d26d9 Author: Po Lu Date: Fri Feb 11 20:20:50 2022 +0800 Merge remote-tracking branch 'origin/master' commit f726ca161c2617a400ce3823926813134ace287e Author: Po Lu Date: Fri Feb 11 20:19:34 2022 +0800 Fix the DJGPP port * config.bat: * msdos/sed1v2.inp: * msdos/sedlibmk.inp: Update for present Emacs. * src/Makefile.in (MAKE_PDUMPER_FINGERPRINT): Fix indentation to not confuse sed*.inp. * src/conf_post.h [MSDOS]: Define some things gnulib wants. diff --git a/config.bat b/config.bat index 29742eec52..d647ad5e67 100644 --- a/config.bat +++ b/config.bat @@ -310,6 +310,9 @@ rm -f makefile.tmp sed -f ../msdos/sedlibcf.inp < gnulib.mk-in > gnulib.tmp sed -f ../msdos/sedlibmk.inp < gnulib.tmp > gnulib.mk rm -f gnulib.tmp +Rem Create directorys in lib/ that MKDIR_P is supposed to create +Rem but I have no idea how to do that on MS-DOS. +mkdir lib\sys Rem Create .d files for new files in lib/ and lib/malloc/ If Not Exist deps\stamp mkdir deps for %%f in (*.c) do @call ..\msdos\depfiles.bat %%f diff --git a/msdos/sed1v2.inp b/msdos/sed1v2.inp index e041e4e5b8..86f00c024a 100644 --- a/msdos/sed1v2.inp +++ b/msdos/sed1v2.inp @@ -55,8 +55,10 @@ s/ *@LIBJPEG@// s/ *@LIBPNG@// s/ *@LIBGIF@// s/ *@LIBXPM@// +s/ *@WEBP_LIBS@// /^HAVE_NATIVE_COMP *=/s/@HAVE_NATIVE_COMP@/no/ /^HAVE_PDUMPER *=/s/@HAVE_PDUMPER@/no/ +/^HAVE_BE_APP *=/s/@HAVE_BE_APP@/no/ /^CHECK_STRUCTS *=/s/@CHECK_STRUCTS@// /^RUN_TEMACS \=/s/temacs/temacs.exe/ /^XFT_LIBS *=/s/@XFT_LIBS@// @@ -78,6 +80,10 @@ s/ *@LIBXPM@// /^NOTIFY_LIBS *=/s/@NOTIFY_LIBS@// /^NOTIFY_CFLAGS *=/s/@NOTIFY_CFLAGS@// /^GTK_OBJ *=/s/@GTK_OBJ@// +/^PGTK_OBJ *=/s/@PGTK_OBJ@// +/^PGTK_LIBS *=/s/@PGTK_LIBS@// +/^HAIKU_OBJ *=/s/@HAIKU_OBJ@// +/^HAIKU_CXX_OBJ *=/s/@HAIKU_CXX_OBJ@// /^LIBS_TERMCAP *=/s/@LIBS_TERMCAP@// /^TERMCAP_OBJ *=/s/@TERMCAP_OBJ@/termcap.o tparam.o/ /^LIBXMU *=/s/@LIBXMU@// @@ -110,6 +116,14 @@ s/ *@LIBXPM@// /^XFIXES_CFLAGS *=/s/@XFIXES_CFLAGS@// /^XDBE_LIBS *=/s/@XDBE_LIBS@// /^XDBE_CFLAGS *=/s/@XDBE_CFLAGS@// +/^XINPUT_LIBS *=/s/@XINPUT_LIBS@// +/^XINPUT_CFLAGS *=/s/@XINPUT_CFLAGS@// +/^XSYNC_LIBS *=/s/@XSYNC_LIBS@// +/^XSYNC_CFLAGS *=/s/@XSYNC_CFLAGS@// +/^WEBP_CFLAGS *=/s/@WEBP_CFLAGS@// +/^SQLITE3_LIBS *=/s/@SQLITE3_LIBS@// +/^HAIKU_LIBS *=/s/@HAIKU_LIBS@// +/^HAIKU_CFLAGS *=/s/@HAIKU_CFLAGS@// /^CYGWIN_OBJ *=/s/@CYGWIN_OBJ@// /^WINDOW_SYSTEM_OBJ *=/s/@WINDOW_SYSTEM_OBJ@// /^MSDOS_OBJ *=/s/= */= dosfns.o msdos.o w16select.o/ @@ -255,4 +269,4 @@ s| -I\$(top_srcdir)/lib|| s| -I\. -I\$(srcdir)| -I.| /^ *test "X/d /\$(CC) -o \$@.tmp/s/\$@.tmp/\$@/ -/mv \$@.tmp \$@/d \ No newline at end of file +/mv \$@.tmp \$@/d diff --git a/msdos/sedlibmk.inp b/msdos/sedlibmk.inp index 59ebec9e75..8602aaf449 100644 --- a/msdos/sedlibmk.inp +++ b/msdos/sedlibmk.inp @@ -268,6 +268,8 @@ s/@PACKAGE@/emacs/ # MKDIR_P lines are edited further below # MKDIR_P is only used to create lib/malloc, and the folder is # already present in the distribution, so this should work fine. +# (No longer true as of Emacs 29, but the directories we need +# are created in config.bat!) /^MKDIR_P *=/s/@MKDIR_P@/echo/ /^NEXT_AS_FIRST_DIRECTIVE_DIRENT_H *=/s/@[^@\n]*@// /^NEXT_AS_FIRST_DIRECTIVE_ERRNO_H *=/s/@[^@\n]*@// @@ -403,18 +405,19 @@ s/^ -*test -z.*|| rm/ -rm/ s/@echo /@djecho / # # Determine which headers to generate -s/= @GL_GENERATE_ALLOCA_H_TRUE@/= 1/ -s/= @GL_GENERATE_BYTESWAP_H@/= 1/ -s/= @GL_GENERATE_EXECINFO_H@/= 1/ -s/= @GL_GENERATE_IEEE754_H@/= 1/ -s/= @GL_GENERATE_STDALIGN_H@/= 1/ -s/= @GL_GENERATE_STDDEF_H@/= 1/ -s/= @GL_GENERATE_STDINT_H@/= 1/ -s/= @GL_GENERATE_LIMITS_H@/= 1/ -s/= @GL_GENERATE_ERRNO_H@/= / -s/= @GL_GENERATE_LIMITS_H@/= / -s/= @GL_GENERATE_GMP_GMP_H@/= 1/ -s/= @GL_GENERATE_MINI_GMP_H@/= 1/ +s/= @GL_GENERATE_ALLOCA_H_CONDITION@/= 1/ +s/= @GL_GENERATE_BYTESWAP_H_CONDITION@/= 1/ +s/= @GL_GENERATE_EXECINFO_H_CONDITION@/= 1/ +s/= @GL_GENERATE_IEEE754_H_CONDITION@/= 1/ +s/= @GL_GENERATE_STDALIGN_H_CONDITION@/= 1/ +s/= @GL_GENERATE_STDDEF_H_CONDITION@/= 1/ +s/= @GL_GENERATE_STDINT_H_CONDITION@/= 1/ +s/= @GL_GENERATE_LIMITS_H_CONDITION@/= 1/ +s/= @GL_GENERATE_ERRNO_H_CONDITION@/= / +s/= @GL_GENERATE_LIMITS_H_CONDITION@/= / +s/= @GL_GENERATE_GMP_H_CONDITION@/= 1/ +s/= @GL_GENERATE_GMP_GMP_H_CONDITION@/= / +s/= @GL_GENERATE_MINI_GMP_H_CONDITION@/= 1/ s/\$\(MKDIR_P\) malloc// # # Determine which modules to build and which to omit diff --git a/src/Makefile.in b/src/Makefile.in index 186e06735c..3353fb16d7 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -681,9 +681,9 @@ $(LIBEGNU_ARCHIVE): $(config_h) $(MAKE) -C $(dir $@) all ifeq ($(HAVE_PDUMPER),yes) - MAKE_PDUMPER_FINGERPRINT = $(libsrc)/make-fingerprint$(EXEEXT) +MAKE_PDUMPER_FINGERPRINT = $(libsrc)/make-fingerprint$(EXEEXT) else - MAKE_PDUMPER_FINGERPRINT = +MAKE_PDUMPER_FINGERPRINT = endif ## We have to create $(etc) here because init_cmdargs tests its diff --git a/src/conf_post.h b/src/conf_post.h index 0b6260b287..cee5a0878a 100644 --- a/src/conf_post.h +++ b/src/conf_post.h @@ -182,6 +182,20 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */ # define SIZE_MAX 4294967295U #endif +/* Things that lib/reg* wants. */ + +#define mbrtowc(pwc, s, n, ps) mbtowc ((pwc), (s), (n)) +#define wcrtomb(s, wc, ps) wctomb ((s), (wc)) +#define btowc(b) ((wchar_t) (b)) +#define towupper(chr) toupper (chr) +#define towlower(chr) tolower (chr) +#define iswalnum(chr) isalnum (chr) +#define wctype(name) ((wctype_t) 0) +#define iswctype(wc, type) false +#define mbsinit(ps) 1 + +#define MALLOC_0_IS_NONNULL 1 + /* We must intercept 'opendir' calls to stash away the directory name, so we could reuse it in readlinkat; see msdos.c. */ #define opendir sys_opendir commit bced4d26d99db9277284e4a37830d81172b82736 Author: Michael Albinus Date: Fri Feb 11 09:37:48 2022 +0100 Tolerate tilde in remote file names when needed * lisp/net/tramp.el (tramp-tolerate-tilde): New defvar. (tramp-handle-expand-file-name): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Respect it. * lisp/net/tramp-adb.el (tramp-adb-tolerate-tilde): * lisp/net/tramp-sshfs.el (tramp-sshfs-tolerate-tilde): New defuns. Advice `shell-mode' with them. (tramp-methods) : Add "-t -t" to `tramp-login-args'. diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 75e6b7179b..85cd2d9bc1 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -1364,6 +1364,24 @@ connection if a previous connection has died for some reason." `(:application tramp :protocol ,tramp-adb-method) 'tramp-adb-connection-local-default-shell-profile)) +;; `shell-mode' tries to open remote files like "/adb::~/.history". +;; This fails, because the tilde cannot be expanded. Tell +;; `tramp-handle-expand-file-name' to tolerate this. +(defun tramp-adb-tolerate-tilde (orig-fun) + "Advice for `shell-mode' to tolerate tilde in remote file names." + (let ((tramp-tolerate-tilde + (or tramp-tolerate-tilde + (equal (file-remote-p default-directory 'method) + tramp-adb-method)))) + (funcall orig-fun))) + +(add-function + :around (symbol-function #'shell-mode) #'tramp-adb-tolerate-tilde) +(add-hook 'tramp-adb-unload-hook + (lambda () + (remove-function + (symbol-function #'shell-mode) #'tramp-adb-tolerate-tilde))) + (add-hook 'tramp-unload-hook (lambda () (unload-feature 'tramp-adb 'force))) diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index d3634b0cc2..23290de685 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -1151,6 +1151,10 @@ file names." (replace-match (tramp-get-connection-property v "default-location" "~") nil t localname 1)))) + ;; Tilde expansion is not possible. + (when (and (not tramp-tolerate-tilde) + (string-match-p "\\`\\(~[^/]*\\)\\(.*\\)\\'" localname)) + (tramp-error v 'file-error "Cannot expand tilde in file `%s'" name)) (unless (tramp-run-real-handler #'file-name-absolute-p (list localname)) (setq localname (concat "/" localname))) ;; We do not pass "/..". @@ -1168,7 +1172,7 @@ file names." ;; Do normal `expand-file-name' (this does "/./" and "/../"), ;; unless there are tilde characters in file name. (tramp-make-tramp-file-name - v (if (string-match-p "\\`~" localname) + v (if (string-match-p "\\`\\(~[^/]*\\)\\(.*\\)\\'" localname) localname (tramp-run-real-handler #'expand-file-name (list localname))))))) diff --git a/lisp/net/tramp-sshfs.el b/lisp/net/tramp-sshfs.el index 72837793de..664dbc31b1 100644 --- a/lisp/net/tramp-sshfs.el +++ b/lisp/net/tramp-sshfs.el @@ -55,7 +55,8 @@ ;; These are for remote processes. (tramp-login-program "ssh") (tramp-login-args (("-q")("-l" "%u") ("-p" "%p") - ("-e" "none") ("%h") ("%l"))) + ("-e" "none") ("-t" "-t") + ("%h") ("%l"))) (tramp-direct-async t) (tramp-remote-shell ,tramp-default-remote-shell) (tramp-remote-shell-login ("-l")) @@ -411,6 +412,24 @@ connection if a previous connection has died for some reason." (with-tramp-connection-property vec "gid-string" (tramp-get-local-gid 'string))) +;; `shell-mode' tries to open remote files like "/sshfs:user@host:~/.history". +;; This fails, because the tilde cannot be expanded. Tell +;; `tramp-handle-expand-file-name' to tolerate this. +(defun tramp-sshfs-tolerate-tilde (orig-fun) + "Advice for `shell-mode' to tolerate tilde in remote file names." + (let ((tramp-tolerate-tilde + (or tramp-tolerate-tilde + (equal (file-remote-p default-directory 'method) + tramp-sshfs-method)))) + (funcall orig-fun))) + +(add-function + :around (symbol-function #'shell-mode) #'tramp-sshfs-tolerate-tilde) +(add-hook 'tramp-sshfs-unload-hook + (lambda () + (remove-function + (symbol-function #'shell-mode) #'tramp-sshfs-tolerate-tilde))) + (add-hook 'tramp-unload-hook (lambda () (unload-feature 'tramp-sshfs 'force))) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index f93ca7601a..32712efb3e 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -3458,6 +3458,10 @@ User is always nil." (if (file-directory-p dir) dir (file-name-directory dir)) nil (tramp-flush-directory-properties v localname))) +(defvar tramp-tolerate-tilde nil + "Indicator, that not expandable tilde shall be tolerated. +Let-bind it when necessary.") + (defun tramp-handle-expand-file-name (name &optional dir) "Like `expand-file-name' for Tramp files." ;; If DIR is not given, use DEFAULT-DIRECTORY or "/". @@ -3475,7 +3479,8 @@ User is always nil." (unless (tramp-run-real-handler #'file-name-absolute-p (list localname)) (setq localname (concat "/" localname))) ;; Tilde expansion is not possible. - (when (string-match-p "\\`\\(~[^/]*\\)\\(.*\\)\\'" localname) + (when (and (not tramp-tolerate-tilde) + (string-match-p "\\`\\(~[^/]*\\)\\(.*\\)\\'" localname)) (tramp-error v 'file-error "Cannot expand tilde in file `%s'" name)) ;; Do not keep "/..". (when (string-match-p "^/\\.\\.?$" localname) @@ -3486,7 +3491,9 @@ User is always nil." (let ((default-directory tramp-compat-temporary-file-directory)) (tramp-make-tramp-file-name v (tramp-drop-volume-letter - (tramp-run-real-handler #'expand-file-name (list localname)))))))) + (if (string-match-p "\\`\\(~[^/]*\\)\\(.*\\)\\'" localname) + localname + (tramp-run-real-handler #'expand-file-name (list localname))))))))) (defun tramp-handle-file-accessible-directory-p (filename) "Like `file-accessible-directory-p' for Tramp files." commit 985cdf8984a81653bb13d05e819d6f2bde096ecd Author: Eli Zaretskii Date: Fri Feb 11 10:15:20 2022 +0200 ; * etc/DEVEL.HUMOR: Add a recent joke. diff --git a/etc/DEVEL.HUMOR b/etc/DEVEL.HUMOR index 6db69bb4b5..bd51845cb1 100644 --- a/etc/DEVEL.HUMOR +++ b/etc/DEVEL.HUMOR @@ -188,3 +188,19 @@ wouldn't worry about it too much." "Kind of late, but thanks for letting us know. I've just revoked your write access to the repository for the obvious safety reasons," -- Bastien Guerry and Stefan Monnier + +---------------------------------------------------------------------- + + "I should have known better than to think I could be right and you +wrong about some Emacs code I've just started looking at. Sorry about +that." + + "No problem. It's one of the many joys of working on a code base +that's up to almost 40 years old: First you have to figure out what +the (no doubt smart) programmer meant to achieve with the code, and +then try to figure out whether it ever even did that, and then whether +it's still working the same way, and then whether it's still relevant +due to changes elsewhere, and then finally whether it can be improved +without breaking odd edge cases on obscure systems you don't have +access to. 🙃" + -- Ignacio Casso and Lars Ingebrigtsen