[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master ea1ec0e 03/12: Improve docstrings of thread-list fu
From: |
Gemini Lasswell |
Subject: |
[Emacs-diffs] master ea1ec0e 03/12: Improve docstrings of thread-list functions |
Date: |
Sun, 9 Sep 2018 11:31:40 -0400 (EDT) |
branch: master
commit ea1ec0ed2e6ebbd4650aa5a7d662f2568f1d858f
Author: Gemini Lasswell <address@hidden>
Commit: Gemini Lasswell <address@hidden>
Improve docstrings of thread-list functions
* lisp/thread.el (thread-list--timer-func): Change
argument from 'buf' to 'buffer'.
(thread-list--get-entries, thread-list--get-status): Improve
docstring.
(thread-list--send-signal): Change argument from 'sgnl' to
'signal'. Tell the user when the thread is no longer alive.
---
lisp/thread.el | 33 +++++++++++++++++----------------
1 file changed, 17 insertions(+), 16 deletions(-)
diff --git a/lisp/thread.el b/lisp/thread.el
index cb1e772..c4a4c11 100644
--- a/lisp/thread.el
+++ b/lisp/thread.el
@@ -90,16 +90,16 @@ An EVENT has the format
;; doing. Kids, don't try this at home!
;;;###autoload (put 'list-threads 'disabled "Beware: manually canceling
threads can ruin your Emacs session.")
-(defun thread-list--timer-func (buf)
- "Revert BUF and set a timer to do it again."
- (when (buffer-live-p buf)
- (with-current-buffer buf
+(defun thread-list--timer-func (buffer)
+ "Revert BUFFER and set a timer to do it again."
+ (when (buffer-live-p buffer)
+ (with-current-buffer buffer
(revert-buffer))
(run-at-time thread-list-refresh-seconds nil
- #'thread-list--timer-func buf)))
+ #'thread-list--timer-func buffer)))
(defun thread-list--get-entries ()
- "Return tabulated list entries for the threads currently active."
+ "Return tabulated list entries for the currently live threads."
(let (entries)
(dolist (thread (all-threads))
(pcase-let ((`(,status ,blocker) (thread-list--get-status thread)))
@@ -112,9 +112,8 @@ An EVENT has the format
(defun thread-list--get-status (thread)
"Describe the status of THREAD.
-Return a list of two strings, the first describing THREAD's
-status and the second describing what it is blocked on if it is
-blocked."
+Return a list of two strings, one describing THREAD's status, the
+other describing THREAD's blocker, if any."
(cond
((not (thread-alive-p thread)) '("Finished" ""))
((eq thread (current-thread)) '("Running" ""))
@@ -132,14 +131,16 @@ blocked."
(interactive)
(thread-list--send-signal 'error))
-(defun thread-list--send-signal (sgnl)
- "Send the signal SGNL to the thread at point.
-Confirm with the user first."
+(defun thread-list--send-signal (signal)
+ "Send the specified SIGNAL to the thread at point.
+Ask for user confirmation before signaling the thread."
(let ((thread (tabulated-list-get-id)))
- (when (and (threadp thread) (thread-alive-p thread))
- (when (y-or-n-p (format "Send %s signal to %s? " sgnl thread))
- (when (and (threadp thread) (thread-alive-p thread))
- (thread-signal thread sgnl nil))))))
+ (if (and (threadp thread) (thread-alive-p thread))
+ (when (y-or-n-p (format "Send %s signal to %s? " signal thread))
+ (if (and (threadp thread) (thread-alive-p thread))
+ (thread-signal thread signal nil)
+ (message "This thread is no longer alive")))
+ (message "This thread is no longer alive"))))
(provide 'thread)
;;; thread.el ends here
- [Emacs-diffs] master a133b1f 01/12: Add list-threads command and thread-list-mode, (continued)
- [Emacs-diffs] master a133b1f 01/12: Add list-threads command and thread-list-mode, Gemini Lasswell, 2018/09/09
- [Emacs-diffs] master a704bad 12/12: Merge branch 'scratch/list-threads', Gemini Lasswell, 2018/09/09
- [Emacs-diffs] master 8adc0e5 10/12: Improve documentation of thread list buffer, Gemini Lasswell, 2018/09/09
- [Emacs-diffs] master b7719f0 11/12: Use thread-live-p instead of obsolete thread-alive-p, Gemini Lasswell, 2018/09/09
- [Emacs-diffs] master e19ca77 07/12: Document list-threads and its buffer, Gemini Lasswell, 2018/09/09
- [Emacs-diffs] master 2f5a65a 09/12: Add tests for list-threads and the *Threads* buffer, Gemini Lasswell, 2018/09/09
- [Emacs-diffs] master 703b1cf 08/12: Add check in list-threads for --without-threads configuration, Gemini Lasswell, 2018/09/09
- [Emacs-diffs] master 3fb8f30 06/12: Show backtraces of threads from thread list buffer, Gemini Lasswell, 2018/09/09
- [Emacs-diffs] master dc5c76c 05/12: Make small fixes to Edebug and debugger documentation, Gemini Lasswell, 2018/09/09
- [Emacs-diffs] master bdba72b 04/12: Make list-threads refresh the *Threads* buffer if it already exists, Gemini Lasswell, 2018/09/09
- [Emacs-diffs] master ea1ec0e 03/12: Improve docstrings of thread-list functions,
Gemini Lasswell <=
- [Emacs-diffs] master 3ca82c5 02/12: Make lisp/thread.el the new home for thread-related Lisp functions, Gemini Lasswell, 2018/09/09