Emacs 配置 打开pdf

;;trivial-mode

(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))
         (let ((obuf (other-buffer (current-buffer) t)) ;; Select correct buffer
           (kbuf (current-buffer)))
           (set-buffer obuf)                ;; set it as current
           (kill-buffer kbuf))))                ;; kill temporary buffer
    (add-to-list 'auto-mode-alist (cons file-regexp mode-command))))

(define-trivial-mode "evince" "//.pdf$")

 

你可能感兴趣的:(Emacs 配置 打开pdf)