Emacs Moz Controller

Wenshan

renws1990@gmail.com

Table of Contents

Demo

  • refresh
  • previous / next tab
  • page up / down
  • kill current page
  • zoom in / out
  • view page source

Installation

Writing Elisp

  • define macro
    (defmacro defun-moz-controller-command (name arglist doc &rest body)
      "Macro for defining moz commands.
    
    NAME: function name.
    ARGLIST: should be an empty list () .
    DOC: docstring for the function.
    BODY: the desired JavaScript expression, as a string."
      `(defun ,name ,arglist
         ,doc
         (interactive)
         (comint-send-string
          (inferior-moz-process)
          ,@body)
         )
      )
    
  • view page source

TODOs

  • Retrieve current URL
    • send command
    • wait and receive output
  • Or…Embed webkit into Emacs

Questions & Answers