From: michael.cadilhac@lrde.org (Michaël Cadilhac)
Subject: Proposal for lpr.el pager options.
Date: Tue, 05 Sep 2006 16:59:12 +0200 [thread overview]
Message-ID: <87veo2gy0v.fsf@lrde.org> (raw)
[-- Attachment #1.1.1: Type: text/plain, Size: 366 bytes --]
Hi!
I use `a2ps' as a pager [1], but I had to make some changes in `lpr.el' to
use it.
$ a2ps -h
prints ... the help of a2ps, yes. But in `lpr.el', `-h' is used as
the option to pass the page title.
I propose the following change, but maybe it is better to add a var
`lpr-page-header-title-switch' (set by default to `-h', in my case to
`--center-title' [2]).
[-- Attachment #1.1.2: lpr.patch --]
[-- Type: text/x-patch, Size: 2531 bytes --]
Index: lisp/lpr.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/lpr.el,v
retrieving revision 1.69
diff -c -r1.69 lpr.el
*** lisp/lpr.el 6 Feb 2006 14:33:34 -0000 1.69
--- lisp/lpr.el 5 Sep 2006 14:22:01 -0000
***************
*** 140,147 ****
;; Berkeley systems support -F, and GNU pr supports both -f and -F,
;; So it looks like -F is a better default.
! (defcustom lpr-page-header-switches '("-F")
! "*List of strings to use as options for the page-header-generating program.
The variable `lpr-page-header-program' specifies the program to use."
:type '(repeat string)
:group 'lpr)
--- 140,148 ----
;; Berkeley systems support -F, and GNU pr supports both -f and -F,
;; So it looks like -F is a better default.
! (defcustom lpr-page-header-switches '("-h %s" "-F")
! "List of strings to use as options for the page-header-generating program.
+ If `%s' appears in one of the strings, it is substituted by the page title.
The variable `lpr-page-header-program' specifies the program to use."
:type '(repeat string)
:group 'lpr)
***************
*** 243,250 ****
(let ((new-coords (print-region-new-buffer start end)))
(apply 'call-process-region (car new-coords) (cdr new-coords)
lpr-page-header-program t t nil
! (nconc (list "-h" title)
! lpr-page-header-switches)))
(setq start (point-min)
end (point-max))))
(apply (or print-region-function 'call-process-region)
--- 244,251 ----
(let ((new-coords (print-region-new-buffer start end)))
(apply 'call-process-region (car new-coords) (cdr new-coords)
lpr-page-header-program t t nil
! (mapcar (lambda (e) (format e title))
! lpr-page-header-switches)))
(setq start (point-min)
end (point-max))))
(apply (or print-region-function 'call-process-region)
Index: lisp/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.9966
diff -c -0 -r1.9966 ChangeLog
*** lisp/ChangeLog 27 Aug 2006 07:08:19 -0000 1.9966
--- lisp/ChangeLog 5 Sep 2006 14:22:14 -0000
***************
*** 0 ****
--- 1,5 ----
+ 2006-09-05 Michaël Cadilhac <michael.cadilhac@lrde.org>
+
+ * lpr.el (lpr-page-header-switches): Page title switch is one of them.
+ (print-region-1): Substitute `%s' in every switches by the page title.
+
[-- Attachment #1.1.3: Type: text/plain, Size: 531 bytes --]
Footnotes:
[1] (setq lpr-page-header-program "a2ps")
[2] Oops, I just tested that. a2ps wants `--center-title=TITLE' only,
and `--center-title TITLE' is not permitted, so this is not a good fix.
--
| Michaël `Micha' Cadilhac | Mieux vaut se taire |
| Epita/LRDE Promo 2007 | Que de parler trop fort. |
| http://www.lrde.org/~cadilh_m | -- As de trèfle |
`-- - JID: micha@amessage.be --' - --'
[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]
[-- Attachment #2: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel
reply other threads:[~2006-09-05 14:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87veo2gy0v.fsf@lrde.org \
--to=michael.cadilhac@lrde.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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).