/[emacs]/emacs/lisp/progmodes/ps-mode.el
ViewVC logotype

Diff of /emacs/lisp/progmodes/ps-mode.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by gerd, Fri Oct 26 09:14:10 2001 UTC revision 1.9 by rms, Sat Nov 10 19:36:51 2001 UTC
# Line 5  Line 5 
5  ;; Author:     Peter Kleiweg <kleiweg@let.rug.nl>  ;; Author:     Peter Kleiweg <kleiweg@let.rug.nl>
6  ;; Maintainer: Peter Kleiweg <kleiweg@let.rug.nl>  ;; Maintainer: Peter Kleiweg <kleiweg@let.rug.nl>
7  ;; Created:    20 Aug 1997  ;; Created:    20 Aug 1997
8  ;; Version:    1.1f, 25 Oct 2001  ;; Version:    1.1g, 9 Nov 2001
9  ;; Keywords:   PostScript, languages  ;; Keywords:   PostScript, languages
10    
11  ;; This file is part of GNU Emacs.  ;; This file is part of GNU Emacs.
# Line 30  Line 30 
30    
31  ;;; Code:  ;;; Code:
32    
33  (defconst ps-mode-version "1.1f, 25 Oct 2001")  (defconst ps-mode-version "1.1g, 9 Nov 2001")
34  (defconst ps-mode-maintainer-address "Peter Kleiweg <kleiweg@let.rug.nl>")  (defconst ps-mode-maintainer-address "Peter Kleiweg <kleiweg@let.rug.nl>")
35    
36  (require 'easymenu)  (require 'easymenu)
# Line 256  If nil, the following are tried in turn, Line 256  If nil, the following are tried in turn,
256     ps-mode-font-lock-keywords-1     ps-mode-font-lock-keywords-1
257     (list     (list
258      '("//\\w+" . font-lock-type-face)      '("//\\w+" . font-lock-type-face)
259      '("^\\(/\\w+\\)\\>[[ \t]*\\(%.*\\)?\r?$"      `(,(concat
260        . (1 font-lock-function-name-face))          "^\\(/\\w+\\)\\>"
261      '("^\\(/\\w+\\)\\>\\([ \t]*{\\|[ \t]*<<\\|.*\\<def\\>\\|[ \t]+[0-9]+[ \t]+dict\\>\\)"          "\\([[ \t]*\\(%.*\\)?\r?$"      ; Nothing but `[' or comment after the name.
262            "\\|[ \t]*\\({\\|<<\\)"         ; `{' or `<<' following the name.
263            "\\|[ \t]+[0-9]+[ \t]+dict\\>"  ; `[0-9]+ dict' following the name.
264            "\\|.*\\<def\\>\\)")            ; `def' somewhere on the same line.
265        . (1 font-lock-function-name-face))        . (1 font-lock-function-name-face))
266      '("/\\w+" . font-lock-variable-name-face)      '("/\\w+" . font-lock-variable-name-face)
267      (cons ps-mode-operators 'font-lock-keyword-face)))      (cons ps-mode-operators 'font-lock-keyword-face)))
# Line 523  Typing \\<ps-run-mode-map>\\[ps-run-goto Line 526  Typing \\<ps-run-mode-map>\\[ps-run-goto
526            ps-mode-font-lock-keywords-1            ps-mode-font-lock-keywords-1
527            ps-mode-font-lock-keywords-2            ps-mode-font-lock-keywords-2
528            ps-mode-font-lock-keywords-3)            ps-mode-font-lock-keywords-3)
529           t)))           t))
530      (set (make-local-variable 'comment-start) "%")
531      ;; NOTE: `\' has a special meaning in strings only
532      (set (make-local-variable 'comment-start-skip) "%+[ \t]*"))
533    
534  (defun ps-mode-show-version ()  (defun ps-mode-show-version ()
535    "Show current version of PostScript mode."    "Show current version of PostScript mode."
# Line 573  Typing \\<ps-run-mode-map>\\[ps-run-goto Line 579  Typing \\<ps-run-mode-map>\\[ps-run-goto
579        ;; Search next bracket, stepping over escaped brackets.        ;; Search next bracket, stepping over escaped brackets.
580        (if (not (looking-at "\\([^()\\\n]\\|\\\\.\\)*\\([()]\\)"))        (if (not (looking-at "\\([^()\\\n]\\|\\\\.\\)*\\([()]\\)"))
581            (setq level -1)            (setq level -1)
582          (if (string= "(" (match-string 2))          (setq level (+ level (if (string= "(" (match-string 2)) 1 -1)))
583              (setq level (1+ level))          (goto-char (setq pos (match-end 0)))))
           (setq level (1- level)))  
         (goto-char (setq pos (match-end 0)))))  
584      (if (not (= level 0))      (if (not (= level 0))
585          nil          nil
586        ;; Found string with nested brackets, now set match data nr 2.        ;; Found string with nested brackets, now set match data nr 2.
587        (goto-char first)        (set-match-data (list first pos nil nil first pos))
588        (re-search-forward "\\(%\\)\\|\\((.*\\)" pos))))        pos)))
589    
590  ;; This function should search for a string or comment  ;; This function should search for a string or comment
591  ;; If comment, return as match data nr 1  ;; If comment, return as match data nr 1

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26