[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/fountain-mode 7ace331 02/17: Remove timer page count an
From: |
Paul Rankin |
Subject: |
[elpa] externals/fountain-mode 7ace331 02/17: Remove timer page count and mode-line alteration |
Date: |
Sun, 19 May 2019 09:55:57 -0400 (EDT) |
branch: externals/fountain-mode
commit 7ace331c29f6ce7e2f0f4b3b1a8bcbf20ea961a6
Author: Paul W. Rankin <address@hidden>
Commit: Paul W. Rankin <address@hidden>
Remove timer page count and mode-line alteration
---
fountain-mode.el | 58 +++++---------------------------------------------------
1 file changed, 5 insertions(+), 53 deletions(-)
diff --git a/fountain-mode.el b/fountain-mode.el
index 8b4b549..3a97a81 100644
--- a/fountain-mode.el
+++ b/fountain-mode.el
@@ -1637,60 +1637,12 @@ number."
(setq current total found t)))
(cons current total)))))
-(defun fountain-count-pages (&optional interactive)
- "Return the approximate current page of total pages in current buffer.
-
-If called interactively, sets INTERACTIVE as non-nil
-unconditionally and prints a message in the echo area."
- (interactive "p")
- (fountain-pages-update-mode-line)
- (redisplay)
+(defun fountain-count-pages ()
+ "Message the current page of total pages in current buffer.
+n.b. This is an approximate calculation."
+ (interactive)
(let ((pages (fountain-get-page-count)))
- (fountain-pages-update-mode-line (car pages) (cdr pages))
- (when interactive
- (message "Page %d of %d" (car pages) (cdr pages)))))
-
-(defun fountain-pages-update-mode-line (&optional current total)
- (setq fountain-page-count-string
- (if fountain-pages-show-in-mode-line
- (if (and current total)
- (format "[%d/%d] " current total)
- "[-/-] ")
- nil))
- (force-mode-line-update))
-
-(defun fountain-count-pages-maybe (&optional force)
- (when (derived-mode-p 'fountain-mode)
- (while-no-input
- (redisplay)
- (cond (force
- (fountain-count-pages))
- ((eq fountain-pages-show-in-mode-line 'timer)
- (fountain-count-pages))
- ((and fountain-page-count-string
- (not fountain-pages-show-in-mode-line))
- (fountain-pages-update-mode-line))))))
-
-(defun fountain-init-mode-line ()
- (let ((tail (cdr (memq 'mode-line-modes mode-line-format))))
- (setq mode-line-format
- (append
- (butlast mode-line-format (length tail))
- (cons 'fountain-page-count-string tail)))))
-
-(defun fountain-cancel-page-count-timer ()
- (when (timerp fountain-page-count-timer)
- (cancel-timer fountain-page-count-timer))
- (setq fountain-page-count-timer nil))
-
-(defun fountain-restart-page-count-timer ()
- (fountain-cancel-page-count-timer)
- (setq fountain-page-count-timer
- ;; FIXME: `fountain-count-pages-maybe' only operates in the "current"
- ;; buffer, but that will be the buffer that happens to be current when
- ;; the timer is run.
- (run-with-idle-timer fountain-pages-count-delay t
- #'fountain-count-pages-maybe)))
+ (message "Page %d of %d" (car pages) (cdr pages))))
;;; Templating
- [elpa] externals/fountain-mode 735561a 15/17: Change scene heading completion to location/suffix completion, (continued)
- [elpa] externals/fountain-mode 735561a 15/17: Change scene heading completion to location/suffix completion, Paul Rankin, 2019/05/19
- [elpa] externals/fountain-mode cb78fc0 11/17: Bind TAB to fountain-dwim, C-c C-o to fountain-include-find-file, Paul Rankin, 2019/05/19
- [elpa] externals/fountain-mode a6a11f8 07/17: Remove fountain page count commands from menu, Paul Rankin, 2019/05/19
- [elpa] externals/fountain-mode 5fd879c 09/17: Neaten up fountain menu, Paul Rankin, 2019/05/19
- [elpa] externals/fountain-mode 6cdcb2d 10/17: Bump version number, Paul Rankin, 2019/05/19
- [elpa] externals/fountain-mode e8a7ecd 08/17: Remove fountain-tab-command from menu, Paul Rankin, 2019/05/19
- [elpa] externals/fountain-mode eb1ae47 06/17: Cleaned up obsolete variable warnings, Paul Rankin, 2019/05/19
- [elpa] externals/fountain-mode d6c367e 05/17: Clean-ups, fixing fountain-scene-numbers group, Paul Rankin, 2019/05/19
- [elpa] externals/fountain-mode 459bd14 04/17: Remove --edit-line funcs, Paul Rankin, 2019/05/19
- [elpa] externals/fountain-mode 0a202b8 03/17: Remove fountain-auto-upcase-highlight face, Paul Rankin, 2019/05/19
- [elpa] externals/fountain-mode 7ace331 02/17: Remove timer page count and mode-line alteration,
Paul Rankin <=
- [elpa] externals/fountain-mode ea6f03b 01/17: Remove background functions & feature creep, Paul Rankin, 2019/05/19