emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: patch: handle PS/PDF in Gnus


From: Eli Zaretskii
Subject: Re: patch: handle PS/PDF in Gnus
Date: Sun, 08 Jul 2007 06:22:27 +0300

> Date: Sun, 08 Jul 2007 12:15:09 +0900
> From: YAMAMOTO Mitsuharu <address@hidden>
> Cc: address@hidden
> 
> 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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]