From f2ae3b622316f2903dea371896369a8370efc5bf Mon Sep 17 00:00:00 2001 From: Alhadis Date: Thu, 21 Jul 2016 07:46:33 +1000 Subject: [PATCH] Define additional extensions/names for Troff files --- lib/linguist/languages.yml | 5 + samples/Groff/an-ext.tmac | 215 +++++++++++++++++++++++++++++++++++++ 2 files changed, 220 insertions(+) create mode 100644 samples/Groff/an-ext.tmac diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 67bf53a5..d3f50d9f 100755 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -1411,9 +1411,14 @@ Groff: - .n - .rno - .roff + - .tmac + filenames: + - mmn + - mmt tm_scope: text.roff aliases: - nroff + - troff ace_mode: text Groovy: diff --git a/samples/Groff/an-ext.tmac b/samples/Groff/an-ext.tmac new file mode 100644 index 00000000..585af208 --- /dev/null +++ b/samples/Groff/an-ext.tmac @@ -0,0 +1,215 @@ +.\" -*- nroff -*- +.\" +.\" an-ext.tmac +.\" +.\" Copyright (C) 2007-2014 Free Software Foundation, Inc. +.\" +.\" Written by Eric S. Raymond +.\" Werner Lemberg +.\" +.\" You may freely use, modify and/or distribute this file. +.\" +.\" The code below provides extension macros for the `man' macro package. +.\" Care has been taken to make the code portable; groff extensions are +.\" properly hidden so that all troff implementations can use it without +.\" changes. +.\" +.\" With groff, this file is sourced by the `man' macro package itself. +.\" Man page authors who are concerned about portability might add the +.\" used macros directly to the prologue of the man page(s). +. +. +.\" Convention: Auxiliary macros and registers start with `m' followed +.\" by an uppercase letter or digit. +. +. +.\" Protect against being sourced twice. +.nr mX +1 +.if \n(mX>1 \ +. nx +. +.\" Check whether we are using grohtml. +.nr mH 0 +.if \n(.g \ +. if '\*(.T'html' \ +. nr mH 1 +. +. +.\" Map mono-width fonts to standard fonts for groff's TTY device. +.if n \{\ +. do ftr CR R +. do ftr CI I +. do ftr CB B +.\} +. +.\" groff has glyph entities for angle brackets. +.ie \n(.g \{\ +. ds la \(la\" +. ds ra \(ra\" +.\} +.el \{\ +. ds la <\" +. ds ra >\" +. \" groff's man macros control hyphenation with this register. +. nr HY 1 +.\} +. +.nr mS 0 +. +. +.\" Declare start of command synopsis. Sets up hanging indentation. +.de SY +. ie !\\n(mS \{\ +. nh +. nr mS 1 +. nr mA \\n(.j +. ad l +. nr mI \\n(.i +. \} +. el \{\ +. br +. ns +. \} +. +. nr mT \w'\fB\\$1\fP\ ' +. HP \\n(mTu +. B "\\$1" +.. +. +. +.\" End of command synopsis. Restores adjustment. +.de YS +. in \\n(mIu +. ad \\n(mA +. hy \\n(HY +. nr mS 0 +.. +. +. +.\" Declare optional option. +.de OP +. ie \\n(.$-1 \ +. RI "[\fB\\$1\fP" "\ \\$2" "]" +. el \ +. RB "[" "\\$1" "]" +.. +. +. +.\" Start URL. +.de UR +. ds m1 \\$1\" +. nh +. if \\n(mH \{\ +. \" Start diversion in a new environment. +. do ev URL-div +. do di URL-div +. \} +.. +. +. +.\" End URL. +.de UE +. ie \\n(mH \{\ +. br +. di +. ev +. +. \" Has there been one or more input lines for the link text? +. ie \\n(dn \{\ +. do HTML-NS "" +. \" Yes, strip off final newline of diversion and emit it. +. do chop URL-div +. do URL-div +\c +. do HTML-NS +. \} +. el \ +. do HTML-NS "\\*(m1" +\&\\$*\" +. \} +. el \ +\\*(la\\*(m1\\*(ra\\$*\" +. +. hy \\n(HY +.. +. +. +.\" Start email address. +.de MT +. ds m1 \\$1\" +. nh +. if \\n(mH \{\ +. \" Start diversion in a new environment. +. do ev URL-div +. do di URL-div +. \} +.. +. +. +.\" End email address. +.de ME +. ie \\n(mH \{\ +. br +. di +. ev +. +. \" Has there been one or more input lines for the link text? +. ie \\n(dn \{\ +. do HTML-NS "" +. \" Yes, strip off final newline of diversion and emit it. +. do chop URL-div +. do URL-div +\c +. do HTML-NS +. \} +. el \ +. do HTML-NS "\\*(m1" +\&\\$*\" +. \} +. el \ +\\*(la\\*(m1\\*(ra\\$*\" +. +. hy \\n(HY +.. +. +. +.\" Continuation line for .TP header. +.de TQ +. br +. ns +. TP \\$1\" no doublequotes around argument! +.. +. +. +.\" Start example. +.de EX +. do ds mF \\n[.fam] +. nr mE \\n(.f +. nf +. nh +. do fam C +. ft CW +.. +. +. +.\" End example. +.de EE +. do fam \\*(mF +. ft \\n(mE +. fi +. hy \\n(HY +.. +. +. +.\" Start display. +.de DS +. \" XXX to be written +.. +. +. +.\" End display. +.de DE +. \" XXX to be written +.. +. +.\" EOF