[sawfish] UTF-8 Support in Windowmenus [Wang Diancheng]



commit c05f39139ca7ee9d67a09969801827d085fe8222
Author: chrisb <zanghar freenet de>
Date:   Sun May 31 12:18:25 2009 +0200

    UTF-8 Support in Windowmenus [Wang Diancheng]
---
 ChangeLog                               |    4 ++++
 lisp/sawfish/wm/ext/beos-window-menu.jl |    5 +++--
 lisp/sawfish/wm/util/groups.jl          |    5 +++--
 man/news.texi                           |    2 ++
 4 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c20b39b..0c75063 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-05-30  Christopher Bratusek <zanghar freenet de>
+	* lisp/sawfish/wm/goups.jl
+	* lisp/sawfish/wm/ext/beos-window-menu.jl: UTF-8 Support [Wang Diancheng]
+
 2009-05-27  Christopher Bratusek <zanghar freenet de>
 	* lisp/sawfish/wm/util/prompt.jl: fixed typo
 
diff --git a/lisp/sawfish/wm/ext/beos-window-menu.jl b/lisp/sawfish/wm/ext/beos-window-menu.jl
index a221f92..1cd39f2 100644
--- a/lisp/sawfish/wm/ext/beos-window-menu.jl
+++ b/lisp/sawfish/wm/ext/beos-window-menu.jl
@@ -25,6 +25,7 @@
     (export beos-window-menu)
 
     (open rep
+	  rep.util.utf8
 	  sawfish.wm.windows
 	  sawfish.wm.misc
 	  sawfish.wm.custom
@@ -38,8 +39,8 @@
 
   (define (abbreviate name #!optional len)
     (unless len (setq len 20))
-    (if (> (length name) len)
-	(concat (substring name 0 len) "...")
+    (if (> (utf8-string-length name) len)
+	(concat (utf8-substring name 0 len) "...")
       name))
 
   (define (make-label w)
diff --git a/lisp/sawfish/wm/util/groups.jl b/lisp/sawfish/wm/util/groups.jl
index 6b53477..970cf92 100644
--- a/lisp/sawfish/wm/util/groups.jl
+++ b/lisp/sawfish/wm/util/groups.jl
@@ -51,6 +51,7 @@
 	    window-group-menu)
 
     (open rep
+	  rep.util.utf8
 	  rep.system
 	  sawfish.wm.misc
 	  sawfish.wm.events
@@ -140,9 +141,9 @@ id of the new group."
 		(let ((name (if (symbolp id)
 				(symbol-name id)
 			      (cdr (assq id group-names)))))
-		  (when (> (length name) 20)
+		  (when (> (utf8-string-length name) 20)
 		    (setq name (concat
-				(substring name 0 20) "...")))
+				(utf8-substring name 0 20) "...")))
 		  (list (quote-menu-item name)
 			(lambda ()
 			  (add-window-to-group w id))
diff --git a/man/news.texi b/man/news.texi
index 4f199e6..67ce970 100644
--- a/man/news.texi
+++ b/man/news.texi
@@ -73,6 +73,8 @@ To use the old style, put @code{(define-special-variable customize-program "sawf
 @item New features:
 @itemize @minus
 
+ item UTF-8 Support in Windowmenus [Wang Diancheng]
+
 @item Tabbed Windowing Support [Yann Hodique, Scott Scriven, Nathan Froyd, Christopher Bratusek]
 
 @item Tabbed Windowing Support: Raise Tabs on hover [Christopher Bratusek]



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]