Hello, Robert Pluim writes: > >> (defun angel-message-setup () > >> (save-excursion > >> (message-goto-body) > >> (mml-secure-message-sign-pgpmime))) > >> > >> (add-hook 'message-setup-hook 'angel-message-setup) > > Angel> Thanks, but unfortunately it behaves in the same way. > > Strange, it works for me. If you want to work out whatʼs going on you > can use `edebug-defun' and then single step through > `angel-message-setup' to see whatʼs going on. Maybe you were trying 'r' instead of 'R'? I edebug'ed it and basically it goes through the function, inserts the tag for signing the message, but afterwards it yanks the text right after the headers, so pushing down the tag. Which I think is what you expect from message-setup-hook: "Hook run as the last thing when the message buffer has been initialized, but before yanked text is inserted.". Ideally I would like to add the hook after the yanked text is inserted, but not sure how to proceed.. Cheers, -- Ángel de Vicente -- (GPG: 0x64D9FDAE7CD5E939) Research Software Engineer (Supercomputing and BigData) Instituto de Astrofísica de Canarias (https://www.iac.es/en)