commit e547ca1f8953ebbcd3bb65acc6eac34335ab3826 (HEAD, refs/remotes/origin/master) Author: Po Lu Date: Tue Mar 15 04:46:01 2022 +0000 Fix some minor glitches with Haiku scroll bars * src/haiku_support.cc (MouseDown): Don't start overscroll if dragging started inside a button. diff --git a/src/haiku_support.cc b/src/haiku_support.cc index 27d4bbafaf..4bd801242a 100644 --- a/src/haiku_support.cc +++ b/src/haiku_support.cc @@ -1785,7 +1785,6 @@ class EmacsScrollBar : public BScrollBar if (buttons == B_PRIMARY_MOUSE_BUTTON) { - maybe_overscroll = true; r = ButtonRegionFor (HAIKU_SCROLL_BAR_UP_BUTTON); if (r.Contains (pt)) @@ -1813,6 +1812,8 @@ class EmacsScrollBar : public BScrollBar haiku_write (SCROLL_BAR_PART_EVENT, &part); goto out; } + + maybe_overscroll = true; } rq.dragging_p = 1; commit 90742d7b01366418f76d7bd08b19719901997903 Author: Po Lu Date: Tue Mar 15 12:14:56 2022 +0800 Fix crashes when trying to pop up a menu on GTK 2 * src/xterm.c (handle_one_xevent): Respect finish when dispatching copy. diff --git a/src/xterm.c b/src/xterm.c index e48592210f..fc90e37043 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -12533,15 +12533,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, if (popup_activated () && xev->evtype == XI_ButtonRelease) - { - *finish = X_EVENT_DROP; - gtk_main_do_event (copy); - gdk_event_free (copy); - goto XI_OTHER; - } - - gtk_main_do_event (copy); - gdk_event_free (copy); + goto XI_OTHER; #endif #ifdef HAVE_XINPUT2_1 @@ -13717,6 +13709,16 @@ handle_one_xevent (struct x_display_info *dpyinfo, } unblock_input (); #endif /* USE_X_TOOLKIT */ +#if defined USE_GTK && !defined HAVE_GTK3 && defined HAVE_XINPUT2 + if (*finish != X_EVENT_DROP && copy) + { + gtk_main_do_event (copy); + *finish = X_EVENT_DROP; + } + + if (copy) + gdk_event_free (copy); +#endif break; } commit 2bfa184e29b51e5c354935be19d8ea3432611190 Author: Po Lu Date: Tue Mar 15 12:09:45 2022 +0800 Fix some issues with input on GTK 2 builds * src/xfns.c (setup_xi_event_mask): Don't ask for XI key press on GTK 2. diff --git a/src/xfns.c b/src/xfns.c index a1d6fd29df..c8aefec8d7 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -3642,9 +3642,9 @@ setup_xi_event_mask (struct frame *f) #ifndef USE_GTK XISetMask (m, XI_FocusIn); XISetMask (m, XI_FocusOut); -#endif XISetMask (m, XI_KeyPress); XISetMask (m, XI_KeyRelease); +#endif XISelectEvents (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &mask, 1); commit 8cc8dfd67e44752667781602394962647afc795b Author: Po Lu Date: Tue Mar 15 10:28:54 2022 +0800 Fix extraneous ifdef in xwidgets code * xterm.c (handle_one_xevent): Pass GesturePinchEnd events to xwidgets regardless of no-longer-present define. diff --git a/src/xterm.c b/src/xterm.c index b198dab983..e48592210f 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -13611,7 +13611,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, case XI_GesturePinchEnd: { -#if defined HAVE_XWIDGETS && HAVE_USABLE_XI_GESTURE_PINCH_EVENT +#if defined HAVE_XWIDGETS XIGesturePinchEvent *pev = (XIGesturePinchEvent *) xi_event; struct xwidget_view *xvw = xwidget_view_from_window (pev->event); commit 299e47536173c62fc5edf1bd12baadc29d718674 Author: Po Lu Date: Tue Mar 15 10:24:13 2022 +0800 * src/xterm.c (handle_one_xevent): Fix use of wrong motion structure. diff --git a/src/xterm.c b/src/xterm.c index 71c0bd3dcd..b198dab983 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -11286,7 +11286,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, last_mouse_window = window; } - if (!x_note_mouse_movement (f, &event->xmotion)) + if (!x_note_mouse_movement (f, &xmotion)) help_echo_string = previous_help_echo_string; } else commit 3bf5c2a8381c9dac54c88c264091b94847abf1c3 Author: Po Lu Date: Tue Mar 15 08:54:30 2022 +0800 Stop relying on dynlib for PGTK interrupt input * src/pgtkterm.c (pgtk_term_init): Use dlopen and dlsym directly instead of dynlib functions. (bug#54378) diff --git a/src/pgtkterm.c b/src/pgtkterm.c index abcf18e11d..9f9768cf2a 100644 --- a/src/pgtkterm.c +++ b/src/pgtkterm.c @@ -36,6 +36,8 @@ along with GNU Emacs. If not, see . */ #include #include +#include + #include "lisp.h" #include "blockinput.h" #include "frame.h" @@ -47,7 +49,6 @@ along with GNU Emacs. If not, see . */ #include "fontset.h" #include "composite.h" #include "ccl.h" -#include "dynlib.h" #include "termhooks.h" #include "termopts.h" @@ -6545,8 +6546,8 @@ pgtk_term_init (Lisp_Object display_name, char *resource_name) static int x_initialized = 0; static unsigned x_display_id = 0; static char *initial_display = NULL; - static dynlib_handle_ptr *handle = NULL; char *dpy_name; + static void *handle = NULL; Lisp_Object lisp_dpy_name = Qnil; block_input (); @@ -6720,15 +6721,15 @@ pgtk_term_init (Lisp_Object display_name, char *resource_name) dpyinfo->connection = -1; if (!handle) - handle = dynlib_open (NULL); + handle = dlopen (NULL, RTLD_LAZY); #ifdef GDK_WINDOWING_X11 if (!strcmp (G_OBJECT_TYPE_NAME (dpy), "GdkX11Display") && handle) { void *(*gdk_x11_display_get_xdisplay) (GdkDisplay *) - = dynlib_sym (handle, "gdk_x11_display_get_xdisplay"); + = dlsym (handle, "gdk_x11_display_get_xdisplay"); int (*x_connection_number) (void *) - = dynlib_sym (handle, "XConnectionNumber"); + = dlsym (handle, "XConnectionNumber"); if (x_connection_number && gdk_x11_display_get_xdisplay) @@ -6742,7 +6743,7 @@ pgtk_term_init (Lisp_Object display_name, char *resource_name) { struct wl_display *wl_dpy = gdk_wayland_display_get_wl_display (dpy); int (*display_get_fd) (struct wl_display *) - = dynlib_sym (handle, "wl_display_get_fd"); + = dlsym (handle, "wl_display_get_fd"); if (display_get_fd) dpyinfo->connection = display_get_fd (wl_dpy); commit e56eb02a256a9875dedb2d9bba11b1eff7f487f8 Author: Thomas Fitzsimmons Date: Mon Mar 14 17:33:42 2022 -0400 EUDC: Fix a bug and some docstrings * lisp/net/eudc.el (eudc-register-protocol): Add doc string. (eudc-expand-inline): Add TRY-ALL-SERVERS to docstring. (eudc-query-with-words): Fix early-return bug reported by Alexander Adolf. (eudc-menu): Add doc string. (eudc-install-menu): Likewise. diff --git a/lisp/net/eudc.el b/lisp/net/eudc.el index 98d0565c2f..7bbf54ee6c 100644 --- a/lisp/net/eudc.el +++ b/lisp/net/eudc.el @@ -298,8 +298,8 @@ accordingly. Otherwise it is set to its EUDC default binding." ;;}}} -;; Add PROTOCOL to the list of supported protocols (defun eudc-register-protocol (protocol) + "Add PROTOCOL to the list of supported protocols." (unless (memq protocol eudc-supported-protocols) (setq eudc-supported-protocols (cons protocol eudc-supported-protocols)) @@ -764,7 +764,8 @@ If SAVE-QUERY-AS-KILL is non-nil, then save the pre-expansion text to the kill ring. `eudc-expansion-save-query-as-kill' being non-nil inverts the meaning of SAVE-QUERY-AS-KILL. Multiple servers can be tried with the same query until one finds a match, -see `eudc-inline-expansion-servers'." +see `eudc-inline-expansion-servers'. If TRY-ALL-SERVERS is +non-nil, collect results from all servers." (interactive) (let* ((end (point)) (beg (save-excursion @@ -853,22 +854,22 @@ keep collecting results from subsequent servers after the first match." (eudc-format-query query-words (car query-formats)) (eudc-translate-attribute-list (cdr eudc-inline-expansion-format))))) - (if response - ;; Process response through eudc-inline-expansion-format. - (dolist (r response) - (let ((response-string - (apply #'format - (car eudc-inline-expansion-format) - (mapcar - (lambda (field) - (or (cdr (assq field r)) - "")) - (eudc-translate-attribute-list - (cdr eudc-inline-expansion-format)))))) - (if (> (length response-string) 0) - (push response-string response-strings)) - (when (not try-all-servers) - (throw 'found nil)))))))) + (when response + ;; Process response through eudc-inline-expansion-format. + (dolist (r response) + (let ((response-string + (apply #'format + (car eudc-inline-expansion-format) + (mapcar + (lambda (field) + (or (cdr (assq field r)) + "")) + (eudc-translate-attribute-list + (cdr eudc-inline-expansion-format)))))) + (if (> (length response-string) 0) + (push response-string response-strings)))) + (when (not try-all-servers) + (throw 'found nil)))))) (catch 'found ;; Loop on the servers. (dolist (server servers) @@ -1103,6 +1104,7 @@ queries the server for the existing fields and displays a corresponding form." :help "Set the directory server to SERVER using PROTOCOL"])) (defun eudc-menu () + "Return easy menu for EUDC." (let (command) (append '("Directory Servers") (list @@ -1134,6 +1136,7 @@ queries the server for the existing fields and displays a corresponding form." eudc-tail-menu))) (defun eudc-install-menu () + "Install EUDC menu." (define-key global-map [menu-bar tools directory-search] commit 5c13c33e0c1b8b2ada18896e7a74b4d31007b09e Author: Paul Eggert Date: Mon Mar 14 13:14:23 2022 -0700 Another fix for the no-toolkit build This should be better in the long run. * oldXMenu/Activate.c (XMenuActivate): Revert previous change, eliminating the goto it introduced. * oldXMenu/XMenuInt.h: Include , for FALLTHROUGH. diff --git a/oldXMenu/Activate.c b/oldXMenu/Activate.c index 410782e60a..e679c2ffed 100644 --- a/oldXMenu/Activate.c +++ b/oldXMenu/Activate.c @@ -615,8 +615,8 @@ XMenuActivate( event.xbutton.window ); if (event_xmp != NULL) continue; - - queue: + FALLTHROUGH; + default: /* * This is a foreign event. * Queue it for later return to the X event queue. @@ -629,9 +629,6 @@ XMenuActivate( feq_tmp->event = event; feq_tmp->next = feq; feq = feq_tmp; - break; - default: - goto queue; } } /* diff --git a/oldXMenu/XMenuInt.h b/oldXMenu/XMenuInt.h index 86b8e057cd..5d5365ad8f 100644 --- a/oldXMenu/XMenuInt.h +++ b/oldXMenu/XMenuInt.h @@ -37,6 +37,8 @@ without express or implied warranty. #include +#include + /* Avoid warnings about redefining NULL by including first; the other file which wants to define it ( on Ultrix systems) can deal if NULL is already defined, but can't. */ commit 0d0703e9c4fb5ebcd4a87e5ebe78e5f53496621e Author: Paul Eggert Date: Mon Mar 14 08:55:46 2022 -0700 Prefer CALLN * src/bytecode.c (Fbyte_code): * src/composite.c (Fclear_composition_cache): Prefer CALLN to doing it by hand. * src/fns.c (ccall2): Remove. All uses replaced by CALLN. diff --git a/src/bytecode.c b/src/bytecode.c index 8704e6069d..65c3ad4da7 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -325,8 +325,8 @@ If the third argument is incorrect, Emacs may crash. */) the original unibyte form. */ bytestr = Fstring_as_unibyte (bytestr); } - Lisp_Object args[] = {0, bytestr, vector, maxdepth}; - return exec_byte_code (Fmake_byte_code (4, args), 0, 0, NULL); + Lisp_Object fun = CALLN (Fmake_byte_code, 0, bytestr, vector, maxdepth); + return exec_byte_code (fun, 0, 0, NULL); } static void diff --git a/src/composite.c b/src/composite.c index 3659de8900..c2ade90d54 100644 --- a/src/composite.c +++ b/src/composite.c @@ -704,8 +704,8 @@ DEFUN ("clear-composition-cache", Fclear_composition_cache, Clear composition cache. */) (void) { - Lisp_Object args[] = {QCtest, Qequal, QCsize, make_fixnum (311)}; - gstring_hash_table = CALLMANY (Fmake_hash_table, args); + gstring_hash_table = CALLN (Fmake_hash_table, QCtest, Qequal, + QCsize, make_fixnum (311)); /* Fixme: We call Fclear_face_cache to force complete re-building of display glyphs. But, it may be better to call this function from Fclear_face_cache instead. */ diff --git a/src/fns.c b/src/fns.c index 06a6456380..e8cf185755 100644 --- a/src/fns.c +++ b/src/fns.c @@ -55,14 +55,6 @@ DEFUN ("identity", Fidentity, Sidentity, 1, 1, 0, return argument; } -static Lisp_Object -ccall2 (Lisp_Object (f) (ptrdiff_t nargs, Lisp_Object *args), - Lisp_Object arg1, Lisp_Object arg2) -{ - Lisp_Object args[2] = {arg1, arg2}; - return f (2, args); -} - static Lisp_Object get_random_bignum (Lisp_Object limit) { @@ -81,9 +73,9 @@ get_random_bignum (Lisp_Object limit) EMACS_INT rand = get_random () >> 1; Lisp_Object lrand = make_fixnum (rand); bits += bitsperiteration; - val = ccall2 (Flogior, - Fash (val, make_fixnum (bitsperiteration)), - lrand); + val = CALLN (Flogior, + Fash (val, make_fixnum (bitsperiteration)), + lrand); lim = Fash (lim, make_fixnum (- bitsperiteration)); } while (!EQ (lim, make_fixnum (0))); @@ -91,11 +83,11 @@ get_random_bignum (Lisp_Object limit) get_random returns a number so close to INTMASK that the remainder isn't random. */ Lisp_Object remainder = Frem (val, limit); - if (!NILP (ccall2 (Fleq, - ccall2 (Fminus, val, remainder), - ccall2 (Fminus, - Fash (make_fixnum (1), make_fixnum (bits)), - limit)))) + if (!NILP (CALLN (Fleq, + CALLN (Fminus, val, remainder), + CALLN (Fminus, + Fash (make_fixnum (1), make_fixnum (bits)), + limit)))) return remainder; } } commit f52dcfd03ad542704d9a43faab0c33be09ab442e Author: Sam Steingold Date: Fri Mar 11 13:59:46 2022 -0500 New command `gnus-summary-browse-all-urls' bound to "v" * lisp/gnus-sum.el (gnus-collect-urls-from-article): New function, extracted from `gnus-summary-browse-url'. (gnus-summary-browse-url): Use it; also use `browse-url-button-open-url' to handle the prefix argument. (gnus-summary-browse-all-urls): New command. (gnus-summary-mode-map): Bind `gnus-summary-browse-all-urls' to "v". diff --git a/etc/NEWS b/etc/NEWS index d6b5da3902..fc6c8b8254 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -699,6 +699,11 @@ displayed as emojis. Default nil. This is bound to 'W D e' and will display symbols that have emoji representation as emojis. ++++ +*** New command 'gnus-summary-browse-all-urls'. +This is for the rare cases when you want to open _all_ the URLs in the +article, and is bound to "v". + ** EIEIO +++ diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 1be5a48068..098d3a067d 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -2010,6 +2010,7 @@ increase the score of each group you read." "s" #'gnus-summary-isearch-article "TAB" #'gnus-summary-button-forward "" #'gnus-summary-button-backward + "v" #'gnus-summary-browse-all-urls "w" #'gnus-summary-browse-url "t" #'gnus-summary-toggle-header "g" #'gnus-summary-show-article @@ -2196,6 +2197,7 @@ increase the score of each group you read." "s" #'gnus-summary-isearch-article "TAB" #'gnus-summary-button-forward "" #'gnus-summary-button-backward + "v" #'gnus-summary-browse-all-urls "w" #'gnus-summary-browse-url "P" #'gnus-summary-print-article "S" #'gnus-sticky-article @@ -9445,6 +9447,16 @@ The 1st element is the button named by `gnus-collect-urls-primary-text'." (push primary urls)) (delete-dups urls))) +(defun gnus-collect-urls-from-article () + "Select the article and return the list of URLs in it. +See 'gnus-collect-urls'." + (gnus-summary-select-article) + (gnus-with-article-buffer + (article-goto-body) + ;; Back up a char, in case body starts with a button. + (backward-char) + (gnus-collect-urls))) + (defun gnus-shorten-url (url max) "Return an excerpt from URL not exceeding MAX characters." (if (<= (length url) max) @@ -9456,37 +9468,38 @@ The 1st element is the button named by `gnus-collect-urls-primary-text'." (concat "#" target))))) (concat host (string-truncate-left rest (- max (length host))))))) -(defun gnus-summary-browse-url (&optional external) +(defun gnus-summary-browse-url (&optional _external) "Scan the current article body for links, and offer to browse them. Links are opened using `browse-url' unless a prefix argument is -given: Then `browse-url-secondary-browser-function' is used instead. +given: then `browse-url-secondary-browser-function' is used instead. If only one link is found, browse that directly, otherwise use completion to select a link. The first link marked in the article text with `gnus-collect-urls-primary-text' is the default." (interactive "P" gnus-summary-mode) - (let (urls target) - (gnus-summary-select-article) - (gnus-with-article-buffer - (article-goto-body) - ;; Back up a char, in case body starts with a button. - (backward-char) - (setq urls (gnus-collect-urls)) - (setq target - (cond ((= (length urls) 1) - (car urls)) - ((> (length urls) 1) - (completing-read - (format-prompt "URL to browse" - (gnus-shorten-url (car urls) 40)) - urls nil t nil nil (car urls))))) - (if target - (if external - (funcall browse-url-secondary-browser-function target) - (browse-url target)) - (message "No URLs found."))))) + (let* ((urls (gnus-collect-urls-from-article)) + (target + (cond ((= (length urls) 1) + (car urls)) + ((> (length urls) 1) + (completing-read + (format-prompt "URL to browse" + (gnus-shorten-url (car urls) 40)) + urls nil t nil nil (car urls)))))) + (if target + (browse-url-button-open-url target) ; this handles the prefix arg + (message "No URLs found.")))) + +(defun gnus-summary-browse-all-urls (&optional _external) + "Scan the current article body for links, and browse them. + +Links are opened using `browse-url' unless a prefix argument is +given: then `browse-url-secondary-browser-function' is used instead." + (interactive "P" gnus-summary-mode) + (dolist (url (gnus-collect-urls-from-article)) + (browse-url-button-open-url url))) ; this handles the prefix arg (defun gnus-summary-isearch-article (&optional regexp-p) "Do incremental search forward on the current article. commit a359a9dfd4439f2d8bf8c2fe1b9862ab00d69b6c Author: Po Lu Date: Mon Mar 14 21:48:47 2022 +0800 Fix the no toolkit build * Activate.c (XMenuActivate): Stop relying on fallthroughs inside switch statement. (bug#54382) diff --git a/oldXMenu/Activate.c b/oldXMenu/Activate.c index e679c2ffed..410782e60a 100644 --- a/oldXMenu/Activate.c +++ b/oldXMenu/Activate.c @@ -615,8 +615,8 @@ XMenuActivate( event.xbutton.window ); if (event_xmp != NULL) continue; - FALLTHROUGH; - default: + + queue: /* * This is a foreign event. * Queue it for later return to the X event queue. @@ -629,6 +629,9 @@ XMenuActivate( feq_tmp->event = event; feq_tmp->next = feq; feq = feq_tmp; + break; + default: + goto queue; } } /* commit 2f2bb883da3553e99509de5fd35c195d78dac730 Author: Lars Ingebrigtsen Date: Mon Mar 14 14:46:25 2022 +0100 Fix RFC2047 encoding of Disposition-Notification-To * lisp/mail/rfc2047.el (rfc2047-header-encoding-alist): Encode Disposition-Notification-To as an address header (bug#54383). diff --git a/lisp/mail/rfc2047.el b/lisp/mail/rfc2047.el index b3c45100f6..bb0d646346 100644 --- a/lisp/mail/rfc2047.el +++ b/lisp/mail/rfc2047.el @@ -46,7 +46,7 @@ ("Followup-To" . nil) ("Message-ID" . nil) ("\\(Resent-\\)?\\(From\\|Cc\\|To\\|Bcc\\|\\(In-\\)?Reply-To\\|Sender\ -\\|Mail-Followup-To\\|Mail-Copies-To\\|Approved\\)" . address-mime) +\\|Mail-Followup-To\\|Mail-Copies-To\\|Approved\\|Disposition-Notification-To\\)" . address-mime) (t . mime)) "Header/encoding method alist. The list is traversed sequentially. The keys can either be commit b72dd3d0c59d4174a779b97e310b8d2029d0736a Author: Po Lu Date: Mon Mar 14 21:37:42 2022 +0800 Handle position specification hints on X toolkit builds * src/xterm.c (x_wm_set_size_hint): Set PPosition and USPosition independently of Xt. diff --git a/src/xterm.c b/src/xterm.c index 06cb933209..71c0bd3dcd 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -578,6 +578,7 @@ along with GNU Emacs. If not, see . */ #ifdef USE_X_TOOLKIT #include +#include #endif #include @@ -16762,6 +16763,9 @@ x_wm_set_size_hint (struct frame *f, long flags, bool user_position) { XSizeHints size_hints; Window window = FRAME_OUTER_WINDOW (f); +#ifdef USE_X_TOOLKIT + WMShellWidget shell; +#endif if (!window) return; @@ -16769,8 +16773,63 @@ x_wm_set_size_hint (struct frame *f, long flags, bool user_position) #ifdef USE_X_TOOLKIT if (f->output_data.x->widget) { + /* Do this dance in xterm.c because some stuff is not as easily + available in widget.c. */ + + eassert (XtIsWMShell (f->output_data.x->widget)); + shell = (WMShellWidget) f->output_data.x->widget; + + shell->wm.size_hints.flags &= ~(PPosition | USPosition); + shell->wm.size_hints.flags |= flags & (PPosition | USPosition); + + if (user_position) + { + shell->wm.size_hints.flags &= ~PPosition; + shell->wm.size_hints.flags |= USPosition; + } + widget_update_wm_size_hints (f->output_data.x->widget, f->output_data.x->edit_widget); + +#ifdef USE_MOTIF + /* Do this all over again for the benefit of Motif, which always + knows better than the programmer. */ + shell->wm.size_hints.flags &= ~(PPosition | USPosition); + shell->wm.size_hints.flags |= flags & (PPosition | USPosition); + + if (user_position) + { + shell->wm.size_hints.flags &= ~PPosition; + shell->wm.size_hints.flags |= USPosition; + } + + /* Drill hints into Motif, since it keeps setting its own. */ + size_hints.flags = shell->wm.size_hints.flags; + size_hints.x = shell->wm.size_hints.x; + size_hints.y = shell->wm.size_hints.y; + size_hints.width = shell->wm.size_hints.width; + size_hints.height = shell->wm.size_hints.height; + size_hints.min_width = shell->wm.size_hints.min_width; + size_hints.min_height = shell->wm.size_hints.min_height; + size_hints.max_width = shell->wm.size_hints.max_width; + size_hints.max_height = shell->wm.size_hints.max_height; + size_hints.width_inc = shell->wm.size_hints.width_inc; + size_hints.height_inc = shell->wm.size_hints.height_inc; + size_hints.min_aspect.x = shell->wm.size_hints.min_aspect.x; + size_hints.min_aspect.y = shell->wm.size_hints.min_aspect.y; + size_hints.max_aspect.x = shell->wm.size_hints.max_aspect.x; + size_hints.max_aspect.y = shell->wm.size_hints.max_aspect.y; +#ifdef HAVE_X11XTR6 + size_hints.base_width = shell->wm.base_width; + size_hints.base_height = shell->wm.base_height; + size_hints.win_gravity = shell->wm.win_gravity; +#endif + + XSetWMNormalHints (XtDisplay (f->output_data.x->widget), + XtWindow (f->output_data.x->widget), + &size_hints); +#endif + return; } #endif commit 5d33f815422e8203297779c6ebedfff922e4ffc7 Author: Stefan Monnier Date: Mon Mar 14 09:28:18 2022 -0400 * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Simplify Edebug spec diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 9fd3350ddd..0d0b5b5158 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -2901,19 +2901,10 @@ To see the documentation for a defined struct type, use (debug (&define ;Makes top-level form not be wrapped. [&or symbolp - (gate + (gate ;; FIXME: Why? symbolp &rest - [&or symbolp - (&or [":conc-name" symbolp] - [":constructor" symbolp &optional cl-lambda-list] - [":copier" symbolp] - [":predicate" symbolp] - [":include" symbolp &rest sexp] ;; Not finished. - [":print-function" sexp] - [":type" symbolp] - [":noinline" &optional sexp] - [":named" &optional sexp] - [":initial-offset" natnump])])] + [&or (":constructor" &define name &optional cl-lambda-list) + sexp])] [&optional stringp] ;; All the above is for the following def-form. &rest &or symbolp (symbolp &optional def-form &rest sexp)))) commit f8cc706fb3d1ba30715c09aac9654ba08aeeb5c9 Author: Lars Ingebrigtsen Date: Mon Mar 14 12:16:27 2022 +0100 Improve the execute-kbd-macro doc string * src/macros.c (Fexecute_kbd_macro): Improve the doc string (bug#14206). diff --git a/src/macros.c b/src/macros.c index 0447a367fd..6b6865d929 100644 --- a/src/macros.c +++ b/src/macros.c @@ -273,9 +273,15 @@ pop_kbd_macro (Lisp_Object info) } DEFUN ("execute-kbd-macro", Fexecute_kbd_macro, Sexecute_kbd_macro, 1, 3, 0, - doc: /* Execute MACRO as string of editor command characters. -MACRO can also be a vector of keyboard events. If MACRO is a symbol, -its function definition is used. + doc: /* Execute MACRO as a sequence of events. +If MACRO is a string or vector, then the events in it are executed +exactly as if they had been input by the user. + +If MACRO is a symbol, its function definition is used. If that is +another symbol, this process repeats. Eventually the result should be +a string or vector. If the result is not a symbol, string, or vector, +an error is signaled. + COUNT is a repeat count, or nil for once, or 0 for infinite loop. Optional third arg LOOPFUNC may be a function that is called prior to commit f3df7916b2b342380930082cf35bad6cb488a4dc Author: Philipp Stephani Date: Mon Mar 14 10:59:03 2022 +0100 Make Edebug specification for 'cl-defstruct' more lenient. For example, 'xref-item' uses the list form of ':noinline'. * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Accept ':noinline' and ':named' with an argument. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-defstruct/edebug): New unit test. diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 4b231d8149..9fd3350ddd 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -2911,7 +2911,8 @@ To see the documentation for a defined struct type, use [":include" symbolp &rest sexp] ;; Not finished. [":print-function" sexp] [":type" symbolp] - [":named"] + [":noinline" &optional sexp] + [":named" &optional sexp] [":initial-offset" natnump])])] [&optional stringp] ;; All the above is for the following def-form. diff --git a/test/lisp/emacs-lisp/cl-macs-tests.el b/test/lisp/emacs-lisp/cl-macs-tests.el index 036ee30966..19ede627a1 100644 --- a/test/lisp/emacs-lisp/cl-macs-tests.el +++ b/test/lisp/emacs-lisp/cl-macs-tests.el @@ -709,4 +709,22 @@ collection clause." ;; Just make sure the forms can be instrumented. (eval-buffer)))) +(ert-deftest cl-defstruct/edebug () + "Check that we can instrument `cl-defstruct' forms." + (with-temp-buffer + (dolist (form '((cl-defstruct cl-defstruct/edebug/1) + (cl-defstruct (cl-defstruct/edebug/2 + :noinline)) + (cl-defstruct (cl-defstruct/edebug/3 + (:noinline t))) + (cl-defstruct (cl-defstruct/edebug/4 + :named)) + (cl-defstruct (cl-defstruct/edebug/5 + (:named t))))) + (print form (current-buffer))) + (let ((edebug-all-defs t) + (edebug-initial-mode 'Go-nonstop)) + ;; Just make sure the forms can be instrumented. + (eval-buffer)))) + ;;; cl-macs-tests.el ends here commit 637dde4aba921435f78d0de769ad74c4f3230aa6 Author: Lars Ingebrigtsen Date: Mon Mar 14 10:27:12 2022 +0100 Don't always escape "." and "?" in `prin1' * src/print.c (print_object): Only escape "." and "?" when appearing as the first character in a symbol (bug#23130). diff --git a/etc/NEWS b/etc/NEWS index b1aac3d6d0..d6b5da3902 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1076,6 +1076,22 @@ Emacs buffers, like indentation and the like. The new ert function * Incompatible Lisp Changes in Emacs 29.1 +--- +** 'prin1' doesn't always escape "." and "?" in symbols any more. +Previously, symbols like 'foo.bar' would be printed by 'prin1' as +"foo\.bar". This now prints as "foo.bar" instead. The Emacs Lisp +reader interprets these strings as referring to the same symbol, so +this is virtually always backwards-compatible, but there may +theoretically be code out there that expects a specific printed +representation. + +The same is the case with the "?" character: The 'foo?' symbol is now +printed as "foo?" instead of "foo\?". + +If the "." and "?" characters are the first character in the symbol, +they will still be escaped, so the '.foo' symbol is still printed as +"\.foo" and the '?bar' symbol is still printed as "\?bar". + +++ ** Remapping 'mode-line' no longer works as expected. 'mode-line' is now the parent face of the new 'mode-line-active' face, diff --git a/src/print.c b/src/print.c index 8cce8a1ad8..704fc278f2 100644 --- a/src/print.c +++ b/src/print.c @@ -2171,14 +2171,19 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag) Lisp_Object name = SYMBOL_NAME (obj); ptrdiff_t size_byte = SBYTES (name); - /* Set CONFUSING if NAME looks like a number, calling - string_to_number for non-obvious cases. */ char *p = SSDATA (name); bool signedp = *p == '-' || *p == '+'; ptrdiff_t len; - bool confusing = ((c_isdigit (p[signedp]) || p[signedp] == '.') - && !NILP (string_to_number (p, 10, &len)) - && len == size_byte); + bool confusing = + /* Set CONFUSING if NAME looks like a number, calling + string_to_number for non-obvious cases. */ + ((c_isdigit (p[signedp]) || p[signedp] == '.') + && !NILP (string_to_number (p, 10, &len)) + && len == size_byte) + /* We don't escape "." or "?" (unless they're the first + character in the symbol name). */ + || *p == '?' + || *p == '.'; if (! NILP (Vprint_gensym) && !SYMBOL_INTERNED_IN_INITIAL_OBARRAY_P (obj)) @@ -2201,8 +2206,8 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag) { if (c == '\"' || c == '\\' || c == '\'' || c == ';' || c == '#' || c == '(' || c == ')' - || c == ',' || c == '.' || c == '`' - || c == '[' || c == ']' || c == '?' || c <= 040 + || c == ',' || c == '`' + || c == '[' || c == ']' || c <= 040 || c == NO_BREAK_SPACE || confusing) { diff --git a/test/src/print-tests.el b/test/src/print-tests.el index 1ef0caf1a4..0bae1959d1 100644 --- a/test/src/print-tests.el +++ b/test/src/print-tests.el @@ -417,5 +417,13 @@ otherwise, use a different charset." t))) (should (equal (prin1-to-string (make-marker)) "")))) +(ert-deftest test-dots () + (should (equal (prin1-to-string 'foo.bar) "foo.bar")) + (should (equal (prin1-to-string '.foo) "\\.foo")) + (should (equal (prin1-to-string '.foo.) "\\.foo.")) + (should (equal (prin1-to-string 'bar?bar) "bar?bar")) + (should (equal (prin1-to-string '\?bar) "\\?bar")) + (should (equal (prin1-to-string '\?bar?) "\\?bar?"))) + (provide 'print-tests) ;;; print-tests.el ends here commit 15c61cb359bc0021f14fbcc5a2e0eb71fe0261ab Author: Martin Rudalics Date: Mon Mar 14 10:26:36 2022 +0100 Init 'rest' in 'balance-windows-2' (Bug#54380) * lisp/window.el (balance-windows-2): Give 'rest' an initial value (Bug#54380). diff --git a/lisp/window.el b/lisp/window.el index 54c9eee5f3..dd297a3169 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -5698,12 +5698,12 @@ right, if any." ;;; Balancing windows. ;; The following routine uses the recycled code from an old version of -;; `window--resize-child-windows'. It's not very pretty, but coding it the way the -;; new `window--resize-child-windows' code does would hardly make it any shorter or -;; more readable (FWIW we'd need three loops - one to calculate the -;; minimum sizes per window, one to enlarge or shrink windows until the -;; new parent-size matches, and one where we shrink the largest/enlarge -;; the smallest window). +;; `window--resize-child-windows'. It's not very pretty, but coding it +;; the way the new `window--resize-child-windows' code does would hardly +;; make it any shorter or more readable (FWIW we'd need three loops - +;; one to calculate the minimum sizes per window, one to enlarge or +;; shrink windows until the new parent-size matches, and one where we +;; shrink the largest/enlarge the smallest window). (defun balance-windows-2 (window horizontal) "Subroutine of `balance-windows-1'. WINDOW must be a vertical combination (horizontal if HORIZONTAL @@ -5714,9 +5714,10 @@ is non-nil)." (first (window-child window)) (sub first) (number-of-children 0) + (rest 0) (parent-size (window-new-pixel window)) (total-sum parent-size) - failed size sub-total sub-delta sub-amount rest) + failed size sub-total sub-delta sub-amount) (while sub (if (window-size-fixed-p sub horizontal) (progn