From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Harald Jörg" <haj@posteo.de>
Cc: emacs-devel@gnu.org
Subject: Re: cperl-mode: Eliminating references to obsolete packages
Date: Wed, 23 Sep 2020 15:50:14 -0400 [thread overview]
Message-ID: <jwvsgb8s2hv.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <ee30c62a-b5e7-04cb-3fe9-3459129dfde3@posteo.de> ("Harald Jörg"'s message of "Wed, 23 Sep 2020 21:38:44 +0200")
> I guess Ilya has retired?
I assume he stopped using Emacs, but I have no idea, really.
> Should I try to contact him?
I don't see any need for it, but feel free to try.
> I want to keep it compatible with at least Emacs 26, since this is the
Sounds good.
> feedback so far. As of now, I have found two commits which violate
> that, one of which I consider fairly irrelevant (timing font-locking:
> This was an issue 20 years ago, when computers where a bit slower).
It's usually pretty easy to tweak changes so they don't break
backward compatibility.
> I am unsure about the procedure: Should the backwards-compatible
> version live in a separate branch on Emacs?
I think we don't need a separate branch. E.g. for format-prompt we can
use a patch like the one below. If you can't think of a simple way to
preserve backward compatibility in a specific situation, feel free to
ask for help,
Stefan
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 468ffc949a..57bee5c4d7 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -6324,6 +6324,12 @@ cperl-word-at-point
(get major-mode 'find-tag-default-function)
'find-tag-default))))))
+(defalias 'cperl--format-prompt
+ (if (fboundp 'format-prompt) #'format-prompt ;New in Emacs≥28
+ (lambda (msg default)
+ (if default (format "%s (default %s): " msg default)
+ (concat msg ": ")))))
+
(defun cperl-info-on-command (command)
"Show documentation for Perl command COMMAND in other window.
If perl-info buffer is shown in some frame, uses this frame.
@@ -6332,7 +6338,7 @@ cperl-info-on-command
(interactive
(let* ((default (cperl-word-at-point))
(read (read-string
- (format-prompt "Find doc for Perl function" default))))
+ (cperl--format-prompt "Find doc for Perl function" default))))
(list (if (equal read "")
default
read))))
@@ -8291,7 +8297,7 @@ cperl-perldoc
(interactive
(list (let* ((default-entry (cperl-word-at-point))
(input (read-string
- (format-prompt "perldoc entry" default-entry))))
+ (cperl--format-prompt "perldoc entry" default-entry))))
(if (string= input "")
(if (string= default-entry "")
(error "No perldoc args given")
next prev parent reply other threads:[~2020-09-23 19:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-23 18:37 cperl-mode: Eliminating references to obsolete packages Harald Jörg
2020-09-23 19:16 ` Stefan Monnier
2020-09-23 19:38 ` Harald Jörg
2020-09-23 19:50 ` Stefan Monnier [this message]
2020-09-24 15:34 ` Harald Jörg
2020-09-24 17:09 ` Stefan Monnier
2020-09-24 18:43 ` Harald Jörg
2020-09-24 22:20 ` Stefan Monnier
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=jwvsgb8s2hv.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=haj@posteo.de \
/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.