diff --git a/lisp/org-compat.el b/lisp/org-compat.el index 57d9574a7..1ab39def1 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -556,6 +556,16 @@ Implements `file-equal-p' for older emacsen and XEmacs." `(org-unmodified ,@body))) (def-edebug-spec org-with-silent-modifications (body)) +;; Remove this when support for Emacs < 24.4 is dropped. +(defun org-define-error (name message) + "Define NAME as a new error signal. +MESSAGE is a string that will be output to the echo area if such +an error is signaled without being caught by a `condition-case'. +Implements `define-error' for older emacsen." + (if (fboundp 'define-error) (define-error name message) + (put name 'error-conditions + (copy-sequence (cons name (get 'error 'error-conditions)))))) + (provide 'org-compat) ;;; org-compat.el ends here diff --git a/lisp/ox.el b/lisp/ox.el index 80cbc375c..5f1611849 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -4044,11 +4044,7 @@ meant to be translated with `org-export-data' or alike." ;; `org-export-data' for further processing, depending on ;; `org-export-with-broken-links' value. -;; FIXME: Remove this when support for Emacsen < 24.4 is dropped. -(if (fboundp 'define-error) - (define-error 'org-link-broken "Unable to resolve link; aborting") - (put 'org-link-broken 'error-conditions - (copy-sequence (cons 'org-link-broken (get 'error 'error-conditions))))) +(org-define-error 'org-link-broken "Unable to resolve link; aborting") (defun org-export-custom-protocol-maybe (link desc backend) "Try exporting LINK with a dedicated function.