diff options
author | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2014-04-25 15:51:17 +0200 |
---|---|---|
committer | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2014-04-25 15:51:17 +0200 |
commit | bc4fb132f218c2025eeb9218f95f56798343c05a (patch) | |
tree | 50d56ec46972ab2adfaef5548d0b25fb886221c5 /helm-tags.el | |
parent | 9bc2702cf13e5096e391088208cc71e580cf2fd7 (diff) |
Finally reindent with the cl indentation behavior of 24.4.50.
It have font-lock broken in some place but is not broken as in 24.3.90.
So perhaps it is the best option for now.
Diffstat (limited to 'helm-tags.el')
-rw-r--r-- | helm-tags.el | 116 |
1 files changed, 58 insertions, 58 deletions
diff --git a/helm-tags.el b/helm-tags.el index 62aa31e5..c2047027 100644 --- a/helm-tags.el +++ b/helm-tags.el @@ -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") @@ -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. @@ -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) @@ -271,18 +271,18 @@ 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) - (ring-insert find-tag-marker-ring (point-marker)) - (funcall switcher fname) - (goto-char (point-min)) - (search-forward elm nil t) - (goto-char (match-beginning 0))))) + (ring-insert find-tag-marker-ring (point-marker)) + (funcall switcher fname) + (goto-char (point-min)) + (search-forward elm nil t) + (goto-char (match-beginning 0))))) (defun helm-etags-mtime (file) "Last modification time of etags tag FILE." @@ -314,19 +314,19 @@ This function aggregates three sources of tag files: (str (thing-at-point 'symbol))) (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)) - (mapc (lambda (f) - (when (or (equal arg '(4)) - (and helm-etags-mtime-alist - (helm-etags-file-modified-p f))) - (remhash f helm-etags-cache))) - tag-files) - (helm :sources 'helm-source-etags-select - :keymap helm-etags-map - :default (list (concat "\\_<" str "\\_>") str) - :buffer "*helm etags*")))) + (cl-loop for k being the hash-keys of 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 + (helm-etags-file-modified-p f))) + (remhash f helm-etags-cache))) + tag-files) + (helm :sources 'helm-source-etags-select + :keymap helm-etags-map + :default (list (concat "\\_<" str "\\_>") str) + :buffer "*helm etags*")))) (provide 'helm-tags) |