xwidget-plus.el 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. ;;; xwidget-plus.el --- Improve xwidget usability
  2. ;; Author: Damien Merenne
  3. ;; URL: https://github.com/canatella/xwidget-plus
  4. ;; Created: 2020-03-11
  5. ;; Keywords: convenience
  6. ;; Version: 0.1
  7. ;; Package-Requires: ((emacs "25.3"))
  8. ;; This file is NOT part of GNU Emacs.
  9. ;;; Commentary:
  10. ;; This package augment the xwidget-webkit browser to make it more usable.
  11. ;;; License:
  12. ;; This program is free software; you can redistribute it and/or modify
  13. ;; it under the terms of the GNU General Public License as published by
  14. ;; the Free Software Foundation; either version 3, or (at your option)
  15. ;; any later version.
  16. ;;
  17. ;; This program is distributed in the hope that it will be useful,
  18. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. ;; GNU General Public License for more details.
  21. ;;
  22. ;; You should have received a copy of the GNU General Public License
  23. ;; along with GNU Emacs; see the file COPYING. If not, write to the
  24. ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  25. ;; Boston, MA 02110-1301, USA.
  26. ;;; Code:
  27. ;;; User customizable variable
  28. ;;
  29. ;;; Code:
  30. (require 'xwidget-plus-common)
  31. (require 'xwidget-plus-follow-link)
  32. ;; Bring the window to front when summoning browse
  33. (defun xwidget-plus-webkit-browse-url-advise (&rest _)
  34. "Advice to add switch to window when calling `xwidget-webkit-browse-url'."
  35. (switch-to-buffer-other-window (xwidget-buffer (xwidget-webkit-current-session))))
  36. (advice-add #'xwidget-webkit-browse-url :after #'xwidget-plus-webkit-browse-url-advise)
  37. ;; Local Variables:
  38. ;; eval: (mmm-mode)
  39. ;; eval: (mmm-add-classes '((elisp-js :submode js-mode :face mmm-code-submode-face :delimiter-mode nil :front "--js \"" :back "\" js--")))
  40. ;; mmm-classes: elisp-js
  41. ;; End:
  42. (provide 'xwidget-plus)
  43. ;;; xwidget-plus.el ends here