unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* silly face function names
@ 2002-12-20  7:43 Miles Bader
  2002-12-20 10:53 ` Kim F. Storm
  2003-01-10 23:21 ` Stefan Monnier
  0 siblings, 2 replies; 7+ messages in thread
From: Miles Bader @ 2002-12-20  7:43 UTC (permalink / raw)


There are a number of face manipulation functions in faces.el of the
form `set-face-FOO-p'.  I think such names are misleading, since they use
the -p prefix on functions which aren't predicates.

Any objections to me renaming them to just `set-face-FOO', and adding
aliases (and make-obolete) for the old names?

Thanks,

-Miles
-- 
Occam's razor split hairs so well, I bought the whole argument!

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

* Re: silly face function names
  2002-12-20 10:53 ` Kim F. Storm
@ 2002-12-20 10:08   ` Miles Bader
  2002-12-20 11:28     ` Kim F. Storm
  2002-12-20 13:22   ` Robert J. Chassell
  1 sibling, 1 reply; 7+ messages in thread
From: Miles Bader @ 2002-12-20 10:08 UTC (permalink / raw)
  Cc: emacs-devel

storm@cua.dk (Kim F. Storm) writes:
> The names are badly chosen (having both 'set-' and '-p' is confusing),
> but if you read the names like this, it does make sense:
> 
>         set-face - FOO-p
> 
> I would argue that 'set-' takes precedence over '-p' here...

I'd argue that you're wrong -- `FOO-p' is not a thing which you can set.
Faces have an `inverse-video' property, and `face-inverse-video-p' is
merely the name of the predicate which tests that property.

Having bogus function names around in emacs-proper just serves to
confuse people and cause the _next_ generation of bogus function names.

-Miles
-- 
Come now, if we were really planning to harm you, would we be waiting here, 
 beside the path, in the very darkest part of the forest?

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

* Re: silly face function names
  2002-12-20  7:43 silly face function names Miles Bader
@ 2002-12-20 10:53 ` Kim F. Storm
  2002-12-20 10:08   ` Miles Bader
  2002-12-20 13:22   ` Robert J. Chassell
  2003-01-10 23:21 ` Stefan Monnier
  1 sibling, 2 replies; 7+ messages in thread
From: Kim F. Storm @ 2002-12-20 10:53 UTC (permalink / raw)
  Cc: emacs-devel

Miles Bader <miles@lsi.nec.co.jp> writes:

> There are a number of face manipulation functions in faces.el of the
> form `set-face-FOO-p'.  I think such names are misleading, since they use
> the -p prefix on functions which aren't predicates.

The names are badly chosen (having both 'set-' and '-p' is confusing),
but if you read the names like this, it does make sense:

        set-face - FOO-p

I would argue that 'set-' takes precedence over '-p' here...

> 
> Any objections to me renaming them to just `set-face-FOO', and adding
> aliases (and make-obolete) for the old names?

IMHO, there is an abundance of silly functions and commands in
faces.el; I don't see any reason to rename a few of them (which are
rarely used anyway - I found only 5 places total).  

So I object.

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

* Re: silly face function names
  2002-12-20 10:08   ` Miles Bader
@ 2002-12-20 11:28     ` Kim F. Storm
  0 siblings, 0 replies; 7+ messages in thread
From: Kim F. Storm @ 2002-12-20 11:28 UTC (permalink / raw)
  Cc: emacs-devel

Miles Bader <miles@lsi.nec.co.jp> writes:

> storm@cua.dk (Kim F. Storm) writes:
> > The names are badly chosen (having both 'set-' and '-p' is confusing),
> > but if you read the names like this, it does make sense:
> > 
> >         set-face - FOO-p
> > 
> > I would argue that 'set-' takes precedence over '-p' here...
> 
> I'd argue that you're wrong -- `FOO-p' is not a thing which you can set.
> Faces have an `inverse-video' property, and `face-inverse-video-p' is
> merely the name of the predicate which tests that property.
> 
> Having bogus function names around in emacs-proper just serves to
> confuse people and cause the _next_ generation of bogus function names.

Ok, but since we already have N ways to do this:
        (make-face-FOO face [F])
        (make-face-unFOO face [F])
        (set-face-attribute face F :FOO bool)
        (set-face-FOO-p face bool [F])

