3 ms·
I guess I should check out helm since it's been recommended a couple of times now!
by fredsir 8y ago
I guess I should check out helm since it's been recommended a couple of times now!
- _asummers 8y agoHelm is great. Others prefer Ivy, but I prefer the way Helm works.
- TeMPOraL 8y agoI don't think you really need Helm explicitly for this (though you could make use of it if you're using it for other things). The standard Emacs function for prompting for data with autocomplete is completing-read. You could build an elisp function that prompts for the name of a wiki file with completing-read, and then visits it. The autocompletion will be provided by whatever package you have configured globally - be it Helm, or Ivy, or something else. A quick example how I started using this feature - I have my half-done invoicing system (for turning time clocked on org-mode tasks into PDF invoices). An entry point to invoicing a customer may look like this: (defun invoice-customer (customer-name) (interactive (customers--completing-read-customer)) ;; TODO Create an org document containing the invoice table and link. (message "Invoicing %s" customer-name)) Note that the "interactive" declaration has a function call in it. Now the completing-read call: (defun customers--completing-read-customer () "To be used as a value of `INTERACTIVE' declaration for functions that need to read a customer value." (list (completing-read "Customer: " (mapcar #'car *customers/customers*) nil t nil nil *customers/current-customer*))) There's a bunch of parameters to completing-read, but at a glance you can see the prompt ("Customer: "), code generating a list of entries (I'm doing a mapcar over customer database; you might want to do a mapcar over a call to directory-files), and an optional default value. Or, instead of all that, you can do what I actually do for the wiki - bookmark the wiki folder itself (with C-x r m in a dired buffer), and use C-x r b foldername to jump to it, and use incremental search in the resulting dired buffer to find the entry you need.