Permalink
Browse files

Create quotify-word-at-point and bind it to C-c'

  • Loading branch information...
Tom ten Thij
Tom ten Thij committed Mar 1, 2012
1 parent fd34f59 commit c207a944cc3f63d55e61ffb8e877c2d2d51510a6
Showing with 13 additions and 0 deletions.
  1. +11 −0 camelscore.el
  2. +2 −0 shared-settings.el
View
@@ -12,6 +12,13 @@
(defun starts-with-colon (s) (eq 0 (string-match ":" s)))
+(defun quotify (s)
+ (concat
+ "\""
+ (replace-regexp-in-string
+ "[\"':]?\\([^\"':]*\\)[\"']?" "\\1" s)
+ "\""))
+
(defun symbolize (s)
(if (starts-with-colon s)
s
@@ -68,4 +75,8 @@
(interactive)
(change-word-or-string-at-point 'symbolize))
+(defun quotify-word-at-point ()
+ (interactive)
+ (change-word-or-string-at-point 'quotify))
+
(provide 'camelscore)
View
@@ -95,6 +95,8 @@
(global-set-key "\C-c;" 'colonize-word-at-point)
(global-set-key "\C-c/" 'camelscore-word-at-point)
(global-set-key "\C-cs" 'symbolize-word-at-point)
+(global-set-key "\C-c'" 'quotify-word-at-point)
+(global-set-key "\C-c\"" 'quotify-word-at-point)
(defun rocket ()
(interactive)

0 comments on commit c207a94

Please sign in to comment.