When I'm composing a message in message-mode I sometimes want to remove a recipient from a long list of recipients on the To: line. It seems that there is no semantic kill command that would delete a complete recipient.

I could zap to the next delimiter, I suppose, but the different formats available for recipients and their display names makes this a lot harder. When on a To:, Cc: or Bcc: line, I really don't need to be able to delete words or sentences or s-expressions, I just need to be able to remove a recipient as a syntactic unit.

How can I easily augment kill-sexp to remove a recipient (i.e. name and email address in the various common formats) when I'm on a recipient line?


message-kill-address (C-c M-k) gets you most of the way there: it will kill from point to the end of the address. You would need to advise/adapt it to go to the beginning of the address to have complete functionality.

For what it's worth, message-kill-address relies internally on message-skip-to-next-address, but as far as I can tell, there's no analogous message-skip-to-previous-address. You could probably adapt the former to get a working version of the latter.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.