commit 35bf8d4a025baa8da2affa3cff5a0f426889096f (HEAD, refs/remotes/origin/master) Merge: aad91285c3 69e82968d7 Author: Stefan Kangas Date: Thu Feb 10 06:56:22 2022 +0100 Merge from origin/emacs-28 69e82968d7 Fix integer arithmetic miss-compilation (bug#53451) 31af9bca99 Mark flymake as compatible with emacs-26.1 commit aad91285c370dd5e50e585b453b9a843113be15f Author: Po Lu Date: Thu Feb 10 13:36:24 2022 +0800 Fix disconnect errors on some X servers * src/xfns.c (x_make_gc): Don't set FillOpaqueStippled on cursor GC. The reason is that some X servers break on such a fill style if the operation being performed is not a stiple operation. diff --git a/src/xfns.c b/src/xfns.c index a41ed62d5f..58f5cb847b 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -4055,11 +4055,9 @@ x_make_gc (struct frame *f) /* Cursor has cursor-color background, background-color foreground. */ gc_values.foreground = FRAME_BACKGROUND_PIXEL (f); gc_values.background = f->output_data.x->cursor_pixel; - gc_values.fill_style = FillOpaqueStippled; f->output_data.x->cursor_gc = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_DRAWABLE (f), - (GCForeground | GCBackground - | GCFillStyle | GCLineWidth), + (GCForeground | GCBackground | GCLineWidth), &gc_values); /* Create the gray border tile used when the pointer is not in commit 0653a58380742acbaf42c605341ef303a4c8365d Author: Po Lu Date: Thu Feb 10 12:57:47 2022 +0800 Fill in missing pixel after PolyLine on scroll bars * src/xterm.c (x_scroll_bar_expose): Draw bottom right corner of scroll bar manually. diff --git a/src/xterm.c b/src/xterm.c index abfad61041..bd0fdde01e 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -8440,6 +8440,9 @@ x_scroll_bar_expose (struct scroll_bar *bar, const XEvent *event) /* x, y, width, height */ 0, 0, bar->width - 1, bar->height - 1); + XDrawPoint (FRAME_X_DISPLAY (f), w, gc, + bar->width - 1, bar->height - 1); + /* Restore the foreground color of the GC if we changed it above. */ if (f->output_data.x->scroll_bar_foreground_pixel != -1) XSetForeground (FRAME_X_DISPLAY (f), gc, commit c867a43872e6ac7830bad8842918f337c480c9c5 Author: Po Lu Date: Thu Feb 10 03:25:19 2022 +0000 * src/haikugui.h [_cplusplus]: Remove extern "C" declarations. These were left over from an old implementation strategy abandoned long before the port was installed. diff --git a/src/haikugui.h b/src/haikugui.h index b744885a42..a6cf3a4e6c 100644 --- a/src/haikugui.h +++ b/src/haikugui.h @@ -19,11 +19,6 @@ along with GNU Emacs. If not, see . */ #ifndef _HAIKU_GUI_H_ #define _HAIKU_GUI_H_ -#ifdef _cplusplus -extern "C" -{ -#endif - typedef struct haiku_char_struct { int rbearing; @@ -100,7 +95,4 @@ typedef haiku Drawable; typedef haiku Window; typedef int Display; -#ifdef _cplusplus -}; -#endif #endif /* _HAIKU_GUI_H_ */ commit f9a7a81cde41bacd63d280700089cc95490e4bea Author: Po Lu Date: Thu Feb 10 10:21:15 2022 +0800 Improve reliability of hotplugging window managers * src/xterm.c (x_make_frame_visible): Change the user time window if the window manager supports something different from what it did the first time the frame was made visible. diff --git a/src/xterm.c b/src/xterm.c index 5b97da36ba..abfad61041 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -14534,21 +14534,36 @@ x_make_frame_visible (struct frame *f) #ifndef USE_GTK output = FRAME_X_OUTPUT (f); - if (output->user_time_window == None) + if (!x_wm_supports (f, dpyinfo->Xatom_net_wm_user_time_window)) { - XSetWindowAttributes attrs; - memset (&attrs, 0, sizeof attrs); - - output->user_time_window - = FRAME_OUTER_WINDOW (f); - - if (x_wm_supports (f, dpyinfo->Xatom_net_wm_user_time_window)) + if (output->user_time_window == None) + output->user_time_window = FRAME_OUTER_WINDOW (f); + else if (output->user_time_window != FRAME_OUTER_WINDOW (f)) + { + XDestroyWindow (dpyinfo->display, + output->user_time_window); + XDeleteProperty (dpyinfo->display, + FRAME_OUTER_WINDOW (f), + dpyinfo->Xatom_net_wm_user_time_window); + output->user_time_window = FRAME_OUTER_WINDOW (f); + } + } + else + { + if (output->user_time_window == FRAME_OUTER_WINDOW (f) + || output->user_time_window == None) { + XSetWindowAttributes attrs; + memset (&attrs, 0, sizeof attrs); + output->user_time_window = XCreateWindow (dpyinfo->display, FRAME_X_WINDOW (f), -1, -1, 1, 1, 0, 0, InputOnly, CopyFromParent, 0, &attrs); + XDeleteProperty (dpyinfo->display, + FRAME_OUTER_WINDOW (f), + dpyinfo->Xatom_net_wm_user_time); XChangeProperty (dpyinfo->display, FRAME_OUTER_WINDOW (f), dpyinfo->Xatom_net_wm_user_time_window, commit 8df3052bdb18d000cd1726eabde2b1a30f6b10f0 Author: Po Lu Date: Thu Feb 10 10:11:19 2022 +0800 Ignore tooltip frames when setting PGTK scrollbar foreground * src/pgtkfns.c (pgtk_set_scroll_bar_foreground): Ignore tip frames. (bug#53900) diff --git a/src/pgtkfns.c b/src/pgtkfns.c index 1535ab9f73..baadc41308 100644 --- a/src/pgtkfns.c +++ b/src/pgtkfns.c @@ -846,6 +846,9 @@ pgtk_set_scroll_bar_foreground (struct frame *f, Lisp_Object new_value, GtkCssProvider *css_provider = FRAME_X_OUTPUT (f)->scrollbar_foreground_css_provider; + if (FRAME_TOOLTIP_P (f)) + return; + if (NILP (new_value)) { gtk_css_provider_load_from_data (css_provider, "", -1, NULL); commit 3f738b90956fed2fa5231b4fd468efd500376ca2 Author: Po Lu Date: Thu Feb 10 10:01:06 2022 +0800 ; * src/xterm.c (handle_one_event): Fix build error. diff --git a/src/xterm.c b/src/xterm.c index 13f5800bb7..5b97da36ba 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -11759,32 +11759,34 @@ handle_one_xevent (struct x_display_info *dpyinfo, case XI_KeyRelease: #if defined HAVE_X_I18N || defined USE_GTK - XKeyPressedEvent xkey; - - memset (&xkey, 0, sizeof xkey); - - xkey.type = KeyRelease; - xkey.serial = xev->serial; - xkey.send_event = xev->send_event; - xkey.display = dpyinfo->display; - xkey.window = xev->event; - xkey.root = xev->root; - xkey.subwindow = xev->child; - xkey.time = xev->time; - xkey.state = ((xev->mods.effective & ~(1 << 13 | 1 << 14)) - | (xev->group.effective << 13)); - xkey.keycode = xev->detail; - xkey.same_screen = True; + { + XKeyPressedEvent xkey; + + memset (&xkey, 0, sizeof xkey); + + xkey.type = KeyRelease; + xkey.serial = xev->serial; + xkey.send_event = xev->send_event; + xkey.display = dpyinfo->display; + xkey.window = xev->event; + xkey.root = xev->root; + xkey.subwindow = xev->child; + xkey.time = xev->time; + xkey.state = ((xev->mods.effective & ~(1 << 13 | 1 << 14)) + | (xev->group.effective << 13)); + xkey.keycode = xev->detail; + xkey.same_screen = True; #ifdef HAVE_X_I18N - if (x_filter_event (dpyinfo, (XEvent *) &xkey)) - *finish = X_EVENT_DROP; + if (x_filter_event (dpyinfo, (XEvent *) &xkey)) + *finish = X_EVENT_DROP; #else - f = x_any_window_to_frame (xkey->event); + f = x_any_window_to_frame (xkey->event); - if (f && xg_filter_key (f, event)) - *finish = X_EVENT_DROP; + if (f && xg_filter_key (f, event)) + *finish = X_EVENT_DROP; #endif + } #endif goto XI_OTHER; commit f063e385216940f4a914b2978edf8dd178faa2a6 Author: Tassilo Horn Date: Wed Feb 9 20:48:02 2022 +0100 ; show-paren: improve previous commit bb69361cbe Update show-paren--last-pos also in the "not at paren position" case. Otherwise, we don't get the context info when moving point from a paren position to a non-paren position and back again. diff --git a/lisp/paren.el b/lisp/paren.el index 4cef9756bc..4e67a4ea4f 100644 --- a/lisp/paren.el +++ b/lisp/paren.el @@ -412,7 +412,8 @@ It is the default value of `show-paren-data-function'." ;; If show-paren-mode is nil in this buffer or if not at a paren that ;; has a match, turn off any previous paren highlighting. (delete-overlay show-paren--overlay) - (delete-overlay show-paren--overlay-1)) + (delete-overlay show-paren--overlay-1) + (setq show-paren--last-pos (point))) ;; Found something to highlight. (let* ((here-beg (nth 0 data)) commit 55463952f27da869cee860186dbddfe53443a619 Author: Eli Zaretskii Date: Wed Feb 9 19:31:45 2022 +0200 ; * src/xterm.c (x_display_set_last_user_time): Fix compilation error. diff --git a/src/xterm.c b/src/xterm.c index 1a9eea42cf..13f5800bb7 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -2225,7 +2225,7 @@ x_display_set_last_user_time (struct x_display_info *dpyinfo, Time time) #endif #ifdef ENABLE_CHECKING - eassert (t <= X_ULONG_MAX); + eassert (time <= X_ULONG_MAX); #endif dpyinfo->last_user_time = time; commit 69e82968d7c2b64710f6f6b79597ac98c82449e7 (refs/remotes/origin/emacs-28) Author: Andrea Corallo Date: Wed Feb 9 17:38:10 2022 +0100 Fix integer arithmetic miss-compilation (bug#53451) * lisp/emacs-lisp/comp-cstr.el (comp-cstr-set-range-for-arithm): When one of the two sources is negated revert to set dst as number. * test/src/comp-tests.el (comp-tests-type-spec-tests): Add test to verify this is effective. diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el index 97f8f4d5c4..65710b58c1 100644 --- a/lisp/emacs-lisp/comp-cstr.el +++ b/lisp/emacs-lisp/comp-cstr.el @@ -449,18 +449,20 @@ Return them as multiple value." (declare (debug (range-body)) (indent defun)) `(with-comp-cstr-accessors - (when-let ((r1 (range ,src1)) - (r2 (range ,src2))) - (let* ((l1 (comp-cstr-smallest-in-range r1)) - (l2 (comp-cstr-smallest-in-range r2)) - (h1 (comp-cstr-greatest-in-range r1)) - (h2 (comp-cstr-greatest-in-range r2))) - (setf (typeset ,dst) (when (cl-some (lambda (x) - (comp-subtype-p 'float x)) - (append (typeset src1) - (typeset src2))) - '(float)) - (range ,dst) ,@range-body))))) + (if (or (neg src1) (neg src2)) + (setf (typeset ,dst) '(number)) + (when-let ((r1 (range ,src1)) + (r2 (range ,src2))) + (let* ((l1 (comp-cstr-smallest-in-range r1)) + (l2 (comp-cstr-smallest-in-range r2)) + (h1 (comp-cstr-greatest-in-range r1)) + (h2 (comp-cstr-greatest-in-range r2))) + (setf (typeset ,dst) (when (cl-some (lambda (x) + (comp-subtype-p 'float x)) + (append (typeset src1) + (typeset src2))) + '(float)) + (range ,dst) ,@range-body)))))) (defun comp-cstr-add-2 (dst src1 src2) "Sum SRC1 and SRC2 into DST." diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index eb84262dc8..96f2b42c0d 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el @@ -1353,7 +1353,14 @@ Return a list of results." (when (eql x 1.0) (error "")) x) - t))) + t) + + ;; 74 + ((defun comp-tests-ret-type-spec-f (x) + (if (eq x 0) + (error "") + (1+ x))) + number))) (defun comp-tests-define-type-spec-test (number x) `(comp-deftest ,(intern (format "ret-type-spec-%d" number)) () commit f06915c93c0755a708f9c600e90674c68b5326dc Author: Michael Albinus Date: Wed Feb 9 17:02:29 2022 +0100 Tilde expansion is not possible for Tramp sshfs method * lisp/net/tramp.el (tramp-handle-expand-file-name): Tilde expansion is not possible. (Bug#53847) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 05a80e1dcf..1b5de46016 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -3474,19 +3474,19 @@ User is always nil." (with-parsed-tramp-file-name name 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) + (tramp-error v 'file-error "Cannot expand tilde in file `%s'" name)) ;; Do not keep "/..". (when (string-match-p "^/\\.\\.?$" localname) (setq localname "/")) - ;; Do normal `expand-file-name' (this does "/./" and "/../"), - ;; unless there are tilde characters in file name. + ;; Do normal `expand-file-name' (this does "/./" and "/../"). ;; `default-directory' is bound, because on Windows there would ;; be problems with UNC shares or Cygwin mounts. (let ((default-directory tramp-compat-temporary-file-directory)) (tramp-make-tramp-file-name - v (if (string-match-p "\\`~" localname) - localname - (tramp-drop-volume-letter - (tramp-run-real-handler #'expand-file-name (list localname))))))))) + v (tramp-drop-volume-letter + (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 bb69361cbeec0715c4786ab0864b6ab8b0a43a69 Author: Tassilo Horn Date: Wed Feb 9 15:14:18 2022 +0100 show-paren: Don't show context again after C-g-ing it away. * lisp/paren.el (show-paren--last-pos): New variable. (show-paren-function): Don't show context again after C-g-ing it away. diff --git a/lisp/paren.el b/lisp/paren.el index 8d45987e90..4cef9756bc 100644 --- a/lisp/paren.el +++ b/lisp/paren.el @@ -398,6 +398,12 @@ It is the default value of `show-paren-data-function'." (add-hook 'post-command-hook #'show-paren--delete-context-overlay nil 'local)) +;; The last position of point for which `show-paren-function' was +;; called. We track it in order to C-g away a context overlay or +;; child-frame without having it pop up again after +;; `show-paren-delay'. +(defvar-local show-paren--last-pos nil) + (defun show-paren-function () "Highlight the parentheses until the next input arrives." (let ((data (and show-paren-mode (funcall show-paren-data-function)))) @@ -462,21 +468,23 @@ It is the default value of `show-paren-data-function'." ;; point is at a closing paren, show the context around the ;; opening paren. (let ((openparen (min here-beg there-beg))) - (if (and show-paren-context-when-offscreen - (< there-beg here-beg) - (not (pos-visible-in-window-p openparen))) - (let ((context (blink-paren-open-paren-line-string - openparen)) - (message-log-max nil)) - (cond - ((and - (eq show-paren-context-when-offscreen 'child-frame) - (display-graphic-p)) - (show-paren--show-context-in-child-frame context)) - ((eq show-paren-context-when-offscreen 'overlay) - (show-paren--show-context-in-overlay context)) - (show-paren-context-when-offscreen - (minibuffer-message "Matches %s" context)))))) + (when (and show-paren-context-when-offscreen + (not (eql show-paren--last-pos (point))) + (< there-beg here-beg) + (not (pos-visible-in-window-p openparen))) + (let ((context (blink-paren-open-paren-line-string + openparen)) + (message-log-max nil)) + (cond + ((and + (eq show-paren-context-when-offscreen 'child-frame) + (display-graphic-p)) + (show-paren--show-context-in-child-frame context)) + ((eq show-paren-context-when-offscreen 'overlay) + (show-paren--show-context-in-overlay context)) + (show-paren-context-when-offscreen + (minibuffer-message "Matches %s" context)))))) + (setq show-paren--last-pos (point)) ;; Always set the overlay face, since it varies. (overlay-put show-paren--overlay 'priority show-paren-priority) (overlay-put show-paren--overlay 'face face)))))) commit 2386aa8a5d1b8b3f38361ee2d5228f739dfe2c3a Author: Po Lu Date: Wed Feb 9 19:05:54 2022 +0800 Get rid of `register' declarations in X11 related files * src/xfns.c (XScreenNumberOfScreen): Rewrite K&R declaration. * src/xterm.c (x_set_offset): Remove `register' from `xoff' and `yoff'. diff --git a/src/xfns.c b/src/xfns.c index 79df70e73c..a41ed62d5f 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -6431,8 +6431,7 @@ visual_classes[] = the X function with the same name when that doesn't exist. */ int -XScreenNumberOfScreen (scr) - register Screen *scr; +XScreenNumberOfScreen (Screen *scr) { Display *dpy = scr->display; int i; diff --git a/src/xterm.c b/src/xterm.c index 50525a76df..1a9eea42cf 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -13386,7 +13386,7 @@ x_calc_absolute_position (struct frame *f) which means, do adjust for borders but don't change the gravity. */ static void -x_set_offset (struct frame *f, register int xoff, register int yoff, int change_gravity) +x_set_offset (struct frame *f, int xoff, int yoff, int change_gravity) { int modified_top, modified_left; #ifdef USE_GTK commit 7ead127a6694c10caff2ed89f876c4b154828c68 Author: Po Lu Date: Wed Feb 9 18:51:51 2022 +0800 Fix compiler warning on GTK * src/xterm.c (x_make_frame_visible): Make some fields that are set but never used conditioned out on GTK. diff --git a/src/xterm.c b/src/xterm.c index e6d7d5d133..50525a76df 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -14485,8 +14485,8 @@ xembed_send_message (struct frame *f, Time t, enum xembed_message msg, void x_make_frame_visible (struct frame *f) { - struct x_display_info *dpyinfo; #ifndef USE_GTK + struct x_display_info *dpyinfo; struct x_output *output; #endif @@ -14513,7 +14513,10 @@ x_make_frame_visible (struct frame *f) block_input (); gui_set_bitmap_icon (f); + +#ifndef USE_GTK dpyinfo = FRAME_DISPLAY_INFO (f); +#endif if (! FRAME_VISIBLE_P (f)) { commit 7f425613a75d7566309e8b60cdc01fd26c597302 Author: Po Lu Date: Wed Feb 9 18:47:07 2022 +0800 Add support for _NET_WM_USER_TIME_WINDOW * src/xterm.c (x_make_frame_visible): (x_display_set_last_user_time): Use and set user time window if the WM supports it. (x_term_init): Intern new atom. * src/xterm.h (struct x_display_info): New atom `_NET_WM_USER_TIME_WINDOW'. (struct x_output): New field `user_time_window'. diff --git a/src/xterm.c b/src/xterm.c index 38b50bcd3b..e6d7d5d133 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -2220,24 +2220,29 @@ static void x_check_font (struct frame *, struct font *); void x_display_set_last_user_time (struct x_display_info *dpyinfo, Time time) { +#ifndef USE_GTK struct frame *focus_frame = dpyinfo->x_focus_frame; +#endif #ifdef ENABLE_CHECKING eassert (t <= X_ULONG_MAX); #endif dpyinfo->last_user_time = time; +#ifndef USE_GTK if (focus_frame) { while (FRAME_PARENT_FRAME (focus_frame)) focus_frame = FRAME_PARENT_FRAME (focus_frame); - XChangeProperty (dpyinfo->display, - FRAME_OUTER_WINDOW (dpyinfo->x_focus_frame), - dpyinfo->Xatom_net_wm_user_time, - XA_CARDINAL, 32, PropModeReplace, - (unsigned char *) &time, 1); + if (FRAME_X_OUTPUT (focus_frame)->user_time_window != None) + XChangeProperty (dpyinfo->display, + FRAME_X_OUTPUT (focus_frame)->user_time_window, + dpyinfo->Xatom_net_wm_user_time, + XA_CARDINAL, 32, PropModeReplace, + (unsigned char *) &time, 1); } +#endif } @@ -14481,6 +14486,9 @@ void x_make_frame_visible (struct frame *f) { struct x_display_info *dpyinfo; +#ifndef USE_GTK + struct x_output *output; +#endif if (FRAME_PARENT_FRAME (f)) { @@ -14518,16 +14526,44 @@ x_make_frame_visible (struct frame *f) && ! f->output_data.x->asked_for_visible) x_set_offset (f, f->left_pos, f->top_pos, 0); +#ifndef USE_GTK + output = FRAME_X_OUTPUT (f); + + if (output->user_time_window == None) + { + XSetWindowAttributes attrs; + memset (&attrs, 0, sizeof attrs); + + output->user_time_window + = FRAME_OUTER_WINDOW (f); + + if (x_wm_supports (f, dpyinfo->Xatom_net_wm_user_time_window)) + { + output->user_time_window + = XCreateWindow (dpyinfo->display, FRAME_X_WINDOW (f), + -1, -1, 1, 1, 0, 0, InputOnly, + CopyFromParent, 0, &attrs); + + XChangeProperty (dpyinfo->display, + FRAME_OUTER_WINDOW (f), + dpyinfo->Xatom_net_wm_user_time_window, + XA_WINDOW, 32, PropModeReplace, + (unsigned char *) &output->user_time_window, + 1); + } + } + if (dpyinfo->last_user_time) XChangeProperty (dpyinfo->display, - FRAME_OUTER_WINDOW (f), + output->user_time_window, dpyinfo->Xatom_net_wm_user_time, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &dpyinfo->last_user_time, 1); else XDeleteProperty (dpyinfo->display, - FRAME_OUTER_WINDOW (f), + output->user_time_window, dpyinfo->Xatom_net_wm_user_time); +#endif f->output_data.x->asked_for_visible = true; @@ -16133,6 +16169,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) ATOM_REFS_INIT ("_NET_WM_SYNC_REQUEST_COUNTER", Xatom_net_wm_sync_request_counter) ATOM_REFS_INIT ("_NET_WM_FRAME_DRAWN", Xatom_net_wm_frame_drawn) ATOM_REFS_INIT ("_NET_WM_USER_TIME", Xatom_net_wm_user_time) + ATOM_REFS_INIT ("_NET_WM_USER_TIME_WINDOW", Xatom_net_wm_user_time_window) /* Session management */ ATOM_REFS_INIT ("SM_CLIENT_ID", Xatom_SM_CLIENT_ID) ATOM_REFS_INIT ("_XSETTINGS_SETTINGS", Xatom_xsettings_prop) diff --git a/src/xterm.h b/src/xterm.h index 9aa7021c4d..afd6a1757c 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -506,7 +506,7 @@ struct x_display_info Xatom_net_frame_extents, Xatom_net_current_desktop, Xatom_net_workarea, Xatom_net_wm_opaque_region, Xatom_net_wm_ping, Xatom_net_wm_sync_request, Xatom_net_wm_sync_request_counter, Xatom_net_wm_frame_drawn, - Xatom_net_wm_user_time; + Xatom_net_wm_user_time, Xatom_net_wm_user_time_window; /* XSettings atoms and windows. */ Atom Xatom_xsettings_sel, Xatom_xsettings_prop, Xatom_xsettings_mgr; @@ -677,6 +677,12 @@ struct x_output Widget menubar_widget; #endif +#ifndef USE_GTK + /* A window used to store the user time property. May be None or + the frame's outer window. */ + Window user_time_window; +#endif + #ifdef USE_GTK /* The widget of this screen. This is the window of a top widget. */ GtkWidget *widget; commit 2f80d8058bada74ae67546e95c314066d697b7ba Author: Antoine Levitt Date: Wed Feb 9 10:53:19 2022 +0100 Improve the set-fill-column prompt * lisp/simple.el (set-fill-column): Improve the prompt (bug#53874). diff --git a/lisp/simple.el b/lisp/simple.el index 3cf3024184..af51c99b28 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -8303,7 +8303,8 @@ Just \\[universal-argument] as argument means to use the current column." ;; We used to use current-column silently, but C-x f is too easily ;; typed as a typo for C-x C-f, so we turned it into an error and ;; now an interactive prompt. - (read-number "Set fill-column to: " (current-column))))) + (read-number (format "Change fill-column from %s to: " fill-column) + (current-column))))) (if (consp arg) (setq arg (current-column))) (if (not (integerp arg)) commit 65a61154d8e801ae3ff12f6e5903a5baf321761e Author: Lars Ingebrigtsen Date: Wed Feb 9 09:32:24 2022 +0100 Make calendar-exit actually respect the KILL parameter * lisp/calendar/calendar.el (calendar-exit): Really kill off all the buffers (if requested) (bug#53870). diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index 48d308afad..7804ce0ee9 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el @@ -1861,7 +1861,9 @@ concatenated and the result truncated." buffs)) (defun calendar-exit (&optional kill) - "Get out of the calendar window and hide it and related buffers." + "Get out of the calendar window and hide it and related buffers. +If KILL (interactively, the prefix), kill the buffers instead of +hiding them." (interactive "P") (let ((diary-buffer (get-file-buffer diary-file)) (calendar-buffers (calendar-buffer-list))) @@ -1880,7 +1882,12 @@ concatenated and the result truncated." (iconify-frame (window-frame w))) (quit-window kill w)))) (dolist (b calendar-buffers) - (quit-windows-on b kill)))))) + (quit-windows-on b kill))) + ;; Finally, kill non-displayed buffers (if requested). + (when kill + (dolist (b calendar-buffers) + (when (buffer-live-p b) + (kill-buffer b))))))) (defun calendar-current-date (&optional offset) "Return the current date in a list (month day year). commit 7f9335f91d3e0ecdff9c3adb93aad08454002035 Author: Po Lu Date: Wed Feb 9 16:07:59 2022 +0800 Implement _NET_WM_USER_TIME protocol * src/xterm.c (x_display_set_last_user_time): Set user time on the active window. (handle_one_xevent): Only set user time when the user actually interacted with Emacs. (x_make_frame_visible): Set user time if non-zero. (x_term_init): Intern `_NET_WM_USER_TIME'. * src/xterm.h (struct x_display_info): New field `Xatom_net_wm_user_time'. (x_display_set_last_user_time): Implement in xterm.c instead. diff --git a/src/xterm.c b/src/xterm.c index aed97fb37e..38b50bcd3b 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -2217,6 +2217,29 @@ static void x_scroll_bar_clear (struct frame *); static void x_check_font (struct frame *, struct font *); #endif +void +x_display_set_last_user_time (struct x_display_info *dpyinfo, Time time) +{ + struct frame *focus_frame = dpyinfo->x_focus_frame; + +#ifdef ENABLE_CHECKING + eassert (t <= X_ULONG_MAX); +#endif + dpyinfo->last_user_time = time; + + if (focus_frame) + { + while (FRAME_PARENT_FRAME (focus_frame)) + focus_frame = FRAME_PARENT_FRAME (focus_frame); + + XChangeProperty (dpyinfo->display, + FRAME_OUTER_WINDOW (dpyinfo->x_focus_frame), + dpyinfo->Xatom_net_wm_user_time, + XA_CARDINAL, 32, PropModeReplace, + (unsigned char *) &time, 1); + } +} + /* Set S->gc to a suitable GC for drawing glyph string S in cursor face. */ @@ -9307,7 +9330,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, break; case SelectionNotify: - x_display_set_last_user_time (dpyinfo, event->xselection.time); #ifdef USE_X_TOOLKIT if (! x_window_to_frame (dpyinfo, event->xselection.requestor)) goto OTHER; @@ -9316,7 +9338,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, break; case SelectionClear: /* Someone has grabbed ownership. */ - x_display_set_last_user_time (dpyinfo, event->xselectionclear.time); #ifdef USE_X_TOOLKIT if (! x_window_to_frame (dpyinfo, event->xselectionclear.window)) goto OTHER; @@ -9332,7 +9353,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, break; case SelectionRequest: /* Someone wants our selection. */ - x_display_set_last_user_time (dpyinfo, event->xselectionrequest.time); #ifdef USE_X_TOOLKIT if (!x_window_to_frame (dpyinfo, event->xselectionrequest.owner)) goto OTHER; @@ -9351,7 +9371,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, break; case PropertyNotify: - x_display_set_last_user_time (dpyinfo, event->xproperty.time); f = x_top_window_to_frame (dpyinfo, event->xproperty.window); if (f && event->xproperty.atom == dpyinfo->Xatom_net_wm_state) { @@ -9682,7 +9701,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, goto OTHER; case KeyPress: - x_display_set_last_user_time (dpyinfo, event->xkey.time); ignore_next_mouse_click_timeout = 0; @@ -10018,7 +10036,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, #endif case KeyRelease: - x_display_set_last_user_time (dpyinfo, event->xkey.time); #ifdef HAVE_X_I18N /* Don't dispatch this event since XtDispatchEvent calls XFilterEvent, and two calls in a row may freeze the @@ -10172,7 +10189,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, case MotionNotify: { - x_display_set_last_user_time (dpyinfo, event->xmotion.time); previous_help_echo_string = help_echo_string; help_echo_string = Qnil; @@ -10482,7 +10498,9 @@ handle_one_xevent (struct x_display_info *dpyinfo, memset (&compose_status, 0, sizeof (compose_status)); dpyinfo->last_mouse_glyph_frame = NULL; - x_display_set_last_user_time (dpyinfo, event->xbutton.time); + + if (event->xbutton.type == ButtonPress) + x_display_set_last_user_time (dpyinfo, event->xbutton.time); f = mouse_or_wdesc_frame (dpyinfo, event->xmotion.window); if (f && event->xbutton.type == ButtonPress @@ -10901,8 +10919,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, goto XI_OTHER; #endif - x_display_set_last_user_time (dpyinfo, xi_event->time); - #ifdef HAVE_XWIDGETS struct xwidget_view *xv = xwidget_view_from_window (xev->event); double xv_total_x = 0.0; @@ -11224,7 +11240,9 @@ handle_one_xevent (struct x_display_info *dpyinfo, bv.time = xev->time; dpyinfo->last_mouse_glyph_frame = NULL; - x_display_set_last_user_time (dpyinfo, xev->time); + + if (xev->evtype == XI_ButtonPress) + x_display_set_last_user_time (dpyinfo, xev->time); f = mouse_or_wdesc_frame (dpyinfo, xev->event); @@ -11735,34 +11753,32 @@ handle_one_xevent (struct x_display_info *dpyinfo, } case XI_KeyRelease: - x_display_set_last_user_time (dpyinfo, xev->time); - #if defined HAVE_X_I18N || defined USE_GTK - XKeyPressedEvent xkey; - - memset (&xkey, 0, sizeof xkey); - - xkey.type = KeyRelease; - xkey.serial = xev->serial; - xkey.send_event = xev->send_event; - xkey.display = dpyinfo->display; - xkey.window = xev->event; - xkey.root = xev->root; - xkey.subwindow = xev->child; - xkey.time = xev->time; - xkey.state = ((xev->mods.effective & ~(1 << 13 | 1 << 14)) - | (xev->group.effective << 13)); - xkey.keycode = xev->detail; - xkey.same_screen = True; + XKeyPressedEvent xkey; + + memset (&xkey, 0, sizeof xkey); + + xkey.type = KeyRelease; + xkey.serial = xev->serial; + xkey.send_event = xev->send_event; + xkey.display = dpyinfo->display; + xkey.window = xev->event; + xkey.root = xev->root; + xkey.subwindow = xev->child; + xkey.time = xev->time; + xkey.state = ((xev->mods.effective & ~(1 << 13 | 1 << 14)) + | (xev->group.effective << 13)); + xkey.keycode = xev->detail; + xkey.same_screen = True; #ifdef HAVE_X_I18N - if (x_filter_event (dpyinfo, (XEvent *) &xkey)) - *finish = X_EVENT_DROP; + if (x_filter_event (dpyinfo, (XEvent *) &xkey)) + *finish = X_EVENT_DROP; #else - f = x_any_window_to_frame (xkey->event); + f = x_any_window_to_frame (xkey->event); - if (f && xg_filter_key (f, event)) - *finish = X_EVENT_DROP; + if (f && xg_filter_key (f, event)) + *finish = X_EVENT_DROP; #endif #endif @@ -11989,8 +12005,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, case XI_GesturePinchEnd: { - x_display_set_last_user_time (dpyinfo, xi_event->time); - #if defined HAVE_XWIDGETS && HAVE_USABLE_XI_GESTURE_PINCH_EVENT XIGesturePinchEvent *pev = (XIGesturePinchEvent *) xi_event; struct xwidget_view *xvw = xwidget_view_from_window (pev->event); @@ -14466,6 +14480,8 @@ xembed_send_message (struct frame *f, Time t, enum xembed_message msg, void x_make_frame_visible (struct frame *f) { + struct x_display_info *dpyinfo; + if (FRAME_PARENT_FRAME (f)) { if (!FRAME_VISIBLE_P (f)) @@ -14489,6 +14505,7 @@ x_make_frame_visible (struct frame *f) block_input (); gui_set_bitmap_icon (f); + dpyinfo = FRAME_DISPLAY_INFO (f); if (! FRAME_VISIBLE_P (f)) { @@ -14501,6 +14518,17 @@ x_make_frame_visible (struct frame *f) && ! f->output_data.x->asked_for_visible) x_set_offset (f, f->left_pos, f->top_pos, 0); + if (dpyinfo->last_user_time) + XChangeProperty (dpyinfo->display, + FRAME_OUTER_WINDOW (f), + dpyinfo->Xatom_net_wm_user_time, + XA_CARDINAL, 32, PropModeReplace, + (unsigned char *) &dpyinfo->last_user_time, 1); + else + XDeleteProperty (dpyinfo->display, + FRAME_OUTER_WINDOW (f), + dpyinfo->Xatom_net_wm_user_time); + f->output_data.x->asked_for_visible = true; if (! EQ (Vx_no_window_manager, Qt)) @@ -16104,6 +16132,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) ATOM_REFS_INIT ("_NET_WM_SYNC_REQUEST", Xatom_net_wm_sync_request) ATOM_REFS_INIT ("_NET_WM_SYNC_REQUEST_COUNTER", Xatom_net_wm_sync_request_counter) ATOM_REFS_INIT ("_NET_WM_FRAME_DRAWN", Xatom_net_wm_frame_drawn) + ATOM_REFS_INIT ("_NET_WM_USER_TIME", Xatom_net_wm_user_time) /* Session management */ ATOM_REFS_INIT ("SM_CLIENT_ID", Xatom_SM_CLIENT_ID) ATOM_REFS_INIT ("_XSETTINGS_SETTINGS", Xatom_xsettings_prop) diff --git a/src/xterm.h b/src/xterm.h index 435569943c..9aa7021c4d 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -505,7 +505,8 @@ struct x_display_info Xatom_net_wm_state_hidden, Xatom_net_wm_state_skip_taskbar, Xatom_net_frame_extents, Xatom_net_current_desktop, Xatom_net_workarea, Xatom_net_wm_opaque_region, Xatom_net_wm_ping, Xatom_net_wm_sync_request, - Xatom_net_wm_sync_request_counter, Xatom_net_wm_frame_drawn; + Xatom_net_wm_sync_request_counter, Xatom_net_wm_frame_drawn, + Xatom_net_wm_user_time; /* XSettings atoms and windows. */ Atom Xatom_xsettings_sel, Xatom_xsettings_prop, Xatom_xsettings_mgr; @@ -1283,6 +1284,8 @@ extern void x_xr_apply_ext_clip (struct frame *f, GC gc); extern void x_xr_reset_ext_clip (struct frame *f); #endif +extern void x_display_set_last_user_time (struct x_display_info *, Time); + INLINE int x_display_pixel_height (struct x_display_info *dpyinfo) { @@ -1295,15 +1298,6 @@ x_display_pixel_width (struct x_display_info *dpyinfo) return WidthOfScreen (dpyinfo->screen); } -INLINE void -x_display_set_last_user_time (struct x_display_info *dpyinfo, Time t) -{ -#ifdef ENABLE_CHECKING - eassert (t <= X_ULONG_MAX); -#endif - dpyinfo->last_user_time = t; -} - INLINE unsigned long x_make_truecolor_pixel (struct x_display_info *dpyinfo, int r, int g, int b) { commit 31af9bca99fa88350271e1a905c9b435eaec28cf Author: Robert Pluim Date: Tue Feb 8 16:04:15 2022 +0100 Mark flymake as compatible with emacs-26.1 * lisp/progmodes/flymake.el: Bump package version and set emacs version in Package-Requires to 26.1 (Bug#53853). diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index e369cb1f21..83d7bc8641 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -4,9 +4,9 @@ ;; Author: Pavel Kobyakov ;; Maintainer: João Távora -;; Version: 1.2.1 +;; Version: 1.2.2 ;; Keywords: c languages tools -;; Package-Requires: ((emacs "28.1") (eldoc "1.1.0") (project "0.7.1")) +;; Package-Requires: ((emacs "26.1") (eldoc "1.1.0") (project "0.7.1")) ;; This is a GNU ELPA :core package. Avoid functionality that is not ;; compatible with the version of Emacs recorded above.