diff options
-rw-r--r-- | gnu/local.mk | 6 | ||||
-rw-r--r-- | gnu/packages/emacs-xyz.scm | 312 | ||||
-rw-r--r-- | gnu/packages/emacs.scm | 457 | ||||
-rw-r--r-- | gnu/packages/mail.scm | 6 | ||||
-rw-r--r-- | gnu/packages/patches/emacs-all-the-icons-remove-duplicate-rs.patch | 21 | ||||
-rw-r--r-- | gnu/packages/patches/emacs-haskell-mode-no-redefine-builtin.patch | 75 | ||||
-rw-r--r-- | gnu/packages/patches/emacs-helpful-fix-tests.patch | 28 | ||||
-rw-r--r-- | gnu/packages/patches/emacs-source-date-epoch.patch | 20 | ||||
-rw-r--r-- | gnu/packages/patches/emacs-yasnippet-fix-empty-snippet-next.patch | 59 | ||||
-rw-r--r-- | gnu/packages/patches/emacs-yasnippet-fix-tests.patch | 14 | ||||
-rw-r--r-- | gnu/packages/patches/notmuch-emacs-test-output.patch | 89 | ||||
-rw-r--r-- | guix/build/emacs-utils.scm | 14 |
12 files changed, 629 insertions, 472 deletions
diff --git a/gnu/local.mk b/gnu/local.mk index ee4567c857..99819286d7 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1092,21 +1092,24 @@ dist_patch_DATA = \ %D%/packages/patches/elm-offline-package-registry.patch \ %D%/packages/patches/elm-reactor-static-files.patch \ %D%/packages/patches/elogind-fix-rpath.patch \ + %D%/packages/patches/emacs-all-the-icons-remove-duplicate-rs.patch \ %D%/packages/patches/emacs-deferred-fix-number-of-arguments.patch \ %D%/packages/patches/emacs-exec-path.patch \ %D%/packages/patches/emacs-ess-fix-obsolete-function-alias.patch \ %D%/packages/patches/emacs-git-email-missing-parens.patch \ %D%/packages/patches/emacs-fix-scheme-indent-function.patch \ %D%/packages/patches/emacs-json-reformat-fix-tests.patch \ + %D%/packages/patches/emacs-haskell-mode-no-redefine-builtin.patch \ + %D%/packages/patches/emacs-helpful-fix-tests.patch \ %D%/packages/patches/emacs-highlight-stages-add-gexp.patch \ %D%/packages/patches/emacs-lispy-fix-thread-last-test.patch \ %D%/packages/patches/emacs-native-comp-driver-options.patch \ %D%/packages/patches/emacs-pasp-mode-quote-file-names.patch \ %D%/packages/patches/emacs-polymode-fix-lexical-variable-error.patch \ - %D%/packages/patches/emacs-source-date-epoch.patch \ %D%/packages/patches/emacs-telega-path-placeholder.patch \ %D%/packages/patches/emacs-telega-test-env.patch \ %D%/packages/patches/emacs-wordnut-require-adaptive-wrap.patch \ + %D%/packages/patches/emacs-yasnippet-fix-empty-snippet-next.patch \ %D%/packages/patches/emacs-yasnippet-fix-tests.patch \ %D%/packages/patches/emacs-kv-fix-tests.patch \ %D%/packages/patches/emacs-pgtk-super-key-fix.patch \ @@ -1651,6 +1654,7 @@ dist_patch_DATA = \ %D%/packages/patches/network-manager-meson.patch \ %D%/packages/patches/nginx-socket-cloexec.patch \ %D%/packages/patches/nnpack-system-libraries.patch \ + %D%/packages/patches/notmuch-emacs-test-output.patch \ %D%/packages/patches/nsis-env-passthru.patch \ %D%/packages/patches/nss-getcwd-nonnull.patch \ %D%/packages/patches/nss-increase-test-timeout.patch \ diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index 977d553ea5..3514ae5fbe 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -1407,6 +1407,10 @@ on stdout instead of using a socket as the Emacsclient does.") (substitute* "test/submodule-test.el" (("\\(ert-deftest (status|ids) .*" all) (string-append all " (skip-unless nil)"))))) + (add-after 'unpack 'ert-number-tests + (lambda _ + (ert-number-tests "test/repository-test.el" + "repository-head-for-worktree"))) (add-before 'install 'prepare-for-install (lambda _ (let ((s "../source")) @@ -2249,99 +2253,99 @@ replacement.") (license license:gpl3+)))) (define-public emacs-haskell-mode - (let ((revision "0") - (commit "5a9f8072c7b9168f0a8409adf9d62a3e4ad4ea3d")) - (package - (name "emacs-haskell-mode") - (version (git-version "17.2" revision commit)) - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/haskell/haskell-mode") - (commit commit))) - (file-name (git-file-name name version)) - (sha256 - (base32 "0np1wrwdq7b9hpqpl9liampacnkx6diphyk8h2sbz2mfn9qr7pxs")))) - (propagated-inputs - (list emacs-dash)) - (native-inputs - (list emacs-minimal emacs-el-search emacs-stream texinfo)) - (build-system gnu-build-system) - (arguments - (list - #:make-flags #~(list - (string-append "EMACS=" #$emacs-minimal "/bin/emacs")) - #:modules `((ice-9 match) - (srfi srfi-26) - ((guix build emacs-build-system) #:prefix emacs:) - ,@%gnu-build-system-modules) - #:imported-modules `(,@%gnu-build-system-modules - (guix build emacs-build-system) - (guix build emacs-utils)) - #: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)) - (_ ""))) + (package + (name "emacs-haskell-mode") + (version "17.4") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/haskell/haskell-mode") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "03j94fgw1bljbjqmikbn9mnrfifxf7g9zrb727zmnnrjwyi0wd4n")) + (patches + (search-patches "emacs-haskell-mode-no-redefine-builtin.patch")))) + (propagated-inputs + (list emacs-dash)) + (native-inputs + (list emacs-minimal emacs-el-search emacs-stream texinfo)) + (build-system gnu-build-system) + (arguments + (list + #:make-flags #~(list + (string-append "EMACS=" #$emacs-minimal "/bin/emacs")) + #:modules `((ice-9 match) + (srfi srfi-26) + ((guix build emacs-build-system) #:prefix emacs:) + ,@%gnu-build-system-modules) + #:imported-modules `(,@%gnu-build-system-modules + (guix build emacs-build-system) + (guix build emacs-utils)) + #: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 (search-input-file inputs "/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))))) - (add-before 'check 'delete-failing-tests - ;; XXX: these tests require GHC executable, which would be a big - ;; native input. - (lambda _ - (with-directory-excursion "tests" - ;; File `haskell-indent-tests.el' fails with - ;; `haskell-indent-put-region-in-literate-2' - ;; on Emacs 27.1+ - ;; XXX: https://github.com/haskell/haskell-mode/issues/1714 - (for-each delete-file - '("haskell-indent-tests.el" - "haskell-customize-tests.el" - "inferior-haskell-tests.el")) - - ;; requires many external tools (e.g. git, hasktags) - (substitute* "haskell-mode-tests.el" - (("\\(ert-deftest haskell-generate-tags.*" all) - (string-append all " (skip-unless nil)")))))) - (replace 'install - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (el-dir (emacs:elpa-directory out)) - (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" - (invoke "makeinfo" "haskell-mode.texi") - (install-file "haskell-mode.info" info)) - (copy-to-dir doc '("CONTRIBUTING.md" "NEWS" "README.md")) - (copy-to-dir el-dir (find-files "." "\\.elc?")))))))) - (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 ((sh (search-input-file inputs "/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))))) + (add-before 'check 'delete-failing-tests + ;; XXX: these tests require GHC executable, which would be a big + ;; native input. + (lambda _ + (with-directory-excursion "tests" + ;; File `haskell-indent-tests.el' fails with + ;; `haskell-indent-put-region-in-literate-2' + ;; on Emacs 27.1+ + ;; XXX: https://github.com/haskell/haskell-mode/issues/1714 + (for-each delete-file + '("haskell-indent-tests.el" + "haskell-customize-tests.el" + "inferior-haskell-tests.el")) + + ;; requires many external tools (e.g. git, hasktags) + (substitute* "haskell-mode-tests.el" + (("\\(ert-deftest haskell-generate-tags.*" all) + (string-append all " (skip-unless nil)")))))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (el-dir (emacs:elpa-directory out)) + (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" + (invoke "makeinfo" "haskell-mode.texi") + (install-file "haskell-mode.info" info)) + (copy-to-dir doc '("CONTRIBUTING.md" "NEWS" "README.md")) + (copy-to-dir el-dir (find-files "." "\\.elc?")))))))) + (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 emacs-dante (package @@ -17113,7 +17117,8 @@ the Emacs TempEl package.") (sha256 (base32 "0via9dzw8m5lzymg1h78xkwjssh39zr3g6ccyamlf1rjzjsyxknv")) (patches - (search-patches "emacs-yasnippet-fix-tests.patch")))) + (search-patches "emacs-yasnippet-fix-empty-snippet-next.patch" + "emacs-yasnippet-fix-tests.patch")))) (build-system emacs-build-system) (arguments `(#:tests? #t @@ -18090,7 +18095,7 @@ in Emacs.") (define-public emacs-php-mode (package (name "emacs-php-mode") - (version "1.24.3") + (version "1.25.0") (source (origin (method git-fetch) @@ -18099,7 +18104,7 @@ in Emacs.") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "01yw10z1kf38nz4z3gmpx56wmc7a7caf4nk6rccg0w4kklqw1h94")))) + (base32 "1vwbxaxjvz2hhb6pli1bh1qlrc2r991zl4i18wiwk78ffanqx6q0")))) (build-system emacs-build-system) (arguments (list @@ -21900,8 +21905,8 @@ object has been freed.") (license license:unlicense))) (define-public emacs-emacsql - (let ((commit "e1baaf2f874df7f9259a8ecca978e03d3ddae5b5") - (revision "0")) + (let ((commit "29194a63ede3ee24c7457c2fde03b0f1320ca4b1") + (revision "1")) (package (name "emacs-emacsql") (version (git-version "3.1.1" revision commit)) @@ -21913,7 +21918,7 @@ object has been freed.") (commit commit))) (file-name (git-file-name name version)) (sha256 - (base32 "0dvqs1jg5zqn0i3r67sn1a40h5rm961q9vxvmqxbgvdhkjvip8fn")))) + (base32 "14yj53xxqi3009bdj39k2fqwyc896yp2m7gdkgyv47wlkh1xwzxh")))) (build-system emacs-build-system) (arguments (list @@ -21929,12 +21934,6 @@ object has been freed.") (srfi srfi-26)) #:phases #~(modify-phases %standard-phases - (add-before 'install 'remove-sqlite-builtin - ;; Current emacs 28.2 doesn't have sqlite feature and compilation - ;; of this file fails. This phase should be removed, when emacs - ;; package is updated to 29. - (lambda _ - (delete-file "emacsql-sqlite-builtin.el"))) (add-before 'install 'patch-elisp-shell-shebangs (lambda _ (substitute* (find-files "." "\\.el") @@ -21972,47 +21971,6 @@ has no concept of @code{TEXT} values; it's all just Lisp objects. The Lisp object @code{nil} corresponds 1:1 with @code{NULL} in the database.") (license license:gpl3+)))) -(define-public emacs-emacsql-sqlite3 - ;; This commit contains changes necessary for Sqlite 3.38+. - (let ((commit "2113618732665f2112cb932a66c0e89c404d8777") - (revision "1")) - (package - (name "emacs-emacsql-sqlite3") - (version (git-version "1.0.2" revision commit)) - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/cireu/emacsql-sqlite3") - (commit commit))) - (file-name (git-file-name name version)) - (sha256 - (base32 "0r8svrd0d4cflx8a8gkynnhafcpv3ksn9rds8dhyx5yibximbzsw")))) - (build-system emacs-build-system) - (arguments - `(#:tests? #t - #:test-command '("emacs" "-Q" "--batch" "-L" "." - "--load" "emacsql-sqlite3-test.el" - "-f" "ert-run-tests-batch-and-exit") - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'embed-path-to-sqlite3 - (lambda _ - (substitute* "emacsql-sqlite3.el" - (("\\(executable-find \"sqlite3\"\\)") - (string-append "\"" (which "sqlite3") "\"")))))))) - (native-inputs - (list emacs-ert-runner)) - (inputs - (list sqlite)) - (propagated-inputs - (list emacs-emacsql)) - (home-page "https://github.com/cireu/emacsql-sqlite3") - (synopsis "EmacSQL backend for SQLite") - (description "This is yet another EmacSQL backend for SQLite which uses -official @command{sqlite3} executable to access SQL database.") - (license license:gpl3+)))) - (define-public emacs-closql (package (name "emacs-closql") @@ -24410,31 +24368,30 @@ downloading manager for Emacs.") (license license:gpl3+)))) (define-public emacs-helpful - (let ((commit "1c98f6f06a85def5d34c735f8cd407f20cebddf9") - (revision "1")) - (package - (name "emacs-helpful") - (version (git-version "0.19" revision commit)) - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/Wilfred/helpful") - (commit commit))) - (file-name (git-file-name name version)) - (sha256 - (base32 "18b5hjfji51zxjrxhkklxx3j9svk295awmxv8n95mp8ilas2kd3l")))) - (build-system emacs-build-system) - (propagated-inputs - (list emacs-dash emacs-elisp-refs emacs-f emacs-s)) - (native-inputs - (list emacs-ert-runner emacs-undercover)) - (arguments - `(#:tests? #t - #:test-command '("ert-runner"))) - (home-page "https://github.com/Wilfred/helpful") - (synopsis "More contextual information in Emacs help") - (description "@code{helpful} is an alternative to the built-in Emacs help + (package + (name "emacs-helpful") + (version "0.21") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/Wilfred/helpful") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "03afgdbs5nmhw833svrqky7fmfs1zlvqzcj7j5g29sakivs60xqc")) + (patches (search-patches "emacs-helpful-fix-tests.patch")))) + (build-system emacs-build-system) + (propagated-inputs + (list emacs-dash emacs-elisp-refs emacs-f emacs-s)) + (native-inputs + (list emacs-ert-runner emacs-undercover)) + (arguments + `(#:tests? #t + #:test-command '("ert-runner"))) + (home-page "https://github.com/Wilfred/helpful") + (synopsis "More contextual information in Emacs help") + (description "@code{helpful} is an alternative to the built-in Emacs help that provides much more contextual information. @itemize @@ -24453,7 +24410,7 @@ functions. @item Trace, disassemble functions from inside Helpful. This is discoverable and doesn't require memorisation of commands. @end itemize\n") - (license license:gpl3+)))) + (license license:gpl3+))) (define-public emacs-logview (package @@ -27820,6 +27777,8 @@ files are easily readable and they work nicely with version control systems.") (url "https://github.com/domtronn/all-the-icons.el") (commit version))) (file-name (git-file-name name version)) + (patches + (search-patches "emacs-all-the-icons-remove-duplicate-rs.patch")) (sha256 (base32 "0lwgvgnqf7vihglm0c5bwsxbl4x7f641289cji5s7jwy2dbsqk7g")))) (build-system emacs-build-system) @@ -27840,10 +27799,12 @@ files are easily readable and they work nicely with version control systems.") (install-file "octicons.ttf" fonts) (install-file "weathericons.ttf" fonts))))) (replace 'check - (lambda* (#:key outputs #:allow-other-keys) - (apply invoke "ert-runner" "-l" - (append (find-files "data" "\\.el") - '("all-the-icons-faces.el")))))))) + (lambda* (#:key tests? outputs #:allow-other-keys) + (if tests? + (apply invoke "ert-runner" "-l" + (append (find-files "data" "\\.el") + '("all-the-icons-faces.el"))) + (format #t "test suite not run~%"))))))) (native-inputs (list emacs-f emacs-ert-runner)) (propagated-inputs @@ -30382,7 +30343,6 @@ JavaScript.") (base32 "0cbchri4117wjcnlk3npi4x1sfx248vck1q61cis8drrrz4c8jyp")) (file-name (git-file-name name version)))) (build-system emacs-build-system) - (arguments (list #:emacs emacs-next)) (propagated-inputs (list emacs-dash emacs-s @@ -35299,7 +35259,7 @@ go directly to where they belong.") (list texinfo)) (propagated-inputs (list emacs-dash - emacs-emacsql-sqlite3 + emacs-emacsql emacs-f emacs-magit emacs-org diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index d3689c2474..cbdc0598b1 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -54,6 +54,7 @@ #:use-module (gnu packages acl) #:use-module (gnu packages autotools) #:use-module (gnu packages base) + #:use-module (gnu packages bash) #:use-module (gnu packages compression) #:use-module (gnu packages fontutils) #:use-module (gnu packages freedesktop) @@ -94,20 +95,21 @@ (srfi srfi-1) (ice-9 ftw)))) -(define-public emacs +(define-public emacs-minimal (package - (name "emacs") - (version "28.2") + (name "emacs-minimal") + (version "29.1") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/emacs/emacs-" version ".tar.xz")) (sha256 (base32 - "12144dcaihv2ymfm7g2vnvdl4h71hqnsz1mljzf34cpg6ci1h8gf")) + "009f7q08vg919b90k2jrsznq73s3n224avz80dd2y7i3rjjq3y6j")) (patches (search-patches "emacs-exec-path.patch" "emacs-fix-scheme-indent-function.patch" - "emacs-source-date-epoch.patch")) + "emacs-native-comp-driver-options.patch" + "emacs-pgtk-super-key-fix.patch")) (modules '((guix build utils))) (snippet '(with-directory-excursion "lisp" @@ -138,37 +140,14 @@ "\"~/.guix-profile/include\"" "\"/var/guix/profiles/system/profile/include\"") " "))))))) - (build-system glib-or-gtk-build-system) + (build-system gnu-build-system) (arguments (list - #:tests? #f ; no check target + #:tests? #f ; no check target #:modules (%emacs-modules build-system) - #:configure-flags #~(list "--with-modules" - "--with-cairo" - "--with-native-compilation" - "--disable-build-details") - #:make-flags #~(list "NATIVE_FULL_AOT=1") + #:configure-flags #~(list "--with-gnutls=no" "--disable-build-details") #:phases #~(modify-phases %standard-phases - (add-after 'set-paths 'set-libgccjit-path - (lambda* (#:key inputs #:allow-other-keys) - (define (first-subdirectory/absolute directory) - (let ((files (scandir - directory - (lambda (file) - (and (not (member file '("." ".."))) - (file-is-directory? (string-append - directory "/" - file))))))) - (and (not (null? files)) - (string-append directory "/" (car files))))) - (let* ((libgccjit-libdir - (first-subdirectory/absolute ;; version - (first-subdirectory/absolute ;; host type - (search-input-directory inputs "lib/gcc"))))) - (setenv "LIBRARY_PATH" - (string-append (getenv "LIBRARY_PATH") - ":" libgccjit-libdir))))) (add-after 'unpack 'enable-elogind (lambda _ (substitute* "configure.ac" @@ -199,20 +178,6 @@ (("\\(tramp-compat-process-running-p \"(.*)\"\\)" all process) (format #f "(or ~a (tramp-compat-process-running-p ~s))" all (string-append "." process "-real")))))) - (add-after 'unpack 'patch-compilation-driver - (lambda _ - (substitute* "lisp/emacs-lisp/comp.el" - (("\\(defcustom native-comp-driver-options nil") - (format - #f "(defcustom native-comp-driver-options '(~@{~s~^ ~})" - (string-append - "-B" #$(this-package-input "binutils") "/bin/") - (string-append - "-B" #$(this-package-input "glibc") "/lib/") - (string-append - "-B" #$(this-package-input "libgccjit") "/lib/") - (string-append - "-B" #$(this-package-input "libgccjit") "/lib/gcc/")))))) (add-before 'configure 'fix-/bin/pwd (lambda _ ;; Use `pwd', not `/bin/pwd'. @@ -254,29 +219,7 @@ (delete-file (string-append lisp-dir "/subdirs.el")) ;; Byte compile the site-start files. (emacs-byte-compile-directory lisp-dir)))) - (add-after 'glib-or-gtk-wrap 'restore-emacs-pdmp - ;; restore the dump file that Emacs installs somewhere in - ;; libexec/ to its original state - (lambda* (#:key outputs target #:allow-other-keys) - (let* ((libexec (string-append (assoc-ref outputs "out") - "/libexec")) - ;; each of these ought to only match a single file, - ;; but even if not (find-files) sorts by string<, - ;; so the Nth element in one maps to the Nth element of - ;; the other - (pdmp (find-files libexec "\\.pdmp$")) - (pdmp-real (find-files libexec "\\.pdmp-real$"))) - (for-each rename-file pdmp-real pdmp)))) - (add-after 'glib-or-gtk-wrap 'strip-double-wrap - (lambda* (#:key outputs #:allow-other-keys) - ;; Directly copy emacs-X.Y to emacs, so that it is not wrapped - ;; twice. This also fixes a minor issue, where WMs would not be - ;; able to track emacs back to emacs.desktop. - (with-directory-excursion (assoc-ref outputs "out") - (copy-file - (car (find-files "bin" "^emacs-([0-9]+\\.)+[0-9]+$")) - "bin/emacs")))) - (add-after 'strip-double-wrap 'wrap-emacs-paths + (add-after 'install 'wrap-emacs-paths (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (lisp-dirs (find-files (string-append out "/share/emacs") @@ -285,9 +228,9 @@ (for-each (lambda (prog) (wrap-program prog - ;; emacs-next and variants rely on uname being in PATH for - ;; Tramp. Tramp paths can't be hardcoded, because they - ;; need to be portable. + ;; Some variants rely on uname being in PATH for Tramp. + ;; Tramp paths can't be hardcoded, because they need to + ;; be portable. `("PATH" suffix ,(map dirname (list (search-input-file inputs "/bin/gzip") @@ -300,64 +243,30 @@ ;; environment variables from emacs. ;; Likewise, we don't need to patch helper binaries ;; like etags, ctags or ebrowse. - "^emacs(-[0-9]+(\\.[0-9]+)*)?$")))))))) - (inputs - (list gnutls - ncurses - - ;; To "unshadow" ld-wrapper in native builds - (make-ld-wrapper "ld-wrapper" #:binutils binutils) - - ;; For native compilation - binutils - (libc-for-target) - libgccjit - - ;; Required for "core" functionality, such as dired and compression. - coreutils - gzip - - ;; Avoid Emacs's limited movemail substitute that retrieves POP3 - ;; email only via insecure channels. - ;; This is not needed for (modern) IMAP. - mailutils - - gpm - libx11 - gtk+ - cairo - pango - harfbuzz - libxft - libtiff - giflib - lcms - libjpeg-turbo - libselinux - acl - jansson - gmp - ghostscript - poppler - elogind - - ;; When looking for libpng `configure' links with `-lpng -lz', so we - ;; must also provide zlib as an input. - libpng - zlib - (librsvg-for-system) - libxpm - libxml2 - libice - libsm - alsa-lib - dbus - - ;; multilingualization support - libotf - m17n-lib)) - (native-inputs - (list autoconf pkg-config texinfo)) + "^emacs(-[0-9]+(\\.[0-9]+)*)?$"))))) + (add-after 'wrap-emacs-paths 'undo-double-wrap + (lambda* (#:key outputs #:allow-other-keys) + ;; Directly copy emacs-X.Y to emacs, so that it is not wrapped + ;; twice. This also fixes a minor issue, where WMs would not be + ;; able to track emacs back to emacs.desktop. + (with-directory-excursion (assoc-ref outputs "out") + (copy-file + (car (find-files "bin" "^emacs-([0-9]+\\.)+[0-9]+$")) + "bin/emacs"))))))) + (inputs (list bash-minimal coreutils gzip ncurses)) + (native-inputs (list autoconf pkg-config texinfo)) + (home-page "https://www.gnu.org/software/emacs/") + (synopsis "The extensible text editor (minimal build for byte-compilation)") + (description + "GNU Emacs is an extensible and highly customizable text editor. It is +based on an Emacs Lisp interpreter with extensions for text editing. Emacs +has been extended in essentially all areas of computing, giving rise to a +vast array of packages supporting, e.g., email, IRC and XMPP messaging, +spreadsheets, remote server editing, and much more. Emacs includes extensive +documentation on all aspects of the system, from basic editing to writing +large Lisp programs. It has full Unicode support for nearly all human +languages.") + (license license:gpl3+) (native-search-paths (list (search-path-specification (variable "EMACSLOADPATH") @@ -368,200 +277,200 @@ (search-path-specification (variable "INFOPATH") (files '("share/info"))) - ;; tree-sitter support is not yet available in emacs 28, but this - ;; search path won't harm and also will be beneficial for - ;; emacs-next and other emacs-* packages, which have tree-sitter - ;; support enabled. Please, remove this comment, when emacs - ;; package is updated to 29. + ;; Most variants support tree-sitter, so let's include it here. (search-path-specification (variable "TREE_SITTER_GRAMMAR_PATH") - (files '("lib/tree-sitter"))))) - - (home-page "https://www.gnu.org/software/emacs/") - (synopsis "The extensible, customizable, self-documenting text editor") - (description - "GNU Emacs is an extensible and highly customizable text editor. It is -based on an Emacs Lisp interpreter with extensions for text editing. Emacs -has been extended in essentially all areas of computing, giving rise to a -vast array of packages supporting, e.g., email, IRC and XMPP messaging, -spreadsheets, remote server editing, and much more. Emacs includes extensive -documentation on all aspects of the system, from basic editing to writing -large Lisp programs. It has full Unicode support for nearly all human -languages.") - (license license:gpl3+))) + (files '("lib/tree-sitter"))))))) -(define-public emacs-next - (package - (inherit emacs) - (name "emacs-next") - (version "29.0.92") - (source - (origin - (inherit (package-source emacs)) - (method git-fetch) - (uri (git-reference - (url "https://git.savannah.gnu.org/git/emacs.git/") - (commit (string-append "emacs-" version)))) - (file-name (git-file-name name version)) - ;; emacs-source-date-epoch.patch is no longer necessary - (patches (search-patches "emacs-exec-path.patch" - "emacs-fix-scheme-indent-function.patch" - "emacs-native-comp-driver-options.patch")) - (sha256 - (base32 - "1h3p325859svcy43iv7wr27dp68049j9d44jq5akcynqdkxz4jjn")))) +(define-public emacs-no-x + (package/inherit emacs-minimal + (name "emacs-no-x") + (synopsis "The extensible, customizable, self-documenting text +editor (console only)") + (arguments + (substitute-keyword-arguments (package-arguments emacs-minimal) + ((#:configure-flags flags #~'()) + #~(cons* "--with-modules" "--with-native-compilation=aot" + (delete "--with-gnutls=no" #$flags))) + ((#:phases phases) + #~(modify-phases #$phases + (add-after 'set-paths 'set-libgccjit-path + (lambda* (#:key inputs #:allow-other-keys) + (define (first-subdirectory/absolute directory) + (let ((files (scandir + directory + (lambda (file) + (and (not (member file '("." ".."))) + (file-is-directory? (string-append + directory "/" + file))))))) + (and (not (null? files)) + (string-append directory "/" (car files))))) + (let* ((libgccjit-libdir + (first-subdirectory/absolute ;; version + (first-subdirectory/absolute ;; host type + (search-input-directory inputs "lib/gcc"))))) + (setenv "LIBRARY_PATH" + (string-append (getenv "LIBRARY_PATH") + ":" libgccjit-libdir))))) + (add-after 'unpack 'patch-compilation-driver + (lambda _ + (substitute* "lisp/emacs-lisp/comp.el" + (("\\(defcustom native-comp-driver-options nil") + (format + #f "(defcustom native-comp-driver-options '(~@{~s~^ ~})" + (string-append + "-B" #$(this-package-input "binutils") "/bin/") + (string-append + "-B" #$(this-package-input "glibc") "/lib/") + (string-append + "-B" #$(this-package-input "libgccjit") "/lib/") + (string-append + "-B" #$(this-package-input "libgccjit") "/lib/gcc/")))))))))) (inputs - (modify-inputs (package-inputs emacs) - (prepend sqlite))) - (native-inputs - (modify-inputs (package-native-inputs emacs) - (prepend autoconf))))) + (modify-inputs (package-inputs emacs-minimal) + (prepend gnutls + ;; To "unshadow" ld-wrapper in native builds + (make-ld-wrapper "ld-wrapper" #:binutils binutils) + ;; For native compilation + binutils + (libc-for-target) + libgccjit -(define-public emacs-next-tree-sitter - (package - (inherit emacs-next) - (name "emacs-next-tree-sitter") - (inputs - (modify-inputs (package-inputs emacs-next) - (prepend sqlite tree-sitter))) - (synopsis "Emacs text editor with @code{tree-sitter} support") - (description "This Emacs build supports tree-sitter."))) + ;; Avoid Emacs's limited movemail substitute that retrieves POP3 + ;; email only via insecure channels. + ;; This is not needed for (modern) IMAP. + mailutils -(define-public emacs-next-pgtk - (package - (inherit emacs-next-tree-sitter) - (name "emacs-next-pgtk") - (source - (origin - (inherit (package-source emacs-next-tree-sitter)) - (patches - (append (search-patches "emacs-pgtk-super-key-fix.patch") - (origin-patches (package-source emacs-next-tree-sitter)))))) - (arguments - (substitute-keyword-arguments (package-arguments emacs-next-tree-sitter) - ((#:configure-flags flags #~'()) - #~(cons* "--with-pgtk" #$flags)))) - (synopsis "Emacs text editor with @code{pgtk} and @code{tree-sitter} support") - (description "This Emacs build implements graphical UI purely in terms -of GTK and supports tree-sitter."))) + acl + alsa-lib + elogind + ghostscript + gpm + jansson + lcms + libice + libselinux + libsm + libxml2 + m17n-lib + sqlite + tree-sitter + zlib))))) -(define-public emacs-next-pgtk-xwidgets - (package - (inherit emacs-next-pgtk) - (name "emacs-next-pgtk-xwidgets") - (synopsis "Emacs text editor with @code{xwidgets} and @code{pgtk} support") +(define-public emacs + (package/inherit emacs-no-x + (name "emacs") + (synopsis "The extensible, customizable, self-documenting text editor") + (build-system glib-or-gtk-build-system) (arguments - (substitute-keyword-arguments (package-arguments emacs-next-pgtk) + (substitute-keyword-arguments (package-arguments emacs-no-x) + ((#:modules _) (%emacs-modules build-system)) ((#:configure-flags flags #~'()) - #~(cons "--with-xwidgets" #$flags)))) - (inputs - (modify-inputs (package-inputs emacs-next-pgtk) - (prepend gsettings-desktop-schemas webkitgtk-with-libsoup2))))) + #~(cons* "--with-cairo" #$flags)) + ((#:phases phases) + #~(modify-phases #$phases + ;; Note: due to the changed #:modules, %standard-phases in #$phases + ;; refers to glib-or-gtk:%standard-phases, so we don't need to add + ;; them ourselves. + (add-after 'glib-or-gtk-wrap 'restore-emacs-pdmp + ;; Restore the dump file that Emacs installs somewhere in + ;; libexec/ to its original state. + (lambda* (#:key outputs target #:allow-other-keys) + (let* ((libexec (string-append (assoc-ref outputs "out") + "/libexec")) + ;; each of these ought to only match a single file, + ;; but even if not (find-files) sorts by string<, + ;; so the Nth element in one maps to the Nth element of + ;; the other + (pdmp (find-files libexec "\\.pdmp$")) + (pdmp-real (find-files libexec "\\.pdmp-real$"))) + (for-each rename-file pdmp-real pdmp)))))))) + (inputs (modify-inputs (package-inputs emacs-no-x) + (prepend + cairo + dbus + gtk+ + giflib + harfbuzz + libjpeg-turbo + libotf + libpng + (librsvg-for-system) + libtiff + libx11 + libxft + libxpm + pango + poppler))))) -(define-public emacs-minimal - ;; This is the version that you should use as an input to packages that just - ;; need to byte-compile .el files. +(define-public emacs-pgtk (package/inherit emacs - (name "emacs-minimal") - (synopsis "The extensible text editor (used only for byte-compilation)") - (build-system gnu-build-system) + (name "emacs-pgtk") (arguments (substitute-keyword-arguments (package-arguments emacs) ((#:configure-flags flags #~'()) - #~(list "--with-gnutls=no" "--disable-build-details")) - ((#:modules _) (%emacs-modules build-system)) - ((#:phases phases) - #~(modify-phases #$phases - (delete 'set-libgccjit-path) - (delete 'patch-compilation-driver) - (delete 'restore-emacs-pdmp) - (delete 'strip-double-wrap))))) - (inputs (list ncurses coreutils gzip)) - (native-inputs (list autoconf pkg-config)))) + #~(cons* "--with-pgtk" #$flags)))) + (synopsis "Emacs text editor with @code{pgtk} frames") + (description "This Emacs build implements graphical UI purely in terms +of GTK."))) (define-public emacs-xwidgets (package/inherit emacs (name "emacs-xwidgets") (synopsis "The extensible, customizable, self-documenting text editor (with xwidgets support)") - (build-system gnu-build-system) (arguments (substitute-keyword-arguments (package-arguments emacs) ((#:configure-flags flags #~'()) - #~(cons "--with-xwidgets" #$flags)) - ((#:modules _) (%emacs-modules build-system)) - ((#:phases phases) - #~(modify-phases #$phases - (delete 'restore-emacs-pdmp) - (delete 'strip-double-wrap))))) + #~(cons "--with-xwidgets" #$flags)))) (inputs (modify-inputs (package-inputs emacs) (prepend webkitgtk-with-libsoup2 libxcomposite))))) +(define-public emacs-pgtk-xwidgets + (package + (inherit emacs-pgtk) + (name "emacs-pgtk-xwidgets") + (synopsis "Emacs text editor with @code{xwidgets} and @code{pgtk} support") + (arguments + (substitute-keyword-arguments (package-arguments emacs-pgtk) + ((#:configure-flags flags #~'()) + #~(cons "--with-xwidgets" #$flags)))) + (inputs + (modify-inputs (package-inputs emacs-pgtk) + (prepend gsettings-desktop-schemas webkitgtk-with-libsoup2))))) + (define-public emacs-motif - (package/inherit emacs + (package/inherit emacs-no-x (name "emacs-motif") (synopsis "The extensible, customizable, self-documenting text editor (with Motif toolkit)") - (build-system gnu-build-system) + ;; Using emacs' inputs as base, since it has all the graphical stuff (inputs (modify-inputs (package-inputs emacs) (delete "gtk+") (prepend inotify-tools motif))) (arguments (substitute-keyword-arguments - (package-arguments - emacs) + (package-arguments emacs-no-x) ((#:configure-flags flags #~'()) #~(cons "--with-x-toolkit=motif" - #$flags)) - ((#:modules _) - (%emacs-modules build-system)) - ((#:phases phases) - #~(modify-phases #$phases - (delete 'restore-emacs-pdmp) - (delete 'strip-double-wrap))))))) - -(define-public emacs-no-x - (package/inherit emacs - (name "emacs-no-x") - (synopsis "The extensible, customizable, self-documenting text -editor (console only)") - (build-system gnu-build-system) - (inputs (modify-inputs (package-inputs emacs) - (delete "libx11" "gtk+" "libxft" "libtiff" "giflib" "libjpeg" - "imagemagick" "libpng" "librsvg" "libxpm" "libice" - "libsm" "cairo" "pango" "harfbuzz" - ;; These depend on libx11, so remove them as well. - "libotf" "m17n-lib" "dbus"))) - (arguments - (substitute-keyword-arguments (package-arguments emacs) - ((#:configure-flags flags #~'()) - #~(delete "--with-cairo" #$flags)) - ((#:modules _) (%emacs-modules build-system)) - ((#:phases phases) - #~(modify-phases #$phases - (delete 'restore-emacs-pdmp) - (delete 'strip-double-wrap))))))) + #$flags)))))) (define-public emacs-no-x-toolkit - (package/inherit emacs + (package/inherit emacs-no-x (name "emacs-no-x-toolkit") (synopsis "The extensible, customizable, self-documenting text editor (without an X toolkit)" ) - (build-system gnu-build-system) + ;; Using emacs' inputs as base, since it has all the graphical stuff (inputs (modify-inputs (package-inputs emacs) (delete "gtk+") (prepend inotify-tools))) (arguments - (substitute-keyword-arguments (package-arguments emacs) + (substitute-keyword-arguments (package-arguments emacs-no-x) ((#:configure-flags flags #~'()) - #~(cons "--with-x-toolkit=no" #$flags)) - ((#:modules _) (%emacs-modules build-system)) - ((#:phases phases) - #~(modify-phases #$phases - (delete 'restore-emacs-pdmp) - (delete 'strip-double-wrap))))))) + #~(cons "--with-x-toolkit=no" #$flags)))))) (define-public emacs-wide-int (package/inherit emacs diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm index 72d971eb77..75dc60744a 100644 --- a/gnu/packages/mail.scm +++ b/gnu/packages/mail.scm @@ -52,6 +52,7 @@ ;;; Copyright © 2022 jgart <jgart@dismail.de> ;;; Copyright © 2022 ( <paren@disroot.org> ;;; Copyright © 2023 Timo Wilken <guix@twilken.net> +;;; Copyright © 2023 Arjan Adriaanse <arjan@adriaan.se> ;;; ;;; This file is part of GNU Guix. ;;; @@ -1382,7 +1383,10 @@ invoking @command{notifymuch} from the post-new hook.") (uri (string-append "https://notmuchmail.org/releases/notmuch-" version ".tar.xz")) (sha256 - (base32 "1xl64xh0ijfkx265lcj9cqv1wkzha8gsn9jn4fw4xgvqigr6sxhf")))) + (base32 "1xl64xh0ijfkx265lcj9cqv1wkzha8gsn9jn4fw4xgvqigr6sxhf")) + (patches + ;; Output for some tests varies slightly in Emacs 29. + (search-patches "notmuch-emacs-test-output.patch")))) (build-system gnu-build-system) (arguments (list diff --git a/gnu/packages/patches/emacs-all-the-icons-remove-duplicate-rs.patch b/gnu/packages/patches/emacs-all-the-icons-remove-duplicate-rs.patch new file mode 100644 index 0000000000..2c6b14e0aa --- /dev/null +++ b/gnu/packages/patches/emacs-all-the-icons-remove-duplicate-rs.patch @@ -0,0 +1,21 @@ +From 24b8d5b63e347bd4cdcf79bf897fc0097fa20fc7 Mon Sep 17 00:00:00 2001 +From: Michael Wernthaler <michael.wernthaler@posteo.de> +Date: Thu, 22 Jul 2021 11:27:31 +0200 +Subject: [PATCH] Fixed icon for .rs-files + +--- + all-the-icons.el | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/all-the-icons.el b/all-the-icons.el +index e1f4cb7695..3399906cfb 100644 +--- a/all-the-icons.el ++++ b/all-the-icons.el +@@ -194,7 +194,6 @@ + ("r" all-the-icons-fileicon "R" :face all-the-icons-lblue) + ("rd" all-the-icons-fileicon "R" :face all-the-icons-lblue) + ("rdx" all-the-icons-fileicon "R" :face all-the-icons-lblue) +- ("rs" all-the-icons-fileicon "R" :face all-the-icons-lblue) + ("rsx" all-the-icons-fileicon "R" :face all-the-icons-lblue) + ;; There seems to be a a bug with this font icon which does not + ;; let you propertise it without it reverting to being a lower diff --git a/gnu/packages/patches/emacs-haskell-mode-no-redefine-builtin.patch b/gnu/packages/patches/emacs-haskell-mode-no-redefine-builtin.patch new file mode 100644 index 0000000000..65ace2ee5e --- /dev/null +++ b/gnu/packages/patches/emacs-haskell-mode-no-redefine-builtin.patch @@ -0,0 +1,75 @@ +From faa95a784d2c74c72e70367a5d531df6dd61aeab Mon Sep 17 00:00:00 2001 +From: Steve Purcell <steve@sanityinc.com> +Date: Sun, 6 Aug 2023 16:41:48 +0200 +Subject: [PATCH] Don't redefine built-in function + +Fixes #1817 +--- + tests/haskell-indent-tests.el | 14 ++++++++------ + tests/haskell-indentation-tests.el | 14 ++++++++------ + 2 files changed, 16 insertions(+), 12 deletions(-) + +diff --git a/tests/haskell-indent-tests.el b/tests/haskell-indent-tests.el +index 7196405b8..9a3de4ad3 100644 +--- a/tests/haskell-indent-tests.el ++++ b/tests/haskell-indent-tests.el +@@ -40,11 +40,13 @@ + ;; (haskell-indent-put-region-in-literate (point-min) (point-max) -1) + ;; (buffer-substring-no-properties (point-min) (point-max)))))) + +-(defsubst string-trim-left (string) +- "Remove leading whitespace from STRING." +- (if (string-match "\\`[ \t\n\r]+" string) +- (replace-match "" t t string) +- string)) ++(if (fboundp 'string-trim-left) ++ (defalias 'haskell--string-trim-left 'string-trim-left) ++ (defun haskell--string-trim-left (string &optional regexp) ++ "Remove leading whitespace from STRING." ++ (if (string-match (concat "\\`\\(?:" (or regexp "[ \t\n\r]+") "\\)") string) ++ (substring string (match-end 0)) ++ string))) + + (defun haskell-indent-format-info (info) + (if (cdr info) +@@ -128,7 +130,7 @@ macro quotes them for you." + :expected-result + ,(if allow-failure :failed :passed) + (haskell-indent-check +- ,(string-trim-left source) ++ ,(haskell--string-trim-left source) + ,@(mapcar (lambda (x) + (list 'quote x)) + test-cases)))))) +diff --git a/tests/haskell-indentation-tests.el b/tests/haskell-indentation-tests.el +index 4889b76a7..cd783a4f4 100644 +--- a/tests/haskell-indentation-tests.el ++++ b/tests/haskell-indentation-tests.el +@@ -33,11 +33,13 @@ + + ;;; Code: + +-(defsubst string-trim-left (string) +- "Remove leading whitespace from STRING." +- (if (string-match "\\`[ \t\n\r]+" string) +- (replace-match "" t t string) +- string)) ++(if (fboundp 'string-trim-left) ++ (defalias 'haskell--string-trim-left 'string-trim-left) ++ (defun haskell--string-trim-left (string &optional regexp) ++ "Remove leading whitespace from STRING." ++ (if (string-match (concat "\\`\\(?:" (or regexp "[ \t\n\r]+") "\\)") string) ++ (substring string (match-end 0)) ++ string))) + + (defun haskell-indentation-check (source &rest test-cases) + "Check if `haskell-indentation-find-indentations' returns expected results. +@@ -115,7 +117,7 @@ macro quotes them for you." + :expected-result + ,(if allow-failure :failed :passed) + (haskell-indentation-check +- ,(string-trim-left source) ++ ,(haskell--string-trim-left source) + ,@(mapcar (lambda (x) + (list 'quote x)) + test-cases)))))) diff --git a/gnu/packages/patches/emacs-helpful-fix-tests.patch b/gnu/packages/patches/emacs-helpful-fix-tests.patch new file mode 100644 index 0000000000..61ed0671a4 --- /dev/null +++ b/gnu/packages/patches/emacs-helpful-fix-tests.patch @@ -0,0 +1,28 @@ +From 233e254bbe44f70ca899a506b3706af489228fda Mon Sep 17 00:00:00 2001 +From: aagon <aymeric.agon@hotmail.fr> +Date: Thu, 10 Aug 2023 20:03:52 +0200 +Subject: [PATCH] Repair helpful--display-implementations test for emacs 29.1 + +--- + test/helpful-unit-test.el | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/test/helpful-unit-test.el b/test/helpful-unit-test.el +index 0f5177b..0716b0d 100644 +--- a/test/helpful-unit-test.el ++++ b/test/helpful-unit-test.el +@@ -1089,8 +1089,12 @@ find the source code." + (require 'xref) + (helpful-function 'xref-location-marker) + (should (s-contains-p "Implementations" (buffer-string))) +- (should (s-contains-p "((l xref-file-location))" (buffer-string))) +- (should (s-contains-p "((l xref-buffer-location))" (buffer-string)))) ++ (should (if (version< emacs-version "29.1") ++ (s-contains-p "((l xref-file-location))" (buffer-string)) ++ (s-contains-p "(xref-location-marker (L xref-file-location))" (buffer-string)))) ++ (should (if (version< emacs-version "29.1") ++ (s-contains-p "((l xref-buffer-location))" (buffer-string)) ++ (s-contains-p "(xref-location-marker (L xref-buffer-location))" (buffer-string))))) + + (defun helpful--boring-advice (orig-fn &rest args) + (apply orig-fn args)) diff --git a/gnu/packages/patches/emacs-source-date-epoch.patch b/gnu/packages/patches/emacs-source-date-epoch.patch deleted file mode 100644 index 77ea7ac15c..0000000000 --- a/gnu/packages/patches/emacs-source-date-epoch.patch +++ /dev/null @@ -1,20 +0,0 @@ -Honor SOURCE_DATE_EPOCH variable to avoid non-determinism in generated -"autoloads" files. - ---- a/lisp/emacs-lisp/autoload.el -+++ b/lisp/emacs-lisp/autoload.el -@@ -419,8 +419,12 @@ - ;; nil t)) - ;; (match-end 2)))) - (insert generate-autoload-section-header) -- (prin1 `(autoloads ,autoloads ,load-name ,file ,time) -- outbuf) -+ (let* ((env (getenv "SOURCE_DATE_EPOCH")) -+ (time (if env -+ (seconds-to-time (string-to-number env)) -+ time))) -+ (prin1 `(autoloads ,autoloads ,load-name ,file ,time) -+ outbuf)) - (terpri outbuf) - ;; Break that line at spaces, to avoid very long lines. - ;; Make each sub-line into a comment. diff --git a/gnu/packages/patches/emacs-yasnippet-fix-empty-snippet-next.patch b/gnu/packages/patches/emacs-yasnippet-fix-empty-snippet-next.patch new file mode 100644 index 0000000000..1faea2b456 --- /dev/null +++ b/gnu/packages/patches/emacs-yasnippet-fix-empty-snippet-next.patch @@ -0,0 +1,59 @@ +From 925292484162bc35c4258e72c36462bb13a5c69a Mon Sep 17 00:00:00 2001 +From: Liliana Marie Prikler <liliana.prikler@gmail.com> +Date: Sat, 19 Aug 2023 08:38:17 +0200 +Subject: [PATCH] Guard against empty snippet in yas-next-field. + +--- + yasnippet.el | 29 +++++++++++++++-------------- + 1 file changed, 15 insertions(+), 14 deletions(-) + +diff --git a/yasnippet.el b/yasnippet.el +index e0b5537..41d86dd 100644 +--- a/yasnippet.el ++++ b/yasnippet.el +@@ -136,6 +136,7 @@ + (declare-function cl-progv-after "cl-extra") ; Needed for 23.4. + (require 'easymenu) + (require 'help-mode) ++(require 'subr-x) + + (defvar yas--editing-template) + (defvar yas--guessed-modes) +@@ -3386,20 +3387,20 @@ Otherwise delegate to `yas-next-field'." + If there's none, exit the snippet." + (interactive) + (unless arg (setq arg 1)) +- (let* ((active-field (overlay-get yas--active-field-overlay 'yas--field)) +- (snippet (car (yas-active-snippets (yas--field-start active-field) +- (yas--field-end active-field)))) +- (target-field (yas--find-next-field arg snippet active-field))) +- (yas--letenv (yas--snippet-expand-env snippet) +- ;; Apply transform to active field. +- (when active-field +- (let ((yas-moving-away-p t)) +- (when (yas--field-update-display active-field) +- (yas--update-mirrors snippet)))) +- ;; Now actually move... +- (if target-field +- (yas--move-to-field snippet target-field) +- (yas-exit-snippet snippet))))) ++ (and-let* ((active-field (overlay-get yas--active-field-overlay 'yas--field)) ++ (snippet (car (yas-active-snippets (yas--field-start active-field) ++ (yas--field-end active-field))))) ++ (let ((target-field (yas--find-next-field arg snippet active-field))) ++ (yas--letenv (yas--snippet-expand-env snippet) ++ ;; Apply transform to active field. ++ (when active-field ++ (let ((yas-moving-away-p t)) ++ (when (yas--field-update-display active-field) ++ (yas--update-mirrors snippet)))) ++ ;; Now actually move... ++ (if target-field ++ (yas--move-to-field snippet target-field) ++ (yas-exit-snippet snippet)))))) + + (defun yas--place-overlays (snippet field) + "Correctly place overlays for SNIPPET's FIELD." +-- +2.41.0 + diff --git a/gnu/packages/patches/emacs-yasnippet-fix-tests.patch b/gnu/packages/patches/emacs-yasnippet-fix-tests.patch index c70cc75d92..5995b0afa4 100644 --- a/gnu/packages/patches/emacs-yasnippet-fix-tests.patch +++ b/gnu/packages/patches/emacs-yasnippet-fix-tests.patch @@ -10,6 +10,11 @@ Content-Transfer-Encoding: 8bit - A test that was temporarily broken passes again. - The default for ‘org-adapt-indentation’ has changed. - buffer-list may be called with arguments when native-comp is enabled. + +2023-08-19 Liliana Marie Prikler <liliana.prikler@gmail.com> + + * delete-numberless-inner-snippet-issue-562: Correct value in + looking-at. --- yasnippet-tests.el | 45 ++++++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 17 deletions(-) @@ -26,6 +31,15 @@ index f7ca2bb..7618ab7 100644 ;; Author: João Távora <joaot@siscog.pt> ;; Keywords: emulations, convenience +@@ -289,7 +289,7 @@ attention to case differences." + (should (looking-at "testblable")) + (ert-simulate-command '(yas-next-field-or-maybe-expand)) + (ert-simulate-command '(yas-skip-and-clear-field)) +- (should (looking-at "ble")) ++ (should (looking-at "blable")) + (should (null (yas-active-snippets))))) + + (ert-deftest delete-nested-simple-field-issue-824 () @@ -556,16 +556,19 @@ XXXXX ------------------------")))) (yas-mock-insert "foo bar") (ert-simulate-command '(yas-next-field)) diff --git a/gnu/packages/patches/notmuch-emacs-test-output.patch b/gnu/packages/patches/notmuch-emacs-test-output.patch new file mode 100644 index 0000000000..3c6d472d6b --- /dev/null +++ b/gnu/packages/patches/notmuch-emacs-test-output.patch @@ -0,0 +1,89 @@ +From e9e779ead4d703ad423e46c23abd0c9afd7d5ed2 Mon Sep 17 00:00:00 2001 +From: Arjan Adriaanse <arjan@adriaan.se> +Date: Tue, 15 Aug 2023 00:00:05 +0200 +Subject: [PATCH] test: fix expected output for Emacs 29 + +--- + test/T453-emacs-reply.sh | 1 - + test/T454-emacs-dont-reply-names.sh | 9 +++------ + .../notmuch-reply-duplicate-4 | 1 - + 3 files changed, 3 insertions(+), 8 deletions(-) + +diff --git a/test/T453-emacs-reply.sh b/test/T453-emacs-reply.sh +index 0a27d066..de400b85 100755 +--- a/test/T453-emacs-reply.sh ++++ b/test/T453-emacs-reply.sh +@@ -17,7 +17,6 @@ cat <<EOF > EXPECTED + From: Notmuch Test Suite <test_suite@notmuchmail.org> + To: Antoine Beaupré <anarcat@orangeseeds.org> + Subject: Re: bug: "no top level messages" crash on Zen email loops +-In-Reply-To: <874llc2bkp.fsf@curie.anarc.at> + Fcc: MAIL_DIR/sent + --text follows this line-- + Antoine Beaupré <anarcat@orangeseeds.org> writes: +diff --git a/test/T454-emacs-dont-reply-names.sh b/test/T454-emacs-dont-reply-names.sh +index 3a770177..9ed4f18b 100755 +--- a/test/T454-emacs-dont-reply-names.sh ++++ b/test/T454-emacs-dont-reply-names.sh +@@ -17,13 +17,12 @@ test_emacs '(let ((message-dont-reply-to-names "notmuchmail\\|noreply\\|harvard" + (test-visible-output "OUTPUT-FULL.raw"))' + + notmuch_dir_sanitize < OUTPUT-FULL.raw > OUTPUT-FULL +-head -6 OUTPUT-FULL > OUTPUT ++head -5 OUTPUT-FULL > OUTPUT + + cat <<EOF > EXPECTED + From: Notmuch Test Suite <test_suite@notmuchmail.org> + To: Mikhail Gusarov <dottedmag@dottedmag.net> + Subject: Re: [notmuch] Working with Maildir storage? +-In-Reply-To: <20091117203301.GV3165@dottiness.seas.harvard.edu> + Fcc: MAIL_DIR/sent + --text follows this line-- + EOF +@@ -38,14 +37,13 @@ test_emacs '(let ((message-dont-reply-to-names + (test-visible-output "OUTPUT-FULL-PRED.raw"))' + + notmuch_dir_sanitize < OUTPUT-FULL-PRED.raw > OUTPUT-FULL-PRED +-head -7 OUTPUT-FULL-PRED > OUTPUT-PRED ++head -6 OUTPUT-FULL-PRED > OUTPUT-PRED + + cat <<EOF > EXPECTED-PRED + From: Notmuch Test Suite <test_suite@notmuchmail.org> + To: Lars Kellogg-Stedman <lars@seas.harvard.edu> + Cc: notmuch@notmuchmail.org + Subject: Re: [notmuch] Working with Maildir storage? +-In-Reply-To: <20091117203301.GV3165@dottiness.seas.harvard.edu> + Fcc: MAIL_DIR/sent + --text follows this line-- + EOF +@@ -59,14 +57,13 @@ test_emacs '(let ((message-dont-reply-to-names nil)) + (test-visible-output "OUTPUT-FULL-NIL.raw"))' + + notmuch_dir_sanitize < OUTPUT-FULL-NIL.raw > OUTPUT-FULL-NIL +-head -7 OUTPUT-FULL-NIL > OUTPUT-NIL ++head -6 OUTPUT-FULL-NIL > OUTPUT-NIL + + cat <<EOF > EXPECTED-NIL + From: Notmuch Test Suite <test_suite@notmuchmail.org> + To: Lars Kellogg-Stedman <lars@seas.harvard.edu>, Mikhail Gusarov <dottedmag@dottedmag.net> + Cc: notmuch@notmuchmail.org + Subject: Re: [notmuch] Working with Maildir storage? +-In-Reply-To: <20091117203301.GV3165@dottiness.seas.harvard.edu> + Fcc: MAIL_DIR/sent + --text follows this line-- + EOF +diff --git a/test/emacs-reply.expected-output/notmuch-reply-duplicate-4 b/test/emacs-reply.expected-output/notmuch-reply-duplicate-4 +index 836f77b1..44b8c7a6 100644 +--- a/test/emacs-reply.expected-output/notmuch-reply-duplicate-4 ++++ b/test/emacs-reply.expected-output/notmuch-reply-duplicate-4 +@@ -1,7 +1,6 @@ + From: Notmuch Test Suite <test_suite@notmuchmail.org> + To: Sean Whitton <spwhitton@spwhitton.name>, 916811@bugs.debian.org, 916805@bugs.debian.org, 916807@bugs.debian.org, 916808@bugs.debian.org, 916809@bugs.debian.org, 916811@bugs.debian.org, 916867@bugs.debian.org, 916869@bugs.debian.org, 916872@bugs.debian.org, 916875@bugs.debian.org, 916876@bugs.debian.org + Subject: Re: [Pkg-emacsen-addons] Bug#916811: Increase severity to 'serious' +-In-Reply-To: <87r2ecrr6x.fsf@zephyr.silentflame.com> + Fcc: MAIL_DIR/sent + --text follows this line-- + Sean Whitton <spwhitton@spwhitton.name> writes: +-- +2.41.0 + diff --git a/guix/build/emacs-utils.scm b/guix/build/emacs-utils.scm index 850b1f5f2a..ac3dac57d1 100644 --- a/guix/build/emacs-utils.scm +++ b/guix/build/emacs-utils.scm @@ -40,6 +40,7 @@ emacs-byte-compile-directory emacs-compile-directory emacs-header-parse + ert-number-tests as-display emacs-substitute-sexps @@ -183,6 +184,19 @@ If native code is not supported, compile to bytecode instead." (insert " ") (insert ,(format #f "~s" replacement)))))) +(define (ert-number-tests file test-name) + "Add a numerically increasing suffix to tests of the same name. +This fixes test errors of the pattern \"Test TEST_NAME redefined\"." + (emacs-batch-edit-file file + `(let ((i 0)) + (while (re-search-forward ,(string-append "ert-deftest " test-name) + nil t) + (goto-char (match-beginning 0)) + (kill-region (match-beginning 0) (match-end 0)) + (insert (format "ert-deftest %s-%d" ,test-name i)) + (setq i (+ i 1))) + (basic-save-buffer)))) + (define-syntax emacs-substitute-sexps (syntax-rules () "Substitute the S-expression immediately following the first occurrence of |