summaryrefslogtreecommitdiff
path: root/tissue/file-document.scm
diff options
context:
space:
mode:
Diffstat (limited to 'tissue/file-document.scm')
-rw-r--r--tissue/file-document.scm11
1 files changed, 8 insertions, 3 deletions
diff --git a/tissue/file-document.scm b/tissue/file-document.scm
index 8de9645..ccd6a48 100644
--- a/tissue/file-document.scm
+++ b/tissue/file-document.scm
@@ -69,10 +69,14 @@
"Return a date representing the recency of DOCUMENT."
(file-document-last-updated-date document))
+(define (file-text file)
+ "Return the contents of text @var{file}."
+ (call-with-file-in-git (current-git-repository) file
+ get-string-all))
+
(define-method (document-text (document <file-document>))
"Return the full text of DOCUMENT."
- (call-with-file-in-git (current-git-repository) (file-document-path document)
- get-string-all))
+ (file-text (file-document-path document)))
(define-method (document-term-generator (document <file-document>))
"Return a term generator indexing DOCUMENT."
@@ -148,4 +152,5 @@ MSet object representing a list of search results."
;; Fallback to filename if document has no title.
file)
#:path file
- #:commits (commits-affecting-file file)))
+ #:commits (commits-affecting-file file)
+ #:snippet-source-text (file-text file)))