unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#65717] [PATCH] gnu: Add emacs-latex-extra.
@ 2023-09-03 17:52 Sergiu Ivanov
  2023-09-03 19:44 ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Sergiu Ivanov @ 2023-09-03 17:52 UTC (permalink / raw)
  To: 65717

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

Dear Guix,

Here's a patch packaging the MELPA package https://github.com/Malabarba/latex-extra .

Thanks!

-
Sergiu

[-- Attachment #2: 0001-gnu-Add-emacs-latex-extra.patch --]
[-- Type: text/x-patch, Size: 2379 bytes --]

From d0e143ed7f1ac22891e67cf354ccecb7439c190a Mon Sep 17 00:00:00 2001
From: Sergiu Ivanov <sivanov@colimite.fr>
Date: Sun, 3 Sep 2023 19:29:03 +0200
Subject: [PATCH] gnu: Add emacs-latex-extra.

* gnu/packages/emacs-xyz.scm (emacs-latex-extra): New variable.
---
 gnu/packages/emacs-xyz.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index dc2998a217..9dc9bcc6a7 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -132,6 +132,7 @@
 ;;; Copyright © 2023 Fabio Natali <me@fabionatali.com>
 ;;; Copyright © 2023 Arnaud Lechevallier <arnaud.lechevallier@free.fr>
 ;;; Copyright © 2023 Ahmad Draidi <a.r.draidi@redscript.org>
+;;; Copyright © 2023 Sergiu Ivanov <sivanov@colimite.fr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -4067,6 +4068,36 @@ (define-public emacs-auctex
 or XEmacs.")
     (license license:gpl3+)))
 
+(define-public emacs-latex-extra
+  (let ((commit "a81e7588448f85c5fcc3f3fc71cf957d0928a656")
+        (revision "0"))
+    (package
+      (name "emacs-latex-extra")
+      (version (git-version "1.14" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/Malabarba/latex-extra")
+                      (commit commit)))
+                (sha256
+                 (base32
+                  "0sajg5vmygnkcnmkrpf8r7c4b8v95hgsv1y6pz868jpznmldnxkb"))
+                (file-name (git-file-name name version))))
+      (build-system emacs-build-system)
+      (arguments
+       `(#:phases (modify-phases %standard-phases
+                    (add-before 'build 'set-home
+                      (lambda _
+                        (setenv "HOME"
+                                (getcwd)))))))
+      (inputs (list emacs-auctex))
+      (home-page "https://github.com/Malabarba/latex-extra")
+      (synopsis "Usability improvements for latex-mode")
+      (description
+       "Latex-extra defines extra commands and keys for LaTeX-mode, as well
+as brings user experience improvements.")
+      (license license:gpl3+))))
+
 (define-public emacs-autothemer
   (let ((commit "8f72afc6dba5ad7cc3a201a084fd20571f945d2e")) ;version bump
     (package
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [bug#65717] [PATCH] gnu: Add emacs-latex-extra.
  2023-09-03 17:52 [bug#65717] [PATCH] gnu: Add emacs-latex-extra Sergiu Ivanov
@ 2023-09-03 19:44 ` Nicolas Goaziou
  2023-09-04 20:16   ` Sergiu Ivanov
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Goaziou @ 2023-09-03 19:44 UTC (permalink / raw)
  To: Sergiu Ivanov; +Cc: 65717

Hello,

Sergiu Ivanov <sivanov@colimite.fr> writes:

> Subject: [PATCH] gnu: Add emacs-latex-extra.

Thank you.

Some comments follow.

> +      (build-system emacs-build-system)
> +      (arguments
> +       `(#:phases (modify-phases %standard-phases
> +                    (add-before 'build 'set-home
> +                      (lambda _
> +                        (setenv "HOME"
> +                                (getcwd)))))))

Why is it needed ?

Also, upstream provides tests. Could you run them?

> +      (inputs (list emacs-auctex))

Usually, inputs are propagated, although it doesn't make a difference
for Emacs.

> +      (home-page "https://github.com/Malabarba/latex-extra")
> +      (synopsis "Usability improvements for latex-mode")

Nitpick: "latex-mode" -> "LaTeX mode"

