stumpwm-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: David Bjergaard
Subject: Re: [STUMP] need help about defun "gnus" command
Date: Thu, 27 Feb 2014 19:37:46 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

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 <address@hidden> 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
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/stumpwm-devel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]