Re: New tab themes



fuchur <flohtransporter gmail com> writes:

> Hi,
>
> On Mon, 7 Feb 2011 20:38:19 +0100
> wrote Christopher Roy Bratusek <nano tuxfamily org>:
>
>>Ahhh... commited without testing (...)
>>
>>Dark and DarkColor are somewhat blurry now... could you fix it?
>>Else... keep up the good work :)
>
> After build from git i can't start sawfish. I got:
>
>
> rep: using deprecated feature - `0xNN' hexadecimal read syntax
>
> Lisp backtrace:
> #12  string-match ...
> #11  string-split ...
> #10  split-desktop-entry ...
> #9   fdo-menu-entry ...
> #8   generate-apps-menu ...
> #7   update-apps-menu ...
> #6   run-byte-code ...
> #4   make-structure (() #<closure 8143028 @ user> #<closure 814303c @
> user> user) #2   load ...
> #1   run-byte-code ...
>
> error--> (bad-arg #<subr string-match> () 2)
>
>
> If i can start sawfish i will try to fix it ;).

Wondering how an entry got past the exile stage in filtering to be able
to get to this error, I noticed that while the exiling would check for
the existence of the "Categories" entry in the desktop file, it would
not check the entry of that key, allowing nonstrings (possibly nothing),
to be passed through, which is what i suspect has happened here.  I
added into the 'check-fdo-exile function the checking '(stringp) of the
"Categories" entry to make sure it is a valid one.  This should fix this
bug.

This also moves the 'Emulator' subcategory from 'Games' to 'System'.

Cheers

-- 
Matthew

diff --git a/lisp/sawfish/wm/ext/apps-menu.jl b/lisp/sawfish/wm/ext/apps-menu.jl
index 782d05f..0c4b4d0 100644
--- a/lisp/sawfish/wm/ext/apps-menu.jl
+++ b/lisp/sawfish/wm/ext/apps-menu.jl
@@ -107,7 +107,7 @@ filtering on the `apps-menu'.")
 		     "X-Internet" "P2P" "Email" "WebBrowser" "IRCClient"
 		     "Chat" "InstantMessaging" "Chat" "WebDevelopment"))
       ("Games" . ("Game" "ActionGame" "AdventureGame" "ArcadeGame"
-		  "BoardGame" "Emulator" "BlocksGame" "CardGame" "KidsGame"
+		  "BoardGame" "BlocksGame" "CardGame" "KidsGame"
 		  "LogicGame" "RolePlaying"))
       ("Graphics" . ("RasterGraphics" "VectorGraphics" "X-GraphicUtility"
 		     "2DGraphics" "3dGraphics" "3DGraphics" "Scanning"
@@ -128,7 +128,7 @@ filtering on the `apps-menu'.")
 		    "TelephonyTools" "Accessibility" "Clock" "ConsoleOnly"))
       ("Filesystem" . ("X-FileSystemFind" "X-FileSystemUtility" "Archiving"
 		       "FileManager" "X-FileSystemMount" "Compression"))
-      ("System" . ("X-SystemSchedule" "System" "X-SystemMemory"
+      ("System" . ("X-SystemSchedule" "System" "X-SystemMemory" "Emulator"
 		   "TerminalEmulator" "Printing" "Monitor" "Security"))
       ("Settings" . ("Settings" "HardwareSettings" "PackageManager" 
 		     "X-GNOME-PersonalSettings" "DesktopSettings"))
@@ -178,7 +178,7 @@ Returns (key . value)"
     (substring instring 1 (- (length instring) 2)))
   
   (define (parse-fdo-file-line infile)
-    "Parse a `*.desktop' file line.
+    "Parse a `*.desktop' file list.
 Returns (group1 (key1 . value1) ... group2 (keyA . valueA) ...)"
     (when (setq this-line (read-line infile))
       (if (not (fdo-skip-line-p this-line))
@@ -223,6 +223,8 @@ files in those direcories with their full pathnames.  Optionally
 	  (t (append (flatten (car input))
 		     (flatten (cdr input))))))
 
+  ;; language functions
+
   (defmacro simplify-mlang (mlang mlevel)
     `(and
       ,(cond 
@@ -361,7 +363,9 @@ with caution, file may be corrupt.\n"))
 exile it."
     (when fdo-list
       (if (or (and (not (assoc "Categories" fdo-list))
-		   (not (assoc "Category" fdo-list)))
+		   (not (stringp (cdr (assoc "Categories" fdo-list))))
+		   (not (assoc "Category" fdo-list))
+		   (not (stringp (cdr (assoc "Categories" fdo-list)))))
 	      (not (assoc "Exec" fdo-list))
 	      (and (not (assoc "Name" fdo-list))
 		   (not (assoc (concat name-string
@@ -375,7 +379,8 @@ exile it."
     (when fdo-list
       (if (assoc "Category" fdo-list)
 	  (if (or (not (stringp (cdr (assoc "Category" fdo-list))))
-		  (equal "" (cdr (assoc "Category" fdo-list))))
+		  (equal "" (cdr (assoc "Category" fdo-list)))
+		  (not (stringp (cdr (assoc "Category" fdo-list)))))
 	      (rplacd (assoc "Category" fdo-list) "Exile"))
 	(append fdo-list (cons (cons "Category" "Exile")))))
       fdo-list)


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