> +      (description
> +       "Latex-extra defines extra commands and keys for LaTeX-mode, as well
> +as brings user experience improvements.")

Nitpick: "LaTeX-mode" -> "LaTeX mode"

Could you send an updated patch?

Regards,
-- 
Nicolas Goaziou




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug#65717] [PATCH] gnu: Add emacs-latex-extra.
  2023-09-03 19:44 ` Nicolas Goaziou
@ 2023-09-04 20:16   ` Sergiu Ivanov
  2023-09-05 12:50     ` bug#65717: " Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Sergiu Ivanov @ 2023-09-04 20:16 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: 65717

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

Hello Nicolas,

Thank you very much for your feedback.


Nicolas Goaziou <mail@nicolasgoaziou.fr> [2023-09-03T21:44:49+0200]:
> Hello,
>
> Sergiu Ivanov <sivanov@colimite.fr> writes:
>
>> Subject: [PATCH] gnu: Add emacs-latex-extra.
>
> Thank you.
>
> Some comments follow.
>
>> +      (build-system emacs-build-system)
>> +      (arguments
>> +       `(#:phases (modify-phases %standard-phases
>> +                    (add-before 'build 'set-home
>> +                      (lambda _
>> +                        (setenv "HOME"
>> +                                (getcwd)))))))
>
> Why is it needed ?

If I don't explicitly set $HOME, the build fails with

Debugger entered--Lisp error: (file-missing "Setting current directory" "No such file or directory" "/homeless-shelter/")
  call-process("sh" nil t nil "-c" "evince --help")
  call-process-shell-command("evince --help" nil t)
  shell-command("evince --help" t)
  shell-command-to-string("evince --help")
  TeX-view-program-select-evince("gnome" "evince")
  ...

> Also, upstream provides tests. Could you run them?

I tried adding the following to the arguments list:

#:tests? #t
#:test-command '("make" "test")

and the build now fails with this error:


starting phase `check'
echo "hi " /tmp/guix-build-emacs-latex-extra-1.14-0.a81e758.drv-0/source && \
emacs -Q --batch -L "auctex-11.87.7/" -L "tests/auctex-11.87.7/" -l "auctex-autoloads.el"   -L . -L .. -L tests/ --eval \
    "(progn                                \
      (unless (fboundp 'function-put) (defalias 'function-put #'(lambda (f prop value) (put f prop value)))) \
      (defun define-error (name message &optional parent) (unless parent (setq parent 'error)) (let ((conditions (if (consp parent) (apply #'nconc (mapcar (lambda (parent) (cons parent (or (get parent 'error-conditions) (error \"Unknown signal %s\" parent)))) parent)) (cons parent (get parent 'error-conditions))))) (put name 'error-conditions (delete-dups (copy-sequence (cons name conditions)))) (when message (put name 'error-message message)))) \
      (setq byte-compile-error-on-warn t)  \
      (batch-byte-compile))" *.el
hi  /tmp/guix-build-emacs-latex-extra-1.14-0.a81e758.drv-0/source
Eager macro-expansion failure: (error "Package cl is deprecated")
Eager macro-expansion failure: (error "Package cl is deprecated")

In toplevel form:
latex-extra.el:130:1: Error: Package cl is deprecated
make: *** [Makefile:25: build] Error 1
error: in phase 'check': uncaught exception:
%exception #<&invoke-error program: "make" arguments: ("test" "-j" "8") exit-status: 2 term-signal: #f stop-signal: #f> 
phase `check' failed after 0.1 seconds


I hunted around emacs-xyz.scm and tried using ert-runner, which
complained that the tests are in the wrong directory, since it expects
apparently the tests to be under test/ and not tests/, as in the case of
latex-extra.  Still, by looking at how the test target is defined in the
Makefile of latex-extra, I think that this is not the problem.  On the
other hand, I don't believe that package cl being deprecated is the
problem either, since that is normally a warning and not an error.

Do you have any ideas as to how to debug this kind of issues?

FWIW, I am already using the draft version of this package out of my
private channel, and it works nicely, so this problem seems to be
specific for the tests.


>> +      (inputs (list emacs-auctex))
>
> Usually, inputs are propagated, although it doesn't make a difference
> for Emacs.

I changed this to propagated-inputs.

>> +      (home-page "https://github.com/Malabarba/latex-extra")
>> +      (synopsis "Usability improvements for latex-mode")
>
> Nitpick: "latex-mode" -> "LaTeX mode"

Fixed.

