Function: dabbrev--abbrev-at-point

dabbrev--abbrev-at-point is a byte-compiled function defined in dabbrev.el.gz.

Signature

(dabbrev--abbrev-at-point)

Documentation

Extract the symbol at point to serve as abbreviation.

Source Code

;; Defined in /usr/src/emacs/lisp/dabbrev.el.gz
(defun dabbrev--abbrev-at-point ()
  "Extract the symbol at point to serve as abbreviation."
  ;; Check for error
  (if (bobp)
      (user-error "No possible abbreviation preceding point"))
  ;; Return abbrev at point
  (save-excursion
    ;; Record the end of the abbreviation.
    (let ((end (point)))
      ;; If we aren't right after an abbreviation,
      ;; move point back to just after one.
      ;; This is so the user can get successive words
      ;; by typing the punctuation followed by M-/.
      (save-match-data
	(if (save-excursion
	      (forward-char -1)
	      (not (looking-at (or dabbrev-abbrev-char-regexp
                                   "\\sw\\|\\s_"))))
	    (if (re-search-backward (or dabbrev-abbrev-char-regexp
                                        "\\sw\\|\\s_")
				    nil t)
		(forward-char 1)
	      (user-error "No possible abbreviation preceding point"))))
      ;; Now find the beginning of that one.
      (dabbrev--goto-start-of-abbrev)
      (buffer-substring-no-properties (point) end))))