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

support for http #114

Open
drdv opened this issue Nov 25, 2023 · 2 comments
Open

support for http #114

drdv opened this issue Nov 25, 2023 · 2 comments

Comments

@drdv
Copy link

drdv commented Nov 25, 2023

Sometimes I need to have http instead of https in the links. Currently I deal with this using

(use-package git-link
  :ensure t
  :bind ("C-c g l" . git-link)
  :config
  (setq git-link-open-in-browser t)
  (defun git-link--http-advice (func link)
    (funcall func (replace-regexp-in-string "^https:" "http:" link)))
  (defun git-link-toggle-http-advice ()
    "Toggle using http or https by advicing `git-link--new'."
    (interactive)
    (if (advice--p (advice--symbol-function 'git-link--new))
	(advice-remove 'git-link--new 'git-link--http-advice)
      (advice-add 'git-link--new :around 'git-link--http-advice)))
  (git-link-toggle-http-advice))

But clearly there is a better way to deal with this. It seems to me that it is trivial to support this in the code (e.g., by adding a variable instead of hard-coding https in the links).

@sshaw
Copy link
Owner

sshaw commented Nov 26, 2023

What services do you need to link to using http?

@drdv
Copy link
Author

drdv commented Nov 26, 2023

self-hosted gitlab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants