Tips for working with pmwiki-mode and Emacs
This page is a compilation of tips for working with a PmWiki-site using pmwiki-mode for Emacs.
Manually open a browsed page in Emacs
- Map a keyboard shortcut in your browser that copies the URI of the current window, say
- The command
C-c C-oin pmwiki-mode) can take a URI as argument for what page to open.
Combine the above as follows
- First use
M-tin the browser to copy the URI
- Then do
C-c C-oin Emacs followed by
C-yto paste the URI.
Voila, a way to quickly open a browsed page in Emacs for editing.
Automatically open a browsed page in Emacs
This tip describes how you can set up your system so that a single keypress in the browser Opera opens the current webpage for editing in Emacs using pmwiki-mode.
- Install gnuserv.
- Start Emacs
- Set the Emacs to receive commands by executing:
(This is not necessary if you made Emacs do this automatically when started)
- Verify that gnuserv works, for instance by executing this command:
- If everything works, then the prompt should now show: 3
- Customize a keyboard shortcut (e.g.
C-eif you don't use Opera's mail software) in Opera to do the following:
Copy document address & Execute program, "wiki-open.sh --client", "%c"
- Start Emacs and execute
M-x gnuserv-start(this prepares Emacs for receiving commands via
- Go to Opera and browse to the page of your interest, then press
C-eto open that page for editing in Emacs.
Mozilla and Firefox
Mozilla has no built-in way to pass the current URL to other applications. However, it can be enhanced by plugins which offer this functionality.
- Install gnuserv as described above.
- Create a batch script named
gnuservfolder with the following content:
C:\home\.elisp\gnuserv\gnuclientw.exe -q -e (my-pmwiki-opener \"%*\")
- Adjust the path to your configuration. The path must be absolute.
- For Linux, a similar shell script is necessary.
- Install Launchy.
- Create a file named
chromesub-folder of your Mozilla profile directory with the following content:
<?xml version="1.0" encoding="UTF-8"?> <configurations xmlns="http://launchy.mozdev.org/configurations"> <application> <label>Emacs PmWiki Helper</label> <type>1</type> <command>C:\home\.elisp\gnuserv\emacs-pmwiki-helper.bat</command> <arguments></arguments> </application> </configurations>
- Adjust the <command> tag to your configuration. The path must be absolute.
- Start Emacs. Make sure gnuserv is running.
- (Re)start Mozilla. Right-click on the page and choose from the Launchy menu Open in Emacs PmWiki Helper.