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

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

Re: elispQ: How can I extract text from #("text" ... )


From: Mirko
Subject: Re: elispQ: How can I extract text from #("text" ... )
Date: Fri, 4 Apr 2008 10:15:27 -0700 (PDT)
User-agent: G2/1.0

On Apr 4, 11:57 am, "Drew Adams" <drew.ad...@oracle.com> wrote:
> > > AFAIK, string= ignores text properties and should do what
> > > you want.
>
> > It does work, you are right.  It is that all the extra stuff is really
> > not necessary in my application.  And it obscures debugging.
>
> Then I guess your options are to either (1) prevent the string from having a
> text property to begin with or (2) remove the text property.
>
> For #1, you need to find where that happens. #2 is straightforward:
>
>  (substring-no-properties string-w-text-props)
>
> Depending on what you are doing, you might alternatively use a print function 
> to
> insert text (without faces) in a buffer.:
>
>  (with-output-to-temp-buffer "foo" (princ some-text))
>
> And if you are getting the text from a buffer in the first place, you can use
> `buffer-substring-no-properties' instead of `buffer-substring'. See also
> `insert-buffer-substring-no-properties'.
>
> HTH

Thanks for the pointers to those functions.  I will communicate with
the xml.el maintainer to see if he sees anything problem in
implementing them.  But I can always fall back to the (substring-no-
properties).

Out of curiosity, do you know where is the #( syntax described?  I
could not find it in the manual.

Thanks again,

Mirko


reply via email to

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