]> crepu.dev Git - config.git/blob - djavu-asus/emacs/elpa/company-20230926.32/company-keywords.el
57ec28d692b9317c991921ab11d7ee86163e8433
[config.git] / djavu-asus / emacs / elpa / company-20230926.32 / company-keywords.el
1 ;;; company-keywords.el --- A company backend for programming language keywords
2
3 ;; Copyright (C) 2009-2011, 2013-2018, 2020-2022 Free Software Foundation, Inc.
4
5 ;; Author: Nikolaj Schumacher
6
7 ;; This file is part of GNU Emacs.
8
9 ;; GNU Emacs is free software: you can redistribute it and/or modify
10 ;; it under the terms of the GNU General Public License as published by
11 ;; the Free Software Foundation, either version 3 of the License, or
12 ;; (at your option) any later version.
13
14 ;; GNU Emacs is distributed in the hope that it will be useful,
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;; GNU General Public License for more details.
18
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
21
22
23 ;;; Commentary:
24 ;;
25
26 ;;; Code:
27
28 (require 'company)
29 (require 'cl-lib)
30 (eval-when-compile (require 'make-mode))
31
32 (defgroup company-keywords nil
33 "Completion backend for keywords."
34 :group 'company)
35
36 (defcustom company-keywords-ignore-case nil
37 "Non-nil to ignore case in completion candidates."
38 :type 'boolean)
39
40 (defun company-keywords-upper-lower (&rest lst)
41 ;; Upcase order is different for _.
42 (nconc (sort (mapcar 'upcase lst) 'string<) lst))
43
44 (defvar company-keywords-alist
45 ;; Please contribute corrections or additions.
46 `((c++-mode
47 ;; from https://en.cppreference.com/w/cpp/keyword
48 "alignas" "alignof" "and" "and_eq" "asm" "atomic_cancel" "atomic_commit"
49 "atomic_noexcept" "auto" "bitand" "bitor" "bool" "break" "case" "catch"
50 "char" "char16_t" "char32_t" "char8_t" "class" "co_await" "co_return"
51 "co_yield" "compl" "concept" "const" "const_cast" "consteval" "constexpr"
52 "constinit" "continue" "decltype" "default" "delete" "do" "double"
53 "dynamic_cast" "else" "enum" "explicit" "export" "extern" "false" "final"
54 "float" "for" "friend" "goto" "if" "import" "inline" "int" "long" "module"
55 "mutable" "namespace" "new" "noexcept" "not" "not_eq" "nullptr" "operator"
56 "or" "or_eq" "override" "private" "protected" "public" "reflexpr" "register"
57 "reinterpret_cast" "requires" "return" "short" "signed" "sizeof" "static"
58 "static_assert" "static_cast" "struct" "switch" "synchronized" "template"
59 "this" "thread_local" "throw" "true" "try" "typedef" "typeid" "typename"
60 "union" "unsigned" "using" "virtual" "void" "volatile" "wchar_t" "while"
61 "xor" "xor_eq")
62 (c-mode
63 ;; from https://en.cppreference.com/w/c/keyword
64 "_Alignas" "_Alignof" "_Atomic" "_Bool" "_Complex"
65 "_Decimal128" "_Decimal32" "_Decimal64" "_Generic" "_Imaginary"
66 "_Noreturn" "_Static_assert" "_Thread_local" "__asm__" "asm"
67 "auto" "break" "case" "char" "const" "continue" "default" "do"
68 "double" "else" "enum" "extern" "float" "for" "goto" "if" "inline"
69 "int" "long" "register" "restrict" "return" "short" "signed" "sizeof"
70 "static" "struct" "switch" "typedef" "union" "unsigned" "void" "volatile"
71 "while")
72 (crystal-mode
73 ;; from https://github.com/crystal-lang/crystal-book/issues/124#issuecomment-1008311227
74 "abstract" "alias" "annotation" "as" "as?" "asm" "begin" "break" "case" "class"
75 "def" "do" "else" "elsif" "end" "ensure" "enum" "extend" "false" "for" "fun"
76 "if" "in" "include" "instance_sizeof" "is_a?" "lib" "macro" "module" "next"
77 "nil" "nil?" "of" "offsetof" "out" "pointerof" "private" "protected" "require"
78 "rescue" "responds_to?" "return" "select" "self" "sizeof" "struct" "super"
79 "then" "true" "type" "typeof" "uninitialized" "union" "unless" "until" "verbatim"
80 "when" "while" "with" "yield")
81 (csharp-mode
82 "abstract" "add" "alias" "as" "base" "bool" "break" "byte" "case"
83 "catch" "char" "checked" "class" "const" "continue" "decimal" "default"
84 "delegate" "do" "double" "else" "enum" "event" "explicit" "extern"
85 "false" "finally" "fixed" "float" "for" "foreach" "get" "global" "goto"
86 "if" "implicit" "in" "int" "interface" "internal" "is" "lock" "long"
87 "namespace" "new" "null" "object" "operator" "out" "override" "params"
88 "partial" "private" "protected" "public" "readonly" "ref" "remove"
89 "return" "sbyte" "sealed" "set" "short" "sizeof" "stackalloc" "static"
90 "string" "struct" "switch" "this" "throw" "true" "try" "typeof" "uint"
91 "ulong" "unchecked" "unsafe" "ushort" "using" "value" "var" "virtual"
92 "void" "volatile" "where" "while" "yield")
93 (d-mode
94 ;; from http://www.digitalmars.com/d/2.0/lex.html
95 "abstract" "alias" "align" "asm"
96 "assert" "auto" "body" "bool" "break" "byte" "case" "cast" "catch"
97 "cdouble" "cent" "cfloat" "char" "class" "const" "continue" "creal"
98 "dchar" "debug" "default" "delegate" "delete" "deprecated" "do"
99 "double" "else" "enum" "export" "extern" "false" "final" "finally"
100 "float" "for" "foreach" "foreach_reverse" "function" "goto" "idouble"
101 "if" "ifloat" "import" "in" "inout" "int" "interface" "invariant"
102 "ireal" "is" "lazy" "long" "macro" "mixin" "module" "new" "nothrow"
103 "null" "out" "override" "package" "pragma" "private" "protected"
104 "public" "pure" "real" "ref" "return" "scope" "short" "static" "struct"
105 "super" "switch" "synchronized" "template" "this" "throw" "true" "try"
106 "typedef" "typeid" "typeof" "ubyte" "ucent" "uint" "ulong" "union"
107 "unittest" "ushort" "version" "void" "volatile" "wchar" "while" "with")
108 (elixir-mode
109 ;; from https://hexdocs.pm/elixir/Kernel.html
110 "__CALLER__" "__DIR__" "__ENV__" "__MODULE__" "__STACKTRACE__"
111 "__aliases__" "__block__" "abs" "alias" "alias!" "and" "apply"
112 "binary_part" "binary_slice" "binding" "bit_size" "byte_size" "case" "ceil"
113 "cond" "dbg" "def" "defdelegate" "defexception" "defguard" "defguardp"
114 "defimpl" "defmacro" "defmacrop" "defmodule" "defoverridable" "defp"
115 "defprotocol" "defstruct" "destructure" "div" "elem" "exit" "floor" "fn"
116 "for" "function_exported?" "get_and_update_in" "get_in" "hd" "if" "import"
117 "in" "inspect" "is_atom" "is_binary" "is_bitstring" "is_boolean"
118 "is_exception" "is_float" "is_function" "is_integer" "is_list" "is_map"
119 "is_map_key" "is_nil" "is_number" "is_pid" "is_port" "is_reference"
120 "is_struct" "is_tuple" "length" "macro_exported?" "make_ref" "map_size"
121 "match?" "max" "min" "node" "not" "or" "pop_in" "put_elem" "put_in" "quote"
122 "raise" "receive" "rem" "require" "reraise" "round" "self" "send" "spawn"
123 "spawn_link" "spawn_monitor" "struct" "struct!" "super" "tap" "then"
124 "throw" "tl" "to_charlist" "to_string" "trunc" "try" "tuple_size" "unless"
125 "unquote" "unquote_splicing" "update_in" "use" "var!" "with")
126 (erlang-mode
127 ;; from https://www.erlang.org/docs/20/reference_manual/introduction.html#id63536
128 "after" "and" "andalso" "band" "begin" "bnot" "bor" "bsl" "bsr" "bxor"
129 "case" "catch" "cond" "div" "end" "fun" "if" "let" "not" "of" "or" "orelse"
130 "receive" "rem" "try" "when" "xor")
131 (f90-mode .
132 ;; from f90.el
133 ;; ".AND." ".GE." ".GT." ".LT." ".LE." ".NE." ".OR." ".TRUE." ".FALSE."
134 ,(company-keywords-upper-lower
135 "abs" "abstract" "achar" "acos" "adjustl" "adjustr" "aimag" "aint"
136 "align" "all" "all_prefix" "all_scatter" "all_suffix" "allocatable"
137 "allocate" "allocated" "and" "anint" "any" "any_prefix" "any_scatter"
138 "any_suffix" "asin" "assign" "assignment" "associate" "associated"
139 "asynchronous" "atan" "atan2" "backspace" "bind" "bit_size" "block"
140 "btest" "c_alert" "c_associated" "c_backspace" "c_bool"
141 "c_carriage_return" "c_char" "c_double" "c_double_complex" "c_f_pointer"
142 "c_f_procpointer" "c_float" "c_float_complex" "c_form_feed" "c_funloc"
143 "c_funptr" "c_horizontal_tab" "c_int" "c_int16_t" "c_int32_t" "c_int64_t"
144 "c_int8_t" "c_int_fast16_t" "c_int_fast32_t" "c_int_fast64_t"
145 "c_int_fast8_t" "c_int_least16_t" "c_int_least32_t" "c_int_least64_t"
146 "c_int_least8_t" "c_intmax_t" "c_intptr_t" "c_loc" "c_long"
147 "c_long_double" "c_long_double_complex" "c_long_long" "c_new_line"
148 "c_null_char" "c_null_funptr" "c_null_ptr" "c_ptr" "c_short"
149 "c_signed_char" "c_size_t" "c_vertical_tab" "call" "case" "ceiling"
150 "char" "character" "character_storage_size" "class" "close" "cmplx"
151 "command_argument_count" "common" "complex" "conjg" "contains" "continue"
152 "copy_prefix" "copy_scatter" "copy_suffix" "cos" "cosh" "count"
153 "count_prefix" "count_scatter" "count_suffix" "cpu_time" "cshift"
154 "cycle" "cyclic" "data" "date_and_time" "dble" "deallocate" "deferred"
155 "digits" "dim" "dimension" "distribute" "do" "dot_product" "double"
156 "dprod" "dynamic" "elemental" "else" "elseif" "elsewhere" "end" "enddo"
157 "endfile" "endif" "entry" "enum" "enumerator" "eoshift" "epsilon" "eq"
158 "equivalence" "eqv" "error_unit" "exit" "exp" "exponent" "extends"
159 "extends_type_of" "external" "extrinsic" "false" "file_storage_size"
160 "final" "floor" "flush" "forall" "format" "fraction" "function" "ge"
161 "generic" "get_command" "get_command_argument" "get_environment_variable"
162 "goto" "grade_down" "grade_up" "gt" "hpf_alignment" "hpf_distribution"
163 "hpf_template" "huge" "iachar" "iall" "iall_prefix" "iall_scatter"
164 "iall_suffix" "iand" "iany" "iany_prefix" "iany_scatter" "iany_suffix"
165 "ibclr" "ibits" "ibset" "ichar" "ieee_arithmetic" "ieee_exceptions"
166 "ieee_features" "ieee_get_underflow_mode" "ieee_set_underflow_mode"
167 "ieee_support_underflow_control" "ieor" "if" "ilen" "implicit"
168 "import" "include" "independent" "index" "inherit" "input_unit"
169 "inquire" "int" "integer" "intent" "interface" "intrinsic" "ior"
170 "iostat_end" "iostat_eor" "iparity" "iparity_prefix" "iparity_scatter"
171 "iparity_suffix" "ishft" "ishftc" "iso_c_binding" "iso_fortran_env"
172 "kind" "lbound" "le" "leadz" "len" "len_trim" "lge" "lgt" "lle" "llt"
173 "log" "log10" "logical" "lt" "matmul" "max" "maxexponent" "maxloc"
174 "maxval" "maxval_prefix" "maxval_scatter" "maxval_suffix" "merge"
175 "min" "minexponent" "minloc" "minval" "minval_prefix" "minval_scatter"
176 "minval_suffix" "mod" "module" "modulo" "move_alloc" "mvbits" "namelist"
177 "ne" "nearest" "neqv" "new" "new_line" "nint" "non_intrinsic"
178 "non_overridable" "none" "nopass" "not" "null" "nullify"
179 "number_of_processors" "numeric_storage_size" "only" "onto" "open"
180 "operator" "optional" "or" "output_unit" "pack" "parameter" "parity"
181 "parity_prefix" "parity_scatter" "parity_suffix" "pass" "pause"
182 "pointer" "popcnt" "poppar" "precision" "present" "print" "private"
183 "procedure" "processors" "processors_shape" "product" "product_prefix"
184 "product_scatter" "product_suffix" "program" "protected" "public"
185 "pure" "radix" "random_number" "random_seed" "range" "read" "real"
186 "realign" "recursive" "redistribute" "repeat" "reshape" "result"
187 "return" "rewind" "rrspacing" "same_type_as" "save" "scale" "scan"
188 "select" "selected_char_kind" "selected_int_kind" "selected_real_kind"
189 "sequence" "set_exponent" "shape" "sign" "sin" "sinh" "size" "spacing"
190 "spread" "sqrt" "stop" "subroutine" "sum" "sum_prefix" "sum_scatter"
191 "sum_suffix" "system_clock" "tan" "tanh" "target" "template" "then"
192 "tiny" "transfer" "transpose" "trim" "true" "type" "ubound" "unpack"
193 "use" "value" "verify" "volatile" "wait" "where" "while" "with" "write"))
194 (go-mode
195 ;; 1. Keywords ref: https://golang.org/ref/spec#Keywords
196 ;; 2. Builtin functions and types ref: https://golang.org/pkg/builtin/
197 "append" "bool" "break" "byte" "cap" "case" "chan" "close" "complex" "complex128"
198 "complex64" "const" "continue" "copy" "default" "defer" "delete" "else" "error"
199 "fallthrough" "false" "float32" "float64" "for" "func" "go" "goto" "if" "imag"
200 "import" "int" "int16" "int32" "int64" "int8" "interface" "len" "make"
201 "map" "new" "nil" "package" "panic" "print" "println" "range" "real" "recover"
202 "return" "rune" "select" "string" "struct" "switch" "true" "type" "uint" "uint16"
203 "uint32" "uint64" "uint8" "uintptr" "var")
204 (java-mode
205 "abstract" "assert" "boolean" "break" "byte" "case" "catch" "char" "class"
206 "continue" "default" "do" "double" "else" "enum" "extends" "final"
207 "finally" "float" "for" "if" "implements" "import" "instanceof" "int"
208 "interface" "long" "native" "new" "package" "private" "protected" "public"
209 "return" "short" "static" "strictfp" "super" "switch" "synchronized"
210 "this" "throw" "throws" "transient" "try" "void" "volatile" "while")
211 (javascript-mode
212 ;; https://tc39.github.io/ecma262/ + async, static and undefined
213 "async" "await" "break" "case" "catch" "class" "const" "continue"
214 "debugger" "default" "delete" "do" "else" "enum" "export" "extends" "false"
215 "finally" "for" "function" "if" "import" "in" "instanceof" "let" "new"
216 "null" "return" "static" "super" "switch" "this" "throw" "true" "try"
217 "typeof" "undefined" "var" "void" "while" "with" "yield")
218 (kotlin-mode
219 "abstract" "annotation" "as" "break" "by" "catch" "class" "companion"
220 "const" "constructor" "continue" "data" "do" "else" "enum" "false" "final"
221 "finally" "for" "fun" "if" "import" "in" "init" "inner" "interface"
222 "internal" "is" "lateinit" "nested" "null" "object" "open" "out" "override"
223 "package" "private" "protected" "public" "return" "super" "this" "throw"
224 "trait" "true" "try" "typealias" "val" "var" "when" "while")
225 (lua-mode
226 ;; https://www.lua.org/manual/5.3/manual.html
227 "and" "break" "do" "else" "elseif" "end" "false" "for" "function" "goto" "if"
228 "in" "local" "nil" "not" "or" "repeat" "return" "then" "true" "until" "while")
229 (nim-mode
230 ;; https://nim-lang.org/docs/manual.html#lexical-analysis-identifiers-amp-keywords
231 "addr" "and" "as" "asm" "bind" "block" "break" "case" "cast" "concept" "const" "continue"
232 "converter" "defer" "discard" "distinct" "div" "do" "elif" "else" "end" "enum" "except"
233 "export" "finally" "for" "from" "func" "if" "import" "in" "include" "interface" "is" "isnot"
234 "iterator" "let" "macro" "method" "mixin" "mod" "nil" "not" "notin" "object" "of" "or" "out"
235 "proc" "ptr" "raise" "ref" "return" "shl" "shr" "static" "template" "try" "tuple" "type"
236 "using" "var" "when" "while" "xor" "yield")
237 (objc-mode
238 "@catch" "@class" "@encode" "@end" "@finally" "@implementation"
239 "@interface" "@private" "@protected" "@protocol" "@public"
240 "@selector" "@synchronized" "@throw" "@try" "alloc" "autorelease"
241 "bycopy" "byref" "in" "inout" "oneway" "out" "release" "retain")
242 (perl-mode
243 ;; from cperl.el
244 "AUTOLOAD" "BEGIN" "CHECK" "CORE" "DESTROY" "END" "INIT" "__END__"
245 "__FILE__" "__LINE__" "abs" "accept" "alarm" "and" "atan2" "bind"
246 "binmode" "bless" "caller" "chdir" "chmod" "chomp" "chop" "chown" "chr"
247 "chroot" "close" "closedir" "cmp" "connect" "continue" "cos"
248 "crypt" "dbmclose" "dbmopen" "defined" "delete" "die" "do" "dump" "each"
249 "else" "elsif" "endgrent" "endhostent" "endnetent" "endprotoent"
250 "endpwent" "endservent" "eof" "eq" "eval" "exec" "exists" "exit" "exp"
251 "fcntl" "fileno" "flock" "for" "foreach" "fork" "format" "formline"
252 "ge" "getc" "getgrent" "getgrgid" "getgrnam" "gethostbyaddr"
253 "gethostbyname" "gethostent" "getlogin" "getnetbyaddr" "getnetbyname"
254 "getnetent" "getpeername" "getpgrp" "getppid" "getpriority"
255 "getprotobyname" "getprotobynumber" "getprotoent" "getpwent" "getpwnam"
256 "getpwuid" "getservbyname" "getservbyport" "getservent" "getsockname"
257 "getsockopt" "glob" "gmtime" "goto" "grep" "gt" "hex" "if" "index" "int"
258 "ioctl" "join" "keys" "kill" "last" "lc" "lcfirst" "le" "length"
259 "link" "listen" "local" "localtime" "lock" "log" "lstat" "lt" "map"
260 "mkdir" "msgctl" "msgget" "msgrcv" "msgsnd" "my" "ne" "next" "no"
261 "not" "oct" "open" "opendir" "or" "ord" "our" "pack" "package" "pipe"
262 "pop" "pos" "print" "printf" "push" "q" "qq" "quotemeta" "qw" "qx"
263 "rand" "read" "readdir" "readline" "readlink" "readpipe" "recv" "redo"
264 "ref" "rename" "require" "reset" "return" "reverse" "rewinddir" "rindex"
265 "rmdir" "scalar" "seek" "seekdir" "select" "semctl" "semget" "semop"
266 "send" "setgrent" "sethostent" "setnetent" "setpgrp" "setpriority"
267 "setprotoent" "setpwent" "setservent" "setsockopt" "shift" "shmctl"
268 "shmget" "shmread" "shmwrite" "shutdown" "sin" "sleep" "socket"
269 "socketpair" "sort" "splice" "split" "sprintf" "sqrt" "srand" "stat"
270 "study" "sub" "substr" "symlink" "syscall" "sysopen" "sysread" "system"
271 "syswrite" "tell" "telldir" "tie" "time" "times" "tr" "truncate" "uc"
272 "ucfirst" "umask" "undef" "unless" "unlink" "unpack" "unshift" "untie"
273 "until" "use" "utime" "values" "vec" "wait" "waitpid"
274 "wantarray" "warn" "while" "write" "x" "xor" "y")
275 (php-mode ;; https://www.php.net/manual/reserved.php
276 "Closure" "Error" "Exception" "Generator" "Throwable"
277 "__CLASS__" "__DIR__" "__FILE__" "__FUNCTION__" "__LINE__" "__METHOD__"
278 "__NAMESPACE__" "__TRAIT__"
279 "abstract" "and" "array" "as" "bool" "break" "callable" "case" "catch"
280 "class" "clone" "const" "continue" "declare" "default" "die" "do" "echo"
281 "else" "elseif" "empty" "enddeclare" "endfor" "endforeach" "endif"
282 "endswitch" "endwhile" "enum" "eval" "exit" "extends" "false" "final" "finally"
283 "float" "fn" "for" "foreach" "function" "global" "goto" "if"
284 "implements" "include" "include_once" "instanceof" "insteadof" "interface"
285 "isset" "iterable" "list" "match" "namespace" "new" "null" "object" "or"
286 "print" "private" "protected" "public" "readonly" "require" "require_once"
287 "return" "self" "static" "string" "switch" "this" "throw" "trait" "true"
288 "try" "unset" "use" "var" "void" "while" "xor" "yield" "yield from")
289 (purescript-mode ;; purescript-font-lock.el
290 "ado" "case" "class" "data" "default" "deriving" "do" "else" "if" "import"
291 "in" "infix" "infixl" "infixr" "instance" "let" "module" "newtype" "of"
292 "then" "type" "where")
293 (python-mode
294 ;; https://docs.python.org/3/reference/lexical_analysis.html#keywords
295 "False" "None" "True" "and" "as" "assert" "break" "class" "continue" "def"
296 "del" "elif" "else" "except" "exec" "finally" "for" "from" "global" "if"
297 "import" "in" "is" "lambda" "nonlocal" "not" "or" "pass" "print" "raise"
298 "return" "try" "while" "with" "yield")
299 (ruby-mode
300 "BEGIN" "END" "alias" "and" "begin" "break" "case" "class" "def" "defined?"
301 "do" "else" "elsif" "end" "ensure" "false" "for" "if" "in" "module"
302 "next" "nil" "not" "or" "redo" "rescue" "retry" "return" "self" "super"
303 "then" "true" "undef" "unless" "until" "when" "while" "yield")
304 ;; From https://doc.rust-lang.org/grammar.html#keywords
305 ;; but excluding unused reserved words: https://www.reddit.com/r/rust/comments/34fq0k/is_there_a_good_list_of_rusts_keywords/cqucvnj
306 (rust-mode
307 "Self"
308 "as" "box" "break" "const" "continue" "crate" "else" "enum" "extern"
309 "false" "fn" "for" "if" "impl" "in" "let" "loop" "macro" "match" "mod"
310 "move" "mut" "pub" "ref" "return" "self" "static" "struct" "super"
311 "trait" "true" "type" "unsafe" "use" "where" "while")
312 ; Extract from R7RS-small Tex: https://small.r7rs.org/
313 (scheme-mode
314 "abs" "acos" "angle" "append" "apply" "asin" "assoc" "assq" "assv"
315 "atan" "binary-port?" "body" "boolean=?" "boolean?" "bytevector"
316 "bytevector-append" "bytevector-copy" "bytevector-copy!"
317 "bytevector-length" "bytevector-u8-ref" "bytevector-u8-set!"
318 "bytevector?" "caaaar" "caaadr" "caaar" "caadar" "caaddr" "caadr"
319 "caar" "cadaar" "cadadr" "cadar" "caddar" "cadddr" "caddr" "cadr"
320 "call-with-port" "call-with-values" "car" "car-internal" "cdaaar"
321 "cdaadr" "cdaar" "cdadar" "cdaddr" "cdadr" "cdar" "cddaar" "cddadr"
322 "cddar" "cdddar" "cddddr" "cdddr" "cddr" "cdr" "ceiling"
323 "char->integer" "char-alphabetic?" "char-ci<=?" "char-ci<?"
324 "char-ci=?" "char-ci>=?" "char-ci>?" "char-downcase" "char-foldcase"
325 "char-lower-case?" "char-numeric?" "char-ready?" "char-upcase"
326 "char-upper-case?" "char-whitespace?" "char<=?" "char<?" "char=?"
327 "char>=?" "char>?" "char?" "close-input-port" "close-output-port"
328 "close-port" "command-line" "complex?" "cons" "cos"
329 "current-error-port" "current-input-port" "current-jiffy"
330 "current-output-port" "current-second" "delete-file" "denominator"
331 "digit-value" "display" "dynamic-wind" "emergency-exit" "environment"
332 "eof-object" "eof-object?" "eq?" "equal?" "eqv?" "error"
333 "error-object-irritants" "error-object-message" "error-object?" "eval"
334 "even?" "exact" "exact-integer-sqrt" "exact-integer?" "exact?" "exit"
335 "exp" "expt" "features" "file-error?" "file-exists?" "finite?" "floor"
336 "floor-quotient" "floor-remainder" "floor/" "flush-output-port" "gcd"
337 "get-environment-variable" "get-environment-variables"
338 "get-output-bytevector" "get-output-string" "imag-part" "inexact"
339 "inexact?" "infinite?" "input-port-open?" "input-port?"
340 "integer->char" "integer?" "interaction-environment"
341 "jiffies-per-second" "lcm" "length" "list" "list->string"
342 "list->vector" "list-copy" "list-ref" "list-set!" "list-tail" "list?"
343 "load" "log" "magnitude" "make-bytevector" "make-list"
344 "make-parameter" "make-polar" "make-promise" "make-rectangular"
345 "make-string" "make-vector" "max" "member" "memq" "memv" "min"
346 "modulo" "nan?" "negative?" "newline" "nil" "not" "null-environment"
347 "null?" "number->string" "number?" "numerator" "odd?"
348 "open-binary-input-file" "open-binary-output-file"
349 "open-input-bytevector" "open-input-file" "open-input-string"
350 "open-output-bytevector" "open-output-file" "open-output-string"
351 "output-port-open?" "output-port?" "pair?" "peek-char" "peek-u8"
352 "port?" "positive?" "procedure?" "promise?" "quasiquote" "quote"
353 "quotient" "raise" "raise-continuable" "rational?" "rationalize"
354 "read" "read-bytevector" "read-bytevector!" "read-char" "read-error?"
355 "read-line" "read-string" "read-u8" "real-part" "real?" "remainder"
356 "reverse" "round" "scheme-report-environment" "set!" "set-car!"
357 "set-cdr!" "setcar" "sin" "sqrt" "square" "string" "string->list"
358 "string->number" "string->symbol" "string->utf" "string->vector"
359 "string-append" "string-ci<=?" "string-ci<?" "string-ci=?"
360 "string-ci>=?" "string-ci>?" "string-copy" "string-copy!"
361 "string-downcase" "string-fill!" "string-foldcase" "string-for-each"
362 "string-length" "string-map" "string-ref" "string-set!"
363 "string-upcase" "string<=?" "string<?" "string=?" "string>=?"
364 "string>?" "string?" "substring" "symbol->string" "symbol=?" "symbol?"
365 "tan" "textual-port?" "truncate" "truncate-quotient"
366 "truncate-remainder" "truncate/" "u8-ready?" "unquote"
367 "unquote-splicing" "utf->string" "values" "vector" "vector->list"
368 "vector->string" "vector-append" "vector-copy" "vector-copy!"
369 "vector-fill!" "vector-for-each" "vector-length" "vector-map"
370 "vector-ref" "vector-set!" "vector?" "with-exception-handler"
371 "with-input-from-file" "with-output-to-file" "write"
372 "write-bytevector" "write-char" "write-shared" "write-simple"
373 "write-string" "write-u8" "zero?")
374 (scala-mode
375 "abstract" "case" "catch" "class" "def" "do" "else" "extends" "false"
376 "final" "finally" "for" "forSome" "if" "implicit" "import" "lazy" "match"
377 "new" "null" "object" "override" "package" "private" "protected"
378 "return" "sealed" "super" "this" "throw" "trait" "true" "try" "type" "val"
379 "var" "while" "with" "yield")
380 (swift-mode
381 "Protocol" "Self" "Type" "and" "as" "assignment" "associatedtype"
382 "associativity" "available" "break" "case" "catch" "class" "column" "continue"
383 "convenience" "default" "defer" "deinit" "didSet" "do" "dynamic" "dynamicType"
384 "else" "elseif" "endif" "enum" "extension" "fallthrough" "false" "file"
385 "fileprivate" "final" "for" "func" "function" "get" "guard" "higherThan" "if"
386 "import" "in" "indirect" "infix" "init" "inout" "internal" "is" "lazy" "left"
387 "let" "line" "lowerThan" "mutating" "nil" "none" "nonmutating" "open"
388 "operator" "optional" "override" "postfix" "precedence" "precedencegroup"
389 "prefix" "private" "protocol" "public" "repeat" "required" "rethrows" "return"
390 "right" "selector" "self" "set" "static" "struct" "subscript" "super" "switch"
391 "throw" "throws" "true" "try" "typealias" "unowned" "var" "weak" "where"
392 "while" "willSet")
393 (julia-mode
394 "abstract" "break" "case" "catch" "const" "continue" "do" "else" "elseif"
395 "end" "eval" "export" "false" "finally" "for" "function" "global" "if"
396 "ifelse" "immutable" "import" "importall" "in" "let" "macro" "module"
397 "otherwise" "quote" "return" "switch" "throw" "true" "try" "type"
398 "typealias" "using" "while"
399 )
400 ;; From https://github.com/apache/thrift/blob/master/contrib/thrift.el
401 (thrift-mode
402 "binary" "bool" "byte" "const" "double" "enum" "exception" "extends"
403 "i16" "i32" "i64" "include" "list" "map" "oneway" "optional" "required"
404 "service" "set" "string" "struct" "throws" "typedef" "void"
405 )
406 ;; aliases
407 (js2-mode . javascript-mode)
408 (js2-jsx-mode . javascript-mode)
409 (espresso-mode . javascript-mode)
410 (js-mode . javascript-mode)
411 (js-jsx-mode . javascript-mode)
412 (rjsx-mode . javascript-mode)
413 (cperl-mode . perl-mode)
414 (jde-mode . java-mode)
415 (ess-julia-mode . julia-mode)
416 (phps-mode . php-mode)
417 (enh-ruby-mode . ruby-mode))
418 "Alist mapping major-modes to sorted keywords for `company-keywords'.")
419
420 (with-eval-after-load 'make-mode
421 (mapc
422 (lambda (mode-stmnts)
423 (setf (alist-get (car mode-stmnts) company-keywords-alist)
424 (cl-remove-duplicates
425 (sort (append makefile-special-targets-list
426 (cl-mapcan #'identity
427 (mapcar
428 #'split-string
429 (cl-remove-if-not
430 #'stringp
431 (symbol-value (cdr mode-stmnts))))))
432 #'string<)
433 :test #'string=)))
434 '((makefile-automake-mode . makefile-automake-statements)
435 (makefile-gmake-mode . makefile-gmake-statements)
436 (makefile-makepp-mode . makefile-makepp-statements)
437 (makefile-bsdmake-mode . makefile-bsdmake-statements)
438 (makefile-imake-mode . makefile-statements)
439 (makefile-mode . makefile-statements))))
440
441 ;;;###autoload
442 (defun company-keywords (command &optional arg &rest ignored)
443 "`company-mode' backend for programming language keywords."
444 (interactive (list 'interactive))
445 (cl-case command
446 (interactive (company-begin-backend 'company-keywords))
447 (prefix (and (assq major-mode company-keywords-alist)
448 (not (company-in-string-or-comment))
449 (or (company-grab-symbol) 'stop)))
450 (candidates
451 (let ((completion-ignore-case company-keywords-ignore-case)
452 (symbols (cdr (assq major-mode company-keywords-alist))))
453 (all-completions arg (if (consp symbols)
454 symbols
455 (cdr (assq symbols company-keywords-alist))))))
456 (kind 'keyword)
457 (sorted t)
458 (ignore-case company-keywords-ignore-case)))
459
460 (provide 'company-keywords)
461 ;;; company-keywords.el ends here