Skip to content

flexibeast/plisp-mode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 

Repository files navigation

plisp-mode - Major mode for PicoLisp programming

Author: Alexis flexibeast@gmail.com (plisp-mode.el); Guillermo R. Palavecine grpala@gmail.com, Thorsten Jolitz tjolitz@gmail.com, Alexis flexibeast@gmail.com (inferior-plisp.el)
URL: https://github.com/flexibeast/plisp-mode

This project is currently unmaintained, and needs a new maintainer. If you wish to take maintainership, please email Alexis.

plisp-mode provides a major mode for PicoLisp programming.

The plisp-mode in this package has been built from scratch, and is not based on, nor connected with, the PicoLisp support for Emacs provided in the PicoLisp distribution, or the more recently updated version of that support. At this stage, the main advantages provided by this package are:

  • access to the PicoLisp reference documentation, including via Eldoc;

  • basic Imenu support;

  • ease of customisability; and

  • a cleaner codebase.

Table of Contents

Features

  • Syntax highlighting of PicoLisp code. (But please read the below note on syntax highlighting.)

  • Comint-based pil REPL buffers.

  • Quick access to documentation for symbol at point.

Installation

Install plisp-mode from MELPA, or put the plisp-mode folder in your load-path and do a (require 'plisp-mode).

Usage

Syntax highlighting

Enable syntax highlighting for a PicoLisp source buffer with M-x plisp-mode.

REPL

Start a pil REPL session with M-x plisp-repl or, from a plisp-mode buffer, with C-c C-i (plisp-repl).

Inferior PicoLisp

This package provides the inferior-plisp feature, a fork of the inferior-picolisp library written by Guillermo Palavecino and Thorsten Jolitz, modified to be compatible with plisp-mode.

By default, inferior-plisp is loaded by plisp-mode; to disable this, set the variable plisp-use-inferior-plisp to nil. It can still be manually loaded with (require 'inferior-plisp).

With inferior-plisp loaded, the following bindings are available in plisp-mode and plisp-repl-mode:

  • M-C-x / C-c C-e : Send the current definition to the inferior PicoLisp process (inferior-plisp-send-definition).

  • C-x C-e : Send the last sexp before point to the inferior PicoLisp process (inferior-plisp-send-last-sexp).

  • C-c M-e : Send the current definition to the inferior PicoLisp process and switch to its buffer (inferior-plisp-send-definition-and-go).

  • C-c C-r : Send the region to the inferior PicoLisp process (inferior-plisp-send-region).

  • C-c M-r : Send the region to the inferior PicoLisp process and switch to its buffer (inferior-plisp-send-region-and-go).

  • C-c C-l : Load a PicoLisp file into the inferior PicoLisp process (inferior-plisp-load-file)."

  • C-c C-x : Switch to the inferior PicoLisp buffer (inferior-plisp-switch-to-picolisp).

Multiple inferior PicoLisp processes can be created and used; the documentation for the variable inferior-plisp-picolisp-buffer provides more details.

By default, inferior-plisp provides the feature inferior-picolisp required by ob-picolisp. To use another package to provide inferior-picolisp, set the inferior-plisp-provide-inferior-picolisp variable to nil.

Org Babel

By default, plisp-mode registers itself as providing the picolisp-mode needed to edit Org Babel PicoLisp source blocks with org-edit-special. If you wish to disable this, set the variable plisp-provide-picolisp-mode to nil.

inferior-plisp can support Org Babel sessions: add (inferior-plisp-support-ob-picolisp) to your init file, and make sure the org-babel-picolisp-cmd variable defined by ob-picolisp is correctly specified for your system.

Documentation

Access documentation for the function at point with C-c C-d (plisp-describe-symbol). By default, documentation will be displayed via the lynx HTML browser. However, one can set the value of plisp-documentation-method to either a string containing the absolute path to an alternative browser, or - for users of Emacs 24.4 and above - to the symbol plisp--shr-documentation; this function uses the shr library to display the documentation in an Emacs buffer. The absolute path to the documentation is specified via plisp-documentation-directory, and defaults to /usr/share/doc/picolisp/.

Eldoc support is available.

If for some reason the PicoLisp documentation is not installed on the system, and cannot be installed, setting plisp-documentation-unavailable to t will prevent plisp-mode from trying to provide documentation.

Commenting

Comment a region in a plisp-mode buffer with C-c C-; (plisp-comment-region); uncomment a region in a plisp-mode buffer with C-c C-: (plisp-uncomment-region). By default one '#' character is added/removed; to specify more, supply a numeric prefix argument to either command.

Indentation

Indent a region in a plisp-mode buffer with C-c M-q (plisp-indent-region). Indentation is done via the pilIndent script provided with the current PicoLisp distribution; the path to the script is specified via the plisp-pilindent-executable variable.

Miscellaneous

SLIME users should read the below note on SLIME.

The various customisation options, including the faces used for syntax highlighting, are available via the plisp customize-group.

A note on syntax highlighting

PicoLisp's creator is opposed to syntax highlighting of symbols in PicoLisp, for good reasons. However, some - such as the author of this package! - feel that, even taking such issues into consideration, the benefits can outweigh the costs. (For example, when learning PicoLisp, it can be useful to get immediate visual feedback about unintentionally redefining a PicoLisp 'builtin'.) To accommodate both views, syntax highlighting can be enabled or disabled via the plisp-syntax-highlighting-p variable; by default, it is set to t (enabled).

A note on SLIME

The design of SLIME is such that it can override plisp-mode functionality. (The documentation for plisp--disable-slime-modes provides details.) The user-customisable variable plisp-disable-slime-p specifies whether to override these overrides, and defaults to t.

TODO

  • Fix misalignment of single-'#' comments upon newline.

Issues / bugs

If you discover an issue or bug in plisp-mode not already noted:

please create a new issue with as much detail as possible, including:

  • which version of Emacs you're running on which operating system, and

  • how you installed plisp-mode.

License

GNU General Public License version 3, or (at your option) any later version.


Converted from plisp-mode.el by el2markdown.

Releases

No releases published

Packages

No packages published