diff --git a/CHANGES.md b/CHANGES.md index 9c32266da4..a797ba5ceb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,6 +13,7 @@ unreleased and bind C-c M-d and C-c | instead to `merlin-destruct`; bind C-u C-c C-t to `merlin-type-expr`. See also + - emacs: remove use of obsolete `defadvice` macro (#1675) merlin 4.10 ========== diff --git a/emacs/merlin.el b/emacs/merlin.el index e1419a8fe6..c13fac943a 100644 --- a/emacs/merlin.el +++ b/emacs/merlin.el @@ -192,7 +192,7 @@ a new window or not." (defcustom merlin-logfile nil "If non-nil, use this file for the log file (should be an absolute path)." - :group 'merlin :type 'filename) + :group 'merlin :type 'file) (defcustom merlin-arrow-keys-type-enclosing t "If non-nil, after a type enclosing, C-up and C-down are used @@ -807,12 +807,12 @@ If there is no error, do nothing." (setq err (merlin--error-at-position point errors)) (if err (cons point err) nil))) -(defun merlin--after-save () +(defun merlin--after-save (&optional _) (when (and merlin-mode merlin-error-after-save) (merlin-error-check))) -(defadvice basic-save-buffer (after merlin--after-save activate) - "The save hook is called only if buffer was modified, but user might want fresh errors anyway" - (merlin--after-save)) +; The save hook is called only if buffer was modified, +; but user might want fresh errors anyway +(advice-add 'basic-save-buffer :after #'merlin--after-save) (defun merlin-error-prev (&optional group) "Jump back to previous error."