Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ivy-thing-at-point error in rgrep #1446

Closed
Silex opened this issue Feb 9, 2018 · 4 comments

Comments

@Silex
Copy link
Contributor

commented Feb 9, 2018

Hello,

If a YAML document contains the following line:

uri: '{{options.uri}}/pdf?accessKey={options.secret}&url=http://{{domain}}/wiki/{_encodeURIComponent(title)}%3Fprintable=yes'

And that you call rgrep on this line, with the cursor on _encodeURIComponent and you press enter (to select the default _encodeURIComponent choice) then there's a TRAMP'ish error:

Debugger entered--Lisp error: (error "{{domain}}/80 Name or service not known")
  make-network-process(:name "{{domain}}" :buffer #<buffer  *url-http-temp*> :host "{{domain}}" :service 80 :nowait t)
  open-network-stream("{{domain}}" #<buffer  *url-http-temp*> "{{domain}}" 80 :type plain :nowait t)
  url-open-stream("{{domain}}" #<buffer  *url-http-temp*> "{{domain}}" 80 nil)
  url-http-find-free-connection("{{domain}}" 80 nil)
  url-http([cl-struct-url "http" nil nil "{{domain}}" nil "/wiki/{_encodeURIComponent" nil nil t nil t] #[128 "\302\303\304p#\210\300\305\240\210\301p\240\207" [(nil) (nil) url-debug retrieval "Synchronous fetching done (%S)" t] 5 "\n\n(fn &rest IGNORED)"] (nil))
  url-retrieve-internal([cl-struct-url "http" nil nil "{{domain}}" nil "/wiki/{_encodeURIComponent" nil nil t nil t] #[128 "\302\303\304p#\210\300\305\240\210\301p\240\207" [(nil) (nil) url-debug retrieval "Synchronous fetching done (%S)" t] 5 "\n\n(fn &rest IGNORED)"] (nil) nil nil)
  url-retrieve([cl-struct-url "http" nil nil "{{domain}}" nil "/wiki/{_encodeURIComponent" nil nil t nil t] #[128 "\302\303\304p#\210\300\305\240\210\301p\240\207" [(nil) (nil) url-debug retrieval "Synchronous fetching done (%S)" t] 5 "\n\n(fn &rest IGNORED)"] nil nil nil)
  url-retrieve-synchronously([cl-struct-url "http" nil nil "{{domain}}" nil "/wiki/{_encodeURIComponent" nil nil t nil t])
  url-http-head([cl-struct-url "http" nil nil "{{domain}}" nil "/wiki/{_encodeURIComponent" nil nil t nil t])
  url-http-file-exists-p([cl-struct-url "http" nil nil "{{domain}}" nil "/wiki/{_encodeURIComponent" nil nil t nil t])
  url-file-exists-p("http://{{domain}}/wiki/{_encodeURIComponent")
  apply(url-file-exists-p "http://{{domain}}/wiki/{_encodeURIComponent")
  url-file-handler(file-exists-p "http://{{domain}}/wiki/{_encodeURIComponent")
  file-exists-p("http://{{domain}}/wiki/{_encodeURIComponent")
  ffap-file-exists-string("http://{{domain}}/wiki/{_encodeURIComponent")
  ffap-file-at-point()
  ivy-thing-at-point()
  ivy--reset-state([cl-struct-ivy-state "Search for \"_encodeURIComponent\" in files (default *.yaml): " read-file-name-internal nil nil nil grep-files-history "*.yaml" nil nil t #<frame  *Minibuf-1* 0x123a660> #<window 201 on pdf.yaml> #<buffer pdf.yaml> nil (1 ("o" identity "default") ("i" (lambda (x) (insert (if (stringp x) x (car x)))) "insert") ("w" (lambda (x) (kill-new (if (stringp x) x (car x)))) "copy")) nil nil nil nil ivy-read-file-transformer "/home/philippe/work/stvs/mediawiki/data/restbase/v1/" read-file-name-internal nil "*.yaml"])
  ivy-read("Search for \"_encodeURIComponent\" in files (default *.yaml): " read-file-name-internal :predicate nil :require-match nil :initial-input nil :preselect "*.yaml" :def "*.yaml" :history grep-files-history :keymap nil :sort t :caller read-file-name-internal)
  ivy-completing-read("Search for \"_encodeURIComponent\" in files (default *.yaml): " read-file-name-internal nil nil nil grep-files-history ("*.yaml" "all" "el" "ch" "c" "cc" "cchh" "hh" "h" "l" "m" "tex" "texi" "asm") nil)
  completing-read("Search for \"_encodeURIComponent\" in files (default *.yaml): " read-file-name-internal nil nil nil grep-files-history ("*.yaml" "all" "el" "ch" "c" "cc" "cchh" "hh" "h" "l" "m" "tex" "texi" "asm"))
  grep-read-files("_encodeURIComponent")
  byte-code("\304 \210�\203�	\305\232\203�\306\307�\310\211\311%C\207\n\204�\312\313!\207\314 \315�!\316\317\310�\320$	\321\232����F\207" [grep-find-command current-prefix-arg grep-find-template default-directory grep-compute-defaults (16) read-from-minibuffer "Run: " nil grep-find-history error "grep.el: No `grep-find-template' available" grep-read-regexp grep-read-files read-directory-name "Base directory: " t (4)] 8)
  call-interactively(rgrep record nil)
  command-execute(rgrep record)
  #[257 "\304\305!\203\f\306\307�!!\210��\307�!\211��\310\307�!\311\")\207" [current-prefix-arg prefix-arg this-command real-this-command featurep smex smex-rank intern command-execute record] 4 "\n\n(fn CMD)"]("rgrep")
  ivy-call()
  ivy-read("M-x " ("yaml-mode" "toggle-debug-on-error" "ivy-mode" "fundamental-mode" "tramp-cleanup-all-connections" "docker-containers" "vr/replace" "ag" "replace-string" "ediff-buffers" "revert-buffer" "docker-volumes" "docker-images" "magit-blame" "sort-lines" "package-utils-upgrade-all" "sp-rewrap-sexp" "ediff-files" "align-regexp" "projectile-ag" "package-install" "find-name-dired" "sort-lines-buffer" "compile" "keep-lines" "package-utils-remove-by-name" "counsel-find-file" "magit-log-buffer-file" "package-refresh-contents" "load-library" "customize-group" "swiper" "github-clone" "read-only-mode" "replace-regexp" "customize-variable" "imenu" "github-browse-commit" "crux-eval-and-replace" "ag-files" "raise-sexp" "ztree-diff" "dumb-jump-go" "dired-du-mode" "crux-open-with" "dired-filter-mode" "crux-cleanup-buffer-or-region" "man" "copy-file" "elmacro-mode" ...) :predicate nil :require-match t :history counsel-M-x-history :action #[257 "\304\305!\203\f\306\307�!!\210��\307�!\211��\310\307�!\311\")\207" [current-prefix-arg prefix-arg this-command real-this-command featurep smex smex-rank intern command-execute record] 4 "\n\n(fn CMD)"] :sort nil :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x)
  counsel-M-x()
  funcall-interactively(counsel-M-x)
  call-interactively(counsel-M-x nil nil)
  command-execute(counsel-M-x)

My guess is that there's no ignore-errors around find-file-at-point, but I didn't take the time to investigate.

@abo-abo

This comment has been minimized.

Copy link
Owner

commented Feb 9, 2018

Can't reproduce with either my config or make plain. Please try to reproduce with make plain, also checking Emacs version.

@Silex

This comment has been minimized.

Copy link
Contributor Author

commented Feb 12, 2018

Okay, the culprit is url-handler-mode. When enabled, the error above happens.

I'm not sure what the correct fix for it is, I might simply disable url-handler-mode as it was something I used long ago and I don't really use much anymore...

@abo-abo abo-abo closed this in 9e637b9 Feb 12, 2018

@abo-abo

This comment has been minimized.

Copy link
Owner

commented Feb 12, 2018

Thanks, please test.

@Silex

This comment has been minimized.

Copy link
Contributor Author

commented Feb 13, 2018

I confirm the problem is gone 👍

abo-abo added a commit that referenced this issue Aug 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.