]> code.delx.au - gnu-emacs/blobdiff - lisp/ps-bdf.el
Auto-commit of generated files.
[gnu-emacs] / lisp / ps-bdf.el
index c5b394a72128db6aa48381ec5a769ddf3cb8bba9..832d1cf55bcc829f897bf2c5d1e9cc4d464d0ce5 100644 (file)
@@ -1,18 +1,18 @@
 ;;; ps-bdf.el --- BDF font file handler for ps-print
 
-;; Copyright (C) 1998, 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-;;   Free Software Foundation, Inc.
+;; Copyright (C) 1998-1999, 2001-2013 Free Software Foundation, Inc.
 ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-;;   2008
+;;   2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
 ;;   Registration Number H14PRO021
-
 ;; Copyright (C) 2003
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
 ;;   Registration Number H13PRO009
 
+;; Author: Kenichi Handa <handa@m17n.org>
+;; (according to ack.texi)
 ;; Keywords: wp, BDF, font, PostScript
-;; Maintainer: Kenichi Handa <handa@m17n.org>
+;; Package: ps-print
 
 ;; This file is part of GNU Emacs.
 
 
 ;;; Code:
 
-(eval-and-compile
-  (require 'ps-mule))
+(require 'ps-mule)
 
 ;;;###autoload
-(defvar bdf-directory-list
+(defcustom bdf-directory-list
   (if (memq system-type '(ms-dos windows-nt))
       (list (expand-file-name "fonts/bdf" installation-directory))
     '("/usr/local/share/emacs/fonts/bdf"))
-  "*List of directories to search for `BDF' font files.
-The default value is '(\"/usr/local/share/emacs/fonts/bdf\").")
+  "List of directories to search for `BDF' font files.
+The default value is '(\"/usr/local/share/emacs/fonts/bdf\")."
+  :type '(repeat :tag "BDF font directory list"
+                (directory :tag "BDF font directory"))
+  :group 'ps-print-miscellany)
 
 ;; MS-DOS and MS-Windows users like to move the binary around after
 ;; it's built, but the value above is computed at load-up time.
@@ -68,20 +70,15 @@ for BDFNAME."
 
 (defsubst bdf-file-mod-time (filename)
   "Return modification time of FILENAME.
-The value is a list of two integers, the first integer has high-order
-16 bits, the second has low 16 bits."
+The value is a list of integers in the same format as `current-time'."
   (nth 5 (file-attributes filename)))
 
 (defun bdf-file-newer-than-time (filename mod-time)
   "Return non-nil if and only if FILENAME is newer than MOD-TIME.
-MOD-TIME is a modification time as a list of two integers, the first
-integer has high-order 16 bits, the second has low 16 bits."
-  (let* ((new-mod-time (bdf-file-mod-time filename))
-        (new-time (car new-mod-time))
-        (time (car mod-time)))
-    (or (> new-time time)
-       (and (= new-time time)
-            (> (nth 1 new-mod-time) (nth 1 mod-time))))))
+MOD-TIME is a modification time as a list of integers in the same
+format as `current-time'."
+  (let ((new-mod-time (bdf-file-mod-time filename)))
+    (time-less-p mod-time new-mod-time)))
 
 (defun bdf-find-file (bdfname)
   "Return a buffer visiting a bdf file BDFNAME.
@@ -90,8 +87,7 @@ If BDFNAME doesn't exist, return nil."
   (and (file-readable-p bdfname)
        (let ((buf (generate-new-buffer " *bdf-work*"))
             (coding-system-for-read 'no-conversion))
-        (save-excursion
-          (set-buffer buf)
+        (with-current-buffer buf
           (insert-file-contents bdfname)
           buf))))
 
@@ -177,8 +173,8 @@ FONT-INFO is a list of the following format:
     (BDFFILE MOD-TIME FONT-BOUNDING-BOX
      RELATIVE-COMPOSE BASELINE-OFFSET CODE-RANGE MAXLEN OFFSET-VECTOR)
 
-MOD-TIME is last modification time as a list of two integers, the
-first integer has high-order 16 bits, the second has low 16 bits.
+MOD-TIME is last modification time as a list of integers in the
+same format as `current-time'.
 
 SIZE is a size of the font on 72 dpi device.  This value is got
 from SIZE record of the font.
@@ -220,8 +216,7 @@ CODE, where N and CODE are in the following relation:
        (message "Reading %s..." bdfname)
       (error "BDF file %s doesn't exist" bdfname))
     (unwind-protect
-       (save-excursion
-         (set-buffer buf)
+       (with-current-buffer buf
          (goto-char (point-min))
          (search-forward "\nFONTBOUNDINGBOX")
          (setq font-bounding-box
@@ -444,5 +439,4 @@ BITMAP-STRING is a string representing bits by hexadecimal digits."
 
 (provide 'ps-bdf)
 
-;; arch-tag: 9b875ba8-565a-4ecf-acaa-30cee732c898
 ;;; ps-bdf.el ends here