GNU bug report logs - #36664
27.0.50; definition of string-trim causes warning

Previous Next

Package: emacs;

Reported by: Andreas Röhler <andreas.roehler <at> easy-emacs.de>

Date: Mon, 15 Jul 2019 12:19:01 UTC

Severity: wishlist

Tags: notabug, wontfix

Found in version 27.0.50

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 36664 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
Cc: 36664 <at> debbugs.gnu.org
Subject: Re: bug#36664: 27.0.50; definition of string-trim causes warning
Date: Mon, 15 Jul 2019 17:16:44 +0200
Andreas Röhler <andreas.roehler <at> easy-emacs.de> writes:

> Have that in python-mode.el --as older Emacsen might miss the function--:
>
> ;; subr-x.el might not exist yet
> (unless (functionp 'string-trim)
>   (defsubst string-trim (string &optional trim-left trim-right)
>     "Trim STRING of leading and trailing strings matching TRIM-LEFT
> and TRIM-RIGHT.
>
> TRIM-LEFT and TRIM-RIGHT default to \"[ \\t\\n\\r]+\"."
>     (string-trim-left (string-trim-right string trim-right) trim-left))

I put the following in /tmp/a.el and said `M-x byte-compile-file', and I
got no warning...

(unless (functionp 'string-trim)
 (defsubst string-trim (string &optional trim-left trim-right)
   "Trim STRING of leading and trailing strings matching TRIM-LEFT
and TRIM-RIGHT.

TRIM-LEFT and TRIM-RIGHT default to \"[ \\t\\n\\r]+\"."
   (string-trim-left (string-trim-right string trim-right) trim-left)))

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 5 years and 245 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.