When trying to use +ivy-tasks in one of my projects it was failing w/ error:
`(Stack overflow in regexp matcher)`. This was due to ripgrep searching a folder
in the project root containing a minified bootstrap CSS source map file (which
had a `TODO:` in it). Since that file was a single line of text concatenated
together, the regex was getting passed ~540KB of text.
To make it easier to recognize what is causing +ivy-tasks to fail I wrapped the
failing code in `condition-case-unless-debug` and report the error and the file
causing the error using `message!`. So now if there is a failure during the
extraction of task from the search cmd's results it moves onto the next and
alerts the user in separate pop-up.
To avoid including the bootstrap file in the ripgrep search result, I added a
`.ignore` file to the project that tells `rg` to ignore it.
NOTE: I was surprised that this problem file was include in the ivy-tasks search
because I expected the search to respect projectile ignore settings. Respecting
projectile's ignored/unignored files and directories wouldn't be too difficult
considering projectile provides a robust collection of functions to help support
this. Also projectile's `projectile-ag` function is a great reference.
+ enable lexical-scope everywhere (lexical-binding = t): ~5-10% faster
startup; ~5-20% general boost
+ reduce consing, function calls & garbage collection by preferring
cl-loop & dolist over lambda closures (for mapc[ar], add-hook, and
various cl-lib filter/map/reduce functions) -- where possible
+ prefer functions with dedicated opcodes, like assq (see byte-defop's
in bytecomp.el for more)
+ prefer pcase & cond (faster) over cl-case
+ general refactor for code readability
+ ensure naming & style conventions are adhered to
+ appease byte-compiler by marking unused variables with underscore
+ defer minor mode activation to after-init, emacs-startup or
window-setup hooks; a customization opportunity for users + ensures
custom functionality won't interfere with startup.
+ Removed literal search
+ Only escapes inserted selection
+ BANG now means: don't respect .gitignore
+ rg: use smart-case (-S) instead of case insensitivity (-i)