unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* emacs + straight.el
@ 2021-08-22 21:43 Andreas Reuleaux
  0 siblings, 0 replies; only message in thread
From: Andreas Reuleaux @ 2021-08-22 21:43 UTC (permalink / raw)
  To: help-guix Users

OK, next question - I am progressing at least :-)

My emacs configuration is in terms of straight.el:

  https://github.com/raxod502/straight.el

this works by placing the following stanza in my ~/.emacs.d/init.el
(as explained on the straight.el website):

--------------------
(defvar bootstrap-version)
(let ((bootstrap-file
       (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
      (bootstrap-version 5))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))
--------------------




or similar: running my script myrun.el from the command line, which install some packages:
leaf, flycheck... as well.

--------------------
:;exec /usr/bin/env emacs -batch -Q -l "$0" -f main "$@"


(require 'cl-lib)



(defun main ()
  (interactive)

  (cl-destructuring-bind
   (&optional fst snd) command-line-args-left
   
    
   (progn
     
     (message (concat "cmd line default dir: " command-line-default-directory))
     (message (concat "usr emacs dir: " user-emacs-directory))
     (message (concat "run w/ [user emacs dir] straight: "       user-emacs-directory "straight"))
    
		      
     (defvar bootstrap-version)
     (let ((bootstrap-file
	    (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
	   (bootstrap-version 5))
       (unless (file-exists-p bootstrap-file)
	 (with-current-buffer
	     (url-retrieve-synchronously
	      "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
	      'silent 'inhibit-cookies)
	   (goto-char (point-max))
	   (eval-print-last-sexp)))
       (load bootstrap-file nil 'nomessage))
     

     (straight-use-package 'leaf)
     (straight-use-package 'flycheck)
     (straight-use-package 'flycheck-haskell)
     

     

     )
   )
  )
----------

In either case: these work fine for me under debian, but under guix I
get some nasty error message: Failed to run git...

I *do* have git installed with
  guix package -i git

and it lives in

  rx@dell ~$ type git
  git is /run/current-system/profile/bin/git

Has anyone been successful with this? Is there a way to specify the git
executable in straight.el - should I ask on the straight.el issue
tracker instead? Thanks in advance.

-A






rx@dell ~/st$ ./myrun.el
cmd line default dir: ~/st/
usr emacs dir: ~/.emacs.d/
require pkgs from [cmd line default dir]: ~/st/pkgs.el
run w/ [user emacs dir] straight: ~/.emacs.d/straight
Bootstrapping straight.el...
Debugger entered--Lisp error: (error "straight.el bootstrap failed: Failed to run \"git\";...")
  signal(error ("straight.el bootstrap failed: Failed to run \"git\";..."))
  error("straight.el bootstrap failed: %s" "Failed to run \"git\"; see buffer *straight-process*...")
  (if (= 0 (call-process (let ((emacs-binary-path (expand-file-name invocation-name invocation-directory)) (runemacs-binary-path (if (straight--windows-os-p) (progn ...)))) (if (and runemacs-binary-path (file-exists-p runemacs-binary-path)) runemacs-binary-path emacs-binary-path)) nil '(t t) nil "--batch" "--no-window-system" "--quick" "--load" temp-file)) nil (error "straight.el bootstrap failed: %s" (buffer-string)))
  (progn (if (= 0 (call-process (let ((emacs-binary-path (expand-file-name invocation-name invocation-directory)) (runemacs-binary-path (if ... ...))) (if (and runemacs-binary-path (file-exists-p runemacs-binary-path)) runemacs-binary-path emacs-binary-path)) nil '(t t) nil "--batch" "--no-window-system" "--quick" "--load" temp-file)) nil (error "straight.el bootstrap failed: %s" (buffer-string))))
  (unwind-protect (progn (if (= 0 (call-process (let ((emacs-binary-path ...) (runemacs-binary-path ...)) (if (and runemacs-binary-path ...) runemacs-binary-path emacs-binary-path)) nil '(t t) nil "--batch" "--no-window-system" "--quick" "--load" temp-file)) nil (error "straight.el bootstrap failed: %s" (buffer-string)))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (if (= 0 (call-process (let (... ...) (if ... runemacs-binary-path emacs-binary-path)) nil '(t t) nil "--batch" "--no-window-system" "--quick" "--load" temp-file)) nil (error "straight.el bootstrap failed: %s" (buffer-string)))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
  (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (if (= 0 (call-process (let ... ...) nil '... nil "--batch" "--no-window-system" "--quick" "--load" temp-file)) nil (error "straight.el bootstrap failed: %s" (buffer-string)))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
  (let ((temp-file (make-temp-file "straight.el~"))) (write-region nil nil temp-file nil 'silent) (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (if (= 0 (call-process ... nil ... nil "--batch" "--no-window-system" "--quick" "--load" temp-file)) nil (error "straight.el bootstrap failed: %s" (buffer-string)))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))))
  (save-current-buffer (set-buffer (url-retrieve-synchronously (format (concat "https://raw.githubusercontent.com/" "raxod502/straight.el/install/%s/straight.el") (substring (symbol-name version) 1)) 'silent 'inhibit-cookies)) (if (equal url-http-response-status 200) nil (error "Unknown recipe version: %S" version)) (delete-region (point-min) url-http-end-of-headers) (goto-char (point-min)) (princ ";; -*- coding: utf-8 -*-" (current-buffer)) (print (cons 'progn (let* ((vars nil) (regexps '("bootstrap-version" "straight-[a-z-]+" "user-emacs-directory")) (regexp (format "^\\(%s\\)$" (mapconcat ... regexps "\\|")))) (mapatoms #'(lambda (sym) (if ... ...))) (mapcar #'(lambda (var) (list ... var ...)) vars))) (current-buffer)) (goto-char (point-max)) (print '(progn (straight-use-package-no-build `(straight :type git :host github :repo ,... :branch ,...)) (unless (and (boundp 'bootstrap-version) (integerp bootstrap-version) (>= bootstrap-version 3)) (let* ((recipe ...) (local-repo ...) (link-target ...) (link-name ...)) (ignore-errors (delete-file link-name)) (if (bound-and-true-p straight-use-symlinks) (if ... ... ...) (with-temp-file link-name ...))))) (current-buffer)) (let ((temp-file (make-temp-file "straight.el~"))) (write-region nil nil temp-file nil 'silent) (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (if (= 0 ...) nil (error "straight.el bootstrap failed: %s" ...))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))))
  (let ((version nil) (straight-profiles (if (boundp 'straight-profiles) straight-profiles '((nil . "default.el")))) (straight-install-dir (or (and (boundp 'straight-base-dir) straight-base-dir) user-emacs-directory)) (print-length nil) (print-level nil)) (let ((--dolist-tail-- (mapcar #'cdr straight-profiles)) lockfile-name) (while --dolist-tail-- (setq lockfile-name (car --dolist-tail--)) (let ((lockfile-path (concat straight-install-dir "straight/versions/" lockfile-name))) (if (file-exists-p lockfile-path) (progn (condition-case nil (let ... ...) (end-of-file ...))))) (setq --dolist-tail-- (cdr --dolist-tail--)))) (if version nil (setq version :beta)) (save-current-buffer (set-buffer (url-retrieve-synchronously (format (concat "https://raw.githubusercontent.com/" "raxod502/straight.el/install/%s/straight.el") (substring (symbol-name version) 1)) 'silent 'inhibit-cookies)) (if (equal url-http-response-status 200) nil (error "Unknown recipe version: %S" version)) (delete-region (point-min) url-http-end-of-headers) (goto-char (point-min)) (princ ";; -*- coding: utf-8 -*-" (current-buffer)) (print (cons 'progn (let* ((vars nil) (regexps '...) (regexp (format "^\\(%s\\)$" ...))) (mapatoms #'(lambda ... ...)) (mapcar #'(lambda ... ...) vars))) (current-buffer)) (goto-char (point-max)) (print '(progn (straight-use-package-no-build `(straight :type git :host github :repo ... :branch ...)) (unless (and (boundp ...) (integerp bootstrap-version) (>= bootstrap-version 3)) (let* (... ... ... ...) (ignore-errors ...) (if ... ... ...)))) (current-buffer)) (let ((temp-file (make-temp-file "straight.el~"))) (write-region nil nil temp-file nil 'silent) (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (if ... nil ...)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))))))
  (progn (message "Bootstrapping straight.el...") (let ((min-version "25.1")) (if (version< emacs-version min-version) (progn (error (concat "straight.el requires at least Emacs %s, " "but you are running Emacs %s") min-version emacs-version)))) (if (boundp 'straight-repository-branch) (progn (if (stringp straight-repository-branch) nil (error "The `straight-repository-branch' must be a string ..." straight-repository-branch)))) (if (executable-find "git") nil (user-error "Git executable not found. straight.el requires git")) (require 'cl-lib) (require 'url-http) (defvar url-http-end-of-headers) (defvar url-http-response-status) (defalias 'straight--windows-os-p #'(lambda nil "Check if the current operating system is Windows." (memq system-type '(ms-dos windows-nt)))) (let ((version nil) (straight-profiles (if (boundp 'straight-profiles) straight-profiles '((nil . "default.el")))) (straight-install-dir (or (and (boundp 'straight-base-dir) straight-base-dir) user-emacs-directory)) (print-length nil) (print-level nil)) (let ((--dolist-tail-- (mapcar #'cdr straight-profiles)) lockfile-name) (while --dolist-tail-- (setq lockfile-name (car --dolist-tail--)) (let ((lockfile-path (concat straight-install-dir "straight/versions/" lockfile-name))) (if (file-exists-p lockfile-path) (progn (condition-case nil ... ...)))) (setq --dolist-tail-- (cdr --dolist-tail--)))) (if version nil (setq version :beta)) (save-current-buffer (set-buffer (url-retrieve-synchronously (format (concat "https://raw.githubusercontent.com/" "raxod502/straight.el/install/%s/straight.el") (substring (symbol-name version) 1)) 'silent 'inhibit-cookies)) (if (equal url-http-response-status 200) nil (error "Unknown recipe version: %S" version)) (delete-region (point-min) url-http-end-of-headers) (goto-char (point-min)) (princ ";; -*- coding: utf-8 -*-" (current-buffer)) (print (cons 'progn (let* ((vars nil) (regexps ...) (regexp ...)) (mapatoms #'...) (mapcar #'... vars))) (current-buffer)) (goto-char (point-max)) (print '(progn (straight-use-package-no-build `...) (unless (and ... ... ...) (let* ... ... ...))) (current-buffer)) (let ((temp-file (make-temp-file "straight.el~"))) (write-region nil nil temp-file nil 'silent) (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn ...) (and ... ...))))))) (message "Bootstrapping straight.el...done"))
  eval((progn (message "Bootstrapping straight.el...") (let ((min-version "25.1")) (if (version< emacs-version min-version) (progn (error (concat "straight.el requires at least Emacs %s, " "but you are running Emacs %s") min-version emacs-version)))) (if (boundp 'straight-repository-branch) (progn (if (stringp straight-repository-branch) nil (error "The `straight-repository-branch' must be a string ..." straight-repository-branch)))) (if (executable-find "git") nil (user-error "Git executable not found. straight.el requires git")) (require 'cl-lib) (require 'url-http) (defvar url-http-end-of-headers) (defvar url-http-response-status) (defalias 'straight--windows-os-p #'(lambda nil "Check if the current operating system is Windows." (memq system-type '(ms-dos windows-nt)))) (let ((version nil) (straight-profiles (if (boundp 'straight-profiles) straight-profiles '(...))) (straight-install-dir (or (and (boundp ...) straight-base-dir) user-emacs-directory)) (print-length nil) (print-level nil)) (let ((--dolist-tail-- (mapcar #'cdr straight-profiles)) lockfile-name) (while --dolist-tail-- (setq lockfile-name (car --dolist-tail--)) (let ((lockfile-path ...)) (if (file-exists-p lockfile-path) (progn ...))) (setq --dolist-tail-- (cdr --dolist-tail--)))) (if version nil (setq version :beta)) (save-current-buffer (set-buffer (url-retrieve-synchronously (format (concat "https://raw.githubusercontent.com/" "raxod502/straight.el/install/%s/straight.el") (substring ... 1)) 'silent 'inhibit-cookies)) (if (equal url-http-response-status 200) nil (error "Unknown recipe version: %S" version)) (delete-region (point-min) url-http-end-of-headers) (goto-char (point-min)) (princ ";; -*- coding: utf-8 -*-" (current-buffer)) (print (cons 'progn (let* (... ... ...) (mapatoms ...) (mapcar ... vars))) (current-buffer)) (goto-char (point-max)) (print '(progn (straight-use-package-no-build ...) (unless ... ...)) (current-buffer)) (let ((temp-file (make-temp-file "straight.el~"))) (write-region nil nil temp-file nil 'silent) (let ((temp-buffer ...)) (save-current-buffer (set-buffer temp-buffer) (unwind-protect ... ...)))))) (message "Bootstrapping straight.el...done")) nil)
  elisp--eval-last-sexp(t)
  eval-last-sexp(t)
  eval-print-last-sexp()
  (save-current-buffer (set-buffer (url-retrieve-synchronously "https://raw.githubusercontent.com/raxod502/straigh..." 'silent 'inhibit-cookies)) (goto-char (point-max)) (eval-print-last-sexp))
  (if (file-exists-p bootstrap-file) nil (save-current-buffer (set-buffer (url-retrieve-synchronously "https://raw.githubusercontent.com/raxod502/straigh..." 'silent 'inhibit-cookies)) (goto-char (point-max)) (eval-print-last-sexp)))
  (let ((bootstrap-file (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) (bootstrap-version 5)) (if (file-exists-p bootstrap-file) nil (save-current-buffer (set-buffer (url-retrieve-synchronously "https://raw.githubusercontent.com/raxod502/straigh..." 'silent 'inhibit-cookies)) (goto-char (point-max)) (eval-print-last-sexp))) (load bootstrap-file nil 'nomessage))
  (progn (message (concat "cmd line default dir: " command-line-default-directory)) (message (concat "usr emacs dir: " user-emacs-directory)) (message (concat "require pkgs from [cmd line default dir]: " command-line-default-directory "pkgs.el")) (message (concat "run w/ [user emacs dir] straight: " user-emacs-directory "straight")) (defvar bootstrap-version) (let ((bootstrap-file (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) (bootstrap-version 5)) (if (file-exists-p bootstrap-file) nil (save-current-buffer (set-buffer (url-retrieve-synchronously "https://raw.githubusercontent.com/raxod502/straigh..." 'silent 'inhibit-cookies)) (goto-char (point-max)) (eval-print-last-sexp))) (load bootstrap-file nil 'nomessage)) (straight-use-package 'leaf) (straight-use-package 'flycheck) (straight-use-package 'flycheck-haskell))
  (progn (if --cl-rest-- (signal 'wrong-number-of-arguments (list '(&optional fst snd) (+ 2 (length --cl-rest--))))) (progn (message (concat "cmd line default dir: " command-line-default-directory)) (message (concat "usr emacs dir: " user-emacs-directory)) (message (concat "require pkgs from [cmd line default dir]: " command-line-default-directory "pkgs.el")) (message (concat "run w/ [user emacs dir] straight: " user-emacs-directory "straight")) (defvar bootstrap-version) (let ((bootstrap-file (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) (bootstrap-version 5)) (if (file-exists-p bootstrap-file) nil (save-current-buffer (set-buffer (url-retrieve-synchronously "https://raw.githubusercontent.com/raxod502/straigh..." 'silent 'inhibit-cookies)) (goto-char (point-max)) (eval-print-last-sexp))) (load bootstrap-file nil 'nomessage)) (straight-use-package 'leaf) (straight-use-package 'flycheck) (straight-use-package 'flycheck-haskell)))
  (let* ((--cl-rest-- command-line-args-left) (fst (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--))))) (snd (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--)))))) (progn (if --cl-rest-- (signal 'wrong-number-of-arguments (list '(&optional fst snd) (+ 2 (length --cl-rest--))))) (progn (message (concat "cmd line default dir: " command-line-default-directory)) (message (concat "usr emacs dir: " user-emacs-directory)) (message (concat "require pkgs from [cmd line default dir]: " command-line-default-directory "pkgs.el")) (message (concat "run w/ [user emacs dir] straight: " user-emacs-directory "straight")) (defvar bootstrap-version) (let ((bootstrap-file (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) (bootstrap-version 5)) (if (file-exists-p bootstrap-file) nil (save-current-buffer (set-buffer (url-retrieve-synchronously "https://raw.githubusercontent.com/raxod502/straigh..." ... ...)) (goto-char (point-max)) (eval-print-last-sexp))) (load bootstrap-file nil 'nomessage)) (straight-use-package 'leaf) (straight-use-package 'flycheck) (straight-use-package 'flycheck-haskell))))
  main()
  funcall-interactively(main)
  call-interactively(main nil nil)
  command-execute(main)
  command-line-1(("-l" "./myrun.el" "-f" "main"))
  command-line()
  normal-top-level()






^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-22 21:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-22 21:43 emacs + straight.el Andreas Reuleaux

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 NNTP newsgroup(s).