diff options
| author | Lars Ingebrigtsen | 2017-09-08 20:23:31 -0700 |
|---|---|---|
| committer | Paul Eggert | 2017-09-09 15:18:58 -0700 |
| commit | 9ad0fcc54442a9a01d41be19880250783426db70 (patch) | |
| tree | 306474b34aab3e7656e19f8c928a840b222fed7f | |
| parent | 1985e9dcbb4ebc4df651decfdad72fae7cff3ed3 (diff) | |
| download | emacs-9ad0fcc54442a9a01d41be19880250783426db70.tar.gz emacs-9ad0fcc54442a9a01d41be19880250783426db70.zip | |
Remove unsafe enriched mode translations
* lisp/gnus/mm-view.el (mm-inline-text):
Do not worry about enriched or richtext type.
* lisp/textmodes/enriched.el (enriched-translations):
Remove translations for FUNCTION, display (Bug#28350).
(enriched-handle-display-prop, enriched-decode-display-prop): Remove.
| -rw-r--r-- | lisp/gnus/mm-view.el | 4 | ||||
| -rw-r--r-- | lisp/textmodes/enriched.el | 32 |
2 files changed, 0 insertions, 36 deletions
diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el index e5859d002cf..77ad271d1da 100644 --- a/lisp/gnus/mm-view.el +++ b/lisp/gnus/mm-view.el | |||
| @@ -383,10 +383,6 @@ | |||
| 383 | (goto-char (point-max)))) | 383 | (goto-char (point-max)))) |
| 384 | (save-restriction | 384 | (save-restriction |
| 385 | (narrow-to-region b (point)) | 385 | (narrow-to-region b (point)) |
| 386 | (when (member type '("enriched" "richtext")) | ||
| 387 | (set-text-properties (point-min) (point-max) nil) | ||
| 388 | (ignore-errors | ||
| 389 | (enriched-decode (point-min) (point-max)))) | ||
| 390 | (mm-handle-set-undisplayer | 386 | (mm-handle-set-undisplayer |
| 391 | handle | 387 | handle |
| 392 | `(lambda () | 388 | `(lambda () |
diff --git a/lisp/textmodes/enriched.el b/lisp/textmodes/enriched.el index beb6c6dda39..a8f0d3891a8 100644 --- a/lisp/textmodes/enriched.el +++ b/lisp/textmodes/enriched.el | |||
| @@ -117,12 +117,7 @@ expression, which is evaluated to get the string to insert.") | |||
| 117 | (full "flushboth") | 117 | (full "flushboth") |
| 118 | (center "center")) | 118 | (center "center")) |
| 119 | (PARAMETER (t "param")) ; Argument of preceding annotation | 119 | (PARAMETER (t "param")) ; Argument of preceding annotation |
| 120 | ;; The following are not part of the standard: | ||
| 121 | (FUNCTION (enriched-decode-foreground "x-color") | ||
| 122 | (enriched-decode-background "x-bg-color") | ||
| 123 | (enriched-decode-display-prop "x-display")) | ||
| 124 | (read-only (t "x-read-only")) | 120 | (read-only (t "x-read-only")) |
| 125 | (display (nil enriched-handle-display-prop)) | ||
| 126 | (unknown (nil format-annotate-value)) | 121 | (unknown (nil format-annotate-value)) |
| 127 | ; (font-size (2 "bigger") ; unimplemented | 122 | ; (font-size (2 "bigger") ; unimplemented |
| 128 | ; (-2 "smaller")) | 123 | ; (-2 "smaller")) |
| @@ -477,32 +472,5 @@ Return value is \(begin end name positive-p), or nil if none was found." | |||
| 477 | (message "Warning: no color specified for <x-bg-color>") | 472 | (message "Warning: no color specified for <x-bg-color>") |
| 478 | nil)) | 473 | nil)) |
| 479 | 474 | ||
| 480 | ;;; Handling the `display' property. | ||
| 481 | |||
| 482 | |||
| 483 | (defun enriched-handle-display-prop (old new) | ||
| 484 | "Return a list of annotations for a change in the `display' property. | ||
| 485 | OLD is the old value of the property, NEW is the new value. Value | ||
| 486 | is a list `(CLOSE OPEN)', where CLOSE is a list of annotations to | ||
| 487 | close and OPEN a list of annotations to open. Each of these lists | ||
| 488 | has the form `(ANNOTATION PARAM ...)'." | ||
| 489 | (let ((annotation "x-display") | ||
| 490 | (param (prin1-to-string (or old new)))) | ||
| 491 | (if (null old) | ||
| 492 | (cons nil (list (list annotation param))) | ||
| 493 | (cons (list (list annotation param)) nil)))) | ||
| 494 | |||
| 495 | (defun enriched-decode-display-prop (start end &optional param) | ||
| 496 | "Decode a `display' property for text between START and END. | ||
| 497 | PARAM is a `<param>' found for the property. | ||
| 498 | Value is a list `(START END SYMBOL VALUE)' with START and END denoting | ||
| 499 | the range of text to assign text property SYMBOL with value VALUE." | ||
| 500 | (let ((prop (when (stringp param) | ||
| 501 | (condition-case () | ||
| 502 | (car (read-from-string param)) | ||
| 503 | (error nil))))) | ||
| 504 | (unless prop | ||
| 505 | (message "Warning: invalid <x-display> parameter %s" param)) | ||
| 506 | (list start end 'display prop))) | ||
| 507 | 475 | ||
| 508 | ;;; enriched.el ends here | 476 | ;;; enriched.el ends here |