summaryrefslogtreecommitdiff
path: root/lisp/format.el
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-08-19 16:48:59 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-08-19 16:48:59 -0700
commit07fcbb558d797272b9f43547da60beda485873a3 (patch)
tree77d5da14e9f9d9d8b1d877c70c01296fd3893796 /lisp/format.el
parentc9bdeff3e45a7ac84a74a81bb048046f82dddc91 (diff)
parentfb81c8c3adf8633f2f617c82f6019aef630860c7 (diff)
downloademacs-07fcbb558d797272b9f43547da60beda485873a3.tar.gz
Merge remote-tracking branch 'origin/master' into athena/unstable
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