I'm in the process of configuring a development environment to learn
Lisp. My platform consists of OS X 10.3 with Unix goodies, such as Emacs
21.3.1 and Clisp 2.29.12, provided by Fink. I manually installed Ilisp 5.
12.0 and version 6.0 of the Hyperspec into a temporary home.
Configuring Ilisp was not too painful, and I have no problems sending
forms from an Emacs buffer to Clisp for evaluation. However, I have not
been able to get Ilisp to look up keywords in HyperSpec; Emacs
cheerfully informs me that no match for the symbol exists. It appears
that hyperspec.el does not properly load the symbol table.
I've obtained the most progress towards a solution using the default
browser in OS X (Safari). While a Fink packages exists for W3M, it
appears to require additional files to interoperate with Emacs. I
downloaded and toyed with these files to no avail, although I did manage
to get W3M to start in an Emacs buffer.
Relevant sections from my .emacs:
***
(setq common-lisp-hyperspec-root
"file://Users/ayank/Documents/text/computer/lisp/HyperSpec/")
(setq common-lisp-hyperspec-symbol-table
"file://Users/ayank/Documents/text/computer/lisp/HyperSpec/Data/
Map_Sym.txt")
(load-library
"file://Users/ayank/Documents/text/computer/lisp/ilisp/extra/hyperspec")
(global-set-key [(shift f1)]
'(lambda ()
(interactive)
(common-lisp-hyperspec
(thing-at-point 'symbol))))
(setq browse-url-browser-function 'browse-url-generic
browse-url-generic-program "/usr/bin/open")
***
Many thanks,
Andreas
andreas at yank dot to
Andreas Yankopolus <·······@nospam.com> writes:
> (setq common-lisp-hyperspec-root
> "file://Users/ayank/Documents/text/computer/lisp/HyperSpec/")
> (setq common-lisp-hyperspec-symbol-table
> "file://Users/ayank/Documents/text/computer/lisp/HyperSpec/Data/
> Map_Sym.txt")
>
> (load-library
> "file://Users/ayank/Documents/text/computer/lisp/ilisp/extra/hyperspec")
Unless emacs does something special on Macos X, the last two of these
should refer to files, not URI
-dan
--
http://web.metacircles.com/cirCLe_CD - Free Software Lisp/Linux distro
Andreas Yankopolus wrote:
> (setq common-lisp-hyperspec-root
> "file://Users/ayank/Documents/text/computer/lisp/HyperSpec/")
> (setq common-lisp-hyperspec-symbol-table
> "file://Users/ayank/Documents/text/computer/lisp/HyperSpec/Data/
> Map_Sym.txt")
Note that one is apparently supposed to be a URL and one is a local path
(Coincidentally, I just happened to mention the same issue in another post
minutes ago).
Perhaps try:
(setq common-lisp-hyperspec-root
"file:/Users/ayank/Documents/text/computer/lisp/HyperSpec/")
(setq common-lisp-hyperspec-symbol-table
"/Users/ayank/Documents/text/computer/lisp/HyperSpec/Data/Map_Sym.txt")
Note also that file: URLs should typically "start" with one slash (or three
slashes) on unix boxes, not two, for pedantic reasons I won't go into.
From: Bill Clementson
Subject: Re: Unable to access HyperSpec via Ilisp on OS X
Date:
Message-ID: <wkk76ecc6f.fsf@yahoo.com>
Andreas Yankopolus <·······@nospam.com> writes:
> I'm in the process of configuring a development environment to learn
> Lisp. My platform consists of OS X 10.3 with Unix goodies, such as Emacs
> 21.3.1 and Clisp 2.29.12, provided by Fink. I manually installed Ilisp 5.
> 12.0 and version 6.0 of the Hyperspec into a temporary home.
>
> Configuring Ilisp was not too painful, and I have no problems sending
> forms from an Emacs buffer to Clisp for evaluation. However, I have not
> been able to get Ilisp to look up keywords in HyperSpec; Emacs
> cheerfully informs me that no match for the symbol exists. It appears
> that hyperspec.el does not properly load the symbol table.
>
> I've obtained the most progress towards a solution using the default
> browser in OS X (Safari). While a Fink packages exists for W3M, it
> appears to require additional files to interoperate with Emacs. I
> downloaded and toyed with these files to no avail, although I did manage
> to get W3M to start in an Emacs buffer.
Have you tried the setup I documented in the CL Cookbook for OSX? The
following code snippet works for me (using Safari to display
context-sensitive hyperspec definitions):
(setq browse-url-browser-function
'(lambda (url &optional new-win)
(do-applescript (concat "open location \""
url "\""))))
--
Bill Clementson
Bill Clementson <···············@yahoo.com> writes:
> Have you tried the setup I documented in the CL Cookbook for OSX? The
> following code snippet works for me (using Safari to display
> context-sensitive hyperspec definitions):
>
> (setq browse-url-browser-function
> '(lambda (url &optional new-win)
> (do-applescript (concat "open location \""
> url "\""))))
Two comments: that opens the URL in the Finder's default browser
(which might not be Safari), and, amusingly/ironically, it won't work
with the Emacs that ships with OS X (do-applescript is a newish
function). You're welcome do do anything you wish with the following
code, which I posted to gnus.emacs.vm.info:
(defun send-url-to-safari (url)
"Sends URL to Safari, using Apple's Open Scripting Architecture."
(with-temp-buffer
(insert "tell application \"Safari\"\n")
(insert " activate\n")
(insert " make new document at the beginning of documents\n")
(insert (format " set the URL of the front document to \"%s\"\n" url))
(insert "end tell\n")
(call-process-region (point-min) (point-max) "/usr/bin/osascript")))
--
/|_ .-----------------------.
,' .\ / | No to Imperialist war |
,--' _,' | Wage class war! |
/ / `-----------------------'
( -. |
| ) |
(`-. '--.)
`. )----'
Hmm, the send-url-to-safari I posted was a little more appropriate for
VM than for HyperSpec reading. The following version lets you avoid
always popping up new windows.
(defun send-url-to-safari (url &optional reuse-window)
"Sends URL to Safari, using Apple's Open Scripting Architecture."
(with-temp-buffer
(insert "tell application \"Safari\"\n")
(insert " activate\n")
(unless reuse-window
(insert " make new document at the beginning of documents\n"))
(insert (format " set the URL of the front document to \"%s\"\n" url))
(insert "end tell\n")
(call-process-region (point-min) (point-max) "/usr/bin/osascript")))
--
/|_ .-----------------------.
,' .\ / | No to Imperialist war |
,--' _,' | Wage class war! |
/ / `-----------------------'
( -. |
| ) |
(`-. '--.)
`. )----'
Thanks for the helpful suggestions. I originally made the Ilisp sections
of my .emacs by pulling from online ones posted by Bill Clementson and
others.
As was suggested, I changed my .emacs so that the entries that should be
files are files and the ones that should be URIs are URIs. Emacs now
tries to open a URL in the HyperSpec, but fails because do-applescript
is a void function. I grepped through all the .el files on my system,
but did not see a reference to this function. Evaluating a form
containing do-applescript in the *scratch* window also returns a void
function error. I noticed that it is not defined in any of the .emacs
files I referenced, so it must be in someone's .emacs. Any suggestions
on where this function should come from would be greatly appreciated.
I'm using a stock Fink installation of Emacs 21.3.1.
Thanks,
Andreas
andreas at yank dot to
Tom's send-url-to-safari function did the trick. I turned browse-url-
browser-function into a wrapper for send-url-to-safari and everything
magically worked!
Thanks for all the help.
-Andreas
andreas at yank dot to
On Thu, 06 Nov 2003 07:05:40 -0600, Andreas Yankopolus <·······@nospam.com> wrote:
> Thanks for the helpful suggestions. I originally made the Ilisp
> sections of my .emacs by pulling from online ones posted by Bill
> Clementson and others.
>
> As was suggested, I changed my .emacs so that the entries that
> should be files are files and the ones that should be URIs are
> URIs. Emacs now tries to open a URL in the HyperSpec, but fails
> because do-applescript is a void function. I grepped through all the
> .el files on my system, but did not see a reference to this
> function. Evaluating a form containing do-applescript in the
> *scratch* window also returns a void function error. I noticed that
> it is not defined in any of the .emacs files I referenced, so it
> must be in someone's .emacs. Any suggestions on where this function
> should come from would be greatly appreciated.
>
> I'm using a stock Fink installation of Emacs 21.3.1.
<http://www.google.com/groups?selm=xcvsml2ymg9.fsf%40famine.OCF.Berkeley.EDU>
I just posted this in another thread, but note that the instructions
in ilisp.emacs suggest that you point to Map_Sym.Txt, but you must
instead point to Map_Sym.txt.
rif