Re: efs-1.12 and archie.el

Andy Norman (ange@hplb.hpl.hp.com)
Thu, 22 Sep 1994 14:32:06 +0100


Jack writes:

> There seems to be some conflict between the dired in efs-1.12 and the
> archie.el I just sent out.

Actually, I think that part of the conflict is due to the fact that XEmacs
19.11 has real keymap objects and archie-deep-copy-keymap can't cope with
them.

The replacement function below may help some.

					-- ange -- <><

					ange@hplb.hpl.hp.com

--------------------------------------------------------------------------------
(defun archie-deep-copy-keymap (map)
  "Perform an arbitrarily deep copy of a keymap, so it may be changed
without affecting the original."
  (cond
   ((listp map)
    (let (m)
      (cond
       ((and (setq m (cdr-safe map))
	     (symbolp m))
	(cons (nth 0 map) m))
       ((and (setq m (cdr-safe m))
	  (symbolp m))
	(cons (nth 0 map) (cons (nth 1 map) m)))
       ((and (setq m (cdr-safe m))
	     (symbolp m))
	(cons (nth 0 map) (cons (nth 1 map) (cons (nth 2 map) m))))
       (t
	(mapcar 'archie-deep-copy-keymap map)))))

   ((or (symbolp map)			; 'keymap, menu handle, or
	(stringp map))			; menu name
    map)

   ((vectorp map)
    (nth 1 (copy-keymap (list 'keymap map))))

   ((keymapp map)			; ange -- catchall for XEmacs
    (copy-keymap map))))