diff options
| author | Gemini Lasswell | 2018-08-01 09:22:32 -0700 |
|---|---|---|
| committer | Gemini Lasswell | 2018-09-09 07:41:49 -0700 |
| commit | 3ca82c59de839f9c10318438ecc87f931b8a0208 (patch) | |
| tree | 31b90d02c22f98564e758a98f6ce0897975c5706 | |
| parent | a133b1f7d6a6961cdb59217918ce7f7c106f420e (diff) | |
| download | emacs-3ca82c59de839f9c10318438ecc87f931b8a0208.tar.gz emacs-3ca82c59de839f9c10318438ecc87f931b8a0208.zip | |
Make lisp/thread.el the new home for thread-related Lisp functions
* lisp/emacs-lisp/thread-list.el: Remove.
* lisp/emacs-lisp/thread.el: Remove.
* lisp/thread.el: New file.
| -rw-r--r-- | lisp/emacs-lisp/thread.el | 44 | ||||
| -rw-r--r-- | lisp/thread.el (renamed from lisp/emacs-lisp/thread-list.el) | 25 |
2 files changed, 21 insertions, 48 deletions
diff --git a/lisp/emacs-lisp/thread.el b/lisp/emacs-lisp/thread.el deleted file mode 100644 index 5d7b90c26e9..00000000000 --- a/lisp/emacs-lisp/thread.el +++ /dev/null | |||
| @@ -1,44 +0,0 @@ | |||
| 1 | ;;; thread.el --- List active threads in a buffer -*- lexical-binding: t -*- | ||
| 2 | |||
| 3 | ;; Copyright (C) 2018 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; Author: Gemini Lasswell <gazally@runbox.com> | ||
| 6 | ;; Maintainer: emacs-devel@gnu.org | ||
| 7 | ;; Keywords: lisp, tools, maint | ||
| 8 | |||
| 9 | ;; This file is part of GNU Emacs. | ||
| 10 | |||
| 11 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 12 | ;; it under the terms of the GNU General Public License as published by | ||
| 13 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 14 | ;; (at your option) any later version. | ||
| 15 | |||
| 16 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 17 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 18 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 19 | ;; GNU General Public License for more details. | ||
| 20 | |||
| 21 | ;; You should have received a copy of the GNU General Public License | ||
| 22 | ;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. | ||
| 23 | |||
| 24 | ;;; Commentary: | ||
| 25 | |||
| 26 | ;;; Code: | ||
| 27 | |||
| 28 | ;;;###autoload | ||
| 29 | (defun thread-handle-event (event) | ||
| 30 | "Handle thread events, propagated by `thread-signal'. | ||
| 31 | An EVENT has the format | ||
| 32 | (thread-event THREAD ERROR-SYMBOL DATA)" | ||
| 33 | (interactive "e") | ||
| 34 | (if (and (consp event) | ||
| 35 | (eq (car event) 'thread-event) | ||
| 36 | (= (length event) 4)) | ||
| 37 | (let ((thread (cadr event)) | ||
| 38 | (err (cddr event))) | ||
| 39 | (message "Error %s: %S" thread err)))) | ||
| 40 | |||
| 41 | (make-obsolete 'thread-alive-p 'thread-live-p "27.1") | ||
| 42 | |||
| 43 | (provide 'thread) | ||
| 44 | ;;; thread.el ends here | ||
diff --git a/lisp/emacs-lisp/thread-list.el b/lisp/thread.el index af1177764b8..cb1e7721de9 100644 --- a/lisp/emacs-lisp/thread-list.el +++ b/lisp/thread.el | |||
| @@ -1,10 +1,10 @@ | |||
| 1 | ;;; thread-list.el --- List active threads in a buffer -*- lexical-binding: t -*- | 1 | ;;; thread.el --- Thread support in Emacs Lisp -*- lexical-binding: t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2018 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2018 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Gemini Lasswell <gazally@runbox.com> | 5 | ;; Author: Gemini Lasswell <gazally@runbox.com> |
| 6 | ;; Maintainer: emacs-devel@gnu.org | 6 | ;; Maintainer: emacs-devel@gnu.org |
| 7 | ;; Keywords: lisp, tools, maint | 7 | ;; Keywords: thread, tools |
| 8 | 8 | ||
| 9 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
| 10 | 10 | ||
| @@ -29,6 +29,23 @@ | |||
| 29 | (require 'pcase) | 29 | (require 'pcase) |
| 30 | (require 'subr-x) | 30 | (require 'subr-x) |
| 31 | 31 | ||
| 32 | ;;;###autoload | ||
| 33 | (defun thread-handle-event (event) | ||
| 34 | "Handle thread events, propagated by `thread-signal'. | ||
| 35 | An EVENT has the format | ||
| 36 | (thread-event THREAD ERROR-SYMBOL DATA)" | ||
| 37 | (interactive "e") | ||
| 38 | (if (and (consp event) | ||
| 39 | (eq (car event) 'thread-event) | ||
| 40 | (= (length event) 4)) | ||
| 41 | (let ((thread (cadr event)) | ||
| 42 | (err (cddr event))) | ||
| 43 | (message "Error %s: %S" thread err)))) | ||
| 44 | |||
| 45 | (make-obsolete 'thread-alive-p 'thread-live-p "27.1") | ||
| 46 | |||
| 47 | ;;; The thread list buffer and list-threads command | ||
| 48 | |||
| 32 | (defcustom thread-list-refresh-seconds 0.5 | 49 | (defcustom thread-list-refresh-seconds 0.5 |
| 33 | "Seconds between automatic refreshes of the *Threads* buffer." | 50 | "Seconds between automatic refreshes of the *Threads* buffer." |
| 34 | :group 'thread-list | 51 | :group 'thread-list |
| @@ -124,5 +141,5 @@ Confirm with the user first." | |||
| 124 | (when (and (threadp thread) (thread-alive-p thread)) | 141 | (when (and (threadp thread) (thread-alive-p thread)) |
| 125 | (thread-signal thread sgnl nil)))))) | 142 | (thread-signal thread sgnl nil)))))) |
| 126 | 143 | ||
| 127 | (provide 'thread-list) | 144 | (provide 'thread) |
| 128 | ;;; thread-list.el ends here | 145 | ;;; thread.el ends here |