all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: [PATCH] Re: Save Options vs. default-input-method
       [not found]             ` <rju1svzxxx.fsf@ssv2.dina.kvl.dk>
@ 2002-02-07 14:57               ` Richard Stallman
  2002-02-07 17:41                 ` Per Abrahamsen
  2002-02-07 14:57               ` Richard Stallman
                                 ` (2 subsequent siblings)
  3 siblings, 1 reply; 28+ messages in thread
From: Richard Stallman @ 2002-02-07 14:57 UTC (permalink / raw)
  Cc: emacs-devel

    A new function 'mark-variable-for-saving' function would be better, as
    the old function already is used with its current semantics.

I see only one use of it, aside from the ones in the options menu
which we are talking about changing now.  But that new
function seems like an ok approach too.

Could you please rename that new function to customize-mark-to-save?

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: [PATCH] Re: Save Options vs. default-input-method
       [not found]             ` <rju1svzxxx.fsf@ssv2.dina.kvl.dk>
  2002-02-07 14:57               ` [PATCH] Re: Save Options vs. default-input-method Richard Stallman
@ 2002-02-07 14:57               ` Richard Stallman
  2002-02-07 16:50                 ` Per Abrahamsen
       [not found]               ` <rjpu3jzwyd.fsf_-_@ssv2.dina.kvl.dk>
       [not found]               ` <rjlme7zwja.fsf@ssv2.dina.kvl.dk>
  3 siblings, 1 reply; 28+ messages in thread
From: Richard Stallman @ 2002-02-07 14:57 UTC (permalink / raw)
  Cc: emacs-devel

I think we are having a miscommunication.  You argued that it is wrong
to use custom-save-all for the options menu.  I said your argument was
convincing and I agree.  Then you went ahead and rewrote the options
menu to use custom-save-all.

Did you think I had rejected your argument?

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: [PATCH] text-mode-hook-identify should be part of the standard value for text-mode-hook
       [not found]               ` <rjpu3jzwyd.fsf_-_@ssv2.dina.kvl.dk>
@ 2002-02-07 14:57                 ` Richard Stallman
  2002-02-07 16:27                   ` Per Abrahamsen
  0 siblings, 1 reply; 28+ messages in thread
From: Richard Stallman @ 2002-02-07 14:57 UTC (permalink / raw)
  Cc: emacs-devel

Your fix was reasonable, but the use of a hook function here is not
a good idea in the first place.  So I changed the code to do the
job another way:

