emacs-devel
[Top][All Lists]
Advanced

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

Re: "CHANGED outside Customize" in frames customization group


From: martin rudalics
Subject: Re: "CHANGED outside Customize" in frames customization group
Date: Thu, 03 Jan 2008 20:32:54 +0100
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

> That is true.  It's somewhat of an annoyance.
> Do you see any other solution?

Not really.  setqing and customizing are not compatible.

>
>     So I would reflect any attempts to set `default-frame-alist' and
>     `initial-frame-alist' via (1) command-line arguments, (2) x-resources,
>     and (3) settings of `fringe-mode', `tool-bar-mode', `menu-bar-mode', and
>     possibly `scroll-bar-mode' (I don't understand the latter yet) in the
>     initial file, in two variables say `overriding-default-frame-alist' and
>     `overriding-initial-frame-alist'.
>
> Yes, that is the solution I am proposing.

The problem is then that anyone who wants to know the current default
settings can't tell them by just consulting `default-frame-alist' alone.
Within Emacs currently just faces, fringe, cua-base, and erc do so, but
there may exist packages beyond Emacs ...

>     I have to avoid an
>
>     "Attempt to autoload customize-set-variable while preparing to dump"
>
>     error here.
>
> Yes, but why would that error happen?

It gets called by fringe.el.

>
>       Hence setting `default-frame-alist' via
>     `customize-set-variable' would have to be forked by an optional argument
>     to `modify-all-frames-parameters'.
>
> I don't follow you there.  Does `modify-all-frames-parameters' get called
> during building Emacs?  If so, maybe that is itself the bug.

I suppose because there's no `fringe-mode-explicit' like there's a
`scroll-bar-mode-explicit'.  The attached patch (naively copied from
scroll-bar) would handle this facet.
*** fringe.el.~1.30.~   Wed Aug 29 08:28:06 2007
--- fringe.el   Thu Jan  3 20:21:32 2008
***************
*** 93,98 ****
--- 93,102 ----
  
  (defvar fringe-mode)
  
+ (defvar fringe-mode-explicit nil
+   "Non-nil means `set-fringe-mode' should really do something.
+ This is nil while loading `fringe.el', and t afterward.")
+ 
  (defun set-fringe-mode-1 (ignore value)
    "Call `set-fringe-mode' with VALUE.
  See `fringe-mode' for valid values and their effect.
***************
*** 104,116 ****
  See `fringe-mode' for possible values and their effect."
    (setq fringe-mode value)
  
!   (modify-all-frames-parameters
!    (list (cons 'left-fringe (if (consp fringe-mode)
!                               (car fringe-mode)
!                             fringe-mode))
!        (cons 'right-fringe (if (consp fringe-mode)
!                                (cdr fringe-mode)
!                              fringe-mode)))))
  
  ;; For initialization of fringe-mode, take account of changes
  ;; made explicitly to default-frame-alist.
--- 108,121 ----
  See `fringe-mode' for possible values and their effect."
    (setq fringe-mode value)
  
!   (when fringe-mode-explicit
!     (modify-all-frames-parameters
!      (list (cons 'left-fringe (if (consp fringe-mode)
!                                 (car fringe-mode)
!                               fringe-mode))
!          (cons 'right-fringe (if (consp fringe-mode)
!                                  (cdr fringe-mode)
!                                fringe-mode))))))
  
  ;; For initialization of fringe-mode, take account of changes
  ;; made explicitly to default-frame-alist.
***************
*** 159,164 ****
--- 164,173 ----
    :initialize 'fringe-mode-initialize
    :set 'set-fringe-mode-1)
  
+ ;; We just set fringe-mode, but that was the default.
+ ;; If it is set again, that is for real.
+ (setq fringe-mode-explicit t)
+ 
  (defun fringe-query-style (&optional all-frames)
    "Query user for fringe style.
  Returns values suitable for left-fringe and right-fringe frame parameters.


reply via email to

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