;; changes.
;;; Code:
+;; A little compatibility insurance
+(globally-declare-fboundp
+ '(mapfam dllist-car dllist-lrotate dllist-rrotate))
+
+(defvar emoney-emacs-is-sexy-enough (and (featurep 'dllist)
+ (fboundp #'mapfam))
+ "Non-nil when emacs has some needed extra features.
+
+Currently, that is support for dllists and #'mapfam. Don't worry, if
+you're not sexy enough you can still use eMoney, you just won't be
+able to \"walk\" through accounts, but you can still switch to any
+account directly.
+
+See: `emoney-walk-accounts'.")
;; Drag in what we need.
(eval-and-compile
(defun emoney-walk-accounts-next ()
"Switch to the 'next' account in the chart of accounts."
(interactive)
- (emoney-walk-accounts 'next))
+ (and emoney-emacs-is-sexy-enough
+ (emoney-walk-accounts 'next)))
+
(defun emoney-walk-accounts-previous ()
"Switch to the 'previous' account in the chart of accounts."
(interactive)
- (emoney-walk-accounts 'previous))
+ (and emoney-emacs-is-sexy-enough
+ (emoney-walk-accounts 'previous)))
(defconst emoney-accounts-buffer-map
(let* ((map (make-sparse-keymap 'emoney-accounts-buffer-map)))
(define-key map [(control c) d] #'emoney-goto-default-account)
(define-key map [(control c) q] #'emoney-quit)
(define-key map [(control c) (control q)] #'emoney-recalc-and-exit)
- (define-key map [(meta n)] #'emoney-walk-accounts-next)
- (define-key map [(meta p)] #'emoney-walk-accounts-previous)
+ (when emoney-emacs-is-sexy-enough
+ (define-key map [(meta n)] #'emoney-walk-accounts-next)
+ (define-key map [(meta p)] #'emoney-walk-accounts-previous))
map)
"Keymap for emoney buffer.")