From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: patch: handle PS/PDF in Gnus Date: Sun, 08 Jul 2007 06:22:27 +0300 Message-ID: References: <86r6nl8s13.fsf@lola.quinscape.zz> <8480CDB2-EDBB-4B62-A3CC-D8A13A8E5A46@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: sea.gmane.org 1183864963 6389 80.91.229.12 (8 Jul 2007 03:22:43 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 8 Jul 2007 03:22:43 +0000 (UTC) Cc: david.reitter@gmail.com, emacs-devel@gnu.org To: YAMAMOTO Mitsuharu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 08 05:22:41 2007 connect(): Connection refused Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1I7NM5-0007d5-IW for ged-emacs-devel@m.gmane.org; Sun, 08 Jul 2007 05:22:37 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I7NM4-0004QW-Oe for ged-emacs-devel@m.gmane.org; Sat, 07 Jul 2007 23:22:36 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I7NM0-0004QK-TC for emacs-devel@gnu.org; Sat, 07 Jul 2007 23:22:32 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I7NLz-0004Pr-Du for emacs-devel@gnu.org; Sat, 07 Jul 2007 23:22:31 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I7NLy-0004Pg-UF for emacs-devel@gnu.org; Sat, 07 Jul 2007 23:22:31 -0400 Original-Received: from heller.inter.net.il ([213.8.233.23]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I7NLy-0004LM-C8 for emacs-devel@gnu.org; Sat, 07 Jul 2007 23:22:30 -0400 Original-Received: from HOME-C4E4A596F7 (IGLD-84-228-0-185.inter.net.il [84.228.0.185]) by heller.inter.net.il (MOS 3.7.3a-GA) with ESMTP id DAJ36571 (AUTH halo1); Sun, 8 Jul 2007 06:22:26 +0300 (IDT) In-reply-to: (message from YAMAMOTO Mitsuharu on Sun, 08 Jul 2007 12:15:09 +0900) X-detected-kernel: FreeBSD 4.7-5.2 (or MacOS X 10.2-10.4) (2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:74454 Archived-At: > Date: Sun, 08 Jul 2007 12:15:09 +0900 > From: YAMAMOTO Mitsuharu > Cc: emacs-devel@gnu.org > > As for the standard print dialogs in Carbon, I've tried an > experimental implementation before (for Mac OS X 10.3 and later). The > function looks like: > > DEFUN ("mac-file-print-dialog", Fmac_file_print_dialog, Smac_file_print_dialog, 1, 3, 0, > doc: /* Print file named FILENAME using the standard print dialog. > The optional second argument NPAGES specifies the total number of > pages; it will appear as the default in the To field of the dialog. > The optional third argument MIME-TYPE specifies the mime type of the > file. It must be either a string, nil (auto-typed) or t (synonym of > \"application/postscript\"). */) > (filename, npages, mime_type) > Lisp_Object filename, npages, mime_type; > > and can be used as: > > (defun mac-ps-print-region (start end program > &optional delete buffer display > &rest args) > (let (pages file) > (save-excursion > (goto-char start) > (if (and (re-search-forward "^%%Trailer" nil end) > (re-search-forward "^%%Pages:\\s-*\\([0-9]+\\)" nil end)) > (setq pages (string-to-number (match-string 1))))) > (setq file (make-temp-file "mac-ps-print")) > (write-region start end file nil 'nomessage) > (unwind-protect > (mac-file-print-dialog file pages t) > (delete-file file)))) > > (setq ps-print-region-function 'mac-ps-print-region) > > Of course, we need to discuss the specification of the function so > that it can be common to the platforms that support print dialogs (in > particular, recent Gtk+) in order to include such a feature in Emacs. I think we need to discuss a platform-independent interface to a printer dialog, before we implement platform-dependent implementations. Carbon and Gtk+ are not the only platforms that have such dialogs built into the OS APIs.