home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / elisp / misc / sendml-enh.el < prev    next >
Encoding:
Text File  |  1990-07-22  |  2.0 KB  |  64 lines

  1. ;From: nate@hobbes.intel.com (Nate Hess)
  2. ;Newsgroups: gnu.emacs.bug
  3. ;Subject: sendmail.el enhancements
  4. ;Message-ID: <633@mipos3.intel.com>
  5. ;Date: 6 Aug 89 20:13:13 GMT
  6. ;Reply-To: woodstock@hobbes.intel.com (Nate Hess)
  7. ;Organization: Intel Corporation, Santa Clara, CA
  8. ;Lines: 53
  9. ;Summary: New ways to move to header fields and to the message
  10. ;
  11. ;I use the C-c C-f C-[ts] commands in Mail Mode quite often, and I added
  12. ;a feature that has proven to be rather useful.  If you give either of
  13. ;these a prefix argument, they will now move to the desired field,
  14. ;erasing whatever was previously there.
  15. ;
  16. ;--------------- Replacements for functions in sendmail.el ----------
  17. (defun mail-to (&optional front)
  18.   "Move point to end of To-field.
  19. With prefix arg, kill all users in To-field."
  20.   (interactive "p")
  21.   (expand-abbrev)
  22.   (mail-position-on-field "To")
  23.   (if (> front 1)
  24.       (progn
  25.     (beginning-of-line)
  26.     (search-forward ":")
  27.     (forward-char 1)
  28.     (kill-line nil))))
  29.  
  30. (defun mail-subject (&optional front)
  31.   "Move point to end of Subject-field.
  32. With prefix arg, kill the current Subject."
  33.   (interactive "p")
  34.   (expand-abbrev)
  35.   (mail-position-on-field "Subject")
  36.   (if (> front 1)
  37.       (progn
  38.     (beginning-of-line)
  39.     (search-forward ":")
  40.     (forward-char 1)
  41.     (kill-line nil))))
  42. ;--------------- Replacements for functions in sendmail.el ----------
  43. ;
  44. ;
  45. ;I also found this function to be rather useful.  It moves to the first
  46. ;line after the mail-header-separator.  I bind it to C-c C-f C-m.
  47. ;
  48. ;--------------- New function for sendmail.el ----------
  49. (defun mail-message ()
  50.   "Move point to beginning of text field."
  51.   (interactive)
  52.   (goto-char (point-min))
  53.   (search-forward (concat "\n" mail-header-separator "\n")))
  54. ;--------------- New function for sendmail.el ----------
  55. ;
  56. ;
  57. ;I hope these prove useful for others...
  58. ;--woodstock
  59. ;-- 
  60. ;       "What I like is when you're looking and thinking and looking
  61. ;       and thinking...and suddenly you wake up."   - Hobbes
  62. ;
  63. ;woodstock@hobbes.intel.com   ...!{decwrl|hplabs!oliveb}!intelca!mipos3!nate 
  64.