** New mode 'conf-toml-mode' is a sub-mode of conf-mode, specialized
for editing TOML files.
+** New mode 'conf-desktop-mode' is a sub-mode of conf-unix-mode,
+specialized for editing freedesktop.org desktop entries.
+
** New minor mode 'pixel-scroll-mode' provides smooth pixel-level scrolling.
** New major mode 'less-css-mode' (a minor variant of 'css-mode') for
("/config\\.\\(?:bat\\|log\\)\\'" . fundamental-mode)
;; Windows candidates may be opened case sensitively on Unix
("\\.\\(?:[iI][nN][iI]\\|[lL][sS][tT]\\|[rR][eE][gG]\\|[sS][yY][sS]\\)\\'" . conf-mode)
- ("\\.\\(?:desktop\\|la\\)\\'" . conf-unix-mode)
+ ("\\.la\\'" . conf-unix-mode)
("\\.ppd\\'" . conf-ppd-mode)
("java.+\\.conf\\'" . conf-javaprop-mode)
("\\.properties\\(?:\\.[a-zA-Z0-9._-]+\\)?\\'" . conf-javaprop-mode)
("\\.toml\\'" . conf-toml-mode)
+ ("\\.desktop\\'" . conf-desktop-mode)
("\\`/etc/\\(?:DIR_COLORS\\|ethers\\|.?fstab\\|.*hosts\\|lesskey\\|login\\.?de\\(?:fs\\|vperm\\)\\|magic\\|mtab\\|pam\\.d/.*\\|permissions\\(?:\\.d/.+\\)?\\|protocols\\|rpc\\|services\\)\\'" . conf-space-mode)
("\\`/etc/\\(?:acpid?/.+\\|aliases\\(?:\\.d/.+\\)?\\|default/.+\\|group-?\\|hosts\\..+\\|inittab\\|ksysguarddrc\\|opera6rc\\|passwd-?\\|shadow-?\\|sysconfig/.+\\)\\'" . conf-mode)
;; ChangeLog.old etc. Other change-log-mode entries are above;
("\\_<false\\|true\\_>" 0 'font-lock-keyword-face))
"Keywords to highlight in Conf TOML mode.")
+(defvar conf-desktop-font-lock-keywords
+ `(,@conf-font-lock-keywords
+ ("\\_<false\\|true\\_>" 0 'font-lock-constant-face)
+ ("\\_<%[uUfFick%]\\_>" 0 'font-lock-constant-face))
+ "Keywords to highlight in Conf Desktop mode.")
+
(defvar conf-assignment-sign ?=
"Sign used for assignments (char or string).")
;;;###autoload
(define-derived-mode conf-unix-mode conf-mode "Conf[Unix]"
"Conf Mode starter for Unix style Conf files.
-Comments start with `#'.
-For details see `conf-mode'. Example:
-
-# Conf mode font-locks this right on Unix and with \\[conf-unix-mode]
-
-[Desktop Entry]
- Encoding=UTF-8
- Name=The GIMP
- Name[ca]=El GIMP
- Name[cs]=GIMP"
+Comments start with `#'. For details see `conf-mode'."
(conf-mode-initialize "#"))
;;;###autoload
(setq-local conf-assignment-column 0)
(setq-local conf-assignment-sign ?=))
+;;;###autoload
+(define-derived-mode conf-desktop-mode conf-unix-mode "Conf[Desktop]"
+ "Conf Mode started for freedesktop.org Desktop files.
+Comments start with `#' and \"assignments\" are with `='.
+For details see `conf-mode'.
+
+# Conf mode font-locks this correctly with \\[conf-desktop-mode]
+ [Desktop Entry]
+ Name=GNU Image Manipulation Program
+ Name[oc]=Editor d'imatge GIMP
+ Exec=gimp-2.8 %U
+ Terminal=false"
+ (conf-mode-initialize "#" 'conf-desktop-font-lock-keywords)
+ (conf-quote-normal nil))
+
(provide 'conf-mode)
;;; conf-mode.el ends here