[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/org-superstar ca448ebd7c 065/162: Added a temporary file s
From: |
Stefan Kangas |
Subject: |
[nongnu] elpa/org-superstar ca448ebd7c 065/162: Added a temporary file slomode.el |
Date: |
Fri, 31 Dec 2021 19:35:26 -0500 (EST) |
branch: elpa/org-superstar
commit ca448ebd7cbe8b82dae72d76a6190f194f05d4b8
Author: D. Williams <d.williams@posteo.net>
Commit: D. Williams <d.williams@posteo.net>
Added a temporary file slomode.el
This file serves as a working example for the Issue discussed here:
https://github.com/integral-dw/org-superstar-mode/issues/3
---
tests/slomode.el | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 59 insertions(+)
diff --git a/tests/slomode.el b/tests/slomode.el
new file mode 100644
index 0000000000..3dd8c3af02
--- /dev/null
+++ b/tests/slomode.el
@@ -0,0 +1,59 @@
+;; this is a temporary file for testing slowdown issues.
+;; edit the variable test-case to 1,2 or 3, then run:
+;; emacs -Q -l slomode-redux-1.el <your sample file>
+;; start the test with ‘M-x slo-mode’.
+(require 'org)
+
+(defvar test-case 1
+ "Check one of several plausible test cases.")
+
+(setq inhibit-compacting-font-caches nil)
+
+(cond ((= test-case 1)
+ ;; same as 2 and 3 combined
+ (defun slo-compose ()
+ (compose-region (match-beginning 1) (match-end 1) ?◉)
+ 'slo-face))
+ ((= test-case 2)
+ (defun slo-compose ()
+ 'slo-face))
+ ((= test-case 3)
+ (defun slo-compose ()
+ (compose-region (match-beginning 1) (match-end 1) ?◉)
+ nil)))
+
+(defface slo-face '((default . nil)) "Sloface")
+
+(defvar slo-keywords
+ '(("^\\**\\(?1:\\*\\) "
+ (1 (slo-compose) prepend))))
+
+(defun slo-fontify-buffer ()
+ "Fontify the buffer."
+ (when font-lock-mode
+ (save-restriction
+ (widen)
+ (font-lock-ensure)
+ (font-lock-flush))))
+
+(defun un-slo ()
+ (save-excursion
+ (goto-char (point-min))
+ (while (re-search-forward "^\\*+ " nil t)
+ (decompose-region (match-beginning 0) (match-end 0)))))
+
+
+;;; Mode commands
+;;;###autoload
+(define-minor-mode slo-mode
+ "Try and slow down the buffer."
+ nil " Slo" nil
+ (cond
+ (slo-mode
+ (font-lock-add-keywords nil slo-keywords
+ 'append)
+ (slo-fontify-buffer))
+ (t
+ (font-lock-remove-keywords nil slo-keywords)
+ (un-slo)
+ (slo-fontify-buffer))))
- [nongnu] elpa/org-superstar e668df215c 016/162: Major cleanup: fixing inconsistencies spotted by flycheck, (continued)
- [nongnu] elpa/org-superstar e668df215c 016/162: Major cleanup: fixing inconsistencies spotted by flycheck, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 7c693b1326 020/162: Added proper terminal support., Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 8daeb3c4f3 040/162: added further reference files, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar f4ef9bb36d 017/162: added a roadmap., Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar ffaf1feb01 018/162: added mention of worg contrib in order not to forget myself, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 9a60ffc4cc 058/162: Removing warning from source., Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar bce708624d 039/162: updated composure-test to run with new unit tests, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar f5a258d524 057/162: Remove warnings from README., Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar f7cb51960e 029/162: added FIXME: other-hbullet face behaves inconsistently when treated as leading bullet., Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar a2876d7399 045/162: fixed bug in external module 'honest-marketing', Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar ca448ebd7c 065/162: Added a temporary file slomode.el,
Stefan Kangas <=
- [nongnu] elpa/org-superstar 98bba637cd 078/162: removing old bullet point, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 22a44f14ee 026/162: overhauled testing module composure-test.el, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 589b136106 064/162: updating homepage., Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar a0d2cfaae1 076/162: "org-mode" -> "Org mode", Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 4500a774bb 068/162: Added an FAQ., Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar a078ca392a 079/162: Remove unnecessary lighter for Org Superstar., Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 369292856e 042/162: reduced minimal-setup, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 3818dff655 006/162: Completed first draft of README., Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 3bbb8e551c 011/162: updating gitignore to correctly handle temp files, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar d9accdcad7 002/162: Added README, Stefan Kangas, 2021/12/31