diff options
author | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2014-04-18 16:24:21 +0200 |
---|---|---|
committer | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2014-04-18 16:24:21 +0200 |
commit | 1592c28fc45c305ecc36d94a2e6f9e7baeb93615 (patch) | |
tree | 116e4ff2a13652bd8c5fc79358cd7368641faa48 /helm-tags.el | |
parent | 2840076ce71fc641726a4661e358e00b55ce77a1 (diff) |
Reindent all files.
Diffstat (limited to 'helm-tags.el')
-rw-r--r-- | helm-tags.el | 126 |
1 files changed, 63 insertions, 63 deletions
diff --git a/helm-tags.el b/helm-tags.el index 0d6e85d8..c2047027 100644 --- a/helm-tags.el +++ b/helm-tags.el @@ -55,7 +55,7 @@ one match." (with-helm-alive-p (helm-quit-and-execute-action (lambda (c) - (helm-etags-action-goto 'find-file-other-window c))))) + (helm-etags-action-goto 'find-file-other-window c))))) (defun helm-etags-run-switch-other-frame () "Run switch to other frame action from `helm-source-etags-select'." @@ -95,22 +95,22 @@ one match." (if (string-match "\\.el\\.gz$" helm-buffer-file-name) (format "ctags -e -u -f- --language-force=lisp --fields=n =(zcat %s) " helm-buffer-file-name) - (format "ctags -e -u -f- --fields=n %s " helm-buffer-file-name)) + (format "ctags -e -u -f- --fields=n %s " helm-buffer-file-name)) nil (current-buffer)) (goto-char (point-min)) (forward-line 2) (delete-region (point-min) (point)) (cl-loop while (and (not (eobp)) (search-forward "\001" (point-at-eol) t)) - for lineno-start = (point) - for lineno = (buffer-substring - lineno-start - (1- (search-forward "," (point-at-eol) t))) - do - (forward-line 0) - (insert (format "%5s:" lineno)) - (search-forward "\177" (point-at-eol) t) - (delete-region (1- (point)) (point-at-eol)) - (forward-line 1))))) + for lineno-start = (point) + for lineno = (buffer-substring + lineno-start + (1- (search-forward "," (point-at-eol) t))) + do + (forward-line 0) + (insert (format "%5s:" lineno)) + (search-forward "\177" (point-at-eol) t) + (delete-region (1- (point)) (point-at-eol)) + (forward-line 1))))) (defvar helm-source-ctags '((name . "Exuberant ctags") @@ -149,9 +149,9 @@ Lookes recursively in parents directorys for a 3) `tags-table-list' which is commonly set by `visit-tags-table' command." (helm-fast-remove-dups (delq nil - (append (list (helm-etags-get-tag-file) - tags-file-name) - tags-table-list)) + (append (list (helm-etags-get-tag-file) + tags-file-name) + tags-table-list)) :test 'equal)) (defun helm-etags-find-tag-file-directory (current-dir) @@ -164,16 +164,16 @@ If not found in CURRENT-DIR search in upper directory." (file-regular-p tag-path) (file-readable-p tag-path)))))) (cl-loop with count = 0 - until (funcall file-exists? current-dir) - ;; Return nil if outside the value of - ;; `helm-etags-tag-file-search-limit'. - if (= count helm-etags-tag-file-search-limit) - do (cl-return nil) - ;; Or search upper directories. - else - do (cl-incf count) - (setq current-dir (expand-file-name (concat current-dir "../"))) - finally return current-dir))) + until (funcall file-exists? current-dir) + ;; Return nil if outside the value of + ;; `helm-etags-tag-file-search-limit'. + if (= count helm-etags-tag-file-search-limit) + do (cl-return nil) + ;; Or search upper directories. + else + do (cl-incf count) + (setq current-dir (expand-file-name (concat current-dir "../"))) + finally return current-dir))) (defun helm-etags-get-header-name (_x) "Create header name for this helm etags session." @@ -192,20 +192,20 @@ If not found in CURRENT-DIR search in upper directory." (kill-buffer)))) (progress-reporter (make-progress-reporter "Loading tag file..." 0 max))) (cl-loop - with fname - with cand - for i in split for count from 0 - for elm = (unless (string-match "^\x0c" i) - (helm-aif (string-match "\177" i) - (substring i 0 it) - i)) - do (cond ((and elm (string-match "^\\([^,]+\\),[0-9]+$" elm)) - (setq fname (match-string 1 elm))) - (elm (setq cand (concat fname ": " elm))) - (t (setq cand nil))) - when cand do (progn - (insert (concat cand "\n")) - (progress-reporter-update progress-reporter count))))) + with fname + with cand + for i in split for count from 0 + for elm = (unless (string-match "^\x0c" i) + (helm-aif (string-match "\177" i) + (substring i 0 it) + i)) + do (cond ((and elm (string-match "^\\([^,]+\\),[0-9]+$" elm)) + (setq fname (match-string 1 elm))) + (elm (setq cand (concat fname ": " elm))) + (t (setq cand nil))) + when cand do (progn + (insert (concat cand "\n")) + (progress-reporter-update progress-reporter count))))) (defun helm-etags-init () "Feed `helm-buffer' using `helm-etags-cache' or tag file. @@ -214,20 +214,20 @@ If no entry in cache, create one." (when tagfiles (with-current-buffer (helm-candidate-buffer 'global) (dolist (f tagfiles) - (helm-aif (gethash f helm-etags-cache) - ;; An entry is present in cache, insert it. - (insert it) - ;; No entry, create a new buffer using content of tag file (slower). - (helm-etags-create-buffer f) - ;; Store content of buffer in cache. - (puthash f (buffer-string) helm-etags-cache) - ;; Store or set the last modification of tag file. - (helm-aif (assoc f helm-etags-mtime-alist) - ;; If an entry exists modify it. - (setcdr it (helm-etags-mtime f)) - ;; No entry create a new one. - (add-to-list 'helm-etags-mtime-alist - (cons f (helm-etags-mtime f)))))))))) + (helm-aif (gethash f helm-etags-cache) + ;; An entry is present in cache, insert it. + (insert it) + ;; No entry, create a new buffer using content of tag file (slower). + (helm-etags-create-buffer f) + ;; Store content of buffer in cache. + (puthash f (buffer-string) helm-etags-cache) + ;; Store or set the last modification of tag file. + (helm-aif (assoc f helm-etags-mtime-alist) + ;; If an entry exists modify it. + (setcdr it (helm-etags-mtime f)) + ;; No entry create a new one. + (add-to-list 'helm-etags-mtime-alist + (cons f (helm-etags-mtime f)))))))))) (defun helm-etags-split-line (line) (let ((regexp "\\`\\([a-zA-Z]?:?.*?\\): \\(.*\\)")) @@ -244,7 +244,7 @@ If no entry in cache, create one." ;; and not the filename. (if helm-etags-match-part-only (cadr (helm-etags-split-line candidate)) - candidate))) + candidate))) (mode-line . helm-etags-mode-line-string) (keymap . ,helm-etags-map) (action . (("Go to tag" . (lambda (c) @@ -254,9 +254,9 @@ If no entry in cache, create one." 'find-file-other-window c))) ("Go to tag in other frame" . (lambda (c) - (helm-etags-action-goto - 'find-file-other-frame - c))))) + (helm-etags-action-goto + 'find-file-other-frame + c))))) (persistent-help . "Go to line") (persistent-action . (lambda (candidate) (helm-etags-action-goto 'find-file candidate) @@ -271,10 +271,10 @@ If no entry in cache, create one." (helm-log-run-hook 'helm-goto-line-before-hook) (let* ((split (helm-etags-split-line candidate)) (fname (cl-loop for tagf being the hash-keys of helm-etags-cache - for f = (expand-file-name - (car split) (file-name-directory tagf)) - when (file-exists-p f) - return f)) + for f = (expand-file-name + (car split) (file-name-directory tagf)) + when (file-exists-p f) + return f)) (elm (cadr split))) (if (null fname) (error "file %s not found" fname) @@ -315,8 +315,8 @@ This function aggregates three sources of tag files: (if (cl-notany 'file-exists-p tag-files) (message "Error: No tag file found. Create with etags shell command, or visit with `find-tag' or `visit-tags-table'.") (cl-loop for k being the hash-keys of helm-etags-cache - unless (member k tag-files) - do (remhash k helm-etags-cache)) + unless (member k tag-files) + do (remhash k helm-etags-cache)) (mapc (lambda (f) (when (or (equal arg '(4)) (and helm-etags-mtime-alist |