gnu: emacs-browse-at-remote: Update to 0.10.0.

* gnu/packages/emacs.scm (emacs-browse-at-remote): Update to 0.10.0.
* gnu/packages/patches/emacs-browse-at-remote-cgit-gnu.patch: Delete file.
* gnu/local.mk (dist_patch_DATA): Remove it.
This commit is contained in:
Oleg Pykhalov 2018-06-30 22:35:12 +03:00
parent 545ceac801
commit 9602318736
No known key found for this signature in database
GPG Key ID: 7246E11C69B79569
3 changed files with 27 additions and 91 deletions

View File

@ -649,7 +649,6 @@ dist_patch_DATA = \
%D%/packages/patches/elfutils-tests-ptrace.patch \ %D%/packages/patches/elfutils-tests-ptrace.patch \
%D%/packages/patches/elogind-glibc-2.27.patch \ %D%/packages/patches/elogind-glibc-2.27.patch \
%D%/packages/patches/einstein-build.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-exec-path.patch \
%D%/packages/patches/emacs-fix-scheme-indent-function.patch \ %D%/packages/patches/emacs-fix-scheme-indent-function.patch \
%D%/packages/patches/emacs-json-reformat-fix-tests.patch \ %D%/packages/patches/emacs-json-reformat-fix-tests.patch \

View File

@ -7027,39 +7027,35 @@ Idris.")
(license license:gpl3+))) (license license:gpl3+)))
(define-public emacs-browse-at-remote (define-public emacs-browse-at-remote
(let ((commit "31dcf77d7c89a12f230e2b2332585db2c44530ef") (package
(revision "1")) (name "emacs-browse-at-remote")
(package (version "0.10.0")
(name "emacs-browse-at-remote") (source
(version (string-append "0.9.0-" revision "." (origin
(string-take commit 7))) (method url-fetch)
(source (origin (uri (string-append
(method git-fetch) "https://github.com/rmuslimov/browse-at-remote/archive/"
(uri (git-reference version ".tar.gz"))
(url "https://github.com/rmuslimov/browse-at-remote.git") (file-name (string-append name "-" version ".tar.gz"))
(commit commit))) (sha256
(file-name (string-append name "-" version "-checkout")) (base32
(patches "0ymslsp6i1naw25zckv25bf4aaq6qwkbkn95qyzlwg869l802686"))))
(search-patches "emacs-browse-at-remote-cgit-gnu.patch")) (build-system emacs-build-system)
(sha256 (propagated-inputs
(base32 `(("emacs-f" ,emacs-f)
"017cb8lf7zbg0jmr7zxzd7d5kz2jy35cvw5vcpdmq1fdr3wqwkgj")))) ("emacs-s" ,emacs-s)))
(build-system emacs-build-system) (native-inputs
(propagated-inputs `(("ert-runner" ,ert-runner)))
`(("emacs-f" ,emacs-f) (arguments
("emacs-s" ,emacs-s))) `(#:tests? #t
(native-inputs #:test-command '("ert-runner")))
`(("ert-runner" ,ert-runner))) (home-page "https://github.com/rmuslimov/browse-at-remote")
(arguments (synopsis "Open github/gitlab/bitbucket/stash page from Emacs")
`(#:tests? #t (description
#:test-command '("ert-runner"))) "This Emacs package allows you to open a target page on
(home-page "https://github.com/rmuslimov/browse-at-remote")
(synopsis "Open github/gitlab/bitbucket/stash page from Emacs")
(description
"This Emacs package allows you to open a target page on
github/gitlab (or bitbucket) by calling @code{browse-at-remote} command. github/gitlab (or bitbucket) by calling @code{browse-at-remote} command.
It supports dired buffers and opens them in tree mode at destination.") It supports dired buffers and opens them in tree mode at destination.")
(license license:gpl3+)))) (license license:gpl3+)))
(define-public emacs-tiny (define-public emacs-tiny
(package (package

View File

@ -1,59 +0,0 @@
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