Just as I have favourite trees, I also have best-loved buildings dotted around Edinburgh, capital of the controversial country Scotland.

Principal among these is St Leonard's Hall. I'd long been aware of the building but only paid particular attention upon learning it had housed the school that inspired the St Trinian's books and films.

Every time I pass it now, I admire its pepper-pot turrets. And I'm saddened at how out of place it looks in its own original demesne, invaded now by modern university halls of residence.

Indeed, the Victorian baronial mansion looks like it might take off at any moment, back to a better world. Back in my menial youth, I used to cut the grass here. I loved the St Trinian's films even back then and find it odd that I was trimming lawns outside the original building and never knew it. How life titters at me.

St Leonard's was designed in 1870 by architect John Lessels for publisher Thomas Nelson. According to the Gazeteer for Scotland website, it has "corbelled-out bartizans". I know the feeling.

I'm grateful to the website for the following architectural details, and indeed for the "pepper-pot" palaver above. St Leonard's has a tower and "a cap-house which is said to be reminiscent of a Highland croft-house". The interior features dark, Neo-Jacobean ceilings and an ornately carved wooden staircase with bird and animal designs.

During the First World War, St Leonard's was used as a Red Cross Hospital and, in 1925, became home to St Trinnean's, which favoured progressive methods such as having pudding before the main course. It gained a reputation as "the school where they do what they like".

At the outset of the Second World War, St Trinnean's moved to the Borders town of Galashiels and, there, caught the attention of cartoonist Ronald Searle, who was serving in the army. The rest is cultural history.

I should mention that, before moving to St Leonard's, St Trinnean's started life, in 1922, in a house in the Grange, the impossibly posh Edinburgh suburb that was plastered in Labour posters during the recent election (and, indeed, helped return the party's only surviving Scottish MP).

Even more oddly, back in my menial youth, I worked as a postman in this area and almost certainly delivered mail to the house. It has been converted into luxury flats, one of which is up for sale (offers over £550,000), a fact that prompted this monograph.

As for St Leonard's, it's now made up of offices and conference suites. But to me it'll always be St Trinian's.