unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* VM and find-face
@ 2005-01-06 15:49 Stephen Eglen
  2005-01-06 21:42 ` Kyle Jones
  2005-01-07  2:50 ` Richard Stallman
  0 siblings, 2 replies; 4+ messages in thread
From: Stephen Eglen @ 2005-01-06 15:49 UTC (permalink / raw)


Hi,

VM 7.17 no longer works with the CVS version of Emacs, I think due to
the introduction yesterday of find-face into find-func.el.  VM has the
following code:

(if (if (fboundp 'find-face)
		(find-face 'vm-monochrome-image)
	      (facep 'vm-monochrome-image))
	    nil
	  (make-face 'vm-monochrome-image)
	  (set-face-background 'vm-monochrome-image "white")
	  (set-face-foreground 'vm-monochrome-image "black"))

In todays's CVS emacs, with its newly defined find-face defun, I get 
the backtrace:

  signal(error ("Don't know where `vm-monochrome-image' is defined"))
  error("Don't know where `%s' is defined" vm-monochrome-image)
  find-function-search-for-symbol(vm-monochrome-image defface nil)
  find-definition-noselect(vm-monochrome-image defface)
  find-function-do-it(vm-monochrome-image defface switch-to-buffer)
  find-face(vm-monochrome-image)


One problem is that find-face behaves differently on Emacs and XEmacs;
find-face returns nil on the above call if the face could not be
found.

What's the best way to proceed - update VM or allow find-face to
return nil?

Stephen

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

* VM and find-face
  2005-01-06 15:49 VM and find-face Stephen Eglen
@ 2005-01-06 21:42 ` Kyle Jones
  2005-01-06 22:11   ` Miles Bader
  2005-01-07  2:50 ` Richard Stallman
  1 sibling, 1 reply; 4+ messages in thread
From: Kyle Jones @ 2005-01-06 21:42 UTC (permalink / raw)
  Cc: emacs-devel

I'd prefer it if find-face returned nil.  Returning nil is better
for functions that aren't going to be used interactively unless
you're going to signal a unique condition like end-of-buffer or
wrong-number-of-arguments.  But the code is easy to fix so it
doesn't matter much one way or the other.

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

* Re: VM and find-face
  2005-01-06 21:42 ` Kyle Jones
@ 2005-01-06 22:11   ` Miles Bader
  0 siblings, 0 replies; 4+ messages in thread
From: Miles Bader @ 2005-01-06 22:11 UTC (permalink / raw)
  Cc: Stephen Eglen, emacs-devel

I sent this message to a different mailing list:

On Thu, 06 Jan 2005 15:05:57 +0000, Glenn Morris
<gmorris+emacs@ast.cam.ac.uk> wrote:
> The new function find-face is incompatible with the XEmacs version,
> and therefore breaks existing package code that tries to handle both
> Emacs flavours.
> 
> The GNU Emacs version throws an error for an unknown face:
> 
> (find-face 'made-up-face)

Yes, the new function `find-face' appears to be a completely different
function than the xemacs `find-face' function; it seems to be an
analogue to `find-function', for finding the source code definition of
a face.

I'm not sure that this is all that useful a function anyway -- the
source code of a defface doesn't really offer much over the face
definition displayed by custom or the like; unlike a function or
variable, defface definitions are almost always "static" (don't use a
run-time calculated value) and rarely have any comments. 
Compatibility with xemacs seems more important.

Perhaps the function could be renamed `find-defface' or
`find-face-definition' instead; those names are slightly inconsistent
with other such functions, but maybe it doesn't matter very much for a
function that will likely be used mostly by clicking on a button in a
*Help* buffer.

-Miles

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

* Re: VM and find-face
  2005-01-06 15:49 VM and find-face Stephen Eglen
  2005-01-06 21:42 ` Kyle Jones
@ 2005-01-07  2:50 ` Richard Stallman
  1 sibling, 0 replies; 4+ messages in thread
From: Richard Stallman @ 2005-01-07  2:50 UTC (permalink / raw)
  Cc: kyle_jones, emacs-devel

I renamed the new find-face command to find-face-definition
so that this confusion would not happen.

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

end of thread, other threads:[~2005-01-07  2:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-06 15:49 VM and find-face Stephen Eglen
2005-01-06 21:42 ` Kyle Jones
2005-01-06 22:11   ` Miles Bader
2005-01-07  2:50 ` Richard Stallman

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