Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/sml-mode/sml-util.el
ViewVC logotype

Diff of /sml/trunk/sml-mode/sml-util.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 340, Fri Jun 18 05:32:46 1999 UTC revision 341, Fri Jun 18 19:10:12 1999 UTC
# Line 96  Line 96 
96  ;; defmap ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  ;; defmap ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
98  (defun custom-create-map (m bs args)  (defun custom-create-map (m bs args)
99      (let (inherit dense)
100        (while args
101          (let ((key (first args))
102                (val (second args)))
103            (cond
104             ((eq key :dense) (setq dense val))
105             ((eq key :inherit) (setq inherit val))
106             (t (message "Uknown argument %s in defmap" key))))
107          (setq args (cddr args)))
108    (unless (keymapp m)    (unless (keymapp m)
109      (setq bs (append m bs))      (setq bs (append m bs))
110      (setq m (make-sparse-keymap)))        (setq m (if dense (make-keymap) (make-sparse-keymap))))
111    (dolist (b bs)    (dolist (b bs)
112      (let ((key (car b))      (let ((key (car b))
113            (binding (cdr b)))            (binding (cdr b)))
# Line 107  Line 116 
116          (substitute-key-definition key binding m global-map))          (substitute-key-definition key binding m global-map))
117         ((let ((o (lookup-key m key))) (or (null o) (numberp o)))         ((let ((o (lookup-key m key))) (or (null o) (numberp o)))
118          (define-key m key binding)))))          (define-key m key binding)))))
   (while args  
     (let ((key (first args))  
           (val (second args)))  
119        (cond        (cond
120         ((eq key :inherit)       ((keymapp inherit) (set-keymap-parent m inherit))
121          (cond       ((consp inherit) (set-keymap-parents m inherit)))
122           ((keymapp val) (set-keymap-parent m val))      m))
          (t (set-keymap-parents m val))))  
        (t (error "Uknown argument %s in defmap" key))))  
     (setq args (cddr args)))  
124  (defmacro defmap (m bs doc &rest args)  (defmacro defmap (m bs doc &rest args)
125    `(defconst ,m    `(defconst ,m

Removed from v.340  
changed lines
  Added in v.341

ViewVC Help
Powered by ViewVC 1.0.0