unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Yet another problem with default-text-properties
@ 2004-05-20  3:50 Luc Teirlinck
  2004-05-20 13:17 ` Richard Stallman
  0 siblings, 1 reply; 2+ messages in thread
From: Luc Teirlinck @ 2004-05-20  3:50 UTC (permalink / raw)


Consider the following ielm run:

*** Welcome to IELM ***  Type (describe-mode) for help.
ELISP> (make-local-variable 'default-text-properties)
default-text-properties
ELISP> (setq default-text-properties '(foo 69))
(foo 69)

ELISP> (setq char-property-alias-alist '((foo bar)))
((foo bar))

ELISP> (setq str "01")
"01"
ELISP> (get-text-property 1 'foo str)
69
ELISP> 

Now this might look perfectly as expected.

However, does this mean that whenever one constructs any strings, or
calls any command that could be constructing strings, that are not
directly related to the current buffer's mode, one should always bind
default-text-properties to nil?  For instance, enriched mode specifies
a buffer-local value for default-text-properties.  That value seems to
be meant for text to be inserted in the buffer, but it will also apply
to completely unrelated strings constructed while the buffer is
current.

Does that not seem somewhat bizarre?

Sincerely,

Luc.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Yet another problem with default-text-properties
  2004-05-20  3:50 Yet another problem with default-text-properties Luc Teirlinck
@ 2004-05-20 13:17 ` Richard Stallman
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Stallman @ 2004-05-20 13:17 UTC (permalink / raw)
  Cc: emacs-devel

    However, does this mean that whenever one constructs any strings, or
    calls any command that could be constructing strings, that are not
    directly related to the current buffer's mode, one should always bind
    default-text-properties to nil?

I don't think so.  The text properties of text in a string should
mean the same as in a buffer.

However, this means that default-text-properties probably should not
have local bindings.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-05-20 13:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-20  3:50 Yet another problem with default-text-properties Luc Teirlinck
2004-05-20 13:17 ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).