Variable: ps-mode-hook

ps-mode-hook is a variable defined in ps-mode.el.gz.

Value

nil

Documentation

Hook run after entering ps-mode.

No problems result if this variable is not bound. add-hook automatically binds it. (This is true for all hook variables.)

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/ps-mode.el.gz
;;;###autoload
(define-derived-mode ps-mode prog-mode "PostScript"
  "Major mode for editing PostScript with GNU Emacs.

Entry to this mode calls `ps-mode-hook'.

The following variables hold user options, and can
be set through the `customize' command:

  `ps-mode-tab'
  `ps-mode-paper-size'
  `ps-mode-print-function'
  `ps-run-prompt'
  `ps-run-font-lock-keywords-2'
  `ps-run-x'
  `ps-run-dumb'
  `ps-run-init'
  `ps-run-error-line-numbers'
  `ps-run-tmp-dir'

Type \\[describe-variable] for documentation on these options.


\\{ps-mode-map}


When starting an interactive PostScript process with \\[ps-run-start],
a second window will be displayed, and `ps-run-mode-hook' will be called.
The keymap for this second window is:

\\{ps-run-mode-map}


When Ghostscript encounters an error it displays an error message
with a file position.  Clicking mouse-2 on this number will bring
point to the corresponding spot in the PostScript window, if input
to the interpreter was sent from that window.
Typing \\<ps-run-mode-map>\\[ps-run-goto-error] when the cursor is at the number has the same effect."
  (setq-local syntax-propertize-function #'ps-mode-syntax-propertize)
  (setq-local font-lock-defaults
              '((ps-mode-font-lock-keywords
                 ps-mode-font-lock-keywords-1
                 ps-mode-font-lock-keywords-2
                 ps-mode-font-lock-keywords-3)
                nil))
  (smie-setup nil #'ps-mode-smie-rules)
  (setq-local electric-indent-chars
              (append '(?> ?\] ?\}) electric-indent-chars))
  (setq-local comment-start "%")
  ;; NOTE: `\' has a special meaning in strings only
  (setq-local comment-start-skip "%+[ \t]*")
  ;; enable doc-view-minor-mode => C-c C-c starts viewing the current ps file
  ;; with doc-view-mode.
  (doc-view-minor-mode 1))