emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/facemenu.el


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/facemenu.el
Date: Fri, 04 Apr 2003 01:22:07 -0500

Index: emacs/lisp/facemenu.el
diff -c emacs/lisp/facemenu.el:1.69 emacs/lisp/facemenu.el:1.70
*** emacs/lisp/facemenu.el:1.69 Sun Jul  7 21:21:41 2002
--- emacs/lisp/facemenu.el      Tue Feb  4 06:18:37 2003
***************
*** 38,44 ****
  ;; insertion.  It will be forgotten if you move point or make other
  ;; modifications before inserting or typing anything.
  ;;
! ;; Faces can be selected from the keyboard as well.  
  ;; The standard keybindings are M-g (or ESC g) + letter:
  ;; M-g i = "set italic",  M-g b = "set bold", etc.
  
--- 38,44 ----
  ;; insertion.  It will be forgotten if you move point or make other
  ;; modifications before inserting or typing anything.
  ;;
! ;; Faces can be selected from the keyboard as well.
  ;; The standard keybindings are M-g (or ESC g) + letter:
  ;; M-g i = "set italic",  M-g b = "set bold", etc.
  
***************
*** 86,99 ****
  
  ;;; Code:
  
! (eval-when-compile 
    (require 'help)
    (require 'button))
  
  ;;; Provide some binding for startup:
  ;;;###autoload (define-key global-map "\M-g" 'facemenu-keymap)
  ;;;###autoload (autoload 'facemenu-keymap "facemenu" "Keymap for 
face-changing commands." t 'keymap)
!   
  ;; Global bindings:
  (define-key global-map [C-down-mouse-2] 'facemenu-menu)
  (define-key global-map "\M-g" 'facemenu-keymap)
--- 86,99 ----
  
  ;;; Code:
  
! (eval-when-compile
    (require 'help)
    (require 'button))
  
  ;;; Provide some binding for startup:
  ;;;###autoload (define-key global-map "\M-g" 'facemenu-keymap)
  ;;;###autoload (autoload 'facemenu-keymap "facemenu" "Keymap for 
face-changing commands." t 'keymap)
! 
  ;; Global bindings:
  (define-key global-map [C-down-mouse-2] 'facemenu-menu)
  (define-key global-map "\M-g" 'facemenu-keymap)
***************
*** 116,122 ****
  
  The faces specifically mentioned in this list are put at the top of
  the menu, in the order specified.  All other faces which are defined,
! except for those in `facemenu-unlisted-faces', are listed after them, 
  but get no keyboard equivalents.
  
  If you change this variable after loading facemenu.el, you will need to call
--- 116,122 ----
  
  The faces specifically mentioned in this list are put at the top of
  the menu, in the order specified.  All other faces which are defined,
! except for those in `facemenu-unlisted-faces', are listed after them,
  but get no keyboard equivalents.
  
  If you change this variable after loading facemenu.el, you will need to call
***************
*** 164,170 ****
  (defalias 'facemenu-face-menu facemenu-face-menu)
  
  ;;;###autoload
! (defvar facemenu-foreground-menu 
    (let ((map (make-sparse-keymap "Foreground Color")))
      (define-key map "o" (cons "Other..." 'facemenu-set-foreground))
      map)
--- 164,170 ----
  (defalias 'facemenu-face-menu facemenu-face-menu)
  
  ;;;###autoload
! (defvar facemenu-foreground-menu
    (let ((map (make-sparse-keymap "Foreground Color")))
      (define-key map "o" (cons "Other..." 'facemenu-set-foreground))
      map)
***************
*** 182,188 ****
  (defalias 'facemenu-background-menu facemenu-background-menu)
  
  ;;;###autoload
! (defvar facemenu-special-menu 
    (let ((map (make-sparse-keymap "Special")))
      (define-key map [?s] (cons (purecopy "Remove Special")
                               'facemenu-remove-special))
--- 182,188 ----
  (defalias 'facemenu-background-menu facemenu-background-menu)
  
  ;;;###autoload
! (defvar facemenu-special-menu
    (let ((map (make-sparse-keymap "Special")))
      (define-key map [?s] (cons (purecopy "Remove Special")
                               'facemenu-remove-special))
***************
*** 213,219 ****
  ;;;###autoload
  (defvar facemenu-indentation-menu
    (let ((map (make-sparse-keymap "Indentation")))
!     (define-key map [decrease-right-margin] 
        (cons (purecopy "Indent Right Less") 'decrease-right-margin))
      (define-key map [increase-right-margin]
        (cons (purecopy "Indent Right More") 'increase-right-margin))
--- 213,219 ----
  ;;;###autoload
  (defvar facemenu-indentation-menu
    (let ((map (make-sparse-keymap "Indentation")))
!     (define-key map [decrease-right-margin]
        (cons (purecopy "Indent Right Less") 'decrease-right-margin))
      (define-key map [increase-right-margin]
        (cons (purecopy "Indent Right More") 'increase-right-margin))
***************
*** 245,267 ****
    (define-key map [s1] (list (purecopy "--"))))
  ;;;###autoload
  (let ((map facemenu-menu))
!   (define-key map [in] (cons (purecopy "Indentation") 
                             'facemenu-indentation-menu))
    (define-key map [ju] (cons (purecopy "Justification")
                             'facemenu-justification-menu))
    (define-key map [s2] (list (purecopy "--")))
!   (define-key map [sp] (cons (purecopy "Special Properties") 
                             'facemenu-special-menu))
!   (define-key map [bg] (cons (purecopy "Background Color") 
                             'facemenu-background-menu))
!   (define-key map [fg] (cons (purecopy "Foreground Color") 
                             'facemenu-foreground-menu))
!   (define-key map [fc] (cons (purecopy "Face") 
                             'facemenu-face-menu)))
  ;;;###autoload
  (defalias 'facemenu-menu facemenu-menu)
  
! (defvar facemenu-keymap 
    (let ((map (make-sparse-keymap "Set face")))
      (define-key map "o" (cons (purecopy "Other...") 'facemenu-set-face))
      map)
--- 245,267 ----
    (define-key map [s1] (list (purecopy "--"))))
  ;;;###autoload
  (let ((map facemenu-menu))
!   (define-key map [in] (cons (purecopy "Indentation")
                             'facemenu-indentation-menu))
    (define-key map [ju] (cons (purecopy "Justification")
                             'facemenu-justification-menu))
    (define-key map [s2] (list (purecopy "--")))
!   (define-key map [sp] (cons (purecopy "Special Properties")
                             'facemenu-special-menu))
!   (define-key map [bg] (cons (purecopy "Background Color")
                             'facemenu-background-menu))
!   (define-key map [fg] (cons (purecopy "Foreground Color")
                             'facemenu-foreground-menu))
!   (define-key map [fc] (cons (purecopy "Face")
                             'facemenu-face-menu)))
  ;;;###autoload
  (defalias 'facemenu-menu facemenu-menu)
  
! (defvar facemenu-keymap
    (let ((map (make-sparse-keymap "Set face")))
      (define-key map "o" (cons (purecopy "Other...") 'facemenu-set-face))
      map)
***************
*** 328,334 ****
  
  Otherwise, this command specifies the face for the next character
  inserted.  Moving point or switching buffers before
! typing a character to insert cancels the specification." 
    (interactive (list (progn
                       (barf-if-buffer-read-only)
                       (read-face-name "Use face"))
--- 328,334 ----
  
  Otherwise, this command specifies the face for the next character
  inserted.  Moving point or switching buffers before
! typing a character to insert cancels the specification."
    (interactive (list (progn
                       (barf-if-buffer-read-only)
                       (read-face-name "Use face"))
***************
*** 350,356 ****
  
  Otherwise, this command specifies the face for the next character
  inserted.  Moving point or switching buffers before
! typing a character to insert cancels the specification." 
    (interactive (list (progn
                       (barf-if-buffer-read-only)
                       (facemenu-read-color "Foreground color: "))
--- 350,356 ----
  
  Otherwise, this command specifies the face for the next character
  inserted.  Moving point or switching buffers before
! typing a character to insert cancels the specification."
    (interactive (list (progn
                       (barf-if-buffer-read-only)
                       (facemenu-read-color "Foreground color: "))
***************
*** 374,380 ****
  
  Otherwise, this command specifies the face for the next character
  inserted.  Moving point or switching buffers before
! typing a character to insert cancels the specification." 
    (interactive (list (progn
                       (barf-if-buffer-read-only)
                       (facemenu-read-color "Background color: "))
--- 374,380 ----
  
  Otherwise, this command specifies the face for the next character
  inserted.  Moving point or switching buffers before
! typing a character to insert cancels the specification."
    (interactive (list (progn
                       (barf-if-buffer-read-only)
                       (facemenu-read-color "Background color: "))
***************
*** 399,405 ****
  
  Otherwise, this command specifies the face for the next character
  inserted.  Moving point or switching buffers before
! typing a character to insert cancels the specification." 
    (interactive (list last-command-event
                     (if (and mark-active (not current-prefix-arg))
                         (region-beginning))
--- 399,405 ----
  
  Otherwise, this command specifies the face for the next character
  inserted.  Moving point or switching buffers before
! typing a character to insert cancels the specification."
    (interactive (list last-command-event
                     (if (and mark-active (not current-prefix-arg))
                         (region-beginning))
***************
*** 407,413 ****
                         (region-end))))
    (barf-if-buffer-read-only)
    (facemenu-get-face face)
!   (if start 
        (facemenu-add-face face start end)
      (facemenu-add-face face)))
  
--- 407,413 ----
                         (region-end))))
    (barf-if-buffer-read-only)
    (facemenu-get-face face)
!   (if start
        (facemenu-add-face face start end)
      (facemenu-add-face face)))
  
***************
*** 440,446 ****
    "Remove `face' and `mouse-face' text properties."
    (interactive "*r") ; error if buffer is read-only despite the next line.
    (let ((inhibit-read-only t))
!     (remove-text-properties 
       start end '(face nil mouse-face nil))))
  
  ;;;###autoload
--- 440,446 ----
    "Remove `face' and `mouse-face' text properties."
    (interactive "*r") ; error if buffer is read-only despite the next line.
    (let ((inhibit-read-only t))
!     (remove-text-properties
       start end '(face nil mouse-face nil))))
  
  ;;;###autoload
***************
*** 456,468 ****
  These special properties include `invisible', `intangible' and `read-only'."
    (interactive "*r") ; error if buffer is read-only despite the next line.
    (let ((inhibit-read-only t))
!     (remove-text-properties 
       start end '(invisible nil intangible nil read-only nil))))
  
  ;;;###autoload
  (defun facemenu-read-color (&optional prompt)
    "Read a color using the minibuffer."
!   (let ((col (completing-read (or prompt "Color: ") 
                              (or facemenu-color-alist
                                  (defined-colors))
                              nil t)))
--- 456,468 ----
  These special properties include `invisible', `intangible' and `read-only'."
    (interactive "*r") ; error if buffer is read-only despite the next line.
    (let ((inhibit-read-only t))
!     (remove-text-properties
       start end '(invisible nil intangible nil read-only nil))))
  
  ;;;###autoload
  (defun facemenu-read-color (&optional prompt)
    "Read a color using the minibuffer."
!   (let ((col (completing-read (or prompt "Color: ")
                              (or facemenu-color-alist
                                  (defined-colors))
                              nil t)))
***************
*** 498,508 ****
          (setq s (point))
          (insert (car list))
          (indent-to 20)
!         (put-text-property s (point) 'face 
                             (cons 'background-color (car list)))
          (setq s (point))
          (insert "  " (car list) "\n")
!         (put-text-property s (point) 'face 
                             (cons 'foreground-color (car list)))
          (setq list (cdr list)))))))
  
--- 498,508 ----
          (setq s (point))
          (insert (car list))
          (indent-to 20)
!         (put-text-property s (point) 'face
                             (cons 'background-color (car list)))
          (setq s (point))
          (insert "  " (car list) "\n")
!         (put-text-property s (point) 'face
                             (cons 'foreground-color (car list)))
          (setq list (cdr list)))))))
  
***************
*** 652,658 ****
           (define-key 'facemenu-keymap key (cons name function))
           (define-key menu key (cons name function)))
          ((facemenu-iterate ; check if equivalent face is already in the menu
!           (lambda (m) (and (listp m) 
                             (symbolp (car m))
                             (face-equal (car m) symbol)))
            (cdr (symbol-function menu))))
--- 652,658 ----
           (define-key 'facemenu-keymap key (cons name function))
           (define-key menu key (cons name function)))
          ((facemenu-iterate ; check if equivalent face is already in the menu
!           (lambda (m) (and (listp m)
                             (symbolp (car m))
                             (face-equal (car m) symbol)))
            (cdr (symbol-function menu))))
***************
*** 693,699 ****
                 (format "Select background color %s for subsequent insertion."
                         name))))
      (cond ((facemenu-iterate ; check if equivalent face is already in the menu
!           (lambda (m) (and (listp m) 
                             (symbolp (car m))
                             (stringp (cadr m))
                             (string-equal (cadr m) color)))
--- 693,699 ----
                 (format "Select background color %s for subsequent insertion."
                         name))))
      (cond ((facemenu-iterate ; check if equivalent face is already in the menu
!           (lambda (m) (and (listp m)
                             (symbolp (car m))
                             (stringp (cadr m))
                             (string-equal (cadr m) color)))
***************
*** 711,723 ****
  
  (defun facemenu-complete-face-list (&optional oldlist)
    "Return list of all faces that look different.
! Starts with given ALIST of faces, and adds elements only if they display 
  differently from any face already on the list.
! The faces on ALIST will end up at the end of the returned list, in reverse 
  order."
    (let ((list (nreverse (mapcar 'car oldlist))))
!     (facemenu-iterate 
!      (lambda (new-face) 
         (if (not (memq new-face list))
           (setq list (cons new-face list)))
         nil)
--- 711,723 ----
  
  (defun facemenu-complete-face-list (&optional oldlist)
    "Return list of all faces that look different.
! Starts with given ALIST of faces, and adds elements only if they display
  differently from any face already on the list.
! The faces on ALIST will end up at the end of the returned list, in reverse
  order."
    (let ((list (nreverse (mapcar 'car oldlist))))
!     (facemenu-iterate
!      (lambda (new-face)
         (if (not (memq new-face list))
           (setq list (cons new-face list)))
         nil)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]