Permalink
Browse files

Ensure that advice never gives errors

Since this advice is attached to important emacs functions, it should
prefer to just do nothing rather than throw an error.
  • Loading branch information...
1 parent 655bece commit 4593f662c563b36dc9806855386dc33a356573d7 @DarwinAwardWinner committed Jan 23, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 smex.el
View
@@ -495,8 +495,9 @@ sorted by frequency of use."
(mapcar (lambda (fun)
`(defadvice ,fun (after smex-update activate)
"Run smex-update upon completion"
- (when (bound-and-true-p 'smex-auto-update)
- (smex-update-if-needed))))
+ (ignore-errors
+ (when (bound-and-true-p smex-auto-update)
+ (smex-update-if-needed)))))
;; Defining advice on `eval' causes infinite recursion, so
;; don't allow that.
(delete-if (apply-partially 'equal 'eval)

0 comments on commit 4593f66

Please sign in to comment.