Hello, I'm Dr. Kara. I have over 20 years of experience as a veterinarian and I'd like to help with your concerns about Onion.
I am sorry to hear about his history of weight loss even though he is eating well and now lethargy, and vomiting.
In an older cat my primary rule-outs would be hyperthyroidism (a tumor of the thyroid gland that overproduces thyroid hormones) or if he were drinking and urinating a tremendous amount diabetes. Cats that have uncontrolled diabetes can become ketoacidotic which makes them extremely ill and they may vomit and become extremely lethargic.
Both of these conditions are treatable or at least manageable if caught early enough.
Hyperthyroidism is controlled with daily medication or a very special diet called y/d both of which must be done for the rest of his life or treatment with radioactive iodine to selectively kill tumor cells which is usually a one time therapy. There are pros and cons to each therapy which your veterinarian can discuss with you after getting a firm diagnosis. Hyperthyroid disease leads to an increased metabolism which burns a tremendous amount of calories, so we see weight loss. It also causes heart disease and secondary hypertension, strokes and bleeding into the brain of back of the eye, abdominal organ damage (kidney and liver), vomiting and diarrhea.
Diabetes is controlled with diet and insulin therapy. If left untreated it can cause vomiting and diarrhea, weight loss, kidney damage, cataracts, and affect brain function.
I know that you would like to help your fellow at home but he sounds much too sick for that to be possible. I know that you love him and have taken great care of him if he is 17. He needs emergency veterinary care, he is truly in serious trouble now and is suffering. Please let me know if you need help finding an emergency clinic if your veterinarian isn't available or if you have any further questions.