From 0399d9d17db736fbae5b8766541c09e5ffa27603 Mon Sep 17 00:00:00 2001 From: CGenie Date: Wed, 27 Mar 2019 18:27:08 +0100 Subject: [PATCH 1/3] `search-backward` fix https://www.gnu.org/software/emacs/manual/html_node/elisp/String-Search.html --- helm-dash.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/helm-dash.el b/helm-dash.el index e352c35..362738e 100644 --- a/helm-dash.el +++ b/helm-dash.el @@ -317,7 +317,7 @@ If doesn't exist, it asks to create it." (cond ((and (not (equal result 0)) ;; TODO: Adjust to proper text. Also requires correct locale. - (backward-search "too long")) + (search-backward "too long")) (error "Failed to extract %s to %s. Filename too long. Consider changing `helm-dash-docsets-path' to a shorter value")) ((not (equal result 0)) (error "Failed to extract %s to %s. Error: %s" docset-temp-path (helm-dash-docsets-path) result))) (goto-char (point-max)) @@ -408,7 +408,8 @@ The Argument FEED-PATH should be a string with the path of the xml file." (defvar helm-dash-sql-queries '((DASH . (lambda (pattern) (let ((like (helm-dash-sql-compose-like "t.name" pattern)) - (query "SELECT t.type, t.name, t.path FROM searchIndex t WHERE %s ORDER BY LENGTH(t.name), LOWER(t.name) LIMIT 1000")) + (query "SELECT t.type, t.name, t.path FROM + Index t WHERE %s ORDER BY LENGTH(t.name), LOWER(t.name) LIMIT 1000")) (format query like)))) (ZDASH . (lambda (pattern) (let ((like (helm-dash-sql-compose-like "t.ZTOKENNAME" pattern)) From d9a2be98af5dceac4b790d1ef7b6f405ff547fe2 Mon Sep 17 00:00:00 2001 From: CGenie Date: Wed, 27 Mar 2019 18:41:32 +0100 Subject: [PATCH 2/3] `search-backward` with noerror If `noerror = nil` then error is thrown and we don't get a chance to report our custom error. --- helm-dash.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm-dash.el b/helm-dash.el index 362738e..33d2a34 100644 --- a/helm-dash.el +++ b/helm-dash.el @@ -317,7 +317,7 @@ If doesn't exist, it asks to create it." (cond ((and (not (equal result 0)) ;; TODO: Adjust to proper text. Also requires correct locale. - (search-backward "too long")) + (search-backward "too long" nil t)) (error "Failed to extract %s to %s. Filename too long. Consider changing `helm-dash-docsets-path' to a shorter value")) ((not (equal result 0)) (error "Failed to extract %s to %s. Error: %s" docset-temp-path (helm-dash-docsets-path) result))) (goto-char (point-max)) From dc9bfa946c12eb05ad72fdab52d1cf8cbb787241 Mon Sep 17 00:00:00 2001 From: Przemek Kaminski Date: Thu, 28 Mar 2019 01:42:43 +0100 Subject: [PATCH 3/3] searchIndex fix for DASH query --- helm-dash.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/helm-dash.el b/helm-dash.el index 33d2a34..28ca32c 100644 --- a/helm-dash.el +++ b/helm-dash.el @@ -408,8 +408,7 @@ The Argument FEED-PATH should be a string with the path of the xml file." (defvar helm-dash-sql-queries '((DASH . (lambda (pattern) (let ((like (helm-dash-sql-compose-like "t.name" pattern)) - (query "SELECT t.type, t.name, t.path FROM - Index t WHERE %s ORDER BY LENGTH(t.name), LOWER(t.name) LIMIT 1000")) + (query "SELECT t.type, t.name, t.path FROM searchIndex t WHERE %s ORDER BY LENGTH(t.name), LOWER(t.name) LIMIT 1000")) (format query like)))) (ZDASH . (lambda (pattern) (let ((like (helm-dash-sql-compose-like "t.ZTOKENNAME" pattern))