diff options
| author | Glenn Morris | 2016-01-19 18:06:30 -0500 |
|---|---|---|
| committer | Glenn Morris | 2016-01-19 18:06:30 -0500 |
| commit | b88f4a2c7624362081aca2bc81cc0c5c72b7245d (patch) | |
| tree | 33e88399cf210038385e2fd1d10eeaff7fbdef96 /lisp | |
| parent | 22977b5c51f5c0ffe318fc3cf8a88b7b14983b15 (diff) | |
| download | emacs-b88f4a2c7624362081aca2bc81cc0c5c72b7245d.tar.gz emacs-b88f4a2c7624362081aca2bc81cc0c5c72b7245d.zip | |
Avoid breaking non-xwidget Emacs that happen to load xwidget.el.
* lisp/xwidget.el (window-configuration-change-hook)
(kill-buffer-query-functions): Only modify these hooks if
compiled with xwidget support.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/xwidget.el | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/xwidget.el b/lisp/xwidget.el index 17fcf3dae91..ff3b977ade5 100644 --- a/lisp/xwidget.el +++ b/lisp/xwidget.el | |||
| @@ -571,7 +571,8 @@ It can be retrieved with `(xwidget-get XWIDGET PROPNAME)'." | |||
| 571 | 571 | ||
| 572 | ;; This would have felt better in C, but this seems to work well in | 572 | ;; This would have felt better in C, but this seems to work well in |
| 573 | ;; practice though. | 573 | ;; practice though. |
| 574 | (add-hook 'window-configuration-change-hook 'xwidget-delete-zombies) | 574 | (if (featurep 'xwidget-internal) |
| 575 | (add-hook 'window-configuration-change-hook 'xwidget-delete-zombies)) | ||
| 575 | 576 | ||
| 576 | (defun xwidget-kill-buffer-query-function () | 577 | (defun xwidget-kill-buffer-query-function () |
| 577 | "Ask beforek illing a buffer that has xwidgets." | 578 | "Ask beforek illing a buffer that has xwidgets." |
| @@ -582,7 +583,8 @@ It can be retrieved with `(xwidget-get XWIDGET PROPNAME)'." | |||
| 582 | (format "Buffer %S has xwidgets; kill it? " | 583 | (format "Buffer %S has xwidgets; kill it? " |
| 583 | (buffer-name (current-buffer))))))) | 584 | (buffer-name (current-buffer))))))) |
| 584 | 585 | ||
| 585 | (add-hook 'kill-buffer-query-functions 'xwidget-kill-buffer-query-function) | 586 | (if (featurep 'xwidget-internal) |
| 587 | (add-hook 'kill-buffer-query-functions 'xwidget-kill-buffer-query-function)) | ||
| 586 | 588 | ||
| 587 | (provide 'xwidget) | 589 | (provide 'xwidget) |
| 588 | 590 | ||