about summary refs log tree commit diff
path: root/third_party/exwm/exwm-core.el
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2023-10-09T07·12+0300
committerVincent Ambo <mail@tazj.in>2023-10-09T07·12+0300
commit5f53841a343f0f2b5a66f9d58739b19a2e81dcb9 (patch)
tree16ce612b7d3b0311265d9ad8a4bc264b8773c945 /third_party/exwm/exwm-core.el
parenta63f99135142e103afe51ee0e9b211f7a065633d (diff)
parent56db521a3ed6a2ccc1193110a56545a1992e9654 (diff)
subtree(3p/exwm): bump exwm to upstream commit '56db521a' r/6746
This bumps us past EXWM 0.28, which has several major fixes.

Change-Id: Ie89997cc5d60f4e5aaedfe60368571420b7e4b9d
Diffstat (limited to 'third_party/exwm/exwm-core.el')
-rw-r--r--third_party/exwm/exwm-core.el28
1 files changed, 19 insertions, 9 deletions
diff --git a/third_party/exwm/exwm-core.el b/third_party/exwm/exwm-core.el
index 75c7c1b17b77..4df57e738123 100644
--- a/third_party/exwm/exwm-core.el
+++ b/third_party/exwm/exwm-core.el
@@ -1,6 +1,6 @@
 ;;; exwm-core.el --- Core definitions  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2023 Free Software Foundation, Inc.
 
 ;; Author: Chris Feng <chris.w.feng@gmail.com>
 
@@ -93,10 +93,12 @@ Here are some predefined candidates:
                   (frame-or-index &optional id))
 
 (define-minor-mode exwm-debug
-  "Debug-logging enabled if non-nil"
-  :global t)
+  "Debug-logging enabled if non-nil."
+  :global t
+  :group 'exwm-debug)
 
 (defmacro exwm--debug (&rest forms)
+  "Evaluate FORMS if mode `exwm-debug' is active."
   (when exwm-debug `(progn ,@forms)))
 
 (defmacro exwm--log (&optional format-string &rest objects)
@@ -116,10 +118,12 @@ FORMAT-STRING is a string specifying the message to output, as in
 
 (defsubst exwm--id->buffer (id)
   "X window ID => Emacs buffer."
+  (declare (indent defun))
   (cdr (assoc id exwm--id-buffer-alist)))
 
 (defsubst exwm--buffer->id (buffer)
   "Emacs buffer BUFFER => X window ID."
+  (declare (indent defun))
   (car (rassoc buffer exwm--id-buffer-alist)))
 
 (defun exwm--lock (&rest _args)
@@ -159,7 +163,9 @@ Nil can be passed as placeholder."
                      :x x :y y :width width :height height)))
 
 (defun exwm--intern-atom (atom &optional conn)
-  "Intern X11 ATOM."
+  "Intern X11 ATOM.
+If CONN is non-nil, use it instead of the value of the variable
+`exwm--connection'."
   (slot-value (xcb:+request-unchecked+reply (or conn exwm--connection)
                   (make-instance 'xcb:InternAtom
                                  :only-if-exists 0
@@ -183,6 +189,7 @@ least SECS seconds later."
 (defsubst exwm--terminal-p (&optional frame)
   "Return t when FRAME's terminal is EXWM's terminal.
 If FRAME is null, use selected frame."
+  (declare (indent defun))
   (eq exwm--terminal (frame-terminal frame)))
 
 (defun exwm--get-client-event-mask ()
@@ -197,13 +204,16 @@ If FRAME is null, use selected frame."
   (when (and color
              (eq (x-display-visual-class) 'true-color))
     (let ((rgb (x-color-values color)))
-      (logior (lsh (lsh (pop rgb) -8) 16)
-              (lsh (lsh (pop rgb) -8) 8)
-              (lsh (pop rgb) -8)))))
+      (logior (ash (ash (pop rgb) -8) 16)
+              (ash (ash (pop rgb) -8) 8)
+              (ash (pop rgb) -8)))))
 
 (defun exwm--get-visual-depth-colormap (conn id)
   "Get visual, depth and colormap from X window ID.
-Return a three element list with the respective results."
+Return a three element list with the respective results.
+
+If CONN is non-nil, use it instead of the value of the variable
+`exwm--connection'."
   (let (ret-visual ret-depth ret-colormap)
     (with-slots (visual colormap)
         (xcb:+request-unchecked+reply conn
@@ -235,7 +245,7 @@ One of `line-mode' or `char-mode'.")
 (defvar-local exwm--geometry nil)
 (defvar-local exwm-class-name nil "Class name in WM_CLASS.")
 (defvar-local exwm-instance-name nil "Instance name in WM_CLASS.")
-(defvar-local exwm-title nil "Window title (either _NET_WM_NAME or WM_NAME)")
+(defvar-local exwm-title nil "Window title (either _NET_WM_NAME or WM_NAME).")
 (defvar-local exwm--title-is-utf8 nil)
 (defvar-local exwm-transient-for nil "WM_TRANSIENT_FOR.")
 (defvar-local exwm--protocols nil)