.emacs-obsolete
changeset 1495 d76487c37e61
parent 1494 874f705f7be4
child 1507 6f939639c52a
equal deleted inserted replaced
1494:874f705f7be4 1495:d76487c37e61
   353   (require 'smex)
   353   (require 'smex)
   354   (smex-initialize)
   354   (smex-initialize)
   355   (global-set-key (kbd "M-X") 'smex))
   355   (global-set-key (kbd "M-X") 'smex))
   356 
   356 
   357 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   357 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   358 (message "ag)
   358 (message "ag")
   359 
   359 
   360 (ignore-errors (require 'ag))
   360 (ignore-errors (require 'ag))
   361 
   361 
   362 (defun my/ag (regex)
   362 (defun my/ag (regex)
   363   "Search with ag from project roor without prefix and from
   363   "Search with ag from project roor without prefix and from
   365   (interactive (list (ag/read-from-minibuffer "Search regex")))
   365   (interactive (list (ag/read-from-minibuffer "Search regex")))
   366   (if current-prefix-arg
   366   (if current-prefix-arg
   367       (let ((current-prefix-arg nil)) (ag-regexp regex default-directory))
   367       (let ((current-prefix-arg nil)) (ag-regexp regex default-directory))
   368     (ag-project-regexp regex)))
   368     (ag-project-regexp regex)))
   369 
   369 
       
   370 (setq ag-group-matches t)
   370 (setq ag-highlight-search t)
   371 (setq ag-highlight-search t)
   371 (when (featurep 'ag)
   372 (when (featurep 'ag)
   372   (global-set-key [f7] 'my/ag))
   373   (global-set-key [f7] 'my/ag))