• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/

Lines Matching +defs:name +defs:entry +defs:length

140 ;;  entry is coerced appropriately.
177 ;; Returns a completion entry that starts with string.
180 ;; Returns a completion entry that exactly matches string.
304 (defcustom save-completions-file-name
310 (expand-file-name "completions" "~/.emacs.d/")))
365 (defvar completion-min-length 6
366 "*The minimum length of a stored completion.
369 (defvar completion-max-length 200
370 "*The maximum length of a stored completion.
373 (defvar completion-prefix-min-length 3
374 "The minimum length of a completion search string.
407 (cond ((and (> (length string) 1)
518 (modify-syntax-entry i " " table)
523 (modify-syntax-entry (+ ?a i) "_" table)
524 (modify-syntax-entry (+ ?A i) "_" table)
529 (modify-syntax-entry (+ ?0 i) "_" table)
535 (modify-syntax-entry char "_" table))
537 (modify-syntax-entry char "w" table)))
554 But only if it is longer than `completion-min-length'."
573 ;; Return completion if the length is reasonable.
574 (if (and (<= completion-min-length
577 completion-max-length))
594 Returns nil if there isn't one longer than `completion-min-length'."
610 (+ cmpl-symbol-start completion-min-length))
626 ;; Return completion if the length is reasonable
627 (if (and (<= completion-min-length
630 completion-max-length))
675 ;; Return completion if the length is reasonable.
676 (if (and (<= completion-prefix-min-length
679 completion-max-length))
923 ;; The value of the symbol is the completion entry
925 ;; bad things may happen if this length is changed due to the way
927 (defconst cmpl-obarray-length 511)
929 (defvar cmpl-prefix-obarray (make-vector cmpl-obarray-length 0)
933 (defvar cmpl-obarray (make-vector cmpl-obarray-length 0)
935 Each symbol is bound to a single completion entry.")
941 ;; A completion entry is a LIST of string, prefix-symbol num-uses, and
951 (defmacro completion-string (completion-entry)
952 (list 'car completion-entry))
954 (defmacro completion-num-uses (completion-entry)
957 (list 'car (list 'cdr completion-entry)))
959 (defmacro completion-last-use-time (completion-entry)
962 (list 'nth 2 completion-entry))
964 (defmacro completion-source (completion-entry)
965 (list 'nth 3 completion-entry))
968 (defmacro set-completion-string (completion-entry string)
969 (list 'setcar completion-entry string))
971 (defmacro set-completion-num-uses (completion-entry num-uses)
972 (list 'setcar (list 'cdr completion-entry) num-uses))
974 (defmacro set-completion-last-use-time (completion-entry last-use-time)
975 (list 'setcar (list 'cdr (list 'cdr completion-entry)) last-use-time))
979 "Return a completion entry."
983 ;;(defmacro cmpl-prefix-entry-symbol (completion-entry)
984 ;; (list 'car (list 'cdr completion-entry)))
990 ;; Prefix symbol entry definition
996 (defalias 'cmpl-prefix-entry-head 'car)
998 (defalias 'cmpl-prefix-entry-tail 'cdr)
1002 (defmacro set-cmpl-prefix-entry-head (prefix-entry new-head)
1003 (list 'setcar prefix-entry new-head))
1005 (defmacro set-cmpl-prefix-entry-tail (prefix-entry new-tail)
1006 (list 'setcdr prefix-entry new-tail))
1010 (defun make-cmpl-prefix-entry (completion-entry-list)
1011 "Make a new prefix entry containing only completion-entry."
1012 (cons completion-entry-list completion-entry-list))
1021 (setq cmpl-prefix-obarray (make-vector cmpl-obarray-length 0))
1022 (setq cmpl-obarray (make-vector cmpl-obarray-length 0))
1037 (append (cmpl-prefix-entry-head (symbol-value prefix-symbol))
1049 (cons (cmpl-prefix-entry-head (symbol-value prefix-symbol))
1072 (defvar cmpl-db-entry nil)
1078 "Return the completion entry for STRING or nil.
1085 (defun find-cmpl-prefix-entry (prefix-string)
1086 "Return the prefix entry for string.
1088 Prefix-string must be exactly `completion-prefix-min-length' long
1094 (defvar inside-locate-completion-entry nil)
1097 (defun locate-completion-entry (completion-entry prefix-entry)
1098 "Locate the completion entry.
1099 Returns a pointer to the element before the completion entry or nil if
1100 the completion entry is at the head.
1102 (let ((prefix-list (cmpl-prefix-entry-head prefix-entry))
1105 ((not (eq (car prefix-list) completion-entry))
1108 (not (eq completion-entry
1116 (error "Completion entry exists but not on prefix list - %s"
1118 (inside-locate-completion-entry
1125 (locate-completion-entry-retry completion-entry)))))))
1127 (defun locate-completion-entry-retry (old-entry)
1128 (let ((inside-locate-completion-entry t))
1129 (add-completion (completion-string old-entry)
1130 (completion-num-uses old-entry)
1131 (completion-last-use-time old-entry))
1132 (let* ((cmpl-entry (find-exact-completion (completion-string old-entry)))
1133 (pref-entry
1134 (if cmpl-entry
1135 (find-cmpl-prefix-entry
1137 0 completion-prefix-min-length)))))
1138 (if (and cmpl-entry pref-entry)
1140 (locate-completion-entry cmpl-entry pref-entry)
1153 longer than `completion-prefix-min-length'.
1155 Returns the completion entry."
1158 (let (;; create an entry
1159 (entry (list (make-completion string)))
1161 (prefix-entry (find-cmpl-prefix-entry
1163 completion-prefix-min-length))))
1166 (cond (prefix-entry
1169 (setcdr (cmpl-prefix-entry-tail prefix-entry) entry)
1170 (set-cmpl-prefix-entry-tail prefix-entry entry))
1172 (set cmpl-db-prefix-symbol (make-cmpl-prefix-entry entry))))
1177 (set cmpl-db-symbol (car entry)))))
1183 COMPLETION-STRING must be longer than `completion-prefix-min-length'.
1186 Returns the completion entry."
1190 (if (setq cmpl-db-entry (find-exact-completion completion-string))
1192 (let* ((prefix-entry (find-cmpl-prefix-entry
1194 completion-prefix-min-length)))
1195 (splice-ptr (locate-completion-entry cmpl-db-entry prefix-entry))
1197 ;; update entry
1198 (set-completion-string cmpl-db-entry completion-string)
1206 (set-cmpl-prefix-entry-tail prefix-entry splice-ptr))
1208 (setcdr cmpl-ptr (cmpl-prefix-entry-head prefix-entry))
1209 (set-cmpl-prefix-entry-head prefix-entry cmpl-ptr)))
1210 cmpl-db-entry)
1212 (let (;; create an entry
1213 (entry (list (make-completion completion-string)))
1215 (prefix-entry (find-cmpl-prefix-entry
1217 completion-prefix-min-length))))
1218 (cond (prefix-entry
1220 (setcdr entry (cmpl-prefix-entry-head prefix-entry))
1221 (set-cmpl-prefix-entry-head prefix-entry entry))
1223 ;; Start new prefix entry
1224 (set cmpl-db-prefix-symbol (make-cmpl-prefix-entry entry))))
1229 (set cmpl-db-symbol (car entry)))))
1233 String must be longer than `completion-prefix-min-length'."
1236 (if (setq cmpl-db-entry (find-exact-completion completion-string))
1238 (let* ((prefix-entry (find-cmpl-prefix-entry
1240 completion-prefix-min-length)))
1241 (splice-ptr (locate-completion-entry cmpl-db-entry prefix-entry)))
1249 (set-cmpl-prefix-entry-tail prefix-entry splice-ptr)))
1252 (or (set-cmpl-prefix-entry-head
1253 prefix-entry (cdr (cmpl-prefix-entry-head prefix-entry)))
1265 ;; (car (find-cmpl-prefix-entry "ban")) --> (("banana" ...))
1266 ;; (cdr (find-cmpl-prefix-entry "ban")) --> (("banana" ...))
1269 ;; (car (find-cmpl-prefix-entry "ban")) --> (("banish" ...) ("banana" ...))
1270 ;; (cdr (find-cmpl-prefix-entry "ban")) --> (("banana" ...))
1272 ;; (car (find-cmpl-prefix-entry "ban")) --> (("banana" ...) ("banish" ...))
1273 ;; (cdr (find-cmpl-prefix-entry "ban")) --> (("banish" ...))
1279 ;; (car (find-cmpl-prefix-entry "ban")) --> (("banana" ...) ("banish" ...))
1280 ;; (cdr (find-cmpl-prefix-entry "ban")) --> (("banish" ...))
1283 ;; (car (find-cmpl-prefix-entry "ban")) --> (("banner" ...) ("banish" ...))
1284 ;; (cdr (find-cmpl-prefix-entry "ban")) --> (("banish" ...))
1287 ;; (find-cmpl-prefix-entry "ban") --> nil
1292 ;; (car (find-cmpl-prefix-entry "ban")) --> (("banana" ...))
1293 ;; (cdr (find-cmpl-prefix-entry "ban")) --> (("banana" ...))
1295 ;; (car (find-cmpl-prefix-entry "ban")) -->(("banana" ...) ("banish" ...))
1296 ;; (cdr (find-cmpl-prefix-entry "ban")) -->(("banish" ...))
1316 (if (zerop (length read)) (setq read (or default "")))
1319 (defun check-completion-length (string)
1320 (if (< (length string) completion-min-length)
1330 (check-completion-length string)
1334 (entry (add-completion-to-head string)))
1336 (if num-uses (set-completion-num-uses entry num-uses))
1338 (set-completion-last-use-time entry last-use-time))))
1351 (check-completion-length string)
1361 entry)
1363 (setq entry (add-completion-to-head string))
1364 (set-completion-num-uses entry (1+ (completion-num-uses entry)))
1391 entry)
1395 (setq entry (add-completion-to-head string))
1397 (zerop (completion-num-uses entry)))
1399 (set-completion-num-uses entry 1)
1409 ;; (car (find-cmpl-prefix-entry "ban")) --> (("banish" ...) ("banana" ...))
1415 ;; (car (find-cmpl-prefix-entry "ban")) --> (("banana" ...) ("banish" ...))
1418 ;; (car (find-cmpl-prefix-entry "ban"))
1423 ;; (car (find-cmpl-prefix-entry "ban")) --> (("banner" ...) ("banana" ...))
1458 STRING must be longer than `completion-prefix-min-length'."
1461 (cmpl-prefix-entry-head
1462 (find-cmpl-prefix-entry
1463 (downcase (substring string 0 completion-prefix-min-length))))
1476 "Return the next completion entry.
1500 (nthcdr (- (length cmpl-starting-possibilities)
1501 (length cmpl-next-possibilities))
1517 "Return the next completion entry without actually moving the pointers.
1633 completion-prefix-min-length)))
1650 (entry (completion-search-next cmpl-current-index))
1652 ;; entry is either a completion entry or a string (if cdabbrev)
1655 (cond (entry
1657 (setq string (if (stringp entry)
1658 entry (completion-string entry)))
1673 (note-complete-inserted entry cmpl-current-index))
1681 (setq entry
1684 (setq string (if (stringp entry)
1685 entry (completion-string entry)))
1718 (setq file (expand-file-name file))
1825 ;; Looks for #define or [<storage class>] [<type>] <name>{,<name>}
1847 (modify-syntax-entry i "w" table)
1850 (modify-syntax-entry char "_" table))
1852 (modify-syntax-entry char " " table))
1853 (modify-syntax-entry ?\[ "(]" table)
1854 (modify-syntax-entry ?\{ "(}" table)
1855 (modify-syntax-entry ?\] ")[" table)
1856 (modify-syntax-entry ?\} "){" table)
2009 If file name is not specified, use `save-completions-file-name'."
2011 (setq filename (expand-file-name (or filename save-completions-file-name)))
2029 (setq buffer-file-name filename)
2074 ;; (GNU leaves a 0 length file if it gets a disk full error!)
2080 ;; Copy the backup back to the current name
2107 If file is not specified, then use `save-completions-file-name'."
2109 (setq filename (expand-file-name (or filename save-completions-file-name)))
2119 (setq buffer-file-name filename)
2126 string entry last-use-time
2127 cmpl-entry cmpl-last-use-time
2148 (setq entry (read buffer))
2151 ((and (consp entry)
2152 (stringp (setq string (car entry)))
2154 ((eq (setq last-use-time (cdr entry)) 'T)
2161 ;; Valid entry
2165 (setq cmpl-entry
2174 (set-completion-last-use-time cmpl-entry last-use-time)))
2178 (prin1-to-string entry))
2222 to make one entry in the kill ring.
2268 (defun completion-def-wrapper (function-name type)
2271 (put function-name 'completion-function
2309 (modify-syntax-entry char "_" table))
2328 (modify-syntax-entry char " " table))
2344 (modify-syntax-entry char " " table))