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

Pinging init.as (American Samoa) #2574

Closed
1 task done
mplsgrant opened this issue Nov 29, 2022 · 16 comments
Closed
1 task done

Pinging init.as (American Samoa) #2574

mplsgrant opened this issue Nov 29, 2022 · 16 comments
Labels

Comments

@mplsgrant
Copy link

mplsgrant commented Nov 29, 2022

What happened?

I put the emacs cursor on the word init.as and I press C-x b which I have mapped to helm-mini. Instead of bringing up helm-mini, I get a message which says Pinging init.as (American Samoa). Changing the word to init.us, for example, will not hang on that message, but will briefly reach out ostensibly to ping init.us.

Instead of this, I expect helm-mini to pop up, and I don't expect helm to reach out to websites.

How to reproduce?

Use the following configuration, and perform C-x b on the word init.as within the scratch buffer.

early-init.el

( setq package-enable-at-startup nil)

init.el

(defvar bootstrap-version)
(let ((bootstrap-file
       (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
      (bootstrap-version 5))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))

(straight-use-package 'use-package)
(setq use-package-always-ensure t)

(use-package helm
  :straight t
  :init (helm-mode t)
  :bind (("M-x"     . helm-M-x)
         ("C-x C-f" . helm-find-files)
         ("C-x b"   . helm-mini)     ;; See buffers & recent files; more useful.
         ("C-x r b" . helm-filtered-bookmarks)
         ("C-x C-r" . helm-recentf)  ;; Search for recently edited files
         ("C-c i"   . helm-imenu)
         ("C-h a"   . helm-apropos)
         ;; Look at what was cut recently & paste it in.
         ("M-y" . helm-show-kill-ring)

         :map helm-map
         ;; We can list ‘actions’ on the currently selected item by C-z.
         ("C-z" . helm-select-action)
         ;; Let's keep tab-completetion anyhow.
         ("TAB"   . helm-execute-persistent-action)
         ("<tab>" . helm-execute-persistent-action)))

(use-package helm-ag
  :straight t)

Helm Version

Master branch

Emacs Version

Emacs-28/29

OS

GNU/Linux

Relevant backtrace (if possible)

No response

Minimal configuration

  • I agree using a minimal configuration
@mplsgrant mplsgrant added the bug label Nov 29, 2022
@thierryvolpiatto
Copy link
Member

thierryvolpiatto commented Nov 29, 2022 via email

@thierryvolpiatto
Copy link
Member

I finally found what is triggering ffap.
We are calling ffap-guess-file-name-at-point indirectly by calling file-name-at-point-functions which contains it by default.
Should be fixed now by let binding ffap-machine-p-known.
Thanks again to catch this.

@mplsgrant
Copy link
Author

Thank you for the quick response, and I am happy to help by submitting these kinds of issues.

I added the following to my init.el:

(setq ffap-machine-p-known 'reject)

It seems to have solved the immediate problem; however, I do feel uneasy knowing that ffap may still lurk out there waiting to send my text to websites at its discretion.

@mplsgrant
Copy link
Author

I noticed the fix uses the following code:

(setq ffap-machine-p-known 'accept)

Should I set it to reject or accept?

@thierryvolpiatto
Copy link
Member

thierryvolpiatto commented Nov 29, 2022 via email

@thierryvolpiatto
Copy link
Member

thierryvolpiatto commented Nov 29, 2022 via email

@mplsgrant
Copy link
Author

Thanks again. I'll close this as it seems to me to be resolved.

@thierryvolpiatto
Copy link
Member

thierryvolpiatto commented Nov 29, 2022 via email

@thierryvolpiatto
Copy link
Member

thierryvolpiatto commented Nov 29, 2022 via email

@mplsgrant
Copy link
Author

I went ahead and added a setq for p-local and p-unkown just to be safe.

Also, earlier I had poked around over in an emacs-release repo and I agree with your conclusion regarding the safeness of reject and accept.

@ncaq
Copy link
Contributor

ncaq commented Feb 6, 2023

I noticed this problem today.
I have the exact same problem.
The version of helm is 20230129.
The version of Emacs is GNU Emacs 28.2.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0) of 2023-02-06.
I rewrote (t ffap-machine-p-known) to (t (print ffap-machine-p-known)) in the ffap-machine-p function and traced it.
It seems to return ping without any change.
I'm overriding it with let... is the static scope causing the problem?
Or is it because the method of calling the function is a bit special?
At any rate, I tried changing it to (ffap-machine-p-known . 'accept) to work around it.

ncaq added a commit to ncaq/.emacs.d that referenced this issue Feb 6, 2023
[Pinging init.as (American Samoa) · Issue #2574 · emacs-helm/helm](emacs-helm/helm#2574)
@thierryvolpiatto
Copy link
Member

thierryvolpiatto commented Feb 6, 2023 via email

@ncaq
Copy link
Contributor

ncaq commented Feb 7, 2023

  1. I modify ffap-machine-p, 1443 line of ffap.el, (t ffap-machine-p-known) -> (t (print ffap-machine-p-known)).
  2. I confirm ffap-machine-p-known of global value is ping.
  3. I open text file below.
example.com
  1. I execute C-x b as switch-to-buffer with enable helm minor mode on domain text.
  2. Emacs display Pinging example.com (Commercial)..., and helm do not execute.
  3. Emacs Message ping, not accept

I confirm helm-guess-filename-at-point let ((ffap-machine-p-known 'accept)), And I get backtrace, helm-guess-filename-at-point is in backtrace.
However, ffap-machine-p-known is ping.

I'm sure I can rewrite here even if I use lexical scope...I couldn't figure out the cause.
Is run-hook-with-args-until-success doing something special?

@thierryvolpiatto
Copy link
Member

thierryvolpiatto commented Feb 7, 2023 via email

@ncaq
Copy link
Contributor

ncaq commented Feb 8, 2023

I will try the minimum reproduction setting next time.

Please don't do that.

This happened without doing this.
Then I realized the problem, and this was just to trace the variable.

What is this? I can't open it, just show the string you have at point.

My apologies for the lack of explanation.
This meant to open a text file that just contains example.com.

@thierryvolpiatto
Copy link
Member

thierryvolpiatto commented Feb 10, 2023 via email

@ncaq ncaq moved this to Todo in @ncaq TODO Feb 13, 2023
@ncaq ncaq added this to @ncaq TODO Feb 13, 2023
PalaceChan pushed a commit to PalaceChan/Configuration that referenced this issue Feb 17, 2023
some context: emacs-helm/helm#2574
(let binding ffap stuff without requiring ffap gave error "defining as dynamic
an already lexical var")
ncaq added a commit to ncaq/.emacs.d that referenced this issue Sep 14, 2023
[Pinging init.as (American Samoa) · Issue #2574 · emacs-helm/helm](emacs-helm/helm#2574)
はよくわからないうちに解消されたようです。
これがあると自動でURLを選択出来ないので設定を削除します。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants