all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: John Soo <jsoo1@asu.edu>
To: 45575@debbugs.gnu.org
Subject: [bug#45575] Add emacs-merlin
Date: Thu, 31 Dec 2020 14:00:48 -0800	[thread overview]
Message-ID: <87ble94ovj.fsf@asu.edu> (raw)
In-Reply-To: <87eej54upy.fsf@asu.edu>

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

I wanted to make autoloads and byte-compile the elisp provided by
merlin.  After fiddling with the emacs output of ocaml-merlin, I found
it much easier to just make an emacs package for merlin.  There is
further work to do to make a vim merlin package but I am not familiar
enough with vim to continue.

- John


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-emacs-merlin.patch --]
[-- Type: text/x-patch, Size: 3959 bytes --]

From 902849f8b8f586347dfd7810c46acc754a323592 Mon Sep 17 00:00:00 2001
From: John Soo <jsoo1@asu.edu>
Date: Thu, 31 Dec 2020 13:34:57 -0800
Subject: [PATCH] gnu: Add emacs-merlin.

* gnu/packages/emacs-xyz.scm (emacs-merlin): New variable.
* gnu/packages/ocaml.scm (ocaml-merlin): [arguments] Remove elisp from output,
[description] Note location of emacs package.
---
 gnu/packages/emacs-xyz.scm | 39 ++++++++++++++++++++++++++++++++++++++
 gnu/packages/ocaml.scm     | 11 +++++++++--
 2 files changed, 48 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 0d8d6837e1..a97bd5ce1e 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -135,6 +135,7 @@
   #:use-module (gnu packages haskell-apps)
   #:use-module (gnu packages ibus)
   #:use-module (gnu packages ncurses)
+  #:use-module (gnu packages ocaml)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages telephony)
@@ -646,6 +647,44 @@ process, passing on the arguments as command line arguments.")
        "Magit-annex adds a few git-annex operations to the Magit interface.")
       (license license:gpl3+))))
 
+(define-public emacs-merlin
+  (package
+    (name "emacs-merlin")
+    (version "3.4.2")
+    (home-page "https://ocaml.github.io/merlin/")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/ocaml/merlin")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0i2nwkdh6cfzmnsdsr8aw86vs8j1k5jkjzrs61b9384wnffdbbmj"))))
+    (build-system emacs-build-system)
+    (propagated-inputs
+     `(("emacs-auto-complete" ,emacs-auto-complete)
+       ("emacs-company" ,emacs-company)
+       ("emacs-iedit" ,emacs-iedit)
+       ("ocaml-merlin" ,ocaml-merlin)))
+    (arguments
+     `(#:tests? #f ; No tests
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'setup-emacs-build
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let ((merlin (assoc-ref inputs "ocaml-merlin")))
+               (chdir "emacs")
+               (for-each make-file-writable (find-files "." "\\.el$"))
+               (emacs-substitute-variables "merlin.el"
+                 ("merlin-command"
+                  (string-append merlin "/bin/ocamlmerlin")))))))))
+    (synopsis "Context sensitive completion for OCaml in Emacs")
+    (description "Merlin is an editor service that provides modern IDE
+features for OCaml.  This package provides the Emacs support for Merlin.")
+    (license license:expat)))
+
 (define-public emacs-minions
   (package
     (name "emacs-minions")
diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index bb5d6c4e92..5f8cf4613d 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -4070,12 +4070,19 @@ documentation always stays up-to-date.")
      `(("ocaml-dot-merlin-reader" ,ocaml-dot-merlin-reader)))
     (arguments
      `(#:package "merlin"
-       #:test-target "tests"))
+       #:test-target "tests"
+       #:phases
+       ;; FIXME: Make merlin.vim into a separate package.
+       (modify-phases %standard-phases
+         (add-after 'install 'remove-emacs
+           (lambda* (#:key outputs #:allow-other-keys)
+             (delete-file-recursively
+              (string-append (assoc-ref outputs "out") "/share/emacs")))))))
     (synopsis "Context sensitive completion for OCaml in Vim and Emacs")
     (description "Merlin is an editor service that provides modern IDE
 features for OCaml.  Emacs and Vim support is provided out-of-the-box.
 External contributors added support for Visual Studio Code, Sublime Text and
-Atom.")
+Atom.  To install the emacs specific package, use @code{emacs-ocaml-merlin}.")
     (license license:expat)))
 
 (define-public ocaml4.07-merlin
-- 
2.29.2


  reply	other threads:[~2020-12-31 22:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-31 19:54 [bug#45575] gnu: Update ocaml-merlin John Soo
2020-12-31 22:00 ` John Soo [this message]
2020-12-31 22:05 ` [bug#45575] Add emacs-merlin John Soo
2020-12-31 22:13 ` John Soo
2020-12-31 22:32 ` [bug#45575] gnu: Update ocaml-merlin Julien Lepiller
2020-12-31 23:50   ` John Soo
2021-01-24 18:40 ` bug#45575: Already done John Soo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ble94ovj.fsf@asu.edu \
    --to=jsoo1@asu.edu \
    --cc=45575@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.