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)