From 46ca8e93c2d222a765b3bdff993e1dc4edf4975e Mon Sep 17 00:00:00 2001 From: Lars Brinkhoff Date: Sat, 11 Apr 2015 19:10:00 +0200 Subject: [PATCH 1/2] New upper-case sample for Common Lisp. --- samples/Common Lisp/hello.lisp | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 samples/Common Lisp/hello.lisp diff --git a/samples/Common Lisp/hello.lisp b/samples/Common Lisp/hello.lisp new file mode 100644 index 00000000..642cdd29 --- /dev/null +++ b/samples/Common Lisp/hello.lisp @@ -0,0 +1,2 @@ +(DEFUN HELLO () + (PRINT 'HELLO)) From 33478b2d238ded92156f0c37d0da820e55ba07b4 Mon Sep 17 00:00:00 2001 From: Lars Brinkhoff Date: Fri, 10 Apr 2015 11:57:39 +0200 Subject: [PATCH 2/2] Make Common Lisp heuristic case insensitive. --- lib/linguist/heuristics.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/linguist/heuristics.rb b/lib/linguist/heuristics.rb index e196e8bf..b1adbd18 100644 --- a/lib/linguist/heuristics.rb +++ b/lib/linguist/heuristics.rb @@ -129,7 +129,7 @@ module Linguist end disambiguate "Common Lisp", "OpenCL", "Cool" do |data| - if data.include?("(defun ") + if /^\s*\((defun|in-package|defpackage) /i.match(data) Language["Common Lisp"] elsif /^class/x.match(data) Language["Cool"] @@ -215,7 +215,7 @@ module Linguist end disambiguate "Common Lisp", "NewLisp" do |data| - if /^\s*\((defun|in-package|defpackage) /.match(data) + if /^\s*\((defun|in-package|defpackage) /i.match(data) Language["Common Lisp"] elsif /^\s*\(define /.match(data) Language["NewLisp"]