unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* customize-face
@ 2002-04-25 11:16 Gerd Moellmann
  2002-04-25 12:12 ` customize-face Andreas Schwab
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Gerd Moellmann @ 2002-04-25 11:16 UTC (permalink / raw)


It just occurred to me, while I wanted to customize a face in Gnus
that I didn't know the name of---wouldn't it be convenient if
customize-face offered to customize the face at point, if that is a
named face (symbol)?

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

* Re: customize-face
  2002-04-25 11:16 customize-face Gerd Moellmann
@ 2002-04-25 12:12 ` Andreas Schwab
  2002-04-25 14:01 ` customize-face Edward O'Connor
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Andreas Schwab @ 2002-04-25 12:12 UTC (permalink / raw)
  Cc: emacs-devel

gerd.moellmann@t-online.de (Gerd Moellmann) writes:

|> It just occurred to me, while I wanted to customize a face in Gnus
|> that I didn't know the name of---wouldn't it be convenient if
|> customize-face offered to customize the face at point, if that is a
|> named face (symbol)?

You can get the name of the face with C-u C-x = .

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE GmbH, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: customize-face
  2002-04-25 11:16 customize-face Gerd Moellmann
  2002-04-25 12:12 ` customize-face Andreas Schwab
@ 2002-04-25 14:01 ` Edward O'Connor
  2002-04-25 15:05   ` customize-face Eli Zaretskii
  2002-04-26  3:19   ` customize-face Richard Stallman
  2002-04-25 14:40 ` customize-face Kai Großjohann
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 10+ messages in thread
From: Edward O'Connor @ 2002-04-25 14:01 UTC (permalink / raw)


> It just occurred to me, while I wanted to customize a face in
> Gnus that I didn't know the name of---wouldn't it be convenient
> if customize-face offered to customize the face at point, if
> that is a named face (symbol)?

Alex Schroeder's face-list.el provides `customize-face-at' and
`describe-face-at' for precisely this sort of situation. I find
them to be very useful, and bind them to C-c f c and C-c f d.

Speaking as a user, I would love it if the standard customize-face
provided such functionality. One less piece of third-party Emacs
Lisp to download. :)


Ted

-- 
Edward O'Connor
ted@oconnor.cx

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

* Re: customize-face
  2002-04-25 14:56 ` customize-face Eli Zaretskii
@ 2002-04-25 14:25   ` Gerd Moellmann
  0 siblings, 0 replies; 10+ messages in thread
From: Gerd Moellmann @ 2002-04-25 14:25 UTC (permalink / raw)
  Cc: emacs-devel

Eli Zaretskii <eliz@is.elta.co.il> writes:

> On 25 Apr 2002, Gerd Moellmann wrote:
> 
> > wouldn't it be convenient if
> > customize-face offered to customize the face at point, if that is a
> > named face (symbol)?
> 
> Yes.  I think something like that was discussed, and everybody agreed it 
> would be nice.

Thanks, Eli.  I've added such a feature.

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

* Re: customize-face
  2002-04-25 11:16 customize-face Gerd Moellmann
  2002-04-25 12:12 ` customize-face Andreas Schwab
  2002-04-25 14:01 ` customize-face Edward O'Connor
@ 2002-04-25 14:40 ` Kai Großjohann
  2002-04-25 14:56 ` customize-face Eli Zaretskii
  2002-04-26  3:18 ` customize-face Richard Stallman
  4 siblings, 0 replies; 10+ messages in thread
From: Kai Großjohann @ 2002-04-25 14:40 UTC (permalink / raw)
  Cc: emacs-devel

gerd.moellmann@t-online.de (Gerd Moellmann) writes:

> It just occurred to me, while I wanted to customize a face in Gnus
> that I didn't know the name of---wouldn't it be convenient if
> customize-face offered to customize the face at point, if that is a
> named face (symbol)?

Maybe the output of describe-text-at could contain buttons useful for
various things, including buttons to customize the faces.

kai
-- 
Silence is foo!

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

* Re: customize-face
  2002-04-25 11:16 customize-face Gerd Moellmann
                   ` (2 preceding siblings ...)
  2002-04-25 14:40 ` customize-face Kai Großjohann
@ 2002-04-25 14:56 ` Eli Zaretskii
  2002-04-25 14:25   ` customize-face Gerd Moellmann
  2002-04-26  3:18 ` customize-face Richard Stallman
  4 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2002-04-25 14:56 UTC (permalink / raw)
  Cc: emacs-devel


On 25 Apr 2002, Gerd Moellmann wrote:

> wouldn't it be convenient if
> customize-face offered to customize the face at point, if that is a
> named face (symbol)?

Yes.  I think something like that was discussed, and everybody agreed it 
would be nice.

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

* Re: customize-face
  2002-04-25 14:01 ` customize-face Edward O'Connor
@ 2002-04-25 15:05   ` Eli Zaretskii
  2002-04-26  3:19   ` customize-face Richard Stallman
  1 sibling, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2002-04-25 15:05 UTC (permalink / raw)
  Cc: emacs-devel


On Thu, 25 Apr 2002, Edward O'Connor wrote:

> Alex Schroeder's face-list.el provides `customize-face-at' and
> `describe-face-at' for precisely this sort of situation. I find
> them to be very useful, and bind them to C-c f c and C-c f d.

What we need, IMHO, is some feature that will suggest such customization, 
perhaps in a tooltip, so that users won't need to know about special 
commands such as those you mention above.  (To say nothing of the fact 
that face-list is not part of Emacs, IIRC.)

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

* Re: customize-face
  2002-04-25 11:16 customize-face Gerd Moellmann
                   ` (3 preceding siblings ...)
  2002-04-25 14:56 ` customize-face Eli Zaretskii
@ 2002-04-26  3:18 ` Richard Stallman
  4 siblings, 0 replies; 10+ messages in thread
