Commit d902d95e authored by Stefan Monnier's avatar Stefan Monnier
Browse files

Don't use font-lock-defaults-alist.

Various docstring and line-width fixups.
(conf-mode): Use cond.
Set font-lock-defaults.  Don't set comment-use-syntax.
parent 42fbd808
2005-10-18 Stefan Monnier <monnier@iro.umontreal.ca>
* textmodes/conf-mode.el: Don't use font-lock-defaults-alist.
Various docstring and line-width fixups.
(conf-mode): Use cond.
Set font-lock-defaults. Don't set comment-use-syntax.
2005-10-18 David Ponce <david@dponce.com>
* tree-widget.el (tree-widget-button-click): New function.
......@@ -42,7 +49,7 @@
2005-10-17 Chong Yidong <cyd@stupidchicken.com>
* cus-edit.el (Custom-move-and-invoke): Deleted.
* cus-edit.el (Custom-move-and-invoke): Delete.
(custom-mode-map): Bind mouse-1 to widget-move-and-invoke.
* wid-edit.el (widget-move-and-invoke): New function, from
......@@ -50,9 +57,9 @@
2005-10-17 Bill Wohler <wohler@newt.com>
Moved all remaining images from lisp/toolbar to etc/images, moved
lisp/toolbar/tool-bar to lisp and "deleted" lisp/toolbar. The low
resolution images were placed in their own directory (low-color).
Move all remaining images from lisp/toolbar to etc/images, move
lisp/toolbar/tool-bar to lisp and "delete" lisp/toolbar. Place
the low resolution images in their own directory (low-color).
* toolbar/attach.*, toolbar/cancel.*, toolbar/close.*,
* toolbar/copy.*, toolbar/cut.*, toolbar/diropen.*, toolbar/exit.*:
......@@ -60,56 +67,52 @@
* toolbar/mail.*, toolbar/new.*, toolbar/open.*, toolbar/paste.*:
* toolbar/preferences.*, toolbar/print.*, toolbar/save.*:
* toolbar/saveas.*, toolbar/search.*, toolbar/search-replace.*:
* toolbar/spell.*, toolbar/undo.*: Moved to etc/images.
* toolbar/lc-copy.*: Moved to etc/images/low-color/copy.*.
* toolbar/lc-cut.*: Moved to etc/images/low-color/cut.*.
* toolbar/lc-help.*: Moved to etc/images/low-color/help.*.
* toolbar/lc-home.*: Moved to etc/images/low-color/home.*.
* toolbar/lc-index.*: Moved to etc/images/low-color/index.*.
* toolbar/lc-new.*: Moved to etc/images/low-color/new.*.
* toolbar/lc-open.*: Moved to etc/images/low-color/open.*.
* toolbar/lc-paste.*: Moved to etc/images/low-color/paste.*.
* toolbar/lc-preferences.*: Moved to
etc/images/low-color/preferences.*.
* toolbar/lc-print.*: Moved to etc/images/low-color/print.*.
* toolbar/lc-save.*: Moved to etc/images/low-color/save.*.
* toolbar/lc-saveas.*: Moved to etc/images/low-color/saveas.*.
* toolbar/lc-search.*: Moved to etc/images/low-color/search.*.
* toolbar/lc-spell.*: Moved to etc/images/low-color/spell.*.
* toolbar/lc-undo.*: Moved to etc/images/low-color/undo.*.
To conform with convention, the underscore (_) in the following
image names were replaced with dash (-) or (/) as appropriate.
* toolbar/back_arrow.*: Moved to etc/images/back-arrow.*.
* toolbar/fld_open.*: Moved to etc/images/fld-open.*.
* toolbar/fwd_arrow.*: Moved to etc/images/fwd-arrow.*.
* toolbar/jump_to.*: Moved to etc/images/jump-to.*.
* toolbar/left_arrow.*: Moved to etc/images/left-arrow.*.
* toolbar/right_arrow.*: Moved to etc/images/right-arrow.*.
* toolbar/up_arrow.*: Moved to etc/images/up-arrow.*.
* toolbar/lc-back_arrow.*.: Moved to etc/images/low-color/back-arrow.*.
* toolbar/lc-fwd_arrow.*.: Moved to etc/images/low-color/fwd-arrow.*.
* toolbar/lc-jump_to.*: Moved to etc/images/low-color/jump-to.*.
* toolbar/lc-left_arrow.*.: Moved to etc/images/low-color/left-arrow.*.
* toolbar/lc-right_arrow.*.: Moved to
etc/images/low-color/right-arrow.*.
* toolbar/lc-up_arrow.*: Moved to etc/images/low-color/up-arrow.*.
* toolbar/mail_compose.*.: Moved to etc/images/mail/compose.*.
* toolbar/mail_send.*: Moved to etc/images/mail/send.*.
* info.el (info-tool-bar-map): Replaced underscores in image names
* toolbar/spell.*, toolbar/undo.*: Move to etc/images.
* toolbar/lc-copy.*: Move to etc/images/low-color/copy.*.
* toolbar/lc-cut.*: Move to etc/images/low-color/cut.*.
* toolbar/lc-help.*: Move to etc/images/low-color/help.*.
* toolbar/lc-home.*: Move to etc/images/low-color/home.*.
* toolbar/lc-index.*: Move to etc/images/low-color/index.*.
* toolbar/lc-new.*: Move to etc/images/low-color/new.*.
* toolbar/lc-open.*: Move to etc/images/low-color/open.*.
* toolbar/lc-paste.*: Move to etc/images/low-color/paste.*.
* toolbar/lc-preferences.*: Move to etc/images/low-color/preferences.*.
* toolbar/lc-print.*: Move to etc/images/low-color/print.*.
* toolbar/lc-save.*: Move to etc/images/low-color/save.*.
* toolbar/lc-saveas.*: Move to etc/images/low-color/saveas.*.
* toolbar/lc-search.*: Move to etc/images/low-color/search.*.
* toolbar/lc-spell.*: Move to etc/images/low-color/spell.*.
* toolbar/lc-undo.*: Move to etc/images/low-color/undo.*.
To conform with convention, replace the underscore (_) in the
following image names with dash (-) or (/) as appropriate.
* toolbar/back_arrow.*: Move to etc/images/back-arrow.*.
* toolbar/fld_open.*: Move to etc/images/fld-open.*.
* toolbar/fwd_arrow.*: Move to etc/images/fwd-arrow.*.
* toolbar/jump_to.*: Move to etc/images/jump-to.*.
* toolbar/left_arrow.*: Move to etc/images/left-arrow.*.
* toolbar/right_arrow.*: Move to etc/images/right-arrow.*.
* toolbar/up_arrow.*: Move to etc/images/up-arrow.*.
* toolbar/lc-back_arrow.*: Move to etc/images/low-color/back-arrow.*.
* toolbar/lc-fwd_arrow.*: Move to etc/images/low-color/fwd-arrow.*.
* toolbar/lc-jump_to.*: Move to etc/images/low-color/jump-to.*.
* toolbar/lc-left_arrow.*: Move to etc/images/low-color/left-arrow.*.
* toolbar/lc-right_arrow.*: Move to etc/images/low-color/right-arrow.*.
* toolbar/lc-up_arrow.*: Move to etc/images/low-color/up-arrow.*.
* toolbar/mail_compose.*: Move to etc/images/mail/compose.*.
* toolbar/mail_send.*: Move to etc/images/mail/send.*.
* info.el (info-tool-bar-map): Replace underscores in image names
with dashes.
* makefile.w32-in (WINS): Removed toolbar.
* makefile.w32-in (WINS): Remove toolbar.
* menu-bar.el: Replaced toolbar/tool-bar.el with tool-bar.el in
comment.
* menu-bar.el: Replace toolbar/tool-bar.el with tool-bar.el in comment.
* tool-bar.el: Moved to lisp from toolbar. Now that
toolbar is empty, it should be deleted when folks run "cvs up
-P".
* tool-bar.el: Move to lisp from toolbar. Now that
toolbar is empty, it should be deleted when folks run "cvs up -P".
2005-10-18 Jay Belanger <belanger@truman.edu>
......
......@@ -86,7 +86,7 @@ not align (only setting space according to `conf-assignment-space')."
(define-key map "\C-c'" 'conf-quote-normal)
(define-key map "\C-c\C-a" 'conf-align-assignments)
map)
"Local keymap for conf-mode buffers.")
"Local keymap for `conf-mode' buffers.")
(defvar conf-mode-syntax-table
(let ((table (make-syntax-table)))
......@@ -99,7 +99,7 @@ not align (only setting space according to `conf-assignment-space')."
(modify-syntax-entry ?\n ">" table)
(modify-syntax-entry ?\r ">" table)
table)
"Syntax table in use in Windows style conf-mode buffers.")
"Syntax table in use in Windows style `conf-mode' buffers.")
(defvar conf-unix-mode-syntax-table
(let ((table (make-syntax-table conf-mode-syntax-table)))
......@@ -107,7 +107,7 @@ not align (only setting space according to `conf-assignment-space')."
;; override
(modify-syntax-entry ?\; "." table)
table)
"Syntax table in use in Unix style conf-mode buffers.")
"Syntax table in use in Unix style `conf-mode' buffers.")
(defvar conf-javaprop-mode-syntax-table
(let ((table (make-syntax-table conf-unix-mode-syntax-table)))
......@@ -124,7 +124,7 @@ not align (only setting space according to `conf-assignment-space')."
(modify-syntax-entry ?\' "." table)
(modify-syntax-entry ?\; "." table)
table)
"Syntax table in use in PPD conf-mode buffers.")
"Syntax table in use in PPD `conf-mode' buffers.")
(defvar conf-xdefaults-mode-syntax-table
(let ((table (make-syntax-table conf-mode-syntax-table)))
......@@ -132,7 +132,7 @@ not align (only setting space according to `conf-assignment-space')."
;; override
(modify-syntax-entry ?\; "." table)
table)
"Syntax table in use in Xdefaults style conf-mode buffers.")
"Syntax table in use in Xdefaults style `conf-mode' buffers.")
(defvar conf-font-lock-keywords
......@@ -144,7 +144,7 @@ not align (only setting space according to `conf-assignment-space')."
(2 'font-lock-constant-face nil t))
;; section { ... } (do this last because some assign ...{...)
("^[ \t]*\\([^=:\n]+?\\)[ \t\n]*{[^{}]*?$" 1 'font-lock-type-face prepend))
"Keywords to hilight in Conf mode")
"Keywords to hilight in Conf mode.")
(defvar conf-javaprop-font-lock-keywords
'(;; var=val
......@@ -156,7 +156,7 @@ not align (only setting space according to `conf-assignment-space')."
(5 'font-lock-variable-name-face nil t)
(6 'font-lock-constant-face nil t)
(7 'font-lock-variable-name-face nil t)))
"Keywords to hilight in Conf Java Properties mode")
"Keywords to hilight in Conf Java Properties mode.")
(defvar conf-space-keywords-alist
'(("\\`/etc/gpm/" . "key\\|name\\|foreground\\|background\\|border\\|head")
......@@ -188,7 +188,7 @@ This variable is best set in the file local variables, or through
'(1 'font-lock-keyword-face)
'(2 'font-lock-variable-name-face))
'("^[ \t]*\\([^\000- ]+\\)" 1 'font-lock-variable-name-face)))
"Keywords to hilight in Conf Space mode")
"Keywords to hilight in Conf Space mode.")
(defvar conf-colon-font-lock-keywords
`(;; [section] (do this first because it may look like a parameter)
......@@ -198,7 +198,7 @@ This variable is best set in the file local variables, or through
(1 'font-lock-variable-name-face))
;; section { ... } (do this last because some assign ...{...)
("^[ \t]*\\([^:\n]+\\)[ \t\n]*{[^{}]*?$" 1 'font-lock-type-face prepend))
"Keywords to hilight in Conf Colon mode")
"Keywords to hilight in Conf Colon mode.")
(defvar conf-assignment-sign ?=
"What sign is used for assignments.")
......@@ -231,12 +231,15 @@ whitespace.")
(if (>= arg 0)
(progn
(indent-to-column arg)
(or (not conf-assignment-space) (memq (char-before (point)) '(?\s ?\t)) (insert ?\s))
(insert conf-assignment-sign (if (and conf-assignment-space (not (eolp))) ?\s "")))
(or (not conf-assignment-space)
(memq (char-before (point)) '(?\s ?\t)) (insert ?\s))
(insert conf-assignment-sign
(if (and conf-assignment-space (not (eolp))) ?\s "")))
(insert (if conf-assignment-space ?\s "") conf-assignment-sign)
(unless (eolp)
(indent-to-column (- arg))
(or (not conf-assignment-space) (memq (char-before (point)) '(?\s ?\t)) (insert ?\s))))
(or (not conf-assignment-space)
(memq (char-before (point)) '(?\s ?\t)) (insert ?\s))))
(unless (eolp)
(if (>= (current-column) (abs arg))
(insert ?\s)
......@@ -255,8 +258,10 @@ both, i.e. quotes delimit strings, except when they are
unbalanced, but hey...)"
(interactive "P")
(let ((table (copy-syntax-table (syntax-table))))
(if (or (not arg) (= (prefix-numeric-value arg) 1)) (modify-syntax-entry ?\' "." table))
(if (or (not arg) (= (prefix-numeric-value arg) 2)) (modify-syntax-entry ?\" "." table))
(if (or (not arg) (= (prefix-numeric-value arg) 1))
(modify-syntax-entry ?\' "." table))
(if (or (not arg) (= (prefix-numeric-value arg) 2))
(modify-syntax-entry ?\" "." table))
(set-syntax-table table)
(and (boundp 'font-lock-mode)
font-lock-mode
......@@ -326,25 +331,25 @@ See also `conf-space-mode', `conf-colon-mode', `conf-javaprop-mode',
((looking-at ".*{")) ; nop
((setq space (1+ space))))
(forward-line)))
(if (> jp (max unix win 3))
(conf-javaprop-mode)
(if (> colon (max equal space))
(conf-colon-mode)
(if (> space (max equal colon))
(conf-space-mode)
(if (or (> win unix)
(and (= win unix) (eq system-type 'windows-nt)))
(conf-windows-mode)
(conf-unix-mode))))))
(cond
((> jp (max unix win 3)) (conf-javaprop-mode))
((> colon (max equal space)) (conf-colon-mode))
((> space (max equal colon)) (conf-space-mode))
((or (> win unix) (and (= win unix) (eq system-type 'windows-nt)))
(conf-windows-mode))
(t (conf-unix-mode))))
(kill-all-local-variables)
(use-local-map conf-mode-map)
(setq major-mode 'conf-mode
mode-name name)
(set (make-local-variable 'font-lock-defaults)
'(conf-font-lock-keywords nil t nil nil))
(set (make-local-variable 'comment-start) comment)
(set (make-local-variable 'comment-start-skip)
(concat (regexp-quote comment-start) "+\\s *"))
(set (make-local-variable 'comment-use-syntax) t)
;; Let newcomment.el decide this for himself.
;; (set (make-local-variable 'comment-use-syntax) t)
(set (make-local-variable 'parse-sexp-ignore-comments) t)
(set (make-local-variable 'outline-regexp)
"[ \t]*\\(?:\\[\\|.+[ \t\n]*{\\)")
......@@ -368,7 +373,7 @@ See also `conf-space-mode', `conf-colon-mode', `conf-javaprop-mode',
Comments start with `#'.
For details see `conf-mode'. Example:
# Conf mode font-locks this right on Unix and with C-c C-u
# Conf mode font-locks this right on Unix and with \\[conf-unix-mode]
\[Desktop Entry]
Encoding=UTF-8
......@@ -384,7 +389,7 @@ For details see `conf-mode'. Example:
Comments start with `;'.
For details see `conf-mode'. Example:
; Conf mode font-locks this right on Windows and with C-c C-w
; Conf mode font-locks this right on Windows and with \\[conf-windows-mode]
\[ExtShellFolderViews]
Default={5984FFE0-28D4-11CF-AE66-08002B2E1262}
......@@ -407,7 +412,7 @@ Comments start with `#' but are also recognized with `//' or
between `/*' and `*/'.
For details see `conf-mode'. Example:
# Conf mode font-locks this right with C-c C-j (Java properties)
# Conf mode font-locks this right with \\[conf-javaprop-mode] (Java properties)
// another kind of comment
/* yet another */
......@@ -441,7 +446,7 @@ KEYWORDS, or any non-nil non-string for no keywords.
For details see `conf-mode'. Example:
# Conf mode font-locks this right with C-c C-s (space separated)
# Conf mode font-locks this right with \\[conf-space-mode] (space separated)
image/jpeg jpeg jpg jpe
image/png png
......@@ -495,7 +500,7 @@ add /dev/mixer desktop"
\"Assignments\" are with `:'.
For details see `conf-mode'. Example:
# Conf mode font-locks this right with C-c C-c (colon)
# Conf mode font-locks this right with \\[conf-colon-mode] (colon)
<Multi_key> <exclam> <exclam> : \"\\241\" exclamdown
<Multi_key> <c> <slash> : \"\\242\" cent"
......@@ -524,7 +529,7 @@ For details see `conf-mode'. Example:
Comments start with `*%' and \"assignments\" are with `:'.
For details see `conf-mode'. Example:
*% Conf mode font-locks this right with C-c C-p (PPD)
*% Conf mode font-locks this right with \\[conf-ppd-mode] (PPD)
*DefaultTransfer: Null
*Transfer Null.Inverse: \"{ 1 exch sub }\""
......@@ -539,22 +544,13 @@ For details see `conf-mode'. Example:
Comments start with `!' and \"assignments\" are with `:'.
For details see `conf-mode'. Example:
! Conf mode font-locks this right with C-c C-x (.Xdefaults)
! Conf mode font-locks this right with \\[conf-xdefaults-mode] (.Xdefaults)
*background: gray99
*foreground: black"
(interactive)
(conf-colon-mode "!" conf-xdefaults-mode-syntax-table "Conf[Xdefaults]"))
;; font lock support
(if (boundp 'font-lock-defaults-alist)
(add-to-list
'font-lock-defaults-alist
(cons 'conf-mode
(list 'conf-font-lock-keywords nil t nil nil))))
(provide 'conf-mode)
;; arch-tag: 0a3805b2-0371-4d3a-8498-8897116b2356
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment