From: Paul Fox Date: Sat, 2 Sep 2017 13:13:44 +0000 (-0400) Subject: Change the priority ordering for multiple -prefer switches X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/5dce1b38ace6cf61398df3ee4ca5aee0e1dedb5d?ds=sidebyside;hp=c038c76a218f28b46b035a9dfb162f56da545c63 Change the priority ordering for multiple -prefer switches Interpreting multiple -prefer switches in ascending priority order allows the command line to override the user's profile. --- diff --git a/man/mhlist.man b/man/mhlist.man index 021d5d84..89aeeb86 100644 --- a/man/mhlist.man +++ b/man/mhlist.man @@ -174,7 +174,7 @@ the reverse order of their placement in the message. The listing, therefore, is in decreasing order of preference, as defined in RFC 2046. The .B \-prefer -switch can be used (one or more times, in order of descending +switch can be used (one or more times, in order of ascending preference) to let MH know which content types from a multipart/alternative MIME part are preferred by the user, in order to override the default preference order. Thus, when viewed by diff --git a/man/mhshow.man b/man/mhshow.man index 93225290..922c5bf7 100644 --- a/man/mhshow.man +++ b/man/mhshow.man @@ -206,7 +206,7 @@ In the absence of will select the "best" displayable subpart from multipart/alternative content. The .B \-prefer -switch can be used (one or more times, in order of descending +switch can be used (one or more times, in order of ascending preference) to let MH know which content types from a multipart/alternative MIME part are preferred by the user, in order to override the default selection for display. For example, mail is @@ -230,7 +230,11 @@ faithful" position. Thus, when viewed by the ordering of multipart/alternative parts will appear to change when invoked with or without various .B \-prefer -switches. +switches. Since the last of multiple +.B \-prefer +options "wins", a +.B \-prefer +on the command line will override any in a profile entry. .SS "Unseen Sequence" If the profile entry \*(lqUnseen\-Sequence\*(rq is present and non-empty, then diff --git a/man/mhstore.man b/man/mhstore.man index 9c99f515..a5087077 100644 --- a/man/mhstore.man +++ b/man/mhstore.man @@ -158,6 +158,10 @@ but is also implemented in and .B mhstore to make common part-numbering possible across all three programs. +The last of multiple +.B \-prefer +switches will have the highest priority. This allows the command line +switches to override profile entries. See .IR mhlist (1) and diff --git a/uip/mhparse.c b/uip/mhparse.c index 4d8e91e7..fda2de0b 100644 --- a/uip/mhparse.c +++ b/uip/mhparse.c @@ -1367,7 +1367,7 @@ static void prefer_parts(CT ct) { int i; - for (i = npreferred-1; i >= 0; i--) + for (i = 0; i < npreferred; i++) move_preferred_part(ct, preferred_types[i], preferred_subtypes[i]); }