summaryrefslogtreecommitdiff
path: root/lisp/format.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/format.el')
-rw-r--r--lisp/format.el26
1 files changed, 18 insertions, 8 deletions
diff --git a/lisp/format.el b/lisp/format.el
index 4209fc6401a..71cf885d417 100644
--- a/lisp/format.el
+++ b/lisp/format.el
@@ -181,7 +181,7 @@ it should be a Lisp function. BUFFER is currently ignored."
;; We should perhaps go via a temporary buffer and copy it
;; back, in case of errors.
(if (and (zerop (save-window-excursion
- (shell-command-on-region from to method t t
+ (shell-command-on-region from to method t 'no-mark
error-buff)))
;; gzip gives zero exit status with bad args, for instance.
(zerop (with-current-buffer error-buff
@@ -747,13 +747,17 @@ to write these unknown annotations back into the file."
(if (numberp val) ; add to ambient value if numeric
(format-property-increment-region from to prop val 0)
- (put-text-property
- from to prop
- (cond ((get prop 'format-list-valued) ; value gets consed onto
- ; list-valued properties
- (let ((prev (get-text-property from prop)))
- (cons val (if (listp prev) prev (list prev)))))
- (t val))))) ; normally, just set to val.
+ ;; Kludge alert: ignore items with reversed order of
+ ;; FROM and TO. They seem to be redundant anyway, and
+ ;; in one case I've seen them refer to EOB.
+ (when (<= from to)
+ (put-text-property
+ from to prop
+ (cond ((get prop 'format-list-valued) ; value gets consed onto
+ ; list-valued properties
+ (let ((prev (get-text-property from prop)))
+ (cons val (if (listp prev) prev (list prev)))))
+ (t val)))))) ; normally, just set to val.
(setq todo (cdr todo)))
(if unknown-ans
@@ -1009,6 +1013,12 @@ either strings, or lists of the form (PARAMETER VALUE)."
prop-alist (car old) nil))
close)
old (cdr old)))
+ ;; If the font is on the format (:background "red"),
+ ;; then we have a single face. We're assuming a list of
+ ;; faces, so transform.
+ (when (and (listp new)
+ (keywordp (car new)))
+ (setq new (list new)))
(while new
(setq open
(append (cdr (format-annotate-atomic-property-change