Skip to content

Commit

Permalink
adding R documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mittelmark committed Dec 4, 2024
1 parent bb89fd2 commit 3a29998
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 3 deletions.
4 changes: 2 additions & 2 deletions microemacs/doc/m9typ033.9
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
.\" Created By : Jon Green
.\" Created : Thu Jun 24 22:02:47 1999
.\"
.Id $Id: m9typ033.9,v 2.6 2024/12/04 07:17:24 jon Exp $
.Id $Id: m9typ033.9,v 2.6 2024/12/04 08:27:19 jon Exp $
.Im MicroEmacs filetype
.so me.tni
.TH python 9
Expand All @@ -20,7 +20,7 @@ python \- Python Language File.
\- Python Language file hook definition
.br
.B python.eaf
\- UNIX shell abbreviation file
\- Python abbreviation file
.ad
.SH EXTENSIONS
.na
Expand Down
104 changes: 104 additions & 0 deletions microemacs/doc/m9typ048.9
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
.\" -*- nroff -*-
.\" This is part of the JASSPA MicroEmacs documentation files.
.\" Copyright (c) 1999-2009 JASSPA (www.jasspa.com)
.\" See the file "me.nrs" for copying and conditions.
.\"
.\" Created By : Jon Green
.\" Created : Thu Jun 24 22:02:47 1999
.\"
.Id $Id: m9typ033.9,v 2.6 2024/12/04 08:37:35 jon Exp $
.Im MicroEmacs filetype
.so me.tni
.TH r 9
.XI R - "R Language File"
.XI r - "R Language File"
.SH SYNOPSIS
r \- R Language File.
.SH FILES
.na
.B hkr.emf
\- R Language file hook definition
.br
.B r.eaf
\- R language abbreviation file
.ad
.SH EXTENSIONS
.na
\fB.r\fR \- R file
.ad
.SH "MAGIC STRINGS"
.TP
\fB^#![ \\t]*/.*env[ \\t]+Rscript\fR
.\"
\*(mE recognizes the magic string on the first line of the file used to locate
the executable. The Rscript files may be extension-less and are still
recognized.
.SH DESCRIPTION
The \fBR\fR file type template provides simple hilighting of Python
files, the template provides minimal hilighting.
.PP
File recognition is performed using the standard file extension \fB.r\fR,
\fB.R\fR or by the magic string.
.PP
It offers as well folding and support for displaying an outline of the
functions of the R script for easy navigation using the
.Ht item-list 3
command. Further is is possible to expand abbreviations either via short
strings using the
.Ht expand-abbrev-handle 3
command and visual inserting abbreviations using the mouse by the
.Ht abbrev-list 3
macro.
.IP "\fBFolding and Information Hiding\fR"
Generic folding is enabled within the R files. The folds occur about
the \fBfunction\fR keywords located on the left-hand margin at the beginning
of the line if the smaller-minus assignment operator is used.
The following commands are supported to show and hide the function bodies.
.Ht collapse-all 3
(un)folds all regions in the file,
.Ht collapse-current 3
(un)folds the current region.
.IP "\fBList Items\fR"
Item listing is available and the key constructs of the file may be listed in
the \fIitem-list\fR.
.IP "\fBAbbreviations\fR"
The installation comes with a default abbreviation file for R code editing
which can be used by writing short abbreviations like "\fBmain\fR"
for a default Rscript application outline,"\fBfor\fR",
"\fBif\fR" or "\fBfun\fR" - for a R function - and then pressing the
key-binding for the
.Ht expand-abbrev-handle 3
command. The list of abbreviations can be used interactively in the GUI
version of \*(mE using the
.Ht abbrev-list 3
command.
.IP "\fBShort Cuts\fR"
The short cut keys used within the buffer are:-
.IP
\fB\*cc \*cc\fR \- Comment out the current line.
.br
\fB\*cc \*cd\fR \- Uncomment the current line.
.br
\fB\*cc \*ce\fR \- Comment to the end of the line with stars (*).
.br
\fB\*a\*ci\fR \- Restyle the current region.
.br
\fBf2\fR \- (un)fold the current region
.br
\fBf3\fR \- (un)fold all regions
.br
\fBf6\fR \- list items
.br
\fB\*e f6\fR \- close list items
.SH BUGS
Functions with using the equal operator for assignments are not shown in the
function outline, this should be seen as a feature which allow you to write
hidden internal functions within other functions.
.SH "SEE ALSO"
.na
.Ht py 9 .
.Ht sh 9 .
.Hl "Supported File Types" FileTypes -
.ad
.FH

2 changes: 1 addition & 1 deletion microemacs/macros/r.eaf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if "if (\p) {\r\r}\P" " if"
elif "elseif (\p) {\r\r}\P" " elif"
else "else {\r\p}\r\P" " else"
while "while (\p) {\r\r}\P" " while"
func "\p <- function (...) {\r\r}\P" " func"
fun "\p <- function (...) {\r\r}\P" " fun"
main "main <- function (argv) {\r\r}\rif (sys.nframe() == 0L && !interactive()) {\r main(commandArgs(trailingOnly=TRUE))\r}" " main"
openw "fout = file(\"\pfilename\",'w')\rcat(\"hello line\\n\",file=fout)\rclose(fout)\r\P" " openw"
openr "fin = file(\"\pfilename\", \"r\")\rwhile(length((line = readLines(fin,n=1)))>0) {\r print(line)\r}\rclose(fin)" " openr"
Expand Down

0 comments on commit 3a29998

Please sign in to comment.