diff options
author | Oleg Pykhalov <go.wigust@gmail.com> | 2018-02-03 00:11:49 +0300 |
---|---|---|
committer | Oleg Pykhalov <go.wigust@gmail.com> | 2018-02-09 22:15:21 +0300 |
commit | 61995dce5038dc801bca5a3ea1419ced2c6bd69c (patch) | |
tree | 6fb2ac82630a0ae74a1c81684a25787babd6d6c5 | |
parent | af414f34fb6e3609e572880f3b0b3bbcb1b3bfc6 (diff) | |
download | guix-61995dce5038dc801bca5a3ea1419ced2c6bd69c.tar guix-61995dce5038dc801bca5a3ea1419ced2c6bd69c.tar.gz |
gnu: emacs-browse-at-remote: Patch for GNU Cgit support.
* gnu/packages/patches/emacs-browse-at-remote-cgit-gnu.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/emacs.scm (emacs-browse-at-remote)[source](patches): Use it.
-rw-r--r-- | gnu/local.mk | 1 | ||||
-rw-r--r-- | gnu/packages/emacs.scm | 2 | ||||
-rw-r--r-- | gnu/packages/patches/emacs-browse-at-remote-cgit-gnu.patch | 59 |
3 files changed, 62 insertions, 0 deletions
diff --git a/gnu/local.mk b/gnu/local.mk index 25999fc17e..925057dc70 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -619,6 +619,7 @@ dist_patch_DATA = \ %D%/packages/patches/elfutils-tests-ptrace.patch \ %D%/packages/patches/elixir-disable-failing-tests.patch \ %D%/packages/patches/einstein-build.patch \ + %D%/packages/patches/emacs-browse-at-remote-cgit-gnu.patch \ %D%/packages/patches/emacs-exec-path.patch \ %D%/packages/patches/emacs-fix-scheme-indent-function.patch \ %D%/packages/patches/emacs-json-reformat-fix-tests.patch \ diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index 18f457abb2..99e78d454c 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -6569,6 +6569,8 @@ Idris.") (url "https://github.com/rmuslimov/browse-at-remote.git") (commit commit))) (file-name (string-append name "-" version "-checkout")) + (patches + (search-patches "emacs-browse-at-remote-cgit-gnu.patch")) (sha256 (base32 "017cb8lf7zbg0jmr7zxzd7d5kz2jy35cvw5vcpdmq1fdr3wqwkgj")))) diff --git a/gnu/packages/patches/emacs-browse-at-remote-cgit-gnu.patch b/gnu/packages/patches/emacs-browse-at-remote-cgit-gnu.patch new file mode 100644 index 0000000000..b90017fdb4 --- /dev/null +++ b/gnu/packages/patches/emacs-browse-at-remote-cgit-gnu.patch @@ -0,0 +1,59 @@ +Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com> + +This patch adds a support for Git repositories hosted on git.savannah.gnu.org. + +Upstream bug URL: + +https://github.com/rmuslimov/browse-at-remote/pull/46 + +From cd2ccdaef8b1d97337d790175f71cc3dbcfcff64 Mon Sep 17 00:00:00 2001 +From: Oleg Pykhalov <go.wigust@gmail.com> +Date: Fri, 26 Jan 2018 00:05:30 +0300 +Subject: [PATCH] Add support for repositories that are hosted on gnu cgit + +--- + browse-at-remote.el | 21 ++++++++++++++++++++- + 1 file changed, 20 insertions(+), 1 deletion(-) + +diff --git a/browse-at-remote.el b/browse-at-remote.el +index 66967b3..e210d18 100644 +--- a/browse-at-remote.el ++++ b/browse-at-remote.el +@@ -44,7 +44,8 @@ + (defcustom browse-at-remote-remote-type-domains + '(("bitbucket.org" ."bitbucket") + ("github.com" . "github") +- ("gitlab.com" . "gitlab")) ++ ("gitlab.com" . "gitlab") ++ ("git.savannah.gnu.org" . "gnu")) + "Alist of domain patterns to remote types." + + :type '(alist :key-type (string :tag "Domain") +@@ -199,6 +200,24 @@ If HEAD is detached, return nil." + (if (fboundp formatter) + formatter nil))) + ++(defun browse-at-remote-gnu-format-url (repo-url) ++ "Get a gnu formatted URL." ++ (replace-regexp-in-string ++ (concat "https://" (car (rassoc "gnu" browse-at-remote-remote-type-domains)) ++ "/\\(git\\).*\\'") ++ "cgit" repo-url nil nil 1)) ++ ++(defun browse-at-remote--format-region-url-as-gnu (repo-url location filename &optional linestart lineend) ++ "URL formatter for gnu." ++ (let ((repo-url (browse-at-remote-gnu-format-url repo-url))) ++ (cond ++ (linestart (format "%s.git/tree/%s?h=%s#n%d" repo-url filename location linestart)) ++ (t (format "%s.git/tree/%s?h=%s" repo-url filename location))))) ++ ++(defun browse-at-remote--format-commit-url-as-gnu (repo-url commithash) ++ "Commit URL formatted for gnu" ++ (format "%s.git/commit/?id=%s" (browse-at-remote-gnu-format-url repo-url) commithash)) ++ + (defun browse-at-remote--format-region-url-as-github (repo-url location filename &optional linestart lineend) + "URL formatted for github." + (cond +-- +2.15.1 + |