* Re: [Emacs-diffs] master 8b36bfa 2/2: Add autoload cookie for the eww-suggest-uris variable. [not found] ` <E1YNQz6-0006Yk-J9@vcs.savannah.gnu.org> @ 2015-02-16 20:29 ` Artur Malabarba 2015-02-17 18:55 ` autoload for eww-suggest-uris Ivan Shmakov 0 siblings, 1 reply; 6+ messages in thread From: Artur Malabarba @ 2015-02-16 20:29 UTC (permalink / raw) To: emacs-devel, Ivan Shmakov; +Cc: emacs-diffs > +;;;###autoload > (defcustom eww-suggest-uris Autoloading defcustoms is know to cause problems. See http://lists.gnu.org/archive/html/emacs-devel/2014-11/msg00608.html Personally, I'd recommend finding another way around your add-hook issue. What was the problem? ^ permalink raw reply [flat|nested] 6+ messages in thread
* autoload for eww-suggest-uris 2015-02-16 20:29 ` [Emacs-diffs] master 8b36bfa 2/2: Add autoload cookie for the eww-suggest-uris variable Artur Malabarba @ 2015-02-17 18:55 ` Ivan Shmakov 2015-03-05 21:55 ` Artur Malabarba 0 siblings, 1 reply; 6+ messages in thread From: Ivan Shmakov @ 2015-02-17 18:55 UTC (permalink / raw) To: emacs-devel >>>>> Artur Malabarba <bruce.connor.am@gmail.com> writes: >> +;;;###autoload >> (defcustom eww-suggest-uris > Autoloading defcustoms is know to cause problems. See > http://lists.gnu.org/archive/html/emacs-devel/2014-11/msg00608.html I don’t seem to see there any description of what /exactly/ happens in such a case – just that package-initialize for some reason resets the variables set with custom-set-variables. Now, given that eww.el is a built-in package, is that even a problem? (Any details on that, anyone?) > Personally, I'd recommend finding another way around your add-hook > issue. What was the problem? This: ;;; ~/.emacs (add-hook 'eww-suggest-uris 'some-new-function) ; → (some-new-function) Expected: that some-new-function /and/ all the default ones. An alternative would be to use add-hook in 'eww itself, but that in turn interferes with (setq eww-suggest-uris '(the-only-one)). -- FSF associate member #7257 http://boycottsystemd.org/ … 3013 B6A0 230E 334A ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: autoload for eww-suggest-uris 2015-02-17 18:55 ` autoload for eww-suggest-uris Ivan Shmakov @ 2015-03-05 21:55 ` Artur Malabarba 2015-03-06 6:24 ` Ivan Shmakov 0 siblings, 1 reply; 6+ messages in thread From: Artur Malabarba @ 2015-03-05 21:55 UTC (permalink / raw) To: emacs-devel > > Personally, I'd recommend finding another way around your add-hook > > issue. What was the problem? > > This: > > ;;; ~/.emacs > (add-hook 'eww-suggest-uris 'some-new-function) > ; → (some-new-function) > > Expected: that some-new-function /and/ all the default ones. > > An alternative would be to use add-hook in 'eww itself, but that > in turn interferes with (setq eww-suggest-uris '(the-only-one)). According to Stefan it is a bug to define a hook with a non-nil initial value (see http://lists.gnu.org/archive/html/emacs-devel/2015-02/msg01271.html), so using the `add-hook' in eww itself is the correct way. In fact, it seems that 25.1 will issue a compiler warning when a hook variable is given a non-nil initial value. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: autoload for eww-suggest-uris 2015-03-05 21:55 ` Artur Malabarba @ 2015-03-06 6:24 ` Ivan Shmakov 2015-03-10 1:23 ` Stefan Monnier 0 siblings, 1 reply; 6+ messages in thread From: Ivan Shmakov @ 2015-03-06 6:24 UTC (permalink / raw) To: emacs-devel >>>>> Artur Malabarba <bruce.connor.am@gmail.com> writes: >>>>> "SM" == Stefan Monnier <monnier@iro.umontreal.ca> writes: […] >> ;;; ~/.emacs (add-hook 'eww-suggest-uris 'some-new-function) >> ; → (some-new-function) >> Expected: that some-new-function /and/ all the default ones. >> An alternative would be to use add-hook in 'eww itself, but that in >> turn interferes with (setq eww-suggest-uris '(the-only-one)). > According to Stefan it is a bug to define a hook with a non-nil > initial value (see > http://lists.gnu.org/archive/html/emacs-devel/2015-02/msg01271.html), [AKA news:jwvd250fej3.fsf-monnier+emacs@gnu.org.] > so using the `add-hook' in eww itself is the correct way. How do we prevent it from interfering with an explicit ‘setq’ then? SM> Basically, given that "unbound == nil", what is a bug is to defvar SM> a hook with a non-nil default value, unless that hook is predefined SM> (i. e. is never unbound). How exactly does this affect the case when autoloads /are/ properly set up (as, I argue, they should be, assuming a proper Emacs installation)? > In fact, it seems that 25.1 will issue a compiler warning when a hook > variable is given a non-nil initial value. Rest assured I’ll promptly ignore it whenever working on my own code. -- FSF associate member #7257 http://boycottsystemd.org/ … 3013 B6A0 230E 334A ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: autoload for eww-suggest-uris 2015-03-06 6:24 ` Ivan Shmakov @ 2015-03-10 1:23 ` Stefan Monnier 2015-03-11 4:42 ` Ivan Shmakov 0 siblings, 1 reply; 6+ messages in thread From: Stefan Monnier @ 2015-03-10 1:23 UTC (permalink / raw) To: emacs-devel > How do we prevent it from interfering with an explicit ‘setq’ > then? The question is fundamentally: is eww-suggest-uris a hook, or is it a list of functions? If it's a hook, then using `setq' on it is a bug (and it should be called eww-suggest-uris-hook or eww-suggest-uris-functions). Stefan ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: autoload for eww-suggest-uris 2015-03-10 1:23 ` Stefan Monnier @ 2015-03-11 4:42 ` Ivan Shmakov 0 siblings, 0 replies; 6+ messages in thread From: Ivan Shmakov @ 2015-03-11 4:42 UTC (permalink / raw) To: emacs-devel >>>>> Stefan Monnier <monnier@iro.umontreal.ca> writes: >> How do we prevent it from interfering with an explicit ‘setq’ then? > The question is fundamentally: is eww-suggest-uris a hook, or is it a > list of functions? > If it's a hook, then using `setq' on it is a bug (and it should be > called eww-suggest-uris-hook or eww-suggest-uris-functions). If we define a hook as a variable holding a list of functions and provided with the purpose of allowing proper operation of arbitrary extensions to the base code, then no – I believe eww-suggest-uris is /not/ a hook. Still, it’s a (customizable) list of functions, defined with :type 'hook, and (arguably) one may use add-hook in one’s ~/.emacs to add to it. (The use of add-hook against this variable in EWW extensions – should there be any – is debatable, though.) -- FSF associate member #7257 np. La Druido — Strika Tango 3013 B6A0 230E 334A ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-03-11 4:42 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <20150216190531.25142.72090@vcs.savannah.gnu.org> [not found] ` <E1YNQz6-0006Yk-J9@vcs.savannah.gnu.org> 2015-02-16 20:29 ` [Emacs-diffs] master 8b36bfa 2/2: Add autoload cookie for the eww-suggest-uris variable Artur Malabarba 2015-02-17 18:55 ` autoload for eww-suggest-uris Ivan Shmakov 2015-03-05 21:55 ` Artur Malabarba 2015-03-06 6:24 ` Ivan Shmakov 2015-03-10 1:23 ` Stefan Monnier 2015-03-11 4:42 ` Ivan Shmakov
Code repositories for project(s) associated with this public inbox https://git.savannah.gnu.org/cgit/emacs.git This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).