On 02/06/2013 08:41 AM, Bastien wrote: > Hi Arun, > > Arun Persaud writes: > >> I like to show trailing white spaces in my buffers using >> >> (setq-default show-trailing-whitespace t) >> >> in my .emacs file. Since I have this enabled, I noticed >> that the calendar (M-x calendar) has a lot of empty white space at the >> end of the line. It would be nice if those could be removed before >> displaying the calendar. > > Can you make a patch for this? It should be small enough so that we > can apply it quickly. > > Thanks, > Here is a simple patch that seems to run on my computer, but I never really looked at the calendar code before, so I'm not sure if this is the right way of doing this. The patch calls delete-trailing-whitespace for the current line when advancing a line (via calendar-ensure-newline) and also removes the whitespace for the last line when inserting a month into the buffer. Removing the trailing whitespace doesn't seem to mess up the formatting, since calendar-insert-at-column seems to be used when adding text which fills the line with spaces in case it's needed before adding the text. cheers Arun