(called-interactively-p 'interactive))
(with-help-window (help-buffer)
(with-current-buffer (help-buffer)
- (insert definition)
+ (insert "Definition of {" word "} in "
+ (cond
+ ((string= dictionary "*") "all dictionaries")
+ ((string= dictionary "!") "first matching dictionary")
+ (t (format "dictionary %s" dictionary)))
+ ":\n\n"
+ definition)
;; Buttonize references to other definitions. These appear as
;; words enclosed with curly braces.
(goto-char (point-min))
"}")
nil t)
(help-xref-button 1 'help-word
- (match-string 1)
+ ;; Normalize spaces in references.
+ (replace-regexp-in-string
+ (rx (+ (or space "\n"))) " " (match-string 1))
dictionary))))))
(defvar dictionary-color-support (display-color-p)