all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
To: David Reitter <david.reitter@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: patch: handle PS/PDF in Gnus
Date: Sun, 08 Jul 2007 12:15:09 +0900	[thread overview]
Message-ID: <wlabu77fia.wl%mituharu@math.s.chiba-u.ac.jp> (raw)
In-Reply-To: <8480CDB2-EDBB-4B62-A3CC-D8A13A8E5A46@gmail.com>

>>>>> On Fri, 6 Jul 2007 17:31:32 +0100, David Reitter <david.reitter@gmail.com> said:

> The Carbon framework has APIs for printing. You would have to output
> things on that end (i.e., implemented in C) and then you can call
> the standard print dialogs that will handle everything from
> outputting to PDF, choosing a printer and using the right driver,
> choosing a layout for the pages, etc.  That would be the correct
> way, and everything else is more or less a hack. It probably not
> worth implementing in Carbon, given that the Cocoa port is in the
> works.

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.

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp

  reply	other threads:[~2007-07-08  3:15 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-06 15:21 patch: handle PS/PDF in Gnus Sean O'Rourke
2007-07-06 15:27 ` Sean O'Rourke
2007-07-06 15:34   ` David Kastrup
2007-07-06 15:52     ` David Reitter
2007-07-06 15:54       ` Sean O'Rourke
2007-07-06 16:31         ` David Reitter
2007-07-08  3:15           ` YAMAMOTO Mitsuharu [this message]
2007-07-08  3:22             ` Eli Zaretskii
2007-07-08 13:41               ` YAMAMOTO Mitsuharu
2007-07-08 14:31               ` Stefan Monnier
2007-07-09 10:52                 ` Jan Djärv
2007-07-09 12:39                   ` David Kastrup
2007-07-09 14:17                     ` Jan Djärv
2007-07-09 18:03                   ` YAMAMOTO Mitsuharu
2007-07-09 19:57                     ` Jan Djärv
2007-07-11 21:51                 ` Jason Rumney
2007-07-12  9:35                   ` Jan Djärv
2007-07-06 18:13       ` Stefan Monnier
2007-07-06 19:32         ` Sean O'Rourke
2007-07-08  5:13           ` Sean O'Rourke
2007-07-08 10:19             ` Jason Rumney
2007-07-08 13:03               ` Sean O'Rourke
2007-07-08 13:14                 ` Sean O'Rourke
2007-07-06 20:44         ` Jason Rumney
2007-07-08  4:52           ` Sean O'Rourke
2007-07-06 15:53     ` Sean O'Rourke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=wlabu77fia.wl%mituharu@math.s.chiba-u.ac.jp \
    --to=mituharu@math.s.chiba-u.ac.jp \
    --cc=david.reitter@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.