Permalink
Browse files

Merge branch 'master' of git@github.com:vjohansen/emacs-config

  • Loading branch information...
vjohansen committed May 29, 2012
2 parents bd977e7 + df44235 commit f4f0687a0408bbd417ee27faa86ba52388baced9
Showing with 100 additions and 7 deletions.
  1. +1 −1 vj-copy-paste.el
  2. +11 −6 vj-grep.el
  3. +70 −0 vj-helm.el
  4. +18 −0 vj-prog.el
View
@@ -1,4 +1,4 @@
-
+;; Copy/Paste - The unsolved problem. But files work.
;; Fluxbox on unix
View
@@ -20,6 +20,13 @@ from filenames for nicer display."
"Face for highlighting failed part in Isearch echo-area message."
:group 'vj-grep)
+(defvar vj-perl-program "perl")
+
+(defvar vj-vgrep-call
+ (concat vj-perl-program " "
+ (or (locate-library "vgrep22.pl") "-S vgrep22.pl"))
+ "Command line for calling vgrep22.pl program.")
+
(defun vgrep (word &optional ext-string)
"Run grep WORD on files with vj-grep-source-extensions in current directory.
@@ -36,7 +43,7 @@ With prefix argument do a recursive grep."
(setq word (current-word)))
(unless (< (length word) 1)
(grep
- (concat vps-vgrep-call
+ (concat vj-vgrep-call
" -i -e " (or ext-string vj-grep-source-extensions) " "
(shell-quote-argument word) " "
(if current-prefix-arg
@@ -55,7 +62,7 @@ With prefix argument do a recursive grep."
((compilation-enter-directory-regexp-alist '(("Dir: \\(.*\\)" 1)))
(compilation-scroll-output nil)
(command
- (concat vps-vgrep-call " -i "
+ (concat vj-vgrep-call " -i "
" -e " vj-grep-source-extensions
" " (shell-quote-argument
(vj-read-from-minibuffer "rgrep" (current-word) 'grep-history))
@@ -65,15 +72,13 @@ With prefix argument do a recursive grep."
(read-from-minibuffer "rgrep command: " command)
command ))))
-;;(defcustom vj-incgrep-system-project-name)
-
-;; TODO pass projectnames to inc grep
;; VJ april 2005
(defun vj-grep-includes (word)
"grep in iclude files for current buffer"
(interactive (list (read-string "include grep: " (thing-at-point 'symbol))))
- (grep (concat "perl -w " (or (locate-library "incgrep.pl") "-S incgrep.pl")
+ (grep (concat vj-perl-program " -w "
+ (or (locate-library "incgrep.pl") "-S incgrep.pl")
" " (buffer-file-name) " " word)))
View
@@ -0,0 +1,70 @@
+
+(defface helm-selection
+ '((((class color) (background light))
+ (:background "#ddddff" :bold t))
+ (t (:background "#000040" :foreground "white")))
+ "")
+
+;; (defface helm-ff-executable
+;; '((((class color) (background light))
+;; (:foreground "#206020"))
+;; (t (:foreground "green")))
+;; "")
+
+(require 'helm-config)
+(require 'helm-files)
+(require 'helm-buffers)
+(require 'helm-misc) ;; enables C-r in minibuffer
+
+;; Added to helm-locate.el
+;; (define-key map (kbd "M-]") 'helm-ff-run-toggle-basename)
+(if (eq system-type 'windows-nt)
+ (setq helm-c-locate-command "c:/tools/Locate32/Locate.exe %s"))
+(setq helm-ff-transformer-show-only-basename nil)
+(global-set-key (kbd "M-h") 'vj-helm)
+
+
+(defvar vj-helm-list '(helm-c-source-buffers-list
+ helm-c-source-recentf
+ helm-c-source-locate))
+
+(defun vj-helm ()
+ (interactive)
+ (if current-prefix-arg
+ (if (eq system-type 'windows-nt)
+ (vj-helm-wdsgrep)
+ (vj-helm-local-locate))
+ (helm-other-buffer vj-helm-list "*vj-helm*")))
+
+
+
+;; Desktop search for windows
+(defvar helm-source-wdsgrep
+ '((name . "Desktop Search")
+ (candidates . (lambda ()
+ (start-process "wdsgrep-process" nil
+ "c:\\tools\\wdsgrep\\wdsgrep.exe" helm-pattern)))
+ (type . file)
+ (requires-pattern . 4)
+ (delayed))
+ "Source for retrieving files via W. Desktop Search.")
+
+
+
+(if (eq system-type 'windows-nt)
+
+ ;; Windows
+ (defun vj-helm-wdsgrep ()
+ (interactive)
+ (helm-other-buffer '(helm-source-wdsgrep) "*helm Desktop Search*"))
+
+ ;; else
+ (defun vj-helm-local-locate ()
+ (interactive)
+ (when (not (file-exists-p "~/.vj-locate.db"))
+ (message "Run: updatedb -l 0 -o ~/.vj-locate.db -U ~")
+ (sit-for 2.0))
+ (let ((helm-c-locate-command "locate -d ~/.vj-locate.db -i -r %s"))
+ (helm-other-buffer
+ '(helm-c-source-locate)
+ "*vj-helm-local-locate*"))))
View
@@ -4,6 +4,24 @@
; ------------------------------------------------------------
+;; Autodetect tab-infested files
+
+;; http://lists.gnu.org/archive/html/emacs-devel/2005-09/msg00860.html
+
+(defun sm-find-file-tab-setup ()
+ (when (and (null indent-tabs-mode)
+;; (local-variable-p 'indent-tabs-mode) ; Trust the major mode.
+ (save-excursion
+ (goto-char (point-min))
+ ;; If there are at least 10 lines with a leading TAB, use TABs.
+ (re-search-forward "^ " (+ (point) 100000) t 10)))
+ (set (make-local-variable 'indent-tabs-mode) t)
+ (setq tab-width 4)))
+
+(add-hook 'find-file-hook 'sm-find-file-tab-setup)
+
+; ------------------------------------------------------------
+
(add-hook 'emacs-lisp-mode-hook 'vj-emacs-lisp-mode-hook)
;;(add-hook 'emacs-lisp-mode-hook 'pretty-lambdas)

0 comments on commit f4f0687

Please sign in to comment.