>> +      (description
>> +       "Latex-extra defines extra commands and keys for LaTeX-mode, as well
>> +as brings user experience improvements.")
>
> Nitpick: "LaTeX-mode" -> "LaTeX mode"

Fixed as well.

-
Sergiu

[-- Attachment #2: 0001-gnu-Add-emacs-latex-extra.patch --]
[-- Type: text/x-patch, Size: 2390 bytes --]

From c8fe800f453c139177dcfb28bbe59b1cd362a902 Mon Sep 17 00:00:00 2001
From: Sergiu Ivanov <sivanov@colimite.fr>
Date: Sun, 3 Sep 2023 19:29:03 +0200
Subject: [PATCH] gnu: Add emacs-latex-extra.

* gnu/packages/emacs-xyz.scm (emacs-latex-extra): New variable.
---
 gnu/packages/emacs-xyz.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index dc2998a217..6815d8410f 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -132,6 +132,7 @@
 ;;; Copyright © 2023 Fabio Natali <me@fabionatali.com>
 ;;; Copyright © 2023 Arnaud Lechevallier <arnaud.lechevallier@free.fr>
 ;;; Copyright © 2023 Ahmad Draidi <a.r.draidi@redscript.org>
+;;; Copyright © 2023 Sergiu Ivanov <sivanov@colimite.fr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -4067,6 +4068,36 @@ (define-public emacs-auctex
 or XEmacs.")
     (license license:gpl3+)))
 
+(define-public emacs-latex-extra
+  (let ((commit "a81e7588448f85c5fcc3f3fc71cf957d0928a656")
+        (revision "0"))
+    (package
+      (name "emacs-latex-extra")
+      (version (git-version "1.14" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/Malabarba/latex-extra")
+                      (commit commit)))
+                (sha256
+                 (base32
+                  "0sajg5vmygnkcnmkrpf8r7c4b8v95hgsv1y6pz868jpznmldnxkb"))
+                (file-name (git-file-name name version))))
+      (build-system emacs-build-system)
+      (arguments
+       `(#:phases (modify-phases %standard-phases
+                    (add-before 'build 'set-home
+                      (lambda _
+                        (setenv "HOME"
+                                (getcwd)))))))
+      (propagated-inputs (list emacs-auctex))
+      (home-page "https://github.com/Malabarba/latex-extra")
+      (synopsis "Usability improvements for LaTeX mode")
+      (description
+       "Latex-extra defines extra commands and keys for LaTeX mode, as well
+as brings user experience improvements.")
+      (license license:gpl3+))))
+
 (define-public emacs-autothemer
   (let ((commit "8f72afc6dba5ad7cc3a201a084fd20571f945d2e")) ;version bump
     (package
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#65717: [PATCH] gnu: Add emacs-latex-extra.
  2023-09-04 20:16   ` Sergiu Ivanov
@ 2023-09-05 12:50     ` Nicolas Goaziou
  0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Goaziou @ 2023-09-05 12:50 UTC (permalink / raw)
  To: Sergiu Ivanov; +Cc: 65717-done

Hello,

Sergiu Ivanov <sivanov@colimite.fr> writes:

> If I don't explicitly set $HOME, the build fails with
>
> Debugger entered--Lisp error: (file-missing "Setting current directory" "No such file or directory" "/homeless-shelter/")

OK.

> I tried adding the following to the arguments list:
>
> #:tests? #t
> #:test-command '("make" "test")

Sometimes, it is necessary to skip the Makefile step and write
explicitly what the Makefile is doing right into #:test-command.

Here, I called `ert-run-tests-batch-and-exit' after loading the test
library. The unusual part was the tests required to be run from within
the "tests/" directory, hence the `cd' evaluation:


        #:test-command
        #~(list "emacs" "-Q" "--batch"
                "--eval=(cd \"tests/\")"
                "-l" "latex-extra-test.el"
                "-f" "ert-run-tests-batch-and-exit")

I applied your patch. Thank you!

Regards,
-- 
Nicolas Goaziou




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-09-05 13:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-03 17:52 [bug#65717] [PATCH] gnu: Add emacs-latex-extra Sergiu Ivanov
2023-09-03 19:44 ` Nicolas Goaziou
2023-09-04 20:16   ` Sergiu Ivanov
2023-09-05 12:50     ` bug#65717: " Nicolas Goaziou

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).