unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* question about frame local variable
@ 2003-10-25  0:49 Kenichi Handa
  2003-10-26 11:46 ` Richard Stallman
  0 siblings, 1 reply; 15+ messages in thread
From: Kenichi Handa @ 2003-10-25  0:49 UTC (permalink / raw)


It seems that we need the attached patch to make a code like
this (allow scalable fonts only for a specific frame) work
well.

(defun make-frame-allowing-scalable-fonts ()
  (make-variable-frame-local 'scalable-fonts-allowed)
  (let ((frame (make-frame '((name . "SCALABLE")))))
    (modify-frame-parameters frame '((scalable-fonts-allowed . t)))
    frame))

The patch accesses the value of `scalable-fonts-allowed' not
directly by Vscalable_fonts_allowed but via:
   find_symbol_value (Qscalable_fonts_allowed)

Is this the correct way?  Shall I install it?

---
Ken'ichi HANDA
handa@m17n.org

*** xfaces.c.~1.284.~	Tue Sep  2 08:26:41 2003
--- xfaces.c	Fri Oct 24 16:48:04 2003
***************
*** 6162,6174 ****
  may_use_scalable_font_p (font)
       const char *font;
  {
!   if (EQ (Vscalable_fonts_allowed, Qt))
      return 1;
!   else if (CONSP (Vscalable_fonts_allowed))
      {
        Lisp_Object tail, regexp;
  
!       for (tail = Vscalable_fonts_allowed; CONSP (tail); tail = XCDR (tail))
  	{
  	  regexp = XCAR (tail);
  	  if (STRINGP (regexp)
--- 6162,6177 ----
  may_use_scalable_font_p (font)
       const char *font;
  {
!   Lisp_Object val;
! 
!   val = find_symbol_value (Qscalable_fonts_allowed);
!   if (EQ (val, Qt))
      return 1;
!   else if (CONSP (val))
      {
        Lisp_Object tail, regexp;
  
!       for (tail = val; CONSP (tail); tail = XCDR (tail))
  	{
  	  regexp = XCAR (tail);
  	  if (STRINGP (regexp)
***************
*** 6364,6370 ****
  	}
  
        /* Try all scalable fonts before giving up.  */
!       if (nfonts == 0 && ! EQ (Vscalable_fonts_allowed, Qt))
  	{
  	  int count = SPECPDL_INDEX ();
  	  specbind (Qscalable_fonts_allowed, Qt);
--- 6367,6374 ----
  	}
  
        /* Try all scalable fonts before giving up.  */
!       if (nfonts == 0
! 	  && ! EQ (find_symbol_value (Qscalable_fonts_allowed), Qt))
  	{
  	  int count = SPECPDL_INDEX ();
  	  specbind (Qscalable_fonts_allowed, Qt);

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

end of thread, other threads:[~2003-11-13  4:32 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-25  0:49 question about frame local variable Kenichi Handa
2003-10-26 11:46 ` Richard Stallman
2003-10-28  8:03   ` Kenichi Handa
2003-10-30  1:35     ` Kenichi Handa
2003-10-30  9:33       ` Gerd Moellmann
2003-10-30 10:46         ` Kenichi Handa
2003-10-30 16:27         ` Stefan Monnier
2003-10-30 19:33           ` Gerd Moellmann
2003-11-10  1:05             ` Kenichi Handa
2003-11-10 10:35               ` Gerd Moellmann
2003-11-11  8:38                 ` Kenichi Handa
2003-11-12 20:02                   ` Richard Stallman
2003-11-13  0:42                     ` Kenichi Handa
2003-11-13  4:14                       ` Richard Stallman
2003-11-13  4:32                         ` Kenichi Handa

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