Merge lp:~akwm/vm/abbreviate-headers into lp:vm
- abbreviate-headers
- Merge into trunk
Status: | Needs review |
---|---|
Proposed branch: | lp:~akwm/vm/abbreviate-headers |
Merge into: | lp:vm |
Diff against target: |
171 lines (+132/-0) 3 files modified
info/vm.texinfo (+23/-0) lisp/vm-page.el (+90/-0) lisp/vm-vars.el (+19/-0) |
To merge this branch: | bzr merge lp:~akwm/vm/abbreviate-headers |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Tim Cross | Pending | ||
Review via email: mp+57440@code.launchpad.net |
Commit message
Description of the change
Change adds to core VM two functions for handling the display of headers. One will abbreviate the number of lines in any header to an amount particular to that header as given by the variable vm-abbreviate-
Should make sure that it is indeed always the presentation buffer. Should also check for corner cases perhaps with conflicting user config etc.
Tim Cross (tcross) wrote : | # |
Arik (akwm) wrote : | # |
Thanks Tim. Messing around, I did find a case that behaves
undesirably, this occurs if one sets a field to 0 in
vm-abbreviate-
silly value for anyone to try, so maybe highlighting this in the doc
is sufficient...
Similarly, for the fill headers, anything less than 2 (equally as
silly) causes odd display.
Anyway, these are probably extreme cases of protecting users from
themselves!
Thanks,
-Arik
Tim Cross writes:
> OK, will try to find time to play with it over the weekend.
> Brief scan of the code looks good. However, your right about possible
> conflicts with other configuraiton settings.
>
> Will see if I can make it blow up! :)
>
> Tim
>
> On Wed, Apr 13, 2011 at 4:19 PM, Arik <email address hidden> wrote:
>
> > Arik has proposed merging lp:~akwm/vm/abbreviate-headers into lp:vm.
> >
> > Requested reviews:
> > Tim Cross (tcross)
> >
> > For more details, see:
> > https:/
> >
> > Change adds to core VM two functions for handling the display of headers.
> > One will abbreviate the number of lines in any header to an amount
> > particular to that header as given by the variable vm-abbreviate-
> > The other fills headers to a particular column (at the same time uniformly
> > making a single space at each new line) controlled by
> > vm-fill-
> > to do nothing. Both likewise act only in the presentation buffer so will not
> > make changes to the message itself.
> >
> > Should make sure that it is indeed always the presentation buffer. Should
> > also check for corner cases perhaps with conflicting user config etc.
> > --
> > https:/
> > You are requested to review the proposed merge of
> > lp:~akwm/vm/abbreviate-headers into lp:vm.
> >
> > === modified file 'lisp/vm-page.el'
> > --- lisp/vm-page.el 2011-03-30 20:33:50 +0000
> > +++ lisp/vm-page.el 2011-04-13 06:19:23 +0000
> > @@ -873,6 +873,11 @@
> > (vm-energize-
> > (vm-highlight-
> > (vm-energize-
> > +
> > + ;; 5.5 prettify the headers of the message while still
> > + ;; in the presentation buffer
> > + (when vm-fill-
> > + (when vm-abbreviate-
> >
> > ;; 6. Go to the text of message
> > (if (and vm-honor-
> > @@ -894,6 +899,76 @@
> >
> > (defalias 'vm-preview-
> >
> > +(defun vm-fill-headers ()
> > + "Fill headers of the message in the current buffer using
> > +`vm-fill-
> > +This function will be run (given that `vm-fill-
> > +non-nil) in the presentation buffer when viewing a message."
> > + (let ((buffer-read-only nil)
> > + (fill-column vm-fill-
> > + done start )
> > + (save-excursion
> > ...
Tim Cross (tcross) wrote : | # |
Hi Arik,
having a bit of a look at your suggested additions/
comments.
1. Your defcustom for vm-fill-
you need to define the value as being either an integrer or nil. If defined
as just an integer, it sees the default of nil as a mismatch)
2. Do you think your variables and possibly function names should have
something like vm-presentation-* as a prefix. While I realise this does tend
to make identifiers quite long, it does seem to fit with a lot of the VM
coding style. It also helps make it clear where these functions/variables
operate i.e. the presentaiton as apart from composition or summary etc.
3. I'm a little confused as to how your extensions fit in with the rfaddons
shrunken headers features. Is it meant as a general replacement or as an
extension? Is there any dependency between the two?
It is interesting that I've noticed (prior to trying out your patch) that
the From: header of 'some' messages was being 'shrunken' - I suspect it is
something to do with enabling shrunken headers. The weird thing is that it
does it on some quite short from lines and not on others that are longer. I
was going to look into this when time permitted.
Just to clarify how your extension is meant to work.
You set a header 'fill column' to enable this feature. This column will
cause headers to be broken into multiple lines at that column. If the header
wraps into more lines than specified in
vm-abbreviate-
for when you want to show the full header.
I will continue to play with the extension for the next few days and see
what results I get.
Tim
On Wed, Apr 13, 2011 at 4:19 PM, Arik <email address hidden> wrote:
> Arik has proposed merging lp:~akwm/vm/abbreviate-headers into lp:vm.
>
> Requested reviews:
> Tim Cross (tcross)
>
> For more details, see:
> https:/
>
> Change adds to core VM two functions for handling the display of headers.
> One will abbreviate the number of lines in any header to an amount
> particular to that header as given by the variable vm-abbreviate-
> The other fills headers to a particular column (at the same time uniformly
> making a single space at each new line) controlled by
> vm-fill-
> to do nothing. Both likewise act only in the presentation buffer so will not
> make changes to the message itself.
>
> Should make sure that it is indeed always the presentation buffer. Should
> also check for corner cases perhaps with conflicting user config etc.
> --
> https:/
> You are requested to review the proposed merge of
> lp:~akwm/vm/abbreviate-headers into lp:vm.
>
> === modified file 'lisp/vm-page.el'
> --- lisp/vm-page.el 2011-03-30 20:33:50 +0000
> +++ lisp/vm-page.el 2011-04-13 06:19:23 +0000
> @@ -873,6 +873,11 @@
> (vm-energize-
> (vm-highlight-
> (vm-energize-
> +
> + ;; 5.5 prettify the headers of the m...
Uday Reddy (reddyuday) wrote : | # |
Hi all,
I just got back from a week's trip and looking into this branch now.
> 1. Your defcustom for vm-fill-
> you need to define the value as being either an integrer or nil. If defined
> as just an integer, it sees the default of nil as a mismatch)
Tim, can you suggest the right type definition for this?
> 2. Do you think your variables and possibly function names should have
> something like vm-presentation-* as a prefix. While I realise this does tend
> to make identifiers quite long, it does seem to fit with a lot of the VM
> coding style. It also helps make it clear where these functions/variables
> operate i.e. the presentaiton as apart from composition or summary etc.
No, we don't really have vm-presentation- as a package name. I think the
current names are fine as they stand.
> 3. I'm a little confused as to how your extensions fit in with the rfaddons
> shrunken headers features. Is it meant as a general replacement or as an
> extension? Is there any dependency between the two?
I have this question too.
Cheers,
Uday
Uday Reddy (reddyuday) wrote : | # |
Hi Arik, here are my comments on the abbreviate-headers branch. (sorry for
the delay in reviewing this, due to some pre-arranged travel.)
- vm-fill-
'(choice (const nil) integer)
- The regexp used for searching for header fields doesn't work for headers
that have hyphens, e.g., X-Mailer. It must conform to the RFC
definition of header fields. Check the function vm-match-header in
vm-folder.el.
- Add a space between the header text and the "[...]" button to make it look
cleaner. Can the button use the 'vm-mime-
shorten the button-text as well.
- The "[...]" button is a bit confusing because it doesn't indicate the
current state of the abbreviation. It could be something like "[>>>]" for
an abbreviated header and "[<<<]" for an expanded header.
- If this is going to replace rfaddons' shrunken-headers feature, then it is
best to use the same naming, i.e., "shrunken" headers instead of "shrunk"
headers or "abbreviated" headers. Differences in terminology can cause
confusion down the road.
- The vm-fill-headers function seems a bit fiddly in engineering the
correct indentation for the continuation lines. Can't the fill-prefix be
used for this purpose, more cleanly?
- VM source files use a tab-width of 8 columns. So, please set your
tab-width to 8 or turn off tabs.
Cheers,
Uday
Arik (akwm) wrote : | # |
Thanks for the comments, I was away on travel as well and so couldn't
respond to Tim's thoughts, sorry. I was intending this to be a VM
native replacement for shrunken headers, along with the additional
fill-headers function which operates along the same lines.
I think I can address all of these, with the exception of using
fill-prefix for the fill-headers function, because it can accept a
value of nil, or characters other than a space and would not be
allowed as a header. I agree it is a bit clunky, but I'm not sure
another way to get the desired behaviour while using fill-region in
another way.
Thanks,
-Arik
Uday Reddy writes:
> Hi Arik, here are my comments on the abbreviate-headers branch. (sorry for
> the delay in reviewing this, due to some pre-arranged travel.)
>
> - vm-fill-
> '(choice (const nil) integer)
>
> - The regexp used for searching for header fields doesn't work for headers
> that have hyphens, e.g., X-Mailer. It must conform to the RFC
> definition of header fields. Check the function vm-match-header in
> vm-folder.el.
>
> - Add a space between the header text and the "[...]" button to make it look
> cleaner. Can the button use the 'vm-mime-
> shorten the button-text as well.
>
> - The "[...]" button is a bit confusing because it doesn't indicate the
> current state of the abbreviation. It could be something like "[>>>]" for
> an abbreviated header and "[<<<]" for an expanded header.
>
> - If this is going to replace rfaddons' shrunken-headers feature, then it is
> best to use the same naming, i.e., "shrunken" headers instead of "shrunk"
> headers or "abbreviated" headers. Differences in terminology can cause
> confusion down the road.
>
> - The vm-fill-headers function seems a bit fiddly in engineering the
> correct indentation for the continuation lines. Can't the fill-prefix be
> used for this purpose, more cleanly?
>
> - VM source files use a tab-width of 8 columns. So, please set your
> tab-width to 8 or turn off tabs.
>
> Cheers,
> Uday
>
> --
> https:/
> You are the owner of lp:~akwm/vm/abbreviate-headers.
Uday Reddy (reddyuday) wrote : | # |
Arik writes:
> Thanks for the comments, I was away on travel as well and so couldn't
> respond to Tim's thoughts, sorry. I was intending this to be a VM
> native replacement for shrunken headers, along with the additional
> fill-headers function which operates along the same lines.
Right. So, we will advise the users to stop using the rfaddons option for
shrunken headers, or even delete it from the distribution. If you used any
code from the rfaddons version, you should add a comment in the source file
and attribute the authorship to Rob F.
> I think I can address all of these, with the exception of using
> fill-prefix for the fill-headers function, because it can accept a
> value of nil, or characters other than a space and would not be
> allowed as a header. I agree it is a bit clunky, but I'm not sure
> another way to get the desired behaviour while using fill-region in
> another way.
I guess I can live with that. I am beginning to admire your earlier
approach for the thread-folding with an apparently fiddly basis on the
contents of the Summary buffer. Redoing it based on the internal thread
information costed me countless hours in debugging the threading code!
But add a comment saying how it is working, so that if somebody has to fix
it in future due to changes in the Emacs filling code, they will know what
is happening.
Cheers,
Uday
- 1177. By Arik
-
changed "abbreviate" to "shrunken/shrink", the expander button now
uses >>> and <<< to indicate the state of header shrinkage and also
uses the vm-mime-button face, altered the search for headers to use
vm-match-header functionality. - 1178. By Arik
-
fixed a bug involving identifying header boundaries, cleaned up the
code as well to be more clear
Arik (akwm) wrote : | # |
I think I have addressed all the issues brought up so far in the
updated branch. This includes using vm-match-header (which did not
have the most obvious doc-string, I didn't realize at first that it
matches the header at point and doesn't search...), improvements to
the indicator of shrunken headers using vm-mime-button face and the
">>>/<<<" indicators - though, Uday, I'm not sure what you meant about
it being shorter if the face could be used?, and added some comments
for the fill code along with some changes that make it smaller and
clearer.
Please let me know what you think about the changes. Then the next
thing is to add some info file documentation, I will try and find a
good entry point unless someone already has a good spot in mind.
Thanks,
-Arik
Unmerged revisions
- 1179. By Arik
-
Added documentation to the new variables for automatically filling and
shrinking headers. - 1178. By Arik
-
fixed a bug involving identifying header boundaries, cleaned up the
code as well to be more clear - 1177. By Arik
-
changed "abbreviate" to "shrunken/shrink", the expander button now
uses >>> and <<< to indicate the state of header shrinkage and also
uses the vm-mime-button face, altered the search for headers to use
vm-match-header functionality. - 1176. By Arik
-
Added two functions to prettify the presentation of headers when
viewing a message. vm-abbreviate-headers will truncate headers in a
fasion quite similar to shrunken headers of rf-addons but is meant to
replace it, and vm-fill-headers attempts to uniformly display headers
that may have erratic layouts. Both are controlled by variables. Still
need info docs
Preview Diff
1 | === modified file 'info/vm.texinfo' | |||
2 | --- info/vm.texinfo 2012-01-05 15:18:34 +0000 | |||
3 | +++ info/vm.texinfo 2012-01-06 02:05:30 +0000 | |||
4 | @@ -1753,6 +1753,29 @@ | |||
5 | 1753 | specified by @code{vm-highlighted-header-face}, which defaults to | 1753 | specified by @code{vm-highlighted-header-face}, which defaults to |
6 | 1754 | 'bold. | 1754 | 'bold. |
7 | 1755 | 1755 | ||
8 | 1756 | @vindex vm-shrunken-headers | ||
9 | 1757 | @vindex vm-fill-headers-column | ||
10 | 1758 | Finally, some messages may have very long subject lines or a large | ||
11 | 1759 | list of recipients, which gets in the way of easily identifying the | ||
12 | 1760 | message or reading the message body. Two variables that allow the user | ||
13 | 1761 | to automatically manage this problem are @code{vm-shrunken-headers} | ||
14 | 1762 | and @code{vm-fill-headers-column}. The first, | ||
15 | 1763 | @code{vm-shrunken-headers}, takes a list of cons cells describing the | ||
16 | 1764 | header and the number of lines that header should show (e.g. (`''To'' | ||
17 | 1765 | . 3), meaning the show three lines of the ``To:'' header). Undesirable | ||
18 | 1766 | results will happen if you select 0 lines; if you wish to not display | ||
19 | 1767 | the header, please instead modify the variable | ||
20 | 1768 | @code{vm-visible-headers}. @code{vm-fill-headers-column} will, prior | ||
21 | 1769 | to shrinking the headers via @code{vm-shrunken-headers}, fill all | ||
22 | 1770 | headers to that particular character width. In doing so, VM will first | ||
23 | 1771 | ensure there is only a single space in front of multi-line headers in | ||
24 | 1772 | order to maximize the use of the fill-column specified. All header | ||
25 | 1773 | modification is done in the presentation buffer and will not edit a | ||
26 | 1774 | real message. Both of these variables, if set to nil do nothing. | ||
27 | 1775 | @emph{note: vm-shrunken-headers is intended as a VM native replacement | ||
28 | 1776 | to the extension of the same name in vm-rfaddons.} | ||
29 | 1777 | |||
30 | 1778 | |||
31 | 1756 | @vindex vm-preview-read-messages | 1779 | @vindex vm-preview-read-messages |
32 | 1757 | By default, VM will not preview messages that are flagged as read. To | 1780 | By default, VM will not preview messages that are flagged as read. To |
33 | 1758 | have VM preview all messages, set the value of | 1781 | have VM preview all messages, set the value of |
34 | 1759 | 1782 | ||
35 | === modified file 'lisp/vm-page.el' | |||
36 | --- lisp/vm-page.el 2012-01-03 16:49:23 +0000 | |||
37 | +++ lisp/vm-page.el 2012-01-06 02:05:30 +0000 | |||
38 | @@ -884,6 +884,11 @@ | |||
39 | 884 | (vm-energize-urls-in-message-region) | 884 | (vm-energize-urls-in-message-region) |
40 | 885 | (vm-highlight-headers-maybe) | 885 | (vm-highlight-headers-maybe) |
41 | 886 | (vm-energize-headers-and-xfaces)) | 886 | (vm-energize-headers-and-xfaces)) |
42 | 887 | |||
43 | 888 | ;; 5.5 prettify the headers of the message while still | ||
44 | 889 | ;; in the presentation buffer | ||
45 | 890 | (when vm-fill-headers-column (vm-fill-headers)) | ||
46 | 891 | (when vm-shrunken-headers (vm-shrink-headers)) | ||
47 | 887 | 892 | ||
48 | 888 | ;; 6. Go to the text of message | 893 | ;; 6. Go to the text of message |
49 | 889 | (if (and vm-honor-page-delimiters need-preview) | 894 | (if (and vm-honor-page-delimiters need-preview) |
50 | @@ -905,6 +910,91 @@ | |||
51 | 905 | 910 | ||
52 | 906 | (defalias 'vm-preview-current-message 'vm-present-current-message) | 911 | (defalias 'vm-preview-current-message 'vm-present-current-message) |
53 | 907 | 912 | ||
54 | 913 | (defun vm-fill-headers () | ||
55 | 914 | "Fill headers of the message in the current buffer using | ||
56 | 915 | `vm-fill-headers-column' to determine the column to fill to. | ||
57 | 916 | This function will be run (given that `vm-fill-headers-column' is | ||
58 | 917 | non-nil) in the presentation buffer when viewing a message." | ||
59 | 918 | (let ((buffer-read-only nil) | ||
60 | 919 | (fill-column vm-fill-headers-column) | ||
61 | 920 | start end) | ||
62 | 921 | (save-excursion | ||
63 | 922 | (goto-char (point-min)) | ||
64 | 923 | (while (vm-match-header) | ||
65 | 924 | ;; The following is to ensure that the filling is done | ||
66 | 925 | ;; unanimously with one space to ensure the header is still a | ||
67 | 926 | ;; valid multi-line header. for filling to applying the same | ||
68 | 927 | ;; initial indent it requires 2 lines to have uniform indent | ||
69 | 928 | ;; at the beginning, the following code is doing this | ||
70 | 929 | (setq start (point)) | ||
71 | 930 | ;; before doing any insertion of filling, which may add/remove | ||
72 | 931 | ;; newlines save the current end of the header as a marker | ||
73 | 932 | (goto-char (- (vm-matched-header-end) 1)) | ||
74 | 933 | (setq end (point-marker)) | ||
75 | 934 | (goto-char start) | ||
76 | 935 | (insert " ") | ||
77 | 936 | (forward-line 1) | ||
78 | 937 | (when (looking-at "^[ \t]+") | ||
79 | 938 | (search-forward-regexp "^[ \t]+") | ||
80 | 939 | (delete-region (point-at-bol) (point)) | ||
81 | 940 | (insert " ")) | ||
82 | 941 | (fill-region start end) | ||
83 | 942 | (goto-char start) | ||
84 | 943 | (delete-char 1) | ||
85 | 944 | (goto-char end) | ||
86 | 945 | (forward-line 1))))) | ||
87 | 946 | |||
88 | 947 | (defun vm-shrink-headers () | ||
89 | 948 | "Shrink the headers of the current message (is run in the | ||
90 | 949 | presentation buffer) to the number of lines as indicated by the | ||
91 | 950 | variable `vm-shrunken-headers' (when non-nil). Headers in this | ||
92 | 951 | list with more lines than specified will have those lines hidden | ||
93 | 952 | and place a button of the form [>>>] allowing their | ||
94 | 953 | expansion. This can make viewing significantly more pleasant for | ||
95 | 954 | messages sent to (or CC'ed to) many recipients | ||
96 | 955 | |||
97 | 956 | This functionality was entirely inspired and partially taken from | ||
98 | 957 | Rob F's rfaddons feature shrunken headers" | ||
99 | 958 | (let ((headers vm-shrunken-headers) start end | ||
100 | 959 | (buffer-read-only nil)) | ||
101 | 960 | (save-excursion | ||
102 | 961 | (while headers | ||
103 | 962 | (goto-char (point-min)) | ||
104 | 963 | (when (search-forward-regexp | ||
105 | 964 | (concat "^" (car (car headers)) ": ") nil t) | ||
106 | 965 | (goto-char (point-at-bol)) | ||
107 | 966 | (vm-match-header) | ||
108 | 967 | (setq end (- (vm-matched-header-end) 1)) | ||
109 | 968 | (end-of-line (cdr (car headers))) | ||
110 | 969 | (when (and (< (point) end) | ||
111 | 970 | (not (invisible-p (point)))) | ||
112 | 971 | (setq start (point)) | ||
113 | 972 | (put-text-property start end | ||
114 | 973 | 'invisible t) | ||
115 | 974 | (goto-char end) | ||
116 | 975 | (insert-button " [>>>]" 'action 'vm-show-shrunken-headers | ||
117 | 976 | 'face 'vm-mime-button | ||
118 | 977 | 'vm-shrunken-header-start start | ||
119 | 978 | 'vm-shrunken-header-end end))) | ||
120 | 979 | (setq headers (cdr headers)))))) | ||
121 | 980 | |||
122 | 981 | (defun vm-show-shrunken-headers (button) | ||
123 | 982 | (let ((buffer-read-only nil) | ||
124 | 983 | (inv t)) | ||
125 | 984 | (when (invisible-p | ||
126 | 985 | (button-get button 'vm-shrunken-header-start)) | ||
127 | 986 | (setq inv nil)) | ||
128 | 987 | (put-text-property (button-get button 'vm-shrunken-header-start) | ||
129 | 988 | (button-get button 'vm-shrunken-header-end) | ||
130 | 989 | 'invisible inv) | ||
131 | 990 | (save-excursion | ||
132 | 991 | (goto-char (button-start button)) | ||
133 | 992 | (forward-char 2) | ||
134 | 993 | (delete-char 3) | ||
135 | 994 | (if inv | ||
136 | 995 | (insert ">>>") | ||
137 | 996 | (insert "<<<"))))) | ||
138 | 997 | |||
139 | 908 | (defun vm-show-current-message () | 998 | (defun vm-show-current-message () |
140 | 909 | "Show the current message in the Presentation Buffer. MIME decoding | 999 | "Show the current message in the Presentation Buffer. MIME decoding |
141 | 910 | is done if necessary. (USR, 2010-01-14)" | 1000 | is done if necessary. (USR, 2010-01-14)" |
142 | 911 | 1001 | ||
143 | === modified file 'lisp/vm-vars.el' | |||
144 | --- lisp/vm-vars.el 2012-01-03 16:49:23 +0000 | |||
145 | +++ lisp/vm-vars.el 2012-01-06 02:05:30 +0000 | |||
146 | @@ -1053,6 +1053,25 @@ | |||
147 | 1053 | :group 'vm-presentation | 1053 | :group 'vm-presentation |
148 | 1054 | :type '(choice (const nil) regexp)) | 1054 | :type '(choice (const nil) regexp)) |
149 | 1055 | 1055 | ||
150 | 1056 | (defcustom vm-fill-headers-column nil | ||
151 | 1057 | "*Non-nil value tells VM to fill the headers in the | ||
152 | 1058 | presentation copy of the current message to this column. This | ||
153 | 1059 | will fill all headers visible in the presentation, also ensuring | ||
154 | 1060 | that subsequent lines are offset uniformly by a single space." | ||
155 | 1061 | :group 'vm-presentation | ||
156 | 1062 | :type '(choice (const nil) integer)) | ||
157 | 1063 | |||
158 | 1064 | (defcustom vm-shrunken-headers '(("To" . 3)("Subject" . 2)("Cc" . 3)) | ||
159 | 1065 | "*Non-nil value should be a list of cons cells each having as | ||
160 | 1066 | its car the name of the header (e.g. 'To') where the cdr is the | ||
161 | 1067 | number of lines to be displayed for this header, after which VM | ||
162 | 1068 | will insert a button in the presentation that, when pushed, will | ||
163 | 1069 | make visible temporarily the remaining lines of that header" | ||
164 | 1070 | :group 'vm-presentation | ||
165 | 1071 | :type '(choice (const nil) | ||
166 | 1072 | (alist :key-type (string :tag "Header name") | ||
167 | 1073 | :value-type (integer :tag "Number of lines")))) | ||
168 | 1074 | |||
169 | 1056 | (defcustom vm-highlighted-header-regexp nil | 1075 | (defcustom vm-highlighted-header-regexp nil |
170 | 1057 | "*Value specifies which headers to highlight. | 1076 | "*Value specifies which headers to highlight. |
171 | 1058 | This is a regular expression that matches the names of headers that should | 1077 | This is a regular expression that matches the names of headers that should |
OK, will try to find time to play with it over the weekend.
Brief scan of the code looks good. However, your right about possible
conflicts with other configuraiton settings.
Will see if I can make it blow up! :)
Tim
On Wed, Apr 13, 2011 at 4:19 PM, Arik <email address hidden> wrote:
> Arik has proposed merging lp:~akwm/vm/abbreviate-headers into lp:vm. /code.launchpad .net/~akwm/ vm/abbreviate- headers/ +merge/ 57440 headers. headers- column. Both these variables, when set to nil, will cause VM /code.launchpad .net/~akwm/ vm/abbreviate- headers/ +merge/ 57440 urls-in- message- region) headers- maybe) headers- and-xfaces) ) headers- column (vm-fill-headers)) headers (vm-abbreviate- headers) ) page-delimiters need-preview) current- message 'vm-present- current- message) headers- column' to determine the column to fill to. headers- column' is headers- column) forward- regexp "^\\w+: " nil t) forward- regexp "^[ \t]+") forward- regexp "^\\w+: \\|^$" nil
>
> Requested reviews:
> Tim Cross (tcross)
>
> For more details, see:
> https:/
>
> Change adds to core VM two functions for handling the display of headers.
> One will abbreviate the number of lines in any header to an amount
> particular to that header as given by the variable vm-abbreviate-
> The other fills headers to a particular column (at the same time uniformly
> making a single space at each new line) controlled by
> vm-fill-
> to do nothing. Both likewise act only in the presentation buffer so will not
> make changes to the message itself.
>
> Should make sure that it is indeed always the presentation buffer. Should
> also check for corner cases perhaps with conflicting user config etc.
> --
> https:/
> You are requested to review the proposed merge of
> lp:~akwm/vm/abbreviate-headers into lp:vm.
>
> === modified file 'lisp/vm-page.el'
> --- lisp/vm-page.el 2011-03-30 20:33:50 +0000
> +++ lisp/vm-page.el 2011-04-13 06:19:23 +0000
> @@ -873,6 +873,11 @@
> (vm-energize-
> (vm-highlight-
> (vm-energize-
> +
> + ;; 5.5 prettify the headers of the message while still
> + ;; in the presentation buffer
> + (when vm-fill-
> + (when vm-abbreviate-
>
> ;; 6. Go to the text of message
> (if (and vm-honor-
> @@ -894,6 +899,76 @@
>
> (defalias 'vm-preview-
>
> +(defun vm-fill-headers ()
> + "Fill headers of the message in the current buffer using
> +`vm-fill-
> +This function will be run (given that `vm-fill-
> +non-nil) in the presentation buffer when viewing a message."
> + (let ((buffer-read-only nil)
> + (fill-column vm-fill-
> + done start )
> + (save-excursion
> + (goto-char (point-min))
> + (when (search-
> + (while (not done)
> + (setq start (point))
> + (goto-char (point-at-bol))
> + (insert " ")
> + (forward-line 1)
> + (when (looking-at "^[ \t]+")
> + (search-
> + (delete-region (point-at-bol) (point))
> + (insert " "))
> + (when (or (not (search-
> t))
> + (looking-at "^$")
> + ...