The first attachment for the sewing machine to sew button holes was patented by Charles Miller of St. Louis, on Mar. 7, 1854. I've attached a link to a website The International Sewing Machine Collector's Society if you would like to read more about the over-edgers of the sewing machines.
Below is a copy of the patent that Charles Miller patented in 1854:
No. 10,609.—Charles Miller.—Improvement in Sewing Machines.— Patented March 7, 1854.
This invention relates to the adaptation of the cloth, or other material to be sewed, to receive what are termed the button-hole stitch, the whip-stitch, and the herring-bone stitch; and consists in giving the cloth, or other material to be sewed, a movement laterally to the direction of the seam, and in opposite directions alternately between every two stitches, in addition to the movement commonly given in the direction of the seam.
Claim.—Giving the cloth, or material being sewed, a movement laterally to the direction of the seam, between the successive stitches, or interlacings of the needle and shuttle-threads, for the purpose of receiving different kinds of stitches or seams.