Skip to content

Commit

Permalink
Change hook name -custom-hooks -> -after-apply-functions
Browse files Browse the repository at this point in the history
With obsolete-variable-alias
  • Loading branch information
10sr committed Oct 19, 2018
1 parent c3be907 commit bb4bc44
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions editorconfig.el
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ when `editorconfig-mode' is enabled."
:type 'string
:group 'editorconfig)

(defcustom editorconfig-custom-hooks ()
"A list of custom hooks after loading common EditorConfig settings.
(defcustom editorconfig-after-apply-functions ()
"A list of functions after loading common EditorConfig settings.
Each element in this list is a hook function. This hook function
takes one parameter, which is a property hash table. The value
Expand All @@ -104,7 +104,7 @@ whatever functionality you want. For example, the following is
an example to add a new property emacs_linum to decide whether to
show line numbers on the left:
(add-hook 'editorconfig-custom-hooks
(add-hook 'editorconfig-after-apply-functions
'(lambda (props)
(let ((show-line-num (gethash 'emacs_linum props)))
(cond ((equal show-line-num \"true\") (linum-mode 1))
Expand All @@ -113,8 +113,12 @@ show line numbers on the left:
:group 'editorconfig)
(define-obsolete-variable-alias
'edconf-custom-hooks
'editorconfig-custom-hooks
'editorconfig-after-apply-functions
"0.5")
(define-obsolete-variable-alias
'editorconfig-custom-hooks
'editorconfig-after-apply-functions
"0.7.13")

(defcustom editorconfig-indentation-alist
;; For contributors: Sort modes in alphabetical order, please :)
Expand Down Expand Up @@ -606,9 +610,9 @@ applies available properties."
(editorconfig-set-major-mode-from-name (gethash 'file_type_emacs props))
(editorconfig-set-major-mode-from-ext (gethash 'file_type_ext props))
(condition-case err
(run-hook-with-args 'editorconfig-custom-hooks props)
(run-hook-with-args 'editorconfig-after-apply-functions props)
(error
(display-warning 'editorconfig-custom-hooks
(display-warning 'editorconfig-after-apply-functions
(concat (error-message-string err)
". Stop running hook.")
:warning))))))
Expand Down

0 comments on commit bb4bc44

Please sign in to comment.