*** text-mode.el.~1.36.~	Tue Oct 30 13:11:01 2001
--- text-mode.el	Wed Feb  6 09:56:16 2002
***************
*** 65,70 ****
--- 65,72 ----
   (see the variable `adaptive-fill-mode').
  \\{text-mode-map}
  Turning on Text mode runs the normal hook `text-mode-hook'."
+   (make-local-variable 'text-mode-variant)
+   (setq text-mode-variant t)
    (set (make-local-variable 'indent-line-function) 'indent-relative))
  
  (define-derived-mode paragraph-indent-text-mode text-mode "Parindent"
***************
*** 92,104 ****
    (run-hooks 'paragraph-indent-text-mode-hook))
        
  (defalias 'indented-text-mode 'text-mode)
- 
- (defun text-mode-hook-identify ()
-   "Mark that this mode has run `text-mode-hook'.
- This is how `toggle-text-mode-auto-fill' knows which buffers to operate on."
-   (set (make-local-variable 'text-mode-variant) t))
- 
- (add-hook 'text-mode-hook 'text-mode-hook-identify)
  
  (defun toggle-text-mode-auto-fill ()
    "Toggle whether to use Auto Fill in Text mode and related modes.
--- 94,99 ----

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: [PATCH] Re: Save Options vs. default-input-method
       [not found]               ` <rjlme7zwja.fsf@ssv2.dina.kvl.dk>
@ 2002-02-07 14:57                 ` Richard Stallman
  2002-02-07 16:31                   ` Per Abrahamsen
  0 siblings, 1 reply; 28+ messages in thread
From: Richard Stallman @ 2002-02-07 14:57 UTC (permalink / raw)
  Cc: emacs-devel

    (custom-set-variables
      ;; custom-set-variables was added by Custom -- don't edit or cut/paste it!
      ;; Your init file should contain only one such instance.
     '(current-language-environment "Latin-1")
     '(default-frame-alist (quote ((tool-bar-lines . 1) (menu-bar-lines . 1))))
     '(default-input-method "latin-1-prefix"))

    1. The code that sets the three variables at startup should also set
       their standard-value, so they won't be seen as modified (assuming
       my previous patch is applied).

Do you mean all three, including default-frame-alist?  Or just the
other two?

Anyway, if Save Options is changed so that it only saves the options
that the Options menu can set, won't that fix this problem?

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: [PATCH] text-mode-hook-identify should be part of the standard value for text-mode-hook
  2002-02-07 14:57                 ` [PATCH] text-mode-hook-identify should be part of the standard value for text-mode-hook Richard Stallman
@ 2002-02-07 16:27                   ` Per Abrahamsen
  2002-02-08 23:23                     ` Richard Stallman
  0 siblings, 1 reply; 28+ messages in thread
From: Per Abrahamsen @ 2002-02-07 16:27 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:

> Your fix was reasonable, but the use of a hook function here is not
> a good idea in the first place.  So I changed the code to do the
> job another way:

I suspect it was done with a hook because text-mode-hook is also
called from modes not derived from text-mode.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: [PATCH] Re: Save Options vs. default-input-method
  2002-02-07 14:57                 ` [PATCH] Re: Save Options vs. default-input-method Richard Stallman
@ 2002-02-07 16:31                   ` Per Abrahamsen
       [not found]                     ` <200202100517.g1A5Hoe06105@aztec.santafe.edu>
  0 siblings, 1 reply; 28+ messages in thread
From: Per Abrahamsen @ 2002-02-07 16:31 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:

>     (custom-set-variables
>       ;; custom-set-variables was added by Custom -- don't edit or cut/paste it!
>       ;; Your init file should contain only one such instance.
>      '(current-language-environment "Latin-1")
>      '(default-frame-alist (quote ((tool-bar-lines . 1) (menu-bar-lines . 1))))
>      '(default-input-method "latin-1-prefix"))
>
>     1. The code that sets the three variables at startup should also set
>        their standard-value, so they won't be seen as modified (assuming
>        my previous patch is applied).
>
> Do you mean all three, including default-frame-alist?  Or just the
> other two?

All three, unless there is some special reason default-frame-alist
shouldn't be included.

> Anyway, if Save Options is changed so that it only saves the options
> that the Options menu can set, won't that fix this problem?

This was with the changed code.  All three can be set from the Options
menu (form the Mule and Show/Hide submenus, respectively).

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: [PATCH] Re: Save Options vs. default-input-method
  2002-02-07 14:57               ` Richard Stallman
@ 2002-02-07 16:50                 ` Per Abrahamsen
  2002-02-08 23:23                   ` Richard Stallman
  0 siblings, 1 reply; 28+ messages in thread
From: Per Abrahamsen @ 2002-02-07 16:50 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:

> I think we are having a miscommunication.  You argued that it is wrong
> to use custom-save-all for the options menu.  I said your argument was
> convincing and I agree.  Then you went ahead and rewrote the options
> menu to use custom-save-all.

I argued against customize-save-variable, there isn't any way around
custom-save-all.  Despite it name, it doesn't save all, only those
options that have explicitly been marked for saving.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: [PATCH] Re: Save Options vs. default-input-method
  2002-02-07 14:57               ` [PATCH] Re: Save Options vs. default-input-method Richard Stallman
@ 2002-02-07 17:41                 ` Per Abrahamsen
  2002-02-07 21:15                   ` Pavel Janík
  0 siblings, 1 reply; 28+ messages in thread
From: Per Abrahamsen @ 2002-02-07 17:41 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:

> I see only one use of it, aside from the ones in the options menu
> which we are talking about changing now.  

It is used by XEmacs and by unbundled code.  It is also a user command
(simplest way to set an option permanently from the minibuffer). 

> Could you please rename that new function to customize-mark-to-save?

Renamed and committed.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: [PATCH] Re: Save Options vs. default-input-method
  2002-02-07 17:41                 ` Per Abrahamsen
@ 2002-02-07 21:15                   ` Pavel Janík
  2002-02-08  7:50                     ` Per Abrahamsen
  0 siblings, 1 reply; 28+ messages in thread
From: Pavel Janík @ 2002-02-07 21:15 UTC (permalink / raw)
  Cc: emacs-devel

   From: Per Abrahamsen <abraham@dina.kvl.dk>
   Date: Thu, 07 Feb 2002 18:41:19 +0100

   > > Could you please rename that new function to customize-mark-to-save?
   > 
   > Renamed and committed.

I do not know if this is exactly the case, but now, I'm always asked when
saving my custom-file for encoding, because the previous one
(iso-latin-2-unix, because I use Czech language environment) can not be
used. I use comments in custom-file, so I have e.g.:

 '(auto-image-file-mode t nil (image-file) "Obrázky se zobrazují jako obrázky.")

there. Do you see that too?
-- 
Pavel Janík

Perl is a strange, strange language.  At the 32nd try, I got my
modifications to work.
                  -- Lars Magne Ingebrigtsen in gnus.ding

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: [PATCH] Re: Save Options vs. default-input-method
  2002-02-07 21:15                   ` Pavel Janík
@ 2002-02-08  7:50                     ` Per Abrahamsen
  0 siblings, 0 replies; 28+ messages in thread
From: Per Abrahamsen @ 2002-02-08  7:50 UTC (permalink / raw)


Pavel@Janik.cz (Pavel Janík) writes:

>    From: Per Abrahamsen <abraham@dina.kvl.dk>
>    Date: Thu, 07 Feb 2002 18:41:19 +0100
>
>    > > Could you please rename that new function to customize-mark-to-save?
>    > 
>    > Renamed and committed.
>
> I do not know if this is exactly the case, but now, I'm always asked when
> saving my custom-file for encoding, because the previous one
> (iso-latin-2-unix, because I use Czech language environment) can not be
> used. I use comments in custom-file, so I have e.g.:
>
>  '(auto-image-file-mode t nil (image-file) "Obrázky se zobrazují jako obrázky.")
>
> there.

I don't see how it can be related, the same code (custom-save-all) is
used for saving.  Only the code for choosing which variables to save
have changed.

> Do you see that too?

I get queried if I put non-Latin-1 text in a comment, both with 21.1
and CVS Emacs.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: [PATCH] text-mode-hook-identify should be part of the standard value for text-mode-hook
  2002-02-07 16:27                   ` Per Abrahamsen
@ 2002-02-08 23:23                     ` Richard Stallman
  2002-02-09 11:38                       ` Per Abrahamsen
  0 siblings, 1 reply; 28+ messages in thread
From: Richard Stallman @ 2002-02-08 23:23 UTC (permalink / raw)
  Cc: emacs-devel

    I suspect it was done with a hook because text-mode-hook is also
    called from modes not derived from text-mode.

That seems very unreliable.  Which are they, and why?

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: [PATCH] Re: Save Options vs. default-input-method
  2002-02-07 16:50                 ` Per Abrahamsen
@ 2002-02-08 23:23                   ` Richard Stallman
  0 siblings, 0 replies; 28+ messages in thread
From: Richard Stallman @ 2002-02-08 23:23 UTC (permalink / raw)
  Cc: emacs-devel

    I argued against customize-save-variable, there isn't any way around
    custom-save-all.  Despite it name, it doesn't save all, only those
    options that have explicitly been marked for saving.

Ok.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: [PATCH] text-mode-hook-identify should be part of the standard value for text-mode-hook
  2002-02-08 23:23                     ` Richard Stallman
@ 2002-02-09 11:38                       ` Per Abrahamsen
  2002-02-11  2:08                         ` Richard Stallman
  0 siblings, 1 reply; 28+ messages in thread
From: Per Abrahamsen @ 2002-02-09 11:38 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:

>     I suspect it was done with a hook because text-mode-hook is also
>     called from modes not derived from text-mode.
>
> That seems very unreliable.  Which are they, and why?

I remember it as being recommended practice, before
define-derived-mode existed.

A grep run-hooks.*text-mode-hook in the Emacs CVS revealed the
following modes that call text-mode-hook:

  bookmark-read-annotation-mode, bookmark-edit-annotation-mode,
  gnus-article-edit-mode, message-mode (fixed in Gnus CVS), the old
  outline-mode, and news-reply-mode (from rnewspost... does rnews
  really still exists?).

From unbundled packages, I know the various AUC TeX modes also call
text-mode-hook explicitly, they have never been converted to use
'define-derived-mode'.  I suspect other older unbundled packages for
editining "mostly plain text" do the same.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: [PATCH] text-mode-hook-identify should be part of the standard value for text-mode-hook
  2002-02-09 11:38                       ` Per Abrahamsen
@ 2002-02-11  2:08                         ` Richard Stallman
  2002-02-13 18:04                           ` ShengHuo ZHU
  0 siblings, 1 reply; 28+ messages in thread
From: Richard Stallman @ 2002-02-11  2:08 UTC (permalink / raw)


Damn, I guess this means we will need to put it back in the hook.
That is sad.

      bookmark-read-annotation-mode, bookmark-edit-annotation-mode,
      gnus-article-edit-mode, message-mode (fixed in Gnus CVS), the old
      outline-mode, and news-reply-mode (from rnewspost... does rnews
      really still exists?).

ShengHuo, could you convert gnus-article-edit-mode to use
define-derived-mode?

Stefan, would you like to convert the rest?  I expect that you would.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: [PATCH] Re: Save Options vs. default-input-method
       [not found]                         ` <200202110209.g1B29mh06648@aztec.santafe.edu>
@ 2002-02-11 17:15                           ` Per Abrahamsen
  2002-02-12  9:56                             ` Per Abrahamsen
                                               ` (2 more replies)
  0 siblings, 3 replies; 28+ messages in thread
From: Per Abrahamsen @ 2002-02-11 17:15 UTC (permalink / raw)


Richard Stallman <rms@gnu.org> writes:

>     The change I installed means that "Save Options" will save those
>     options whose default-value is different from their standard-value.
>     It does not care _why_ they are different.  But if they are different
>     because the user has an explicit "setq" in his .emacs, saving is a bad
>     idea.
>
> I see.
>
> It seems like a good idea--please go ahead.

Ok, I commited a patch below.  It makes all the non-mule options use
customize-set-variable or equivalent, and makes 'Save options' only
save those options modified by customize-set-variable or equivalent.

Some notes:

* The "Truncate Long Lines in This Buffer" option now set the default
  value, instead of the buffer specific value, which mean the name is
  misleading.  However, the old code attempted to save the value, and
  you can't save a buffer specific value.  So either the name should
  be changed, or we should not save the variable.  Opinions?

* The code no longer tries to save default-frame-alist.  Instead, it
  saves the more specific menu-bar-mode, tool-bar-mode and
  scroll-bar-mode.   

  However, 'menu-bar-mode' and 'tool-bar-mode' have
  the standard value nil, while in reality it they are usually enabled
  by default.  There are two obvious ways to solve this:

  - Fix the standard value.

  - Remove the standard value. 

  Removing the standard value mean you can no longer choose "Erase
  customization" from customize, but it ensures that the option is
  always saved.  Usually, options are only saved when different from
  their standard value.  This is usually sufficient, but not when the
  (real) standard value depend on how you start Emacs.

  I chose to remove the standard value to make it work, but there are
  many other options with a similar problem, and we should have a
  principal decision.  Maybe a combination of both, where we set the
  standard value to reflect reality, but also set a special flag that
  forces that value to be saved even when identical to the standard value?

* Most menu item are created with menu-bar-make-toggle.  This
  creates a toggle-foobar function for each foobar variable.  I
  decided to leave these alone, since they may conceivable be used in
  ".emacs" files, in which case the option should not be saved.  I
  created a new function customize-mark-as-set to mark the current
  default value as being set by customized after the fact.

* In general, I made the code obey the :get, :set and :require
  defcustom directives.


Index: lisp/ChangeLog
===================================================================
RCS file: /cvsroot/emacs//emacs/lisp/ChangeLog,v
retrieving revision 1.3433
diff -c -r1.3433 ChangeLog
*** lisp/ChangeLog	11 Feb 2002 07:07:25 -0000	1.3433
--- lisp/ChangeLog	11 Feb 2002 16:44:19 -0000
***************
*** 1,3 ****
--- 1,27 ----
+ 2002-02-11  Per Abrahamsen  <abraham@dina.kvl.dk>
+ 
+ 	* toolbar/tool-bar.el (tool-bar-mode): Removed standard value.
+ 	* menu-bar.el (menu-bar-mode): Ditto.
+ 	* cus-edit.el (customize-mark-to-save): Always save variables
+ 	without a standard value.
+ 
+ 	* menu-bar.el (menu-bar-make-toggle): Made it aware of customize.
+ 	(menu-bar-options-save): Ditto.
+ 	(menu-bar-showhide-menu): Ditto.
+ 	(menu-bar-options-menu): Ditto.
+ 	(menu-bar-scroll-bar-right, menu-bar-scroll-bar-left,
+ 	menu-bar-scroll-bar-none): Removed. 
+ 	(menu-bar-showhide-scroll-bar-menu): Use customize aware lambda
+ 	expressions instead.
+ 
+ 	* cus-edit.el (customize-set-value): Return value.
+ 	(customize-set-variable): Ditto.
+ 	(customize-save-variable): Ditto.
+ 	(customize-set-variable): Load dependencies before setting value. 
+         (custom-load-symbol): Autoload it.
+ 	(customize-mark-as-set): New function.
+ 
  2002-02-11  Eli Zaretskii  <eliz@is.elta.co.il>
  
  	* cus-start.el: Don't warn about "x-*" symbols when building a
Index: lisp/cus-edit.el
===================================================================
RCS file: /cvsroot/emacs//emacs/lisp/cus-edit.el,v
retrieving revision 1.143
diff -c -r1.143 cus-edit.el
*** lisp/cus-edit.el	7 Feb 2002 17:32:18 -0000	1.143
--- lisp/cus-edit.el	11 Feb 2002 16:44:19 -0000
***************
*** 748,754 ****
  
  ;;;###autoload
  (defun customize-set-value (var val &optional comment)
!   "Set VARIABLE to VALUE.  VALUE is a Lisp object.
  
  If VARIABLE has a `variable-interactive' property, that is used as if
  it were the arg to `interactive' (which see) to interactively read the value.
--- 748,754 ----
  
  ;;;###autoload
  (defun customize-set-value (var val &optional comment)
!   "Set VARIABLE to VALUE, and return VALUE.  VALUE is a Lisp object.
  
  If VARIABLE has a `variable-interactive' property, that is used as if
  it were the arg to `interactive' (which see) to interactively read the value.
***************
*** 761,775 ****
  				       "Set %s to value: "
  				       current-prefix-arg))
     
-   (set var val)
    (cond ((string= comment "")
   	 (put var 'variable-comment nil))
   	(comment
!  	 (put var 'variable-comment comment))))
  
  ;;;###autoload
  (defun customize-set-variable (variable value &optional comment)
!   "Set the default for VARIABLE to VALUE.  VALUE is a Lisp object.
  
  If VARIABLE has a `custom-set' property, that is used for setting
  VARIABLE, otherwise `set-default' is used.
--- 761,776 ----
  				       "Set %s to value: "
  				       current-prefix-arg))
     
    (cond ((string= comment "")
   	 (put var 'variable-comment nil))
   	(comment
!  	 (put var 'variable-comment comment)))
!   (set var val))
  
  ;;;###autoload
  (defun customize-set-variable (variable value &optional comment)
!   "Set the default for VARIABLE to VALUE, and return VALUE.
! VALUE is a Lisp object.
  
  If VARIABLE has a `custom-set' property, that is used for setting
  VARIABLE, otherwise `set-default' is used.
***************
*** 787,792 ****
--- 788,794 ----
    (interactive (custom-prompt-variable "Set variable: "
  				       "Set customized value for %s to: "
  				       current-prefix-arg))
+   (custom-load-symbol variable)
    (funcall (or (get variable 'custom-set) 'set-default) variable value)
    (put variable 'customized-value (list (custom-quote value)))
    (cond ((string= comment "")
***************
*** 794,804 ****
   	 (put variable 'customized-variable-comment nil))
   	(comment
   	 (put variable 'variable-comment comment)
!  	 (put variable 'customized-variable-comment comment))))
  
  ;;;###autoload
  (defun customize-save-variable (var value &optional comment)
    "Set the default for VARIABLE to VALUE, and save it for future sessions.
  If VARIABLE has a `custom-set' property, that is used for setting
  VARIABLE, otherwise `set-default' is used.
  
--- 796,809 ----
   	 (put variable 'customized-variable-comment nil))
   	(comment
   	 (put variable 'variable-comment comment)
!  	 (put variable 'customized-variable-comment comment)))
!   value)
  
  ;;;###autoload
  (defun customize-save-variable (var value &optional comment)
    "Set the default for VARIABLE to VALUE, and save it for future sessions.
+ Return VALUE.
+ 
  If VARIABLE has a `custom-set' property, that is used for setting
  VARIABLE, otherwise `set-default' is used.
  
***************
*** 823,829 ****
   	(comment
   	 (put var 'variable-comment comment)
   	 (put var 'saved-variable-comment comment)))
!   (custom-save-all))
  
  ;;;###autoload
  (defun customize ()
--- 828,835 ----
   	(comment
   	 (put var 'variable-comment comment)
   	 (put var 'saved-variable-comment comment)))
!   (custom-save-all)
!   value)
  
  ;;;###autoload
  (defun customize ()
***************
*** 1815,1820 ****
--- 1821,1827 ----
  (defvar custom-load-recursion nil
    "Hack to avoid recursive dependencies.")
  
+ ;;;###autoload
  (defun custom-load-symbol (symbol)
    "Load all dependencies for SYMBOL."
    (unless custom-load-recursion
***************
*** 3750,3771 ****
    "Mark SYMBOL for later saving.
  
  If the default value of SYMBOL is different from the standard value, 
! set the 'saved-value' property to a list whose car evaluates to the
  default value. Otherwise, set it til nil.
  
! To actually save the value, call 'custom-save-all'.
  
! Return non-nil iff the 'saved-value' property actually changed."
    (let* ((get (or (get symbol 'custom-get) 'default-value))
  	 (value (funcall get symbol))
  	 (saved (get symbol 'saved-value))
  	 (standard (get symbol 'standard-value))
  	 (comment (get symbol 'customized-variable-comment)))
      ;; Save default value iff different from standard value.
!     (if (and standard 
! 	     (not (condition-case nil
! 		      (equal value (eval (car standard)))
! 		    (error nil))))
  	(put symbol 'saved-value (list (custom-quote value)))
        (put symbol 'saved-value nil))
      ;; Clear customized information (set, but not saved).
--- 3757,3778 ----
    "Mark SYMBOL for later saving.
  
  If the default value of SYMBOL is different from the standard value, 
! set the `saved-value' property to a list whose car evaluates to the
  default value. Otherwise, set it til nil.
  
! To actually save the value, call `custom-save-all'.
  
! Return non-nil iff the `saved-value' property actually changed."
    (let* ((get (or (get symbol 'custom-get) 'default-value))
  	 (value (funcall get symbol))
  	 (saved (get symbol 'saved-value))
  	 (standard (get symbol 'standard-value))
  	 (comment (get symbol 'customized-variable-comment)))
      ;; Save default value iff different from standard value.
!     (if (or (null standard)
! 	    (not (equal value (condition-case nil
! 				  (eval (car standard))
! 				(error nil)))))
  	(put symbol 'saved-value (list (custom-quote value)))
        (put symbol 'saved-value nil))
      ;; Clear customized information (set, but not saved).
***************
*** 3774,3779 ****
--- 3781,3810 ----
      (when comment
        (put symbol 'saved-variable-comment comment))
      (not (equal saved (get symbol 'saved-value)))))
+ 
+ ;;;###autoload
+ (defun customize-mark-as-set (symbol)
+   "Mark current value of SYMBOL as being set from customize.
+ 
+ If the default value of SYMBOL is different from the saved value if any, 
+ or else if it is different from the standard value, set the
+ `customized-value' property to a list whose car evaluates to the 
+ default value. Otherwise, set it til nil.
+ 
+ Return non-nil iff the `customized-value' property actually changed."
+   (let* ((get (or (get symbol 'custom-get) 'default-value))
+ 	 (value (funcall get symbol))
+ 	 (customized (get symbol 'customized-value))
+ 	 (old (or (get symbol 'saved-value) (get symbol 'standard-value))))
+     ;; Mark default value as set iff different from old value.
+     (if (or (null old)
+ 	    (not (equal value (condition-case nil 
+ 				  (eval (car old))
+ 				(error nil)))))
+ 	(put symbol 'customized-value (list (custom-quote value)))
+       (put symbol 'customized-value nil))
+     ;; Changed?
+     (not (equal customized (get symbol 'customized-value)))))
  
  ;;; The Customize Menu.
  
Index: lisp/menu-bar.el
===================================================================
RCS file: /cvsroot/emacs//emacs/lisp/menu-bar.el,v
retrieving revision 1.197
diff -c -r1.197 menu-bar.el
*** lisp/menu-bar.el	10 Feb 2002 17:26:14 -0000	1.197
--- lisp/menu-bar.el	11 Feb 2002 16:44:20 -0000
***************
*** 530,541 ****
  		(substring help 1) ".")
         (interactive)
         (if ,(if body `(progn . ,body)
! 	      `(setq ,variable (not ,variable)))
!   	   (message ,message "enabled")
    	 (message ,message "disabled")))
!      '(menu-item ,doc ,name
  		 :help ,help
!                  :button (:toggle . (and (boundp ',variable) ,variable)))))
  
  ;;; Assemble all the top-level items of the "Options" menu
  (define-key menu-bar-options-menu [customize]
--- 530,557 ----
  		(substring help 1) ".")
         (interactive)
         (if ,(if body `(progn . ,body)
! 	      `(progn 
! 		 (custom-load-symbol ',variable)
! 		 (let ((set (or (get ',variable 'custom-set) 'set-default))
! 		       (get (or (get ',variable 'custom-get) 'default-value)))
! 		   (funcall set ',variable (not (funcall get ',variable))))))
! 	   (message ,message "enabled")
    	 (message ,message "disabled")))
!      ;; The function `customize-mark-as-set' must only be called when
!      ;; a variable is set interactively, as the purpose is to mark it
!      ;; as a candidate for "Save Options", and we do not want to save
!      ;; options the user have already set explicitly in his init
!      ;; file.  Unfortunately, he could very likely call the function
!      ;; defined above there.  So we put `customize-mark-as-set' in a
!      ;; lambda expression. 
!      ;; -- Per Abrahamsen <abraham@dina.kvl.dk> 2002-02-11.
!      '(menu-item ,doc (lambda ()
! 			(interactive)
! 			(,name)
! 			(customize-mark-as-set ',variable))
  		 :help ,help
!                  :button (:toggle . (and (default-boundp ',variable)
! 					 (default-value ',variable))))))
  
  ;;; Assemble all the top-level items of the "Options" menu
  (define-key menu-bar-options-menu [customize]
***************
*** 546,572 ****
    "Save current values of Options menu items using Custom."
    (interactive)
    (let ((need-save nil))
!     (dolist (elt '(debug-on-quit debug-on-error auto-compression-mode
  		   case-fold-search truncate-lines show-paren-mode
  		   transient-mark-mode global-font-lock-mode
! 		   current-language-environment default-input-method
! 		   default-frame-alist display-time-mode
! 		   line-number-mode column-number-mode))
        (when (customize-mark-to-save elt)
  	(setq need-save t)))
-     ;; We only want to save text-mode-hook after adding or removing auto fill.
-     (and (or (memq 'turn-on-auto-fill text-mode-hook) ;Added.
- 	     ;; If it is already saved, it is safe to save.
- 	     (get 'text-mode-hook 'saved-value)) ;Maybe removed.
- 	 (customize-mark-to-save 'text-mode-hook)
- 	 (setq need-save t))
-     ;; Avoid loading extra libraries.
-     (and (featurep 'saveplace)
- 	 (customize-mark-to-save 'save-place)
- 	 (setq need-save t))
-     (and (featurep 'uniquify)
- 	 (customize-mark-to-save 'uniquify-buffer-name-style)
- 	 (setq need-save t))
      ;; Save if we changed anything.
      (when need-save
        (custom-save-all))))
--- 562,588 ----
    "Save current values of Options menu items using Custom."
    (interactive)
    (let ((need-save nil))
!     ;; These are set with `customize-set-variable'.
!     (dolist (elt '(line-number-mode column-number-mode scroll-bar-mode
! 		   debug-on-quit debug-on-error menu-bar-mode tool-bar-mode
! 		   save-place uniquify-buffer-name-style
  		   case-fold-search truncate-lines show-paren-mode
  		   transient-mark-mode global-font-lock-mode
! 		   display-time-mode auto-compression-mode
! 		   ;; Saving `text-mode-hook' is somewhat questionable,
! 		   ;; as we might get more than we bargain for, if
! 		   ;; other code may has added hooks as well.
! 		   ;; Nonetheless, not saving it would like be confuse
! 		   ;; more often.
! 		   ;; -- Per Abrahamsen <abraham@dina.kvl.dk> 2002-02-11.
! 		   text-mode-hook))
!       (and (get elt 'customized-value)
! 	   (customize-mark-to-save elt)
! 	   (setq need-save t)))
!     ;; These are set with other functions.
!     (dolist (elt '(current-language-environment default-input-method))
        (when (customize-mark-to-save elt)
  	(setq need-save t)))
      ;; Save if we changed anything.
      (when need-save
        (custom-save-all))))
***************
*** 603,609 ****
      (message "Display-time mode disabled.")))
  
  (define-key menu-bar-showhide-menu [showhide-date-time]
!   '(menu-item "Date and time" showhide-date-time
  	      :help "Display date and time in the mode-line"
  	      :button (:toggle . display-time-mode)))
  
--- 619,628 ----
      (message "Display-time mode disabled.")))
  
  (define-key menu-bar-showhide-menu [showhide-date-time]
!   '(menu-item "Date and time" (lambda ()
! 				(interactive)
! 				(showhide-date-time)
! 				(customize-mark-as-set 'display-time-mode))
  	      :help "Display date and time in the mode-line"
  	      :button (:toggle . display-time-mode)))
  
***************
*** 612,649 ****
  
  (defvar menu-bar-showhide-scroll-bar-menu (make-sparse-keymap "Scroll-bar"))
  
- (defun menu-bar-scroll-bar-right ()
-   "Turn on the scroll-bar on the right side."
-   (interactive)
-   (set-scroll-bar-mode 'right))
- 
- (defun menu-bar-scroll-bar-left ()
-   "Turn on the scroll-bar on the left side."
-   (interactive)
-   (set-scroll-bar-mode 'left))
- 
- (defun menu-bar-scroll-bar-none ()
-   "Turn off the scroll-bar."
-   (interactive)
-   (set-scroll-bar-mode nil))
- 
  (define-key menu-bar-showhide-scroll-bar-menu [right]
!   '(menu-item "On the Right" menu-bar-scroll-bar-right
  	      :help "Scroll-bar on the right side"
  	      :visible window-system
! 	      :button (:radio . (eq (cdr (assq 'vertical-scroll-bars (frame-parameters))) 'right))))
  
  (define-key menu-bar-showhide-scroll-bar-menu [left]
!   '(menu-item "On the Left" menu-bar-scroll-bar-left
  	      :help "Scroll-bar on the left side"
  	      :visible window-system
! 	      :button (:radio . (eq (cdr (assq 'vertical-scroll-bars (frame-parameters))) 'left))))
  
  (define-key menu-bar-showhide-scroll-bar-menu [none]
!   '(menu-item "None" menu-bar-scroll-bar-none
  	      :help "Turn off scroll-bar"
  	      :visible window-system
! 	      :button (:radio . (eq (cdr (assq 'vertical-scroll-bars (frame-parameters))) nil))))
  
  (define-key menu-bar-showhide-menu [showhide-scroll-bar]
    (list 'menu-item "Scroll-Bar" menu-bar-showhide-scroll-bar-menu
--- 631,665 ----
  
  (defvar menu-bar-showhide-scroll-bar-menu (make-sparse-keymap "Scroll-bar"))
  
  (define-key menu-bar-showhide-scroll-bar-menu [right]
!   '(menu-item "On the Right" 
! 	      (lambda ()
! 		(interactive)
! 		(customize-set-variable 'scroll-bar-mode 'right))
  	      :help "Scroll-bar on the right side"
  	      :visible window-system
! 	      :button (:radio . (eq (cdr (assq 'vertical-scroll-bars
! 					       (frame-parameters))) 'right))))
  
  (define-key menu-bar-showhide-scroll-bar-menu [left]
!   '(menu-item "On the Left" 	   
! 	      (lambda ()
! 		(interactive)
! 		(customize-set-variable 'scroll-bar-mode 'left))
  	      :help "Scroll-bar on the left side"
  	      :visible window-system
! 	      :button (:radio . (eq (cdr (assq 'vertical-scroll-bars
! 					       (frame-parameters))) 'left))))
  
  (define-key menu-bar-showhide-scroll-bar-menu [none]
!   '(menu-item "None" 
! 	      (lambda ()
! 		(interactive)
! 		(customize-set-variable 'scroll-bar-mode nil))
  	      :help "Turn off scroll-bar"
  	      :visible window-system
! 	      :button (:radio . (eq (cdr (assq 'vertical-scroll-bars
! 					       (frame-parameters))) nil))))
  
  (define-key menu-bar-showhide-menu [showhide-scroll-bar]
    (list 'menu-item "Scroll-Bar" menu-bar-showhide-scroll-bar-menu
***************
*** 659,665 ****
      (message "Menu-bar mode disabled.  Use M-x menu-bar-mode to make the menu bar appear.")))
  
  (define-key menu-bar-showhide-menu [showhide-menu-bar]
!   '(menu-item "Menu-bar" showhide-menu-bar
  	      :help "Toggle menu-bar on/off"
  	      :button (:toggle . menu-bar-mode)))
  
--- 675,685 ----
      (message "Menu-bar mode disabled.  Use M-x menu-bar-mode to make the menu bar appear.")))
  
  (define-key menu-bar-showhide-menu [showhide-menu-bar]
!   '(menu-item "Menu-bar" 
! 	      (lambda ()
! 		(interactive)
! 		(showhide-menu-bar)
! 		(customize-mark-as-set 'menu-bar-mode))
  	      :help "Toggle menu-bar on/off"
  	      :button (:toggle . menu-bar-mode)))
  
***************
*** 671,677 ****
      (message "Tool-bar mode disabled.")))
  
  (define-key menu-bar-showhide-menu [showhide-tool-bar]
!   '(menu-item "Tool-bar" showhide-tool-bar
  	      :help "Turn tool-bar on/off"
  	      :visible window-system
  	      :button (:toggle . tool-bar-mode)))
--- 691,701 ----
      (message "Tool-bar mode disabled.")))
  
  (define-key menu-bar-showhide-menu [showhide-tool-bar]
!   '(menu-item "Tool-bar" 
! 	      (lambda ()
! 		(interactive)
! 		(showhide-tool-bar)
! 		(customize-mark-as-set 'tool-bar-mode))
  	      :help "Turn tool-bar on/off"
  	      :visible window-system
  	      :button (:toggle . tool-bar-mode)))
***************
*** 712,729 ****
    '("--"))
  (define-key menu-bar-options-menu [toggle-auto-compression]
    '(menu-item "Automatic File De/compression"
!              auto-compression-mode
! 	     :help "Transparently decompress compressed files"
!              :button (:toggle . (rassq 'jka-compr-handler
! 				       file-name-handler-alist))))
  (define-key menu-bar-options-menu [save-place]
    (menu-bar-make-toggle toggle-save-place-globally save-place
  			"Save Place in Files between Sessions"
  			"Saving place in files %s"
! 			"Save Emacs state for next session"
!                         (require 'saveplace)
! 			(setq-default save-place
! 				      (not (default-value save-place)))))
  (define-key menu-bar-options-menu [uniquify]
    (menu-bar-make-toggle toggle-uniquify-buffer-names uniquify-buffer-name-style
  			"Use Directory Names in Buffer Names"
--- 736,754 ----
    '("--"))
  (define-key menu-bar-options-menu [toggle-auto-compression]
    '(menu-item "Automatic File De/compression"
! 	      (lambda ()
! 		(interactive)
! 		(auto-compression-mode)
! 		(customize-mark-as-set 'auto-compression-mode))
! 	      :help "Transparently decompress compressed files"
! 	      :button (:toggle . (rassq 'jka-compr-handler
! 					file-name-handler-alist))))
  (define-key menu-bar-options-menu [save-place]
    (menu-bar-make-toggle toggle-save-place-globally save-place
  			"Save Place in Files between Sessions"
  			"Saving place in files %s"
! 			"Save Emacs state for next session"))
! 
  (define-key menu-bar-options-menu [uniquify]
    (menu-bar-make-toggle toggle-uniquify-buffer-names uniquify-buffer-name-style
  			"Use Directory Names in Buffer Names"
***************
*** 733,738 ****
--- 758,764 ----
  			(setq uniquify-buffer-name-style
  			      (if (not uniquify-buffer-name-style)
  				  'forward))))
+ 
  (define-key menu-bar-options-menu [edit-options-separator]
    '("--"))
  (define-key menu-bar-options-menu [case-fold-search]
***************
*** 742,748 ****
  			"Ignore letter-case in search"))
  (define-key menu-bar-options-menu [auto-fill-mode]
    '(menu-item "Word Wrap in Text Modes (Auto Fill)"
!               toggle-text-mode-auto-fill
  	      :help "Automatically fill text between left and right margins"
                :button (:toggle . (member 'turn-on-auto-fill text-mode-hook))))
  (define-key menu-bar-options-menu [truncate-lines]
--- 768,780 ----
  			"Ignore letter-case in search"))
  (define-key menu-bar-options-menu [auto-fill-mode]
    '(menu-item "Word Wrap in Text Modes (Auto Fill)"
!               (lambda ()
! 		(interactive)
! 		(toggle-text-mode-auto-fill)
! 		;; This is somewhat questionable, as `text-mode-hook'
! 		;; might have changed outside customize.  
! 		;; -- Per Abrahamsen <abraham@dina.kvl.dk> 2002-02-11.
! 		(customize-mark-as-set 'text-mode-hook))
  	      :help "Automatically fill text between left and right margins"
                :button (:toggle . (member 'turn-on-auto-fill text-mode-hook))))
  (define-key menu-bar-options-menu [truncate-lines]
***************
*** 750,756 ****
     toggle-truncate-lines truncate-lines
     "Truncate Long Lines in this Buffer" "Long Line Truncation %s"
     "Truncate long lines on the screen"
!    (prog1 (setq truncate-lines (not truncate-lines))
       (set-buffer-modified-p (buffer-modified-p)))))
  (define-key menu-bar-options-menu [highlight-separator]
    '("--"))
--- 782,791 ----
     toggle-truncate-lines truncate-lines
     "Truncate Long Lines in this Buffer" "Long Line Truncation %s"
     "Truncate long lines on the screen"
!    ;; FIXME: We should define a :set method for `truncate-lines' to do
!    ;; the `buffer-modified-p' stuff.
!    ;; -- Per Abrahamsen <abraham@dina.kvl.dk> 2002-02-11.
!    (prog1 (setq-default truncate-lines (not truncate-lines))
       (set-buffer-modified-p (buffer-modified-p)))))
  (define-key menu-bar-options-menu [highlight-separator]
    '("--"))
***************
*** 758,765 ****
    (menu-bar-make-toggle toggle-highlight-paren-mode show-paren-mode
  			"Paren Match Highlighting (Show Paren mode)"
  			"Show Paren mode %s"
! 			"Highlight matching/mismatched parentheses at cursor"
! 			(show-paren-mode)))
  (define-key menu-bar-options-menu [transient-mark-mode]
    (menu-bar-make-toggle toggle-transient-mark-mode transient-mark-mode
  			"Active Region Highlighting (Transient Mark mode)"
--- 793,799 ----
    (menu-bar-make-toggle toggle-highlight-paren-mode show-paren-mode
  			"Paren Match Highlighting (Show Paren mode)"
  			"Show Paren mode %s"
! 			"Highlight matching/mismatched parentheses at cursor"))
  (define-key menu-bar-options-menu [transient-mark-mode]
    (menu-bar-make-toggle toggle-transient-mark-mode transient-mark-mode
  			"Active Region Highlighting (Transient Mark mode)"
***************
*** 769,776 ****
    (menu-bar-make-toggle toggle-global-lazy-font-lock-mode global-font-lock-mode
  			"Syntax Highlighting (Global Font Lock mode)"
  			"Global Font Lock mode %s"
! 			"Colorize text based on language syntax"
! 			(global-font-lock-mode)))
  
  \f
  ;; The "Tools" menu items
--- 803,809 ----
    (menu-bar-make-toggle toggle-global-lazy-font-lock-mode global-font-lock-mode
  			"Syntax Highlighting (Global Font Lock mode)"
  			"Global Font Lock mode %s"
! 			"Colorize text based on language syntax"))
  
  \f
  ;; The "Tools" menu items
***************
*** 1402,1407 ****
--- 1435,1446 ----
    :initialize 'custom-initialize-default
    :type 'boolean
    :group 'frames)
+ 
+ ;;; `menu-bar-mode' doesn't really have a standard value, as it depend
+ ;;; on where and how Emacs was started.  By removing the standard
+ ;;; value, we ensure that customize will always save it.
+ ;; -- Per Abrahamsen <abraham@dina.kvl.dk> 2002-02-11.
+ (put 'menu-bar-mode 'standard-value nil)
  
  (defun menu-bar-mode (&optional flag)
    "Toggle display of a menu bar on each frame.
Index: lisp/toolbar/tool-bar.el
===================================================================
RCS file: /cvsroot/emacs//emacs/lisp/toolbar/tool-bar.el,v
retrieving revision 1.23
diff -c -r1.23 tool-bar.el
*** lisp/toolbar/tool-bar.el	30 Aug 2001 06:50:59 -0000	1.23
--- lisp/toolbar/tool-bar.el	11 Feb 2002 16:44:20 -0000
***************
*** 1,6 ****
  ;;; tool-bar.el --- setting up the tool bar
  ;;
! ;; Copyright (C) 2000, 2001 Free Software Foundation, Inc.
  ;;
  ;; Author: Dave Love <fx@gnu.org>
  ;; Keywords: mouse frames
--- 1,6 ----
  ;;; tool-bar.el --- setting up the tool bar
  ;;
! ;; Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
  ;;
  ;; Author: Dave Love <fx@gnu.org>
  ;; Keywords: mouse frames
***************
*** 66,71 ****
--- 66,77 ----
  		(display-graphic-p)
  		(= 1 (length (default-value 'tool-bar-map)))) ; not yet setup
  	   (tool-bar-setup))))
+ 
+ ;;; `tool-bar-mode' doesn't really have a standard value, as it depend
+ ;;; on where and how Emacs was started.  By removing the standard
+ ;;; value, we ensure that customize will always save it.
+ ;; -- Per Abrahamsen <abraham@dina.kvl.dk> 2002-02-11.
+ (put 'tool-bar-mode 'standard-value nil)
  
  (defvar tool-bar-map (make-sparse-keymap)
    "Keymap for the tool bar.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: [PATCH] Re: Save Options vs. default-input-method
  2002-02-11 17:15                           ` Per Abrahamsen
@ 2002-02-12  9:56                             ` Per Abrahamsen
  2002-02-13 15:38                               ` Richard Stallman
  2002-02-12 15:23                             ` Richard Stallman
  2002-02-12 15:23                             ` Richard Stallman
  2 siblings, 1 reply; 28+ messages in thread
From: Per Abrahamsen @ 2002-02-12  9:56 UTC (permalink / raw)


Per Abrahamsen <abraham@dina.kvl.dk> writes:

> Ok, I commited a patch below.  It makes all the non-mule options use
> customize-set-variable or equivalent, and makes 'Save options' only
> save those options modified by customize-set-variable or equivalent.

I fixed the MULE options as well.  Now none of the options get saved,
unless you have changed them interactively.

Index: lisp/ChangeLog
===================================================================
RCS file: /cvsroot/emacs//emacs/lisp/ChangeLog,v
retrieving revision 1.3436
diff -c -r1.3436 ChangeLog
*** lisp/ChangeLog	12 Feb 2002 04:50:04 -0000	1.3436
--- lisp/ChangeLog	12 Feb 2002 09:45:23 -0000
***************
*** 1,3 ****
--- 1,16 ----
+ 2002-02-12  Per Abrahamsen  <abraham@dina.kvl.dk>
+ 
+ 	* menu-bar.el (menu-bar-options-save): Only save
+ 	`current-language-environment' and `default-input-method' when
+ 	marked as customized.
+ 
+ 	* international/mule-cmds.el
+ 	(setup-specified-language-environment): Mark
+ 	`current-language-environment' as customized.
+ 	(set-input-method): Mark
+ 	`default-input-method' as customized when called interactively.
+ 	(toggle-input-method): Ditto.
+ 
  2002-02-11  Colin Walters  <walters@verbum.org>
  
  	* ibuffer.el (ibuffer-switch-format): Supply required argument for
Index: lisp/menu-bar.el
===================================================================
RCS file: /cvsroot/emacs//emacs/lisp/menu-bar.el,v
retrieving revision 1.198
diff -c -r1.198 menu-bar.el
*** lisp/menu-bar.el	11 Feb 2002 16:47:55 -0000	1.198
--- lisp/menu-bar.el	12 Feb 2002 09:45:23 -0000
***************
*** 569,574 ****
--- 569,575 ----
  		   case-fold-search truncate-lines show-paren-mode
  		   transient-mark-mode global-font-lock-mode
  		   display-time-mode auto-compression-mode
+ 		   current-language-environment default-input-method
  		   ;; Saving `text-mode-hook' is somewhat questionable,
  		   ;; as we might get more than we bargain for, if
  		   ;; other code may has added hooks as well.
***************
*** 579,588 ****
        (and (get elt 'customized-value)
  	   (customize-mark-to-save elt)
  	   (setq need-save t)))
-     ;; These are set with other functions.
-     (dolist (elt '(current-language-environment default-input-method))
-       (when (customize-mark-to-save elt)
- 	(setq need-save t)))
      ;; Save if we changed anything.
      (when need-save
        (custom-save-all))))
--- 580,585 ----
Index: lisp/international/mule-cmds.el
===================================================================
RCS file: /cvsroot/emacs//emacs/lisp/international/mule-cmds.el,v
retrieving revision 1.183
diff -c -r1.183 mule-cmds.el
*** lisp/international/mule-cmds.el	8 Feb 2002 11:59:42 -0000	1.183
--- lisp/international/mule-cmds.el	12 Feb 2002 09:45:23 -0000
***************
*** 1103,1109 ****
  	    (if default "Select input method (default %s): " "Select input method: ")
  	    default t))))
    (activate-input-method input-method)
!   (setq default-input-method input-method))
  
  (defun toggle-input-method (&optional arg)
    "Enable or disable multilingual text input method for the current buffer.
--- 1103,1112 ----
  	    (if default "Select input method (default %s): " "Select input method: ")
  	    default t))))
    (activate-input-method input-method)
!   (setq default-input-method input-method)
!   (when (interactive-p)
!     (customize-mark-as-set 'default-input-method))
!   default-input-method)
  
  (defun toggle-input-method (&optional arg)
    "Enable or disable multilingual text input method for the current buffer.
***************
*** 1134,1141 ****
  	      (if default "Input method (default %s): " "Input method: " )
  	      default t))
  	 default))
!       (or default-input-method
! 	  (setq default-input-method current-input-method)))))
  
  (defun describe-input-method (input-method)
    "Describe input method INPUT-METHOD."
--- 1137,1147 ----
  	      (if default "Input method (default %s): " "Input method: " )
  	      default t))
  	 default))
!       (unless default-input-method
! 	(prog1 
! 	    (setq default-input-method current-input-method)
! 	  (when (interactive-p)
! 	    (customize-mark-as-set 'default-input-method)))))))
  
  (defun describe-input-method (input-method)
    "Describe input method INPUT-METHOD."
***************
*** 1297,1303 ****
  	     (or (not (eq last-command-event 'Default))
  		 (setq last-command-event 'English))
  	     (setq language-name (symbol-name last-command-event)))
! 	(set-language-environment language-name)
        (error "Bogus calling sequence"))))
  
  (defcustom current-language-environment "English"
--- 1303,1311 ----
  	     (or (not (eq last-command-event 'Default))
  		 (setq last-command-event 'English))
  	     (setq language-name (symbol-name last-command-event)))
! 	(prog1
! 	    (set-language-environment language-name)
! 	  (customize-mark-as-set 'current-language-environment))
        (error "Bogus calling sequence"))))
  
  (defcustom current-language-environment "English"

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: [PATCH] Re: Save Options vs. default-input-method
  2002-02-11 17:15                           ` Per Abrahamsen
  2002-02-12  9:56                             ` Per Abrahamsen
@ 2002-02-12 15:23                             ` Richard Stallman
  2002-02-12 16:39                               ` Per Abrahamsen
  2002-02-12 15:23                             ` Richard Stallman
  2 siblings, 1 reply; 28+ messages in thread
From: Richard Stallman @ 2002-02-12 15:23 UTC (permalink / raw)
  Cc: emacs-devel

    * The "Truncate Long Lines in This Buffer" option now set the default
      value, instead of the buffer specific value, which mean the name is
      misleading.  However, the old code attempted to save the value, and
      you can't save a buffer specific value.  So either the name should
      be changed, or we should not save the variable.  Opinions?

I think it is more useful, for this specific option, to set it only
for the current buffer.  Which means it should not be saved at all.

The only argument for setting and saving the default value is
consistency with the other menu items.  But I tend to think that is
not a strong enough argument to outweigh the greater utility of setting
this particular option buffer-locally.



_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: [PATCH] Re: Save Options vs. default-input-method
  2002-02-11 17:15                           ` Per Abrahamsen
  2002-02-12  9:56                             ` Per Abrahamsen
  2002-02-12 15:23                             ` Richard Stallman
@ 2002-02-12 15:23                             ` Richard Stallman
  2002-02-12 16:24                               ` Per Abrahamsen
  2 siblings, 1 reply; 28+ messages in thread
From: Richard Stallman @ 2002-02-12 15:23 UTC (permalink / raw)
  Cc: emacs-devel

      Removing the standard value mean you can no longer choose "Erase
      customization" from customize, but it ensures that the option is
      always saved.

Is there some reason we want this always to be saved?  I don't see it.
What precisely would go wrong if you make t the standard value?


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: [PATCH] Re: Save Options vs. default-input-method
  2002-02-12 15:23                             ` Richard Stallman
@ 2002-02-12 16:24                               ` Per Abrahamsen
  2002-02-14  3:11                                 ` Richard Stallman
  0 siblings, 1 reply; 28+ messages in thread
From: Per Abrahamsen @ 2002-02-12 16:24 UTC (permalink / raw)


Richard Stallman <rms@gnu.org> writes:

>       Removing the standard value mean you can no longer choose "Erase
>       customization" from customize, but it ensures that the option is
>       always saved.
>
> Is there some reason we want this always to be saved?  

In general: If the standard value changes a lot, we might want to save
the option even if identical to the current standard value, as it
might not be identical to future standard values.

> What precisely would go wrong if you make t the standard value?

Even when there isn't any tool bar?  That might work, a user might
want to tell Emacs never to turn on the tool bar, but is not likely to
tell Emacs to always turn on the tool bar, even when Emacs would not
do it by default.

Should I change the standard value for `menu-bar-mode' and
`tool-bar-mode' to t?

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: [PATCH] Re: Save Options vs. default-input-method
  2002-02-12 15:23                             ` Richard Stallman
@ 2002-02-12 16:39                               ` Per Abrahamsen
  0 siblings, 0 replies; 28+ messages in thread
From: Per Abrahamsen @ 2002-02-12 16:39 UTC (permalink / raw)


Richard Stallman <rms@gnu.org> writes:

>     * The "Truncate Long Lines in This Buffer" option now set the default
>       value, instead of the buffer specific value, which mean the name is
>       misleading.  However, the old code attempted to save the value, and
>       you can't save a buffer specific value.  So either the name should
>       be changed, or we should not save the variable.  Opinions?
>
> I think it is more useful, for this specific option, to set it only
> for the current buffer.  Which means it should not be saved at all.

Ok, I changed it to only affect the current buffer, and not be saved.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: [PATCH] Re: Save Options vs. default-input-method
  2002-02-12  9:56                             ` Per Abrahamsen
@ 2002-02-13 15:38                               ` Richard Stallman
  0 siblings, 0 replies; 28+ messages in thread
From: Richard Stallman @ 2002-02-13 15:38 UTC (permalink / raw)
  Cc: emacs-devel

    I fixed the MULE options as well.  Now none of the options get saved,
    unless you have changed them interactively.

Thanks.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: [PATCH] text-mode-hook-identify should be part of the standard value for text-mode-hook
  2002-02-11  2:08                         ` Richard Stallman
@ 2002-02-13 18:04                           ` ShengHuo ZHU
  0 siblings, 0 replies; 28+ messages in thread
From: ShengHuo ZHU @ 2002-02-13 18:04 UTC (permalink / raw)


Richard Stallman <rms@gnu.org> writes:

> Damn, I guess this means we will need to put it back in the hook.
> That is sad.
>
>       bookmark-read-annotation-mode, bookmark-edit-annotation-mode,
>       gnus-article-edit-mode, message-mode (fixed in Gnus CVS), the old
>       outline-mode, and news-reply-mode (from rnewspost... does rnews
>       really still exists?).
>
> ShengHuo, could you convert gnus-article-edit-mode to use
> define-derived-mode?

Actually, I've installed Stefan's define-derived-mode patch for both
gnus-article-edit-mode and message-mode in the Gnus CVS.  And I just
commented the gnus-article-edit-mode part into the Emacs CVS.  Because
there are too many changes related to message-mode in oGnus, I am
afraid it might cause trouble to port the patch into Gnus 5.9 without
extensive tests. So, I think it is better to keep message-mode
unchanged in the Emacs CVS until Gnus 5.10 or 5.11 is released.

ShengHuo

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: [PATCH] Re: Save Options vs. default-input-method
  2002-02-12 16:24                               ` Per Abrahamsen
@ 2002-02-14  3:11                                 ` Richard Stallman
  2002-02-14  9:34                                   ` Per Abrahamsen
  0 siblings, 1 reply; 28+ messages in thread
From: Richard Stallman @ 2002-02-14  3:11 UTC (permalink / raw)
  Cc: emacs-devel

    > Is there some reason we want this always to be saved?  

    In general: If the standard value changes a lot, we might want to save
    the option even if identical to the current standard value, as it
    might not be identical to future standard values.

Does that apply here?  Do these standard values change a lot?  I don't
see that they do.  As far as I know, these defaults have never changed
since these features were first implemented.

    > What precisely would go wrong if you make t the standard value?

    Even when there isn't any tool bar?  That might work, a user might
    want to tell Emacs never to turn on the tool bar, but is not likely to
    tell Emacs to always turn on the tool bar, even when Emacs would not
    do it by default.

As far as I know, Emacs always turns on the tool bar by default.
Or at least it tries to.  On some terminals this does not succeed
because they cannot support the feature, but Emacs always tries
to have a tool bar.

Am I mistaken?

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: [PATCH] Re: Save Options vs. default-input-method
  2002-02-14  3:11                                 ` Richard Stallman
@ 2002-02-14  9:34                                   ` Per Abrahamsen
  2002-02-15 10:36                                     ` Richard Stallman
  0 siblings, 1 reply; 28+ messages in thread
From: Per Abrahamsen @ 2002-02-14  9:34 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:

>     > Is there some reason we want this always to be saved?  
>
>     In general: If the standard value changes a lot, we might want to save
>     the option even if identical to the current standard value, as it
>     might not be identical to future standard values.
>
> Does that apply here?  Do these standard values change a lot?  I don't
> see that they do.  As far as I know, these defaults have never changed
> since these features were first implemented.

True for menu-bar-mode, but tool-bar-mode is nil if you start with "-nw".

>     > What precisely would go wrong if you make t the standard value?
>
>     Even when there isn't any tool bar?  That might work, a user might
>     want to tell Emacs never to turn on the tool bar, but is not likely to
>     tell Emacs to always turn on the tool bar, even when Emacs would not
>     do it by default.
>
> As far as I know, Emacs always turns on the tool bar by default.
> Or at least it tries to.  On some terminals this does not succeed
> because they cannot support the feature, but Emacs always tries
> to have a tool bar.
>
> Am I mistaken?

I don't think Emacs even enter the part of the code that turn on
tool-bar-mode when you start it with -nw, but it doesn't matter.  If
setting standard-value unconditionally to t give the most useful
behavior, we should do that.

Will you give me an OK to change standard-value for menu-bar-mode and
tool-bar-mode to t?

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: [PATCH] Re: Save Options vs. default-input-method
  2002-02-14  9:34                                   ` Per Abrahamsen
@ 2002-02-15 10:36                                     ` Richard Stallman
  2002-02-17 10:31                                       ` Per Abrahamsen
  0 siblings, 1 reply; 28+ messages in thread
From: Richard Stallman @ 2002-02-15 10:36 UTC (permalink / raw)
  Cc: emacs-devel

    > Does that apply here?  Do these standard values change a lot?  I don't
    > see that they do.  As far as I know, these defaults have never changed
    > since these features were first implemented.

    True for menu-bar-mode, but tool-bar-mode is nil if you start with "-nw".

It looks correct to say that the standard value is t, but in this case
the actual value is nil.  Isn't that the cleanest way to model the
situation?  Do you see a reason why that is a bad way to look at it?

    Will you give me an OK to change standard-value for menu-bar-mode and
    tool-bar-mode to t?

I'm asking for your help in understanding whether that change would
really have any bad consequences.  Do you see a situation where
it would have bad consequences?


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: [PATCH] Re: Save Options vs. default-input-method
  2002-02-15 10:36                                     ` Richard Stallman
@ 2002-02-17 10:31                                       ` Per Abrahamsen
  2002-02-17 22:50                                         ` Richard Stallman
  0 siblings, 1 reply; 28+ messages in thread
From: Per Abrahamsen @ 2002-02-17 10:31 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:

>     Will you give me an OK to change standard-value for menu-bar-mode and
>     tool-bar-mode to t?
>
> I'm asking for your help in understanding whether that change would
> really have any bad consequences.  Do you see a situation where
> it would have bad consequences?

No.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: [PATCH] Re: Save Options vs. default-input-method
  2002-02-17 10:31                                       ` Per Abrahamsen
@ 2002-02-17 22:50                                         ` Richard Stallman
  2002-02-19 10:31                                           ` Per Abrahamsen
  0 siblings, 1 reply; 28+ messages in thread
From: Richard Stallman @ 2002-02-17 22:50 UTC (permalink / raw)
  Cc: emacs-devel

    >     Will you give me an OK to change standard-value for menu-bar-mode and
    >     tool-bar-mode to t?
    >
    > I'm asking for your help in understanding whether that change would
    > really have any bad consequences.  Do you see a situation where
    > it would have bad consequences?

    No.

In that case, it looks like a good change to make.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: [PATCH] Re: Save Options vs. default-input-method
  2002-02-17 22:50                                         ` Richard Stallman
@ 2002-02-19 10:31                                           ` Per Abrahamsen
  0 siblings, 0 replies; 28+ messages in thread
From: Per Abrahamsen @ 2002-02-19 10:31 UTC (permalink / raw)


Richard Stallman <rms@gnu.org> writes:

>     >     Will you give me an OK to change standard-value for menu-bar-mode and
>     >     tool-bar-mode to t?
>     >
>     > I'm asking for your help in understanding whether that change would
>     > really have any bad consequences.  Do you see a situation where
>     > it would have bad consequences?
>
>     No.
>
> In that case, it looks like a good change to make.

I have committed it.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

end of thread, other threads:[~2002-02-19 10:31 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <m3665k6ayy.fsf@Janik.cz>
     [not found] ` <200201302237.g0UMb1d24844@aztec.santafe.edu>
     [not found]   ` <m3sn8jbzs6.fsf@Janik.cz>
     [not found]     ` <200202040927.g149RUF02434@aztec.santafe.edu>
     [not found]       ` <m3ofj5fs5i.fsf@Janik.cz>
     [not found]         ` <rjbsf57anr.fsf@ssv2.dina.kvl.dk>
     [not found]           ` <200202051248.g15CmDb02207@aztec.santafe.edu>
     [not found]             ` <rju1svzxxx.fsf@ssv2.dina.kvl.dk>
2002-02-07 14:57               ` [PATCH] Re: Save Options vs. default-input-method Richard Stallman
2002-02-07 17:41                 ` Per Abrahamsen
2002-02-07 21:15                   ` Pavel Janík
2002-02-08  7:50                     ` Per Abrahamsen
2002-02-07 14:57               ` Richard Stallman
2002-02-07 16:50                 ` Per Abrahamsen
2002-02-08 23:23                   ` Richard Stallman
     [not found]               ` <rjpu3jzwyd.fsf_-_@ssv2.dina.kvl.dk>
2002-02-07 14:57                 ` [PATCH] text-mode-hook-identify should be part of the standard value for text-mode-hook Richard Stallman
2002-02-07 16:27                   ` Per Abrahamsen
2002-02-08 23:23                     ` Richard Stallman
2002-02-09 11:38                       ` Per Abrahamsen
2002-02-11  2:08                         ` Richard Stallman
2002-02-13 18:04                           ` ShengHuo ZHU
     [not found]               ` <rjlme7zwja.fsf@ssv2.dina.kvl.dk>
2002-02-07 14:57                 ` [PATCH] Re: Save Options vs. default-input-method Richard Stallman
2002-02-07 16:31                   ` Per Abrahamsen
     [not found]                     ` <200202100517.g1A5Hoe06105@aztec.santafe.edu>
     [not found]                       ` <rjlme17mhm.fsf@ssv2.dina.kvl.dk>
     [not found]                         ` <200202110209.g1B29mh06648@aztec.santafe.edu>
2002-02-11 17:15                           ` Per Abrahamsen
2002-02-12  9:56                             ` Per Abrahamsen
2002-02-13 15:38                               ` Richard Stallman
2002-02-12 15:23                             ` Richard Stallman
2002-02-12 16:39                               ` Per Abrahamsen
2002-02-12 15:23                             ` Richard Stallman
2002-02-12 16:24                               ` Per Abrahamsen
2002-02-14  3:11                                 ` Richard Stallman
2002-02-14  9:34                                   ` Per Abrahamsen
2002-02-15 10:36                                     ` Richard Stallman
2002-02-17 10:31                                       ` Per Abrahamsen
2002-02-17 22:50                                         ` Richard Stallman
2002-02-19 10:31                                           ` Per Abrahamsen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.