; cperl-mode.el: use ps-print instead of cperl-ps-print

There is no value in having an opinionated cperl customization for
PostScript printing (who does that anyway in 2026?) which clobbers
ps-print customization with 'eval-after-load'.

* lisp/progmodes/cperl-mode.el
(cperl-menu): Delete "CPerl pretty print (experimental)".
(cperl-ps-print-face-properties):
Obsolete this cperl-ism variable in favor of ps-print customizing.
(cperl-windowed-init): No longer used, deleted.
(cperl-init-faces): Remove call to 'cperl-ps-print-init'.
(cperl-ps-print-init): Obsolete this function, point to 'ps-print'
customization in the docstring.
(cperl-ps-print): Obsolete this functoin in favor of
`'s-print-buffer'. The function body uses that function.
This commit is contained in:
Harald Jörg 2026-08-24 22:03:25 +02:00
parent 63166a13cc
commit 558709f2c7

View file

@ -603,6 +603,7 @@ entries, and do not change indentation."
(cons (choice (const nil) string)
(repeat symbol)))))
:group 'cperl-faces)
(make-obsolete-variable 'cperl-ps-print-face-properties "not used." "32.1")
(defvar cperl-dark-background
(cperl-choose-color "navy" "os2blue" "darkgreen"))
@ -1110,8 +1111,6 @@ Unless KEEP, removes the old indentation."
(get-text-property (point) 'syntax-type))
'(here-doc pod))]
"----"
["CPerl pretty print (experimental)" cperl-ps-print]
"----"
["Syntaxify region" cperl-find-pods-heres-region
(use-region-p)]
["Profile syntaxification" cperl-time-fontification t]
@ -6281,22 +6280,6 @@ In POD, returns the level of the current heading."
(t 5))) ; should not happen
(defun cperl-windowed-init ()
"Initialization under windowed version."
(cond ((featurep 'ps-print)
(or cperl-faces-init
(progn
(cperl-init-faces))))
((not cperl-faces-init)
(add-hook 'font-lock-mode-hook
(lambda ()
(if (memq major-mode '(perl-mode cperl-mode))
(progn
(or cperl-faces-init (cperl-init-faces))))))
(eval-after-load
"ps-print"
'(or cperl-faces-init (cperl-init-faces))))))
(defvar cperl-font-lock-keywords-1 nil
"Additional expressions to highlight in Perl mode. Minimal set.")
(defvar cperl-font-lock-keywords nil
@ -6768,30 +6751,17 @@ functions (which they are not). Inherits from `default'.")
(defvar ps-underlined-faces)
(defun cperl-ps-print-init ()
"Initialization of `ps-print' components for faces used in CPerl."
(eval-after-load "ps-print"
'(setq ps-bold-faces
;; font-lock-variable-name-face
;; font-lock-constant-face
(append '(cperl-array-face cperl-hash-face)
ps-bold-faces)
ps-italic-faces
;; font-lock-constant-face
(append '(cperl-nonoverridable-face cperl-hash-face)
ps-italic-faces)
ps-underlined-faces
;; font-lock-type-face
(append '(cperl-array-face cperl-hash-face underline cperl-nonoverridable-face)
ps-underlined-faces))))
(defvar ps-print-face-extension-alist)
"This function is no longer available. Use `customize` to set
preferences for the \"ps-print\" group instead.
Initialization of `ps-print' components for faces used in CPerl."
(declare (obsolete nil "32.1")))
(defun cperl-ps-print (&optional file)
"Pretty-print in CPerl style.
"Print the current buffer to FILE.
If optional argument FILE is an empty string, prints to printer, otherwise
to the file FILE. If FILE is nil, prompts for a file name.
Style of printout regulated by the variable `cperl-ps-print-face-properties'."
The printout style can be customized in the \"ps-print\" group."
(declare (obsolete 'ps-print-buffer "32.1"))
(interactive)
(or file
(setq file (read-from-minibuffer
@ -6800,13 +6770,7 @@ Style of printout regulated by the variable `cperl-ps-print-face-properties'."
nil nil 'file-name-history)))
(or (> (length file) 0)
(setq file nil))
(require 'ps-print) ; To get ps-print-face-extension-alist
(let ((ps-print-color-p t)
(ps-print-face-extension-alist ps-print-face-extension-alist))
(ps-extend-face-list cperl-ps-print-face-properties)
(ps-print-buffer-with-faces file)))
(cperl-windowed-init)
(ps-print-buffer file))
(defconst cperl-styles-entries
'(cperl-indent-level cperl-brace-offset cperl-continued-brace-offset