1b6cee71dSXin LI 2b6cee71dSXin LI#------------------------------------------------------------------------------ 3*3e41d09dSXin LI# $File: lisp,v 1.24 2015/11/30 20:54:26 christos Exp $ 4b6cee71dSXin LI# lisp: file(1) magic for lisp programs 5b6cee71dSXin LI# 6b6cee71dSXin LI# various lisp types, from Daniel Quinlan (quinlan@yggdrasil.com) 7b6cee71dSXin LI 8b6cee71dSXin LI# updated by Joerg Jenderek 9b6cee71dSXin LI# GRR: This lot is too weak 10b6cee71dSXin LI#0 string ;; 11b6cee71dSXin LI# windows INF files often begin with semicolon and use CRLF as line end 12b6cee71dSXin LI# lisp files are mainly created on unix system with LF as line end 13b6cee71dSXin LI#>2 search/4096 !\r Lisp/Scheme program text 14b6cee71dSXin LI#>2 search/4096 \r Windows INF file 15b6cee71dSXin LI 16b6cee71dSXin LI0 search/4096 (setq\ Lisp/Scheme program text 17b6cee71dSXin LI!:mime text/x-lisp 18b6cee71dSXin LI0 search/4096 (defvar\ Lisp/Scheme program text 19b6cee71dSXin LI!:mime text/x-lisp 20b6cee71dSXin LI0 search/4096 (defparam\ Lisp/Scheme program text 21b6cee71dSXin LI!:mime text/x-lisp 22b6cee71dSXin LI0 search/4096 (defun\ Lisp/Scheme program text 23b6cee71dSXin LI!:mime text/x-lisp 24b6cee71dSXin LI0 search/4096 (autoload\ Lisp/Scheme program text 25b6cee71dSXin LI!:mime text/x-lisp 26b6cee71dSXin LI0 search/4096 (custom-set-variables\ Lisp/Scheme program text 27b6cee71dSXin LI!:mime text/x-lisp 28b6cee71dSXin LI 29*3e41d09dSXin LI# URL: https://en.wikipedia.org/wiki/Emacs_Lisp 30*3e41d09dSXin LI# Reference: http://ftp.gnu.org/old-gnu/emacs/elisp-manual-18-1.03.tar.gz 31*3e41d09dSXin LI# Update: Joerg Jenderek 32b6cee71dSXin LI# Emacs 18 - this is always correct, but not very magical. 33*3e41d09dSXin LI0 string \012( 34*3e41d09dSXin LI# look for emacs lisp keywords 35*3e41d09dSXin LI# GRR: split regex because it is too long or get error like 36*3e41d09dSXin LI# lisp, 36: Warning: cannot get string from `^(defun|defvar|defconst|defmacro|setq|fset|put|provide|require|' 37*3e41d09dSXin LI>&0 regex \^(defun|defvar|defconst|defmacro|setq|fset) Emacs v18 byte-compiled Lisp data 38b6cee71dSXin LI!:mime application/x-elc 39*3e41d09dSXin LI# https://searchcode.com/codesearch/view/2173420/ 40*3e41d09dSXin LI# not really pure text 41*3e41d09dSXin LI!:apple EMAxTEXT 42*3e41d09dSXin LI!:ext elc 43*3e41d09dSXin LI# remaining regex 44*3e41d09dSXin LI>&0 regex \^(put|provide|require|random) Emacs v18 byte-compiled Lisp data 45*3e41d09dSXin LI!:mime application/x-elc 46*3e41d09dSXin LI!:apple EMAxTEXT 47*3e41d09dSXin LI!:ext elc 48*3e41d09dSXin LI# missed cl.elc dbx.elc simple.elc look like normal lisp starting with ;;; 49*3e41d09dSXin LI 50b6cee71dSXin LI# Emacs 19+ - ver. recognition added by Ian Springer 51b6cee71dSXin LI# Also applies to XEmacs 19+ .elc files; could tell them apart with regexs 52b6cee71dSXin LI# - Chris Chittleborough <cchittleborough@yahoo.com.au> 53*3e41d09dSXin LI# Update: Joerg Jenderek 54b6cee71dSXin LI0 string ;ELC 55*3e41d09dSXin LI# version\0\0\0 56*3e41d09dSXin LI>4 byte >18 Emacs/XEmacs v%d byte-compiled Lisp data 57*3e41d09dSXin LI# why less than 32 ? does not make sense to me. GNU Emacs version is 24.5 at April 2015 58*3e41d09dSXin LI#>4 byte <32 Emacs/XEmacs v%d byte-compiled Lisp data 59b6cee71dSXin LI!:mime application/x-elc 60*3e41d09dSXin LI!:apple EMAxTEXT 61*3e41d09dSXin LI!:ext elc 62b6cee71dSXin LI 63b6cee71dSXin LI# Files produced by CLISP Common Lisp From: Bruno Haible <haible@ilog.fr> 64b6cee71dSXin LI0 string (SYSTEM::VERSION\040' CLISP byte-compiled Lisp program (pre 2004-03-27) 65b6cee71dSXin LI0 string (|SYSTEM|::|VERSION|\040' CLISP byte-compiled Lisp program text 66b6cee71dSXin LI 67b6cee71dSXin LI0 long 0x70768BD2 CLISP memory image data 68b6cee71dSXin LI0 long 0xD28B7670 CLISP memory image data, other endian 69b6cee71dSXin LI 70b6cee71dSXin LI#.com and .bin for MIT scheme 71b6cee71dSXin LI0 string \372\372\372\372 MIT scheme (library?) 72b6cee71dSXin LI 73b6cee71dSXin LI# From: David Allouche <david@allouche.net> 74b6cee71dSXin LI0 search/1 \<TeXmacs| TeXmacs document text 75b6cee71dSXin LI!:mime text/texmacs 76