unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [david.reitter@gmail.com: tool-bar: frame-local tool-bar-button-margin]
@ 2005-10-24  1:01 Richard M. Stallman
  2005-10-24 23:51 ` Chong Yidong
  0 siblings, 1 reply; 4+ messages in thread
From: Richard M. Stallman @ 2005-10-24  1:01 UTC (permalink / raw)


Would someone please investigate this bug, and ack?

------- Start of forwarded message -------
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com;
	h=received:mime-version:content-transfer-encoding:message-id:content-type:to:from:subject:date:x-mailer;
	b=r3C3fULpX1KWe4Tac2XnkI4etL1GxL2005axUsS2PBzqmE8P9wYHEtD3+I8BIt/j65l/Wv6sFtdIHaDvbMNJmrZjCmjd0BDXKs3iHUaqzYBFPrafhk6WHy77e2Ab2rIJlUnxk3c97pRFwp2iKGmLdlrWGeVhwjPxNLIqGVxw0Rs=
To: emacs-pretest-bug@gnu.org
From: David Reitter <david.reitter@gmail.com>
Date: Mon, 10 Oct 2005 14:48:03 +0100
Subject: tool-bar: frame-local tool-bar-button-margin
Sender: emacs-pretest-bug-bounces+rms=gnu.org@gnu.org
X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on monty-python
X-Spam-Level: 
X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no version=2.63

Making tool-bar-button-margin a frame-local variable doesn't have the  
desired effect.
When several frames are open, a change to this variable will change  
all tool-bars, not just the one belonging to the current frame.

(This works as intended with making it buffer-local, which is,  
however, not what I really want.)

Sample code:


1. Open two frames, displaying different buffers in different fonts  
(with different font heights).

2. Ensure toolbars are turned on (toolbar-mode)

3. Execute this in one of the frames

;; This code tries to get rid of the ugly extra line drawn under the  
toolbar.

(make-variable-frame-local 'tool-bar-button-margin)
;; (make-variable-buffer-local  'tool-bar-button-margin) ;; this  
would work sometimes
(setq tool-bar-button-margin
       (cons 4 (+ 2
                      (mod tool-bar-images-pixel-height
               (frame-char-height)))))

4. The toolbar height will change in all frames, not just the one  
where the code was executed.





In GNU Emacs 22.0.50.1 (powerpc-apple-darwin8.2.0)
  of 2005-10-07 on lucy - Aquamacs Distribution 0.9.6
Distributor `Apple Computers', version 10.4.2
configured using `configure '--without-x' '--prefix=/usr/local''

Important settings:
   value of $LC_ALL: nil
   value of $LC_COLLATE: nil
   value of $LC_CTYPE: nil
   value of $LC_MESSAGES: nil
   value of $LC_MONETARY: nil
   value of $LC_NUMERIC: nil
   value of $LC_TIME: nil
   value of $LANG: nil
   locale-coding-system: iso-latin-1
   default-enable-multibyte-characters: t

Major mode: Emacs-Lisp

Minor modes in effect:
   smart-frame-positioning-mode: t
   recentf-mode: t
   osx-key-mode: t
   mouse-wheel-mode: t
   show-paren-mode: t
   delete-selection-mode: t
   pc-selection-mode: t
   cua-mode: t
   encoded-kbd-mode: t
   tooltip-mode: t
   auto-compression-mode: t
   menu-bar-mode: t
   global-font-lock-mode: t
   font-lock-mode: t
   blink-cursor-mode: t
   unify-8859-on-encoding-mode: t
   utf-translate-cjk-mode: t
   column-number-mode: t
   line-number-mode: t
   transient-mark-mode: t

Recent input:
m o d SPC H-v SPC <down-mouse-1> <mouse-1> <double-down-mouse-1>
<mouse-movement> <double-mouse-1> H-c <down-mouse-1>
<mouse-1> H-v <down-mouse-1> <mouse-1> C-x C-e <wheel-down>
<S-down-mouse-1> <S-mouse-1> H-x <down-mouse-1> <mouse-1>
<double-down-mouse-1> <double-mouse-1> H-v <down-mouse-1>
<mouse-1> <return> <tab> <tab> <tab> <tab> <down-mouse-1>
<mouse-1> <return> <tab> <tab> <tab> <backspace> <backspace>
<backspace> <backspace> <return> <tab> <backspace>
<backspace> <backspace> <tab> <up> <H-backspace> <escape>
x e m a c s - <escape> <escape> <escape> <escape> <down-mouse-1>
<drag-mouse-1> <down-mouse-1> <mouse-movement> <mouse-movement>
<drag-mouse-1> H-c <switch-frame> <return> <return>
H-v <up> <up> <tab> <down> <tab> <down-mouse-1> <mouse-movement>
<mouse-1> <backspace> <backspace> <down-mouse-1> <mouse-movement>
<mouse-movement> <mouse-movement> <mouse-movement>
<drag-mouse-1> H-c <help-echo> <down-mouse-1> <mouse-1>
<help-echo> <menu-bar> <help-menu> <report-emacs-b
ug>

Recent messages:
(4 . 10)
tool-bar-button-margin
(4 . 6)
tool-bar-button-margin
(4 . 8)
Making completion list...
8
16
8
Quit





_______________________________________________
Emacs-pretest-bug mailing list
Emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
------- End of forwarded message -------

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

* Re: [david.reitter@gmail.com: tool-bar: frame-local tool-bar-button-margin]
  2005-10-24  1:01 [david.reitter@gmail.com: tool-bar: frame-local tool-bar-button-margin] Richard M. Stallman
@ 2005-10-24 23:51 ` Chong Yidong
  2005-10-25  7:12   ` David Reitter
  0 siblings, 1 reply; 4+ messages in thread
From: Chong Yidong @ 2005-10-24 23:51 UTC (permalink / raw)
  Cc: David Reitter, emacs-devel

> Would someone please investigate this bug, and ack?
>
> From: David Reitter <david.reitter@gmail.com>
> Subject: tool-bar: frame-local tool-bar-button-margin
> To: emacs-pretest-bug@gnu.org
>
> Making tool-bar-button-margin a frame-local variable doesn't have the  
> desired effect.
> When several frames are open, a change to this variable will change  
> all tool-bars, not just the one belonging to the current frame.

The trouble is that tool-bar-button-margin is not a frame parameter.
The documentation for make-variable-frame-local says:

  Enable variable to have frame-local bindings.

  When a frame-local binding exists in the current frame,
  it is in effect whenever the current buffer has no buffer-local binding.
  A frame-local binding is actually a frame parameter value;
  thus, any given frame has a local binding for variable if it has
  a value for the frame parameter named variable.  Return variable.
  See `modify-frame-parameters' for how to set frame parameters.

