unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#5327: 23.1; unload-feature-special-hooks add fill-nobreak-predicate
@ 2010-01-05 23:38 Kevin Ryde
  2010-01-06  1:30 ` Juanma Barranquero
  2011-07-11 16:25 ` Juanma Barranquero
  0 siblings, 2 replies; 5+ messages in thread
From: Kevin Ryde @ 2010-01-05 23:38 UTC (permalink / raw)
  To: bug-gnu-emacs

While nosing around the unload-feature stuff I wondered if
unload-feature-special-hooks should include fill-nobreak-predicate, as
it's a hook now.

The damage from leaving an unloaded func there is limited to paragraph
filling, and is likely to be either buffer local, or be autoloaded and
then end up ok anyway.  You can see a bad effect currently for instance
with

    M-x sgml-mode
    M-x unload-feature sgml-mode
    type in a long line to be filled
    M-q
    => Symbol's function definition is void: sgml-fill-nobreak


In GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.16.5)
 of 2009-09-14 on raven, modified by Debian
configured using `configure  '--build=i486-linux-gnu' '--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.1/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS=''







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

* bug#5327: 23.1; unload-feature-special-hooks add  fill-nobreak-predicate
  2010-01-05 23:38 bug#5327: 23.1; unload-feature-special-hooks add fill-nobreak-predicate Kevin Ryde
@ 2010-01-06  1:30 ` Juanma Barranquero
  2010-01-08 21:28   ` Kevin Ryde
  2011-07-11 16:25 ` Juanma Barranquero
  1 sibling, 1 reply; 5+ messages in thread
From: Juanma Barranquero @ 2010-01-06  1:30 UTC (permalink / raw)
  To: Kevin Ryde; +Cc: 5327

On Wed, Jan 6, 2010 at 00:38, Kevin Ryde <user42@zip.com.au> wrote:

> While nosing around the unload-feature stuff I wondered if
> unload-feature-special-hooks should include fill-nobreak-predicate, as
> it's a hook now.

It's a hook or hook-like, and its name does not end in -hooks?, so yes.

As an aside, perhaps unload-feature should also remove automatically
unloaded funcs from symbols called *-functions, which would eliminate
much cruft from `unload-feature-special-hooks'. The question is
whether there are many variables called -functions which are not
really hooks.

    Juanma






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

* bug#5327: 23.1; unload-feature-special-hooks add  fill-nobreak-predicate
  2010-01-06  1:30 ` Juanma Barranquero
@ 2010-01-08 21:28   ` Kevin Ryde
  0 siblings, 0 replies; 5+ messages in thread
From: Kevin Ryde @ 2010-01-08 21:28 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: 5327

Juanma Barranquero <lekktu@gmail.com> writes:
>
> The question is
> whether there are many variables called -functions which are not
> really hooks.

That'd be the dangerous bit.  I've got a defconst called -functions in
some of my code, but it wouldn't be hurt.

Those with a custom-type of 'hook or '(repeat function) could be likely.
In fact any var with that custom-type might be ok to act on.  A grep
finds me three called -functions (code below)

    find-directory-functions
    auto-coding-functions
    compile-command-default-functions

of which auto-coding-functions may be the only important one not
presently in unload-feature-special-hooks.




(pp (let (ret)
      (mapatoms (lambda (sym)
                  (and (boundp sym)
                       (get sym 'custom-type)
                       (not (memq sym unload-feature-special-hooks))
                       (string-match "-functions\\'" (symbol-name sym))
                       (push (list sym (get sym 'custom-type)) ret))))
      ret)
    (current-buffer))






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

* bug#5327: 23.1; unload-feature-special-hooks add fill-nobreak-predicate
  2010-01-05 23:38 bug#5327: 23.1; unload-feature-special-hooks add fill-nobreak-predicate Kevin Ryde
  2010-01-06  1:30 ` Juanma Barranquero
@ 2011-07-11 16:25 ` Juanma Barranquero
  2011-07-16  1:52   ` Kevin Ryde
  1 sibling, 1 reply; 5+ messages in thread
From: Juanma Barranquero @ 2011-07-11 16:25 UTC (permalink / raw)
  To: Kevin Ryde; +Cc: 5327-done

On Wed, Jan 6, 2010 at 00:38, Kevin Ryde <user42@zip.com.au> wrote:

>    M-x sgml-mode
>    M-x unload-feature sgml-mode
>    type in a long line to be filled
>    M-q
>    => Symbol's function definition is void: sgml-fill-nobreak

`fill-nobreak-predicate' was set locally, so it would be removed when
the mode for the buffer was changed. Previously, `unload-feature'
failed to do so unless the mode package's FEATURE-unload-function,
assuming one existed, did by itself. Since revno:104702
`unload-feature' does so automatically, so the above case should work
(i.e, unloading sgml-mode will change the buffer's major mode to
text-mode).

That said, I'll add that variable and some of the others you mentioned
to `unload-feature-special-hooks' because it's better to be safe than
sorry. But, what would be nice is some way to identify hook variables
in a generic way, instead of special-casing still more of them. :-(

>   find-directory-functions
>   auto-coding-functions

OK.

>   compile-command-default-functions

I cannot find that one in the Emacs sources.

    Juanma





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

* bug#5327: 23.1; unload-feature-special-hooks add fill-nobreak-predicate
  2011-07-11 16:25 ` Juanma Barranquero
@ 2011-07-16  1:52   ` Kevin Ryde
  0 siblings, 0 replies; 5+ messages in thread
From: Kevin Ryde @ 2011-07-16  1:52 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: 5327

Juanma Barranquero <lekktu@gmail.com> writes:
>
>>   compile-command-default-functions
>
> I cannot find that one in the Emacs sources.

Ah yes, sorry, that's one of my own slipped through.
(Which I jigged up to add to unload-feature-special-hooks too anyway.)


-- 
The sigfile one-line movie reviews series:
"Les Amants du Pont Neuf" -- fine sequel to Les Amants du Pont Huit.





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

end of thread, other threads:[~2011-07-16  1:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-05 23:38 bug#5327: 23.1; unload-feature-special-hooks add fill-nobreak-predicate Kevin Ryde
2010-01-06  1:30 ` Juanma Barranquero
2010-01-08 21:28   ` Kevin Ryde
2011-07-11 16:25 ` Juanma Barranquero
2011-07-16  1:52   ` Kevin Ryde

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).