Longformacus ( Scottish Gaelic: Longphort Mhacais) is a small village in Berwickshire in the Scottish Borders area of Scotland. It is around 10 kilometres (6.2 mi) north-west of  Duns, in the Lammermuir Hills. The Dye Water runs through the village, flowing east towards its confluence with the Whiteadder Water nearby.
In the vicinity are traces of an ancient fortification at Runklie or Wrinklaw
 and the  Mutiny Stones cairn.  
, written by Lucia di Lammermoor Gaetano Donizetti and based on Sir Walter Scott's , was set in the Lammermuirs and an old form of the village's name, Lockermachus, is mentioned in Scott's novel. The Bride of Lammermoor 
Southern Upland Way, a Long Distance Route which crosses southern Scotland, passes through the village, and the Sir Walter Scott Way from Moffat to Cockburnspath passes through Longformacus.
Longformacus derives its name from the Gaelic
Longphort Mhacais, meaning 'Macas's camp'. Derivation from  Lann Fothir Maccus, meaning 'church on the land of Maccus' has also been suggested. 
The Mansion House of Longformacus
The church of Longformacus was dedicated by Bishop
David de Bernham, 11th March 1243. In 1667 the choir was in ruins, the church itself being "very ruinous." It was rebuilt on the old foundations in 1730, and a thorough renovation was made, in 1895. Our Lady's Well is on the Dye Water, about a quarter of a mile east of the village. The parish was long united to Mordington, but was disjoined in 1666. Longformacus and Ellem were united in 1712; and Ellem church was disused.  There was some copper ore in the area which a former minister smelted but large scale production was not sucessful.   
People from Longformacus
Places nearby include
Cranshaws, Abbey St Bathans, Bonkle, Preston, Scottish Borders, the Whiteadder Water, and Duns. 
"OS 25 inch Map 1841-1952". zoomable map with Bing transparency overlay. National Library of Scotland . Retrieved 2017.
^ a b
Groome, Francis H. "Longformacus". Ordnance Gazetteer of Scotland. Gazetteer for Scotland . Retrieved 2018.
^ a b
First Report and Inventory of Monuments and Constructions in the County of Berwick (PDF). HMSO. 1909. p. 43.
Scott, Walter, Sir (1800). . Boston: Dana Estes & company. p. 380 The heart of Midlothian; The bride of Lammermoor . Retrieved 2019.
"Scottish Parliament - Placenames K-O" (PDF).
"Place-names of Scotland".
Riddell, Henry (1834). . The new statistical account of Scotland 2. Edinburgh and London: William Blackwood and Sons. pp. 93-98 . Retrieved 2019.
Robson, James (1896). . Kelso: Rutherford. pp. 171-174 The churches and churchyards of Berwickshire . Retrieved 2019.
Scott, Hew (1917). . Fasti ecclesiae scoticanae; the succession of ministers in the Church of Scotland from the reformation 2. Edinburgh: Oliver and Boyd. p. 24 . Retrieved 2019. This article incorporates text from this source, which is in the public domain.
Rutherfurd, J. and J. H. (1866). . Kelso: J. and J.H.Ruthderfurd,etc.,etc. pp. 662-666 The southern counties' register and directory; containing much useful and interesting information,and very complete lists connected with the counties of Roxburgh,Berwick,and Selkirk . Retrieved 2019.
Ord, Selby (1791). . The statistical account of Scotland 1. Edinburgh: Printed and sold by William Creech. pp. 69-71 . Retrieved 2019.
Francis Hindes, Groome (1895). . Ordnance gazetteer of Scotland : a survey of Scottish topography, statistical, biographical and historical 4. London: W. Mackenzie. p. 555 . Retrieved 2019.
Baird, William (1898). . Edinburgh: Andrew Elliot. pp. 329-332 Annals of Duddingston and Portobello . Retrieved 2019.
Slater, Isaac (1886). . Manchester: Isaac Slater. pp. 331-332 Slater's (later Pigot and Co's) Royal national commercial directory and topography of Scotland . Retrieved 2019.
"Longformacus". . CANMORE Royal Commission on the Ancient and Historical Monuments of Scotland . Retrieved 2010.
Coordinates: 55°48?28?N 2°29?32?W / 55.80782°N 2.49212°W