News for hackers. Stuff that matters.
Re:My bag of tricks – loose notes, design patterns, rules-of... by fredsir on Friday August 31, 2018 @01:27PM (#17887339)
How are you using org-mode for this?

I have recently switched all my note-taking and task/todo management to org-mode, but I'm still figuring out how to use it properly. At the moment, I just have a personal.org, refile.org and project specific .org files, all kinda taking the shape of headings with sub-sub-sub-sub-headings inside until there is either none or some content inside, but a personal wiki, it doesn't feel like. It feels more like ordered mess, kinda. It's definitely better than anything I've ever used before.

Any good tips you want to share?

Re:My bag of tricks – loose notes, design patterns, rules-of... by nextos on Friday August 31, 2018 @01:43PM (#17887482)
That's not an easy question. I think you need to enforce some style guide, like Wikipedia does.

org-mode is a bit like C++ or LaTeX. I say this as a good thing. It has tons of features, but you need to choose what to use and what to keep out.

For me, something that works great is to keep all org files in the same folder, with a flat structure. That includes my task list and my calendar. I version control everything, except organizational things that change often instead of growing like articles. I also keep out of version control first quick drafts of any article.

Re:My bag of tricks – loose notes, design patterns, rules-of... by fredsir on Friday August 31, 2018 @01:52PM (#17887550)
Thanks for the reply!
Re:My bag of tricks – loose notes, design patterns, rules-of... by weaksauce on Friday August 31, 2018 @03:11PM (#17888042)
It’s nice to have a personal man page folder on different subjects. I personally use a binding in Emacs to bring up a helm buffer to select it quickly. Also, a tab completion function tied to an alias for it called “mm” so you can access it from the command line too is useful.
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.