So I really don't see _any_ reason to add an N+1'th way to do the same:
        (set-face-FOO face bool [F])

Instead, I'd suggest simply to mark the set-face-FOO-p obsolete, and
change the few existing uses of those functions to use one of the other
alternatives above.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

* Re: silly face function names
  2002-12-20 10:53 ` Kim F. Storm
  2002-12-20 10:08   ` Miles Bader
@ 2002-12-20 13:22   ` Robert J. Chassell
  2002-12-20 14:46     ` Kim F. Storm
  1 sibling, 1 reply; 7+ messages in thread
From: Robert J. Chassell @ 2002-12-20 13:22 UTC (permalink / raw)


   Miles Bader <miles@lsi.nec.co.jp> writes:

   > There are a number of face manipulation functions in faces.el of the
   > form `set-face-FOO-p'.  I think such names are misleading, ...

Yes, they are misleading.

As storm@cua.dk (Kim F. Storm) says

   The names are badly chosen (having both 'set-' and '-p' is confusing),
   but if you read the names like this, it does make sense:

           set-face - FOO-p

which is true.  Kim then goes on to say

   IMHO, there is an abundance of silly functions and commands in
   faces.el; I don't see any reason to rename a few of them (which are
   rarely used anyway - I found only 5 places total).  

But even a few silly names should be fixed.  Our long term goal should
be code that is clear and meaningful, not misleading or silly.  That
means cleaning up previous silly messes.

As ESR said after he cleaned up a large number of messes for the shift
from GNU Emacs version 18 to version 19, "that was an Augean Stables."

-- 
    Robert J. Chassell                         Rattlesnake Enterprises
    http://www.rattlesnake.com                  GnuPG Key ID: 004B4AC8
    http://www.teak.cc                             bob@rattlesnake.com

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

* Re: silly face function names
  2002-12-20 13:22   ` Robert J. Chassell
@ 2002-12-20 14:46     ` Kim F. Storm
  0 siblings, 0 replies; 7+ messages in thread
From: Kim F. Storm @ 2002-12-20 14:46 UTC (permalink / raw)
  Cc: emacs-devel

"Robert J. Chassell" <bob@rattlesnake.com> writes:

>    Miles Bader <miles@lsi.nec.co.jp> writes:
> 
>    > There are a number of face manipulation functions in faces.el of the
>    > form `set-face-FOO-p'.  I think such names are misleading, ...
> 
> But even a few silly names should be fixed.  Our long term goal should
> be code that is clear and meaningful, not misleading or silly.  That
> means cleaning up previous silly messes.

In my subsequent mail, I agreed with Miles that we should obsolete the
silly named functions -- but *not* introduce new functions to replace them
as there is still an abundance of functions doing the same!

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

* Re: silly face function names
  2002-12-20  7:43 silly face function names Miles Bader
  2002-12-20 10:53 ` Kim F. Storm
@ 2003-01-10 23:21 ` Stefan Monnier
  1 sibling, 0 replies; 7+ messages in thread
From: Stefan Monnier @ 2003-01-10 23:21 UTC (permalink / raw)
  Cc: emacs-devel

> There are a number of face manipulation functions in faces.el of the
> form `set-face-FOO-p'.  I think such names are misleading, since they use
> the -p prefix on functions which aren't predicates.
> 
> Any objections to me renaming them to just `set-face-FOO', and adding
> aliases (and make-obolete) for the old names?
> 
> Thanks,
> 
> -Miles
> -- 
> Occam's razor split hairs so well, I bought the whole argument!
> 
> 
> _______________________________________________
> Emacs-devel mailing list
> Emacs-devel@gnu.org
> http://mail.gnu.org/mailman/listinfo/emacs-devel
> 

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

end of thread, other threads:[~2003-01-10 23:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-20  7:43 silly face function names Miles Bader
2002-12-20 10:53 ` Kim F. Storm
2002-12-20 10:08   ` Miles Bader
2002-12-20 11:28     ` Kim F. Storm
2002-12-20 13:22   ` Robert J. Chassell
2002-12-20 14:46     ` Kim F. Storm
2003-01-10 23:21 ` Stefan Monnier

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