;;; ps-mode.el --- PostScript mode for GNU Emacs
-;; Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+;; Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
;; Free Software Foundation, Inc.
;; Author: Peter Kleiweg <p.c.j.kleiweg@rug.nl>
;; Version: 1.1h, 16 Jun 2005
;; Keywords: PostScript, languages
+;; Yoni Rabkin <yoni@rabkins.net> contacted the maintainer of this
+;; file on 18/3/2008, and the maintainer agreed that when a bug is
+;; filed in the Emacs bug reporting system against this file, a copy
+;; of the bug report be sent to the maintainer's email address, but
+;; only if: "... those e-mails have a link to the bug report system,
+;; where I can cancel these e-mails if I want to.".
+
;; This file is part of GNU Emacs.
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
(defcustom ps-mode-print-function
(lambda ()
(let ((lpr-switches nil)
- (lpr-command (if (memq system-type '(usg-unix-v dgux hpux irix))
+ (lpr-command (if (memq system-type '(usg-unix-v hpux irix))
"lp" "lpr")))
(lpr-buffer)))
"*Lisp function to print current buffer as PostScript."
(defcustom ps-run-tmp-dir nil
"*Name of directory to place temporary file.
-
-If nil, the following are tried in turn, until success:
- 1. \"$TEMP\"
- 2. \"$TMP\"
- 3. \"$HOME/tmp\"
- 4. \"/tmp\""
+If nil, use `temporary-file-directory'."
:group 'PostScript-interaction
:type '(choice (const nil) directory))
\f
-(declare-function doc-view-minor-mode "../doc-view")
+(declare-function doc-view-minor-mode "doc-view")
;; PostScript mode.
(defun ps-run-make-tmp-filename ()
(unless ps-mode-tmp-file
- (cond (ps-run-tmp-dir)
- ((setq ps-run-tmp-dir (getenv "TEMP")))
- ((setq ps-run-tmp-dir (getenv "TMP")))
- ((setq ps-run-tmp-dir (getenv "HOME"))
- (setq
- ps-run-tmp-dir
- (concat (file-name-as-directory ps-run-tmp-dir) "tmp"))
- (unless (file-directory-p ps-run-tmp-dir)
- (setq ps-run-tmp-dir nil))))
- (unless ps-run-tmp-dir
- (setq ps-run-tmp-dir "/tmp"))
(setq ps-mode-tmp-file
- (make-temp-file
- (concat
- (if ps-run-tmp-dir
- (file-name-as-directory ps-run-tmp-dir)
- "")
- "ps-run-"))))
+ (let ((temporary-file-directory (or ps-run-tmp-dir
+ temporary-file-directory)))
+ (make-temp-file "ps-run-"))))
ps-mode-tmp-file)
;; Remove temporary file
(provide 'ps-mode)
-;;; arch-tag: dce13d2d-69fb-4ec4-9d5d-6dd29c3f0e6e
+;; arch-tag: dce13d2d-69fb-4ec4-9d5d-6dd29c3f0e6e
;;; ps-mode.el ends here