Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

TorgoX (1933)


"Il est beau comme la retractilité des serres des oiseaux rapaces [...] et surtout, comme la rencontre fortuite sur une table de dissection d'une machine à coudre et d'un parapluie !" -- Lautréamont

Journal of TorgoX (1933)

Tuesday October 18, 2005
05:25 AM

The operations are the strategy

[ #27224 ]
Dear Log,

Today's elisp accomplishments:

(defun spawn-terminal ()
  "Spawn a new terminal window"
  (call-process "gnome-terminal" nil 0 nil)

(defun spawn-explore-pwd ()
  "Spawn a filesystem window on pwd"
  (call-process "gnome-open" nil 0 nil ".")

(defun start-current-buffer ()
  "Run the current buffer"
  (unless (buffer-file-name) (error
    "You have to save this buffer someplace first"))
  (call-process "gnome-open" nil 0 nil
    ;start with no input, and ignore output

(defun dired-start-this-file ()
  "Run current/selected files"
    (function (lambda (x)
      (call-process "gnome-open" nil 0 nil x)))
    (dired-get-marked-files t current-prefix-arg)

Apparently call-process is what I've been looking for all this time, for these various tasks where I don't want to capture output, wait for the process to finish, etc.

Further observation: grepping /usr/share/emacs/[funk]/lisp/*.el is a great way to find code to cobble from. Like I had no idea how to throw an error in elisp, or what the "unless" syntax was, so I just grepped and instantly found a dozen examples.

Later in the day, I sat around at the diner for a while with an old BASIC games book, and got some ideas for JavaScripty games in Haida/Tlingit. (That, for the most part, is what I do for a day job these days -- making "multimedia learning tools" for Haida and Tlinigt. It's easy and hard and a different thing every day, and I love it.)

Caffeine is a wonderful thing.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.