]> git.eshelyaron.com Git - emacs.git/commitdiff
* progmodes/octave.el (inferior-octave-error-regexp-alist)
authorLeo Liu <sdl.web@gmail.com>
Fri, 4 Oct 2013 09:45:25 +0000 (17:45 +0800)
committerLeo Liu <sdl.web@gmail.com>
Fri, 4 Oct 2013 09:45:25 +0000 (17:45 +0800)
(inferior-octave-compilation-font-lock-keywords): New variables.
(compilation-error-regexp-alist)
(compilation-mode-font-lock-keywords): Defvar to pacify compiler.
(inferior-octave-mode): Use compilation-shell-minor-mode.

lisp/ChangeLog
lisp/progmodes/octave.el

index b2bd9900ac3b4329696a951c95689f72d0e42a0b..a8f2776d49a6d3bc86266d58feabf6222d43cc71 100644 (file)
@@ -1,3 +1,11 @@
+2013-10-04  Leo Liu  <sdl.web@gmail.com>
+
+       * progmodes/octave.el (inferior-octave-error-regexp-alist)
+       (inferior-octave-compilation-font-lock-keywords): New variables.
+       (compilation-error-regexp-alist)
+       (compilation-mode-font-lock-keywords): Defvar to pacify compiler.
+       (inferior-octave-mode): Use compilation-shell-minor-mode.
+
 2013-10-04  Jorgen Schaefer  <forcer@forcix.cx>
 
        * minibuffer.el (completion--replace): Be careful that `end' might be
index 51cee8b2989116b6a869ee79f605e0a969f4989a..ec48f75dd6874884df3a353e9be7d3c99bebdf89 100644 (file)
@@ -631,6 +631,24 @@ mode, include \"-q\" and \"--traditional\"."
   :type 'hook
   :group 'octave)
 
+(defcustom inferior-octave-error-regexp-alist
+  '(("error:\\s-*\\(.*?\\) at line \\([0-9]+\\), column \\([0-9]+\\)"
+     1 2 3 2 1)
+    ("warning:\\s-*\\([^:\n]+\\):.*at line \\([0-9]+\\), column \\([0-9]+\\)"
+     1 2 3 1 1))
+  "Value for `compilation-error-regexp-alist' in inferior octave."
+  :type '(repeat (choice (symbol :tag "Predefined symbol")
+                         (sexp :tag "Error specification")))
+  :group 'octave)
+
+(defvar inferior-octave-compilation-font-lock-keywords
+  '(("\\_<PASS\\_>" . compilation-info-face)
+    ("\\_<FAIL\\_>" . compilation-error-face)
+    ("\\_<\\(warning\\):" 1 compilation-warning-face)
+    ("\\_<\\(error\\):" 1 compilation-error-face)
+    ("^\\s-*!!!!!.*\\|^.*failed$" . compilation-error-face))
+  "Value for `compilation-mode-font-lock-keywords' in inferior octave.")
+
 (defvar inferior-octave-process nil)
 
 (defvar inferior-octave-mode-map
@@ -673,6 +691,8 @@ This variable is used to initialize `comint-dynamic-complete-functions'
 in the Inferior Octave buffer.")
 
 (defvar info-lookup-mode)
+(defvar compilation-error-regexp-alist)
+(defvar compilation-mode-font-lock-keywords)
 
 (define-derived-mode inferior-octave-mode comint-mode "Inferior Octave"
   "Major mode for interacting with an inferior Octave process."
@@ -698,10 +718,14 @@ in the Inferior Octave buffer.")
   (setq-local comint-prompt-read-only inferior-octave-prompt-read-only)
   (add-hook 'comint-input-filter-functions
             'inferior-octave-directory-tracker nil t)
+  (comint-read-input-ring t)
   ;; http://thread.gmane.org/gmane.comp.gnu.octave.general/48572
   (add-hook 'window-configuration-change-hook
             'inferior-octave-track-window-width-change nil t)
-  (comint-read-input-ring t))
+  (setq-local compilation-error-regexp-alist inferior-octave-error-regexp-alist)
+  (setq-local compilation-mode-font-lock-keywords
+              inferior-octave-compilation-font-lock-keywords)
+  (compilation-shell-minor-mode 1))
 
 ;;;###autoload
 (defun inferior-octave (&optional arg)