[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 153/352: Siirretään ajastimen käynnistys ja sammutus omiin funkt
From: |
Stefan Monnier |
Subject: |
[elpa] 153/352: Siirretään ajastimen käynnistys ja sammutus omiin funktioihinsa |
Date: |
Mon, 07 Jul 2014 14:03:26 +0000 |
monnier pushed a commit to branch master
in repository elpa.
commit a5a30ebd843e624f02472cfbb94c64c230391e42
Author: Teemu Likonen <address@hidden>
Date: Fri Mar 12 08:28:45 2010 +0000
Siirretään ajastimen käynnistys ja sammutus omiin funktioihinsa
---
wcheck-mode.el | 31 ++++++++++++++++++++-----------
1 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/wcheck-mode.el b/wcheck-mode.el
index cca70a9..1642b47 100644
--- a/wcheck-mode.el
+++ b/wcheck-mode.el
@@ -470,13 +470,9 @@ or skip in a buffer."
;; Add this buffer to buffer database.
(wcheck-update-buffer-data (current-buffer) wcheck-language)
- ;; Start idle timer if it's not already started. The timer runs
- ;; a function which updates buffers which have requested for
- ;; that.
- (unless wcheck-timer
- (setq wcheck-timer
- (run-with-idle-timer wcheck-timer-idle t
- #'wcheck-timer-read-event)))
+ ;; Ensure that the idle timer is running. The timer runs a
+ ;; function which updates buffers which have requested for that.
+ (wcheck-timer-start)
;; Request update for this buffer.
(wcheck-timer-add-read-request (current-buffer))))
@@ -492,10 +488,8 @@ or skip in a buffer."
;; If there are no buffers using wcheck-mode anymore, stop the idle
;; timer and remove global hooks.
(when (null (wcheck-get-all-data :buffer))
- (wcheck-remove-global-hooks)
- (when wcheck-timer
- (cancel-timer wcheck-timer)
- (setq wcheck-timer nil)))
+ (wcheck-timer-stop)
+ (wcheck-remove-global-hooks))
;; Remove buffer-local hooks.
(wcheck-remove-local-hooks (current-buffer))))
@@ -505,6 +499,21 @@ or skip in a buffer."
;;; Timers
+(defun wcheck-timer-start ()
+ "Start `wcheck-mode' idle timer if it's not running already."
+ (unless wcheck-timer
+ (setq wcheck-timer
+ (run-with-idle-timer wcheck-timer-idle t
+ #'wcheck-timer-read-event))))
+
+
+(defun wcheck-timer-stop ()
+ "Stop `wcheck-mode' idle timer."
+ (when wcheck-timer
+ (cancel-timer wcheck-timer)
+ (setq wcheck-timer nil)))
+
+
(defun wcheck-timer-add-read-request (buffer)
(add-to-list 'wcheck-timer-read-requested buffer))
(defun wcheck-timer-remove-read-request (buffer)
- [elpa] 293/352: Remove duplicate word "function" from doc string, (continued)
- [elpa] 293/352: Remove duplicate word "function" from doc string, Stefan Monnier, 2014/07/07
- [elpa] 324/352: Leave author and timestamp out from exported README.org, Stefan Monnier, 2014/07/07
- [elpa] 294/352: Put case-fold in language options rather than email parser function, Stefan Monnier, 2014/07/07
- [elpa] 206/352: Käsitellään oikolukuehdotusten virheet toisella tavalla, Stefan Monnier, 2014/07/07
- [elpa] 347/352: Add elpa pkg file to the repository (version 2014.5.17), Stefan Monnier, 2014/07/07
- [elpa] 178/352: Käytetään Emacs Lisp -tiedostojen vakiintuneita otsakkeita, Stefan Monnier, 2014/07/07
- [elpa] 315/352: Update copyright year to 2013, Stefan Monnier, 2014/07/07
- [elpa] 154/352: Optimoidaan hieman funktiota wcheck-collect-faces, Stefan Monnier, 2014/07/07
- [elpa] 165/352: Lisätään autoload-vihje funktiolle wcheck-spelling-suggestions, Stefan Monnier, 2014/07/07
- [elpa] 242/352: New feature: call custom functions from suggestion menu, Stefan Monnier, 2014/07/07
- [elpa] 153/352: Siirretään ajastimen käynnistys ja sammutus omiin funktioihinsa,
Stefan Monnier <=
- [elpa] 295/352: Minor README formatting, Stefan Monnier, 2014/07/07
- [elpa] 343/352: Delete obsolete variable wcheck-read-or-skip-faces, Stefan Monnier, 2014/07/07
- [elpa] 204/352: Siirretään makrojen määritykset samaan paikkaan, Stefan Monnier, 2014/07/07
- [elpa] 341/352: Remove "see examples below" from the doc string of wcheck-language-data, Stefan Monnier, 2014/07/07
- [elpa] 326/352: Rephrase README.org file (FIXME and email examples), Stefan Monnier, 2014/07/07
- [elpa] 346/352: Adjust Makefile, Stefan Monnier, 2014/07/07
- [elpa] 217/352: Muutetaan hylätyn korjausehdotusvalinnan virheilmoitusta, Stefan Monnier, 2014/07/07
- [elpa] 316/352: Version 2013.04.07, Stefan Monnier, 2014/07/07
- [elpa] 336/352: Drop the .org suffix from README (mentioned doc string), Stefan Monnier, 2014/07/07
- [elpa] 319/352: Change docstring Github URL to the wcheck-mode's main page, Stefan Monnier, 2014/07/07