Redefine M-< and M-> for some modes. For example, - in `dired-mode', M-< (respectively M->) goes to first (respectively last) file line - in message mode, - M-< goes to first line of message body (after headings) - M-> goes to last line before message signature - in prog-mode, - M-< goes to the first line after comments - M-> goes to the last line before comments Many more modes are supported.