0

I use Emacs 29.3 on an M1 Mac Mini with OS 14.4.1.

I'm trying to set up PS printing. I picked up the name of my printer from lpstat. I copied the following code, verbatim, to my init.el from the Printing Package page on EmacsWiki:

(require 'printing)     ; load printing package
(setq pr-txt-name 'Brother_HL_L8260CDW_series)
(setq pr-txt-printer-alist
      '(Brother_HL_L8260CDW_series "lpr" nil "Brother_HL_L8260CDW_series"))
(setq pr-ps-name 'Brother_HL_L8260CDW_series)
(setq pr-ps-printer-alist
      '(Brother_HL_L8260CDW_series "lpr" nil "-P" "Brother_HL_L8260CDW_series"))
(pr-update-menus t)

Opening Emacs now gives me the error:

Wrong type argument: listp, Brother_HL_L8260CDW_series

Where is this error coming from? I have a very limited understanding of Emacs Lisp, I thought that copying code from a legit source would not lead to errors. I see that the EmacsWiki page was last edited in 2017. Has something changed in the interim?

2 Answers 2

1

Even if you have a single printer the value of pr-txt-printer-alist and pr-ps-printer-alist must be a list of lists. Update the code with another set of parentheses

(setq pr-txt-printer-alist
      '((Brother_HL_L8260CDW_series "lpr" nil "Brother_HL_L8260CDW_series")))

and

(setq pr-ps-printer-alist
      '((Brother_HL_L8260CDW_series "lpr" nil "-P" "Brother_HL_L8260CDW_series")))
1
  • Thanks, @matteol, solved the problem. I misinterpreted/misunderstood the example on the EMacs Wiki, thinking that the extra brackets had something to do with a list of 2 printers. Thanks again.
    – PhilC
    Commented Apr 12 at 23:59
1

You ask:

Where is this error coming from?

M-x set-variable RET debug-on-error RET t

Then, when the error is raised you can see the debugger backtrace in buffer *Backtrace*.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.