help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: string func to use in .emacs


From: Eli Zaretskii
Subject: Re: string func to use in .emacs
Date: 26 Jan 2004 09:03:13 +0200

> From: Peter Wu <peterwu@hotmail.com>
> Newsgroups: gnu.emacs.help
> Date: Sun, 25 Jan 2004 22:16:02 -0500
> 
> > (defun string-trim-right (str)
> >   (with-temp-buffer
> >     (insert str)
> >     (delete-trailing-whitespace)
> >     (buffer-string)))
> 
> I tried to use the func and got an error:
> 
>   Symbol's value as variable is void: string-trim-right
> 
> My code:
> 
> (string-trim-right("Emacs "))
> => "Emacs" (the expected output)

You need to evaluate the function's definition, otherwise how will
Emacs know what is string-trim-right?  To do that, put the cursor
after the right closing paren of the function, and type "C-x C-e".





reply via email to

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