From 5345e32b84ed1f84af0475c6ff2d693658e8029d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Lindqvist?= Date: Sat, 2 Jul 2016 15:27:33 +0200 Subject: [PATCH] FUEL: readding factor-method-definition-regex It is needed by the fuel-refactor--def-word function. --- misc/fuel/factor-mode.el | 16 ++++++++-------- misc/fuel/fuel-refactor.el | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/misc/fuel/factor-mode.el b/misc/fuel/factor-mode.el index c810d0d293..938e33a996 100644 --- a/misc/fuel/factor-mode.el +++ b/misc/fuel/factor-mode.el @@ -275,16 +275,17 @@ these lines in your .emacs: (defconst factor-bad-string-regex "\\_<\"[^>]\\([^\"\n]\\|\\\\\"\\)*\n") -(defconst factor-word-starters - '(":" "::" "GENERIC:" "GENERIC#" "DEFER:" "HOOK:" - "MACRO:" "MACRO::" "MATH:" "MEMO:" "MEMO::" - "POSTPONE:" "PRIMITIVE:" "SYNTAX:" "TYPED:" "TYPED::")) - (defconst factor-word-definition-regex (concat - (format "\\_<\\(%s\\)" (regexp-opt factor-word-starters)) + (one-symbol (regexp-opt + '(":" "::" "GENERIC:" "GENERIC#" "DEFER:" "HOOK:" + "MACRO:" "MACRO::" "MATH:" "MEMO:" "MEMO::" + "POSTPONE:" "PRIMITIVE:" "SYNTAX:" "TYPED:" "TYPED::"))) ws+ symbol)) +(defconst factor-method-definition-regex + (syntax-and-2-symbols '("M" "M:" "BEFORE" "AFTER"))) + ;; [parsing-word] [vocab-word] (defconst factor-vocab-ref-regex (syntax-and-1-symbol '("IN" "USE" "QUALIFIED"))) @@ -454,8 +455,7 @@ these lines in your .emacs: (,factor-float-regex . 'factor-font-lock-number) (,factor-ratio-regex . 'factor-font-lock-ratio) ,(factor-syntax factor-type-definition-regex '("P" "T")) - ,(factor-syntax (syntax-and-2-symbols '("M" "M:" "BEFORE" "AFTER")) - '("P" "T" "W")) + ,(factor-syntax factor-method-definition-regex '("P" "T" "W")) ;; Highlights tuple and struct definitions. The TUPLE/STRUCT ;; parsing word, class name and optional parent classes are diff --git a/misc/fuel/fuel-refactor.el b/misc/fuel/fuel-refactor.el index e5e2a50d27..441160636c 100644 --- a/misc/fuel/fuel-refactor.el +++ b/misc/fuel/fuel-refactor.el @@ -213,7 +213,7 @@ The word's body is put in a new method for the generic." (save-excursion (factor-beginning-of-defun) (or (and (looking-at factor-method-definition-regex) - (match-string-no-properties 2)) + (match-string-no-properties 3)) (and (looking-at factor-word-definition-regex) (match-string-no-properties 2)))))