Mercurial > hg > xemacs-beta
comparison lisp/modes/xrdb-mode.el @ 102:a145efe76779 r20-1b3
Import from CVS: tag r20-1b3
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:15:49 +0200 |
parents | 441bb1e64a06 |
children | 34a5b81f86ba |
comparison
equal
deleted
inserted
replaced
101:a0ec055d74dd | 102:a145efe76779 |
---|---|
1 ;;; xrdb-mode.el --- mode for editing X resource database files | 1 ;;; xrdb-mode.el --- mode for editing X resource database files |
2 | 2 |
3 ;; Author: 1994-1997 Barry A. Warsaw | 3 ;; Author: 1994-1997 Barry A. Warsaw |
4 ;; Maintainer: tools-help@python.org | 4 ;; Maintainer: tools-help@python.org |
5 ;; Created: May 1994 | 5 ;; Created: May 1994 |
6 ;; Version: 1.17 | 6 ;; Version: 1.21 |
7 ;; Last Modified: 1997/02/21 22:28:59 | 7 ;; Last Modified: 1997/02/24 03:34:56 |
8 ;; Keywords: data languages | 8 ;; Keywords: data languages |
9 | 9 |
10 ;; Copyright (C) 1994 Barry A. Warsaw | 10 ;; Copyright (C) 1994 Barry A. Warsaw |
11 | 11 |
12 ;; This file is not part of GNU Emacs. | 12 ;; This file is not part of GNU Emacs. |
44 ;; vice for another? Hmm... Anyway, if you are still down in the | 44 ;; vice for another? Hmm... Anyway, if you are still down in the |
45 ;; trenches and would like to inherit this file, let me know. I | 45 ;; trenches and would like to inherit this file, let me know. I |
46 ;; don't intend to do any work on it any more... unless I lose my | 46 ;; don't intend to do any work on it any more... unless I lose my |
47 ;; place in paradise. I promise to be good, Steve. :-) :-)" | 47 ;; place in paradise. I promise to be good, Steve. :-) :-)" |
48 ;; | 48 ;; |
49 ;; I have fallen from grace. | 49 ;; I have fallen from grace and have been kicked out of paradise. So |
50 ;; has Steve Jobs apparently :-) | |
51 ;; | |
52 ;; To use, put the following in your .emacs: | |
53 ;; | |
54 ;; (autoload 'xrdb-mode "xrdb-mode" "Mode for editing X resource files" t) | |
55 ;; | |
56 ;; You may also want something like: | |
57 ;; | |
58 ;; (setq auto-mode-alist | |
59 ;; (append '(("\\.Xdefaults$" . xrdb-mode) | |
60 ;; ("\\.Xenvironment$" . xrdb-mode) | |
61 ;; ("\\.Xresources$" . xrdb-mode) | |
62 ;; ) | |
63 ;; auto-mode-alist)) | |
64 | |
50 | 65 |
51 ;; Code: | 66 ;; Code: |
52 | 67 |
53 | 68 |
54 ;; These variables are available for your customization | 69 ;; These variables are available for your customization |
336 (run-hooks 'xrdb-mode-hook)) | 351 (run-hooks 'xrdb-mode-hook)) |
337 | 352 |
338 | 353 |
339 | 354 |
340 ;; faces and font-locking | 355 ;; faces and font-locking |
341 (require 'font-lock) | 356 (defvar xrdb-option-name-face 'xrdb-option-name-face |
357 "Face for option name on a line in an X resource db file") | |
358 (defvar xrdb-option-value-face 'xrdb-option-value-face | |
359 "Face for option value on a line in an X resource db file") | |
360 | |
342 (make-face 'xrdb-option-name-face) | 361 (make-face 'xrdb-option-name-face) |
343 (make-face 'xrdb-option-value-face) | 362 (make-face 'xrdb-option-value-face) |
344 (or (face-differs-from-default-p 'xrdb-option-name-face) | 363 |
345 (copy-face 'font-lock-keyword-face 'xrdb-option-name-face)) | 364 (defun xrdb-font-lock-mode-hook () |
346 (or (face-differs-from-default-p 'xrdb-option-value-face) | 365 (or (face-differs-from-default-p 'xrdb-option-name-face) |
347 (copy-face 'font-lock-string-face 'xrdb-option-value-face)) | 366 (copy-face 'font-lock-keyword-face 'xrdb-option-name-face)) |
367 (or (face-differs-from-default-p 'xrdb-option-value-face) | |
368 (copy-face 'font-lock-string-face 'xrdb-option-value-face)) | |
369 (remove-hook 'font-lock-mode-hook 'xrdb-font-lock-mode-hook)) | |
370 (add-hook 'font-lock-mode-hook 'xrdb-font-lock-mode-hook) | |
348 | 371 |
349 (defvar xrdb-font-lock-keywords | 372 (defvar xrdb-font-lock-keywords |
350 (list '("^[ \t]*\\([^\n:]*:\\)[ \t]*\\(.*\\)$" | 373 (list '("^[ \t]*\\([^\n:]*:\\)[ \t]*\\(.*\\)$" |
351 (1 xrdb-option-name-face) | 374 (1 xrdb-option-name-face) |
352 (2 xrdb-option-value-face))) | 375 (2 xrdb-option-value-face))) |
353 "Additional expressions to highlight in Xrdb mode.") | 376 "Additional expressions to highlight in X resource db mode.") |
354 | 377 (put 'xrdb-mode 'font-lock-defaults '(xrdb-font-lock-keywords)) |
355 (put 'xrdb-mode 'font-lock-defaults '(xrdb-font-lock-keywords nil)) | |
356 | 378 |
357 | 379 |
358 | 380 |
359 ;; commands | 381 ;; commands |
360 (defun xrdb-region-goal-column () | 382 (defun xrdb-region-goal-column () |
378 | 400 |
379 | 401 |
380 | 402 |
381 ;; submitting bug reports | 403 ;; submitting bug reports |
382 | 404 |
383 (defconst xrdb-version "1.17" | 405 (defconst xrdb-version "1.21" |
384 "xrdb-mode version number.") | 406 "xrdb-mode version number.") |
385 | 407 |
386 (defconst xrdb-mode-help-address "tools-help@python.org" | 408 (defconst xrdb-mode-help-address "tools-help@python.org" |
387 "Address for xrdb-mode bug reports.") | 409 "Address for xrdb-mode bug reports.") |
388 | 410 |