branch: externals/ebdb commit 65247f6daa9b0a331f70b81262193787e1a55ad8 Author: Eric Abrahamsen <e...@ericabrahamsen.net> Commit: Eric Abrahamsen <e...@ericabrahamsen.net>
Make csv-mode dependency optional * ebdb-format.el (ebdb-formatter-csv): Declare function and check it exists. --- ebdb-format.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ebdb-format.el b/ebdb-format.el index 8de3f1a..678c106 100644 --- a/ebdb-format.el +++ b/ebdb-format.el @@ -49,6 +49,8 @@ (require 'ebdb) +(declare-function csv-mode "ext:csv-mode") + (defcustom ebdb-format-buffer-name "*EBDB Format*" "Default name of buffer in which to display formatted records." :type 'string @@ -482,7 +484,9 @@ multiple instances in a single alist." (defclass ebdb-formatter-csv (ebdb-formatter-tabular) ((record-separator :initform "\n") (field-separator :initform ",") - (post-format-function :initform #'csv-mode))) + (post-format-function :initform (lambda () + (when (fboundp 'csv-mode) + (csv-mode)))))) (cl-defmethod ebdb-fmt-field ((fmt ebdb-formatter-csv) (_field ebdb-field)