Description: Autogenerated patch header for a single-debian-patch file.
 The delta against upstream is either kept as a single patch, or maintained
 in some VCS, and exported as a single patch instead of more manageable
 atomic patches.
Forwarded: not-needed

---
--- vala-mode-el-0.1.orig/vala-mode.el
+++ vala-mode-el-0.1/vala-mode.el
@@ -1,11 +1,11 @@
-;;; vala-mode.el --- Vala mode derived mode
+;;; vala-mode.el --- Vala mode derived mode -*- lexical-binding: t -*-
 
 ;; Author:     2005 Dylan R. E. Moonfire
 ;;	       2008 Étienne BERSAC
 ;; Maintainer: Étienne BERSAC <bersace03@laposte.net>
 ;; Modifier:   Kentaro NAKAZAWA <kentaro.nakazawa@nifty.com>
 ;; Created:    2008 May the 4th
-;; Modified:   April 2011
+;; Modified:   2018/2/6
 ;; Version:    0.1
 ;; Keywords:   vala languages oop
 
@@ -46,8 +46,11 @@
 ;;	0.1	: Initial version based on csharp-mode
 ;;
 
+(require 'cl)
+
 ;; This is a copy of the function in cc-mode which is used to handle
 ;; the eval-when-compile which is needed during other times.
+(require 'cc-defs)
 (defun c-filter-ops (ops opgroup-filter op-filter &optional xlate)
   ;; See cc-langs.el, a direct copy.
   (unless (listp (car-safe ops))
@@ -55,13 +58,15 @@
   (cond ((eq opgroup-filter t)
 	 (setq opgroup-filter (lambda (opgroup) t)))
 	((not (functionp opgroup-filter))
-	 (setq opgroup-filter `(lambda (opgroup)
-				 (memq opgroup ',opgroup-filter)))))
+	 (let ((opgroup-filter-orig opgroup-filter))
+	   (setq opgroup-filter (lambda (opgroup)
+				  (memq opgroup opgroup-filter-orig))))))
   (cond ((eq op-filter t)
 	 (setq op-filter (lambda (op) t)))
 	((stringp op-filter)
-	 (setq op-filter `(lambda (op)
-			    (string-match ,op-filter op)))))
+	 (let ((op-filter-orig op-filter))
+	   (setq op-filter (lambda (op)
+			     (string-match op-filter-orig op))))))
   (unless xlate
     (setq xlate 'identity))
   (c-with-syntax-table (c-lang-const c-mode-syntax-table)
@@ -116,6 +121,16 @@
   vala (if (c-lang-const c-opt-identifier-concat-key)
 	   (c-lang-const c-symbol-start)))
 
+(c-lang-defconst c-make-top-level-kwds
+  "Keywords which make declarations they introduce be handled as top-level."
+  t    nil
+  vala '("extern"))
+
+(c-lang-defconst c-make-top-level-key
+  ;; A regexp which matches any `c-make-top-level-kwds' keyword.
+  t (c-make-keywords-re t (c-lang-const c-make-top-level-kwds)))
+(c-lang-defvar c-make-top-level-key (c-lang-const c-make-top-level-key))
+
 (c-lang-defconst c-basic-matchers-before
   vala `(
 ;;;; Font-lock the attributes by searching for the
@@ -149,22 +164,20 @@
 	 ;; Fontify leading identifiers in fully
 	 ;; qualified names like "Foo.Bar".
 	 ,@(when (c-lang-const c-opt-identifier-concat-key)
-	     `((,(byte-compile
-		  `(lambda (limit)
-		     (while (re-search-forward
-			     ,(concat "\\(\\<" ; 1
-				      "\\(" (c-lang-const c-symbol-key)
-				      "\\)" ; 2
-				      "[ \t\n\r\f\v]*"
-				      (c-lang-const
-				       c-opt-identifier-concat-key)
-				      "[ \t\n\r\f\v]*"
-				      "\\)"
-				      "\\("
-				      (c-lang-const
-				       c-opt-after-id-concat-key)
-				      "\\)")
-			     limit t)
+	     (let ((regexp (concat "\\(\\<" ; 1
+				   "\\(" (c-lang-const c-symbol-key)
+				   "\\)" ; 2
+				   "[ \t\n\r\f\v]*"
+				   (c-lang-const
+				    c-opt-identifier-concat-key)
+				   "[ \t\n\r\f\v]*"
+				   "\\)"
+				   "\\("
+				   (c-lang-const
+				    c-opt-after-id-concat-key)
+				   "\\)")))
+	       `((,(lambda (limit)
+		     (while (re-search-forward regexp limit t)
 		       (unless (progn
 				 (goto-char (match-beginning 0))
 				 (c-skip-comments-and-strings limit))
@@ -340,10 +353,6 @@
 ;;		  ;; irrelevant menu alternatives.
 ;;		  (cons "Vala" (c-lang-const c-mode-menu vala)))
 
-;;; Autoload mode trigger
-(add-to-list 'auto-mode-alist '("\\.vala$" . vala-mode))
-(add-to-list 'auto-mode-alist '("\\.vapi$" . vala-mode))
-
 ;; Custom variables
 (defcustom vala-mode-hook nil
   "*Hook called by `vala-mode'."
@@ -393,6 +402,23 @@ Key bindings:
   (run-hooks 'vala-mode-hook)
   (c-update-modeline))
 
+;;; mode trigger
+;;;###autoload
+(add-to-list 'auto-mode-alist '("\\.vala$" . vala-mode))
+;;;###autoload
+(add-to-list 'auto-mode-alist '("\\.vapi$" . vala-mode))
+
+;;;###autoload
+(add-to-list 'file-coding-system-alist '("\\.vala$" . utf-8))
+;;;###autoload
+(add-to-list 'file-coding-system-alist '("\\.vapi$" . utf-8))
+
+;; Use C# semantics when ECB and CEDET are both installed:
+;;;###autoload
+(when (and (file-exists-p "/usr/share/emacs/site-lisp/ecb/ecb.el")
+	       (fboundp 'wisent-csharp-default-setup))
+  (add-hook 'vala-mode-hook #'wisent-csharp-default-setup))
+
 (provide 'vala-mode)
 
 ;;; vala-mode.el ends here
