comparison lisp/ps-print.el @ 60726:d1b7b92f7057

Use functionp instead symbolp and fboundp.
author Vinicius Jose Latorre <viniciusjl@ig.com.br>
date Sat, 19 Mar 2005 04:11:54 +0000
parents 9afc1e30ea84
children ff7181a543b6
comparison
equal deleted inserted replaced
60725:086d1f41fbb3 60726:d1b7b92f7057
1 ;;; ps-print.el --- print text from the buffer as PostScript 1 ;;; ps-print.el --- print text from the buffer as PostScript
2 2
3 ;; Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 3 ;; Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 ;; 2003, 2004 Free Software Foundation, Inc. 4 ;; 2003, 2004, 2005 Free Software Foundation, Inc.
5 5
6 ;; Author: Jim Thompson (was <thompson@wg2.waii.com>) 6 ;; Author: Jim Thompson (was <thompson@wg2.waii.com>)
7 ;; Jacques Duthen (was <duthen@cegelec-red.fr>) 7 ;; Jacques Duthen (was <duthen@cegelec-red.fr>)
8 ;; Vinicius Jose Latorre <viniciusjl@ig.com.br> 8 ;; Vinicius Jose Latorre <viniciusjl@ig.com.br>
9 ;; Kenichi Handa <handa@etl.go.jp> (multi-byte characters) 9 ;; Kenichi Handa <handa@etl.go.jp> (multi-byte characters)
10 ;; Maintainer: Kenichi Handa <handa@etl.go.jp> (multi-byte characters) 10 ;; Maintainer: Kenichi Handa <handa@etl.go.jp> (multi-byte characters)
11 ;; Vinicius Jose Latorre <viniciusjl@ig.com.br> 11 ;; Vinicius Jose Latorre <viniciusjl@ig.com.br>
12 ;; Keywords: wp, print, PostScript 12 ;; Keywords: wp, print, PostScript
13 ;; Time-stamp: <2004/07/21 23:12:05 vinicius> 13 ;; Time-stamp: <2005/03/19 00:40:12 vinicius>
14 ;; Version: 6.6.5 14 ;; Version: 6.6.6
15 ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/ 15 ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/
16 16
17 (defconst ps-print-version "6.6.5" 17 (defconst ps-print-version "6.6.6"
18 "ps-print.el, v 6.6.5 <2004/07/21 vinicius> 18 "ps-print.el, v 6.6.6 <2004/07/21 vinicius>
19 19
20 Vinicius's last change version -- this file may have been edited as part of 20 Vinicius's last change version -- this file may have been edited as part of
21 Emacs without changes to the version number. When reporting bugs, please also 21 Emacs without changes to the version number. When reporting bugs, please also
22 report the version of Emacs, if any, that ps-print was distributed with. 22 report the version of Emacs, if any, that ps-print was distributed with.
23 23
4829 (setq str (cons (cond 4829 (setq str (cons (cond
4830 ;; string 4830 ;; string
4831 ((stringp (car content)) 4831 ((stringp (car content))
4832 (car content)) 4832 (car content))
4833 ;; function symbol 4833 ;; function symbol
4834 ((and (symbolp (car content)) (fboundp (car content))) 4834 ((functionp (car content))
4835 (concat "(" (funcall (car content)) ")")) 4835 (concat "(" (funcall (car content)) ")"))
4836 ;; variable symbol 4836 ;; variable symbol
4837 ((and (symbolp (car content)) (boundp (car content))) 4837 ((and (symbolp (car content)) (boundp (car content)))
4838 (concat "(" (symbol-value (car content)) ")")) 4838 (concat "(" (symbol-value (car content)) ")"))
4839 ;; otherwise, empty string 4839 ;; otherwise, empty string
4867 ((stringp content) 4867 ((stringp content)
4868 (ps-output (ps-mule-encode-header-string content fonttag))) 4868 (ps-output (ps-mule-encode-header-string content fonttag)))
4869 4869
4870 ;; Functions are called -- they should return strings; they will be inserted 4870 ;; Functions are called -- they should return strings; they will be inserted
4871 ;; as strings and the PS string delimiters added. 4871 ;; as strings and the PS string delimiters added.
4872 ((and (symbolp content) (fboundp content)) 4872 ((functionp content)
4873 (ps-output-string (ps-mule-encode-header-string (funcall content) 4873 (ps-output-string (ps-mule-encode-header-string (funcall content)
4874 fonttag))) 4874 fonttag)))
4875 4875
4876 ;; Variables will have their contents inserted. They should contain 4876 ;; Variables will have their contents inserted. They should contain
4877 ;; strings, and will be inserted as strings. 4877 ;; strings, and will be inserted as strings.