Re: Does 'doc' require Global Installation?

2011-11-11 Thread Jon Kleiser

Hi Alex,

It may very well be that 'cat' cannot handle an URL, but when I try this:
(doc '+ echo)
then I get this:
file:doc/ref_.html#+

It still seems to me that this path is more relative than absolute.

I have made a tiny Mac OS X shell script that opens up a given URL using 
my default browser (Safari), but I think it would need an absolute URL. 
My current shell script looks like this:


#!/bin/sh
osascript -e open location \$1\

/Jon

On 11/10/11 4:33 PM, Alexander Burger wrote:

Hi Jon,


I tried this (using PicoLisp 3.0.7.3 C on my Mac):
(doc '+ cat)
and got this:
cat: file:doc/ref_.html#+: No such file or directory

Does this mean that the 'doc' function requires global installation of
PicoLisp?

No, the installation can be global or local, it will always find the
documentation.


The problem with the above is that 'cat' cannot handle an URL. What
'doc' expects is a browser. You can perhaps call

(doc '+ 'safari)

or set the environment variable BROWSER so some executable.

Cheers,
- Alex


--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: How to get the signature of function and method definitions

2011-11-11 Thread Thorsten
Alexander Burger a...@software-lab.de writes:

Hi Alex,

 Perhaps the output mode (console cooked vs. raw) is not right? Does it
 behave correctly if you start it - without emacs - just from the shell

$ pil +

 in the default way?

picolisp does work from the shell - but not 'doc:

,-
| tj1@tj-desktop:~$ pil + 
| + open: No such file or directory   
| ?   
| : (+ 2 3)   
| - 5
| : (pp 'insert)  
| (de insert (N Lst X)
| (conc (cut (dec N) 'Lst) (cons X) Lst) )
| - insert   
| : (doc 'insert) 
| !? (doc 'insert)
| doc -- Undefined
| ?   
| :   
`-


Cheers,
-- 
Thorsten

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: Does 'doc' require Global Installation?

2011-11-11 Thread Alexander Burger
Hi Jon,

 It may very well be that 'cat' cannot handle an URL, but when I try this:
 (doc '+ echo)
 then I get this:
 file:doc/ref_.html#+

Yes, that's right. 'echo' doesn't try to open its argument(s), but sends
them to stdout.


 It still seems to me that this path is more relative than absolute.

As for all files in PicoLisp, this depends on how the interpreter is
invoked. I have global and local installations here. So if I try the
global one,

   $ pil +
   : (doc '+ echo)
   file:///usr/lib/picolisp/doc/ref_.html#+
   - T

or a local installation with relative

   $ ./pil +
   : (doc '+ echo)
   file:doc/ref_.html#+
   - T

or global pathes

   $ /usr/abu/pico/pil +
   : (doc '+ echo)
   file:///usr/abu/pico/doc/ref_.html#+
   - T

I always get the correct path.

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: How to get the signature of function and method definitions

2011-11-11 Thread Alexander Burger
Hi Thorsten,

  Perhaps the output mode (console cooked vs. raw) is not right? Does it
  behave correctly if you start it - without emacs - just from the shell
 
 $ pil +
 
  in the default way?
 
 picolisp does work from the shell - but not 'doc:
 
 ,-
 | tj1@tj-desktop:~$ pil + 
 | + open: No such file or directory   

Oops, do you use a rather old version? The '+' as debug flag was
introduced with picoLisp-3.0.6 (before March 2011).


 | !? (doc 'insert)
 | doc -- Undefined

This happens because the '+' was not recognized, and thus the debugger
and related information were not loaded.

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: Does 'doc' require Global Installation?

2011-11-11 Thread Jon Kleiser

Hi Alex,

Thanks! By invoking PicoLisp using the global path, I'm now able to view 
the docs by specifying my shell script, like this:

(doc '+ openurl.sh)
.. and after having done this:
export BROWSER=openurl.sh
.. I only have to do (doc '+). Very nice!

/Jon

On 11/11/11 2:24 PM, Alexander Burger wrote:

Hi Jon,


..

As for all files in PicoLisp, this depends on how the interpreter is
invoked. I have global and local installations here. So if I try the
global one,

$ pil +
: (doc '+ echo)
file:///usr/lib/picolisp/doc/ref_.html#+
-  T

or a local installation with relative

$ ./pil +
: (doc '+ echo)
file:doc/ref_.html#+
-  T

or global pathes

$ /usr/abu/pico/pil +
: (doc '+ echo)
file:///usr/abu/pico/doc/ref_.html#+
-  T

I always get the correct path.

Cheers,
- Alex


--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: Does 'doc' require Global Installation?

2011-11-11 Thread Henrik Sarvell
Thorsten I'm afraid we're two monkeys in a spaceship with this.

The above code is basically just ripped from Xah Lee's article:
http://xahlee.org/emacs/emacs_lookup_ref.html

Read Xah's stuff carefully and maybe it will help you, note the
(w3m-browse-url myurl) call in his second code listing.

Basically everything in my whole emacs series is just copy paste from
other people's code.

I have attached my config for complete reference in case you want to
take a look.


On Sat, Nov 12, 2011 at 1:51 AM, Thorsten quintf...@googlemail.com wrote:
 Henrik Sarvell hsarv...@gmail.com
 writes:

 Hi Henrik,

 For emacs I wrote jump to documentation some while back:
 http://www.prodevtips.com/2010/11/03/autocompletion-jump-to-documentation-swank-and-slime/

 If you don't care to do the jump here is the e-lisp code that you put
 in your config:

 (defun picolisp-jump ()
  (interactive)
  (let (myword myurl)
    (setq myword
          (if (and transient-mark-mode mark-active)
              (buffer-substring-no-properties (region-beginning) (region-end))
            (thing-at-point 'symbol)))
   (setq myurl (concat http://www.software-lab.de/doc/ref; (upcase
 (substring myword 0 1)) .html# myword))
   (browse-url myurl)))

 Invocation:

 (define-key picolisp-mode-map (kbd C-M-r) 'picolisp-jump)

 This is really great, thanks.

 I was looking for an easier way to access the documentation from inside
 emacs. It works just fine for me, except one little thing: the emacs-w3m
 window (in my case) always replaces the picolisp window, instead of
 splitting it and showing both buffers, w3m and picolisp.

 I use (w3m-use-tab t), what seems to be a logical choice, unfortunately
 it overrides the usual split window behaviour by (w3m-pop-up-windows t).
 Maybe you use w3m too and found a solution for this?


 cheers
 --
 Thorsten

 --
 UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

(defun iwb ()
  indent whole buffer
  (interactive)
  (delete-trailing-whitespace)
  (indent-region (point-min) (point-max) nil)
  (untabify (point-min) (point-max)))
  
(defun rc () (slime-repl-clear-buffer) ) 
 
(defun browser-jump (base-url)
  (let (myword myurl)
(setq myword
  (if (and transient-mark-mode mark-active)
  (buffer-substring-no-properties (region-beginning) (region-end))
(thing-at-point 'symbol)))
(setq myurl (concat base-url myword))
(browse-url myurl)))

(defun clojure-jump () (interactive) (browser-jump http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/;))

(defun picolisp-jump ()
  (interactive)
  (let (myword myurl)
(setq myword
  (if (and transient-mark-mode mark-active)
  (buffer-substring-no-properties (region-beginning) (region-end))
(thing-at-point 'symbol)))
(setq myurl (concat http://www.software-lab.de/doc/ref; (upcase (substring myword 0 1)) .html# myword))
(browse-url myurl)))

(fset 'sqbracket-wrap
  (lambda (optional arg) Keyboard macro. (interactive p) (kmacro-exec-ring-item (quote (\213[ 0 %d)) arg)))

(fset 'curlybrace-wrap
  (lambda (optional arg) Keyboard macro. (interactive p) (kmacro-exec-ring-item (quote (\213{ 0 %d)) arg)))

(setq kill-whole-line t)

(defun refresh-file ()
  (interactive)
  (revert-buffer t t t))


(global-set-key (kbd C-c C-s) 'find-grep-dired)
(global-set-key [f5] 'refresh-file)
(global-set-key (kbd C-z) 'undo)
(global-set-key (kbd C-M-m) 'mark-sexp)
(global-set-key (kbd M-[) 'sqbracket-wrap)
(global-set-key [f1] 'menu-bar-mode)
(global-set-key [f6] 'split-window-horizontally)
(global-set-key [f7] 'split-window-vertically)
(global-set-key [f8] 'delete-window)
(global-set-key (kbd C-c c)'comment-region)
(global-set-key (kbd C-c C-u c)'uncomment-region)
(define-key clojure-mode-map (kbd M-{) 'curlybrace-wrap)
(define-key clojure-mode-map (kbd C-M-r) 'clojure-jump)
(define-key picolisp-mode-map (kbd C-M-r) 'picolisp-jump)

(defun lisp-enable-paredit-hook () (paredit-mode 1))
(add-hook 'picolisp-mode-hook 'lisp-enable-paredit-hook)

(add-to-list 'load-path ~/.emacs.d/henrik/color-theme-6.6.0)
(require 'color-theme)
(eval-after-load color-theme
  '(progn
 (color-theme-initialize)
 (color-theme-hober)))
(eval-after-load color-theme '(color-theme-zenburn))
(set-face-attribute 'default nil :height 104)

(global-linum-mode 1)
(setq column-number-mode t)

(defun switch-full-screen ()
  (interactive)
  (shell-command wmctrl -r :ACTIVE: -btoggle,fullscreen))

(global-set-key [f11] 'switch-full-screen)

(load-file /home/henrik/.emacs.d/henrik/cedet/common/cedet.el)

(add-to-list 'load-path ~/.emacs.d/henrik/ecb-2.40)
(global-ede-mode 1)
(semantic-load-enable-code-helpers)
;(add-hook 'picolisp-mode-hook 'semantic-default-picolisp-setup)
(require 'ecb)
(setq ecb-tree-buffer-style 'ascii-guides)
(global-set-key [f12] 'ecb-activate)
(setq ecb-tip-of-the-day nil)

(add-to-list 'ac-dictionary-directories ~/.emacs.d/henrik/dict)
(require 'auto-complete-config)