abbrev--before-point is a byte-compiled function defined in
abbrev.el.gz.
Signature
(abbrev--before-point)
Documentation
Try and find an abbrev before point. Return it if found, nil otherwise.
References
References in abbrev.el.gz:
(defun abbrev--default-expand ...)
Find all references Functions used by abbrev--before-point
Debugging
Enable edebug Enable tracing
Disassemble Forget
Source Code
/usr/share/emacs/29.4/lisp/abbrev.el.gz
(defun abbrev--before-point ()
"Try and find an abbrev before point. Return it if found, nil otherwise."
(unless (eq abbrev-start-location-buffer (current-buffer))
(setq abbrev-start-location nil))
(let ((tables (abbrev--active-tables))
(pos (point))
start end name res)
(if abbrev-start-location
(progn
(setq start abbrev-start-location)
(setq abbrev-start-location nil)
(when (and (< start (point-max))
(eq (char-after start) ?-))
(delete-region start (1+ start))
(setq pos (1- pos)))
(skip-syntax-backward " ")
(setq end (point))
(when (> end start)
(setq name (buffer-substring start end))
(goto-char pos) (list (abbrev-symbol name tables) name start end)))
(while (and tables (not (car res)))
(let* ((table (pop tables))
(enable-fun (abbrev-table-get table :enable-function)))
(setq tables (append (abbrev-table-get table :parents) tables))
(setq res
(and (or (not enable-fun) (funcall enable-fun))
(let ((re (abbrev-table-get table :regexp)))
(if (null re)
(let ((lim (point)))
(backward-word 1)
(setq start (point))
(forward-word 1)
(setq end (min (point) lim)))
(when (looking-back re (line-beginning-position))
(setq start (match-beginning 1))
(setq end (match-end 1)))))
(setq name (buffer-substring start end))
(let ((abbrev (abbrev--symbol name table)))
(when abbrev
(setq enable-fun (abbrev-get abbrev :enable-function))
(and (or (not enable-fun) (funcall enable-fun))
(list abbrev name start end))))))
(goto-char pos)))
res)))