unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Jack Hill <jackhill@jackhill.us>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 31726@debbugs.gnu.org
Subject: bug#31726: confirming proposed change
Date: Fri, 8 Jun 2018 15:46:46 -0400 (EDT)	[thread overview]
Message-ID: <alpine.DEB.2.20.1806081534020.1480@marsh.hcoop.net> (raw)
In-Reply-To: <87po11l59e.fsf@gnu.org>

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

On Fri, 8 Jun 2018, Ludovic Courtès wrote:

> Hi,
>
> Jack Hill <jackhill@jackhill.us> skribis:
>
>> Sure, I'll give make a path a go. You're thinking that I should try
>> applying the changes that the commit introduced as part of our package
>> definition?
>
> Yes, either that or use a snapshot of upstream haskell-mode.

I have started workign on a patch implementing the former. I've included 
what I have so far below, but it's not ready to be included in the 
distribution because not all of the tests pass. Maybe this is because the 
one patch shouldn't be applied in issolation and it would be bettter to 
take the snapshot approach?

Otherwise, is what I did with the package revision reasonable?

Thanks,
Jack

From 62ae1a14c48f3d70e6f47ffd6de60a0b9af9d43f Mon Sep 17 00:00:00 2001
From: Jack Hill <jackhill@jackhill.us>
Date: Thu, 7 Jun 2018 22:54:12 -0400
Subject: [PATCH] Patch haskell-mode to remove unused lexical variables

