unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: mekeor@posteo.de
To: 63987@debbugs.gnu.org
Subject: [bug#63987] [PATCH] gnu: Add emacs-jinx.
Date: Fri, 09 Jun 2023 23:00:37 +0000	[thread overview]
Message-ID: <88d5ddf1b26b5f4c23601780aa29158e46a6cbfe.1686354110.git.mekeor@posteo.de> (raw)

* gnu/packages/emacs-xyz.scm (emacs-jinx): New variable.
---
Hello Guix! I have some questions about this patch that I'm submitting:

- emacs-jinx needs gcc at build time. Should I use gcc-toolchain (or
  rather the internal gcc) package?

- When using the module (gnu packages commencement), I first got the
  following warning. That's why I decided to use it with a prefix
  instead. What do you think about that?

  WARNING: (gnu packages emacs-xyz): `canonical-package' imported from
  both (gnu packages base) and (gnu packages commencement)

- I did not introduce any (revision "0") variable or so. I hope that's
  okay. I'm not sure when to use it.

- I placed the package declaration right after other spelling related
  Emacs packages. Unfortunately, the declaration of emacs-jit-spell is
  not close. I could send another additional patch that moves all
  spelling-related Emacs packages into an own section, if you'd like.
  Like this:

  ;;;
  ;;; Spelling
  ;;;

Anyways. Cheers!

 gnu/packages/emacs-xyz.scm | 73 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 0ea9732bfa..7e4f1a1fea 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -148,6 +148,7 @@
 
 (define-module (gnu packages emacs-xyz)
   #:use-module ((guix licenses) #:prefix license:)
+  #:use-module ((gnu packages commencement) #:prefix commencement:)
   #:use-module (guix packages)
   #:use-module (guix cvs-download)
   #:use-module (guix download)
@@ -265,6 +266,7 @@ (define-module (gnu packages emacs-xyz)
   #:use-module (gnu packages virtualization)
   #:use-module (gnu packages web-browsers)
   #:use-module (gnu packages wget)
+  #:use-module (gnu packages enchant)
   #:use-module (guix utils)
   #:use-module (srfi srfi-1)
   #:use-module (ice-9 match))
@@ -31922,6 +31924,77 @@ (define-public emacs-spell-fu
 that runs from the syntax highlighter without starting external processes.")
       (license license:gpl3+))))
 
+(define-public emacs-jinx
+  (package
+    (name "emacs-jinx")
+    (version "0.8")
+    (source
+      (origin
+        (method git-fetch)
+        (uri
+          (git-reference
+            (url "https://github.com/minad/jinx")
+            (commit "7fced90fdaca5a482cd08b80967e0eac5ee8d885")))
+        (file-name (git-file-name name version))
+        (sha256
+          (base32
+            "1y097rnf9zg26jf4vh74a0laddfp4x6pp1fjqs3xqgwc0cmdq59w"))))
+    (build-system emacs-build-system)
+    (propagated-inputs (list emacs-compat))
+    (native-inputs
+      (list
+        emacs-compat
+        enchant
+        commencement:gcc-toolchain
+        pkg-config
+        texinfo))
+    (inputs (list enchant))
+    (arguments
+      (list
+        #:phases
+        #~(modify-phases %standard-phases
+            ;; Compile the accompanying jinx-mod.c file with Emacs and
+            ;; jinx.el. This needs to happen after expand-load-path phase so
+            ;; that jinx.el is able to load emacs-compat.
+            (add-after 'expand-load-path 'compile-jinx-mod-c
+              (lambda _
+                (invoke
+                  "emacs" "--batch" "-L" "."
+                  "-l" "jinx.el"
+                  "-f" "jinx--load-module")
+                (install-file "jinx-mod.so"
+                  (string-append #$output "/lib"))))
+            ;; Patch Jinx.el to load the previously compiled jinx-mod.so from
+            ;; correct output path instead of attempting to compile it.
+            (add-after 'compile-jinx-mod-c 'use-compiled-jinx-mod-so
+              (lambda _
+                (let ((file "jinx.el"))
+                  (make-file-writable file)
+                  (emacs-substitute-sexps file
+                    ("\"Compile and load dynamic module.\""
+                      `(module-load
+                         ,(string-append #$output "/lib/jinx-mod.so")))))))
+            (add-after 'install 'makeinfo
+              (lambda _
+                (invoke "emacs" "--batch"
+                  "--eval=(require 'ox-texinfo)"
+                  "--eval=(find-file \"README.org\")"
+                  "--eval=(org-texinfo-export-to-info)")
+                (install-file "jinx.info"
+                  (string-append #$output "/share/info")))))))
+    (home-page "https://github.com/minad/jinx")
+    (synopsis "Emacs Enchanted Spell Checker")
+    (description
+      "Jinx is a fast just-in-time spell-checker for Emacs.  Jinx highlights
+misspelled words in the text of the visible portion of the buffer.  For
+efficiency, Jinx highlights misspellings lazily, recognizes window boundaries
+and text folding, if any.  For example, when unfolding or scrolling, only the
+newly visible part of the text is checked if it has not been checked before.
+Each misspelling can be corrected from a list of dictionary words presented as
+a completion menu.  Jinx's high performance and low resource usage comes from
+directly calling the widely-used API of the Enchant library.")
+    (license license:gpl3+)))
+
 (define-public emacs-org-emms
   (let ((commit "07a8917f3d628c32e5de1dbd118ac08203772533")
         (revision "1"))

base-commit: 297ba5c15a32845ab8514aeb6f405ebd4290142d
-- 
2.39.2






             reply	other threads:[~2023-06-09 23:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-09 23:00 mekeor [this message]
2023-06-18 11:34 ` [bug#63987] Should jinx-mod.so be installed into /.../lib or into /.../share/emacs/site-lisp/...? Mekeor Melire
2023-06-18 11:56   ` Liliana Marie Prikler
2023-06-20 22:04     ` Mekeor Melire
2023-06-21  4:23       ` Liliana Marie Prikler
2023-06-18 12:14 ` [bug#63987] [PATCH] gnu: Add emacs-jinx Liliana Marie Prikler
2023-06-18 23:02 ` [bug#63987] [PATCH v2] " Mekeor Melire
2023-06-18 23:17 ` [bug#63987] [PATCH v3] " Mekeor Melire
2023-09-09 10:30   ` bug#63987: " Liliana Marie Prikler

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=88d5ddf1b26b5f4c23601780aa29158e46a6cbfe.1686354110.git.mekeor@posteo.de \
    --to=mekeor@posteo.de \
    --cc=63987@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).