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 <[email protected]> wrote:
> Henrik Sarvell <[email protected]>
> 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:[email protected]?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)
(ac-config-default)
(setq ac-auto-start 3)
(add-to-list 'ac-modes 'picolisp-mode)
(setq ac-ignore-case t)
(setq ac-auto-start nil)
(global-set-key (kbd "C-<tab>") 'auto-complete)
; left7 left14 left-dir-plus-speedbar
(setq ecb-layout-name "left15")
(setq ecb-layout-window-sizes (quote (("left15" (0.14285714285714285 . 0.49206349206349204) (0.14285714285714285 . 0.49206349206349204)))))
(setq my-projects '("/opt/clojure" "/opt/picolisp" "/home/henrik/rails_projects" "/home/henrik/.emacs.d" "/var/www/casinolovers"))
(setq tags-table-list '("/opt/picolisp"))
(setq ecb-source-path my-projects)
(add-to-list 'load-path "~/emacs.d/henrik/slime")
(require 'slime)
(slime-setup)
(eval-after-load "slime"
'(progn (slime-setup '(slime-repl))))
(add-to-list 'auto-mode-alist '("\\.l\\'" . picolisp-mode))
(add-hook 'inferior-picolisp-load-hook (lambda () (tsm-mode 1)))
(delete-selection-mode t)
;(load-file "~/.emacs.d/henrik/nxhtml/autostart.el")
;(custom-set-faces
; '(mumamo-background-chunk-major ((((class color) (min-colors 88) (background dark)) nil)))
; '(mumamo-background-chunk-submode1 ((((class color) (min-colors 88) (background dark)) nil))))
;(add-hook 'php-nxhtml-mumamo-hook (lambda () (mumamo-alt-php-tags-mode 1)))
;(setq debug-on-error nil)
;(add-hook 'picolisp-mode-hook (lambda () (slime-mode 1)))
;(setq slime-lisp-implementations
; `((picolisp ("/opt/picolisp/p") :init slime-init-picolisp)))
;(defun slime-init-picolisp (file _)
; (setq slime-protocol-version 'ignore)
; (setq arglist-for-echo-area (lambda ()))
; (format "%S\n"
; `(prog (load ,(expand-file-name "/home/henrik/.emacs.d/henrik/swank-picolisp/swank-picolisp.l"))
; (swank-start ,file))))