---
  gnu/packages/emacs.scm                             | 174 +++++++++++----------
  ...ell-mode-removed-unused-lexical-variables.patch |  42 +++++
  2 files changed, 131 insertions(+), 85 deletions(-)
  create mode 100644 gnu/packages/patches/haskell-mode-removed-unused-lexical-variables.patch

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index e90660a23..5e93cd2b8 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -631,92 +631,96 @@ only a handful of functions that are not resource-specific.")
      (license license:gpl3+)))

  (define-public haskell-mode
-  (package
-    (name "haskell-mode")
-    (version "16.1")
-    (source (origin
-              (method url-fetch)
-              (file-name (string-append name "-" version ".tar.gz"))
-              (uri (string-append
-                    "https://github.com/haskell/haskell-mode/archive/v"
-                    version ".tar.gz"))
-              (sha256
-               (base32 "0g6lcjw7lcgavv3yrd8xjcyqgfyjl787y32r1z14amw2f009m78h"))))
-    (inputs
-     `(("emacs-el-search" ,emacs-el-search) ; for tests
-       ("emacs-stream" ,emacs-stream)))     ; for tests
-    (propagated-inputs
-     `(("emacs-dash" ,emacs-dash)))
-    (native-inputs
-     `(("emacs" ,emacs-minimal)
-       ("texinfo" ,texinfo)))
-    (build-system gnu-build-system)
-    (arguments
-     `(#:make-flags (list (string-append "EMACS="
-                                         (assoc-ref %build-inputs "emacs")
-                                         "/bin/emacs"))
-       #:modules ((ice-9 match)
-                  (srfi srfi-26)
-                  ,@%gnu-build-system-modules)
-       #:phases
-       (modify-phases %standard-phases
-         (delete 'configure)
-         (add-before
-          'build 'pre-build
-          (lambda* (#:key inputs #:allow-other-keys)
-            (define (el-dir store-dir)
-              (match (find-files store-dir "\\.el$")
-                ((f1 f2 ...) (dirname f1))
-                (_ "")))
-
-            (let ((sh (string-append (assoc-ref inputs "bash") "/bin/sh")))
-              (define emacs-prefix? (cut string-prefix? "emacs-" <>))
-
-              (setenv "SHELL" "sh")
-              (setenv "EMACSLOADPATH"
-                      (string-concatenate
-                       (map (match-lambda
-                              (((? emacs-prefix? name) . dir)
-                               (string-append (el-dir dir) ":"))
-                              (_ ""))
-                            inputs)))
-              (substitute* (find-files "." "\\.el") (("/bin/sh") sh))
-              (substitute* "tests/haskell-code-conventions.el"
-                ;; Function name recently changed in "emacs-el-search".
-                (("el-search--search-pattern") "el-search-forward")
-                ;; Don't contact home.
-                (("\\(when \\(>= emacs-major-version 25\\)")
-                 "(require 'el-search) (when nil"))
-              #t)))
-         (replace
-          'install
-          (lambda* (#:key outputs #:allow-other-keys)
-            (let* ((out (assoc-ref outputs "out"))
-                   (el-dir (string-append out "/share/emacs/site-lisp"))
-                   (doc (string-append
-                         out "/share/doc/haskell-mode-" ,version))
-                   (info (string-append out "/share/info")))
-              (define (copy-to-dir dir files)
-                (for-each (lambda (f)
-                            (install-file f dir))
-                          files))
-
-              (with-directory-excursion "doc"
-                (unless (zero? (system* "makeinfo" "haskell-mode.texi"))
-                  (error "makeinfo failed"))
-                (install-file "haskell-mode.info" info))
-               (copy-to-dir doc '("CONTRIBUTING.md" "NEWS" "README.md"))
-               (copy-to-dir el-dir (find-files "." "\\.elc?"))
-               ;; These are part of other packages.
-               (with-directory-excursion el-dir
-                 (for-each delete-file '("dash.el" "ert.el")))
-               #t))))))
-    (home-page "https://github.com/haskell/haskell-mode")
-    (synopsis "Haskell mode for Emacs")
-    (description
-     "This is an Emacs mode for editing, debugging and developing Haskell
+  (let ((release "16.1")
+        (revision "1"))
+    (package
+      (name "haskell-mode")
+      (version (string-append release "-" revision))
+      (source (origin
+                (method url-fetch)
+                (file-name (string-append name "-" release ".tar.gz"))
+                (uri (string-append
+                      "https://github.com/haskell/haskell-mode/archive/v"
+                      release ".tar.gz"))
+                (sha256
+                 (base32 "0g6lcjw7lcgavv3yrd8xjcyqgfyjl787y32r1z14amw2f009m78h"))
+                (patches
+                 (search-patches "haskell-mode-removed-unused-lexical-variables.patch"))))
+      (inputs
+       `(("emacs-el-search" ,emacs-el-search) ; for tests
+         ("emacs-stream" ,emacs-stream)))     ; for tests
+      (propagated-inputs
+       `(("emacs-dash" ,emacs-dash)))
+      (native-inputs
+       `(("emacs" ,emacs-minimal)
+         ("texinfo" ,texinfo)))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:make-flags (list (string-append "EMACS="
+                                           (assoc-ref %build-inputs "emacs")
+                                           "/bin/emacs"))
+         #:modules ((ice-9 match)
+                    (srfi srfi-26)
+                    ,@%gnu-build-system-modules)
+         #:phases
+         (modify-phases %standard-phases
+           (delete 'configure)
+           (add-before
+               'build 'pre-build
+             (lambda* (#:key inputs #:allow-other-keys)
+               (define (el-dir store-dir)
+                 (match (find-files store-dir "\\.el$")
+                   ((f1 f2 ...) (dirname f1))
+                   (_ "")))
+
+               (let ((sh (string-append (assoc-ref inputs "bash") "/bin/sh")))
+                 (define emacs-prefix? (cut string-prefix? "emacs-" <>))
+
+                 (setenv "SHELL" "sh")
+                 (setenv "EMACSLOADPATH"
+                         (string-concatenate
+                          (map (match-lambda
+                                 (((? emacs-prefix? name) . dir)
+                                  (string-append (el-dir dir) ":"))
+                                 (_ ""))
+                               inputs)))
+                 (substitute* (find-files "." "\\.el") (("/bin/sh") sh))
+                 (substitute* "tests/haskell-code-conventions.el"
+                   ;; Function name recently changed in "emacs-el-search".
+                   (("el-search--search-pattern") "el-search-forward")
+                   ;; Don't contact home.
+                   (("\\(when \\(>= emacs-major-version 25\\)")
+                    "(require 'el-search) (when nil"))
+                 #t)))
+           (replace
+               'install
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (el-dir (string-append out "/share/emacs/site-lisp"))
+                      (doc (string-append
+                            out "/share/doc/haskell-mode-" ,version))
+                      (info (string-append out "/share/info")))
+                 (define (copy-to-dir dir files)
+                   (for-each (lambda (f)
+                               (install-file f dir))
+                             files))
+
+                 (with-directory-excursion "doc"
+                   (unless (zero? (system* "makeinfo" "haskell-mode.texi"))
+                     (error "makeinfo failed"))
+                   (install-file "haskell-mode.info" info))
+                 (copy-to-dir doc '("CONTRIBUTING.md" "NEWS" "README.md"))
+                 (copy-to-dir el-dir (find-files "." "\\.elc?"))
+                 ;; These are part of other packages.
+                 (with-directory-excursion el-dir
+                   (for-each delete-file '("dash.el" "ert.el")))
+                 #t))))))
+      (home-page "https://github.com/haskell/haskell-mode")
+      (synopsis "Haskell mode for Emacs")
+      (description
+       "This is an Emacs mode for editing, debugging and developing Haskell
  programs.")
-    (license license:gpl3+)))
+      (license license:gpl3+))))

  (define-public flycheck
    (package
diff --git a/gnu/packages/patches/haskell-mode-removed-unused-lexical-variables.patch b/gnu/packages/patches/haskell-mode-removed-unused-lexical-variables.patch
new file mode 100644
index 000000000..a618df5fb
--- /dev/null
+++ b/gnu/packages/patches/haskell-mode-removed-unused-lexical-variables.patch
@@ -0,0 +1,42 @@
+From cee22450ee30e79952f594796721dc6b17798ee6 Mon Sep 17 00:00:00 2001
+From: Sascha Wilde <wilde@sha-bang.de>
+Date: Fri, 23 Sep 2016 15:35:59 +0200
+Subject: [PATCH] Removed unused lexical variables.
+
+---
+ haskell-lexeme.el  | 3 +--
+ haskell-process.el | 4 +---
+ 2 files changed, 2 insertions(+), 5 deletions(-)
+
+diff --git a/haskell-lexeme.el b/haskell-lexeme.el
+index 4256a79..b832560 100644
+--- a/haskell-lexeme.el
++++ b/haskell-lexeme.el
+@@ -138,8 +138,7 @@ When match is successful, match-data will contain:
+   (match-text 2) - whole qualified identifier
+   (match-text 3) - unqualified part of identifier
+   (match-text 4) - closing backtick"
+-  (let ((begin (point))
+-        (match-data-old (match-data))
++  (let ((match-data-old (match-data))
+         first-backtick-start
+         last-backtick-start
+         qid-start
+diff --git a/haskell-process.el b/haskell-process.el
+index b4efba2..4f3f859 100644
+--- a/haskell-process.el
++++ b/haskell-process.el
+@@ -160,9 +160,7 @@ HPTYPE is the result of calling `'haskell-process-type`' function."
+ (defun haskell-process-log (msg)
+   "Effective append MSG to the process log (if enabled)."
+   (when haskell-process-log
+-    (let* ((append-to (get-buffer-create "*haskell-process-log*"))
+-           (windows (get-buffer-window-list append-to t t))
+-           move-point-in-windows)
++    (let* ((append-to (get-buffer-create "*haskell-process-log*")))
+       (with-current-buffer append-to
+         ;; point should follow insertion so that it stays at the end
+         ;; of the buffer
+-- 
+2.11.0
+
-- 
2.11.0

  reply	other threads:[~2018-06-08 19:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-05 16:27 bug#31726: haskell-mode fails to build with (at least) Emacs 26.1 Jack Hill
     [not found] ` <handler.31726.B.1528217025308.ack@debbugs.gnu.org>
2018-06-05 21:02   ` bug#31726: Acknowledgement (haskell-mode fails to build with (at least) Emacs 26.1) Jack Hill
2018-06-07 16:14     ` Ludovic Courtès
2018-06-07 21:43 ` bug#31726: confirming proposed change Jack Hill
2018-06-08 14:30   ` Ludovic Courtès
2018-06-08 19:46     ` Jack Hill [this message]
2018-06-09 20:34       ` Ludovic Courtès
2018-07-20 19:58 ` bug#31726: Attempt to use git reference for haskell-mode Jack Hill
2018-07-23  8:20   ` Ludovic Courtès

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=alpine.DEB.2.20.1806081534020.1480@marsh.hcoop.net \
    --to=jackhill@jackhill.us \
    --cc=31726@debbugs.gnu.org \
    --cc=ludo@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).