(defvar Info-mode-font-lock-keywords
'(("‘\\([‘’]\\|[^‘’]*\\)’" (1 'Info-quoted))))
+;; See info-utils.c:degrade_utf8 in Texinfo for the source of the list
+;; below.
+(defvar info-symbols-and-replacements
+ '((?\‘ . "`")
+ (?\’ . "'")
+ (?\“ . "\"")
+ (?\” . "\"")
+ (?© . "(C)")
+ (?\》 . ">>")
+ (?→ . "->")
+ (?⇒ . "=>")
+ (?⊣ . "-|")
+ (?★ . "-!-")
+ (?↦ . "==>")
+ (?‐ . "-")
+ (?‑ . "-")
+ (?‒ . "-")
+ (?– . "-")
+ (?— . "--")
+ (?− . "-")
+ (?… . "...")
+ (?• . "*")
+ )
+ "A list of Unicode symbols used in Info files and their ASCII translations.
+Each element should be a cons cell with its car a character and its cdr
+a string of ASCII characters.")
+
;; Autoload cookie needed by desktop.el
;;;###autoload
(define-derived-mode Info-mode nil "Info" ;FIXME: Derive from special-mode?
(setq case-fold-search t)
(setq buffer-read-only t)
(setq Info-tag-table-marker (make-marker))
+ (unless (or (display-multi-font-p)
+ (coding-system-equal
+ (coding-system-base (terminal-coding-system))
+ 'utf-8))
+ (dolist (elt info-symbols-and-replacements)
+ (let ((ch (car elt))
+ (repl (cdr elt)))
+ (or (char-displayable-p ch)
+ (aset (or buffer-display-table
+ (setq buffer-display-table (make-display-table)))
+ ch (vconcat (mapcar (lambda (c)
+ (make-glyph-code c 'homoglyph))
+ repl)))))))
+
(if Info-use-header-line ; do not override global header lines
(setq header-line-format
'(:eval (get-text-property (point-min) 'header-line))))