summaryrefslogtreecommitdiff
path: root/helm-tags.el
diff options
context:
space:
mode:
authortasuwo <kamuhata.you@gmail.com>2016-11-26 10:04:19 +0900
committertasuwo <kamuhata.you@gmail.com>2016-11-26 10:04:19 +0900
commit38af8a05cbbaca8b8ebbda5e55024c5e2654f6ab (patch)
treebd188d5d4b555aeb6a999f7d78e616c20ec9a9b9 /helm-tags.el
parent676f07f9788261997ae024febcfe63baea68effe (diff)
Search compressed files by helm-tags
Diffstat (limited to 'helm-tags.el')
-rw-r--r--helm-tags.el19
1 files changed, 19 insertions, 0 deletions
diff --git a/helm-tags.el b/helm-tags.el
index 4e774e02..e8b396c3 100644
--- a/helm-tags.el
+++ b/helm-tags.el
@@ -56,6 +56,14 @@ one match."
:type 'boolean
:group 'helm-tags)
+(defcustom helm-etags-compression-info-list
+ (purecopy '("" ".Z" ".bz2" ".gz" ".xz" ".tgz"))
+ "List of extensions tried by helm-tags when `auto-compression-mode' is on.
+An empty string means search the non-compressed file."
+ :version "24.1" ; added xz
+ :type '(repeat string)
+ :group 'helm-tags)
+
(defgroup helm-tags-faces nil
"Customize the appearance of helm-tags faces."
@@ -254,10 +262,21 @@ If no entry in cache, create one."
"Helm default action to jump to an etags entry in other window."
(require 'etags)
(helm-log-run-hook 'helm-goto-line-before-hook)
+ ;; If interested in compressed-files, search files with extensions.
(let* ((split (helm-grep-split-line candidate))
+ (file-search-extensions (if auto-compression-mode
+ helm-etags-compression-info-list
+ '("")))
(fname (cl-loop for tagf being the hash-keys of helm-etags-cache
for f = (expand-file-name
(car split) (file-name-directory tagf))
+
+ ;; search the file with each possible extension
+ do (while (and (not (file-exists-p f)) file-search-extensions)
+ (if (not (file-exists-p (concat f (car file-search-extensions))))
+ (setq file-search-extensions (cdr file-search-extensions))
+ (setq f (concat f (car file-search-extensions)))))
+
when (file-exists-p f)
return f))
(elm (cl-caddr split))