# HG changeset patch # User Augie Fackler # Date 1234369663 21600 # Node ID 60dbe5b005cc693ece9b9e4149cdb180626d9291 # Parent bc63fd9e6d64174939aea701a6c576cdebe99fe2 Fix a bug in shell quoting. diff --git a/.elisp/textmate.el b/.elisp/textmate.el --- a/.elisp/textmate.el +++ b/.elisp/textmate.el @@ -95,8 +95,8 @@ ,(kbd "A-t") [(meta t)]) (textmate-goto-symbol ,(kbd "A-T") [(meta T)]) - (textmate-toggle-camel-case - ,(kbd "C-_") [(control _)]))) + (textmate-toggle-camel-case + ,(kbd "C-_") [(control _)]))) (defvar *textmate-project-root-p* #'(lambda (coll) (or (member ".git" coll) @@ -221,14 +221,14 @@ ((string= type "hg") "hg manifest")) " | xargs grep -nR " (if pattern (concat " --include='" pattern "' ") "") - "'" re "'")) + (shell-quote-argument re))) (t (concat "cd " root "; egrep -nR --exclude='" *textmate-gf-exclude* "' --include='" incpat - "' '" - re - "' . | grep -vE '" + "' " + (shell-quote-argument re) + " . | grep -vE '" *textmate-gf-exclude* "' | sed s:./::" ))))) @@ -246,27 +246,27 @@ (interactive) (if (thing-at-point 'word) (progn - (unless (looking-at "\\<") (backward-sexp)) - (let ((case-fold-search nil) - (start (point)) - (end (save-excursion (forward-sexp) (point)))) - (if (and (looking-at "[a-z0-9_]+") (= end (match-end 0))) ; snake-case - (progn - (goto-char start) - (while (re-search-forward "_[a-z]" end t) - (goto-char (1- (point))) - (delete-char -1) - (upcase-region (point) (1+ (point))) - (setq end (1- end)))) - (downcase-region (point) (1+ (point))) - (while (re-search-forward "[A-Z][a-z]" end t) - (forward-char -2) - (insert "_") - (downcase-region (point) (1+ (point))) - (forward-char 1) - (setq end (1+ end))) - (downcase-region start end) - ))))) + (unless (looking-at "\\<") (backward-sexp)) + (let ((case-fold-search nil) + (start (point)) + (end (save-excursion (forward-sexp) (point)))) + (if (and (looking-at "[a-z0-9_]+") (= end (match-end 0))) ; snake-case + (progn + (goto-char start) + (while (re-search-forward "_[a-z]" end t) + (goto-char (1- (point))) + (delete-char -1) + (upcase-region (point) (1+ (point))) + (setq end (1- end)))) + (downcase-region (point) (1+ (point))) + (while (re-search-forward "[A-Z][a-z]" end t) + (forward-char -2) + (insert "_") + (downcase-region (point) (1+ (point))) + (forward-char 1) + (setq end (1+ end))) + (downcase-region start end) + ))))) ;;; Utilities