Created
January 16, 2011 11:28
-
-
Save jmhodges/781710 to your computer and use it in GitHub Desktop.
A nice start to a tool to help me write better
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trying to | |
attempting to | |
to help | |
that helps | |
utilize | |
helps to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'full-ack) | |
(defun editorial-control () ; making full-ack do what I want | |
"Check for things I hate in my own writing." | |
(interactive) | |
(ack-abort) | |
(let ((buffer (get-buffer-create "editorial-control")) | |
(search-file (buffer-file-name)) | |
(phrase-file "useless_phrases.txt") | |
(inhibit-read-only t) | |
(phrase-regexes) | |
) | |
(setq next-error-last-buffer buffer) | |
(when (file-readable-p phrase-file) | |
(with-temp-buffer | |
(insert-file-contents phrase-file) | |
(setq phrase-regexes (split-string (buffer-string) "\n" t)) | |
)) | |
(setq regex (concat "(" (mapconcat 'identity phrase-regexes "|") ")")) | |
(setq arguments | |
(append ack-arguments (nconc (ack-arguments-from-options regex) | |
(list "-i" "-H" regex search-file)))) | |
(with-current-buffer buffer | |
(erase-buffer) | |
(ack-mode) | |
(setq buffer-read-only t) | |
(font-lock-fontify-buffer) | |
(display-buffer (current-buffer)) | |
) | |
(setq ack-process | |
(apply 'start-process "ack" buffer ack-executable arguments)) | |
(set-process-sentinel ack-process 'ack-sentinel) | |
(set-process-query-on-exit-flag ack-process nil) | |
(set-process-filter ack-process 'ack-filter) | |
) | |
) | |
(provide 'writing) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think
perhaps
maybe
and yet
hopefully
probably
possibly
Clearly,
Obviously,