Ambrevar Fix set-url-new-buffer duplicate
SET-URL-NEW-BUFFER is declared twice which is probably a bug and also leads to
compilation warning/error on some Common Lisp implementations.
Latest commit bdab8b5 Oct 11, 2018

README.org

Next Developer Readme

Developer Installation

Next is written in Common Lisp. It can be built with CCL and SBCL. It is designed to be cross-platform compatible. Support for graphics is provided via Cocoa for MacOS and GTK for Linux. To download a prebuilt-binary, please see the “Releases” section of the GitHub repository (https://github.com/next-browser/next/releases).

MacOS Setup

Installing CCL

  1. Copy the downloaded CCL directory to /usr/local/src/ccl
  2. Copy the script located at ccl/scripts/ccl64 somewhere into your executable path
  3. Optionally make an alias, or rename ccl64 to ccl

Installing Quicklisp

The official quicklisp website can provide updated links to downloads, and instructions:

https://www.quicklisp.org

To install quicklisp:

  • Download https://beta.quicklisp.org/quicklisp.lisp
  • Execute ccl --load quicklisp.lisp to load quicklisp
  • Evaluate in the REPL (quicklisp-quickstart:install) to install
  • Evaluate in the REPL (ql:add-to-init-file) to add quicklisp to your ccl init file

more detailed instructions and other resources are readily available on the quicklisp website.

Linux Setup (Experimental)

Installing SBCL

You can obtain SBCL either from your package manager or by downloading it directly from the SBCL repository.

Next is also compatible with CCL, but due to upstream issues in a dependency, the stability of Next is best with SBCL.

Installing Quicklisp

The official quicklisp website can provide updated links to downloads, and instructions:

https://www.quicklisp.org

To install quicklisp:

  • Download https://beta.quicklisp.org/quicklisp.lisp
  • Execute lisp --load quicklisp.lisp to load quicklisp (replace lisp with sbcl or ccl)
  • Evaluate in the REPL (quicklisp-quickstart:install) to install
  • Evaluate in the REPL (ql:add-to-init-file) to add quicklisp to your ccl init file

more detailed instructions and other resources are readily available on the quicklisp website.

Install WebKit2GTK+

Find a package for your distribution which provides libwebkit2gtk-4.0.so (the shared library for WebKit2GTK+).

For Ubuntu this package is libwebkit2gtk-4.0-dev For Debian this package is libwebkit2gtk For Arch this package is webkit2gtk

A note of caution about installing Webkit on Linux via your package manager: Your distribution supplied version of Webkit may not provide up-to-date versions of Webkit including the latest security patches. WebkitGTK+ tries to do the best job possible with maintaining security patches upstream, but it is also additionally up to the the distribution provider to update their packages to take advantage of these fixes.

Install cl-webkit

The cl-webkit bindings provide an interface to the Webkit2GTK+ framework for manipulating and rendering web content.

Run from Source

In a new Terminal execute the following:

  1. lisp to create a new Lisp Repl (replace lisp with sbcl or ccl)
  2. Execute (require :asdf) if asdf is not already loaded
  3. Execute (asdf:load-asd "/full/path/to/next.asd") to load the Next system definition (you can not use relative pathnames).
  4. Execute (ql:quickload :next) to load the Next system into your Lisp image. To load the MacOS version quickload :next/cocoa. To load the GTK version quickload :next/gtk.
  5. Execute (next:start) to open your first Next window.

Compile

Build a Linux binary

cd next/next
make build-gtk

the compiled binary will be present in the directory source as next-gtk.

MacOS Compilation

From the CCL Source directory, execute

  1. ccl --no-init --load make.lisp
  2. The compiled binary will be present in build/Next

Help & Community

There are several ways to ask for help from the community. The first and easiest one is to simply open up an issue with whatever problem you have. Feel free to open issues for any task, suggestion or conversation you wish to have.

Contribution

To contribute, please find a task within this document that has a TODO label affixed. Upon finding a task that you’d like to work on, ideally, ensure that it is not already being worked on.

After you have found a TODO item that is available:

  • make a fork of the repository
  • add your changes
  • make a pull request

IRC Channel

You can find Next on Freenode IRC at #next-browser

Mailing List

Next maintains a GNU Mailman server located at http://mail.next-browser.com/listinfo.

Developer Mailing List

You can sign up for the developer mailing list to participate in discussions on the engineering and programming of Next.

Alpha Mailing List

You can up for the alpha mailing list to participate in discussions on feature requests, and early version testing.

Release Timeline

Major releases are issued by incrementing the first digit. That is, release 1.20, and 2.20 are one major release away from each other. Minor releases are issued by incrementing by 0.01. That is, 1.01, and 1.02 are two minor releases following major release 1.0.

0.10

Jump to paragraph categorized based on content

  • Develop first content analysis functions to be used for keyword generation
  • Use the keyword generation to extend upon the current jump to heading built into next to allow jumping to a paragraph (many websites do not use h1, h2 tags, especially ones with user created content)

Maintain Scroll Position

  • When jumping back and forth through history, maintain the scroll position

Package System

  • Create way for users to install packages easily
  • Create trusted source for packages

Compilation Script

The script should be able to produce a complete application bundle for MacOS, self contained dmg etc. On Linux it should do the equivalent, but with flatpak.

Compilation Script Linux

Compilation Script MacOS

0.09

Linux Frontend

  • Create frontend that renders the new Next GUI

MacOS Frontend

  • Create frontend that renders the new Next GUI

Lisp Core Remote Backend

  • Create abstract interface for controlling frontends.
  • Interface must be asynchronous
  • Interface should be connection agnostic, should support BSD style sockets for first iteration, and Unix domain sockets for second interation

0.08

Execute Extended Command

Allow the user to run M-x to execute any extended command.

Hydra Functionality

  • Implement functionality similar to the famous Hydra package by Oleh Krehel

Add Hook System

Add ability to inspect commands

Continuation Passing Style Input

  • Allow user to use a (input* ()) type binding in which they can prompt the user for input rather than the current style which involves setting the input handling as part of the lambda registered in the keybinding
  • Convert existing functions to use continuation passing style input

Define-Command

  • Implement define-command macro with overhaul for how keybindings are set/handled in functions
  • Convert all user invokable functions to use define-command

Support XDG Configuration

0.07

GTK Port

  • Create Linux GTK Port

0.06

Fix Compilation

  • Compilation loading of quicklisp should check both ~/.quicklisp as well as ~/quicklisp and load whichever it finds first

User Customization Example

  • Create an example in the Documents directory that details the creation of a simple mode, and a way of customizing Next

Jump to Heading

  • Implement something akin to ijump which allows you to jump to any heading on a given page represented by H1 H2 H3 tag etc

Search within Buffer

  • Add ability to search within the buffer

Add Search Function

  • Minibuffer should allow searching via a search engine

Buffer contains list of modes

  • The buffer should contain a list of all of the modes that have been applied to it, so that no memory is lost when switching modes

Add Slime Support

  • Add slime support to the compiled version of Next

Reload Init Function

  • Allow function to reload init

Add Help System

  • Add basic help system that can be extended
  • Add the ability to look up global variables

Extend Bookmark Support

  • Allow user to manually enter the bookmark URL into the minibuffer directly
  • Allow the user to create a bookmark from a link-hint anchor

0.05

Minibuffer selection

  • Should be able to move up and down through candidates using C-n and C-p
  • Minibuffer should return actual object in question instead of doing strange magic with strings

Minibuffer set text

  • Allow the setting of the Minibuffer text
  • Setup the automatic clearing of the Minibuffer previous text

Add Link Hints

  • user should be able to navigate all links entirely by keyboard
  • user should be able to open link hints in a new buffer with focus
  • user should be able to open link hints in a new buffer without focus

Fix keybindings within repl

  • Allow keybinding invocation within repl overriding ccl cocoa IDE

History

  • History will be stored in a db (possibly sqlite)

History is searchable

  • History has a query language that can be used to look for different things (e.g. date, include exclude regex, etc)
  • Because history is stored in sqlite db, user can create queries against their history

Set-url history suggestion

  • History should be suggested by set-url
  • Minibuffer input should be able to handle different use cases for different input methods

Update Manual

  • Update manual with latest capabilities and changes to codebase

0.04

Isolate backend QT Code

  • Break apart QT code into separate file
  • Remove all top-level side effects
  • Modularize GUI backend

Write Cocoa backend

  • Use CCL Cocoa Library to use native webkit backend

Bookmarks

  • Bookmarks will be stored in a db (possibly sqlite) with information about them, they’ll be navigable via a completion buffer

0.03

Write Manual Base

  • Write basic information and configuration within the manual as a “users” guide

Improve in Code Documentation & Architecture

  • Create much clearer picture of how everything functions together, make cleaner architecture diagrams showing how everything links together
  • Document all functions

OSX Compilation

  • Modify make.lisp script to create a binary that grabs all of the dependencies and creates a executable that can be deployed on OSX
  • Use `macdeployqt` to copy the core qt libraries to `Next.app/Contents/Frameworks`
  • Use `otool -L Next.app/Contents/MacOS/next` to find the linked frameworks that are not located in `Next.app/Contents/Frameworks`, manually copy them to `Next.app/Contents/Frameworks`
  • Use install_name_tool to update the now copied frameworks in `Next.app/Contents/Frameworks`
  • For more info please see: http://doc.qt.io/qt-5/osx-deployment.html

Kill Buffer

  • Add function to kill buffer, bind to C-k

0.02

History Tree Mode

  • Create a mode that allows traversal of the tree created in the history of a document-mode buffer

Cancel Within Minibuffer mode

Within document-mode the history will be represented as a tree

  • forwards and backwards navigation creating new nodes and

traversals. This will allow for all points in history to be reachable, and a future expansion designed to recreate the functionality offered by undo-tree: https://www.emacswiki.org/emacs/UndoTree

Ability to navigate forward and backward in history

  • using the key binding M-f, and M-b for forward and backward respectively
  • should only work if there is one child

Forward navigation with more than one child prompts mini-buffer selection

  • If a user tries to navigate forward but there is more than one possible destination available, show the possibilities as an auto-completable list in the minibuffer

CLOS

  • Convert struct usage to CLOS

Scrolling

  • The ability to scroll up and down within a document
    • using C-n to scroll down
    • using C-p to scroll up

0.01

This version describes the minimum usability as a basic browser, with the following features:
  • Implementation of document-mode, the major-mode that all modes extend
  • Ability to set key bindings for major modes
  • Ability to browse and change buffers using C-x b

Definitions

Buffer: All documents are contained in an object type called a buffer. As an example, a document on the web located at http://www.url.com can be contained in a buffer with a similar name. A buffer is composed of all elements (text, bitmaps, etc) necessary to render a single document.

Mode-map: A keyboard hot-key to function mapping.

Minibuffer: A special buffer dedicated to interacting with Next commands in progress. This buffer appears at the bottom of the screen and is collapsed when not in use.

Major-mode: A major mode is defined as the primary mode of interacting with a particular buffer. A mode defines a set of key bindings, hooks for actions, and presentation details for a given view. At any given time, there may only be one major mode for a buffer. All major modes are composed of entirely lower case alpha with dashes used as a separator. Every major mode has a keyboard mapping that follows this pattern: document-mode, will have a mode map called document-mode-map.

Minor-mode: A minor mode is a secondary mode of modifying a buffer’s behavior and content. There can be an infinite amount of minor modes applied to a given buffer. All minor modes are composed of entirely lower case alpha with dashes used as a separator.

Major mode: document-mode

All major modes inherit from document mode. Document mode provides the basic framework for mapping global commands and defining general behavior.

Document-mode will be the basic major mode for opening documents on the web. document-mode will extend document-mode, and thus will inherit all of its key bindings. If there is a conflict of key bindings, the lowest scope key binding will be prioritized. As a concrete example, all bindings defined in a minor mode will override any defined in document-mode. In the first release, document-mode will support the following key bindings and features:

For the first release, document-mode must have:

Ability to open a new html document with the key binding C-l

Opening of new pages in the same buffer can be invoked by the key binding C-l. This key binding will open up the Minibuffer and prompt the user to enter the url which they would like to visit.

Ability to open new buffers with the key-binding M-l

Opening of new buffers by invoking M-l will open the Minibuffer. Within the Minibuffer, the user will be presented with a prompt in which they can enter in the url they would like to visit in a new buffer.
  • May possibly switch implementation to “hide” rather than “close” widgets, possibly using a widget pool as well for memory performance

Ability to set Key bindings

The following syntax should be used to set a key binding:

(define-key x-mode-map (kbd “C-h”) ‘function)

Where x-mode-map is a keymap relating to a mode (major or minor).

Where ‘function is a function that is passed to define-key to trigger a function upon a key press.

(kbd “C-h”) defines that the keyboard sequence Control + h is represented. For the keyboard syntax, the following keys are described:

  • S = super key (windows/command key)
  • C = control key
  • M = meta key (alt key)

A chain of key bindings may be set in the following manner:

(kbd “C-x C-s”) will denote the following key presses, Ctrl + x, followed by Ctrl + s immediately thereafter.

Upon the definition of a “chained” keyboard binding, any elements in the chain may not be used individually. For example, binding “C-x C-s”, will prohibit the binding of “C-x” by itself. This is because there would be ambiguity in regards to which key binding is intended to be invoked.

Ability to browse and change buffers

The user will be able to invoke the key binding C-x b to bring up a menu in the Minibuffer in which they will be able to select a new buffer to bring to focus.

Minibuffer Completion

Switch buffer should demonstrate an example of minibuffer completion candidates

Compilation OSX

  • One “click” build system for deployment on OSX
  • Organization of build systems into lisp files, no shell scripts