From 53f312e9fca5cfb20a7f9cbea5f51644f3fd6341 Mon Sep 17 00:00:00 2001 From: Joseph Mingrone Date: Fri, 1 Dec 2023 23:43:28 -0400 Subject: [PATCH 01/21] stumpwm.asd: Bump :version to 23.11 --- stumpwm.asd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stumpwm.asd b/stumpwm.asd index c692141c..8a4ab24c 100644 --- a/stumpwm.asd +++ b/stumpwm.asd @@ -7,7 +7,7 @@ (defsystem :stumpwm :name "StumpWM" :author "Shawn Betts " - :version "1.0.1" + :version "23.11" :maintainer "David Bjergaard " ;; :license "GNU General Public License" :description "A tiling, keyboard driven window manager" From e82d5af6c53a636265cc311262455b168a8ddcb8 Mon Sep 17 00:00:00 2001 From: Artyom Bologov Date: Mon, 11 Dec 2023 22:33:09 +0400 Subject: [PATCH 02/21] input: Export *input-refine-candidates-fn* for consistency. input-refine-prefix and input-refine-regexp are already exported, which makes a case for *input-refine-candidates-fn* export. --- input.lisp | 1 + 1 file changed, 1 insertion(+) diff --git a/input.lisp b/input.lisp index 6d05a17f..e75306fb 100644 --- a/input.lisp +++ b/input.lisp @@ -25,6 +25,7 @@ (export '(*input-history-ignore-duplicates* *input-candidate-selected-hook* + *input-refine-candidates-fn* *input-completion-style* *input-map* *numpad-map* From dc2c23d2b367f302e05071d5bef3fba0e60642a7 Mon Sep 17 00:00:00 2001 From: Artyom Bologov Date: Mon, 11 Dec 2023 22:43:47 +0400 Subject: [PATCH 03/21] input(input-refine-fuzzy): Add for fuzzy matching. This way, one can filter through the suggestions in a way that's slightly better than prefix, but less powerful than regexp one. The implementation is somewhat simplistic. In particular, it doesn't check the order of space-separated parts and doesn't ensure that all the matches are unique. Still, better than prefix matching. --- input.lisp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/input.lisp b/input.lisp index 6d05a17f..90616ab1 100644 --- a/input.lisp +++ b/input.lisp @@ -36,6 +36,7 @@ input-insert-string input-point input-refine-prefix + input-refine-fuzzy input-refine-regexp input-substring input-validate-region @@ -136,6 +137,16 @@ and complete the input by mutating it.")) :end2 (length str)))) candidates)) +(defun input-refine-fuzzy (str candidates) + (remove-if-not (lambda (elt) + (when (listp elt) + (setf elt (car elt))) + (and (<= (length str) (length elt)) + (every (lambda (part) + (search part elt)) + (uiop:split-string str)))) + candidates)) + (defun input-refine-regexp (str candidates) (remove-if-not (lambda (elt) (when (listp elt) From b34347ce9056f5e53161a3fda42692c9102071f4 Mon Sep 17 00:00:00 2001 From: Dorovich Date: Sun, 24 Dec 2023 18:57:19 +0100 Subject: [PATCH 04/21] fix frame splitting ratio pixels --- tile-group.lisp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tile-group.lisp b/tile-group.lisp index ec696c70..0d134ec5 100644 --- a/tile-group.lisp +++ b/tile-group.lisp @@ -564,7 +564,7 @@ T (default) then also focus the frame." If ratio is an integer return the number of pixel desired." (if (integerp ratio) ratio - (* length ratio))) + (round (* length ratio)))) (defun funcall-on-leaf (tree leaf fn) "Return a new tree with LEAF replaced with the result of calling FN on LEAF." From 6415aeacf055d0896cc2f99ca81a1a59716dd246 Mon Sep 17 00:00:00 2001 From: szos Date: Sat, 27 Jan 2024 02:02:46 +0100 Subject: [PATCH 05/21] patch copy-frame-tree to not expect a structure This commit replaces copy-structure with copy-frame, as frames are no longer represented by structures but by classes. --- tile-group.lisp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tile-group.lisp b/tile-group.lisp index 3f4bb2df..3c165761 100644 --- a/tile-group.lisp +++ b/tile-group.lisp @@ -475,7 +475,7 @@ T (default) then also focus the frame." "Return a copy of the frame tree." (cond ((null tree) tree) ((typep tree 'frame) - (copy-structure tree)) + (copy-frame tree)) (t (mapcar #'copy-frame-tree tree)))) From b60968db371c9f80b40ce196f91cedb793e3014e Mon Sep 17 00:00:00 2001 From: Mihail Ivanchev Date: Thu, 15 Feb 2024 17:21:59 +0100 Subject: [PATCH 06/21] Expand documentation of define-frame-preference to describe hidden but critically important feature. --- primitives.lisp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/primitives.lisp b/primitives.lisp index a498ec5e..eeb3613a 100644 --- a/primitives.lisp +++ b/primitives.lisp @@ -1323,7 +1323,8 @@ add rules") (defmacro define-frame-preference (target-group &body frame-rules) "Create a rule that matches windows and automatically places them in -a specified group and frame. Each frame rule is a lambda list: +a specified group and frame or converts them to floating windows. Each +frame rule is a lambda list: @example \(frame-number raise lock &key from-group create restore dump-name class class-not instance instance-not type type-not role role-not title title-not @@ -1336,7 +1337,9 @@ When nil, rule applies in the current group. When non nil, @var{lock} determines applicability of rule @item frame-number -The frame number to send matching windows to +The frame number to send matching windows to. If set to :float instead of a +frame number, the window will be converted to a floating window. This is +convenient for applications that should be launched as pop-ups. @item raise When non-nil, raise and focus the window in its frame From f0ef15330ee2fbc57a95ef9262dce52446f8a104 Mon Sep 17 00:00:00 2001 From: "Kirill A. Korinsky" Date: Fri, 16 Feb 2024 12:09:30 +0100 Subject: [PATCH 07/21] Require :uiop at make-image.lisp `make-image.lisp` can be run via `--script` at SBCL and the last one do not load ASDF and UIOP by default on this way. That leads to an error like: ``` Package UIOP/LISP-BUILD does not exist. ``` --- make-image.lisp.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/make-image.lisp.in b/make-image.lisp.in index f0b648c6..2cfdc1db 100644 --- a/make-image.lisp.in +++ b/make-image.lisp.in @@ -1,3 +1,5 @@ +(require :uiop) + (in-package #:cl-user) (let* ((expected-warnings From cfa9870d7c8402ac94e329eb8b2570c20e2373b7 Mon Sep 17 00:00:00 2001 From: szos Date: Tue, 20 Feb 2024 23:39:46 +0100 Subject: [PATCH 08/21] remove number zero from group number map StumpWM expects group numbers to grow incrementally and for their numbers to match the *group-number-map*. However because group numbers start from one the tenth group created gets the group number ten, while the *group-number-map* and associated function group-map-number report its number as zero, because zero is the tenth character in that string. Removing the zero from the string removes this inconsistency, as any group-map-number that isnt present in the string is returned via princ-to-string. --- primitives.lisp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/primitives.lisp b/primitives.lisp index a498ec5e..7e9ac379 100644 --- a/primitives.lisp +++ b/primitives.lisp @@ -771,7 +771,7 @@ exist, in which case they go into the current group.") (defvar *window-number-map* "0123456789" "Set this to a string to remap the window numbers to something more convenient.") -(defvar *group-number-map* "1234567890" +(defvar *group-number-map* "123456789" "Set this to a string to remap the group numbers to something more convenient.") (defvar *frame-number-map* "0123456789abcdefghijklmnopqrstuvwxyz" From b43a6d0f6e7cf6b2ce5bd6a60658e7848ae4dd1b Mon Sep 17 00:00:00 2001 From: szos Date: Mon, 25 Mar 2024 14:13:28 -0700 Subject: [PATCH 09/21] Patch MARK to accept the window as an optional argument Modify the MARK command to take two optional arguments. Current behavior is preserved. The arguments are the window to mark, which defaults to the current window, and a new argument controlling whether or not to display a message to the user that the window has been marked. In addition, the message displayed has been modified to also display the window that has been marked. --- window.lisp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/window.lisp b/window.lisp index 505326a1..eec89233 100644 --- a/window.lisp +++ b/window.lisp @@ -1253,14 +1253,18 @@ formatting. This is a simple wrapper around the command @command{windowlist}." (defcommand-alias insert window-send-string) -(defcommand mark () () -"Toggle the current window's mark." - (let ((win (current-window))) - (when win - (setf (window-marked win) (not (window-marked win))) +(defcommand mark (&optional (win (current-window)) (message t)) () +"Toggle a window's mark. The optional argument WIN controls which window is +marked and defaults to the current window. The optional argument MESSAGE +controls whether or not to display a message to the user indicating that WIN has +been marked, and defaults to T." + (when win + (setf (window-marked win) (not (window-marked win))) + (when message (message (if (window-marked win) - "Marked!" - "Unmarked!"))))) + "^3~A^n Marked!" + "^3~A^n Unmarked!") + (format-expand *window-formatters* *window-format* win))))) (defcommand clear-window-marks (&optional (group (current-group)) (windows (group-windows group))) () "Clear all marks in the current group." From 736d1962c6c0f3cfe399875a77118884fcdff3b2 Mon Sep 17 00:00:00 2001 From: szos Date: Tue, 2 Apr 2024 14:43:43 -0700 Subject: [PATCH 10/21] Patch minor mode scopes all-object function and filter types Patch minor mode scopes to accurately return all objects according to the filter type. Previously problems were encountered when global scopes were defined because certain minor mode scopes failed to filter out irrelevant scope objects. For example, the :MANUAL-TILING-GROUP scope would report all tiling groups, because the function returning all scope objects would return any object that matched the base type, and didnt remove objects that matched the filter type. Additionally, patch the :MANUAL-TILING-GROUP and :FRAME-EXCLUDING-HEAD scopes to not rely on SATISFIES for their filter types. --- minor-modes.lisp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/minor-modes.lisp b/minor-modes.lisp index 88eb07dd..4e99182e 100644 --- a/minor-modes.lisp +++ b/minor-modes.lisp @@ -761,10 +761,13 @@ DESIGNATOR in the minor mode scope hash table." (defun scope-current-object-function (designator) (cadr (get-scope designator))) (defun scope-all-objects-function (designator) - (let ((type (first (get-scope designator)))) + (let* ((scope (get-scope designator)) + (type (first scope)) + (filter (third scope))) (lambda () (loop for object in (list-mode-objects nil) - when (typep object type) + when (and (typep object type) + (typep object filter)) collect object)))) (defun find-active-global-minor-modes-for-scope (scope) (loop for mode in *active-global-minor-modes* @@ -878,12 +881,9 @@ provided." (define-minor-mode-scope (:dynamic-group dynamic-group) (current-group)) -(defun %manual-tiling-group-p (g) - (and (typep g 'tile-group) - (not (typep g 'dynamic-group)))) - -(define-minor-mode-scope (:manual-tiling-group tile-group - (satisfies %manual-tiling-group-p)) +(define-minor-mode-scope (:manual-tiling-group + tile-group + (and tile-group (not dynamic-group))) (current-group)) (define-minor-mode-scope (:frame frame) @@ -894,12 +894,8 @@ provided." (define-minor-mode-scope (:head head) (current-head)) -(defun %frame-but-not-head (o) - (and (typep o 'frame) - (not (typep o 'head)))) - (define-descended-minor-mode-scope :frame-excluding-head :frame - :filter-type (satisfies %frame-but-not-head)) + :filter-type (and frame (not head))) (define-minor-mode-scope (:window window) (current-window)) From 05a78997dec29e5915f5c474ea538d4ed6d45329 Mon Sep 17 00:00:00 2001 From: szos Date: Tue, 2 Apr 2024 14:54:50 -0700 Subject: [PATCH 11/21] update manual to include an example of defining minor mode scopes Add an example of using define-descended-minor-mode-scope to define a new scope that is restricted to firefox windows. Additionally change the word 'dispatch' to 'specialize', using the terminology common to Common Lisp. --- stumpwm.texi.in | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/stumpwm.texi.in b/stumpwm.texi.in index 7c9a748b..91bea6f2 100644 --- a/stumpwm.texi.in +++ b/stumpwm.texi.in @@ -2542,7 +2542,7 @@ minor mode scoped to @code{:GROUP} cant be a subclass of a minor mode scoped to @code{:WINDOW}, for example. However there is a way to override this by explicitly stating that two otherwise incompatible scopes are compatible. This is done by defining methods for the generic -function @code{VALIDATE-SUPERSCOPE} which dispatch upon the scope +function @code{VALIDATE-SUPERSCOPE} which specialize upon the scope designators. Such methods should return at least one value, indicating if the superscope is a valid parent of the scope. If multiple values are returned, the second value must indicate whether the superscope is an @@ -2564,6 +2564,20 @@ it is created. For this reason it is important when defining a minor mode or minor mode scope to understand the type hierarchy. It may also be in the programmers best interests to define an accompanying type. +Below is an example of a minor mode scope definition that descends from +the @code{:WINDOW} scope, and is restricted to only firefox +windows. This would be used to implement a minor mode that only gets +mixed in to firefox windows, for example to implement key rebinding. + +@verbatim +(defun %firefox-window-p (w) + (and (typep w 'window) + (string-equal (window-class window) "Firefox"))) + +(define-descended-minor-mode-scope :firefox-window :window + :filter-type (satisfies %firefox-window-p)) +@end verbatim + The following scopes are predefined: @itemize @item From 103c50c771e9e70638e7124aca9660f3ae3b31f7 Mon Sep 17 00:00:00 2001 From: Mihail Ivanchev Date: Sun, 26 May 2024 21:32:30 +0200 Subject: [PATCH 12/21] Avoid source registry init and add (require "asdf") where it's missing. --- Makefile.in | 6 +++--- load-stumpwm.lisp.in | 8 ++------ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Makefile.in b/Makefile.in index ff09b91e..56b2c860 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,9 +1,9 @@ LISP=@LISP_PROGRAM@ MAKEINFO=@MAKEINFO@ -sbcl_BUILDOPTS=--non-interactive --eval "(setf sb-impl::*default-external-format* :UTF-8)" --load ./make-image.lisp -sbcl_INFOOPTS=--non-interactive --eval "(setf sb-impl::*default-external-format* :UTF-8)" --eval "(progn (load \"load-stumpwm.lisp\") (load \"manual.lisp\"))" --eval "(progn (stumpwm::generate-manual) (sb-ext:quit))" -sbcl_TESTOPTS=--non-interactive --eval "(setf sb-impl::*default-external-format* :UTF-8)" --eval "(progn (load \"load-stumpwm.lisp\") (asdf:load-system :stumpwm-tests))" --eval "(if (fiasco:all-tests) (uiop:quit 0) (uiop:quit 1))" +sbcl_BUILDOPTS=--non-interactive --eval "(require 'asdf)" --eval "(setf sb-impl::*default-external-format* :UTF-8)" --load ./make-image.lisp +sbcl_INFOOPTS=--non-interactive --eval "(require 'asdf)" --eval "(setf sb-impl::*default-external-format* :UTF-8)" --eval "(progn (load \"load-stumpwm.lisp\") (load \"manual.lisp\"))" --eval "(progn (stumpwm::generate-manual) (sb-ext:quit))" +sbcl_TESTOPTS=--non-interactive --eval "(require 'asdf)" --eval "(setf sb-impl::*default-external-format* :UTF-8)" --eval "(progn (load \"load-stumpwm.lisp\") (asdf:load-system :stumpwm-tests))" --eval "(if (fiasco:all-tests) (uiop:quit 0) (uiop:quit 1))" datarootdir = @datarootdir@ prefix=@prefix@ diff --git a/load-stumpwm.lisp.in b/load-stumpwm.lisp.in index a7b228a3..0c0e2f94 100644 --- a/load-stumpwm.lisp.in +++ b/load-stumpwm.lisp.in @@ -5,9 +5,5 @@ (require 'asdf) -(asdf:initialize-source-registry - '(:source-registry - (:directory "@STUMPWM_ASDF_DIR@") - :inherit-configuration)) - -(asdf:oos 'asdf:load-op 'stumpwm) +(asdf:load-asd #p"@STUMPWM_ASDF_DIR@/stumpwm.asd") +(asdf:load-system "stumpwm") From 82f33221a3c53d3ed151867e4177393df4499e97 Mon Sep 17 00:00:00 2001 From: Mihail Ivanchev Date: Sun, 26 May 2024 23:20:28 +0200 Subject: [PATCH 13/21] Merge system definitions in a single ASD file. --- Makefile.in | 2 +- stumpwm-tests.asd | 12 ------------ stumpwm.asd | 15 ++++++++++++++- 3 files changed, 15 insertions(+), 14 deletions(-) delete mode 100644 stumpwm-tests.asd diff --git a/Makefile.in b/Makefile.in index 56b2c860..330598be 100644 --- a/Makefile.in +++ b/Makefile.in @@ -3,7 +3,7 @@ MAKEINFO=@MAKEINFO@ sbcl_BUILDOPTS=--non-interactive --eval "(require 'asdf)" --eval "(setf sb-impl::*default-external-format* :UTF-8)" --load ./make-image.lisp sbcl_INFOOPTS=--non-interactive --eval "(require 'asdf)" --eval "(setf sb-impl::*default-external-format* :UTF-8)" --eval "(progn (load \"load-stumpwm.lisp\") (load \"manual.lisp\"))" --eval "(progn (stumpwm::generate-manual) (sb-ext:quit))" -sbcl_TESTOPTS=--non-interactive --eval "(require 'asdf)" --eval "(setf sb-impl::*default-external-format* :UTF-8)" --eval "(progn (load \"load-stumpwm.lisp\") (asdf:load-system :stumpwm-tests))" --eval "(if (fiasco:all-tests) (uiop:quit 0) (uiop:quit 1))" +sbcl_TESTOPTS=--non-interactive --eval "(require 'asdf)" --eval "(setf sb-impl::*default-external-format* :UTF-8)" --eval "(progn (load \"load-stumpwm.lisp\") (asdf:load-system :stumpwm/tests))" --eval "(if (fiasco:all-tests) (uiop:quit 0) (uiop:quit 1))" datarootdir = @datarootdir@ prefix=@prefix@ diff --git a/stumpwm-tests.asd b/stumpwm-tests.asd deleted file mode 100644 index dfaa6c9f..00000000 --- a/stumpwm-tests.asd +++ /dev/null @@ -1,12 +0,0 @@ -(defsystem "stumpwm-tests" - :name "StumpWM tests" - :serial t - :depends-on ("stumpwm" - "fiasco") - :pathname "tests/" - :components ((:file "package") - (:file "kmap") - (:file "pathnames") - (:file "mode-line-formatters")) - :perform (test-op (o c) - (uiop/package:symbol-call "FIASCO" "RUN-TESTS" 'stumpwm-tests))) diff --git a/stumpwm.asd b/stumpwm.asd index 8a4ab24c..a1658305 100644 --- a/stumpwm.asd +++ b/stumpwm.asd @@ -67,7 +67,7 @@ ;; keep this last so it always gets recompiled if ;; anything changes (:file "version")) - :in-order-to ((test-op (test-op "stumpwm-tests")))) + :in-order-to ((test-op (test-op "stumpwm/tests")))) (defsystem "stumpwm/build" :depends-on ("stumpwm") @@ -76,5 +76,18 @@ :entry-point "stumpwm:main" :components ((:file "main"))) +(defsystem "stumpwm/tests" + :name "StumpWM tests" + :serial t + :depends-on ("stumpwm" + "fiasco") + :pathname "tests/" + :components ((:file "package") + (:file "kmap") + (:file "pathnames") + (:file "mode-line-formatters")) + :perform (test-op (o c) + (uiop/package:symbol-call "FIASCO" "RUN-TESTS" 'stumpwm-tests))) + ;; Quicklisp prefers systems in the central registry over its own systems (push (asdf:system-relative-pathname "stumpwm" "dynamic-mixins/") asdf:*central-registry*) From 623472e4e155aca67ad8c73f9e37b6c1453e2397 Mon Sep 17 00:00:00 2001 From: Mihail Ivanchev Date: Mon, 27 May 2024 15:43:36 +0200 Subject: [PATCH 14/21] Adding support for message window margins. --- message-window.lisp | 12 +++++++++--- primitives.lisp | 12 ++++++++++++ stumpwm.texi.in | 2 ++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/message-window.lisp b/message-window.lisp index 2a46dc54..2bc1b373 100644 --- a/message-window.lisp +++ b/message-window.lisp @@ -82,10 +82,16 @@ function expects to be wrapped in a with-state for win." (* (xlib:drawable-border-width win) 2))) (head-x (head-x (current-head))) (head-y (head-y (current-head))) - (head-maxx (+ head-x (head-width (current-head)))) - (head-maxy (+ head-y (head-height (current-head))))) + (head-width (head-width (current-head))) + (head-height (head-height (current-head))) + (margin-x (if (> (* *message-window-margin* 2) head-width) 0 *message-window-margin*)) + (margin-y (if (> (* *message-window-y-margin* 2) head-height) 0 *message-window-y-margin*)) + (minx (+ head-x margin-x)) + (miny (+ head-y margin-y)) + (maxx (- (+ head-x head-width) margin-x)) + (maxy (- (+ head-y head-height) margin-y))) (multiple-value-bind (x y) - (gravity-coords gravity w h head-x head-y head-maxx head-maxy) + (gravity-coords gravity w h minx miny maxx maxy) (setf (xlib:drawable-y win) (max head-y y) (xlib:drawable-x win) (max head-x x)))))) diff --git a/primitives.lisp b/primitives.lisp index ce1012a4..135e6a7f 100644 --- a/primitives.lisp +++ b/primitives.lisp @@ -75,6 +75,8 @@ *window-parent-events* *message-window-padding* *message-window-y-padding* + *message-window-margin* + *message-window-y-margin* *message-window-gravity* *message-window-real-gravity* *message-window-input-gravity* @@ -470,6 +472,16 @@ Include only those we are ready to support.") (defvar *message-window-y-padding* 0 "The number of pixels that pad the text in the message window vertically.") +(defvar *message-window-margin* 0 + "The number of pixels (i.e. the gap) between the message window and the + horizontal edges of the head. The margin is disregarded if it takes more + space than is available.") + +(defvar *message-window-y-margin* 0 + "The number of pixels (i.e. the gap) between the message window and the + vertical edges of the head. The margin is disregarded if it takes more + space than is available.") + (defvar *message-window-gravity* :top-right "This variable controls where the message window appears. The following are valid values. diff --git a/stumpwm.texi.in b/stumpwm.texi.in index 91bea6f2..2b75202f 100644 --- a/stumpwm.texi.in +++ b/stumpwm.texi.in @@ -1655,6 +1655,8 @@ set these color variables. ### *message-window-padding* ### *message-window-y-padding* +### *message-window-margin* +### *message-window-y-margin* ### *message-window-gravity* ### *message-window-input-gravity* ### *message-window-timer* From d4d79b1c4dcd1f81dec3a92fa9c3838870ffe443 Mon Sep 17 00:00:00 2001 From: Mihail Ivanchev Date: Fri, 26 Jul 2024 10:41:29 +0200 Subject: [PATCH 15/21] Supporting reproducible builds. --- configure.ac | 8 ++++++++ version.lisp => version.lisp.in | 24 ++++++++++++------------ 2 files changed, 20 insertions(+), 12 deletions(-) rename version.lisp => version.lisp.in (59%) diff --git a/configure.ac b/configure.ac index a198d4d5..510f53ed 100644 --- a/configure.ac +++ b/configure.ac @@ -8,6 +8,7 @@ AC_SUBST(MODULE_DIR) AC_SUBST(LISP_PROGRAM) AC_SUBST(LISP) AC_SUBST(COMPRESSION) +AC_SUBST(REPRODUCIBLE) AC_SUBST(STUMPWM_ASDF_DIR) # Checks for programs. @@ -22,6 +23,11 @@ AC_ARG_ENABLE(compression, COMPRESSION="t", COMPRESSION="nil") +AC_ARG_ENABLE(reproducible, + [ --enable-reproducible create a reproducible build (doesn't include compilation date and time)], + REPRODUCIBLE="t", + REPRODUCIBLE="nil") + STUMPWM_ASDF_DIR="`pwd`" if test -x "$SBCL_PATH"; then @@ -63,3 +69,5 @@ AC_CONFIG_FILES([make-image.lisp]) AC_OUTPUT AC_CONFIG_FILES([load-stumpwm.lisp]) AC_OUTPUT +AC_CONFIG_FILES([version.lisp]) +AC_OUTPUT diff --git a/version.lisp b/version.lisp.in similarity index 59% rename from version.lisp rename to version.lisp.in index f9f050fe..367512f4 100644 --- a/version.lisp +++ b/version.lisp.in @@ -27,18 +27,18 @@ (export '(*version* version)) (defparameter *version* - #.(concatenate - 'string - (let* ((sys (asdf:find-system :stumpwm)) - (git-dir (probe-path (asdf:system-relative-pathname sys ".git")))) - (if git-dir - (string-trim '(#\Newline) - (run-shell-command - (format nil "GIT_DIR=~a git describe --tags" git-dir) t)) - (asdf:component-version sys))) - " Compiled On " - (format-expand *time-format-string-alist* - *time-format-string-default*))) + #.(let* ((sys (asdf:find-system :stumpwm)) + (git-dir (probe-path (asdf:system-relative-pathname sys ".git"))) + (ver (if git-dir + (string-trim '(#\Newline) + (run-shell-command + (format nil "GIT_DIR=~a git describe --tags" git-dir) t)) + (asdf:component-version sys)))) + (if @REPRODUCIBLE@ + (concatenate 'string ver " Reproducible Build") + (concatenate 'string ver " Compiled On " (format-expand + *time-format-string-alist* + *time-format-string-default*))))) (defcommand version () () "Print version information and compilation date." From bc13b087e7499d00e978c640f392e99176811642 Mon Sep 17 00:00:00 2001 From: "modula t. worm" Date: Fri, 9 Aug 2024 00:53:34 -0500 Subject: [PATCH 16/21] support `S-DEL` and `C-DEL` in `*input-map*` --- input.lisp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/input.lisp b/input.lisp index aa69563e..97cb4c68 100644 --- a/input.lisp +++ b/input.lisp @@ -158,7 +158,9 @@ and complete the input by mutating it.")) (defvar *input-map* (let ((map (make-sparse-keymap))) (define-key map (kbd "DEL") 'input-delete-backward-char) + (define-key map (kbd "S-DEL") 'input-delete-backward-char) (define-key map (kbd "M-DEL") 'input-backward-kill-word) + (define-key map (kbd "C-DEL") 'input-backward-kill-word) (define-key map (kbd "C-d") 'input-delete-forward-char) (define-key map (kbd "M-d") 'input-forward-kill-word) (define-key map (kbd "Delete") 'input-delete-forward-char) From 8388b9b992d8e842b9d98213f23d304435556f46 Mon Sep 17 00:00:00 2001 From: "Randy J. Ray" Date: Tue, 20 Aug 2024 17:38:13 -0700 Subject: [PATCH 17/21] Update stumpwm.texi.in Add blank line before `Frames` so that the generated documentation properly separates sections 6 (Windows) and 7 (Frames). --- stumpwm.texi.in | 1 + 1 file changed, 1 insertion(+) diff --git a/stumpwm.texi.in b/stumpwm.texi.in index 2b75202f..afdc7c48 100644 --- a/stumpwm.texi.in +++ b/stumpwm.texi.in @@ -162,6 +162,7 @@ Windows * Programming With Windows:: * Rule Based Window Placement:: * Window Selection Expressions:: + Frames * Interactively Resizing Frames:: From 42640bc4b9a3a65abc6d747a2d91f5792370b0e1 Mon Sep 17 00:00:00 2001 From: Luminous-99 Date: Mon, 16 Sep 2024 21:12:44 +0300 Subject: [PATCH 18/21] Some additional documentation for hooks --- primitives.lisp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/primitives.lisp b/primitives.lisp index 135e6a7f..65f220d0 100644 --- a/primitives.lisp +++ b/primitives.lisp @@ -247,16 +247,15 @@ appear for. This must be an integer. If falsy, default to *timeout-wait*.") "The background color of the grabbed pointer.") ;;; Hooks - (defvar *command-mode-start-hook* '(command-mode-start-message) - "A hook called whenever command mode is started") + "A hook called whenever command mode is started.") (defvar *command-mode-end-hook* '(command-mode-end-message) - "A hook called whenever command mode is ended") + "A hook called whenever command mode is ended.") (defvar *urgent-window-hook* '() "A hook called whenever a window sets the property indicating that - it demands the user's attention") + it demands the user's attention. Called with the window as an argument.") (defvar *map-window-hook* '() "A hook called whenever a window is mapped.") @@ -267,10 +266,11 @@ appear for. This must be an integer. If falsy, default to *timeout-wait*.") (defvar *new-window-hook* '() "A hook called whenever a window is added to the window list. This includes a genuinely new window as well as bringing a withdrawn window -back into the window list.") +back into the window list. Called with the window as an argument.") (defvar *destroy-window-hook* '() - "A hook called whenever a window is destroyed or withdrawn.") + "A hook called whenever a window is destroyed or withdrawn. +Called with the window as an argument.") (defvar *focus-window-hook* '() "A hook called when a window is given focus. It is called with 2 @@ -278,7 +278,7 @@ arguments: the current window and the last window (could be nil).") (defvar *place-window-hook* '() "A hook called whenever a window is placed by rule. Arguments are -window group and frame") +window, group and frame.") (defvar *pre-thread-hook* '() "A hook called before any threads are started. Useful if you need to fork.") @@ -375,7 +375,6 @@ with 1 argument: the menu.") (defvar *new-head-hook* '() "A hook called whenever a head is added. It is called with 2 arguments: the new head and the current screen.") - ;; Data types and globals used by stumpwm (defvar *display* nil From 4109df85d319ddd852a47929ba57a25b65c23583 Mon Sep 17 00:00:00 2001 From: "Kirill A. Korinsky" Date: Wed, 9 Oct 2024 01:22:27 +0200 Subject: [PATCH 19/21] Reset uiop/asdf after load an image When stumpwm is built in some sort of fake environment the resulted image contains cached path to that fake enviroment which migth broke quicklisp. Here I call a standard callback which is used by uiop for :toplevel function, and, additionally clear asdf configuration from build system and reset it. --- make-image.lisp.in | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/make-image.lisp.in b/make-image.lisp.in index 2cfdc1db..c701d5c2 100644 --- a/make-image.lisp.in +++ b/make-image.lisp.in @@ -50,6 +50,16 @@ (uiop:symbol-call '#:asdf '#:register-immutable-system system-name))) (sb-ext:save-lisp-and-die "stumpwm" :toplevel (lambda () + ;; stumpwm migth be build in fake enviroment, so use uiop:restore-image + ;; to compute real uiop:*user-cache* on that user + (uiop:restore-image) + ;; and clean asdf configuration to avoid some cached paths as well + (asdf:clear-configuration) + (asdf:clear-output-translations) + (asdf:initialize-output-translations + '(:output-translations + :enable-user-cache + :ignore-inherited-configuration)) ;; asdf requires sbcl_home to be set, so set it to the value when the image was built (alexandria:when-let ((home #.(sb-ext:posix-getenv "SBCL_HOME"))) (sb-posix:putenv (format nil "SBCL_HOME=~A" home))) From 3608b089f0d89c83f78125b93127932ccb9e61b3 Mon Sep 17 00:00:00 2001 From: David <171410+dmb2@users.noreply.github.com> Date: Sat, 19 Oct 2024 09:19:51 -0400 Subject: [PATCH 20/21] Revert "Supporting reproducible builds." --- configure.ac | 8 -------- version.lisp.in => version.lisp | 24 ++++++++++++------------ 2 files changed, 12 insertions(+), 20 deletions(-) rename version.lisp.in => version.lisp (59%) diff --git a/configure.ac b/configure.ac index 510f53ed..a198d4d5 100644 --- a/configure.ac +++ b/configure.ac @@ -8,7 +8,6 @@ AC_SUBST(MODULE_DIR) AC_SUBST(LISP_PROGRAM) AC_SUBST(LISP) AC_SUBST(COMPRESSION) -AC_SUBST(REPRODUCIBLE) AC_SUBST(STUMPWM_ASDF_DIR) # Checks for programs. @@ -23,11 +22,6 @@ AC_ARG_ENABLE(compression, COMPRESSION="t", COMPRESSION="nil") -AC_ARG_ENABLE(reproducible, - [ --enable-reproducible create a reproducible build (doesn't include compilation date and time)], - REPRODUCIBLE="t", - REPRODUCIBLE="nil") - STUMPWM_ASDF_DIR="`pwd`" if test -x "$SBCL_PATH"; then @@ -69,5 +63,3 @@ AC_CONFIG_FILES([make-image.lisp]) AC_OUTPUT AC_CONFIG_FILES([load-stumpwm.lisp]) AC_OUTPUT -AC_CONFIG_FILES([version.lisp]) -AC_OUTPUT diff --git a/version.lisp.in b/version.lisp similarity index 59% rename from version.lisp.in rename to version.lisp index 367512f4..f9f050fe 100644 --- a/version.lisp.in +++ b/version.lisp @@ -27,18 +27,18 @@ (export '(*version* version)) (defparameter *version* - #.(let* ((sys (asdf:find-system :stumpwm)) - (git-dir (probe-path (asdf:system-relative-pathname sys ".git"))) - (ver (if git-dir - (string-trim '(#\Newline) - (run-shell-command - (format nil "GIT_DIR=~a git describe --tags" git-dir) t)) - (asdf:component-version sys)))) - (if @REPRODUCIBLE@ - (concatenate 'string ver " Reproducible Build") - (concatenate 'string ver " Compiled On " (format-expand - *time-format-string-alist* - *time-format-string-default*))))) + #.(concatenate + 'string + (let* ((sys (asdf:find-system :stumpwm)) + (git-dir (probe-path (asdf:system-relative-pathname sys ".git")))) + (if git-dir + (string-trim '(#\Newline) + (run-shell-command + (format nil "GIT_DIR=~a git describe --tags" git-dir) t)) + (asdf:component-version sys))) + " Compiled On " + (format-expand *time-format-string-alist* + *time-format-string-default*))) (defcommand version () () "Print version information and compilation date." From 0bad08ed095274296d2cb02056ddfd7bf2d305ea Mon Sep 17 00:00:00 2001 From: David <171410+dmb2@users.noreply.github.com> Date: Sat, 19 Oct 2024 09:40:54 -0400 Subject: [PATCH 21/21] Update make-image.lisp.in Fixed a few typos in comments --- make-image.lisp.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/make-image.lisp.in b/make-image.lisp.in index c701d5c2..2f4d263b 100644 --- a/make-image.lisp.in +++ b/make-image.lisp.in @@ -50,17 +50,17 @@ (uiop:symbol-call '#:asdf '#:register-immutable-system system-name))) (sb-ext:save-lisp-and-die "stumpwm" :toplevel (lambda () - ;; stumpwm migth be build in fake enviroment, so use uiop:restore-image - ;; to compute real uiop:*user-cache* on that user + ;; stumpwm might be built in a fake enviroment, so use uiop:restore-image + ;; to compute the real uiop:*user-cache* for that user (uiop:restore-image) - ;; and clean asdf configuration to avoid some cached paths as well + ;; and clean the asdf configuration to avoid some cached paths as well (asdf:clear-configuration) (asdf:clear-output-translations) (asdf:initialize-output-translations '(:output-translations :enable-user-cache :ignore-inherited-configuration)) - ;; asdf requires sbcl_home to be set, so set it to the value when the image was built + ;; asdf requires SBCL_HOME to be set, so set it to the value when the image was built (alexandria:when-let ((home #.(sb-ext:posix-getenv "SBCL_HOME"))) (sb-posix:putenv (format nil "SBCL_HOME=~A" home))) (stumpwm:stumpwm)