Re: [STUMP] need help about defun "gnus" command

David Bjergaard <[email protected]>
Newsgroups gmane.comp.window-managers.stumpwm.devel
Message-ID <[email protected]>
Hi,

I'm not entirely sure what's going wrong. Could you clarify what the
difference between working and not working? Also, you may not want the quote:

Two pieces of code you might want to use as a reference:
https://github.com/dss-project/dswm-modules/tree/master/emacs
and
https://gitorious.org/dss-project/stumpmacs/source/1a2d69f20f0843fce5c5213a539824020786ad27:stumpmacs/daemon.lisp#L99

I hope to integrate the latter some day...

Does:
#+begin_src lisp
(defcommand gnus () ()
(run-shell-command "emacsclient -c -e '(gnus)'")) 
#+end_src 
work?
Cheers,

    Dave


Feng Shu <[email protected]> writes:

> Hi:
>
> I defun a emacsclient-eval function like this
>
> #+begin_src lisp
> (defun escape-instance-name (str)
>   (let (buf)
>     (map nil #'(lambda (ch)
> 		 (if (or (char= ch #\()
> 			 (char= ch #\))
> 			 (char= ch #\")
> 			 (char= ch #\ ))
> 		     (push #\_ buf)
> 		     (push ch buf)))
> 	 str)
>     (coerce (reverse buf) 'string)))
>
> (defun emacsclient-eval (&optional expression create-frame frame-name file)
>   (let* ((expr-string (string-downcase (prin1-to-string expression)))
>          (name (or frame-name
>                    (escape-instance-name expression))))
>     (run-or-raise
>      (concat "emacsclient --server-file=default "
> 	     (when create-frame (concat "-c -F '((name . \"" name "\"))' "))
> 	     (when expr-string (concat " --eval '" expr-string "'"))
> 	     file)
>      (list :instance name))))
>
> #+end_src
>
> this can work,
> #+begin_src
> (emacsclient-eval '(gnus))
> #+end_src
>
> but the follow command defun can't work, someone can help me? thanks!
>
> #+begin_src
> (defcommand gnus () ()
>  (emacsclient-eval '(gnus)))
> #+end_src
>
> -- feng shu
>
>
> _______________________________________________
> Stumpwm-devel mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/stumpwm-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.