Emacs: Lookup Google, Dictionary, Documentation
Emacs: xah-lookup.el, Lookup the Web
For ready to-use-package, see
Write Your Own Lookup Command
Here's how to write a command to lookup the web of the word under cursor.
(require 'browse-url) ; part of gnu emacs (defun my-lookup-wikipedia () "Look up the word under cursor in Wikipedia. If there is a text selection (a phrase), use that. This command switches to browser." (interactive) (let (word) (setq word (if (use-region-p) (buffer-substring-no-properties (region-beginning) (region-end)) (current-word))) (setq word (replace-regexp-in-string " " "_" word)) (browse-url (concat "http://en.wikipedia.org/wiki/" word)) ;; (eww myUrl) ; emacs's own browser ))
You can setup a key such as F8 for easy access. See: Emacs: How to Define Keys.
You can change the URL in the above definition to other reference sites.
Writing Major Mode Topics
- How to Write a Emacs Major Mode for Syntax Coloring
- Emacs Lisp: html6-mode
- Emacs Lisp: Font Lock Mode Basics
- Emacs Lisp: How to Define Face
- Emacs Lisp: How to Color Comment in Major Mode
- Emacs Lisp: How to Write Comment Command in Major Mode
- Emacs Lisp: How to Write Your Own Comment Command from Scratch
- Emacs Lisp: How to Write Keyword Completion Command
- Emacs Lisp: How to Create Keymap for Major Mode
- Emacs Lisp: Create Abbrev and Templates for Major Mode
- Emacs Lisp: Overlay Highlighting
- Emacs: Lookup Google, Dictionary, Documentation
- Emacs Lisp: How to Name Your Major Mode
- Emacs Lisp: What's “feature”?
- Emacs Lisp: require, load, load-file, autoload, feature, Explained