summaryrefslogtreecommitdiff
path: root/lisp/facemenu.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-02-13 16:56:19 +0000
committerRichard M. Stallman <rms@gnu.org>1995-02-13 16:56:19 +0000
commit7fce8c916f2482523c3aa6a74b86ce5ad8b808eb (patch)
treed116f64a4913a6e0a8591dd088b1c15d2cb4e250 /lisp/facemenu.el
parent189fad68dd3b54a083a2e65912d2c9c59a073bb0 (diff)
downloademacs-7fce8c916f2482523c3aa6a74b86ce5ad8b808eb.tar.gz
(facemenu-next): Variable deleted.
(facemenu-self-insert-face): New function. (facemenu-set-face): Use facemenu-self-insert-face. (facemenu-set-face-from-menu): Likewise. (facemenu-after-change): Function deleted. Don't use it as hook.
Diffstat (limited to 'lisp/facemenu.el')
-rw-r--r--lisp/facemenu.el23
1 files changed, 6 insertions, 17 deletions
diff --git a/lisp/facemenu.el b/lisp/facemenu.el
index 831e3a3f81c..706cf49d39f 100644
--- a/lisp/facemenu.el
+++ b/lisp/facemenu.el
@@ -216,7 +216,6 @@ requested in `facemenu-keybindings'.")
"Alist of colors, used for completion.
If null, `facemenu-read-color' will set it.")
-(defvar facemenu-next nil) ; set when we are going to set a face on next char.
(defvar facemenu-loc nil)
(defun facemenu-update ()
@@ -252,8 +251,7 @@ typing a character cancels the request."
(let ((start (or start (region-beginning)))
(end (or end (region-end))))
(facemenu-add-face face start end))
- (setq facemenu-next face
- facemenu-loc (point))))
+ (facemenu-self-insert-face face)))
;;;###autoload
(defun facemenu-set-foreground (color &optional start end)
@@ -301,7 +299,11 @@ typing a character cancels the request."
(facemenu-get-face face)
(if start
(facemenu-add-face face start end)
- (setq facemenu-next face facemenu-loc (point))))
+ (facemenu-self-insert-face face)))
+
+(defun facemenu-self-insert-face (face)
+ (setq self-insert-face face
+ self-insert-face-command this-command))
(defun facemenu-set-invisible (start end)
"Make the region invisible.
@@ -489,18 +491,6 @@ Automatically called when a new face is created."
(define-key menu key (cons name function))))))
nil) ; Return nil for facemenu-iterate
-(defun facemenu-after-change (begin end old-length)
- "May set the face of just-inserted text to user's request.
-This only happens if the change is an insertion, and
-`facemenu-set-face[-from-menu]' was called with point at the
-beginning of the insertion."
- (if (null facemenu-next) ; exit immediately if no work
- nil
- (if (and (= 0 old-length) ; insertion
- (= facemenu-loc begin)) ; point wasn't moved in between
- (facemenu-add-face facemenu-next begin end))
- (setq facemenu-next nil)))
-
(defun facemenu-complete-face-list (&optional oldlist)
"Return list of all faces that are look different.
Starts with given ALIST of faces, and adds elements only if they display
@@ -524,6 +514,5 @@ Returns the non-nil value it found, or nil if all were nil."
(car iterate-list))
(facemenu-update)
-(add-hook 'after-change-functions 'facemenu-after-change)
;;; facemenu.el ends here