Merge branch 'next' into ledger-mode-automatic-transactions
This commit is contained in:
commit
4c608cccd0
3 changed files with 28 additions and 6 deletions
|
|
@ -303,6 +303,21 @@ transactions like automated transaction, will be moved in the sorting
|
||||||
process and may not function correctly afterwards. For this reason
|
process and may not function correctly afterwards. For this reason
|
||||||
there is no key sequence.
|
there is no key sequence.
|
||||||
|
|
||||||
|
You can limit the allowed sort region by using embedded Ledger-mode
|
||||||
|
markup within your ledger. For exmaple
|
||||||
|
@smallexample
|
||||||
|
<<< infomration to not sort >>>
|
||||||
|
|
||||||
|
; Ledger-mode: Start sort
|
||||||
|
|
||||||
|
<<< xacts to sort >>>
|
||||||
|
|
||||||
|
;Ledger-mode: End sort
|
||||||
|
|
||||||
|
<<< information to not sort >>>
|
||||||
|
@end smallexample
|
||||||
|
|
||||||
|
|
||||||
@node Hiding Transactions, , Sorting Transactions, The Ledger Buffer
|
@node Hiding Transactions, , Sorting Transactions, The Ledger Buffer
|
||||||
@section Hiding Transactions
|
@section Hiding Transactions
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -133,10 +133,10 @@ the account"
|
||||||
(setq column ledger-post-amount-alignment-column))
|
(setq column ledger-post-amount-alignment-column))
|
||||||
(save-excursion
|
(save-excursion
|
||||||
;; Position the account
|
;; Position the account
|
||||||
(beginning-of-line)
|
;; (beginning-of-line)
|
||||||
(set-mark (point))
|
(set-mark (point))
|
||||||
(delete-horizontal-space)
|
;; (delete-horizontal-space)
|
||||||
(insert ledger-default-acct-transaction-indent)
|
;; (insert ledger-default-acct-transaction-indent)
|
||||||
(goto-char (1+ (line-end-position)))
|
(goto-char (1+ (line-end-position)))
|
||||||
(let* ((mark-first (< (mark) (point)))
|
(let* ((mark-first (< (mark) (point)))
|
||||||
(begin (if mark-first (mark) (point)))
|
(begin (if mark-first (mark) (point)))
|
||||||
|
|
|
||||||
|
|
@ -54,8 +54,8 @@
|
||||||
;; the beginning of next record
|
;; the beginning of next record
|
||||||
;; after the region
|
;; after the region
|
||||||
(setq new-end (point))
|
(setq new-end (point))
|
||||||
(narrow-to-region beg end)
|
(narrow-to-region new-beg new-end)
|
||||||
(goto-char (point-min))
|
(goto-char new-beg)
|
||||||
|
|
||||||
(let ((inhibit-field-text-motion t))
|
(let ((inhibit-field-text-motion t))
|
||||||
(sort-subr
|
(sort-subr
|
||||||
|
|
@ -66,7 +66,14 @@
|
||||||
(defun ledger-sort-buffer ()
|
(defun ledger-sort-buffer ()
|
||||||
"Sort the entire buffer."
|
"Sort the entire buffer."
|
||||||
(interactive)
|
(interactive)
|
||||||
(ledger-sort-region (point-min) (point-max)))
|
(let ((sort-start (point-min))
|
||||||
|
(sort-end (point-max)))
|
||||||
|
(goto-char (point-min))
|
||||||
|
(if (re-search-forward ";.*Ledger-mode:.*Start sort" nil t)
|
||||||
|
(set 'sort-start (match-end 0)))
|
||||||
|
(if (re-search-forward ";.*Ledger-mode:.*End sort" nil t)
|
||||||
|
(set 'sort-end (match-end 0)))
|
||||||
|
(ledger-sort-region sort-start sort-end)))
|
||||||
|
|
||||||
(provide 'ldg-sort)
|
(provide 'ldg-sort)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue