Note that there are some explanatory texts on larger screens.

plurals
  1. POemacs lisp scripting optimization help request
    primarykey
    data
    text
    <p>I'm learning emacs lisp and I'm trying to script using it. I wrote a script and it works fine but I just think there are a lot of things I make in bash that I can do in emacs lisp instead.</p> <p>Big deal here: <strong>I'm not sure if my start-process works correct</strong></p> <p>Please suggest / show me the lisp way of scripting on my script (as example) :</p> <pre><code>#!/usr/bin/emacs --script (message "Vision synchronization \n") (let ((default-directory "/home/vision/")) (shell-command "git pull;") (princ (shell-command-to-string "git fetch upstream;git merge upstream/master;")) (princ (start-process "Vision push \n" "git" "git" "push"))) (message "Gentoo-haskell synchronization \n") (let ((default-directory "/home/gentoo-haskell/")) (shell-command "git pull;") (princ (shell-command-to-string "git fetch upstream;git merge upstream/master;")) (princ (start-process "Gentoo-haskell push \n" "git" "git" "push"))) (message "Nengraphy synchronization \n") (let ((default-directory "/home/nengraphy/")) (princ (start-process "Nengraphy pull \n" "git" "git" "pull"))) (message "Gentoo synchronization \n") (let ((default-directory "/usr/portage/")) (message "Gentoo rsync (New files will be added, deprecated files will be deleted) : \n") (princ (shell-command-to-string "rsync --recursive --links --safe-links --perms --times --compress --force --whole-file --delete --timeout=180 --exclude=/.git --exclude=/metadata/cache/ --exclude=/distfiles --exclude=/local --exclude=/packages rsync://209.177.148.226/gentoo-portage/ /usr/portage/")) (message "We want to make extra-sure that we don't grab any metadata, since we don't keep metadata for the gentoo.org tree (space reasons)") (shell-command "[ -e metadata/cache ] &amp;&amp; rm -rf metadata/cache") (shell-command "[ -e metadata/md5-cache ] &amp;&amp; rm -rf metadata/md5-cache") (message "the rsync command wiped our critical .gitignore file, so recreate it.") (shell-command "echo \"distfiles/*\" &gt; /usr/portage/.gitignore") (shell-command "echo \"packages/*\" &gt;&gt; /usr/portage/.gitignore") (message "profile formats fix") (shell-command "echo \"profile-formats = portage-1\" &gt;&gt; /usr/portage/metadata/layout.conf") (message "\"git add .\" will record all the changes to local files the git repo. So there must be no stray files.") (shell-command "if [ ! -d profiles/package.mask ] then mv profiles/package.mask profiles/package.mask.bak || exit 4 install -d profiles/package.mask || exit 4 mv profiles/package.mask.bak profiles/package.mask/gentoo || exit 4 fi") (princ (shell-command-to-string "git add .")) (message "create a commit") (shell-command "git commit -a -m \"gentoo updates `date` update\"") (message "push these changes up.") (princ (shell-command-to-string "git push origin master"))) (message "Gentoo verification \n") (princ (shell-command-to-string "emerge --sync;")) (message "Layman synchronization \n") (princ (shell-command-to-string "layman -S;")) </code></pre> <p>thank you!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload