[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#36664: 27.0.50; definition of string-trim causes warning

From: Andreas Röhler
Subject: bug#36664: 27.0.50; definition of string-trim causes warning
Date: Mon, 15 Jul 2019 16:33:05 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:60.0) Gecko/20100101 Thunderbird/60.7.2

On 15.07.19 16:24, Andreas Röhler wrote:

On 15.07.19 14:24, Lars Ingebrigtsen wrote:
Andreas Röhler <address@hidden> writes:

concerns subr-x.el

When byte-compiling a file with def of trim-string inside, get a
warning: Lexical argument shadows the dynamic variable
I'm not sure I follow.  Do you mean if you have a function that calls
string-trim (not define trim-string?) in a file, and you compile that
file, you get that warning?

If that's what you mean, I'm unable to reproduce the error.

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))


Hmm, also can't reproduce with emacs -Q, only from my config - see attachment.

Beside of this IMO the warning is reasonable - commonly used symbols should not appear as plain argument names.

Attachment: warning.png
Description: PNG image

reply via email to

[Prev in Thread] Current Thread [Next in Thread]