[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/fountain-mode 735561a 15/17: Change scene heading compl
From: |
Paul Rankin |
Subject: |
[elpa] externals/fountain-mode 735561a 15/17: Change scene heading completion to location/suffix completion |
Date: |
Sun, 19 May 2019 09:56:00 -0400 (EDT) |
branch: externals/fountain-mode
commit 735561a282510c15b0a021b31367dcf4023a5e2c
Author: Paul W. Rankin <address@hidden>
Commit: Paul W. Rankin <address@hidden>
Change scene heading completion to location/suffix completion
---
fountain-mode.el | 34 ++++++++++++++++++++--------------
1 file changed, 20 insertions(+), 14 deletions(-)
diff --git a/fountain-mode.el b/fountain-mode.el
index 7974ec3..f249eac 100644
--- a/fountain-mode.el
+++ b/fountain-mode.el
@@ -579,16 +579,22 @@ Requires `fountain-match-scene-heading' for preceding
blank line.")
(defcustom fountain-scene-heading-suffix-sep
" - "
- "String separating scene heading location from suffix."
+ "String separating scene heading location from suffix.
+
+WARNING: If you change this any existing scene headings will no
+longer be parsed correctly."
:type 'string
:safe 'string
:set #'fountain--set-and-refresh-all-font-lock)
(defcustom fountain-scene-heading-suffix-list
- '("DAY" "NIGHT" "LATER" "MOMENTS LATER" "CONTINUOUS")
+ '("DAY" "NIGHT" "CONTINUOUS" "LATER" "MOMENTS LATER")
"List of scene heading suffixes (case insensitive).
-These are separated from scene heading locations with
+These are only used for auto-completion. Any scene headings can
+have whatever suffix you like.
+
+Separated from scene heading locations with
`fountain-scene-heading-suffix-sep'."
:type '(repeat (string :tag "Suffix"))
:set #'fountain--set-and-refresh-all-font-lock)
@@ -1246,9 +1252,9 @@ Assumes that all other element matching has been done."
;;; Auto-completion
-(defvar-local fountain-completion-scene-headings
+(defvar-local fountain-completion-locations
nil
- "List of scene headings in the current buffer.")
+ "List of scene locations in the current buffer.")
(defvar-local fountain-completion-characters
nil
@@ -1257,8 +1263,8 @@ Each element is a cons (NAME . OCCUR) where NAME is a
string, and
OCCUR is an integer representing the character's number of
occurrences. ")
-(defun fountain-completion-update-scene-headings (start end &optional length)
- "Update `fountain-completion-scene-headings' between START and END."
+(defun fountain-completion-update-locations (start end &optional length)
+ "Update `fountain-completion-locations' between START and END."
(goto-char end)
(if (fountain-match-scene-heading)
(forward-line)
@@ -1268,13 +1274,13 @@ occurrences. ")
(fountain-forward-scene 0)
(while (< (point) end)
(when (fountain-match-scene-heading)
- (let ((scene-heading (match-string-no-properties 4)))
- (unless (member scene-heading fountain-completion-scene-headings)
- (push scene-heading fountain-completion-scene-headings))))
+ (let ((location (match-string-no-properties 4)))
+ (unless (member location fountain-completion-locations)
+ (push location fountain-completion-locations))))
(fountain-forward-scene 1)))
(defun fountain-completion-update-characters (start end &optional length)
- "Update `fountain-completion-characters' between START and END."
+ "Update `fountain-completion-characters' in current buffer."
(goto-char end)
(if (fountain-match-scene-heading)
(forward-line)
@@ -1358,14 +1364,14 @@ Added to `completion-at-point-functions'."
(list (match-end 3)
(point)
(completion-table-case-fold
- fountain-completion-scene-headings)))
+ fountain-completion-locations)))
((and (fountain-match-scene-heading)
(match-string 1))
;; Return scene location completion (forced)
(list (match-end 1)
(point)
(completion-table-case-fold
- fountain-completion-scene-headings)))
+ fountain-completion-locations)))
((fountain-blank-before-p)
;; Return character completion
(list (line-beginning-position)
@@ -1378,7 +1384,7 @@ Added to `completion-at-point-functions'."
Add to `fountain-mode-hook' to have completion upon load."
(interactive)
- (setq fountain-completion-scene-headings nil
+ (setq fountain-completion-locations nil
fountain-completion-characters nil)
(save-excursion
(save-restriction
- [elpa] externals/fountain-mode updated (7d92f6b -> eef014a), Paul Rankin, 2019/05/19
- [elpa] externals/fountain-mode eef014a 17/17: Update README/Commentary/code comments, Paul Rankin, 2019/05/19
- [elpa] externals/fountain-mode 349436a 16/17: Update fountain-dwim to toggle outline/completion-at-point, Paul Rankin, 2019/05/19
- [elpa] externals/fountain-mode 51d3e39 14/17: Fix scene heading regexp grouping for scene numbers, Paul Rankin, 2019/05/19
- [elpa] externals/fountain-mode f12e7f0 13/17: Improve completion for scene headings, Paul Rankin, 2019/05/19
- [elpa] externals/fountain-mode c1a01e3 12/17: Remove old page-count vars/options, Paul Rankin, 2019/05/19
- [elpa] externals/fountain-mode 735561a 15/17: Change scene heading completion to location/suffix completion,
Paul Rankin <=
- [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, 2019/05/19