All pastes #548527 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-06-07 19:24 UTC
rendered paste body
(defun define-trivial-mode(mode-prefix file-regexp &optional command)
  (or command (setq command mode-prefix))
  (let ((mode-command (intern (concat mode-prefix "-mode"))))
    (fset mode-command
          `(lambda ()
             (interactive)
         (toggle-read-only t)
         (start-process ,mode-prefix nil
                ,command (buffer-file-name))))
    (add-to-list 'auto-mode-alist (cons file-regexp mode-command)))
  )

(define-trivial-mode "ghostview" "\\.ps$")