JUSTICE Secretary Kenny MacAskill has pledged to examine whether people accused of some serious crimes should maintain their anonymity to prevent trial by media before they are charged.

Mr MacAskill, who stressed it was not a formal government policy, told MSPs he would be happy to explore such a move to prevent the names of those accused of crimes appearing in the press, TV and the internet.

His comments came as the former lawyer responded to concerns raised by Holyrood's Justice Committee over the damage to potentially innocent people who are arrested but then released. It is considering changes to police powers of arrest in the Criminal Justice Bill.

Mr MacAskill, responding to a point raised by a committee member, said: "I think those points relate not to statutory definitions of arrest and detention, but to media profile."

Mr MacAskill said lessons should be learned from the murder in Bristol of architect Jo Yeates. Her landlord ­Christopher Jefferies was arrested and smeared by the media but subsequently released. Another man was jailed.

Committee convenor Christine Grahame asked if he thought there may be room for considering ­anonymity in certain cases where someone has been accused of a crime, but not officially charged. She said there was some traction behind the proposal for anonymity, given that "people are tried by the media and have to live with it".

Mr MacAskill replied: "That is a matter I am always happy to look at as these things do have great consequences and effects. The difficulty is in a world of social media, even with a court order, if it's coming from a different jurisdiction, if it's available on Twitter or YouTube, it's pretty hard to enforce."

The Bill contains measures to change the current scheme which draws a distinction between detention and arrest. Police officers in Scotland can currently detain a person on suspicion of committing an offence, but must have reasonable grounds for believing that they are able to charge a person before they can arrest them.

In England and Wales a suspect may be arrested on suspicion of having committed an offence. Changes contained in the Bill would see Scottish police officers given a similar "power of arrest in suspicion of having committed an offence". An arrested person will then become ­"officially accused" when they are charged.

Ann Ritchie, a former President of the Glasgow Bar Association, said it would be a welcome move, but added: "I'm not sure how they would distinguish very serious cases and who would make the decision. Obviously there would be a statute about that.

"If it was a principle to be adopted then I don't really see why it should be limited to certain very serious cases because, for anyone charged with a criminal offence or allegation, that may have significance in their life even if it was deemed to be a minor offence."

David McKie, a court lawyer and head of media law at Glasgow University, said: "On the one hand, anyone arrested but released with no further action taken would want to remain anonymous given all of the implications of media coverage and the Google factor which is now a major issue for anyone who has ever been mentioned online.

"On the other, we should be slow to impose legislative change where existing laws permit those affected to take legal action. That is precisely why defamation and contempt of court laws exist and these are arguably adequate to address any transgressions of the law."