comparison lisp/packages/pending-del.el @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents 56c54cf7c5b6
children 1370575f1259
comparison
equal deleted inserted replaced
69:804d1389bcd6 70:131b0175ea99
46 (extent-end-position zmacs-region-extent))) 46 (extent-end-position zmacs-region-extent)))
47 (zmacs-deactivate-region) 47 (zmacs-deactivate-region)
48 t))) 48 t)))
49 49
50 (defun pending-delete-pre-hook () 50 (defun pending-delete-pre-hook ()
51 ;; don't ever signal an error in pre-command-hook! 51 (let ((type (and (symbolp this-command)
52 (condition-case e 52 (get this-command 'pending-delete))))
53 (let ((type (and (symbolp this-command) 53 (cond ((eq type 'kill)
54 (get this-command 'pending-delete)))) 54 (delete-active-region t))
55 (cond ((eq type 'kill) 55 ((eq type 'supersede)
56 (delete-active-region t)) 56 (if (delete-active-region ())
57 ((eq type 'supersede) 57 (setq this-command '(lambda () (interactive)))))
58 (if (delete-active-region ()) 58 (type
59 (setq this-command '(lambda () (interactive))))) 59 (delete-active-region ())))))
60 (type
61 (delete-active-region ()))))
62 (error
63 (warn "Error caught in `pending-delete-pre-hook': %s" e))))
64 60
65 (put 'self-insert-command 'pending-delete t) 61 (put 'self-insert-command 'pending-delete t)
66 62
67 (put 'yank 'pending-delete t) 63 (put 'yank 'pending-delete t)
68 (put 'x-yank-clipboard-selection 'pending-delete t) 64 (put 'x-yank-clipboard-selection 'pending-delete t)