;cperl-mode.el: Allow running under Emacs >=27
authorHarald Jörg <haj@posteo.de>
Thu, 16 May 2024 19:55:07 +0000 (21:55 +0200)
committerHarald Jörg <haj@posteo.de>
Thu, 16 May 2024 19:58:34 +0000 (21:58 +0200)
I would like to advertise cperl-mode.el from the repository as a
workaround for bug#70948.  This can be achieved by safeguarding
the call to derived-mode-add-parents with a version check.

* lisp/progmodes/cperl-mode.el: Call derived-mode-add-parents only
if it is available.

lisp/progmodes/cperl-mode.el

index 11709bfe00b7f082694aff9384c65a2617645b20..81ecb535b826fba599a02b6279d1e3fbcd034d5d 100644 (file)
@@ -1934,7 +1934,8 @@ or as help on variables `cperl-tips', `cperl-problems',
   ;; Setup Flymake
   (add-hook 'flymake-diagnostic-functions #'perl-flymake nil t))
 
-(derived-mode-add-parents 'cperl-mode '(perl-mode))
+(when (fboundp 'derived-mode-add-parents) ; to run under Emacs <30
+  (derived-mode-add-parents 'cperl-mode '(perl-mode)))
 
 (defun cperl--set-file-style ()
   (when cperl-file-style