branch: externals/matlab-mode
commit 1d935b364dd90449a9dfa9a8743e275359096289
Author: John Ciolfi <john.ciolfi...@gmail.com>
Commit: John Ciolfi <john.ciolfi...@gmail.com>

    Remove font-lock-constant-face from help comments
    
    A general guidline for help comments is to capitalize functions such as 
PLOT as references and we
    used to make these a font-lock-constant-face inside of comments. However, 
often capital items are
    not references and make comments look bad, so removed these. Likewise, 
there were other uses of
    font-lock-constant-face that look odd, so removed these.
    
    See https://github.com/mathworks/Emacs-MATLAB-Mode/issues/28
    
    Also removed some older code that was needed before Emacs 20 regarding 
regexp-opt.
---
 matlab.el        | 22 +++-------------------
 tests/fontlock.m |  2 +-
 2 files changed, 4 insertions(+), 20 deletions(-)

diff --git a/matlab.el b/matlab.el
index 9df901a0a0..7772eab202 100644
--- a/matlab.el
+++ b/matlab.el
@@ -888,8 +888,7 @@ Customizing this variable is only useful if `regexp-opt' is 
available."
 (defcustom matlab-debug-list '("dbstop" "dbclear" "dbcont" "dbdown" "dbmex"
                                "dbstack" "dbstatus" "dbstep" "dbtype" "dbup"
                                "dbquit")
-  "List of debug commands used in highlighting.
-Customizing this variable is only useful if `regexp-opt' is available."
+  "List of debug commands used in highlighting."
   :group 'matlab
   :type '(repeat (string :tag "Debug Keyword: ")))
 
@@ -912,12 +911,9 @@ Customizing this variable is only useful if `regexp-opt' 
is available."
   :type '(repeat (string :tag "Debug Keyword: ")))
 
 (defun matlab-font-lock-regexp-opt (keywordlist)
-  "Create a font-lock usable KEYWORDLIST matching regular expression.
-Uses `regex-opt' if available.  Otherwise creates a dumb expression."
+  "Create a font-lock usable KEYWORDLIST matching regular expression."
   (concat "\\_<\\("
-          (if (fboundp 'regexp-opt)
-              (regexp-opt keywordlist)
-            (mapconcat (lambda (s) s) keywordlist "\\|"))
+          (regexp-opt keywordlist)
           "\\)\\_>"))
 
 ;;; Font lock keyword handlers
@@ -1182,18 +1178,6 @@ This matcher will handle a range of variable features."
       1 font-lock-builtin-face)
     ;; highlight transpose
     '("[]A-Za-z0-9_\"})']\\('+\\)" 1 font-lock-builtin-face)
-    ;; How about references in the HELP text.
-    (list (concat "^" matlab-comment-line-s "\\s-*"
-                  "\\(\\([A-Z]+\\s-*=\\s-+\\|\\[[^]]+]\\s-*=\\s-+\\|\\)"
-                  "\\([A-Z][0-9A-Z]+\\)\\(([^)\n]+)\\| \\)\\)")
-          '(1 font-lock-constant-face prepend))
-    (list (concat "^" matlab-comment-line-s "\\s-*"
-                  "See also\\s-+")
-          '("\\([A-Z][A-Z0-9]+\\)\\([,.]\\| and\\|$\\) *" nil  nil
-            (1 font-lock-constant-face prepend)))
-    (list (concat "^" matlab-comment-line-s "\\s-*"
-                  "\\(\\$" "Revision" "[^\n$]+\\$\\)")
-          '(1 font-lock-constant-face prepend))
     ;; Debugging Keywords
     (list (matlab-font-lock-regexp-opt matlab-debug-list)
           '(0 'bold))
diff --git a/tests/fontlock.m b/tests/fontlock.m
index faf884744d..43431782c7 100644
--- a/tests/fontlock.m
+++ b/tests/fontlock.m
@@ -151,7 +151,7 @@ end
 
 function helptest()
 % HELPTEXT has fancy fonts in it.
-%^  ^cn
+%^  ^co
         
 end
 

Reply via email to