The Elisp documentation is a little more explicit:

  Frame-local bindings are actually frame parameters: you create a
  frame-local binding in a specific frame by calling
  `modify-frame-parameters' and specifying the variable name as the
  parameter name...

  make-variable-frame-local:

     Enable the use of frame-local bindings for VARIABLE.  This does
     not in itself create any frame-local bindings for the variable;
     however, if some frame already has a value for VARIABLE as a frame
     parameter, that value automatically becomes a frame-local binding.

Using modify-frame-parameters followed by make-variable-frame-local, I
am indeed able to get frame-local values for tool-bar-button margin.

Probably the docstring for make-variable-frame-local should be
rephrased to make it clearer.

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

* Re: [david.reitter@gmail.com: tool-bar: frame-local tool-bar-button-margin]
  2005-10-24 23:51 ` Chong Yidong
@ 2005-10-25  7:12   ` David Reitter
  2005-10-30  3:37     ` Richard M. Stallman
  0 siblings, 1 reply; 4+ messages in thread
From: David Reitter @ 2005-10-25  7:12 UTC (permalink / raw)
  Cc: Emacs-Devel '

On 25 Oct 2005, at 00:51, Chong Yidong wrote:
>
>   make-variable-frame-local:
>
>      Enable the use of frame-local bindings for VARIABLE.  This does
>      not in itself create any frame-local bindings for the variable;
>      however, if some frame already has a value for VARIABLE as a  
> frame
>      parameter, that value automatically becomes a frame-local  
> binding.
>
> Using modify-frame-parameters followed by make-variable-frame-local, I
> am indeed able to get frame-local values for tool-bar-button margin.
>
> Probably the docstring for make-variable-frame-local should be
> rephrased to make it clearer.

Yes that'd be an improvement - but I find the whole principle  
confusing. One would expect that make-variable-buffer-local and make- 
variable-frame-local lead parallel lives. For example, I knew already  
that frame-local-variables are the same as frame parameters. But I  
expected that setting a variable that has been made frame-local will  
set the appropriate frame parameter/variable.

The design is the root of the problem, not just the documentation...

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

* Re: [david.reitter@gmail.com: tool-bar: frame-local tool-bar-button-margin]
  2005-10-25  7:12   ` David Reitter
@ 2005-10-30  3:37     ` Richard M. Stallman
  0 siblings, 0 replies; 4+ messages in thread
From: Richard M. Stallman @ 2005-10-30  3:37 UTC (permalink / raw)
  Cc: cyd, emacs-devel

    One would expect that make-variable-buffer-local and make- 
    variable-frame-local lead parallel lives. For example, I knew already  
    that frame-local-variables are the same as frame parameters. But I  
    expected that setting a variable that has been made frame-local will  
    set the appropriate frame parameter/variable.

I agree with you--the name make-variable-frame-local is misleading.
What would be a better name?

Perhaps make-variable-frame-localizable?
enable-frame-local-bindings?

For the meanwhile, I clarified its doc string.

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

end of thread, other threads:[~2005-10-30  3:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-24  1:01 [david.reitter@gmail.com: tool-bar: frame-local tool-bar-button-margin] Richard M. Stallman
2005-10-24 23:51 ` Chong Yidong
2005-10-25  7:12   ` David Reitter
2005-10-30  3:37     ` Richard M. 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).