Mercurial > hg > xemacs-beta
diff lisp/packages/pending-del.el @ 48:56c54cf7c5b6 r19-16b90
Import from CVS: tag r19-16b90
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:56:04 +0200 |
parents | 0293115a14e9 |
children | 131b0175ea99 |
line wrap: on
line diff
--- a/lisp/packages/pending-del.el Mon Aug 13 08:55:32 2007 +0200 +++ b/lisp/packages/pending-del.el Mon Aug 13 08:56:04 2007 +0200 @@ -48,15 +48,19 @@ t))) (defun pending-delete-pre-hook () - (let ((type (and (symbolp this-command) - (get this-command 'pending-delete)))) - (cond ((eq type 'kill) - (delete-active-region t)) - ((eq type 'supersede) - (if (delete-active-region ()) - (setq this-command '(lambda () (interactive))))) - (type - (delete-active-region ()))))) + ;; don't ever signal an error in pre-command-hook! + (condition-case e + (let ((type (and (symbolp this-command) + (get this-command 'pending-delete)))) + (cond ((eq type 'kill) + (delete-active-region t)) + ((eq type 'supersede) + (if (delete-active-region ()) + (setq this-command '(lambda () (interactive))))) + (type + (delete-active-region ())))) + (error + (warn "Error caught in `pending-delete-pre-hook': %s" e)))) (put 'self-insert-command 'pending-delete t)