Skip to content

Instantly share code, notes, and snippets.

@tonini
Last active January 5, 2017 14:36
Show Gist options
  • Save tonini/284701fbcdb79308c2c5 to your computer and use it in GitHub Desktop.
Save tonini/284701fbcdb79308c2c5 to your computer and use it in GitHub Desktop.
(defun a-function (option callback)
"Open the message with key."
(interactive)
(let* ((buffer (get-buffer-create "aprocessbuffer"))
(command (a-build-autocomple-command option))
(proc (start-process "aproccess" buffer "ls" "-l" )))
(set-process-sentinel proc (lambda (process signal)
(cond
((equal signal "finished\n")
(let ((output (with-current-buffer (process-buffer process)
(buffer-substring (point-min) (point-max)))))
(funcall callback output)
))
('t
(message "signal: %s" signal)
))))))
(a-function "List" (lambda (e)
(message "SUPER %s" e)
))
;; error in process sentinel: let: Symbol's value as variable is void: callback
;; error in process sentinel: Symbol's value as variable is void: callback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment