CVS update by scop packages/xemacs-packages/text-modes,
desktop-entry-mode.el ...
xemacs-cvs at xemacs.org
xemacs-cvs at xemacs.org
Sat Jun 30 07:52:11 EDT 2007
User: scop
Date: 07/06/30 13:52:11
Modified: packages/xemacs-packages/text-modes ChangeLog
desktop-entry-mode.el
Log:
desktop-entry-mode 1.0: highlights deprecated and unknown keys
Revision Changes Path
1.168 +5 -0 XEmacs/packages/xemacs-packages/text-modes/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/text-modes/ChangeLog,v
retrieving revision 1.167
retrieving revision 1.168
diff -u -p -r1.167 -r1.168
--- ChangeLog 2007/05/02 10:48:56 1.167
+++ ChangeLog 2007/06/30 11:52:09 1.168
@@ -1,3 +1,8 @@
+2007-06-30 Ville Skyttä <scop at xemacs.org>
+
+ * desktop-entry-mode.el: Update to 1.0, adds highlighting of
+ deprecated and unknown keys.
+
2007-05-02 Norbert Koch <viteno at xemacs.org>
* Makefile (VERSION): XEmacs package 1.94 released.
1.7 +34 -7 XEmacs/packages/xemacs-packages/text-modes/desktop-entry-mode.el
Index: desktop-entry-mode.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/text-modes/desktop-entry-mode.el,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- desktop-entry-mode.el 2006/10/31 22:00:41 1.6
+++ desktop-entry-mode.el 2007/06/30 11:52:09 1.7
@@ -1,6 +1,6 @@
;;; desktop-entry-mode.el --- freedesktop.org desktop entry editing
-;; Copyright (C) 2003-2004, 2006, Ville Skyttä <scop at xemacs.org>
+;; Copyright (C) 2003-2004, 2006-2007 Ville Skyttä <scop at xemacs.org>
;; Author: Ville Skyttä <scop at xemacs.org>
;; Keywords: unix, desktop entry
@@ -45,11 +45,14 @@
;; For more information about desktop entry files, see
;; <http://www.freedesktop.org/Standards/desktop-entry-spec>
;;
-;; This version is up to date with version 0.9.8 of the specification.
+;; This version is up to date with version 1.0 of the specification.
;;; Code:
-(defconst desktop-entry-mode-version "0.98 (spec 0.9.8)"
+(eval-when-compile
+ (require 'regexp-opt))
+
+(defconst desktop-entry-mode-version "1.0 (spec 1.0)"
"Version of `desktop-entry-mode'.")
(defgroup desktop-entry nil
@@ -74,6 +77,19 @@
"*Face for highlighting desktop entry group headers."
:group 'desktop-entry-faces)
+(defface desktop-entry-deprecated-keyword-face
+ '((((class color)) (:background "yellow" :foreground "black" :strikethru t))
+ )
+ "*Face for highlighting deprecated desktop entry keys."
+:group 'desktop-entry-faces)
+
+(defface desktop-entry-unknown-keyword-face
+ '((((class color)) (:foreground "red3" :underline t))
+ (t (:underline t))
+ )
+ "*Face for highlighting unknown desktop entry keys."
+:group 'desktop-entry-faces)
+
(defface desktop-entry-value-face
'((((class color) (background light)) (:foreground "darkgreen"))
(((class color) (background dark)) (:foreground "lightgreen"))
@@ -90,7 +106,6 @@
(defconst desktop-entry-keywords
(eval-when-compile
- (require 'regexp-opt)
(concat
"\\(?:"
(regexp-opt
@@ -125,7 +140,16 @@
"MountPoint"
"ReadOnly"
"UnmountIcon"
- ;; Deprecated
+ ) 'words)
+ "\\|X-[A-Za-z0-9-]+\\)"))
+ "Expression for matching desktop entry keys.")
+
+(defconst desktop-entry-deprecated-keywords
+ (eval-when-compile
+ (concat
+ "\\(\\<Type\\s-*=\\s-*MimeType\\>\\|"
+ (regexp-opt
+ '(
"Patterns"
"DefaultApp"
"Encoding"
@@ -140,8 +164,8 @@
"SortOrder"
"FilePattern"
) 'words)
- "\\|X-[A-Za-z0-9-]+\\)"))
- "Expression for matching desktop entry keys.")
+ "\\)"))
+ "Expression for matching deprecated desktop entry keys.")
(defconst desktop-entry-group-header-re
"^\\[\\(X-[^\][]+\\|\\(?:Desktop \\(?:Entry\\|Action [a-zA-Z]+\\)\\)\\)\\]"
@@ -150,7 +174,10 @@
(defconst desktop-entry-font-lock-keywords
(list
(cons "^\\s-*#.*$" '(0 'font-lock-comment-face))
+ (cons (concat "^" desktop-entry-deprecated-keywords)
+ '(0 'desktop-entry-deprecated-keyword-face))
(cons (concat "^" desktop-entry-keywords) '(0 'font-lock-keyword-face))
+ (cons "^[A-Za-z0-9-]+" '(0 'desktop-entry-unknown-keyword-face))
(cons desktop-entry-group-header-re '(1 'desktop-entry-group-header-face))
(cons "^[A-Za-z0-9-]+?\\s-*=\\s-*\\(.*\\)"
'(1 'desktop-entry-value-face))
More information about the XEmacs-CVS
mailing list