{"id":27171268,"url":"https://github.com/dykstrom/basic-mode","last_synced_at":"2025-04-09T08:32:25.096Z","repository":{"id":53747016,"uuid":"105182806","full_name":"dykstrom/basic-mode","owner":"dykstrom","description":"Emacs major mode for editing BASIC code","archived":false,"fork":false,"pushed_at":"2023-11-27T09:37:13.000Z","size":90,"stargazers_count":6,"open_issues_count":3,"forks_count":10,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-12-16T05:38:50.472Z","etag":null,"topics":["basic","emacs-lisp","emacs-mode","programming"],"latest_commit_sha":null,"homepage":null,"language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dykstrom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-09-28T18:09:39.000Z","updated_at":"2023-12-16T05:38:50.472Z","dependencies_parsed_at":"2023-11-25T17:29:19.309Z","dependency_job_id":"f77bedb2-273d-4d6b-851a-e2df05a59857","html_url":"https://github.com/dykstrom/basic-mode","commit_stats":null,"previous_names":[],"tags_count":17,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dykstrom%2Fbasic-mode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dykstrom%2Fbasic-mode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dykstrom%2Fbasic-mode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dykstrom%2Fbasic-mode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dykstrom","download_url":"https://codeload.github.com/dykstrom/basic-mode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248003044,"owners_count":21031719,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["basic","emacs-lisp","emacs-mode","programming"],"created_at":"2025-04-09T08:31:25.012Z","updated_at":"2025-04-09T08:32:25.083Z","avatar_url":"https://github.com/dykstrom.png","language":"Emacs Lisp","readme":"# basic-mode\n\n\u003cdiv style=\"text-align: left\"\u003e\n\n[![MELPA](https://melpa.org/packages/basic-mode-badge.svg)](https://melpa.org/#/basic-mode)\n[![MELPA Stable](https://stable.melpa.org/packages/basic-mode-badge.svg)](https://stable.melpa.org/#/basic-mode)\n[![Open Issues](https://img.shields.io/github/issues/dykstrom/basic-mode)](https://github.com/dykstrom/basic-mode/issues)\n![License](https://img.shields.io/github/license/dykstrom/basic-mode)\n\n\u003c/div\u003e\n\nPackage basic-mode provides a major mode for editing BASIC code in GNU Emacs.\nFeatures include syntax highlighting and indentation, as well as support for\nauto-numbering and renumbering of code lines.\n\n\u003c!-- TOC --\u003e\n* [basic-mode](#basic-mode)\n  * [Installation](#installation)\n  * [BASIC Dialects](#basic-dialects)\n    * [Setting Sub Mode](#setting-sub-mode)\n      * [Manually](#manually)\n      * [File Variable](#file-variable)\n      * [Init File](#init-file)\n    * [Available Sub Modes](#available-sub-modes)\n  * [Usage](#usage)\n    * [Formatting Code](#formatting-code)\n    * [Line Numbers](#line-numbers)\n    * [Navigation](#navigation)\n  * [Configuration](#configuration)\n\u003c!-- TOC --\u003e\n\n## Installation\n\nThe recommended way to install basic-mode is from [MELPA](https://melpa.org).\n\nTo install manually, place basic-mode.el in your load-path, and add the\nfollowing lines of code to your init file:\n\n```elisp\n(autoload 'basic-generic-mode \"basic-mode\" \"Major mode for editing BASIC code.\" t)\n(add-to-list 'auto-mode-alist '(\"\\\\.bas\\\\'\" . basic-generic-mode))\n```\n\n\n## BASIC Dialects\n\nPackage basic-mode supports some of the many\n[BASIC dialects](https://en.wikipedia.org/wiki/List_of_BASIC_dialects) using\nsub modes derived from the main basic-mode. Section\n[Available Sub Modes](#available-sub-modes) lists the currently existing\nsub modes. In addition, basic-mode also provides a generic sub mode that will\nbe used if no sub mode is specified.\n\nThe sub mode configures, among other things, syntax highlighting and indentation,\nwhich differs between dialects.\n\n\n### Setting Sub Mode\n\nBy default, basic-mode will open BASIC files in sub mode _basic-generic-mode_.\nThere are several ways to change that behaviour if you prefer a specific sub mode.\n\n\n#### Manually\n\nAfter opening a file in Emacs, you can type _M-x MODE-NAME_ to set the sub mode,\ne.g. _M-x basic-zx81-mode_ to set the Sinclair ZX81 sub mode.\n\n\n#### File Variable\n\nYou can specify the sub mode as a file variable in the first line of the file, see\n[Specifying File Variables](https://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html)\nin the GNU Emacs Manual. For example, a file beginning with this line, will open in\nthe TRS-80 Model 100 sub mode.\n\n```BASIC\n10 REM -*- basic-m100 -*-\n```\n\n#### Init File\n\nIf you are always working with a specific BASIC dialect, you can configure Emacs to\nalways open BASIC files in that sub mode. For example, adding the below line to your\ninit file will open all BASIC files in the Sinclair ZX81 sub mode.\n\n```elisp\n(add-to-list 'auto-mode-alist '(\"\\\\.bas\\\\'\" . basic-zx81-mode))\n```\n\n\n### Available Sub Modes\n\nThis table lists the existing sub modes. If you feel that a sub mode\nis missing, the best way to bring it into existence is to create it\nyourself, and submit a pull request to include it in basic-mode.\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth align=\"left\"\u003eBASIC Dialect\u003c/th\u003e\n    \u003cth align=\"left\"\u003eSub Mode\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eDartmouth\u003c/td\u003e\n    \u003ctd\u003ebasic-dartmouth-mode\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eMicrosoft QuickBasic 4.5\u003c/td\u003e\n    \u003ctd\u003ebasic-qb45-mode\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eSinclair ZX81\u003c/td\u003e\n    \u003ctd\u003ebasic-zx81-mode\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eSinclair ZX Spectrum\u003c/td\u003e\n    \u003ctd\u003ebasic-spectrum-mode\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eTRS-80 Model I and III\u003c/td\u003e\n    \u003ctd\u003ebasic-trs80-mode\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eTRS-80 Model 100\u003c/td\u003e\n    \u003ctd\u003ebasic-m100-mode\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\n## Usage\n\n\n### Formatting Code\n\nTAB indents the current line of BASIC code, including line numbers if available.\nIf the region is active, TAB indents all lines in the region.\n\n_C-c C-f_ formats the entire buffer; indents all lines, and removes any extra\nwhitespace. If the region is active, _C-c C-f_ formats all lines in the region.\n\n\n### Line Numbers\n\nFor classic BASIC, basic-mode provides several functions to manage line numbers.\nCustomize variables basic-auto-number and basic-line-number-cols to your liking\nto turn on line numbers.\n\nWith line numbers turned on, RET will start new lines with a fresh line number.\nThe line number increment is defined by variable basic-auto-number. _C-c C-r_\nwill renumber all lines in the entire buffer, including any jumps in the code.\nThe line number increment used when renumbering is defined by variable\nbasic-renumber-increment. If the region is active, _C-c C-r_ renumbers all lines\nin the region instead.\n\nWith line numbers turned on, _C-c C-f_ will also respect line numbers, and the\nvalue configured in basic-line-number-cols while formatting.\n\n\n### Navigation\n\nPackage basic-mode also provides additional functionality to navigate in the\nsource code. _M-._ will find and move to the definition of the identifier at\npoint, and _M-,_ will move back again. For more information, see function\nxref-find-definitions.\n\n\n## Configuration\n\nThe following table lists the customizable variables that affect basic-mode\nin some way:\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth align=\"left\"\u003eName\u003c/th\u003e\n    \u003cth align=\"left\"\u003eDescription\u003c/th\u003e\n    \u003cth align=\"left\"\u003eDefault Value\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr bgcolor=\"#EEEEFF\"\u003e\n    \u003ctd\u003ebasic-auto-number\u003c/td\u003e\n    \u003ctd\u003eIf non-nil, auto-number new lines by incrementing the line number with this value.\u003c/td\u003e\n    \u003ctd\u003enil\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ebasic-delete-trailing-whitespace\u003c/td\u003e\n    \u003ctd\u003eIf non-nil, basic-format-code deletes trailing whitespace while formatting.\u003c/td\u003e\n    \u003ctd\u003et\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr bgcolor=\"#EEEEFF\"\u003e\n    \u003ctd\u003ebasic-indent-offset\u003c/td\u003e\n    \u003ctd\u003eThe number of columns to indent code blocks, for example inside an IF statement.\u003c/td\u003e\n    \u003ctd\u003e4\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ebasic-line-number-cols\u003c/td\u003e\n    \u003ctd\u003eThe number of columns allocated to line numbers at the beginning of the line.\u003c/td\u003e\n    \u003ctd\u003e0\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr bgcolor=\"#EEEEFF\"\u003e\n    \u003ctd\u003ebasic-mode-hook\u003c/td\u003e\n    \u003ctd\u003eHook run when entering BASIC mode.\u003c/td\u003e\n    \u003ctd\u003enil\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ebasic-renumber-increment\u003c/td\u003e\n    \u003ctd\u003eDefault line number increment when renumbering lines.\u003c/td\u003e\n    \u003ctd\u003e10\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr bgcolor=\"#EEEEFF\"\u003e\n    \u003ctd\u003ebasic-renumber-unnumbered-lines\u003c/td\u003e\n    \u003ctd\u003eIf non-nil, lines without line numbers are also renumbered when renumbering lines.\u003c/td\u003e\n    \u003ctd\u003et\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ebasic-syntax-highlighting-require-separator\u003c/td\u003e\n    \u003ctd\u003e\n    If non-nil, only keywords separated by separators will be highlighted.\n    If nil, keywords separated by numbers will also be highlighted.\n    \u003c/td\u003e\n    \u003ctd\u003et\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr bgcolor=\"#EEEEFF\"\u003e\n    \u003ctd\u003edelete-trailing-lines (simple.el)\u003c/td\u003e\n    \u003ctd\u003eIf non-nil, basic-format-code deletes trailing empty lines while formatting.\u003c/td\u003e\n    \u003ctd\u003et\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\nAdditionally, each sub mode will also define a hook variable, named like\nthe sub mode, e.g. _basic-generic-mode-hook_ for the generic sub mode.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdykstrom%2Fbasic-mode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdykstrom%2Fbasic-mode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdykstrom%2Fbasic-mode/lists"}