(when (maybe-require-package 'ledger-mode)

  (add-to-list 'auto-mode-alist '("\\.ledger$" . ledger-mode))

  (when (maybe-require-package 'flycheck-ledger)
    (after-load 'flycheck
      (after-load 'ledger-mode
        (require 'flycheck-ledger))))

  (after-load 'ledger-mode
    (define-key ledger-mode-map (kbd "RET") 'newline)
    (define-key ledger-mode-map (kbd "C-o") 'open-line))

  (setq ledger-highlight-xact-under-point nil
        ledger-use-iso-dates nil)

  (after-load 'ledger-mode
    (when (memq window-system '(mac ns))
      (exec-path-from-shell-copy-env "LEDGER_FILE")))

  (add-hook 'ledger-mode-hook 'goto-address-prog-mode))

(provide 'init-ledger)

(when (maybe-require-package 'ledger-mode)
  (when (maybe-require-package 'flycheck-ledger)
    (after-load 'flycheck
      (after-load 'ledger-mode
        (require 'flycheck-ledger))))

  (after-load 'ledger-mode
    (define-key ledger-mode-map (kbd "RET") 'newline)
    (define-key ledger-mode-map (kbd "C-o") 'open-line))

  (setq ledger-highlight-xact-under-point nil
        ledger-use-iso-dates nil)

  (after-load 'ledger-mode
    (when (memq window-system '(mac ns))
      (exec-path-from-shell-copy-env "LEDGER_FILE")))

  (add-hook 'ledger-mode-hook 'goto-address-prog-mode))

(provide 'init-ledger)

Drop auto-mode-alist entry for ledger-mode, now added upstream
Drop auto-mode-alist entry for ledger-mode, now added upstream

purcell/emacs.d,me020523/emacs.d,baohaojun/emacs.d,krzysz00/emacs.d,blueabysm/emacs.d,emuio/emacs.d,sgarciac/emacs.d,arthurl/emacs.d,braveoyster/emacs.d,qianwan/emacs.d,lust4life/emacs.d,kindoblue/emacs.d,dcorking/emacs.d,cjqw/emacs.d,roxolan/emacs.d,blueseason/emacs.d,gsmlg/emacs.d,wegatron/emacs.d,benkha/emacs.d,mmqmzk/emacs.d,svenyurgensson/emacs.d,kongfy/emacs.d