diff options
Diffstat (limited to '')
-rw-r--r-- | emacs.d/custom/fcuny-defuns.el | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/emacs.d/custom/fcuny-defuns.el b/emacs.d/custom/fcuny-defuns.el index 872f622..47d0a00 100644 --- a/emacs.d/custom/fcuny-defuns.el +++ b/emacs.d/custom/fcuny-defuns.el @@ -17,11 +17,10 @@ (message "File '%s' successfully renamed to '%s'" name (file-name-nondirectory new-name)))))))) (defun fcuny/remove-mysql-columns () - "Removes | from text. This is useful when I want to drop the column separator from some text coming from a mysql query." + "Removes from text. This is useful when I want to drop the column separator from some text coming from a mysql query." (interactive) - (if (region-active-p) - (replace-regexp "\s?|\s?" "" nil (region-beginning) (region-end)) - (replace-regexp "\s?|\s?" ""))) + (while (search-forward-regexp "\s?|\s?") + (replace-match " "))) (defun fcuny/copy-whole-buffer () "Selects the buffer and copy it." @@ -39,4 +38,15 @@ (buffer-file-name) (string-match "src/source/.*\.py$" (buffer-file-name)))) +(defun fcuny/build-python-checker () + "Compiles a newer version of the checker for Python." + (interactive) + (let ((output (make-temp-file "checker-foo")) + (errors (make-temp-file "checker-errors")) + (default-directory "~/workspace/source")) + (let ((status (call-process "~/workspace/source/pants" nil `(,output ,errors) nil "-q" "binary" "src/python/twitter/devprod/checkstyle:check"))) + (if (zerop status) + (message "Built check.pex successfully") + (message (buffer-file-name output)))))) + (provide 'fcuny-defuns) |