Skip to content

Instantly share code, notes, and snippets.

@jmhodges
Created January 16, 2011 11:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmhodges/781710 to your computer and use it in GitHub Desktop.
Save jmhodges/781710 to your computer and use it in GitHub Desktop.
A nice start to a tool to help me write better
trying to
attempting to
to help
that helps
utilize
helps to
(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)
@mrflip
Copy link

mrflip commented Jan 17, 2011

I think
perhaps
maybe
and yet
hopefully
probably
possibly
Clearly,
Obviously,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment