(:work "Work Tree")
(t (symbol-name name)))))
+(defun stgit-insert-without-trailing-whitespace (text)
+ "Insert TEXT in buffer using `insert', without trailing whitespace.
+A newline is appended."
+ (unless (string-match "\\(.*?\\) *$" text)
+ (error))
+ (insert (match-string 1 text) ?\n))
+
(defun stgit-patch-pp (patch)
(let* ((status (stgit-patch->status patch))
(start (point))
'face 'stgit-description-face)
?D (propertize (or (stgit-patch->desc patch)
(stgit-patch-display-name patch))
- 'face face))))
+ 'face face)))
+ (text (format-spec fmt spec)))
- (insert (format-spec fmt spec) "\n")
+ (stgit-insert-without-trailing-whitespace text)
(put-text-property start (point) 'entry-type 'patch)
(when (memq name stgit-expanded-patches)
(stgit-insert-patch-files patch))
(stgit-file->old-perm file)
(stgit-file->new-perm file))
'face 'stgit-description-face))))
- (insert (format-spec stgit-file-line-format spec) "\n")
+ (stgit-insert-without-trailing-whitespace
+ (format-spec stgit-file-line-format spec))
(add-text-properties start (point)
(list 'entry-type 'file
'file-data file))))