From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34515) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehjAn-0007A7-Dv for guix-patches@gnu.org; Fri, 02 Feb 2018 16:47:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ehjAk-0002g1-9I for guix-patches@gnu.org; Fri, 02 Feb 2018 16:47:05 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:46746) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ehjAk-0002fe-5I for guix-patches@gnu.org; Fri, 02 Feb 2018 16:47:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ehjAj-00085n-Ro for guix-patches@gnu.org; Fri, 02 Feb 2018 16:47:01 -0500 Subject: [bug#30328] [PATCH] gnu: Add emacs-browse-at-remote-gnu. Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34326) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehj9m-0006x7-Pf for guix-patches@gnu.org; Fri, 02 Feb 2018 16:46:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ehj9j-0001n9-Ca for guix-patches@gnu.org; Fri, 02 Feb 2018 16:46:02 -0500 Received: from mail-lf0-x230.google.com ([2a00:1450:4010:c07::230]:33856) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ehj9j-0001mK-0V for guix-patches@gnu.org; Fri, 02 Feb 2018 16:45:59 -0500 Received: by mail-lf0-x230.google.com with SMTP id k19so33587371lfj.1 for ; Fri, 02 Feb 2018 13:45:58 -0800 (PST) From: Oleg Pykhalov Date: Sat, 3 Feb 2018 00:44:57 +0300 Message-Id: <20180202214457.14147-1-go.wigust@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 30328@debbugs.gnu.org * gnu/packages/emacs.scm (emacs-browse-at-remote-gnu): New public variable. * gnu/packages/patches/emacs-browse-at-remote-gnu-add-support-for-gnu-repositories.patch: New file. * gnu/local.mk (dist_patch_DATA): Add this. --- gnu/local.mk | 1 + gnu/packages/emacs.scm | 10 ++++ ...mote-gnu-add-support-for-gnu-repositories.patch | 59 ++++++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 gnu/packages/patches/emacs-browse-at-remote-gnu-add-support-for-gnu-repositories.patch diff --git a/gnu/local.mk b/gnu/local.mk index 6fdea16c8..088ddee85 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -617,6 +617,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-gnu-add-support-for-gnu-repositories.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 9523f14da..827469217 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -6470,6 +6470,16 @@ github/gitlab (or bitbucket) by calling @code{browse-at-remote} command. It supports dired buffers and opens them in tree mode at destination.") (license license:gpl3+)))) +(define-public emacs-browse-at-remote-gnu + (package + (inherit emacs-browse-at-remote) + (name "emacs-browse-at-remote-gnu") + (source + (origin + (inherit (package-source emacs-browse-at-remote)) + (patches (search-patches "emacs-browse-at-remote-gnu\ +-add-support-for-gnu-repositories.patch")))))) + (define-public emacs-tiny (package (name "emacs-tiny") diff --git a/gnu/packages/patches/emacs-browse-at-remote-gnu-add-support-for-gnu-repositories.patch b/gnu/packages/patches/emacs-browse-at-remote-gnu-add-support-for-gnu-repositories.patch new file mode 100644 index 000000000..b90017fdb --- /dev/null +++ b/gnu/packages/patches/emacs-browse-at-remote-gnu-add-support-for-gnu-repositories.patch @@ -0,0 +1,59 @@ +Copyright © 2018 Oleg Pykhalov + +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 +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 + -- 2.15.1