I'm using this code on Xubuntu (emacs 24.5.1) but it throw error on windows (emacs 25.0.50.1 64bit)
(defun 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)))))
(global-set-key [s-left] (ignore-error-wrapper 'windmove-left))
(global-set-key [s-right] (ignore-error-wrapper 'windmove-right))
(global-set-key [s-up] (ignore-error-wrapper 'windmove-up))
(global-set-key [s-down] (ignore-error-wrapper 'windmove-down))
lexical-let
without first requiringcl
(which is the package that exportslexical-let
).