News for hackers. Stuff that matters.
Re:My bag of tricks – loose notes, design patterns, rules-of... by kornish on Friday August 31, 2018 @04:51PM (#17888555)
Org-wiki and linking between pages is a godsend. Add a keybinding to search pages using helm and you’re up and running.
Re:My bag of tricks – loose notes, design patterns, rules-of... by fredsir on Friday August 31, 2018 @04:56PM (#17888578)
I guess I should check out helm since it's been recommended a couple of times now!
Re:My bag of tricks – loose notes, design patterns, rules-of... by TeMPOraL on Friday August 31, 2018 @06:01PM (#17888857)
I 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.

Re:My bag of tricks – loose notes, design patterns, rules-of... by _asummers on Friday August 31, 2018 @05:20PM (#17888683)
Helm is great. Others prefer Ivy, but I prefer the way Helm works.