From: Drew Adams <drew.adams@oracle.com>
To: Jean-Christophe Helary <jean.christophe.helary@gmail.com>,
Tino Calancha <tino.calancha@gmail.com>
Cc: Mark Oteiza <mvoteiza@udel.edu>, emacs-devel <emacs-devel@gnu.org>
Subject: RE: Trimming strings, /emacs/lisp/emacs-lisp/subr-x.el modification
Date: Sat, 6 May 2017 09:30:46 -0700 (PDT) [thread overview]
Message-ID: <0d4cb885-4bea-44d5-8a19-5b77773db563@default> (raw)
In-Reply-To: <8F6958D6-3E13-4C31-B1F8-AF10A8FC8FC6@gmail.com>
> > +(defsubst string-trim-left (string &optional regexp)
> > + "Trim STRING of leading whitespace matching REGEXP.
> > +
> > +REGEXP defaults to \"[ \t\n\r]+\"."
> > + (if (string-match (concat "\\`" (or regexp "[ \t\n\r]+")) string)
> > (replace-match "" t t string)
> > string))
>
> Isn't there a way to do [...] that would work with defsubst?
IMHO, *none* of the defsubsts in subr-x.el should be there.
They should all be defuns. (Currently, even their names are
inconsistent, some with `--' to indicate internal, most not.)
The code will be byte-compiled. I see zero reason why these
functions should be defsubsts. Instead of using a boatload
of defsubsts willy nilly, any defsubsts we put in the code
should be _strongly_ justified. I don't see any justification
for these defsubsts.
It's not just because `defsubst' still exists that we should
use it casually (or even use it at all). It is a precambrian
vestige, with little or no real use case.
Just one opinion.
next prev parent reply other threads:[~2017-05-06 16:30 UTC|newest]
Thread overview: 73+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-02 9:34 Trimming strings, /emacs/lisp/emacs-lisp/subr-x.el modification Jean-Christophe Helary
2017-05-02 15:41 ` Clément Pit-Claudel
2017-05-02 22:35 ` Jean-Christophe Helary
2017-05-02 17:16 ` Eli Zaretskii
2017-05-02 22:48 ` Jean-Christophe Helary
2017-05-02 23:11 ` Mark Oteiza
2017-05-03 1:13 ` Jean-Christophe Helary
2017-05-06 2:41 ` Jean-Christophe Helary
2017-05-06 4:29 ` Tino Calancha
2017-05-06 9:02 ` Jean-Christophe Helary
2017-05-06 9:22 ` Eli Zaretskii
2017-05-06 10:33 ` Jean-Christophe Helary
2017-05-06 10:43 ` Eli Zaretskii
2017-05-06 11:02 ` Jean-Christophe Helary
2017-05-06 13:05 ` Jean-Christophe Helary
2017-05-06 13:51 ` Tino Calancha
2017-05-06 14:24 ` Eli Zaretskii
2017-05-07 2:25 ` Tino Calancha
2017-05-07 2:43 ` Eli Zaretskii
2017-05-07 10:40 ` Tino Calancha
2017-05-06 17:51 ` Johan Bockgård
2017-05-06 19:02 ` Eli Zaretskii
2017-05-06 19:55 ` Johan Bockgård
2017-05-06 20:03 ` Eli Zaretskii
2017-05-07 16:23 ` Johan Bockgård
2017-05-07 16:53 ` Eli Zaretskii
2017-05-10 9:21 ` Yuri Khan
2017-05-10 11:15 ` Jean-Christophe Helary
2017-05-10 11:56 ` Stefan Monnier
2017-05-10 12:21 ` Jean-Christophe Helary
2017-05-08 2:40 ` Jean-Christophe Helary
2017-05-08 14:28 ` Eli Zaretskii
2017-05-08 21:33 ` Jean-Christophe Helary
2017-05-08 22:45 ` Johan Bockgård
2017-05-08 23:15 ` Jean-Christophe Helary
2017-05-09 12:05 ` Michael Heerdegen
2017-05-09 13:09 ` Jean-Christophe Helary
2017-05-09 14:05 ` Michael Heerdegen
2017-05-10 9:30 ` Michael Heerdegen
2017-05-10 11:11 ` Jean-Christophe Helary
2017-05-09 15:23 ` Eli Zaretskii
2017-05-09 15:33 ` Jean-Christophe Helary
2017-05-09 16:21 ` Eli Zaretskii
2017-05-09 23:03 ` Jean-Christophe Helary
2017-05-10 0:45 ` Stefan Monnier
2017-05-10 2:44 ` Eli Zaretskii
2017-05-10 3:09 ` Stefan Monnier
2017-05-10 3:49 ` Jean-Christophe Helary
2017-05-10 11:55 ` Stefan Monnier
2017-05-09 16:37 ` Andreas Schwab
2017-05-10 2:29 ` Eli Zaretskii
2017-05-10 7:45 ` Andreas Schwab
2017-05-10 11:07 ` Jean-Christophe Helary
2017-05-07 4:39 ` Jean-Christophe Helary
2017-05-07 14:49 ` Eli Zaretskii
2017-05-07 13:48 ` Stefan Monnier
2017-05-10 14:26 ` Jean-Christophe Helary
2017-05-13 13:36 ` bug#26908: Fwd: " Jean-Christophe Helary
2017-05-16 22:21 ` Jean-Christophe Helary
2017-05-17 2:26 ` Eli Zaretskii
2017-05-17 2:26 ` Eli Zaretskii
2017-05-17 3:41 ` Jean-Christophe Helary
2017-05-17 3:41 ` Jean-Christophe Helary
2017-05-16 22:21 ` Jean-Christophe Helary
2017-05-19 11:30 ` Eli Zaretskii
2017-05-06 11:06 ` Jean-Christophe Helary
2017-05-06 16:30 ` Drew Adams [this message]
2017-05-06 17:44 ` Stefan Monnier
2017-05-06 18:07 ` subr-x.el code and defsubst [was: Trimming strings, /.../subr-x.el modification] Drew Adams
2017-05-14 22:45 ` Tianxiang Xiong
2017-05-15 1:11 ` Drew Adams
2017-05-06 9:12 ` Trimming strings, /emacs/lisp/emacs-lisp/subr-x.el modification Andreas Schwab
2017-05-06 10:31 ` Tino Calancha
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=0d4cb885-4bea-44d5-8a19-5b77773db563@default \
--to=drew.adams@oracle.com \
--cc=emacs-devel@gnu.org \
--cc=jean.christophe.helary@gmail.com \
--cc=mvoteiza@udel.edu \
--cc=tino.calancha@gmail.com \
/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.