|
|
1db854 |
commit 9ad0fcc54442a9a01d41be19880250783426db70
|
|
|
1db854 |
Author: Lars Ingebrigtsen <larsi@gnus.org>
|
|
|
1db854 |
Date: Fri Sep 8 20:23:31 2017 -0700
|
|
|
1db854 |
|
|
|
1db854 |
Remove unsafe enriched mode translations
|
|
|
1db854 |
|
|
|
1db854 |
* lisp/gnus/mm-view.el (mm-inline-text):
|
|
|
1db854 |
Do not worry about enriched or richtext type.
|
|
|
1db854 |
* lisp/textmodes/enriched.el (enriched-translations):
|
|
|
1db854 |
Remove translations for FUNCTION, display (Bug#28350).
|
|
|
1db854 |
(enriched-handle-display-prop, enriched-decode-display-prop): Remove.
|
|
|
1db854 |
|
|
|
1db854 |
diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el
|
|
|
1db854 |
index e5859d002c..77ad271d1d 100644
|
|
|
1db854 |
--- a/lisp/gnus/mm-view.el
|
|
|
1db854 |
+++ b/lisp/gnus/mm-view.el
|
|
|
1db854 |
@@ -383,10 +383,6 @@
|
|
|
1db854 |
(goto-char (point-max))))
|
|
|
1db854 |
(save-restriction
|
|
|
1db854 |
(narrow-to-region b (point))
|
|
|
1db854 |
- (when (member type '("enriched" "richtext"))
|
|
|
1db854 |
- (set-text-properties (point-min) (point-max) nil)
|
|
|
1db854 |
- (ignore-errors
|
|
|
1db854 |
- (enriched-decode (point-min) (point-max))))
|
|
|
1db854 |
(mm-handle-set-undisplayer
|
|
|
1db854 |
handle
|
|
|
1db854 |
`(lambda ()
|
|
|
1db854 |
diff --git a/lisp/textmodes/enriched.el b/lisp/textmodes/enriched.el
|
|
|
1db854 |
index beb6c6dda3..a8f0d3891a 100644
|
|
|
1db854 |
--- a/lisp/textmodes/enriched.el
|
|
|
1db854 |
+++ b/lisp/textmodes/enriched.el
|
|
|
1db854 |
@@ -117,12 +117,7 @@ expression, which is evaluated to get the string to insert.")
|
|
|
1db854 |
(full "flushboth")
|
|
|
1db854 |
(center "center"))
|
|
|
1db854 |
(PARAMETER (t "param")) ; Argument of preceding annotation
|
|
|
1db854 |
- ;; The following are not part of the standard:
|
|
|
1db854 |
- (FUNCTION (enriched-decode-foreground "x-color")
|
|
|
1db854 |
- (enriched-decode-background "x-bg-color")
|
|
|
1db854 |
- (enriched-decode-display-prop "x-display"))
|
|
|
1db854 |
(read-only (t "x-read-only"))
|
|
|
1db854 |
- (display (nil enriched-handle-display-prop))
|
|
|
1db854 |
(unknown (nil format-annotate-value))
|
|
|
1db854 |
; (font-size (2 "bigger") ; unimplemented
|
|
|
1db854 |
; (-2 "smaller"))
|
|
|
1db854 |
@@ -477,32 +472,5 @@ Return value is \(begin end name positive-p), or nil if none was found."
|
|
|
1db854 |
(message "Warning: no color specified for <x-bg-color>")
|
|
|
1db854 |
nil))
|
|
|
1db854 |
|
|
|
1db854 |
-;;; Handling the `display' property.
|
|
|
1db854 |
-
|
|
|
1db854 |
-
|
|
|
1db854 |
-(defun enriched-handle-display-prop (old new)
|
|
|
1db854 |
- "Return a list of annotations for a change in the `display' property.
|
|
|
1db854 |
-OLD is the old value of the property, NEW is the new value. Value
|
|
|
1db854 |
-is a list `(CLOSE OPEN)', where CLOSE is a list of annotations to
|
|
|
1db854 |
-close and OPEN a list of annotations to open. Each of these lists
|
|
|
1db854 |
-has the form `(ANNOTATION PARAM ...)'."
|
|
|
1db854 |
- (let ((annotation "x-display")
|
|
|
1db854 |
- (param (prin1-to-string (or old new))))
|
|
|
1db854 |
- (if (null old)
|
|
|
1db854 |
- (cons nil (list (list annotation param)))
|
|
|
1db854 |
- (cons (list (list annotation param)) nil))))
|
|
|
1db854 |
-
|
|
|
1db854 |
-(defun enriched-decode-display-prop (start end &optional param)
|
|
|
1db854 |
- "Decode a `display' property for text between START and END.
|
|
|
1db854 |
-PARAM is a `<param>' found for the property.
|
|
|
1db854 |
-Value is a list `(START END SYMBOL VALUE)' with START and END denoting
|
|
|
1db854 |
-the range of text to assign text property SYMBOL with value VALUE."
|
|
|
1db854 |
- (let ((prop (when (stringp param)
|
|
|
1db854 |
- (condition-case ()
|
|
|
1db854 |
- (car (read-from-string param))
|
|
|
1db854 |
- (error nil)))))
|
|
|
1db854 |
- (unless prop
|
|
|
1db854 |
- (message "Warning: invalid <x-display> parameter %s" param))
|
|
|
1db854 |
- (list start end 'display prop)))
|
|
|
1db854 |
|
|
|
1db854 |
;;; enriched.el ends here
|