\f
* Changes in Specialized Modes and Packages in Emacs 29.1
+** Enriched Mode
+
+---
+*** New command 'enriched-toggle-markup'.
+This allows you to see the markup in 'enriched-mode' buffers (e.g.,
+the HELLO file).
+
** Shell Script Mode
---
This command lets you examine all data in the current selection and
the clipboard, and insert it into the buffer.
++++
** New user option 'yank-transform-functions'.
This function allows the user to alter the string to be inserted.
(list start end 'display prop)
(list start end 'display (list 'disable-eval prop)))))
+(defvar enriched--markup-shown)
+(defun enriched-toggle-markup ()
+ "Toggle whether to see markup in the current buffer."
+ (interactive)
+ (save-excursion
+ (save-restriction
+ (widen)
+ (with-silent-modifications
+ (if (bound-and-true-p enriched--markup-shown)
+ (progn
+ (setq-local enriched--markup-shown nil)
+ ;; Remove any faces, because they will be decoded, too.
+ (goto-char (point-min))
+ (let (match)
+ (while (setq match (text-property-search-forward 'face))
+ (put-text-property (prop-match-beginning match)
+ (prop-match-end match)
+ 'face nil)))
+ (enriched-decode (point-min) (point-max))
+ (enriched-mode 1))
+ (setq-local enriched--markup-shown t)
+ (enriched-encode (point-min) (point-max) (current-buffer))
+ (enriched-mode -1))))))
+
(provide 'enriched)
;;; enriched.el ends here