>>> "EB" == Emanuel Berg writes: > Uwe Brauer wrote: >>> Uwe Brauer writes: >> >>> Try `message-beginning-of-header' instead. Alternately, >>> fooling with the value of (variable) >>> `message-beginning-of-line' while calling (function) >>> `message-beginning-of-line'. >> >> Great, I did >> >> (defun my-add-subject-test () >> (interactive) >> (message-goto-subject) >> ; (message-beginning-of-line) >> (message-beginning-of-header 'subject) >> (insert "[Test] ")) >> >> And this work nicely for both, empty and non empty >> subject lines! > ?! Subject twice? > What kind of code is that? I mean > (message-goto-subject) > (message-beginning-of-header 'subject) > Much better: > `message-goto-subject' could have an optional formal parameter > BEG so when the argument is non-nil it does > (message-beginning-of-header 'subject) last. That is a proposal? > But at the very least (message-beginning-of-header 'subject) > should imply (message-goto-subject) first. > Or one could make HANDLE-FOLDED optional and when nil, go to > the current line's header beginning. > Subject should appear one time! So the correct code is (defun my-add-subject-test () (interactive) (message-goto-subject) (message-beginning-of-header t) (insert "[Test] ")) Ok!