From 316b1b7cfefbc3d65994f518df39545ef74f6879 Mon Sep 17 00:00:00 2001 From: 4ourbit <4ourbit@gmail.com> Date: Wed, 1 Jan 2014 22:00:26 +0100 Subject: [PATCH] Plugging ledger pcomplete into completion-at-point. Added documentation on how to use pcomplete transparently via completion-at-point. --- doc/ledger-mode.texi | 5 +++++ lisp/ledger-mode.el | 1 + 2 files changed, 6 insertions(+) diff --git a/doc/ledger-mode.texi b/doc/ledger-mode.texi index c8af96cb..e81045c6 100644 --- a/doc/ledger-mode.texi +++ b/doc/ledger-mode.texi @@ -175,6 +175,11 @@ typing a close match to the payee. Ledger-mode will call @command{ledger xact} with the data you enter and place the transaction in the proper chronological place in the ledger. +To complete just the part of the transaction where your cursor is at, +Ledger-mode supports Emacs' universal @command{completion-at-point} +command. You may bind this command to @kbd{C-M-i} since this is the +default for Emacs programming modes. + @node Reconciliation, Reports, Quick Add, Quick Demo @subsection Reconciliation @kindex C-c C-r diff --git a/lisp/ledger-mode.el b/lisp/ledger-mode.el index 209f970e..0d683168 100644 --- a/lisp/ledger-mode.el +++ b/lisp/ledger-mode.el @@ -325,6 +325,7 @@ With a prefix argument, remove the effective date. " 'ledger-parse-arguments) (set (make-local-variable 'pcomplete-command-completion-function) 'ledger-complete-at-point) + (add-to-list 'completion-at-point-functions 'pcomplete-completions-at-point) (add-hook 'post-command-hook 'ledger-highlight-xact-under-point nil t) (add-hook 'before-revert-hook 'ledger-occur-remove-all-overlays nil t)