Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
emacs_version:
- '28.2'
- '29.4'
- '30.1'
- '30.2'
- 'snapshot'

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Emacs
uses: purcell/setup-emacs@master
with:
version: ${{ matrix.emacs_version }}

- name: Run tests
run: make test
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

56 changes: 56 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# AGENTS.md

## Project Overview

"Edit with Emacs" is a browser extension for Firefox and Chrome-based browsers that allows users to edit text areas from web pages in their Emacs editor.

### Architecture
- **The Browser Extension**: JavaScript-based. It identifies editable fields, extracts text, and sends it to a local server.
- **The Edit Server (`edit-server.el`)**: An Emacs Lisp script running inside Emacs. It listens for HTTP requests (default port 9292), opens a buffer, and returns the modified text upon buffer kill/save.

The project is licensed under the GPL v3.

## Project Structure

- `/` (Root): Contains v2 `manifest.json`, `Makefile` and project-wide documentation and metadata.
- `/css/`: CSS for the browser extension.
- `/fancy-settings/`: a vendored copy of fancy-setting library
- `/html/`: the background.html for the browser extension
- `/icons/`: icons and indicators for the browser extension
- `/javascript/`: the javascript for the browser extension
- `/lib/`: mini-fied copies of supporting javascript libs
- `/servers/`: example servers including the main Emacs `edit-server.el`

This file contains instructions for AI agents to understand and interact with this project.

## Project Overview

"Edit with Emacs" is a browser extension for Firefox and other WebExtension-compatible browsers that allows users to edit text areas from web pages in their Emacs editor. It consists of two main components:

1. **The Browser Extension**: Written in JavaScript, it identifies editable text areas on a web page and sends their contents to the Edit Server.
2. **The Edit Server**: An Emacs Lisp script (`edit-server.el`) that runs within Emacs, listening for requests from the browser extension. It opens a new Emacs buffer with the text from the web page, and when the user saves and closes the buffer, it sends the updated text back to the browser.

The project is licensed under the GPL v3.

## Key Technologies

- **JavaScript**: For the browser extension logic.
- **Emacs Lisp**: For the Edit Server.
- **HTML/CSS**: For the extension's options page and UI elements.
- **WebExtensions API**: The standard for browser extension development.

## Build & Test Info

- **Make**: Use `make` to see available targets.
- **Testing**:
- JavaScript tests (if any) are located in `/test`.
- To test the extension: Load the directory as a "Temporary Extension" in `about:debugging` (Firefox) or `chrome://extensions` (Chrome).
- To test the server: `M-x load-file edit-server.el` followed by `M-x edit-server-start`.

## Agent Guidelines

- **Namespacing**: When writing JavaScript, prefer the `browser` namespace or a compatibility polyfill unless specific to one browser.
- **Elisp Style**: Follow standard Emacs Lisp naming conventions (e.g., prefix functions with `edit-server-`).
- **No Direct Commits**: Agents should suggest changes in code blocks or provide patch files. Do not attempt to commit directly to the repository.
- **Documentation**: If adding a feature to the extension, ensure the corresponding configuration option is added to the Options page and documented in the README.
- **Communication Protocol**: If modifying the data sent between the browser and Emacs, ensure backward compatibility so older versions of the extension can still talk to newer versions of the server script (and vice versa).
32 changes: 32 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Makefile for Edit with Emacs

.PHONY: test release

# Get the version from manifest.json
VERSION := $(shell grep "\"version\"" manifest.json | cut -d: -f2 | cut -d\" -f2)
NAME=edit-with-emacs
RELEASE_NAME=edit-with-emacs-$(VERSION)
RELEASE_ZIP=$(RELEASE_NAME).zip

# Files to include in the release zip.
# We have to be careful not to include any dev tooling or secrets.
FILES = \
manifest.json \
icons \
html \
javascript \
css \
lib \
fancy-settings \
servers/edit-server.el \
README.md \
COPYING \
NEWS

test:
emacs -Q --batch -l tests/install-prereqs.el
emacs -Q --batch -l ert -l servers/edit-server.el -l servers/edit-server-ert.el -f ert-run-tests-batch-and-exit

release:
rm -f $(RELEASE_ZIP)
zip -r $(RELEASE_ZIP) $(FILES)
13 changes: 0 additions & 13 deletions test-travis.sh

This file was deleted.