From: Richard Stallman @ 2002-04-26  3:18 UTC (permalink / raw)
  Cc: emacs-devel

    It just occurred to me, while I wanted to customize a face in Gnus
    that I didn't know the name of---wouldn't it be convenient if
    customize-face offered to customize the face at point, if that is a
    named face (symbol)?

It sounds like a good idea.  It could do this if you input the null string.

If there is more than one face on the given character, it could put
all those faces together in the customization buffer.

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

* Re: customize-face
  2002-04-25 14:01 ` customize-face Edward O'Connor
  2002-04-25 15:05   ` customize-face Eli Zaretskii
@ 2002-04-26  3:19   ` Richard Stallman
  2002-04-26 15:33     ` customize-face Alex Schroeder
  1 sibling, 1 reply; 10+ messages in thread
From: Richard Stallman @ 2002-04-26  3:19 UTC (permalink / raw)
  Cc: emacs-devel

    Alex Schroeder's face-list.el provides `customize-face-at' and
    `describe-face-at' for precisely this sort of situation. I find
    them to be very useful, and bind them to C-c f c and C-c f d.

Could you send me this code, and his email address?

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

* Re: customize-face
  2002-04-26  3:19   ` customize-face Richard Stallman
@ 2002-04-26 15:33     ` Alex Schroeder
  0 siblings, 0 replies; 10+ messages in thread
From: Alex Schroeder @ 2002-04-26 15:33 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:

>     Alex Schroeder's face-list.el provides `customize-face-at' and
>     `describe-face-at' for precisely this sort of situation. I find
>     them to be very useful, and bind them to C-c f c and C-c f d.
>
> Could you send me this code, and his email address?

;;; face-list.el --- convenience functions for face customization

;; Copyright (C) 2000  Alex Schroeder <alex@gnu.org>

;; Author: Alex Schroeder <alex@gnu.org>
;; Maintainer: Alex Schroeder <alex@gnu.org>
;; Version: 1.0.0
;; Keywords: faces

;; This file is not part of GNU Emacs.

;; This is free software; you can redistribute it and/or modify it under
;; the terms of the GNU General Public License as published by the Free
;; Software Foundation; either version 2, or (at your option) any later
;; version.

;; This is distributed in the hope that it will be useful, but WITHOUT
;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
;; FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
;; for more details.

;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING.  If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
;; MA 02111-1307, USA.

;;; Commentary:

;; This code allows you to browse the list of defined faces and to
;; quickly call a face customization buffer for the face at point,
;; thereby facilitating the job of a color theme author.

;; Loading this code will advise `list-faces-display' to put the *Faces*
;; buffer into `faces-list-mode'.  That modes provides two extra key
;; bindings; one of them calls `face-describe' for the face at point,
;; the other calls `customize-face' for the face at point.

;; The two functions to describe and customize the face at point can be
;; called from anywhere; they are `describe-face-at' and
;; `customize-face-at'.  If you are working with Emacs and discover a
;; face you don't like, put point on some text with the offending face
;; and type M-x customize-face-at RET.

\f

;;; Code:

(defadvice list-faces-display (after do-faces-list-mode activate)
  "Start faces-list-mode after listing the faces."
  (set-buffer (get-buffer "*Faces*"))
  (faces-list-mode))

(defun faces-list-mode ()
  "Major mode to examine and modify faces.

Use \\[describe-face-at] to describe the face at point.
Use \\[customize-face-at] to customize the face at point."
  (kill-all-local-variables)
  (setq major-mode 'faces-list-mode)
  (setq mode-name "Faces")
  (use-local-map faces-list-mode-map)
  (setq buffer-read-only t))

(defvar faces-list-mode-map
  (let ((map (make-sparse-keymap)))
    (define-key map (kbd "e") 'customize-face-at)
    (define-key map (kbd "RET") 'customize-face-at)
    (define-key map (kbd "d") 'describe-face-at)
    (define-key map (kbd "?") 'describe-face-at)
    (define-key map (kbd "q") 'bury-buffer)
    map)
  "Mode map used for `faces-list-mode'.")

(defun describe-face-at ()
  "Describe face at point."
  (interactive)
  (describe-face (get-face-at)))

(defun customize-face-at ()
  "Customize face at point."
  (interactive)
  (customize-face (get-face-at)))

(defun get-face-at ()
  "Determine face at point using `get-char-property'.  
If char at point has no face property, examine the text on the same line
as point as well."
  (let ((face (get-char-property (point) 'face)))
    (unless face
      (let ((start (point)))
	(while (null (or (setq face (get-char-property (point) 'face))
			 (eolp)))
	  (forward-char 1))))
    (unless face
      (let ((start (point)))
	(while (null (or (setq face (get-char-property (point) 'face))
			 (bolp)))
	  (forward-char -1))))
    (unless face
	(error "No face selected."))
    (if (listp face)
	(setq face (car face)))
    face))

(provide 'face-list)

;;; face-list.el ends here

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

end of thread, other threads:[~2002-04-26 15:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-25 11:16 customize-face Gerd Moellmann
2002-04-25 12:12 ` customize-face Andreas Schwab
2002-04-25 14:01 ` customize-face Edward O'Connor
2002-04-25 15:05   ` customize-face Eli Zaretskii
2002-04-26  3:19   ` customize-face Richard Stallman
2002-04-26 15:33     ` customize-face Alex Schroeder
2002-04-25 14:40 ` customize-face Kai Großjohann
2002-04-25 14:56 ` customize-face Eli Zaretskii
2002-04-25 14:25   ` customize-face Gerd Moellmann
2002-04-26  3:18 ` customize-face 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).