functions.el 533 B

123456789101112131415
  1. (defun define-word ()
  2. ;; TODO: needs refinement
  3. (interactive)
  4. (let ((myword (word-at-point)))
  5. ;; (message (shell-command-to-string (concat "mw " myword)))))
  6. (with-current-buffer (current-buffer)
  7. (save-excursion
  8. (set-buffer "worddef")
  9. (erase-buffer)))
  10. (call-process "mw" nil "worddef" nil myword)
  11. (with-current-buffer (current-buffer)
  12. (save-excursion
  13. (set-buffer "worddef")
  14. (ansi-color-apply-on-region (point-min) (point-max))))
  15. (display-buffer-pop-up-window (get-buffer "worddef") '())))