* Invalid Function while using setq
@ 2008-01-12 17:58 sapsi
2008-01-12 21:12 ` Lennart Borgman (gmail)
2008-01-14 17:16 ` Joel J. Adamson
0 siblings, 2 replies; 3+ messages in thread
From: sapsi @ 2008-01-12 17:58 UTC (permalink / raw)
To: help-gnu-emacs
Hello,
I have the following function in my .emacs (or rather Preferences.el
on Aquamacs)
(defun send-to-R-app ()
(interactive)
"Sends the selection to R.App"
(let ( (myStr2 nil) (mystr nil))(
(setq mystr (buffer-substring-no-properties (mark) (point)))
(setq myStr2 (replace-regexp-in-string "\"" "'" mystr ) )
(do-applescript (concat "tell application \"R\" \r"
"cmd "
"\"" myStr2 "\""
"\r"
"end tell"
))
) ))
(global-set-key (kbd "A-r")
'send-to-R-app)
When i start emacs, i get this error
`(setq mystr (buffer-substring-no-properties (mark) (point)))' is a
malformed function.
I have no idea why, also if select the code fragement and type M-x
eval-region and then select some code and type M-x send-to-R-app, i
get a similar error
Invalid function setq mystr (buffer-substring-no-properties (mark)
(point)))
Could someone help me out on this?
Thank you
Saptarshi
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Invalid Function while using setq
2008-01-12 17:58 Invalid Function while using setq sapsi
@ 2008-01-12 21:12 ` Lennart Borgman (gmail)
2008-01-14 17:16 ` Joel J. Adamson
1 sibling, 0 replies; 3+ messages in thread
From: Lennart Borgman (gmail) @ 2008-01-12 21:12 UTC (permalink / raw)
To: sapsi; +Cc: help-gnu-emacs
sapsi wrote:
> Hello,
> I have the following function in my .emacs (or rather Preferences.el
> on Aquamacs)
>
> (defun send-to-R-app ()
> (interactive)
> "Sends the selection to R.App"
> (let ( (myStr2 nil) (mystr nil))(
Remove the last ( above.
> (setq mystr (buffer-substring-no-properties (mark) (point)))
> (setq myStr2 (replace-regexp-in-string "\"" "'" mystr ) )
> (do-applescript (concat "tell application \"R\" \r"
> "cmd "
> "\"" myStr2 "\""
> "\r"
> "end tell"
> ))
> ) ))
> (global-set-key (kbd "A-r")
> 'send-to-R-app)
>
> When i start emacs, i get this error
> `(setq mystr (buffer-substring-no-properties (mark) (point)))' is a
> malformed function.
>
> I have no idea why, also if select the code fragement and type M-x
> eval-region and then select some code and type M-x send-to-R-app, i
> get a similar error
> Invalid function setq mystr (buffer-substring-no-properties (mark)
> (point)))
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Invalid Function while using setq
2008-01-12 17:58 Invalid Function while using setq sapsi
2008-01-12 21:12 ` Lennart Borgman (gmail)
@ 2008-01-14 17:16 ` Joel J. Adamson
1 sibling, 0 replies; 3+ messages in thread
From: Joel J. Adamson @ 2008-01-14 17:16 UTC (permalink / raw)
To: help-gnu-emacs
sapsi <saptarshi.guha@gmail.com> writes:
> Hello,
> I have the following function in my .emacs (or rather Preferences.el
> on Aquamacs)
>
> (defun send-to-R-app ()
If the R you want is R, then you want ESS (ess.r-project.org).
Joel
--
Joel J. Adamson
Biostatistician
Pediatric Psychopharmacology Research Unit
Massachusetts General Hospital
Boston, MA 02114
(617) 643-1432
(303) 880-3109
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-01-14 17:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-12 17:58 Invalid Function while using setq sapsi
2008-01-12 21:12 ` Lennart Borgman (gmail)
2008-01-14 17:16 ` Joel J. Adamson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).