emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: ps-print-buffer-with-faces doesn't use selected frame's background


From: Vinicius Jose Latorre
Subject: Re: ps-print-buffer-with-faces doesn't use selected frame's background
Date: Tue, 16 Jan 2007 00:32:33 -0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.9) Gecko/20061211 SeaMonkey/1.0.7

Richard Stallman wrote:
Well, I don't know why, but when the initialization code for ps-default-bg and ps-default-fg include frame-parameter,

What is the precise test case that you tried?

1. set in the ~/.emacs file:
  (setq initial-frame-alist (append '((background-color "DarkSlateGray"))
                                    initial-frame-alist))
  (setq default-frame-alist (append '((background-color "DarkSlateGray"))
                                    default-frame-alist))

2. set in emacs/lisp/ps-print.el file:
  (defcustom ps-default-bg (frame-parameter nil 'background-color))

3. byte-compile ps-print.el file

4. start new Emacs session

5. type: C-h v ps-default-bg RET
  ==>> "#ffffff" (white)

6. type: M-: (frame-parameter nil 'background-color) RET
  ==>> "DarkSlateGray"


If the variables have a value (let's say, 'frame-parameter), the value of them is calculated when any ps-print command is activated. And it's used frame-parameter function to get the color value.

I don't understand what that means.  Could you show me the code you
have in mind?
Well, the idea is to have the following initialization:

   (defcustom ps-default-bg 'frame-parameter)

When ps-print is invoked as, for example:

   M-x ps-print-buffer-with-faces RET

The following piece of code is executed:

   (setq ps-default-background
         (cond
           ((eq ps-default-bg 'frame-parameter)
             (frame-parameter nil 'background-color))
           ;; ... other conditions ...
           ))

So, the frame-parameter function is invoked only during ps-print command activation instead of during ps-print file loading.

ps-default-fg variable is handled in a similar way.





reply via email to

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