emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/xeft 8b8c4bd37a 27/55: Improve README


From: ELPA Syncer
Subject: [elpa] externals/xeft 8b8c4bd37a 27/55: Improve README
Date: Fri, 13 Jan 2023 23:58:38 -0500 (EST)

branch: externals/xeft
commit 8b8c4bd37afe8ab5df2ee3c90fffcdca02396e12
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>

    Improve README
    
    * Makefile: Remove whitespaces.
    * README.md: IMPROVE.
    * demo.gif: New file.
---
 Makefile  |  10 +++----
 README.md |  90 ++++++++++++++++++++++++++++++++++++++------------------------
 demo.gif  | Bin 0 -> 1192465 bytes
 3 files changed, 60 insertions(+), 40 deletions(-)

diff --git a/Makefile b/Makefile
index 32bddbd723..1c48d520b3 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,9 @@
 .POSIX:
-PREFIX = /usr/local
-CXX = g++
-CXXFLAGS = -fPIC -I$(PREFIX)/include
-LDFLAGS = -L$(PREFIX)/lib
-LDLIBS = -lxapian
+PREFIX=/usr/local # Even if this is unnecessary, it doesn’t hurt.
+CXX=g++
+CXXFLAGS=-fPIC -I$(PREFIX)/include
+LDFLAGS=-L$(PREFIX)/lib
+LDLIBS=-lxapian
 
 xeft-module.so: xeft-module.cc
        $(CXX) $< -o $@ -shared $(CXXFLAGS) $(LDFLAGS) $(LDLIBS)
diff --git a/README.md b/README.md
index f776aeb398..36e16358b5 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,5 @@
+![Demo gif](./demo.gif)
+
 # What is Xeft
 
 1. A dynamic module that exposes a very basic indexing feature to
@@ -9,47 +11,32 @@
 ;;=> (0.031512 0 0.0)
 ```
 
-2. A note taking interface like Deft, built on the dynamic module.
+2. A note taking interface like Deft, built on top of the dynamic module.
 
-# How to use the dynamic module
+# Usage
 
-Because it’s so basic, the dynamic module is very easy to use and
-also very flexible. To index files, use
+To use Xeft the note searching interface, install it and type `M-x
+xeft RET` to bring up the panel. If the dynamic module isn’t compiled,
+you are prompted to compile it. Refer to the next section for
+prerequisites for compiling the module.
 
-```emacs-lisp
-(dolist (file (directory-files "my-note-dir"))
-  (xeft-reindex-file file dbpath))
-```
+Once the xeft buffer is up, type the search phrase in the first line.
+Press `C-n` and `C-p` to go through each file. You can preview a file
+in another window by pressing `SPC` on a file, or click the file with
+the mouse. Press `RET` to open the file in the current window.
 
-This indexes each file in `my-note-dir`, saving them to the database
-at `dbpath`. If the database doesn’t exist yet, it is created.
+Directory `xeft-directory` stores note files, directory
+`xeft-database` stores the database. Xeft uses
+`xeft-default-extension` to create new files, and it ignores files
+with `xeft-ignore-extension`.
 
-To search for a term, use
+By default, Xeft only searches for first level files in
+`xeft-directory`, to make it search recursively, set `xeft-recursiv`
+to t.
 
-```emacs-lisp
-(xeft-query-term "search term" dbpath 0 10)
-```
+See the “xeft” customize group for more custom options and faces.
 
-This returns a list of paths of the files that contains `search term`,
-ranked by relevance. The `0` and `10` means “return 10 results
-starting from the 0th place”, it is essentially used for paging. If
-you want all the result, use `0` and `999999`.
-
-When a file is modified, call `xeft-reindex-file` again on that file.
-If a file is removed, you don’t need to remove it from the database,
-it will be automatically removed. If the file has been indexed and
-haven’t been modified, `xeft-reindex-file` is (kind of) a no-op (i.e.
-fast).
-
-Both file path and database path must be absolute path.
-
-# How to use the note-taking interface
-
-It is essentially the same as [Zeft](https://github.com/casouri/zeft).
-To try it out, build the dynamic module or download prebuilt ones from
-release page. Then type `M-x xeft RET`.
-
-# How to build the dynamic module
+# building the dynamic module
 
 To build the module, you need to have Xapian installed. On Mac, it can
 be installed with macports by
@@ -65,7 +52,8 @@ make PREFIX=/opt/local
 ```
 
 Here `/opt/local` is the default prefix of macports, which is what I
-used to install Xapian.
+used to install Xapian. Homebrew and Linux users probably can leave it
+empty.
 
 # Beware
 
@@ -78,3 +66,35 @@ Xapian, without reading his code I wouldn’t be able to write 
Xeft.
 
 Also, if you want a more powerful searching experience, you will be
 happier using notdeft instead.
+
+# How to use the dynamic module
+
+Because it’s so basic, the dynamic module is very easy to use and
+also very flexible. To index files, use
+
+```emacs-lisp
+(dolist (file (directory-files "my-note-dir"))
+  (xeft-reindex-file file dbpath))
+```
+
+This indexes each file in `my-note-dir`, saving them to the database
+at `dbpath`. If the database doesn’t exist yet, it is created.
+
+To search for a term, use
+
+```emacs-lisp
+(xeft-query-term "search term" dbpath 0 10)
+```
+
+This returns a list of paths of the files that contains `search term`,
+ranked by relevance. The `0` and `10` means “return 10 results
+starting from the 0th place”, it is essentially used for paging. If
+you want all the result, use `0` and `999999`.
+
+When a file is modified, call `xeft-reindex-file` again on that file.
+If a file is removed, you don’t need to remove it from the database,
+it will be automatically removed. If the file has been indexed and
+haven’t been modified, `xeft-reindex-file` is (kind of) a no-op (i.e.
+fast).
+
+Both file path and database path must be absolute path.
diff --git a/demo.gif b/demo.gif
new file mode 100644
index 0000000000..0538e249e5
Binary files /dev/null and b/demo.gif differ



reply via email to

[Prev in Thread] Current Thread [Next in Thread]