xuchunyang / osx-dictionary.el

Mac OS X Dictionary.app interface for Emacs
139 stars 23 forks source link

Suggest to include word in buffer name #30

Closed PengjuXu closed 2 years ago

PengjuXu commented 2 years ago

Workaround

(defun osx-dictionary-search-input ()
      "Search input word and display result with buffer."
      (interactive)
      (let* ((text (my/get-current-text))
             (word (completing-read
                    "macDict: "
                    ;; p4 list of word suffix
                    nil ;;(list text)
                    nil nil text)
                   )
             (osx-dictionary-buffer-name
              (format "%s %s" osx-dictionary-buffer-name word))
             )
        (osx-dictionary--view-result word)
        ))
xuchunyang commented 2 years ago

You can use osx-dictionary-generate-buffer-name-function, see also #28.