Add siren-ignore-error-wrapper as core function of siren

This commit is contained in:
2018-05-20 17:21:22 +01:00
parent e1f1adfea8
commit 3b07c4cfbf

View File

@@ -68,5 +68,13 @@ Borrowed from: http://emacsredux.com/blog/2013/05/04/rename-file-and-buffer/"
(set-visited-file-name new-name)
(set-buffer-modified-p nil)))))))
(defun siren-ignore-error-wrapper (fn)
"Funtion return new function that ignore errors.
The function wraps a function with `ignore-errors' macro."
(lexical-let ((fn fn))
(lambda ()
(interactive)
(ignore-errors (funcall fn)))))
(provide 'siren-core)
;;; siren-core.el ends here