(user-error "No ellipsis to expand here")))
(let* ((end (next-single-property-change (point) 'cl-print-ellipsis))
(begin (previous-single-property-change end 'cl-print-ellipsis))
- (value (get-text-property begin 'cl-print-ellipsis)))
+ (value (get-text-property begin 'cl-print-ellipsis))
+ ;; Ensure clicking the button works even in read only buffers.
+ (inhibit-read-only t))
;; FIXME: Rather than `t' (i.e. reuse the print-length/level unchanged),
;; I think it would make sense to increase the level by 1 and to
;; double the length at each expansion step.
;; TODO:
;; - log buffers need font-locking.
-(eval-when-compile (require 'cl-lib))
+(eval-when-compile
+ (require 'cl-lib)
+ (require 'cl-print))
;; General customization
(unless (eq (point) (point-min))
(insert "\f\n"))
(setq new-window-start (point))
- (insert "Running \"" cmd)
+ (insert "Running '" cmd)
(dolist (flag flags)
- (insert " " flag))
- (insert "\"...\n")
+ (let ((lines (string-lines flag)))
+ (insert " ")
+ ;; If the argument has newlines in it (as a commit
+ ;; message commonly will) then ellipse it down so
+ ;; that the whole command is more readable.
+ (if (cdr lines)
+ (let ((flag (copy-sequence flag))
+ (cl-print-string-length (length
+ (car lines))))
+ (set-text-properties 0 (length flag) nil
+ flag)
+ (cl-prin1 flag buffer))
+ (insert flag))))
+ (insert "'...\n")
args))))
(setq proc (apply #'vc-do-command t 'async command nil args))))
(unless vc--inhibit-async-window