Re: custom-set-variables fails to set variable
AFAIK, Gerd isn't listening, so I CC'ed him. Gerd, can you please help? revision 1.2 date: 2003/07/23 00:00:13; author: gm; state: Exp; lines: +5 -1 I don't recognize the author gm, but I'm pretty sure it's not me :-). ___ Emacs-pretest-bug mailing list Emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: custom-set-variables fails to set variable
I do not know wether the fact that a hook is unbound caused problems back in July 2003, but it certainly causes no problems in today's CVS. Many hooks are unbound until add-hook gets called for them. It is nicer if the hooks are bound and have doc strings. Not necessary, but nicer. That is why I suggested other ways to fix this. If those don't work, or are too hard, then as a fallback we can delete these defvars. ___ Emacs-pretest-bug mailing list Emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: custom-set-variables fails to set variable
Date: Thu, 10 Nov 2005 19:32:44 -0800 From: Bill Wohler [EMAIL PROTECTED] Cc: emacs-pretest-bug@gnu.org Luc Teirlinck [EMAIL PROTECTED] wrote: Bill Wohler wrote: Also, why does the same code work in Emacs 21 and not in Emacs 22? I believe that I answered this in an earlier reply, but maybe you had not yet read that reply when you asked this. Yes, that is correct. I liked your proposal to revert to Emacs 21 semantics. This would also fix the problem with the two broken MH-E hooks which, as far as I can tell, shouldn't be broken (although I might be confused about how require works ;-). (Who knows how many other hooks are broken in the same way.) If Gerd is listening, perhaps he can let us know why he added that defvar: AFAIK, Gerd isn't listening, so I CC'ed him. Gerd, can you please help? revision 1.2 date: 2003/07/23 00:00:13; author: gm; state: Exp; lines: +5 -1 branches: 1.2.2; (define-derived-mode): Mention hook in doc string. Defvar the derived hook. Maybe someone familiar with that code can take it out... ___ Emacs-pretest-bug mailing list Emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: custom-set-variables fails to set variable
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: AFAIK, Gerd isn't listening, so I CC'ed him. Gerd, can you please help? revision 1.2 date: 2003/07/23 00:00:13; author: gm; state: Exp; lines: +5 -1 I don't recognize the author gm, but I'm pretty sure it's not me :-). Ooops ;-). -- Bill Wohler [EMAIL PROTECTED] http://www.newt.com/wohler/ GnuPG ID:610BD9AD Maintainer of comp.mail.mh FAQ and MH-E. Vote Libertarian! If you're passed on the right, you're in the wrong lane. ___ Emacs-pretest-bug mailing list Emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: custom-set-variables fails to set variable
Stefan Monnier [EMAIL PROTECTED] wrote: revision 1.2 date: 2003/07/23 00:00:13; author: gm; state: Exp; lines: +5 -1 branches: 1.2.2; (define-derived-mode): Mention hook in doc string. Defvar the derived hook. Maybe someone familiar with that code can take it out... I'll gladly take it out if nobody objects. Thanks. I tried taking it out and found that the output of make bootstrap didn't change in a meaningful way. It also fixed the setting of those two MH-E hooks. I'd feel better if someone else who could articulate the reason in the ChangeLog better checked this in. -- Bill Wohler [EMAIL PROTECTED] http://www.newt.com/wohler/ GnuPG ID:610BD9AD Maintainer of comp.mail.mh FAQ and MH-E. Vote Libertarian! If you're passed on the right, you're in the wrong lane. ___ Emacs-pretest-bug mailing list Emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: custom-set-variables fails to set variable
Date: Fri, 11 Nov 2005 12:26:47 +0100 Cc: [EMAIL PROTECTED], emacs-pretest-bug@gnu.org, [EMAIL PROTECTED] From: [EMAIL PROTECTED] [EMAIL PROTECTED] AFAIK, Gerd isn't listening, so I CC'ed him. Gerd, can you please help? revision 1.2 date: 2003/07/23 00:00:13; author: gm; state: Exp; lines: +5 -1 I don't recognize the author gm, but I'm pretty sure it's not me :-). Oops, sorry, you are right. It was Glenn Morris. Glenn, any insights why this change added a defvar for the hook? ___ Emacs-pretest-bug mailing list Emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: custom-set-variables fails to set variable
AFAIK, Gerd isn't listening, so I CC'ed him. Gerd, can you please help? revision 1.2 date: 2003/07/23 00:00:13; author: gm; state: Exp; lines: +5 -1 I don't recognize the author gm, but I'm pretty sure it's not me :-). Oops, sorry, you are right. It was Glenn Morris. Glenn, any insights why this change added a defvar for the hook? I'm not Glenn, but IIRC the motivation was to make sure that foo-mode-hook was always bound. It's not needed from elisp's point of view. Stefan ___ Emacs-pretest-bug mailing list Emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: custom-set-variables fails to set variable
Stefan Monnier wrote: I'm not Glenn, but IIRC the motivation was to make sure that foo-mode-hook was always bound. It's not needed from elisp's point of view. I am he, but Stefan has it right anyway. It was just a cosmetic change, in response to bug report outline mode doesn't call outline-mode-hook as promised (patch) (Jul 16 2003). Without it, when one read the docstring for a mode defined with define-derived-mode it referenced a hook that did not seem to be defined. ___ Emacs-pretest-bug mailing list Emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: custom-set-variables fails to set variable
Glenn Morris wrote: I am he, but Stefan has it right anyway. It was just a cosmetic change, in response to bug report outline mode doesn't call outline-mode-hook as promised (patch) (Jul 16 2003). Without it, when one read the docstring for a mode defined with define-derived-mode it referenced a hook that did not seem to be defined. I do not know wether the fact that a hook is unbound caused problems back in July 2003, but it certainly causes no problems in today's CVS. Many hooks are unbound until add-hook gets called for them. Sincerely, Luc. ___ Emacs-pretest-bug mailing list Emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: custom-set-variables fails to set variable
Luc Teirlinck wrote: I do not know wether the fact that a hook is unbound caused problems back in July 2003, but it certainly causes no problems in today's CVS. Many hooks are unbound until add-hook gets called for them. I haven't made myself clear. There was no _real_ problem with hooks not being bound; it just confused someone to read the docstring of outline-mode and see: Turning on outline mode calls the value ... of `outline-mode-hook' ; then to try `C-h v outline-mode-hook' and get [No match]. Many packages (eg sh-script.el) that define modes by hand explicitly defcustom the associated hook. As you say, they don't need to; it just helps document things for the user, I guess. That was the motivation here. ___ Emacs-pretest-bug mailing list Emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
custom-set-variables fails to set variable
I've found a problem where my mh-letter-mode-hook (in MH-E) isn't getting called. It is listed properly in the custom-set-variables stanza, but when I start Emacs, load MH-E, and run customize-option on mh-letter-mode-hook, the hook is empty! When I enter the hook function, the hook works again. Is it because MH-E isn't loaded when custom-set-variables is run? Is it something MH-E is doing when it is loaded? I do not see this behavior under Emacs 21 so this is a regression. I intend to go through the rest of my customization variables to see if this a trend or an isolated problem. I'll follow up on this thread when I do. In GNU Emacs 22.0.50.2 (i686-pc-linux-gnu, GTK+ Version 2.6.10) of 2005-11-10 on olgas X server distributor `The X.Org Foundation', version 11.0.60802000 configured using `configure '--with-gtk' 'CFLAGS=-g'' Important settings: value of $LC_ALL: en_US 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: en_US locale-coding-system: iso-latin-1 default-enable-multibyte-characters: t Major mode: MH-Folder Minor modes in effect: hl-line-mode: t display-time-mode: t desktop-save-mode: t tooltip-mode: t auto-compression-mode: t mouse-wheel-mode: t menu-bar-mode: t global-font-lock-mode: t font-lock-mode: t unify-8859-on-encoding-mode: t utf-translate-cjk-mode: t line-number-mode: t transient-mark-mode: t Recent input: h v a DEL DEL a v i o r SPC s o SPC DEL DEL DEL o r SPC s h o u l d SPC I SPC r e p o r t SPC i t SPC C-SPC C-p C-f C-f C-f C-f C-f C-f C-f C-f C-f C-w C-a C-n C-SPC C-p C-p C-p C-p C-p C-p C-p C-p C-p C-n C-w C-c C-c SPC SPC SPC SPC SPC i return C-n C-n C-n C-n C-n C-n C-n C-n C-p C-x 4 b d r tab M-x r e p o r t - e m return Recent messages: Auto-saving...done Mark set [2 times] Spell checking region using aspell with default dictionary... Spell-checking using aspell with default dictionary done Wrote /home/wohler/var/mail/drafts/5 Sending...backgrounded inc +inbox...done Fontifying show-+inbox... (regexps..) Quit Loading emacsbug...done -- Bill Wohler [EMAIL PROTECTED] http://www.newt.com/wohler/ GnuPG ID:610BD9AD Maintainer of comp.mail.mh FAQ and MH-E. Vote Libertarian! If you're passed on the right, you're in the wrong lane. ___ Emacs-pretest-bug mailing list Emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: custom-set-variables fails to set variable
Bill Wohler wrote: I've found a problem where my mh-letter-mode-hook (in MH-E) isn't getting called. It is listed properly in the custom-set-variables stanza, but when I start Emacs, load MH-E, and run customize-option on mh-letter-mode-hook, the hook is empty! When I enter the hook function, the hook works again. Is it because MH-E isn't loaded when custom-set-variables is run? Is it something MH-E is doing when it is loaded? No. The sequence of events is the following. (I explain it in a somewhat simplified version, but it is still complex enough.) The entry for mh-letter-mode-hook in the custom-set-variables form is not executed while your .emacs is loaded, _unless_ the variable already has a value at that time. If the variable already has a value, custom-set-variables immediately overwrites it and you will note that your bug disappears if you put (defvar mh-letter-mode-hook nil) in your .emacs _before_ the call to custom-set-variables. But if mh-letter-mode-hook is unbound when the custom-set-variables form is evaluated then all custom-set-variables does is set the 'saved-value property of mh-letter-mode-hook, which remains unbound. Later, when the defcustom is executed mh-letter-mode-hook is set to the 'saved-value property _if_ it is still unbound. But if it got bound to some value in the meantime, the defcustom leaves that value unchanged. Summary, where defvar means a non-compiler defvar, i.e just (defvar foo) has no effect, except quieting the compiler: defvar custom-set-variables defvar defcustom: custom-set-variables wins. custom-set-variables defcustom defvar: custom-set-variables wins again. custom-set-variables defvar defcustom: The defvar wins. All of this may look contorted, but the fact is that making a defcustom compete with a real defvar makes no sense. mh-letter-mode is defined using define-derived-mode, whose macroexpanded form contains: (defvar mh-letter-mode-hook nil) This is normally executed after the custom-set-variables form, but before the defcustom, so we get: custom-set-variables defvar defcustom and the defvar wins. mh-letter-mode-hook remains nil. There are probably good, but complex reasons behind Custom's complexity, as explained above. I do not immediately know what the best real solution to your problem is, but a workaround to the problem would be to put the defcustom before the call to define-derived-mode. Then you get: custom-set-variables defcustom defvar and the defvar looses, as it should. Sincerely, Luc. ___ Emacs-pretest-bug mailing list Emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: custom-set-variables fails to set variable
From my previous message: custom-set-variables defcustom defvar and the defvar looses, as it should. The defvar looses in the struggle for the value, but the defvar wins in as far as the docstring is concerned, which might be a problem for you. To avoid this you could do: defcustom define-derived-mode yet-another-defvar-with-your-docstring, which would start looking very strange. Maybe we need a keyword argument to define-derived-mode that prevents it from defvarring the mode hook, in case somebody wants a defcustom or a hand-crafted defvar. Sincerely, Luc. ___ Emacs-pretest-bug mailing list Emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: custom-set-variables fails to set variable
Bill Wohler [EMAIL PROTECTED] writes: I've found a problem where my mh-letter-mode-hook (in MH-E) isn't getting called. It is listed properly in the custom-set-variables stanza, but when I start Emacs, load MH-E, and run customize-option on mh-letter-mode-hook, the hook is empty! When I enter the hook function, the hook works again. Is it because MH-E isn't loaded when custom-set-variables is run? Is it something MH-E is doing when it is loaded? I do not see this behavior under Emacs 21 so this is a regression. It is not documented in NEWS, either. I intend to go through the rest of my customization variables to see if this a trend or an isolated problem. I'll follow up on this thread when I do. Boy howdy! It is a trend. When I bring up a customization buffer for each of my customization variables, some look good (are set correctly, have a state of saved, and have documentation). However, the rest have a value of nil or are just empty (mostly hooks), have a state of changed, and do not have documentation strings. The ones that are OK are either in files that are in preloaded-file-list or have ;;;###autoload cookies. There are two solutions 1. Preserve the Emacs 21 semantics which had the effect of remembering customization settings in customize-set-variables so that when the modules were eventually loaded, the user's settings took precendence. 2. Add lots of lots of ;;;###autoload cookies to defcustoms everywhere. I am but one small user, but my list of broken customization variables is long (appended below). I suspect that option #2 is the preferred approach as it has the advantage of providing docstrings and customizationability to options in unloaded packages. It looks like the great majority of these are in the Gnus and MH-E packages. If a Gnus person can handle the Gnus options, I can handle the MH-E options, and Peter can handle the Debian options. Richard, should someone take the responsibility of ensuring that all of the defcustom options are autoloaded? Do *all* of the options need to be autoloaded? Or just the right ones (whatever that is)? - List of broken options in ~wohler/.emacs.custom - Man-notify-method c-backslash-column canlock-password cperl-font-lock cperl-indent-level cperl-lazy-help-time cperl-under-as-char cvs-confirm-removals debian-bug-always-CC-myself debian-bug-menu-action-default debian-bug-menu-preload-flag gnus-agent-expire-days gnus-asynchronous gnus-before-startup-hook gnus-default-article-saver gnus-directory gnus-group-line-format gnus-interactive-catchup gnus-interactive-exit gnus-large-newsgroup gnus-message-archive-group gnus-message-archive-method gnus-orphan-score gnus-read-active-file gnus-read-newsrc-file gnus-save-killed-list gnus-save-newsrc-file gnus-score-expiry-days gnus-secondary-select-methods gnus-summary-line-format gnus-summary-mode-hook gnus-thread-expunge-below gnus-thread-hide-subtree gnus-thread-sort-functions gnus-updated-mode-lines gnus-visible-headers gpg-passphrase-timeout ispell-program-name jde-db-source-directories jde-project-file-name jde-use-font-lock log-edit-hook lpr-page-header-program lpr-page-header-switches mail-source-delete-incoming mail-sources message-auto-save-directory message-directory message-mail-user-agent message-send-hook message-sent-hook message-user-organization mh-alias-insertion-location mh-auto-fields-list mh-before-quit-hook mh-before-send-letter-hook mh-compose-skipped-header-fields mh-compose-space-does-completion-flag mh-default-folder-must-exist-flag mh-default-folder-prefix mh-delete-yanked-msg-window-flag mh-display-buttons-for-alternatives-flag mh-do-not-confirm-flag mh-folder-mode-hook mh-identity-default mh-identity-list mh-inc-folder-hook mh-index-new-messages-folders mh-index-ticked-messages-folders mh-invisible-header-fields mh-invisible-header-fields-default mh-junk-background mh-junk-disposition mh-large-folder mh-letter-mode-hook mh-lpr-command-format mh-mime-save-parts-default-directory mh-quit-hook mh-recenter-summary-flag mh-recursive-folders-flag mh-reply-default-reply-to mh-show-mode-hook mh-show-threads-flag mh-show-use-goto-addr-flag mh-tool-bar-folder-buttons mh-yank-behavior mm-discouraged-alternatives mm-inline-large-images mm-inline-text-html-with-images mm-text-html-renderer nnmail-keep-last-article nnmail-prepare-incoming-hook pgg-encrypt-for-me pgg-query-keyserver smiley-data-directory speedbar-hide-button-brackets-flag speedbar-use-images w3m-content-type-alist w3m-key-binding w3m-use-favicon -- Bill Wohler [EMAIL PROTECTED]
Re: custom-set-variables fails to set variable
Luc Teirlinck [EMAIL PROTECTED] writes: custom-set-variables defvar defcustom: The defvar wins. Thanks very much for the explanation. Too bad I didn't read this before sending my last note. I evidently got confused when I ran my last test. After loading MH-E, I found that the list I previously posted was reduced to the following: mh-inc-folder-hook mh-letter-mode-hook mh-show-mode-hook I'm still a bit confused though. For example, mh-show-mode-hook is defined implicitly by the definition of mh-show-mode in mh-utils.el which requires mh-customize.el which contains the defcustom of mh-show-mode-hook. Shouldn't that defcustom have won against the defvar in the mh-show-mode? I'd still be curious to hear the opinions on whether one should use the ;;;###autoload cookie on the defcustoms or not. Also, why does the same code work in Emacs 21 and not in Emacs 22? -- Bill Wohler [EMAIL PROTECTED] http://www.newt.com/wohler/ GnuPG ID:610BD9AD Maintainer of comp.mail.mh FAQ and MH-E. Vote Libertarian! If you're passed on the right, you're in the wrong lane. ___ Emacs-pretest-bug mailing list Emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: custom-set-variables fails to set variable
Bill Wohler wrote: There are two solutions 1. Preserve the Emacs 21 semantics which had the effect of remembering customization settings in customize-set-variables so that when the modules were eventually loaded, the user's settings took precendence. In as far as I can see the way that customization settings are remembered in emacs-23 is exactly the same as in current CVS. I explained the somewhat complex details in my earlier message. What _has_ changed is that now define-derived-mode writes a defvar for the mode hook. It did not do that in emacs-21.3. That is what caused the regression. Why does define-minor-mode need to defvar the mode hook? There is no need to defvar hooks. `add-hook' can perfectly handle unbound hook variables. I propose that we revert this change in define-derived-mode. One should check define-minor-mode and similar macros to see if they have the same problem and correct them too if they do. Boy howdy! It is a trend. Not to the degree you think. Obviously it is a trend for mode hooks that have competing definitions, one as a defvar and one as a defcustom. However, many of the problems in your list seem to be unrelated local problems. For instance I can not reproduce your problem with ispell-program-name. Sincerely, Luc. ___ Emacs-pretest-bug mailing list Emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: custom-set-variables fails to set variable
I'm still a bit confused though. For example, mh-show-mode-hook is defined implicitly by the definition of mh-show-mode in mh-utils.el which requires mh-customize.el which contains the defcustom of mh-show-mode-hook. Shouldn't that defcustom have won against the defvar in the mh-show-mode? I should look at the details to figure that out. But do not forget that add-hook also will bind an undefined hook, just as defvar does. Custom and hooks quite simply do not work very well together. Per designed Custom under the assumption that there are two disjoint classes of variables: internal variables for use by programs and Custom variables for user customization which programs should never touch. Emacs does not satisfy that assumption and this creates problems. These problems are the worst for hooks, which should be manipulated with add-hook and remove-hook, not with setq-default, as Custom does. I described several nasty problems related to Custom and hooks earlier. This is a yet another one. We are planning for a fix, but decided it was too involved to do before the release. (add-hook 'foo-hook 'essential-function) custom-set-variables: The custom-set-variables undoes the add-hook. This is a problem I described earlier. It could create problems if a user upgrades to an Emacs version in which essential-function is new and essential. It is a constant potential pitfall for CVS users. But now: custom-set-variables (add-hook 'foo-hook 'essential-function) defcustom: Now the add-hook means that the user's customization is ignored. This is yet another problem related to Custom and hooks. custom-set-variables defcustom (add-hook 'foo-hook 'essential-function) will work as intended, but I see no way to always guarantee this order. I'd still be curious to hear the opinions on whether one should use the ;;;###autoload cookie on the defcustoms or not. It could solve the newly pointed out problem with Custom and hooks, but would not solve the other ones, like, for instance, the first one I pointed out above (there are others). Some people who do not have a lot of memory available might not like it. Sincerely, Luc. ___ Emacs-pretest-bug mailing list Emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: custom-set-variables fails to set variable
Bill Wohler wrote: Also, why does the same code work in Emacs 21 and not in Emacs 22? I believe that I answered this in an earlier reply, but maybe you had not yet read that reply when you asked this. Sincerely, Luc. ___ Emacs-pretest-bug mailing list Emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: custom-set-variables fails to set variable
Luc Teirlinck [EMAIL PROTECTED] wrote: Bill Wohler wrote: Also, why does the same code work in Emacs 21 and not in Emacs 22? I believe that I answered this in an earlier reply, but maybe you had not yet read that reply when you asked this. Yes, that is correct. I liked your proposal to revert to Emacs 21 semantics. This would also fix the problem with the two broken MH-E hooks which, as far as I can tell, shouldn't be broken (although I might be confused about how require works ;-). (Who knows how many other hooks are broken in the same way.) If Gerd is listening, perhaps he can let us know why he added that defvar: revision 1.2 date: 2003/07/23 00:00:13; author: gm; state: Exp; lines: +5 -1 branches: 1.2.2; (define-derived-mode): Mention hook in doc string. Defvar the derived hook. Maybe someone familiar with that code can take it out... -- Bill Wohler [EMAIL PROTECTED] http://www.newt.com/wohler/ GnuPG ID:610BD9AD Maintainer of comp.mail.mh FAQ and MH-E. Vote Libertarian! If you're passed on the right, you're in the wrong lane. ___ Emacs-pretest-bug mailing list Emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: custom-set-variables fails to set variable
revision 1.2 date: 2003/07/23 00:00:13; author: gm; state: Exp; lines: +5 -1 branches: 1.2.2; (define-derived-mode): Mention hook in doc string. Defvar the derived hook. Maybe someone familiar with that code can take it out... I'll gladly take it out if nobody objects. Stefan ___ Emacs-pretest-bug mailing list Emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug