emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: (unknown)


From: Oliver Scholz
Subject: Re: (unknown)
Date: Tue, 20 May 2003 19:13:46 +0200
User-agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.3.50 (windows-nt)

Lennart Staflin <address@hidden> writes:

> If I evaluate:
>
>     (setenv "T5" "Y")
>     (substitute-env-vars "X$T5")

(substitute-env-vars "X${T5}")

The doc-string of `substitute-env-vars' says:

,----
| The variable name should be terminated with a character not a
| letter, digit or underscore; otherwise, enclose the entire variable
| name in braces.
`----

I suggest to add an example to the doc-string:

Index: env.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/env.el,v
retrieving revision 1.29
diff -c -r1.29 env.el
*** env.el      25 Feb 2003 06:19:21 -0000      1.29
--- env.el      20 May 2003 17:13:06 -0000
***************
*** 61,70 ****
  (defun substitute-env-vars (string)
    "Substitute environment variables referred to in STRING.
  `$FOO' where FOO is an environment variable name means to substitute
! the value of that variable.  The variable name should be terminated
! with a character not a letter, digit or underscore; otherwise, enclose
! the entire variable name in braces.  Use `$$' to insert a single
! dollar sign."
    (let ((start 0))
      (while (string-match
            (eval-when-compile
--- 61,74 ----
  (defun substitute-env-vars (string)
    "Substitute environment variables referred to in STRING.
  `$FOO' where FOO is an environment variable name means to substitute
! the value of that variable.  
! 
! The variable name should be terminated with a character not a letter,
! digit or underscore; otherwise, enclose the entire variable name in
! braces. For example, use `(substitute-env-vars \"${FOO}BAR\")' to get
! a string where the value of FOO is concatenated with \"BAR\".
! 
! Use `$$' to insert a single dollar sign."
    (let ((start 0))
      (while (string-match
            (eval-when-compile



    Oliver
-- 
1 Prairial an 211 de la Révolution
Liberté, Egalité, Fraternité!





reply via email to

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