Merge @YungSang 's context-sensitive menu patch

ref #265