annotate lisp/mh-e/mh-comp.el @ 105973:b7d8222914b4

2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-clone-subtree-with-time-shift): Make it work at the end of the buffer. * org-mobile.el (org-mobile-write-checksums): Specify coding system. (org-mobile-timestamp-buffer): Keep local variable/mode line at beginning of buffer. * org-latex.el (org-latex-entities-regexp): Fix typo in regexp. * org.el (org-block-todo-from-children-or-siblings-or-parent) (org-block-todo-from-checkboxes): Do not block changes to a nil TODO state. 2009-11-13 James TD Smith <ahktenzero@mohorovi.cc> * org-habit.el (org-habit-parse-todo): Indicate which habit is wrongly set up in the error messages. * org-colview.el (org-columns-display-here): Don't try to calculate values if the underlying property is not set. (org-columns-string-to-number): Convert age strings back into fractional days. (org-agenda-colview-summarize): Handle extended summary types properly. * org-colview-xemacs.el (org-columns-display-here): Don't try to calculate values if the underlying property is not set. (org-columns-string-to-number): Convert age strings back into fractional days. (org-agenda-colview-summarize): Handle extended summary types properly. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-exp.el (org-export-format-drawer-function): New variable. (org-export-format-drawer): New function. (org-export-preprocess-string): Pass the backend as a parameter to `org-export-remove-or-extract-drawers'. (org-export-remove-or-extract-drawers): New parameter BACKEND. * org-protocol.el (org-protocol-char-to-string): New defsubst. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-diary-entry-in-org-file): Add error message when no block is selected. * org-latex.el (org-export-latex-links): Check for protectedness in the last matched character, not after the match. * org-datetree.el (org-datetree-find-date-create): Respect restriction when KEEP-RESTRICTION is set. (org-datetree-file-entry-under): New function. (org-datetree-cleanup): New command. 2009-11-13 Dan Davison <davison@stats.ox.ac.uk> * org-src.el (org-edit-src-code): New optional argument context allows calling functions to avoid altering the saved window configuration. (org-edit-src-exit): Do not restore window configuration when this function is used in the context of saving the edit buffer. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-clock.el (org-clock-out, org-clock-cancel): Revert to instances to switching to with-current-buffer, because these seem to cause problems - no idea why. * org-agenda.el (org-agenda-add-entry-to-org-agenda-diary-file): Require diary-lib for (diary-date-display-form). 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-log-reschedule, org-log-redeadline): New options. (org-log-note-headings): Add templates for rescheduling and deadline changing. (org-startup-options): Add in-buffer settings for logging changing schedule and deadline time stamps. (org-deadline, org-schedule): Check for existing date and arrange for logging if the user requests it. (org-add-log-note): Prepare proper note buffers for rescheduling and deadline changes. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-diary-entry-in-org-file) (org-agenda-add-entry-to-org-agenda-diary-file) (org-agenda-insert-diary-make-new-entry): New functions. (org-agenda-diary-entry): Call `org-agenda-diary-entry-in-org-file' when appropriate. * org.el (org-calendar-insert-diary-entry-key): New option. (org-agenda-diary-file): New option. ("calendar"): Install our insertion function in the calendar. * org-remember.el (org-datetree): Require. (org-remember-templates): Add new positioning option. (org-remember-reference-date): New variable. (org-remember-apply-template): Store the reference date in a local variable. (org-remember-handler): Implement date tree positioning of entries. * org-datetree.el: New file. * org-latex.el (org-export-latex-preprocess): Protect targets in verbatim emphasis. * org-html.el (org-export-as-html): Protect targets in verbatim emphasis. * org-docbook.el (org-export-as-docbook): Protect targets in verbatim emphasis. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-clock.el (org-show-notification): Handle messages that contain a percent character. * org-remember.el (org-remember-apply-template): Turn of partial completion. * org-mobile.el (org-mobile-before-process-capture-hook): New hook. (org-mobile-pull): Run `org-mobile-before-process-capture-hook'. * org.el (org-indent-mode): Define variable already in org.el. (org-unfontify-region): Remove line-prefix and wrap-prefix properties only if org-indent-mode is active. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-icalendar.el (org-print-icalendar-entries): Save match data around call to verify function. (org-print-icalendar-entries): Add a call to the verification function. * org.el (org-speedbar-set-agenda-restriction): Remove unnecessary save-restrivtion' form. 2009-11-13 Dan Davison <davison@stats.ox.ac.uk> * org-exp.el (org-export-format-source-code-or-example): restrict scope of preserve-indentp to the let binding. (org-src): require org-src, since org-src-preserve-indentation is used. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-timer.el (org-timer-set-timer): Set variables org-timer-timer[123] correctly. * org-mobile.el (org-mobile-files-alist): Make it work when `agenda-archives' is included in `org-agenda-text-search-extra-files'. (org-mobile-push): Restore agenda after mobile push. 2009-11-13 John Wiegley <jwiegley@gmail.com> * org-clock.el (org-resolve-clocks-if-idle): Another fix to the way the amount of idle time is presented in the minibuffer. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-icalendar.el (org-print-icalendar-entries): Use org-icalendar-verify-function only if non-nil. * org.el (org-refile): Refile to clock only if the prefix arg is 2. (org-sparse-tree): Fix docstring to be in line with prompt. (org-update-parent-todo-statistics): Call `org-after-todo-statistics-hook' on each level. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-remember.el (org-remember-apply-template): Make sure the buffer exists. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-tab-ind-state): New variable. (org-cycle-level): New function. (org-cycle-level-after-item/entry-creation): New option. (org-flag-subtree): New function. (org-hide-archived-subtrees): Call `org-flag-subtree'. (org-set-effort): Indexed access. * org-list.el (org-cycle-item-indentation): New function. * org.el (org-refile): Make prefix argument 2 refile to current clock. (org-priority): Interpret action `remove' as call to remove the priority cookie. * org-remember.el (org-remember-apply-template): Don't depend on buffer name being like file name. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-clock.el (org-clock-play-sound): Expand file in org-clock-sound, to allow ~ for home. * org-remember.el (org-remember-handler): Set text-before-node-creation even if this already looks like a node, because the string might be needed on non-org-mode target files. * org-agenda.el (org-agenda-open-link): Make this work in agenda clocktables. (org-agenda-switch-to): Follow a link at point if org-return-follows-link' is set and there is nothing else to do in this line. 2009-11-13 James TD Smith <ahktenzero@mohorovi.cc> * org-colview-xemacs.el: Add in changes from org-colview.el 2009-11-13 Dan Davison <davison@stats.ox.ac.uk> * org-exp-blocks.el: Modify split separator regexp to avoid empty strings. 2009-11-13 James TD Smith <ahktenzero@mohorovi.cc> * org-colview.el (org-columns-new): Make this work with the new operators. (org-columns-store-format): Make this work with the new operators. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-src.el (org-src-preserve-indentation): Document that this variable is also used during export. * org-exp.el (org-export-format-source-code-or-example): Preserve indentation if a block has a -i option, or if `org-src-preserve-indentation' is set. * org-exp-blocks.el (org-export-blocks-preprocess): Preserve indentation if a block has a -i option, or if `org-src-preserve-indentation' is set. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-mode-map): Define the new archiving keys. (org-speed-commands-default): Define an archiving key in the speed command map. (org-org-menu): Improve the menu structure concerning archiving. * org-archive.el (org-archive-subtree-default-with-confirmation): New command. * org-agenda.el (org-agenda-mode-map): Define the new archiving keys. (org-agenda-menu): Add the new archiving commands to the menu. (org-agenda-archive-default) (org-agenda-archive-default-with-confirmation): New commands. (org-agenda-archive, org-agenda-archive-to-archive-sibling): Just call `org-agenda-archive-with'. (org-agenda-archive-with): New function. * org-table.el (org-table-convert-region): Inert spaces around "|" to avoid line beginnings like "|-1" which will be mistaken as hlines. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-offer-links-in-entry): Return nil if there are no links, t if a link has been selected. (org-open-at-point): Open attachment directory when called in the headline and there are no links in the entry body. (org-speed-commands-default): Add "o" for open-at-point as a speed command. * org-attach.el (org-attach-reveal): Optional prefix arg IF-EXISTS, which avoids creating the attachment directory if it does not yet exist. * org-agenda.el (org-agenda, org-run-agenda-series): Evaluate MATCH. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org.el ("abbrev"): Work with abbrev tables only after they have been loaded. * org-list.el (org-list-send-list): Fix bug related to match data. * org-latex.el (org-export-latex-fontify): Apply verbatim emphasis. (org-export-latex-make-header): Insert \obeylines if line breaks should be preserved. * org-exp.el (org-export-protect-verbatim): Add an `org-verbatim-emph' property to such text. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-icalendar.el (org-icalendar-use-plain-timestamp): New option. (org-print-icalendar-entries): Skip entries where the timestamp is not a deadline and not scheduled, if the user requests that. * org-latex.el (org-export-latex-quotation-marks): Allow a bracket before an opening quote. * org-archive.el (org-archive-subtree): Keep archive after archiving something. * org-id.el (org-id-update-id-locations): Add archive files if that is required by `org-id-extra-files'. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-src.el (org-src-window-setup): New option. (org-src-switch-to-buffer): New function. (org-edit-src-exit): Add optional argument CONTEXT and use it to restore window configuration. (org-edit-src-code, org-edit-src-continue, org-edit-src-exit): Call `org-src-switch-to-buffer'. * org.el (org-default-properties): Add STYLE property. (org-files-list): Use the function call to get the files. (org-additional-option-like-keywords): Add SETUPFILE to completion list. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-table.el (org-table-convert-region): Correctly interpret quoting in csv import. * org.el (org-icompleting-read): Make iswitchb completion work with lists and tables. * org-agenda.el (org-agenda-add-entry-text): Never add entry text while pushing the mobile agenda. 2009-11-13 John Wiegley <jwiegley@gmail.com> * org-clock.el (org-clock-auto-clock-resolution): Now takes three values: nil, t and `when-no-clock-is-running'. (org-clock-in): Use `org-clock-auto-clock-resolution' to determine whether or not to resolve Org buffers on clock in. 2009-11-13 James TD Smith <ahktenzero@mohorovi.cc> * org-colview.el (org-format-time-period): Function to format times in fractional days for display. (org-columns-display-here): Add support for showing a calculated value in place of the property. (org-columns): Set `org-columns-time' to the current time so time difference calculations will work. (org-columns-time): Use to store the current time when column view is displayed, so all time differences will use the same reference point. (org-columns-compile-map): There is now an extra position in each entry specifying the function to use to calculate the displayed value for the non-calculated properties in the column, (org-columns-compute-all): Set `org-columns-time' to the current time so time difference calculations will work. (org-columns-compute): Handle column operators where the values used are calculated from the underlying property. (org-columns-number-to-string): Handle the 'age' column format (org-columns-string-to-number): Correct the function name (was org-column...). Add support for the 'age' column format. (org-columns-compile-format): Support the additional parameter in org-columns-compile-map. 2009-11-13 Bastien Guerry <bzg@altern.org> * org.el (org-mode-hook): Turn `org-mode-hook' into a customizable variable. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-clock.el (org-clock-has-been-used): New variable. (org-clock-in): Set `org-clock-has-been-used'. (org-clock-save): Save only if clock data has been used or created during this session. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-clock.el (org-clock-persist): New value, to store only the clock history. (org-clock-save): Don't save the clock if only the history should be stored. (org-clock-load): Turn off John Wiegley's auto resolving mechanism when restoring a saved clock. 2009-11-13 John Wiegley <jwiegley@gmail.com> * org-clock.el (org-clock-display, org-clock-put-overlay): Use `org-time-clock-use-fractional'. * org.el (org-time-clocksum-use-fractional) (org-time-clocksum-fractional-format): Two new customizable variables which allow the user to select fractional times (1.25 instead of 1:25) in the `org-clock-display' report. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-ascii.el (org-export-ascii-table-keep-all-vertical-lines): New option. * org.el (org-tag-alist): Fix customization type. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-mobile.el (org-mobile-update-checksum-for-capture-file): Make sure the regexp search can fail without throwing an error. (org-mobile-apply): Save the inbox buffer after removing successfully applied changes. 2009-11-13 John Wiegley <jwiegley@gmail.com> * org-clock.el (org-resolve-clocks-if-idle): Fix to the way idle time is reported after the user comes back (but before they resolve time). * org.el (org-get-repeat): Change so that this function can be called with either `org-scheduled-string' or `org-deadline-string'. * org-clock.el (org-clock-auto-clock-resolution): Renamed `org-clock-disable-clock-resolution', since negatives don't sound good in customization variables. (org-clock-in): Don't use the auto-resolution logic if the user is clocking into a different task while an active clock is running. This then allows the default behavior of clocking out of the open task and then into the new task. * org.el (org-modules): Made this variable more consistent, since it was referring to Org, OrgMode and Org-mode, whereas the docs for the variable always refer to Org-mode. 2009-11-13 James TD Smith <ahktenzero@mohorovi.cc> * org.el (org-repeat-re): The changed org-repeat-re no longer matched simple +2d type repeaters. Fix it so it does. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-preprocess): Protect the vspace macro in the VERSE environment. 2009-11-13 John Wiegley <jwiegley@gmail.com> * org-habit.el (org-habit-get-priority): A new function that determines the relative priority of a habit, based on how long past its scheduled date it is, and how near the deadline is. * org-agenda.el (org-agenda-get-scheduled): Set habit priority using `org-habit-get-priority'. * org-habit.el (org-habit-build-graph): Start displaying colors from the first scheduled date, if that date is earlier than the first completion date. * org-habit.el: Changed all "color" variables to faces, and made them appropriate for light and dark backgrounds. * org-habit.el (org-habit-duration-to-days): Made this function more general. (org-habit-parse-todo): Parse the new ".+N/N" style repeater. * org-agenda.el (org-agenda-get-deadlines): Removed all mention of habits, since they don't use DEADLINE anymore. * org.el (org-repeat-re, org-display-custom-time) (org-timestamp-change): Extended to support the new ".+N/N" syntax, used for habits. * org-clock.el (org-clock-resolve-clock): Fixed an incorrect variable reference. * org-agenda.el (org-agenda-set-mode-name): Show Habit in the modeline when habits are being displayed (if that module is being loaded). 2009-11-13 James TD Smith <ahktenzero@mohorovi.cc> * org-clock.el (org-x11-idle-seconds): Add a method to get the X11 idle time using the xscreensaver extension. (org-user-idle-seconds): Use X11 idle time if available. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-next-line): New command. (org-agenda-previous-line): New commands. (org-agenda-show-and-scroll-up, org-agenda-show-scroll-down): New commands. (org-agenda-follow-mode): Do the follow immediately if the mode is turned on here. (previous-line, next-line): Replace keys with the corresponding org functions. (org-agenda-mode-map): Bind backspace and delete to the scrolling command. * org.el (org-icompleting-read): Turn off partial completion mode for the duration of this completion round. * org-latex.el (org-export-latex-fontify-headline): Protect TeX macros in author lines and similar stuff. * org.el (org-file-tags): Fix docstring. (org-get-buffer-tags): Add the #+FILETAGS tags. ("ecb"): Maks ecb show context after jumping into an Org file. 2009-11-13 John Wiegley <johnw@newartisans.com> * org-agenda.el (org-finalize-agenda): Draw habit consistency graphs after everything else in the buffer has been setup. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-mobile.el (org-mobile-apply): Count success and failure. * org.el (org-indent-line-function): Fix regexp replace problem. 2009-11-13 John Wiegley <johnw@newartisans.com> * org-clock.el (org-clock-disable-clock-resolution): New customization variable that disable automatic clock resolution on clock in. (org-clock-in): If `org-clock-disable-clock-resolution' is set, do not automatically resolve anything. This is does not affect idle-time resolution, however, if `org-clock-idle-time' is set. 2009-11-13 John Wiegley <johnw@newartisans.com> * org-habit.el: New file, which implements code to build a "habit consistency graph". * org-agenda.el (org-agenda-get-deadlines) (org-agenda-get-scheduled): Display consistency graphs when outputting habits into the agenda. The graphs are always relative to the current time. (org-format-agenda-item): Added new parameter `habitp', which indicates whether we are formatting a habit or not. Do not display "extra" leading information if habitp is true. * org.el (org-repeat-re): Improved regexp to include .+ and ++ leaders for repeat strings. (org-get-repeat): Now takes a string parameter `tagline', so the caller can obtain the SCHEDULED repeat, or the DEADLINE repeat. 2009-11-13 John Wiegley <johnw@newartisans.com> * org-agenda.el (org-agenda-auto-exclude-function): New customization variable for allowing the user to create an "auto exclusion" filter for doing context-aware auto tag filtering. (org-agenda-filter-by-tag): Changes to support the use of `org-agenda-auto-exclude-function'. See the new manual addition,. 2009-11-13 John Wiegley <johnw@newartisans.com> * org.el (org-files-list): Don't attempt to return a file name for Org buffers which have no associated file. * org-agenda.el (org-agenda-do-action): Fixed a typo. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-mobile.el (org-mobile-locate-entry): Interpret files relative to org-directory. (org-mobile-inbox-for-pull): Document the best location for this file. (org-mobile-check-setup): Verify `org-directory'. (org-mobile-create-index-file): Sort the files to be listed in index.org. 2009-11-13 James TD Smith <ahktenzero@mohorovi.cc> * org.el (org-fast-tag-selection): Add a way to display a description for a tag group. This is done by adding a string to either the startgroup or endgroup cell. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-clock.el (org-clock-resolve, org-resolve-clocks) (org-emacs-idle-seconds): Use `org-float-time' instead of `time-to-seconds' 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-sorting-strategy): Fix customization type. * org.el (org-pre-cycle-hook): Document that `empty' can also be the value of ARG when doing local cycling. 2009-11-13 John Wiegley <johnw@newartisans.com> * org-clock.el (org-clock-resolve-clock): If keeping or subtracting time results in a clock out at a time in the past, and if the resolution occurred due to idleness or invoking `M-x org-resolve-clocks', remember that past moment in time. On the next clock in, the user will be prompted to see if they want to back-date their new clock to then. (org-clock-resolve): Do not jump the user to the location of a dangling clock if the resolution is occuring due to an idle timeout. In that case there is typically only one dangling clock, the active one, and there is no value gained by shuffling their windows around to show it to them. Being prompted to resolve an idle clock should be as inobtrusive as possible. (org-resolve-clocks-if-idle): New function that resolves only the currently active clock if the user has exceeded the time returned by `org-user-idle-seconds', based on the value of `org-clock-idle-time'. (org-clock-in): If, after resolving clocks, (org-clock-out): Cancel the `org-clock-idle-timer' on clock out. * org-clock.el (org-clock-resolve-clock): New function that resolves a clock to a specific time, closing or resuming as need be, and possibly even starting a new clock. (org-clock-resolve): New function used by `org-resolve-clocks' that sets up for the call to `org-clock-resolve-clock'. It determines the time to resolve to based on a single-character selection from the user to either keep time, subtract away time or cancel the clock. (org-resolve-clocks): New user command which resolves dangling clocks -- that is, open but not active -- anywhere in the file list returned by `org-files-list'. (org-clock-in): Automatically resolve dangling clocks whenever a user clocks in. (org-clock-cancel): If the user cancels the solely clock in a LOGBOOK, remove the empty drawer. * org-clock.el (org-clock-idle-time): New user customizable option for detecting whether the user has left a clock idle. Note: it is only used in this commit to test whether it's worthwhile to check OS X to get the Mac user's current idle time. If the Emacs idle time is less than the value, the user hasn't been away long enough to be worth checking (a more expensive test than just getting Emacs idle time). (org-user-idle-seconds, org-mac-idle-seconds) (org-emacs-idle-seconds): This three functions, in conjunction with the user customization variable `org-clock-idle-time', return the number of seconds (as a floating point) that the user has been away from their Emacs (or, if running on OS X, their computer). * org-clock.el (org-find-open-clocks): New function that returns a list of all open clocks in the given FILE. Note that each clock it returns is a cons cell of the format (MARKER . START-TIME). This "clock" value is used by several of the new clock module utility functions. (org-is-active-clock): New inline function which tests whether the given clock value is the same as the currently active clock. Returns non-nil if this is the case. (org-with-clock-position): New macro that evaluates FORMS with point in the buffer and at the position of the given clock. Changes to the current clock are global. (org-with-clock): New macro that evaluates FORMS with point in the buffer and at the position of the given clock. However, changes to the current clock are local and have no effect on the user's active clock. This allows, for example, far any clock to be cancelled without cancelling the active clock. (org-clock-clock-in): New inline function that switches the active clock to the given clock. If either the argument RESUME, or the global `org-clock-in-resume', are non-nil, it will resume a clock that was previously left open. (org-clock-clock-out): New inline function that clocks out the given clock value without affecting the currently active clock. (org-clock-clock-cancel): New inline function that cancels the given clock value without affecting the currently active clock. * org-clock.el (org-clock-in): Before creating `org-clock-mode-line-timer', check to make sure an older timer is not currently running. (org-clock-out): Accept new third parameter `at-time', which permits a clock to be clocked out at a specific time. Note that no attempt is made to verify that the clock out time is later than the clock in time. * org.el (org-files-list): New utility function for returning a list of all open org-mode buffers, plus all files used to build the agenda buffer. Note that not all the files will necessarily be visited by a buffer at time of call. (org-entry-beginning-position): Like the function `line-beginning-position', this inline function returns the beginning position of the current heading/entry. (org-entry-end-position): Like the function `line-end-position', this inline function returns the end position of the current heading/entry. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-list): Mark the all-todo items line as a header line. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-exp.el (org-inlinetask-remove-END-maybe): Declare function. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-filter-make-matcher): Allow to filter entries that have no tags. (org-agenda-search-view): New customize group. (org-agenda-search-view-search-words-only): New option. (org-search-view): Implement substring search. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-outline-level): Add doc string. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-inlinetask.el (org-inlinetask-export): Re-introduce variable. (org-inlinetask-export-handler): Only export inline task if the user option calls for it. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-exp.el (org-export-handle-export-tags): Remove inlinetask END if present. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-tables): Don't format in protected regions. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-src.el (org-edit-src-code) (org-edit-src-find-region-and-lang, org-edit-src-exit): Handle macro editing. * org-agenda.el (org-prefix-category-max-length): New variable. (org-format-agenda-item): Use `org-prefix-category-max-length'. (org-compile-prefix-format): Set `org-prefix-category-max-length'. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-mobile.el (org-mobile-create-index-file): Improve the listing of tags and todo keywords. * org-latex.el (org-export-latex-format-image): New function. (org-export-latex-links): Use `org-export-latex-format-image'. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-inlinetask.el (org-inlinetask-get-current-indentation) (org-inlinetask-remove-terminator): New functions. (org-inlinetask-export-handler): Terminate the description list. * org-exp.el (org-export-select-backend-specific-text): Remove the region markers. * org-inlinetask.el (org-inlinetask-export-handler): fix bug for tasks without content. * org-clock.el: Make sure the clock-in target position does not move to a different node by widening the buffer. * org-html.el (org-export-html-format-image): Wrap image into figure div only when there is a caption. * org-archive.el (org-archive-mark-done): Change default value to nil. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-context): Call `bobp', not `eobp'. * org-clock.el (org-clock-cancel): Remove quotes from marker variables. * org.el (org-read-date-prefer-future): New allowed value `time'. (org-read-date-analyze): Shift day to tomorrow depending on time entered and value of `org-read-date-prefer-future'.
author Carsten Dominik <dominik@science.uva.nl>
date Fri, 13 Nov 2009 08:37:55 +0000
parents 00c0adbb54a9
children 1d1d5d9bd884
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
1 ;;; mh-comp.el --- MH-E functions for composing and sending messages
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
2
62847
aa8c2e12ee24 Upgraded to MH-E version 7.84.
Bill Wohler <wohler@newt.com>
parents: 62465
diff changeset
3 ;; Copyright (C) 1993, 1995, 1997,
101468
a9bf21156375 Follow Glenn's lead and update format of Copyright.
Bill Wohler <wohler@newt.com>
parents: 100908
diff changeset
4 ;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
a9bf21156375 Follow Glenn's lead and update format of Copyright.
Bill Wohler <wohler@newt.com>
parents: 100908
diff changeset
5 ;; Free Software Foundation, Inc.
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
6
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
7 ;; Author: Bill Wohler <wohler@newt.com>
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
8 ;; Maintainer: Bill Wohler <wohler@newt.com>
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
9 ;; Keywords: mail
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
10 ;; See: mh-e.el
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
11
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
12 ;; This file is part of GNU Emacs.
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
13
94663
90c9ebd43589 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 92126
diff changeset
14 ;; GNU Emacs is free software: you can redistribute it and/or modify
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
15 ;; it under the terms of the GNU General Public License as published by
94663
90c9ebd43589 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 92126
diff changeset
16 ;; the Free Software Foundation, either version 3 of the License, or
90c9ebd43589 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 92126
diff changeset
17 ;; (at your option) any later version.
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
18
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
19 ;; GNU Emacs is distributed in the hope that it will be useful,
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
22 ;; GNU General Public License for more details.
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
23
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
24 ;; You should have received a copy of the GNU General Public License
94663
90c9ebd43589 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 92126
diff changeset
25 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
26
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
27 ;;; Commentary:
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
28
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
29 ;; This file includes the functions in the MH-Folder maps that get us
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
30 ;; into MH-Letter mode, as well the functions in the MH-Letter mode
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
31 ;; that are used to send the mail. Other that those, functions that
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
32 ;; are needed in mh-letter.el should be found there.
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
33
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
34 ;;; Change Log:
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
35
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
36 ;;; Code:
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
37
68096
57c4e7929f99 * mh-alias.el (mh-alias-gecos-name): Use replace-regexp-in-string
Bill Wohler <wohler@newt.com>
parents: 68013
diff changeset
38 (require 'mh-e)
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
39 (require 'mh-gnus) ;needed because mh-gnus.el not compiled
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
40 (require 'mh-scan)
68096
57c4e7929f99 * mh-alias.el (mh-alias-gecos-name): Use replace-regexp-in-string
Bill Wohler <wohler@newt.com>
parents: 68013
diff changeset
41
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
42 (require 'sendmail)
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
43
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
44 (autoload 'easy-menu-add "easymenu")
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
45 (autoload 'mml-insert-tag "mml")
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
46
67681
3a8785724cca * mh-acros.el:
Bill Wohler <wohler@newt.com>
parents: 67656
diff changeset
47
3a8785724cca * mh-acros.el:
Bill Wohler <wohler@newt.com>
parents: 67656
diff changeset
48
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
49 ;;; Site Customization
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
50
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
51 (defvar mh-send-prog "send"
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
52 "Name of the MH send program.
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
53 Some sites need to change this because of a name conflict.")
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
54
71352
3b4c4b0d5eef (mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents: 70062
diff changeset
55 (defvar mh-send-uses-spost-flag nil
3b4c4b0d5eef (mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents: 70062
diff changeset
56 "Non-nil means \"send\" uses \"spost\" to submit messages.
3b4c4b0d5eef (mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents: 70062
diff changeset
57
3b4c4b0d5eef (mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents: 70062
diff changeset
58 If the value of \"postproc:\" is \"spost\", you may need to set
3b4c4b0d5eef (mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents: 70062
diff changeset
59 this variable to t to tell MH-E to avoid using features of
3b4c4b0d5eef (mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents: 70062
diff changeset
60 \"post\" that are not supported by \"spost\". You'll know that
3b4c4b0d5eef (mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents: 70062
diff changeset
61 you'll need to do this if sending mail fails with an error of
3b4c4b0d5eef (mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents: 70062
diff changeset
62 \"spost: -msgid unknown\".")
3b4c4b0d5eef (mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents: 70062
diff changeset
63
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
64 (defvar mh-redist-background nil
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
65 "If non-nil redist will be done in background like send.
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
66 This allows transaction log to be visible if -watch, -verbose or
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
67 -snoop are used.")
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
68
67681
3a8785724cca * mh-acros.el:
Bill Wohler <wohler@newt.com>
parents: 67656
diff changeset
69
3a8785724cca * mh-acros.el:
Bill Wohler <wohler@newt.com>
parents: 67656
diff changeset
70
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
71 ;;; Variables
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
72
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
73 (defvar mh-comp-formfile "components"
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
74 "Name of file to be used as a skeleton for composing messages.
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
75
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
76 Default is \"components\".
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
77
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
78 If not an absolute file name, the file is searched for first in the
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
79 user's MH directory, then in the system MH lib directory.")
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
80
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
81 (defvar mh-repl-formfile "replcomps"
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
82 "Name of file to be used as a skeleton for replying to messages.
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
83
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
84 Default is \"replcomps\".
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
85
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
86 If not an absolute file name, the file is searched for first in the
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
87 user's MH directory, then in the system MH lib directory.")
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
88
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
89 (defvar mh-repl-group-formfile "replgroupcomps"
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
90 "Name of file to be used as a skeleton for replying to messages.
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
91
56673
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
92 Default is \"replgroupcomps\".
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
93
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
94 This file is used to form replies to the sender and all recipients of
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
95 a message. Only used if `(mh-variant-p 'nmh)' is non-nil.
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
96 If not an absolute file name, the file is searched for first in the
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
97 user's MH directory, then in the system MH lib directory.")
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
98
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
99 (defvar mh-rejected-letter-start
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
100 (format "^%s$"
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
101 (regexp-opt
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
102 '("Content-Type: message/rfc822" ;MIME MDN
56673
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
103 "------ This is a copy of the message, including all the headers. ------";from exim
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
104 "--- Below this line is a copy of the message."; from qmail
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
105 " ----- Unsent message follows -----" ;from sendmail V5
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
106 " --------Unsent Message below:" ; from sendmail at BU
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
107 " ----- Original message follows -----" ;from sendmail V8
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
108 "------- Unsent Draft" ;from MH itself
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
109 "---------- Original Message ----------" ;from zmailer
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
110 " --- The unsent message follows ---" ;from AIX mail system
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
111 " Your message follows:" ;from MMDF-II
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
112 "Content-Description: Returned Content" ;1993 KJ sendmail
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
113 ))))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
114
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
115 (defvar mh-new-draft-cleaned-headers
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
116 "^Date:\\|^Received:\\|^Message-Id:\\|^From:\\|^Sender:\\|^Errors-To:\\|^Delivery-Date:\\|^Return-Path:"
67760
9c3504ae6060 Follow MH-E Developers Guide conventions. Use `' quotes for Help
Bill Wohler <wohler@newt.com>
parents: 67759
diff changeset
117 "Regexp of header lines to remove before offering a message as a new draft\\<mh-folder-mode-map>.
9c3504ae6060 Follow MH-E Developers Guide conventions. Use `' quotes for Help
Bill Wohler <wohler@newt.com>
parents: 67759
diff changeset
118 Used by the \\[mh-edit-again] and \\[mh-extract-rejected-mail] commands.")
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
119
95690
c12a32810ea6 (mh-letter-mode-syntax-table): Define within defvar.
John Paul Wallington <jpw@pobox.com>
parents: 94663
diff changeset
120 (defvar mh-letter-mode-syntax-table
c12a32810ea6 (mh-letter-mode-syntax-table): Define within defvar.
John Paul Wallington <jpw@pobox.com>
parents: 94663
diff changeset
121 (let ((syntax-table (make-syntax-table text-mode-syntax-table)))
c12a32810ea6 (mh-letter-mode-syntax-table): Define within defvar.
John Paul Wallington <jpw@pobox.com>
parents: 94663
diff changeset
122 (modify-syntax-entry ?% "." syntax-table)
c12a32810ea6 (mh-letter-mode-syntax-table): Define within defvar.
John Paul Wallington <jpw@pobox.com>
parents: 94663
diff changeset
123 syntax-table)
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
124 "Syntax table used by MH-E while in MH-Letter mode.")
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
125
73129
6478736310c3 mh-comp.el (mh-send-args): Initialize to "" instead of nil
Stephen Gildea <gildea@stop.mail-abuse.org>
parents: 71352
diff changeset
126 (defvar mh-send-args ""
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
127 "Extra args to pass to \"send\" command.")
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
128
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
129 (defvar mh-annotate-char nil
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
130 "Character to use to annotate `mh-sent-from-msg'.")
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
131
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
132 (defvar mh-annotate-field nil
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
133 "Field name for message annotation.")
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
134
82839
af7dc7457402 add mh-annotate-msg-hook
Stephen Gildea <gildea@stop.mail-abuse.org>
parents: 82478
diff changeset
135 (defvar mh-annotate-list nil
af7dc7457402 add mh-annotate-msg-hook
Stephen Gildea <gildea@stop.mail-abuse.org>
parents: 82478
diff changeset
136 "Messages annotated, either a sequence name or a list of message numbers.
af7dc7457402 add mh-annotate-msg-hook
Stephen Gildea <gildea@stop.mail-abuse.org>
parents: 82478
diff changeset
137 This variable can be used by `mh-annotate-msg-hook'.")
af7dc7457402 add mh-annotate-msg-hook
Stephen Gildea <gildea@stop.mail-abuse.org>
parents: 82478
diff changeset
138
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
139 (defvar mh-insert-auto-fields-done-local nil
56673
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
140 "Buffer-local variable set when `mh-insert-auto-fields' called successfully.")
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
141 (make-variable-buffer-local 'mh-insert-auto-fields-done-local)
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
142
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
143
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
144
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
145 ;;; MH-E Entry Points
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
146
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
147 ;;;###autoload
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
148 (defun mh-smail ()
66626
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
149 "Compose a message with the MH mail system.
56673
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
150 See `mh-send' for more details on composing mail."
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
151 (interactive)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
152 (mh-find-path)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
153 (call-interactively 'mh-send))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
154
66626
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
155 ;;;###autoload
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
156 (defun mh-smail-other-window ()
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
157 "Compose a message with the MH mail system in other window.
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
158 See `mh-send' for more details on composing mail."
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
159 (interactive)
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
160 (mh-find-path)
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
161 (call-interactively 'mh-send-other-window))
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
162
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
163 (defun mh-send-other-window (to cc subject)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
164 "Compose a message in another window.
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
165
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
166 See `mh-send' for more information and a description of how the
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
167 TO, CC, and SUBJECT arguments are used."
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
168 (interactive (list
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
169 (mh-interactive-read-address "To: ")
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
170 (mh-interactive-read-address "Cc: ")
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
171 (mh-interactive-read-string "Subject: ")))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
172 (let ((pop-up-windows t))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
173 (mh-send-sub to cc subject (current-window-configuration))))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
174
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
175 (defvar mh-error-if-no-draft nil) ;raise error over using old draft
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
176
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
177 ;;;###autoload
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
178 (defun mh-smail-batch (&optional to subject other-headers &rest ignored)
66626
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
179 "Compose a message with the MH mail system.
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
180
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
181 This function does not prompt the user for any header fields, and
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
182 thus is suitable for use by programs that want to create a mail
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
183 buffer. Users should use \\[mh-smail] to compose mail.
56673
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
184
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
185 Optional arguments for setting certain fields include TO,
67886
b98e23ab1402 * simple.el (mh-e-user-agent): Move to mh-e/mh-comp.el and autoload.
Bill Wohler <wohler@newt.com>
parents: 67760
diff changeset
186 SUBJECT, and OTHER-HEADERS. Additional arguments are IGNORED.
b98e23ab1402 * simple.el (mh-e-user-agent): Move to mh-e/mh-comp.el and autoload.
Bill Wohler <wohler@newt.com>
parents: 67760
diff changeset
187
b98e23ab1402 * simple.el (mh-e-user-agent): Move to mh-e/mh-comp.el and autoload.
Bill Wohler <wohler@newt.com>
parents: 67760
diff changeset
188 This function remains for Emacs 21 compatibility. New
b98e23ab1402 * simple.el (mh-e-user-agent): Move to mh-e/mh-comp.el and autoload.
Bill Wohler <wohler@newt.com>
parents: 67760
diff changeset
189 applications should use `mh-user-agent-compose'."
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
190 (mh-find-path)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
191 (let ((mh-error-if-no-draft t))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
192 (mh-send (or to "") "" (or subject ""))))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
193
67886
b98e23ab1402 * simple.el (mh-e-user-agent): Move to mh-e/mh-comp.el and autoload.
Bill Wohler <wohler@newt.com>
parents: 67760
diff changeset
194 ;;;###autoload
b98e23ab1402 * simple.el (mh-e-user-agent): Move to mh-e/mh-comp.el and autoload.
Bill Wohler <wohler@newt.com>
parents: 67760
diff changeset
195 (define-mail-user-agent 'mh-e-user-agent
b98e23ab1402 * simple.el (mh-e-user-agent): Move to mh-e/mh-comp.el and autoload.
Bill Wohler <wohler@newt.com>
parents: 67760
diff changeset
196 'mh-user-agent-compose 'mh-send-letter 'mh-fully-kill-draft
b98e23ab1402 * simple.el (mh-e-user-agent): Move to mh-e/mh-comp.el and autoload.
Bill Wohler <wohler@newt.com>
parents: 67760
diff changeset
197 'mh-before-send-letter-hook)
b98e23ab1402 * simple.el (mh-e-user-agent): Move to mh-e/mh-comp.el and autoload.
Bill Wohler <wohler@newt.com>
parents: 67760
diff changeset
198
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
199 ;;;###autoload
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
200 (defun mh-user-agent-compose (&optional to subject other-headers continue
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
201 switch-function yank-action
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
202 send-actions)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
203 "Set up mail composition draft with the MH mail system.
67886
b98e23ab1402 * simple.el (mh-e-user-agent): Move to mh-e/mh-comp.el and autoload.
Bill Wohler <wohler@newt.com>
parents: 67760
diff changeset
204 This is the `mail-user-agent' entry point to MH-E. This function
b98e23ab1402 * simple.el (mh-e-user-agent): Move to mh-e/mh-comp.el and autoload.
Bill Wohler <wohler@newt.com>
parents: 67760
diff changeset
205 conforms to the contract specified by `define-mail-user-agent'
b98e23ab1402 * simple.el (mh-e-user-agent): Move to mh-e/mh-comp.el and autoload.
Bill Wohler <wohler@newt.com>
parents: 67760
diff changeset
206 which means that this function should accept the same arguments
b98e23ab1402 * simple.el (mh-e-user-agent): Move to mh-e/mh-comp.el and autoload.
Bill Wohler <wohler@newt.com>
parents: 67760
diff changeset
207 as `compose-mail'.
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
208
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
209 The optional arguments TO and SUBJECT specify recipients and the
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
210 initial Subject field, respectively.
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
211
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
212 OTHER-HEADERS is an alist specifying additional header fields.
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
213 Elements look like (HEADER . VALUE) where both HEADER and VALUE
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
214 are strings.
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
215
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
216 CONTINUE, SWITCH-FUNCTION, YANK-ACTION and SEND-ACTIONS are
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
217 ignored."
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
218 (mh-find-path)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
219 (let ((mh-error-if-no-draft t))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
220 (mh-send to "" subject)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
221 (while other-headers
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
222 (mh-insert-fields (concat (car (car other-headers)) ":")
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
223 (cdr (car other-headers)))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
224 (setq other-headers (cdr other-headers)))))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
225
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
226 ;; Shush compiler.
70028
d81780942bb8 * mh-acros.el (struct, x, y): No need to wrap defvar with
Bill Wohler <wohler@newt.com>
parents: 69575
diff changeset
227 (defvar sendmail-coding-system) ; XEmacs
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
228
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
229 ;;;###autoload
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
230 (defun mh-send-letter (&optional arg)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
231 "Save draft and send message.
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
232
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
233 When you are all through editing a message, you send it with this
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
234 command. You can give a prefix argument ARG to monitor the first stage
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
235 of the delivery\; this output can be found in a buffer called \"*MH-E
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
236 Mail Delivery*\".
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
237
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
238 The hook `mh-before-send-letter-hook' is run at the beginning of
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
239 this command. For example, if you want to check your spelling in
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
240 your message before sending, add the function `ispell-message'.
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
241
69272
cc66ebd3f3a4 (mh-send-letter, mh-insert-auto-fields): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents: 68529
diff changeset
242 Unless `mh-insert-auto-fields' had previously been called
cc66ebd3f3a4 (mh-send-letter, mh-insert-auto-fields): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents: 68529
diff changeset
243 manually, the function `mh-insert-auto-fields' is called to
cc66ebd3f3a4 (mh-send-letter, mh-insert-auto-fields): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents: 68529
diff changeset
244 insert fields based upon the recipients. If fields are added, you
cc66ebd3f3a4 (mh-send-letter, mh-insert-auto-fields): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents: 68529
diff changeset
245 are given a chance to see and to confirm these fields before the
cc66ebd3f3a4 (mh-send-letter, mh-insert-auto-fields): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents: 68529
diff changeset
246 message is actually sent. You can do away with this confirmation
cc66ebd3f3a4 (mh-send-letter, mh-insert-auto-fields): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents: 68529
diff changeset
247 by turning off the option `mh-auto-fields-prompt-flag'.
cc66ebd3f3a4 (mh-send-letter, mh-insert-auto-fields): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents: 68529
diff changeset
248
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
249 In case the MH \"send\" program is installed under a different name,
97190
2d8df19f85d3 (mh-send-letter, mh-redistribute): Mention mh-annotate-msg-hook in
Bill Wohler <wohler@newt.com>
parents: 95690
diff changeset
250 use `mh-send-prog' to tell MH-E the name.
2d8df19f85d3 (mh-send-letter, mh-redistribute): Mention mh-annotate-msg-hook in
Bill Wohler <wohler@newt.com>
parents: 95690
diff changeset
251
2d8df19f85d3 (mh-send-letter, mh-redistribute): Mention mh-annotate-msg-hook in
Bill Wohler <wohler@newt.com>
parents: 95690
diff changeset
252 The hook `mh-annotate-msg-hook' is run after annotating the
2d8df19f85d3 (mh-send-letter, mh-redistribute): Mention mh-annotate-msg-hook in
Bill Wohler <wohler@newt.com>
parents: 95690
diff changeset
253 message and scan line."
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
254 (interactive "P")
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
255 (run-hooks 'mh-before-send-letter-hook)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
256 (if (and (mh-insert-auto-fields t)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
257 mh-auto-fields-prompt-flag
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
258 (goto-char (point-min)))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
259 (if (not (y-or-n-p "Auto fields inserted, send? "))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
260 (error "Send aborted")))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
261 (cond ((mh-mh-directive-present-p)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
262 (mh-mh-to-mime))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
263 ((or (mh-mml-tag-present-p) (not (mh-ascii-buffer-p)))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
264 (mh-mml-to-mime)))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
265 (save-buffer)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
266 (message "Sending...")
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
267 (let ((draft-buffer (current-buffer))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
268 (file-name buffer-file-name)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
269 (config mh-previous-window-config)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
270 (coding-system-for-write
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
271 (if (and (local-variable-p 'buffer-file-coding-system
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
272 (current-buffer)) ;XEmacs needs two args
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
273 ;; We're not sure why, but buffer-file-coding-system
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
274 ;; tends to get set to undecided-unix.
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
275 (not (memq buffer-file-coding-system
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
276 '(undecided undecided-unix undecided-dos))))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
277 buffer-file-coding-system
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
278 (or (and (boundp 'sendmail-coding-system) sendmail-coding-system)
104664
50fdf250e26b * mh-e/mh-comp.el (mh-send-letter):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 101468
diff changeset
279 (and (default-boundp 'buffer-file-coding-system)
50fdf250e26b * mh-e/mh-comp.el (mh-send-letter):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 101468
diff changeset
280 (default-value 'buffer-file-coding-system))
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
281 'iso-latin-1))))
71352
3b4c4b0d5eef (mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents: 70062
diff changeset
282 ;; Older versions of spost do not support -msgid and -mime.
3b4c4b0d5eef (mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents: 70062
diff changeset
283 (unless mh-send-uses-spost-flag
3b4c4b0d5eef (mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents: 70062
diff changeset
284 ;; Adding a Message-ID field looks good, makes it easier to search for
3b4c4b0d5eef (mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents: 70062
diff changeset
285 ;; message in your +outbox, and best of all doesn't break threading for
3b4c4b0d5eef (mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents: 70062
diff changeset
286 ;; the recipient if you reply to a message in your +outbox.
3b4c4b0d5eef (mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents: 70062
diff changeset
287 (setq mh-send-args (concat "-msgid " mh-send-args))
3b4c4b0d5eef (mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents: 70062
diff changeset
288 ;; The default BCC encapsulation will make a MIME message unreadable.
3b4c4b0d5eef (mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents: 70062
diff changeset
289 ;; With nmh use the -mime arg to prevent this.
3b4c4b0d5eef (mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents: 70062
diff changeset
290 (if (and (mh-variant-p 'nmh)
3b4c4b0d5eef (mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents: 70062
diff changeset
291 (mh-goto-header-field "Bcc:")
3b4c4b0d5eef (mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents: 70062
diff changeset
292 (mh-goto-header-field "Content-Type:"))
3b4c4b0d5eef (mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents: 70062
diff changeset
293 (setq mh-send-args (concat "-mime " mh-send-args))))
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
294 (cond (arg
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
295 (pop-to-buffer mh-mail-delivery-buffer)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
296 (erase-buffer)
92126
e4406f235887 (mh-send-letter): Call split-string on mh-send-args when sending
Bill Wohler <wohler@newt.com>
parents: 91945
diff changeset
297 (mh-exec-cmd-output mh-send-prog t
e4406f235887 (mh-send-letter): Call split-string on mh-send-args when sending
Bill Wohler <wohler@newt.com>
parents: 91945
diff changeset
298 "-nodraftfolder" "-watch" "-nopush"
e4406f235887 (mh-send-letter): Call split-string on mh-send-args when sending
Bill Wohler <wohler@newt.com>
parents: 91945
diff changeset
299 (split-string mh-send-args) file-name)
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
300 (goto-char (point-max)) ; show the interesting part
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
301 (recenter -1)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
302 (set-buffer draft-buffer)) ; for annotation below
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
303 (t
92126
e4406f235887 (mh-send-letter): Call split-string on mh-send-args when sending
Bill Wohler <wohler@newt.com>
parents: 91945
diff changeset
304 (mh-exec-cmd-daemon mh-send-prog nil
e4406f235887 (mh-send-letter): Call split-string on mh-send-args when sending
Bill Wohler <wohler@newt.com>
parents: 91945
diff changeset
305 "-nodraftfolder" "-noverbose"
69520
67b5315387f4 (mh-send-letter): Use split-string to break up mh-send-args (closes SF
Bill Wohler <wohler@newt.com>
parents: 69272
diff changeset
306 (split-string mh-send-args) file-name)))
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
307 (if mh-annotate-char
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
308 (mh-annotate-msg mh-sent-from-msg
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
309 mh-sent-from-folder
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
310 mh-annotate-char
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
311 "-component" mh-annotate-field
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
312 "-text" (format "\"%s %s\""
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
313 (mh-get-header-field "To:")
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
314 (mh-get-header-field "Cc:"))))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
315
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
316 (cond ((or (not arg)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
317 (y-or-n-p "Kill draft buffer? "))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
318 (kill-buffer draft-buffer)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
319 (if config
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
320 (set-window-configuration config))))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
321 (if arg
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
322 (message "Sending...done")
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
323 (message "Sending...backgrounded"))))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
324
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
325 ;;;###autoload
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
326 (defun mh-fully-kill-draft ()
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
327 "Quit editing and delete draft message.
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
328
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
329 If for some reason you are not happy with the draft, you can use
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
330 this command to kill the draft buffer and delete the draft
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
331 message. Use the command \\[kill-buffer] if you don't want to
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
332 delete the draft message."
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
333 (interactive)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
334 (if (y-or-n-p "Kill draft message? ")
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
335 (let ((config mh-previous-window-config))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
336 (if (file-exists-p buffer-file-name)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
337 (delete-file buffer-file-name))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
338 (set-buffer-modified-p nil)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
339 (kill-buffer (buffer-name))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
340 (message "")
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
341 (if config
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
342 (set-window-configuration config)))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
343 (error "Message not killed")))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
344
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
345
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
346
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
347 ;;; MH-Folder Commands
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
348
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
349 ;; Alphabetical.
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
350
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
351 ;;;###mh-autoload
66626
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
352 (defun mh-edit-again (message)
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
353 "Edit a MESSAGE to send it again.
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
354
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
355 If you don't complete a draft for one reason or another, and if
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
356 the draft buffer is no longer available, you can pick your draft
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
357 up again with this command. If you don't use a draft folder, your
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
358 last \"draft\" file will be used. If you use draft folders,
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
359 you'll need to visit the draft folder with \"\\[mh-visit-folder]
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
360 drafts <RET>\", use \\[mh-next-undeleted-msg] to move to the
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
361 appropriate message, and then use \\[mh-edit-again] to prepare
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
362 the message for editing.
66626
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
363
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
364 This command can also be used to take messages that were sent to
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
365 you and to send them to more people.
66626
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
366
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
367 Don't use this command to re-edit a message from a Mailer-Daemon
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
368 who complained that your mail wasn't posted for some reason or
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
369 another (see `mh-extract-rejected-mail').
66626
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
370
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
371 The default message is the current message.
56673
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
372
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
373 See also `mh-send'."
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
374 (interactive (list (mh-get-msg-num t)))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
375 (let* ((from-folder mh-current-folder)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
376 (config (current-window-configuration))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
377 (draft
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
378 (cond ((and mh-draft-folder (equal from-folder mh-draft-folder))
66626
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
379 (pop-to-buffer (find-file-noselect (mh-msg-filename message))
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
380 t)
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
381 (rename-buffer (format "draft-%d" message))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
382 ;; Make buffer writable...
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
383 (setq buffer-read-only nil)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
384 ;; If buffer was being used to display the message reinsert
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
385 ;; from file...
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
386 (when (eq major-mode 'mh-show-mode)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
387 (erase-buffer)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
388 (insert-file-contents buffer-file-name))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
389 (buffer-name))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
390 (t
66626
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
391 (mh-read-draft "clean-up" (mh-msg-filename message) nil)))))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
392 (mh-clean-msg-header (point-min) mh-new-draft-cleaned-headers nil)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
393 (mh-insert-header-separator)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
394 (goto-char (point-min))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
395 (save-buffer)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
396 (mh-compose-and-send-mail draft "" from-folder nil nil nil nil nil nil
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
397 config)
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
398 (mh-letter-mode-message)
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
399 (mh-letter-adjust-point)))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
400
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
401 ;;;###mh-autoload
66626
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
402 (defun mh-extract-rejected-mail (message)
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
403 "Edit a MESSAGE that was returned by the mail system.
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
404
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
405 This command prepares the message for editing by removing the
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
406 Mailer-Daemon envelope and unneeded header fields. Fix whatever
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
407 addressing problem you had, and send the message again with
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
408 \\[mh-send-letter].
66626
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
409
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
410 The default message is the current message.
56673
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
411
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
412 See also `mh-send'."
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
413 (interactive (list (mh-get-msg-num t)))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
414 (let ((from-folder mh-current-folder)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
415 (config (current-window-configuration))
66626
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
416 (draft (mh-read-draft "extraction" (mh-msg-filename message) nil)))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
417 (goto-char (point-min))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
418 (cond ((re-search-forward mh-rejected-letter-start nil t)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
419 (skip-chars-forward " \t\n")
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
420 (delete-region (point-min) (point))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
421 (mh-clean-msg-header (point-min) mh-new-draft-cleaned-headers nil))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
422 (t
56673
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
423 (message "Does not appear to be a rejected letter")))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
424 (mh-insert-header-separator)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
425 (goto-char (point-min))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
426 (save-buffer)
66626
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
427 (mh-compose-and-send-mail draft "" from-folder message
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
428 (mh-get-header-field "To:")
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
429 (mh-get-header-field "From:")
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
430 (mh-get-header-field "Cc:")
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
431 nil nil config)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
432 (mh-letter-mode-message)))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
433
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
434 ;;;###mh-autoload
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
435 (defun mh-forward (to cc &optional range)
67313
2ae99b10dd40 * mh-comp.el (mh-forward): Went over all uses of the word "RANGE" in
Bill Wohler <wohler@newt.com>
parents: 67246
diff changeset
436 "Forward message.
66626
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
437
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
438 You are prompted for the TO and CC recipients. You are given a
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
439 draft to edit that looks like it would if you had run the MH
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
440 command \"forw\". You can then add some text.
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
441
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
442 You can forward several messages by using a RANGE. All of the
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
443 messages in the range are inserted into your draft. Check the
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
444 documentation of `mh-interactive-range' to see how RANGE is read
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
445 in interactive use.
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
446
67756
7ff92ad99326 * mh-alias.el (mh-alias-reload): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents: 67681
diff changeset
447 The hook `mh-forward-hook' is called on the draft.
7ff92ad99326 * mh-alias.el (mh-alias-reload): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents: 67681
diff changeset
448
7ff92ad99326 * mh-alias.el (mh-alias-reload): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents: 67681
diff changeset
449 See also `mh-compose-forward-as-mime-flag',
7ff92ad99326 * mh-alias.el (mh-alias-reload): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents: 67681
diff changeset
450 `mh-forward-subject-format', and `mh-send'."
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
451 (interactive (list (mh-interactive-read-address "To: ")
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
452 (mh-interactive-read-address "Cc: ")
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
453 (mh-interactive-range "Forward")))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
454 (let* ((folder mh-current-folder)
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
455 (msgs (mh-range-to-msg-list range))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
456 (config (current-window-configuration))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
457 (fwd-msg-file (mh-msg-filename (car msgs) folder))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
458 ;; forw always leaves file in "draft" since it doesn't have -draft
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
459 (draft-name (expand-file-name "draft" mh-user-path))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
460 (draft (cond ((or (not (file-exists-p draft-name))
68133
fc48ac700159 (mh-forward): Cosmetics on prompt when draft exists.
Bill Wohler <wohler@newt.com>
parents: 68130
diff changeset
461 (y-or-n-p "The file draft exists; discard it? "))
56673
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
462 (mh-exec-cmd "forw" "-build"
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
463 (if (and (mh-variant-p 'nmh)
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
464 mh-compose-forward-as-mime-flag)
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
465 "-mime")
50702
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
466 mh-current-folder
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
467 (mh-coalesce-msg-list msgs))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
468 (prog1
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
469 (mh-read-draft "" draft-name t)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
470 (mh-insert-fields "To:" to "Cc:" cc)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
471 (save-buffer)))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
472 (t
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
473 (mh-read-draft "" draft-name nil)))))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
474 (let (orig-from
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
475 orig-subject)
105867
00c0adbb54a9 * mh-thread.el (mh-thread-set-tables):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104664
diff changeset
476 (with-current-buffer (get-buffer-create mh-temp-buffer)
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
477 (erase-buffer)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
478 (insert-file-contents fwd-msg-file)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
479 (setq orig-from (mh-get-header-field "From:"))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
480 (setq orig-subject (mh-get-header-field "Subject:")))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
481 (let ((forw-subject
50702
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
482 (mh-forwarded-letter-subject orig-from orig-subject)))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
483 (mh-insert-fields "Subject:" forw-subject)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
484 (goto-char (point-min))
66354
cf99ce27df54 * mh-comp.el (mh-letter-menu): Rename
Bill Wohler <wohler@newt.com>
parents: 66138
diff changeset
485 ;; If using MML, translate MH-style directive
cf99ce27df54 * mh-comp.el (mh-letter-menu): Rename
Bill Wohler <wohler@newt.com>
parents: 66138
diff changeset
486 (if (equal mh-compose-insertion 'mml)
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
487 (save-excursion
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
488 (goto-char (mh-mail-header-end))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
489 (while
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
490 (re-search-forward
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
491 "^#forw \\[\\([^]]+\\)\\] \\(+\\S-+\\) \\(.*\\)$"
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
492 (point-max) t)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
493 (let ((description (if (equal (match-string 1)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
494 "forwarded messages")
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
495 "forwarded message %d"
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
496 (match-string 1)))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
497 (msgs (split-string (match-string 3)))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
498 (i 0))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
499 (beginning-of-line)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
500 (delete-region (point) (progn (forward-line 1) (point)))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
501 (dolist (msg msgs)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
502 (setq i (1+ i))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
503 (mh-mml-forward-message (format description i)
82478
6cd0b704b471 (mh-forward): Address SF 1730393. When forwarding
Jeffrey C Honig <jch@bsdi.com>
parents: 78231
diff changeset
504 folder msg)
6cd0b704b471 (mh-forward): Address SF 1730393. When forwarding
Jeffrey C Honig <jch@bsdi.com>
parents: 78231
diff changeset
505 ;; Was inserted before us, move to end of file to preserve order
6cd0b704b471 (mh-forward): Address SF 1730393. When forwarding
Jeffrey C Honig <jch@bsdi.com>
parents: 78231
diff changeset
506 (goto-char (point-max)))))))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
507 ;; Postition just before forwarded message
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
508 (if (re-search-forward "^------- Forwarded Message" nil t)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
509 (forward-line -1)
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
510 (goto-char (mh-mail-header-end))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
511 (forward-line 1))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
512 (delete-other-windows)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
513 (mh-add-msgs-to-seq msgs 'forwarded t)
50702
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
514 (mh-compose-and-send-mail draft "" folder msgs
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
515 to forw-subject cc
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
516 mh-note-forw "Forwarded:"
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
517 config)
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
518 (mh-letter-mode-message)
56673
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
519 (mh-letter-adjust-point)
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
520 (run-hooks 'mh-forward-hook)))))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
521
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
522 (defun mh-forwarded-letter-subject (from subject)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
523 "Return a Subject suitable for a forwarded message.
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
524 Original message has headers FROM and SUBJECT."
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
525 (let ((addr-start (string-match "<" from))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
526 (comment (string-match "(" from)))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
527 (cond ((and addr-start (> addr-start 0))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
528 ;; Full Name <luser@host>
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
529 (setq from (substring from 0 (1- addr-start))))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
530 (comment
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
531 ;; luser@host (Full Name)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
532 (setq from (substring from (1+ comment) (1- (length from)))))))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
533 (format mh-forward-subject-format from subject))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
534
66626
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
535 ;;;###mh-autoload
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
536 (defun mh-redistribute (to cc &optional message)
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
537 "Redistribute a message.
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
538
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
539 This command is similar in function to forwarding mail, but it
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
540 does not allow you to edit the message, nor does it add your name
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
541 to the \"From\" header field. It appears to the recipient as if
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
542 the message had come from the original sender. When you run this
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
543 command, you are prompted for the TO and CC recipients. The
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
544 default MESSAGE is the current message.
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
545
67988
7882fc7df359 * mh-alias.el (mh-alias-grab-from-field): Remove leading * from
Bill Wohler <wohler@newt.com>
parents: 67886
diff changeset
546 Also investigate the command \\[mh-edit-again] for another way to
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
547 redistribute messages.
66626
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
548
97190
2d8df19f85d3 (mh-send-letter, mh-redistribute): Mention mh-annotate-msg-hook in
Bill Wohler <wohler@newt.com>
parents: 95690
diff changeset
549 See also `mh-redist-full-contents-flag'.
2d8df19f85d3 (mh-send-letter, mh-redistribute): Mention mh-annotate-msg-hook in
Bill Wohler <wohler@newt.com>
parents: 95690
diff changeset
550
2d8df19f85d3 (mh-send-letter, mh-redistribute): Mention mh-annotate-msg-hook in
Bill Wohler <wohler@newt.com>
parents: 95690
diff changeset
551 The hook `mh-annotate-msg-hook' is run after annotating the
2d8df19f85d3 (mh-send-letter, mh-redistribute): Mention mh-annotate-msg-hook in
Bill Wohler <wohler@newt.com>
parents: 95690
diff changeset
552 message and scan line."
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
553 (interactive (list (mh-read-address "Redist-To: ")
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
554 (mh-read-address "Redist-Cc: ")
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
555 (mh-get-msg-num t)))
66626
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
556 (or message
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
557 (setq message (mh-get-msg-num t)))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
558 (save-window-excursion
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
559 (let ((folder mh-current-folder)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
560 (draft (mh-read-draft "redistribution"
66626
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
561 (if mh-redist-full-contents-flag
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
562 (mh-msg-filename message)
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
563 nil)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
564 nil)))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
565 (mh-goto-header-end 0)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
566 (insert "Resent-To: " to "\n")
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
567 (if (not (equal cc "")) (insert "Resent-cc: " cc "\n"))
50702
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
568 (mh-clean-msg-header
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
569 (point-min)
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
570 "^Message-Id:\\|^Received:\\|^Return-Path:\\|^Sender:\\|^Date:\\|^From:"
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
571 nil)
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
572 (save-buffer)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
573 (message "Redistributing...")
50702
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
574 (let ((env "mhdist=1"))
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
575 ;; Setup environment...
66626
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
576 (setq env (concat env " mhaltmsg="
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
577 (if mh-redist-full-contents-flag
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
578 buffer-file-name
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
579 (mh-msg-filename message folder))))
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
580 (unless mh-redist-full-contents-flag
50702
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
581 (setq env (concat env " mhannotate=1")))
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
582 ;; Redistribute...
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
583 (if mh-redist-background
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
584 (mh-exec-cmd-env-daemon env mh-send-prog nil buffer-file-name)
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
585 (mh-exec-cmd-error env mh-send-prog "-push" buffer-file-name))
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
586 ;; Annotate...
66626
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
587 (mh-annotate-msg message folder mh-note-dist
50702
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
588 "-component" "Resent:"
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
589 "-text" (format "\"%s %s\"" to cc)))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
590 (kill-buffer draft)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
591 (message "Redistributing...done"))))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
592
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
593 ;;;###mh-autoload
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
594 (defun mh-reply (message &optional reply-to includep)
66626
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
595 "Reply to a MESSAGE.
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
596
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
597 When you reply to a message, you are first prompted with \"Reply
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
598 to whom?\" (unless the optional argument REPLY-TO is provided).
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
599 You have several choices here.
66626
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
600
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
601 Response Reply Goes To
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
602
69575
87709ba6191e (mh-reply): Sync docstring with manual.
Bill Wohler <wohler@newt.com>
parents: 69520
diff changeset
603 from The person who sent the message. This is the
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
604 default, so <RET> is sufficient.
66626
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
605
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
606 to Replies to the sender, plus all recipients in the
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
607 \"To:\" header field.
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
608
69575
87709ba6191e (mh-reply): Sync docstring with manual.
Bill Wohler <wohler@newt.com>
parents: 69520
diff changeset
609 all cc Forms a reply to the addresses in the
87709ba6191e (mh-reply): Sync docstring with manual.
Bill Wohler <wohler@newt.com>
parents: 69520
diff changeset
610 \"Mail-Followup-To:\" header field if one
87709ba6191e (mh-reply): Sync docstring with manual.
Bill Wohler <wohler@newt.com>
parents: 69520
diff changeset
611 exists; otherwise forms a reply to the sender,
87709ba6191e (mh-reply): Sync docstring with manual.
Bill Wohler <wohler@newt.com>
parents: 69520
diff changeset
612 plus all recipients.
56673
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
613
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
614 Depending on your answer, \"repl\" is given a different argument
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
615 to form your reply. Specifically, a choice of \"from\" or none at
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
616 all runs \"repl -nocc all\", and a choice of \"to\" runs \"repl
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
617 -cc to\". Finally, either \"cc\" or \"all\" runs \"repl -cc all
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
618 -nocc me\".
66626
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
619
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
620 Two windows are then created. One window contains the message to
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
621 which you are replying in an MH-Show buffer. Your draft, in
69575
87709ba6191e (mh-reply): Sync docstring with manual.
Bill Wohler <wohler@newt.com>
parents: 69520
diff changeset
622 MH-Letter mode (*note `mh-letter-mode'), is in the other window.
87709ba6191e (mh-reply): Sync docstring with manual.
Bill Wohler <wohler@newt.com>
parents: 69520
diff changeset
623 If the reply draft was not one that you expected, check the
87709ba6191e (mh-reply): Sync docstring with manual.
Bill Wohler <wohler@newt.com>
parents: 69520
diff changeset
624 things that affect the behavior of \"repl\" which include the
87709ba6191e (mh-reply): Sync docstring with manual.
Bill Wohler <wohler@newt.com>
parents: 69520
diff changeset
625 \"repl:\" profile component and the \"replcomps\" and
87709ba6191e (mh-reply): Sync docstring with manual.
Bill Wohler <wohler@newt.com>
parents: 69520
diff changeset
626 \"replgroupcomps\" files.
66626
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
627
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
628 If you supply a prefix argument INCLUDEP, the message you are
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
629 replying to is inserted in your reply after having first been run
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
630 through \"mhl\" with the format file \"mhl.reply\".
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
631
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
632 Alternatively, you can customize the option `mh-yank-behavior'
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
633 and choose one of its \"Automatically\" variants to do the same
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
634 thing. If you do so, the prefix argument has no effect.
66626
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
635
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
636 Another way to include the message automatically in your draft is
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
637 to use \"repl: -filter repl.filter\" in your MH profile.
66626
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
638
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
639 If you wish to customize the header or other parts of the reply
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
640 draft, please see \"repl\" and \"mh-format\".
66626
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
641
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
642 See also `mh-reply-show-message-flag',
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
643 `mh-reply-default-reply-to', and `mh-send'."
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
644 (interactive (list
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
645 (mh-get-msg-num t)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
646 (let ((minibuffer-help-form
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
647 "from => Sender only\nto => Sender and primary recipients\ncc or all => Sender and all recipients"))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
648 (or mh-reply-default-reply-to
68012
256cc87e0619 * mh-comp.el (mh-reply): Use standard default notation in prompts
Bill Wohler <wohler@newt.com>
parents: 67988
diff changeset
649 (completing-read "Reply to whom (default from): "
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
650 '(("from") ("to") ("cc") ("all"))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
651 nil
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
652 t)))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
653 current-prefix-arg))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
654 (let* ((folder mh-current-folder)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
655 (show-buffer mh-show-buffer)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
656 (config (current-window-configuration))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
657 (group-reply (or (equal reply-to "cc") (equal reply-to "all")))
97407
663a752ef575 Rename variant mu-mh to gnu-mh and be explicit about GNU mailutils MH
Bill Wohler <wohler@newt.com>
parents: 97190
diff changeset
658 (form-file (cond ((and (mh-variant-p 'nmh 'gnu-mh) group-reply
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
659 (stringp mh-repl-group-formfile))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
660 mh-repl-group-formfile)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
661 ((stringp mh-repl-formfile) mh-repl-formfile)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
662 (t nil))))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
663 (message "Composing a reply...")
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
664 (mh-exec-cmd "repl" "-build" "-noquery" "-nodraftfolder"
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
665 (if form-file
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
666 (list "-form" form-file))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
667 mh-current-folder message
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
668 (cond ((or (equal reply-to "from") (equal reply-to ""))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
669 '("-nocc" "all"))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
670 ((equal reply-to "to")
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
671 '("-cc" "to"))
97407
663a752ef575 Rename variant mu-mh to gnu-mh and be explicit about GNU mailutils MH
Bill Wohler <wohler@newt.com>
parents: 97190
diff changeset
672 (group-reply (if (mh-variant-p 'nmh 'gnu-mh)
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
673 '("-group" "-nocc" "me")
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
674 '("-cc" "all" "-nocc" "me"))))
66354
cf99ce27df54 * mh-comp.el (mh-letter-menu): Rename
Bill Wohler <wohler@newt.com>
parents: 66138
diff changeset
675 (cond ((or (eq mh-yank-behavior 'autosupercite)
cf99ce27df54 * mh-comp.el (mh-letter-menu): Rename
Bill Wohler <wohler@newt.com>
parents: 66138
diff changeset
676 (eq mh-yank-behavior 'autoattrib))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
677 '("-noformat"))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
678 (includep '("-filter" "mhl.reply"))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
679 (t '())))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
680 (let ((draft (mh-read-draft "reply"
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
681 (expand-file-name "reply" mh-user-path)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
682 t)))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
683 (delete-other-windows)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
684 (save-buffer)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49578
diff changeset
685
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
686 (let ((to (mh-get-header-field "To:"))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
687 (subject (mh-get-header-field "Subject:"))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
688 (cc (mh-get-header-field "Cc:")))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
689 (goto-char (point-min))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
690 (mh-goto-header-end 1)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
691 (or includep
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
692 (not mh-reply-show-message-flag)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
693 (mh-in-show-buffer (show-buffer)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
694 (mh-display-msg message folder)))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
695 (mh-add-msgs-to-seq message 'answered t)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
696 (message "Composing a reply...done")
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
697 (mh-compose-and-send-mail draft "" folder message to subject cc
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
698 mh-note-repl "Replied:" config))
66354
cf99ce27df54 * mh-comp.el (mh-letter-menu): Rename
Bill Wohler <wohler@newt.com>
parents: 66138
diff changeset
699 (when (and (or (eq 'autosupercite mh-yank-behavior)
cf99ce27df54 * mh-comp.el (mh-letter-menu): Rename
Bill Wohler <wohler@newt.com>
parents: 66138
diff changeset
700 (eq 'autoattrib mh-yank-behavior))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
701 (eq (mh-show-buffer-message-number) mh-sent-from-msg))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
702 (undo-boundary)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
703 (mh-yank-cur-msg))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
704 (mh-letter-mode-message))))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
705
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
706 ;;;###mh-autoload
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
707 (defun mh-send (to cc subject)
66626
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
708 "Compose a message.
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
709
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
710 Your letter appears in an Emacs buffer whose mode is
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
711 MH-Letter (see `mh-letter-mode').
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
712
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
713 The arguments TO, CC, and SUBJECT can be used to prefill the
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
714 draft fields or suppress the prompts if `mh-compose-prompt-flag'
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
715 is on. They are also passed to the function set in the option
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
716 `mh-compose-letter-function'.
66626
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
717
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
718 See also `mh-insert-x-mailer-flag' and `mh-letter-mode-hook'.
8d60d23ffa33 * mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents: 66518
diff changeset
719
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
720 Outside of an MH-Folder buffer (`mh-folder-mode'), you must call
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
721 either \\[mh-smail] or \\[mh-smail-other-window] to compose a new
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
722 message."
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
723 (interactive (list
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
724 (mh-interactive-read-address "To: ")
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
725 (mh-interactive-read-address "Cc: ")
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
726 (mh-interactive-read-string "Subject: ")))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
727 (let ((config (current-window-configuration)))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
728 (delete-other-windows)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
729 (mh-send-sub to cc subject config)))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
730
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
731
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
732
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
733 ;;; Support Routines
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
734
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
735 (defun mh-interactive-read-address (prompt)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
736 "Read an address.
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
737 If `mh-compose-prompt-flag' is non-nil, then read an address with
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
738 PROMPT.
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
739 Otherwise return the empty string."
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
740 (if mh-compose-prompt-flag (mh-read-address prompt) ""))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
741
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
742 (defun mh-interactive-read-string (prompt)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
743 "Read a string.
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
744 If `mh-compose-prompt-flag' is non-nil, then read a string with
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
745 PROMPT.
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
746 Otherwise return the empty string."
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
747 (if mh-compose-prompt-flag (read-string prompt) ""))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
748
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
749 ;;;###mh-autoload
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
750 (defun mh-show-buffer-message-number (&optional buffer)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
751 "Message number of displayed message in corresponding show buffer.
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
752
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
753 Return nil if show buffer not displayed.
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
754 If in `mh-letter-mode', don't display the message number being replied
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
755 to, but rather the message number of the show buffer associated with
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
756 our originating folder buffer.
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
757 Optional argument BUFFER can be used to specify the buffer."
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
758 (save-excursion
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
759 (if buffer
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
760 (set-buffer buffer))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
761 (cond ((eq major-mode 'mh-show-mode)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
762 (let ((number-start (mh-search-from-end ?/ buffer-file-name)))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
763 (string-to-number (substring buffer-file-name
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
764 (1+ number-start)))))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
765 ((and (eq major-mode 'mh-folder-mode)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
766 mh-show-buffer
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
767 (get-buffer mh-show-buffer))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
768 (mh-show-buffer-message-number mh-show-buffer))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
769 ((and (eq major-mode 'mh-letter-mode)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
770 mh-sent-from-folder
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
771 (get-buffer mh-sent-from-folder))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
772 (mh-show-buffer-message-number mh-sent-from-folder))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
773 (t
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
774 nil))))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
775
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
776 (defun mh-send-sub (to cc subject config)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
777 "Do the real work of composing and sending a letter.
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
778 Expects the TO, CC, and SUBJECT fields as arguments.
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
779 CONFIG is the window configuration before sending mail."
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
780 (let ((folder mh-current-folder)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
781 (msg-num (mh-get-msg-num nil)))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
782 (message "Composing a message...")
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
783 (let ((draft (mh-read-draft
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
784 "message"
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
785 (let (components)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
786 (cond
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
787 ((file-exists-p
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
788 (setq components
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
789 (expand-file-name mh-comp-formfile mh-user-path)))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
790 components)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
791 ((file-exists-p
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
792 (setq components
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
793 (expand-file-name mh-comp-formfile mh-lib)))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
794 components)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
795 (t
68528
bd5e46db392c (mh-send-sub): Don't find components file in current directory--this
Bill Wohler <wohler@newt.com>
parents: 68483
diff changeset
796 (error "Can't find %s in %s or %s"
bd5e46db392c (mh-send-sub): Don't find components file in current directory--this
Bill Wohler <wohler@newt.com>
parents: 68483
diff changeset
797 mh-comp-formfile mh-user-path mh-lib))))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
798 nil)))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
799 (mh-insert-fields "To:" to "Subject:" subject "Cc:" cc)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
800 (goto-char (point-max))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
801 (mh-compose-and-send-mail draft "" folder msg-num
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
802 to subject cc
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
803 nil nil config)
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
804 (mh-letter-mode-message)
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
805 (mh-letter-adjust-point))))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
806
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
807 (defun mh-read-draft (use initial-contents delete-contents-file)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
808 "Read draft file into a draft buffer and make that buffer the current one.
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
809
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
810 USE is a message used for prompting about the intended use of the
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
811 message.
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
812 INITIAL-CONTENTS is filename that is read into an empty buffer, or nil
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
813 if buffer should not be modified. Delete the initial-contents file if
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
814 DELETE-CONTENTS-FILE flag is set.
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
815 Returns the draft folder's name.
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
816 If the draft folder facility is enabled in ~/.mh_profile, a new buffer
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
817 is used each time and saved in the draft folder. The draft file can
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
818 then be reused."
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
819 (cond (mh-draft-folder
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
820 (let ((orig-default-dir default-directory)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
821 (draft-file-name (mh-new-draft-name)))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
822 (pop-to-buffer (generate-new-buffer
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
823 (format "draft-%s"
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
824 (file-name-nondirectory draft-file-name))))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
825 (condition-case ()
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
826 (insert-file-contents draft-file-name t)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
827 (file-error))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
828 (setq default-directory orig-default-dir)))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
829 (t
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
830 (let ((draft-name (expand-file-name "draft" mh-user-path)))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
831 (pop-to-buffer "draft") ; Create if necessary
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
832 (if (buffer-modified-p)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
833 (if (y-or-n-p "Draft has been modified; kill anyway? ")
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
834 (set-buffer-modified-p nil)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
835 (error "Draft preserved")))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
836 (setq buffer-file-name draft-name)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
837 (clear-visited-file-modtime)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
838 (unlock-buffer)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
839 (cond ((and (file-exists-p draft-name)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
840 (not (equal draft-name initial-contents)))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
841 (insert-file-contents draft-name)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
842 (delete-file draft-name))))))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
843 (cond ((and initial-contents
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
844 (or (zerop (buffer-size))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
845 (if (y-or-n-p
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
846 (format "A draft exists. Use for %s? " use))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
847 (if mh-error-if-no-draft
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
848 (error "A prior draft exists"))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
849 t)))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
850 (erase-buffer)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
851 (insert-file-contents initial-contents)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
852 (if delete-contents-file (delete-file initial-contents))))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
853 (auto-save-mode 1)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
854 (if mh-draft-folder
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
855 (save-buffer)) ; Do not reuse draft name
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
856 (buffer-name))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
857
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
858 (defun mh-new-draft-name ()
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
859 "Return the pathname of folder for draft messages."
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
860 (save-excursion
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
861 (mh-exec-cmd-quiet t "mhpath" mh-draft-folder "new")
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
862 (buffer-substring (point-min) (1- (point-max)))))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
863
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
864 (defun mh-insert-fields (&rest name-values)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
865 "Insert the NAME-VALUES pairs in the current buffer.
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
866 If the field exists, append the value to it.
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
867 Do not insert any pairs whose value is the empty string."
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
868 (let ((case-fold-search t))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
869 (while name-values
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
870 (let ((field-name (car name-values))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
871 (value (car (cdr name-values))))
56673
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
872 (if (not (string-match "^.*:$" field-name))
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
873 (setq field-name (concat field-name ":")))
68476
a58223a143bc (mh-insert-fields): Handle nil values. Rmail, at least, will deliver
Bill Wohler <wohler@newt.com>
parents: 68465
diff changeset
874 (cond ((or (null value)
a58223a143bc (mh-insert-fields): Handle nil values. Rmail, at least, will deliver
Bill Wohler <wohler@newt.com>
parents: 68465
diff changeset
875 (equal value ""))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
876 nil)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
877 ((mh-position-on-field field-name)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
878 (insert " " (or value "")))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
879 (t
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
880 (insert field-name " " value "\n")))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
881 (setq name-values (cdr (cdr name-values)))))))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
882
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
883 (defun mh-compose-and-send-mail (draft send-args
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
884 sent-from-folder sent-from-msg
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
885 to subject cc
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
886 annotate-char annotate-field
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
887 config)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
888 "Edit and compose a draft message in buffer DRAFT and send or save it.
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
889 SEND-ARGS is the argument passed to the send command.
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
890 SENT-FROM-FOLDER is buffer containing scan listing of current folder,
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
891 or nil if none exists.
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
892 SENT-FROM-MSG is the message number or sequence name or nil.
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
893 The TO, SUBJECT, and CC fields are passed to the
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
894 `mh-compose-letter-function'.
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
895 If ANNOTATE-CHAR is non-null, it is used to notate the scan listing of
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
896 the message. In that case, the ANNOTATE-FIELD is used to build a
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
897 string for `mh-annotate-msg'.
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
898 CONFIG is the window configuration to restore after sending the
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
899 letter."
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
900 (pop-to-buffer draft)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
901 (mh-letter-mode)
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
902
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
903 ;; Insert identity.
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
904 (mh-insert-identity mh-identity-default t)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
905 (mh-identity-make-menu)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
906 (mh-identity-add-menu)
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
907
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
908 ;; Insert extra fields.
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
909 (mh-insert-x-mailer)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
910 (mh-insert-x-face)
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
911
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
912 (mh-letter-hide-all-skipped-fields)
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
913
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
914 (setq mh-sent-from-folder sent-from-folder)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
915 (setq mh-sent-from-msg sent-from-msg)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
916 (setq mh-send-args send-args)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
917 (setq mh-annotate-char annotate-char)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
918 (setq mh-annotate-field annotate-field)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
919 (setq mh-previous-window-config config)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
920 (setq mode-line-buffer-identification (list " {%b}"))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
921 (mh-logo-display)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
922 (mh-make-local-hook 'kill-buffer-hook)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
923 (add-hook 'kill-buffer-hook 'mh-tidy-draft-buffer nil t)
69520
67b5315387f4 (mh-send-letter): Use split-string to break up mh-send-args (closes SF
Bill Wohler <wohler@newt.com>
parents: 69272
diff changeset
924 (run-hook-with-args 'mh-compose-letter-function to subject cc))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
925
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
926 (defun mh-insert-x-mailer ()
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
927 "Append an X-Mailer field to the header.
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
928 The versions of MH-E, Emacs, and MH are shown."
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
929 ;; Lazily initialize mh-x-mailer-string.
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
930 (when (and mh-insert-x-mailer-flag (null mh-x-mailer-string))
56673
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
931 (setq mh-x-mailer-string
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
932 (format "MH-E %s; %s; %sEmacs %s"
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
933 mh-version mh-variant-in-use
86202
794e428cd497 * eshell/esh-util.el (eshell-under-xemacs-p): Remove.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 82839
diff changeset
934 (if (featurep 'xemacs) "X" "GNU ")
794e428cd497 * eshell/esh-util.el (eshell-under-xemacs-p): Remove.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 82839
diff changeset
935 (cond ((not (featurep 'xemacs))
70062
e4338fe2e331 (mh-insert-x-mailer): Strip build number from version in X-Mailer
Bill Wohler <wohler@newt.com>
parents: 70028
diff changeset
936 (string-match "[0-9]+\\.[0-9]+\\(\\.[0-9]+\\)?"
e4338fe2e331 (mh-insert-x-mailer): Strip build number from version in X-Mailer
Bill Wohler <wohler@newt.com>
parents: 70028
diff changeset
937 emacs-version)
e4338fe2e331 (mh-insert-x-mailer): Strip build number from version in X-Mailer
Bill Wohler <wohler@newt.com>
parents: 70028
diff changeset
938 (match-string 0 emacs-version))
56673
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
939 ((string-match "[0-9.]*\\( +\([ a-z]+[0-9]+\)\\)?"
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
940 emacs-version)
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
941 (match-string 0 emacs-version))
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
942 (t (format "%s.%s" emacs-major-version
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
943 emacs-minor-version))))))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
944 ;; Insert X-Mailer, but only if it doesn't already exist.
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
945 (save-excursion
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
946 (when (and mh-insert-x-mailer-flag
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
947 (null (mh-goto-header-field "X-Mailer")))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
948 (mh-insert-fields "X-Mailer:" mh-x-mailer-string))))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
949
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
950 (defun mh-insert-x-face ()
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
951 "Append X-Face, Face or X-Image-URL field to header.
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
952 If the field already exists, this function does nothing."
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
953 (when (and (file-exists-p mh-x-face-file)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
954 (file-readable-p mh-x-face-file))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
955 (save-excursion
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
956 (unless (or (mh-position-on-field "X-Face")
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
957 (mh-position-on-field "Face")
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
958 (mh-position-on-field "X-Image-URL"))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
959 (save-excursion
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
960 (goto-char (+ (point) (cadr (insert-file-contents mh-x-face-file))))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
961 (if (not (looking-at "^"))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
962 (insert "\n")))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
963 (unless (looking-at "\\(X-Face\\|Face\\|X-Image-URL\\): ")
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
964 (insert "X-Face: "))))))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
965
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
966 (defun mh-tidy-draft-buffer ()
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
967 "Run when a draft buffer is destroyed."
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
968 (let ((buffer (get-buffer mh-recipients-buffer)))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
969 (if buffer
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
970 (kill-buffer buffer))))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
971
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
972 (defun mh-letter-mode-message ()
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
973 "Display a help message for users of `mh-letter-mode'.
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
974 This should be the last function called when composing the draft."
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
975 (message "%s" (substitute-command-keys
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
976 (concat "Type \\[mh-send-letter] to send message, "
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
977 "\\[mh-help] for help"))))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
978
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
979 (defun mh-letter-adjust-point ()
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
980 "Move cursor to first header field if are using the no prompt mode."
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
981 (unless mh-compose-prompt-flag
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
982 (goto-char (point-max))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
983 (mh-letter-next-header-field)))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
984
82839
af7dc7457402 add mh-annotate-msg-hook
Stephen Gildea <gildea@stop.mail-abuse.org>
parents: 82478
diff changeset
985 (defun mh-annotate-msg (msg folder note &rest args)
af7dc7457402 add mh-annotate-msg-hook
Stephen Gildea <gildea@stop.mail-abuse.org>
parents: 82478
diff changeset
986 "Mark MSG in FOLDER with character NOTE and annotate message with ARGS.
91945
8f2ff5b7ee99 (mh-annotate-msg): Remove trailing whitespace.
Bill Wohler <wohler@newt.com>
parents: 87649
diff changeset
987 MSG can be a message number, a list of message numbers, or a sequence.
82839
af7dc7457402 add mh-annotate-msg-hook
Stephen Gildea <gildea@stop.mail-abuse.org>
parents: 82478
diff changeset
988 The hook `mh-annotate-msg-hook' is run after annotating; see its
af7dc7457402 add mh-annotate-msg-hook
Stephen Gildea <gildea@stop.mail-abuse.org>
parents: 82478
diff changeset
989 documentation for variables it can use."
af7dc7457402 add mh-annotate-msg-hook
Stephen Gildea <gildea@stop.mail-abuse.org>
parents: 82478
diff changeset
990 (apply 'mh-exec-cmd "anno" folder
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
991 (if (listp msg) (append msg args) (cons msg args)))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
992 (save-excursion
82839
af7dc7457402 add mh-annotate-msg-hook
Stephen Gildea <gildea@stop.mail-abuse.org>
parents: 82478
diff changeset
993 (cond ((get-buffer folder) ; Buffer may be deleted
af7dc7457402 add mh-annotate-msg-hook
Stephen Gildea <gildea@stop.mail-abuse.org>
parents: 82478
diff changeset
994 (set-buffer folder)
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
995 (mh-iterate-on-range nil msg
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
996 (mh-notate nil note
82839
af7dc7457402 add mh-annotate-msg-hook
Stephen Gildea <gildea@stop.mail-abuse.org>
parents: 82478
diff changeset
997 (+ mh-cmd-note mh-scan-field-destination-offset))))))
af7dc7457402 add mh-annotate-msg-hook
Stephen Gildea <gildea@stop.mail-abuse.org>
parents: 82478
diff changeset
998 (let ((mh-current-folder folder)
af7dc7457402 add mh-annotate-msg-hook
Stephen Gildea <gildea@stop.mail-abuse.org>
parents: 82478
diff changeset
999 ;; mh-annotate-list is a sequence name or a list of message numbers
af7dc7457402 add mh-annotate-msg-hook
Stephen Gildea <gildea@stop.mail-abuse.org>
parents: 82478
diff changeset
1000 (mh-annotate-list (if (numberp msg) (list msg) msg)))
af7dc7457402 add mh-annotate-msg-hook
Stephen Gildea <gildea@stop.mail-abuse.org>
parents: 82478
diff changeset
1001 (run-hooks 'mh-annotate-msg-hook)))
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
1002
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
1003 (defun mh-insert-header-separator ()
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
1004 "Insert `mh-mail-header-separator', if absent."
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
1005 (save-excursion
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
1006 (goto-char (point-min))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
1007 (rfc822-goto-eoh)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
1008 (if (looking-at "$")
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
1009 (insert mh-mail-header-separator))))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
1010
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1011 ;;;###mh-autoload
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1012 (defun mh-insert-auto-fields (&optional non-interactive)
66476
ea959f21cde8 (mh-insert-signature, mh-insert-auto-fields): Checkdoc fixes.
Bill Wohler <wohler@newt.com>
parents: 66356
diff changeset
1013 "Insert custom fields if recipient is found in `mh-auto-fields-list'.
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1014
69272
cc66ebd3f3a4 (mh-send-letter, mh-insert-auto-fields): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents: 68529
diff changeset
1015 Once the header contains one or more recipients, you may run this
cc66ebd3f3a4 (mh-send-letter, mh-insert-auto-fields): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents: 68529
diff changeset
1016 command to insert these fields manually. However, if you use this
cc66ebd3f3a4 (mh-send-letter, mh-insert-auto-fields): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents: 68529
diff changeset
1017 command, the automatic insertion when the message is sent is
cc66ebd3f3a4 (mh-send-letter, mh-insert-auto-fields): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents: 68529
diff changeset
1018 disabled.
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
1019
69272
cc66ebd3f3a4 (mh-send-letter, mh-insert-auto-fields): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents: 68529
diff changeset
1020 In a program, set buffer-local `mh-insert-auto-fields-done-local'
cc66ebd3f3a4 (mh-send-letter, mh-insert-auto-fields): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents: 68529
diff changeset
1021 if header fields were added. If NON-INTERACTIVE is non-nil,
cc66ebd3f3a4 (mh-send-letter, mh-insert-auto-fields): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents: 68529
diff changeset
1022 perform actions quietly and only if
cc66ebd3f3a4 (mh-send-letter, mh-insert-auto-fields): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents: 68529
diff changeset
1023 `mh-insert-auto-fields-done-local' is nil. Return t if fields
cc66ebd3f3a4 (mh-send-letter, mh-insert-auto-fields): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents: 68529
diff changeset
1024 added; otherwise return nil."
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1025 (interactive)
56673
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
1026 (when (or (not non-interactive)
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
1027 (not mh-insert-auto-fields-done-local))
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1028 (save-excursion
56673
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
1029 (when (and (or (mh-goto-header-field "To:")
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
1030 (mh-goto-header-field "cc:")))
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
1031 (let ((list mh-auto-fields-list)
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
1032 (fields-inserted nil))
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1033 (while list
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1034 (let ((regexp (nth 0 (car list)))
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1035 (entries (nth 1 (car list))))
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1036 (when (mh-regexp-in-field-p regexp "To:" "cc:")
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1037 (setq mh-insert-auto-fields-done-local t)
56673
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
1038 (setq fields-inserted t)
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1039 (if (not non-interactive)
56673
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
1040 (message "Fields for %s added" regexp))
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1041 (let ((entry-list entries))
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1042 (while entry-list
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1043 (let ((field (caar entry-list))
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1044 (value (cdar entry-list)))
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1045 (cond
56673
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
1046 ((equal ":identity" field)
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
1047 (when
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
1048 ;;(and (not mh-identity-local)
65980
4520ae2624f2 * mh-init.el (mh-image-load-path): New function that adds the path to
Bill Wohler <wohler@newt.com>
parents: 65681
diff changeset
1049 ;; Bug 1204506. But do we need to be able
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
1050 ;; to set an identity manually that won't be
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
1051 ;; overridden by mh-insert-auto-fields?
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
1052 (assoc value mh-identity-list)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
1053 ;;)
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1054 (mh-insert-identity value)))
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1055 (t
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1056 (mh-modify-header-field field value
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1057 (equal field "From")))))
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1058 (setq entry-list (cdr entry-list))))))
56673
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
1059 (setq list (cdr list)))
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
1060 fields-inserted)))))
50702
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
1061
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
1062 (defun mh-modify-header-field (field value &optional overwrite-flag)
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
1063 "To header FIELD add VALUE.
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
1064 If OVERWRITE-FLAG is non-nil then the old value, if present, is
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
1065 discarded."
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1066 (cond ((and overwrite-flag
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1067 (mh-goto-header-field (concat field ":")))
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1068 (insert " " value)
68529
7daec5f4a289 * mh-alias.el (mh-alias-gecos-name): Use mh-replace-regexp-in-string
Bill Wohler <wohler@newt.com>
parents: 68528
diff changeset
1069 (delete-region (point) (mh-line-end-position)))
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1070 ((and (not overwrite-flag)
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1071 (mh-regexp-in-field-p (concat "\\b" value "\\b") field))
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1072 ;; Already there, do nothing.
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1073 )
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1074 ((and (not overwrite-flag)
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1075 (mh-goto-header-field (concat field ":")))
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1076 (insert " " value ","))
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1077 (t
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1078 (mh-goto-header-end 0)
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1079 (insert field ": " value "\n"))))
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
1080
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
1081 (defun mh-regexp-in-field-p (regexp &rest fields)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
1082 "Non-nil means REGEXP was found in FIELDS."
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
1083 (save-excursion
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
1084 (let ((search-result nil)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
1085 (field))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
1086 (while fields
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
1087 (setq field (car fields))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
1088 (if (and (mh-goto-header-field field)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
1089 (re-search-forward
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
1090 regexp (save-excursion (mh-header-field-end)(point)) t))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
1091 (setq fields nil
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
1092 search-result t)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
1093 (setq fields (cdr fields))))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68212
diff changeset
1094 search-result)))
56673
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
1095
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
1096 (defun mh-ascii-buffer-p ()
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
1097 "Check if current buffer is entirely composed of ASCII.
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
1098 The function doesn't work for XEmacs since `find-charset-region'
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
1099 doesn't exist there."
56673
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
1100 (loop for charset in (mh-funcall-if-exists
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
1101 find-charset-region (point-min) (point-max))
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
1102 unless (eq charset 'ascii) return nil
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56406
diff changeset
1103 finally return t))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
1104
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
1105 (provide 'mh-comp)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
1106
67681
3a8785724cca * mh-acros.el:
Bill Wohler <wohler@newt.com>
parents: 67656
diff changeset
1107 ;; Local Variables:
3a8785724cca * mh-acros.el:
Bill Wohler <wohler@newt.com>
parents: 67656
diff changeset
1108 ;; indent-tabs-mode: nil
3a8785724cca * mh-acros.el:
Bill Wohler <wohler@newt.com>
parents: 67656
diff changeset
1109 ;; sentence-end-double-space: nil
3a8785724cca * mh-acros.el:
Bill Wohler <wohler@newt.com>
parents: 67656
diff changeset
1110 ;; End:
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
1111
67681
3a8785724cca * mh-acros.el:
Bill Wohler <wohler@newt.com>
parents: 67656
diff changeset
1112 ;; arch-tag: 62865511-e610-4923-b0b5-f45a8ab70a34
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
1113 ;;; mh-comp.el ends here