dash-docs-el / helm-dash

Browse Dash docsets inside emacs
510 stars 59 forks source link

No error is given if sqlite3 cannot be found #80

Closed davidshepherd7 closed 9 years ago

davidshepherd7 commented 9 years ago

When emacs cannot find sqlite3 helm-dash fails silently. The list of completions remains simply remains empty, no error message or stack trace appears. It would be nicer if errors were displayed somehow.

I had some problems because of this. For some reason even though sqlite3 was installed emacs couldn't find it (I didn't find out why but a re-install fixed it). However, in order to find out that this was the issue I had to dig quite deeply into the code.

I'm working on a fix at the moment, but emacs' process calling functions are a confusing mess!

tko commented 9 years ago

You could replace helm-dash-sql with the following and get a decent error if sqlite3 isn't executable:

(defun helm-dash-sql (db-path sql)
  (mapcar (lambda (x) (split-string x "|" t))
          (process-lines "sqlite3" db-path sql)))

The downside is that if you have a typo in your docset lists nothing works and the only error you get is "sqlite3 exited with status 1" which isn't very helpful.

davidshepherd7 commented 9 years ago

I think I'll look into this again tomorrow and get something working.

Thanks for the process-lines tip and the motivation :)