;;; ps-mode.el --- PostScript mode for GNU Emacs
-;; Copyright (C) 1999, 2001-2012 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2001-2014 Free Software Foundation, Inc.
;; Author: Peter Kleiweg <p.c.j.kleiweg@rug.nl>
;; Maintainer: Peter Kleiweg <p.c.j.kleiweg@rug.nl>
;; Created: 20 Aug 1997
-;; Version: 1.1h
+;; Version: 1.1i
;; Keywords: PostScript, languages
;; Yoni Rabkin <yoni@rabkins.net> contacted the maintainer of this
\f
;;; Code:
-(defconst ps-mode-version "1.1h, 16 Jun 2005")
-(defconst ps-mode-maintainer-address "Peter Kleiweg <p.c.j.kleiweg@rug.nl>")
+(defconst ps-mode-version "1.1i, 17 May 2008")
+(defconst ps-mode-maintainer-address
+ "Peter Kleiweg <p.c.j.kleiweg@rug.nl>, bug-gnu-emacs@gnu.org")
(require 'comint)
(require 'easymenu)
;; User variables.
(defcustom ps-mode-auto-indent t
- "*Should we use autoindent?"
+ "Should we use autoindent?"
:group 'PostScript-edit
:type 'boolean)
(defcustom ps-mode-tab 4
- "*Number of spaces to use when indenting."
+ "Number of spaces to use when indenting."
:group 'PostScript-edit
:type 'integer)
(defcustom ps-mode-paper-size '(595 842)
- "*Default paper size.
+ "Default paper size.
When inserting an EPSF template these values are used
to set the boundingbox to include the whole page.
(lpr-command (if (memq system-type '(usg-unix-v hpux irix))
"lp" "lpr")))
(lpr-buffer)))
- "*Lisp function to print current buffer as PostScript."
+ "Lisp function to print current buffer as PostScript."
:group 'PostScript-edit
:type 'function)
(defcustom ps-run-prompt "\\(GS\\(<[0-9]+\\)?>\\)+"
- "*Regexp to match prompt in interactive PostScript."
+ "Regexp to match prompt in interactive PostScript."
:group 'PostScript-interaction
:type 'regexp)
("^\\(Current file position is\\) \\([0-9]+\\)"
(1 font-lock-comment-face nil nil)
(2 font-lock-warning-face nil nil))))
- "*Medium level highlighting of messages from the PostScript interpreter.
+ "Medium level highlighting of messages from the PostScript interpreter.
See documentation on font-lock for details."
:group 'PostScript-interaction
(boolean :tag "Laxmatch" :value t))))))
(defcustom ps-run-x '("gs" "-r72" "-sPAPERSIZE=a4")
- "*Command as list to run PostScript with graphic display."
+ "Command as list to run PostScript with graphic display."
:group 'PostScript-interaction
:type '(repeat string))
(defcustom ps-run-dumb '("gs" "-dNODISPLAY")
- "*Command as list to run PostScript without graphic display."
+ "Command as list to run PostScript without graphic display."
:group 'PostScript-interaction
:type '(repeat string))
(defcustom ps-run-init nil
- "*String of commands to send to PostScript to start interactive.
+ "String of commands to send to PostScript to start interactive.
Example: \"executive\"
:type '(choice (const nil) string))
(defcustom ps-run-error-line-numbers nil
- "*What values are used by the PostScript interpreter in error messages?"
+ "What values are used by the PostScript interpreter in error messages?"
:group 'PostScript-interaction
:type '(choice (const :tag "line numbers" t)
(const :tag "byte counts" nil)))
(defcustom ps-run-tmp-dir nil
- "*Name of directory to place temporary file.
+ "Name of directory to place temporary file.
If nil, use `temporary-file-directory'."
:group 'PostScript-interaction
:type '(choice (const nil) directory))
;; - 8bit characters (warning face)
;; Multiline strings are not supported. Strings with nested brackets are.
(defconst ps-mode-font-lock-keywords-1
- '(("\\`%!PS.*" . font-lock-reference-face)
+ '(("\\`%!PS.*" . font-lock-constant-face)
("^%%BoundingBox:[ \t]+-?[0-9]+[ \t]+-?[0-9]+[ \t]+-?[0-9]+[ \t]+-?[0-9]+[ \t]*$"
- . font-lock-reference-face)
+ . font-lock-constant-face)
(ps-mode-match-string-or-comment
(1 font-lock-comment-face nil t)
(2 font-lock-string-face nil t))
(define-key ps-mode-map "\177" 'ps-mode-backward-delete-char)
(define-key ps-mode-map "\t" 'ps-mode-tabkey)
(define-key ps-mode-map "\r" 'ps-mode-newline)
- (define-key ps-mode-map [return] 'ps-mode-newline)
(easy-menu-define ps-mode-main ps-mode-map "PostScript" ps-mode-menu-main))
(unless ps-run-mode-map
(while (re-search-forward "[\200-\377]" (marker-position endm) t)
(setq i (1+ i))
(backward-char)
- (insert (format "\\%03o" (string-to-char (buffer-substring (point) (1+ (point))))))
+ (insert (format "\\%03o" (string-to-char (string-make-unibyte (buffer-substring (point) (1+ (point)))))))
(delete-char 1))
(message "%d change%s made" i (if (= i 1) "" "s"))
(set-marker endm nil)))))