branch: scratch/editorconfig-cc
commit b70817d18dde84f9f2cde99646a7ac393a3d4b46
Author: 10sr <8slashes+...@gmail.com>
Commit: Stefan Monnier <monn...@iro.umontreal.ca>

    Catch error thrown from editorconfig-custom-hooks
    
    And show it as warning.
---
 editorconfig.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/editorconfig.el b/editorconfig.el
index 5370ab6510..e8a42003a3 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -333,7 +333,13 @@ applies available properties."
                (gethash 'end_of_line props)
                (gethash 'charset props))
               (editorconfig-set-line-length (gethash 'max_line_length props))
-              (run-hook-with-args 'editorconfig-custom-hooks props))))
+              (condition-case err
+                  (run-hook-with-args 'editorconfig-custom-hooks props)
+                (error
+                 (display-warning 'editorconfig-custom-hooks
+                                  (concat (error-message-string err)
+                                          ". Stop running hook.")
+                                  :warning))))))
       (error
        (display-warning 'editorconfig
                         (concat (error-message-string err)

Reply via email to