"""
Copy_Buffer_Path_to_Clipboard.py - A Jython macro
for jEdit that copies the path of the current buffer
to the clipboard.

Copyright (C) 2002 Ollie Rutherfurd <oliver@rutherfurd.net>

$Id: Copy_Buffer_Path_to_Clipboard.py 28 2003-03-25 22:40:28Z oliver $
"""

from org.gjt.sp.jedit import Registers
from org.gjt.sp.jedit.gui import HistoryModel

def copyBufferPathToClipboard(buffer):
	Registers.setRegister('$', buffer.getPath())
	HistoryModel.getModel('clipboard').addItem(buffer.getPath())

if __name__ in ('__main__','main'):
	copyBufferPathToClipboard(init.buffer)

# :indentSize=4:lineSeparator=\n:noTabs=false:tabSize=4:

