[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/org-auto-tangle 70e5e3d131 13/56: move the whole thing int
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/org-auto-tangle 70e5e3d131 13/56: move the whole thing into a minor mode |
Date: |
Mon, 6 Jun 2022 11:58:52 -0400 (EDT) |
branch: elpa/org-auto-tangle
commit 70e5e3d1318c2bf78fbd91df44f311af0e9d4e68
Author: Unknown <domatropic@localhost.localdomain>
Commit: Unknown <domatropic@localhost.localdomain>
move the whole thing into a minor mode
---
org-auto-tangle.el | 27 ++++++++++++---------------
1 file changed, 12 insertions(+), 15 deletions(-)
diff --git a/org-auto-tangle.el b/org-auto-tangle.el
index 781c8452d4..2391f0e925 100644
--- a/org-auto-tangle.el
+++ b/org-auto-tangle.el
@@ -54,11 +54,6 @@
(require 'async)
-(defcustom org-auto-tangle-tangle-on-save t
- "Enables the parsing of auto-tanlge option for org files."
- :type 'boolean
- :group 'auto-tangle)
-
(defun org-auto-tangle-find-value (buffer)
"Search the `auto_tangle' property in BUFFER and extracts it when found."
(with-current-buffer buffer
@@ -84,16 +79,18 @@
(message (concat ,message-string
(format "%s seconds" tangle-time)))))))
-
-
-(add-hook 'org-mode-hook
- (lambda ()
- (when org-auto-tangle-tangle-on-save
- (add-hook 'after-save-hook
- (lambda () (when (and (org-auto-tangle-find-value
(current-buffer))
- (not (string=
(org-auto-tangle-find-value(current-buffer)) "nil")))
- (org-auto-tangle-async
(buffer-file-name))))
- nil 'local))))
+(define-minor-mode org-auto-tangle-mode
+ "Automatically tangle org-mode files with the option #+auto_tangle: t."
+ :lighter "org-auto-tangle"
+
+ (add-hook 'org-mode-hook
+ (lambda ()
+ (when org-auto-tangle-mode
+ (add-hook 'after-save-hook
+ (lambda () (when (and (org-auto-tangle-find-value
(current-buffer))
+ (not (string=
(org-auto-tangle-find-value(current-buffer)) "nil")))
+ (org-auto-tangle-async
(buffer-file-name))))
+ nil 'local)))))
(provide 'org-auto-tangle)
- [nongnu] elpa/org-auto-tangle 5da721fff9 40/56: Update readme to correct grammatical issues., (continued)
- [nongnu] elpa/org-auto-tangle 5da721fff9 40/56: Update readme to correct grammatical issues., ELPA Syncer, 2022/06/06
- [nongnu] elpa/org-auto-tangle fbdd38d11e 55/56: Added Safe-list usage to readme, ELPA Syncer, 2022/06/06
- [nongnu] elpa/org-auto-tangle d3036a040a 12/56: moved the method definations to top level to remove error warnings, ELPA Syncer, 2022/06/06
- [nongnu] elpa/org-auto-tangle 2e4a664210 19/56: moved the anonymous function inside the hooks to a named function, ELPA Syncer, 2022/06/06
- [nongnu] elpa/org-auto-tangle eed3601f4b 25/56: added syntax highlighting and some spelling corrections, ELPA Syncer, 2022/06/06
- [nongnu] elpa/org-auto-tangle ade8d90ecf 34/56: changed quotes for functions with a sharp quote, ELPA Syncer, 2022/06/06
- [nongnu] elpa/org-auto-tangle dc7eb11e6a 45/56: Merge pull request #7 from zzamboni/master, ELPA Syncer, 2022/06/06
- [nongnu] elpa/org-auto-tangle 5d9f2734c9 54/56: Update License.org, ELPA Syncer, 2022/06/06
- [nongnu] elpa/org-auto-tangle cedd4dc41f 46/56: Update org-auto-tangle.el, ELPA Syncer, 2022/06/06
- [nongnu] elpa/org-auto-tangle 6c0786d863 14/56: modified the readme to reflect the changes, ELPA Syncer, 2022/06/06
- [nongnu] elpa/org-auto-tangle 70e5e3d131 13/56: move the whole thing into a minor mode,
ELPA Syncer <=
- [nongnu] elpa/org-auto-tangle 2e97156230 32/56: Merge pull request #2 from kamoii/patch-1, ELPA Syncer, 2022/06/06
- [nongnu] elpa/org-auto-tangle be9007a23a 43/56: corrected the arguments to org-auto-tangle-find-value function call, ELPA Syncer, 2022/06/06
- [nongnu] elpa/org-auto-tangle cebc4bbf73 44/56: Improve auto_tangle regex, ELPA Syncer, 2022/06/06
- [nongnu] elpa/org-auto-tangle 50292af50d 50/56: Merge pull request #10 from juergenhoetzel/non-essential, ELPA Syncer, 2022/06/06
- [nongnu] elpa/org-auto-tangle aa6afc302f 49/56: Prevent Tramp from prompting for user passwords, ELPA Syncer, 2022/06/06
- [nongnu] elpa/org-auto-tangle ad3c332f06 52/56: Merge pull request #13 from fredericgiquel/babel-evaluation, ELPA Syncer, 2022/06/06
- [nongnu] elpa/org-auto-tangle 8883015f00 09/56: fixed Emacs references by using M-x-checkdoc, ELPA Syncer, 2022/06/06
- [nongnu] elpa/org-auto-tangle 15884227bb 16/56: got it working again by moving the hook to inner block, ELPA Syncer, 2022/06/06
- [nongnu] elpa/org-auto-tangle b9c28533ee 21/56: added a remove-hook if org-auto-tangle-mode is nil, ELPA Syncer, 2022/06/06
- [nongnu] elpa/org-auto-tangle c593c5d028 28/56: added local to remove hook, ELPA Syncer, 2022/06/06