From a50a86243989164aa9a896750b160f9cc51107d4 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 16 May 2013 19:58:00 +0200 Subject: Add stumpwm-scm --- .../x11-wm/stumpwm/files/stumpwm-printing.patch | 77 ++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 packages/x11-wm/stumpwm/files/stumpwm-printing.patch (limited to 'packages/x11-wm/stumpwm/files/stumpwm-printing.patch') diff --git a/packages/x11-wm/stumpwm/files/stumpwm-printing.patch b/packages/x11-wm/stumpwm/files/stumpwm-printing.patch new file mode 100644 index 0000000..bea70b1 --- /dev/null +++ b/packages/x11-wm/stumpwm/files/stumpwm-printing.patch @@ -0,0 +1,77 @@ +Source: Elias Pipping +Upstream: no (pasted on irc) +Reason: A window whose title contains the string ^\ cannot have it printed + +From 56b478ae447ca8bf4b0d6d80e10fe00fb1c8d95b Mon Sep 17 00:00:00 2001 +From: Elias Pipping +Date: Sat, 5 Jan 2013 22:03:53 +0100 +Subject: [PATCH 1/2] Typo + +--- + primitives.lisp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/primitives.lisp b/primitives.lisp +index 50d062e..3d42012 100644 +--- a/primitives.lisp ++++ b/primitives.lisp +@@ -753,7 +753,7 @@ do: + (format t "%~a~@[~a~]" len from-left-p) + (let* ((fmt (cadr (assoc (car cur) fmt-alist :test 'char=))) + (str (cond (fmt +- ;; it can return any type, not jut as string. ++ ;; it can return any type, not just a string. + (format nil "~a" (apply fmt args))) + ((char= (car cur) #\%) + (string #\%)) +-- +1.8.0.3 + +From db588e4393567b3016c2be57511d35d3c01e4e46 Mon Sep 17 00:00:00 2001 +From: Elias Pipping +Date: Sat, 5 Jan 2013 22:08:11 +0100 +Subject: [PATCH 2/2] Escape window information before printing + +Otherwise, a window with a title like ^\ will wreak havoc when +echo-string-list fails to parse it. +--- + primitives.lisp | 16 ++++++++++++++-- + 1 file changed, 14 insertions(+), 2 deletions(-) + +diff --git a/primitives.lisp b/primitives.lisp +index 3d42012..88b45d4 100644 +--- a/primitives.lisp ++++ b/primitives.lisp +@@ -732,6 +732,15 @@ do: + ;;; + ;;; formatting routines + ++(defun escape-string (str) ++ (let (buf) ++ (map nil #'(lambda (ch) ++ (push ch buf) ++ (when (char= ch #\^) ++ (push ch buf))) ++ str) ++ (coerce (reverse buf) 'string))) ++ + (defun format-expand (fmt-alist fmt &rest args) + (let* ((chars (coerce fmt 'list)) + (output "") +@@ -753,8 +762,11 @@ do: + (format t "%~a~@[~a~]" len from-left-p) + (let* ((fmt (cadr (assoc (car cur) fmt-alist :test 'char=))) + (str (cond (fmt +- ;; it can return any type, not just a string. +- (format nil "~a" (apply fmt args))) ++ ;; Any sequence that could be interpreted as ++ ;; a colorisation directive is escaped here ++ (escape-string ++ ;; it can return any type, not just a string. ++ (format nil "~a" (apply fmt args)))) + ((char= (car cur) #\%) + (string #\%)) + (t +-- +1.8.0.3 + -- cgit v1.2.3-54-g00ecf