[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] feature/new-tutorial 1a25246 03/10: Support saving org-mod
From: |
Phillip Lord |
Subject: |
[Emacs-diffs] feature/new-tutorial 1a25246 03/10: Support saving org-mode tutorial |
Date: |
Thu, 18 May 2017 05:18:52 -0400 (EDT) |
branch: feature/new-tutorial
commit 1a252468d329a6b9a1d6ff687faf8c88d2d64cd1
Author: Phillip Lord <address@hidden>
Commit: Phillip Lord <address@hidden>
Support saving org-mode tutorial
---
lisp/tutorial.el | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/lisp/tutorial.el b/lisp/tutorial.el
index 785dbdf..c1e8c30 100644
--- a/lisp/tutorial.el
+++ b/lisp/tutorial.el
@@ -627,13 +627,15 @@ with some explanatory links."
"Directory to which tutorials are saved."
(locate-user-emacs-file "tutorial/"))
-(defun tutorial--saved-file ()
+(defun tutorial--saved-file (type)
"File name in which to save tutorials."
(let ((file-name tutorial--lang)
(ext (file-name-extension tutorial--lang)))
- (when (or (not ext)
- (string= ext ""))
- (setq file-name (concat file-name ".tut")))
+ (if (eq type 'org)
+ (setq file-name (concat file-name ".org"))
+ (when (or (not ext)
+ (string= ext ""))
+ (setq file-name (concat file-name ".tut"))))
(expand-file-name file-name (tutorial--saved-dir))))
(defun tutorial--remove-remarks ()
@@ -769,7 +771,13 @@ Run the Viper tutorial? "))
((get-language-info current-language-environment 'tutorial)
current-language-environment)
(t "English")))
- (filename (get-language-info lang 'tutorial))
+ (tutorial-type
+ (if (get-language-info lang 'tutorial-org)
+ 'org 'orig))
+ (filename
+ (or
+ (get-language-info lang 'tutorial-org)
+ (get-language-info lang 'tutorial)))
(tut-buf-name filename)
(old-tut-buf (get-buffer tut-buf-name))
(old-tut-win (when old-tut-buf (get-buffer-window old-tut-buf t)))
@@ -805,10 +813,11 @@ Run the Viper tutorial? "))
;; (unless old-tut-buf (text-mode))
(unless lang (error "Variable lang is nil"))
(setq tutorial--lang lang)
- (setq old-tut-file (file-exists-p (tutorial--saved-file)))
+ (setq old-tut-file (file-exists-p (tutorial--saved-file
tutorial-type)))
(let ((inhibit-read-only t))
(erase-buffer))
- (message "Preparing tutorial ...") (sit-for 0)
+ (message "Preparing tutorial ...")
+ (sit-for 0)
;; Do not associate the tutorial buffer with a file. Instead use
;; a hook to save it when the buffer is killed.
- [Emacs-diffs] branch feature/new-tutorial created (now 7812f5e), Phillip Lord, 2017/05/18
- [Emacs-diffs] feature/new-tutorial a780687 02/10: Move tutorial.org to correct location, Phillip Lord, 2017/05/18
- [Emacs-diffs] feature/new-tutorial 7812f5e 10/10: Add images, Phillip Lord, 2017/05/18
- [Emacs-diffs] feature/new-tutorial 1a25246 03/10: Support saving org-mode tutorial,
Phillip Lord <=
- [Emacs-diffs] feature/new-tutorial 2367af9 06/10: First org-mode tutorial, Phillip Lord, 2017/05/18
- [Emacs-diffs] feature/new-tutorial 2a7e4ee 07/10: Make tutorial read-only, Phillip Lord, 2017/05/18
- [Emacs-diffs] feature/new-tutorial 353fc5f 09/10: Update branch notes, Phillip Lord, 2017/05/18
- [Emacs-diffs] feature/new-tutorial d37b299 05/10: Add tutorial-org, refactor tutorial, and lots of supporting changes., Phillip Lord, 2017/05/18
- [Emacs-diffs] feature/new-tutorial 1979beb 01/10: Commit, Phillip Lord, 2017/05/18
- [Emacs-diffs] feature/new-tutorial 4a9a824 08/10: Refill tutorial, Phillip Lord, 2017/05/18
- [Emacs-diffs] feature/new-tutorial 1f5d3b7 04/10: Add test framework, Phillip Lord, 2017/05/18