unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* text properties not applied (almost a bug report, but...)
@ 2005-05-25 17:22 Joe Corneli
  0 siblings, 0 replies; 4+ messages in thread
From: Joe Corneli @ 2005-05-25 17:22 UTC (permalink / raw)


In some modes (elisp and mail are two I've tested) this form simply
returns `t', there's no change to the display, and apparently no
change to the buffer.

(set-text-properties (line-beginning-position)
                     (line-end-position)
                     '(face font-lock-keyword-face)
                     (current-buffer))               
                            ^                        ^

                            2                        1
                                                  C-x C-e
                          (get-text-property       
                             (point) 'face)
                          ;=> nil

Is there a way to assert that I really want to set the face,
regardless of the mode the buffer happens to be in (though it seems to
be a bit of a long-shot)?  Or must I switch to fundamental mode to set
the face?  (Note: in CVS emacs of 2005-05-10, switching *back* to
fundamental mode didn't work, but with today's version emacs, that at
least works.)

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

* Re: text properties not applied (almost a bug report, but...)
       [not found] <mailman.1780.1117043290.25862.help-gnu-emacs@gnu.org>
@ 2005-05-25 18:51 ` Johan Bockgård
  2005-05-25 19:31   ` Joe Corneli
       [not found]   ` <mailman.1805.1117049864.25862.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 4+ messages in thread
From: Johan Bockgård @ 2005-05-25 18:51 UTC (permalink / raw)


Joe Corneli <jcorneli@math.utexas.edu> writes:

> Is there a way to assert that I really want to set the face,
> regardless of the mode the buffer happens to be in

I doesn't depend on the mode, but on whether font lock is used or not
(font lock uses the face property).

-- 
Johan Bockgård

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

* Re: text properties not applied (almost a bug report, but...)
  2005-05-25 18:51 ` text properties not applied (almost a bug report, but...) Johan Bockgård
@ 2005-05-25 19:31   ` Joe Corneli
       [not found]   ` <mailman.1805.1117049864.25862.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 4+ messages in thread
From: Joe Corneli @ 2005-05-25 19:31 UTC (permalink / raw)


Well, I realized that I might as well use overlays.

   I doesn't depend on the mode, but on whether font lock is used or not
   (font lock uses the face property).

I'm not sure this is correct, since if you save my message,
kill the buffer, reopen it, and run `font-lock-fontify-buffer'
then faces change, but the code snippet still changes
the faces when it is run.

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

* Re: text properties not applied (almost a bug report, but...)
       [not found]   ` <mailman.1805.1117049864.25862.help-gnu-emacs@gnu.org>
@ 2005-05-25 20:12     ` rgb
  0 siblings, 0 replies; 4+ messages in thread
From: rgb @ 2005-05-25 20:12 UTC (permalink / raw)


>    I doesn't depend on the mode, but on whether font lock is used or not
>    (font lock uses the face property).
>
> I'm not sure this is correct, since if you save my message,
> kill the buffer, reopen it, and run `font-lock-fontify-buffer'
> then faces change, but the code snippet still changes
> the faces when it is run.

When font lock is turned on, application of a text property
is seen as a change that causes the text to be re-fontified.
So your setting of the text face is almost immediately erased.
If you execute your code in a buffer with font-lock turned off
your face setting will persist.

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

end of thread, other threads:[~2005-05-25 20:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.1780.1117043290.25862.help-gnu-emacs@gnu.org>
2005-05-25 18:51 ` text properties not applied (almost a bug report, but...) Johan Bockgård
2005-05-25 19:31   ` Joe Corneli
     [not found]   ` <mailman.1805.1117049864.25862.help-gnu-emacs@gnu.org>
2005-05-25 20:12     ` rgb
2005-05-25 17:22 Joe Corneli

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