FelipeLema/emacs-counsel-gtags

counsel-gtags-find-definition gives "(wrong-number-of-arguments (1 . 1) 2)"

Closed this issue · 1 comments

Emacs Version: 26.1

This problem seems to lay in counsel-gtags.el#L192

			    (let ((path (executable-find exec t)))

while in Emacs 26.1, the executable-find command only takes on argument. The problem could be fixed on 26.1 if I remove the 't' after 'exec'.

Backtrace

Debugger entered--Lisp error: (wrong-number-of-arguments (1 . 1) 2)
  executable-find("rg" t)
  (let ((path (executable-find exec t))) (if path (progn (throw 'path (concat path " " (cdr (assoc-string exec counsel-gtags--grep-options-alist)))))))
  (closure (t) (exec) (let ((path (executable-find exec t))) (if path (progn (throw 'path (concat path " " (cdr (assoc-string exec counsel-gtags--grep-options-alist))))))))("rg")
  mapc((closure (t) (exec) (let ((path (executable-find exec t))) (if path (progn (throw 'path (concat path " " (cdr (assoc-string exec counsel-gtags--grep-options-alist)))))))) ("rg" "ag" "grep"))
  (catch 'path (mapc (function (lambda (exec) (let ((path (executable-find exec t))) (if path (progn (throw 'path (concat path " " (cdr (assoc-string exec counsel-gtags--grep-options-alist))))))))) counsel-gtags--grep-commands-list) nil)
  (set (make-local-variable 'counsel-gtags--get-grep-command) (catch 'path (mapc (function (lambda (exec) (let ((path (executable-find exec t))) (if path (progn (throw 'path (concat path " " (cdr (assoc-string exec counsel-gtags--grep-options-alist))))))))) counsel-gtags--grep-commands-list) nil))
  (or counsel-gtags--get-grep-command (set (make-local-variable 'counsel-gtags--get-grep-command) (catch 'path (mapc (function (lambda (exec) (let ((path (executable-find exec t))) (if path (progn (throw 'path (concat path " " (cdr (assoc-string exec counsel-gtags--grep-options-alist))))))))) counsel-gtags--grep-com$
  counsel-gtags--get-grep-command-find()
  (concat " | " (counsel-gtags--get-grep-command-find) " " (shell-quote-argument (counsel--elisp-to-pcre (ivy--regex query))))
  (and query (concat " | " (counsel-gtags--get-grep-command-find) " " (shell-quote-argument (counsel--elisp-to-pcre (ivy--regex query)))))
  (concat "global -c " (counsel-gtags--command-options 'definition query nil) (and query (concat " | " (counsel-gtags--get-grep-command-find) " " (shell-quote-argument (counsel--elisp-to-pcre (ivy--regex query))))))
  counsel-gtags--build-command-to-collect-candidates("g_major")
  (let ((command (counsel-gtags--build-command-to-collect-candidates query))) (counsel-gtags--debug-message "Async Command: %s" command) (counsel--async-command command) '("" "Filtering …"))
  (or (ivy-more-chars) (let ((command (counsel-gtags--build-command-to-collect-candidates query))) (counsel-gtags--debug-message "Async Command: %s" command) (counsel--async-command command) '("" "Filtering …")))
  counsel-gtags--async-tag-query("g_major")
  ivy--dynamic-collection-cands("g_major")
  ivy--reset-state(#s(ivy-state :prompt "Find Definition: " :collection counsel-gtags--async-tag-query :predicate nil :require-match nil :initial-input "g_major" :history nil :preselect nil :keymap nil :update-fn nil :sort nil :frame #<frame F1 0xc371b0> :window #<window 1 on xpu_drv.c> :buffer #<buffer xpu_drv.c> :$
  ivy-read("Find Definition: " counsel-gtags--async-tag-query :initial-input "g_major" :unwind (closure (t) nil (counsel-delete-process) (swiper--cleanup)) :dynamic-collection t :caller counsel-gtags--read-tag)
  (list (ivy-read "Find Definition: " (if counsel-gtags-use-dynamic-list (function counsel-gtags--async-tag-query) (counsel-gtags--sync-tag-query)) :initial-input (and counsel-gtags-use-input-at-point (ivy-thing-at-point)) :unwind (function (lambda nil (counsel-delete-process) (swiper--cleanup))) :dynamic-collection$
  call-interactively(counsel-gtags-find-definition nil nil)
  command-execute(counsel-gtags-find-definition)

that t is for remote/tramp support: it will search for command in tramp buffers. This arg is available in 27 onwards.

I'm guessing you're not using tramp, so I'll add a "only tramp and 27 onwards" around it