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

Lines Matching +defs:abbrev +defs:start +defs:location

10 ;; Keywords: abbrev expand completion convenience
73 ;; right. It resets them after finding the abbrev.
105 :group 'abbrev
119 (defcustom dabbrev-abbrev-skip-leading-regexp nil
188 (defcustom dabbrev-abbrev-char-regexp nil
197 previous word-start, but the search is for symbols.
302 (defvar dabbrev--last-abbrev-location nil)
311 (defvar dabbrev--last-expansion-location nil)
333 (defvar dabbrev--abbrev-char-regexp nil)
382 (abbrev (dabbrev--abbrev-at-point))
387 (string= abbrev (downcase abbrev)))))
394 (setq dabbrev--last-abbreviation abbrev)
397 (dabbrev--find-all-expansions abbrev ignore-case-p))
403 abbrev
411 ((string= abbrev (upcase abbrev))
415 ((string= (substring abbrev 0 1)
416 (upcase (substring abbrev 0 1)))
427 (setq init (try-completion abbrev my-obarray))))
432 (setq init abbrev))
436 (not (string-equal (downcase init) (downcase abbrev))))
441 (dabbrev--substitute-expansion nil abbrev init nil))
472 See also `dabbrev-abbrev-char-regexp' and \\[dabbrev-completion]."
474 (let (abbrev record-case-pattern
476 ;; abbrev -- the abbrev to expand
479 ;; (the abbrev, or the previously-made expansion)
482 (markerp dabbrev--last-abbrev-location)
483 (marker-position dabbrev--last-abbrev-location)
486 (= dabbrev--last-abbrev-location
488 ;; Find a different expansion for the same abbrev as last time.
490 (setq abbrev dabbrev--last-abbreviation)
496 (markerp dabbrev--last-abbrev-location)
497 (marker-position dabbrev--last-abbrev-location)
498 (= (point) (1+ dabbrev--last-abbrev-location)))
500 ;; The "abbrev" to expand is just the space.
501 (setq abbrev " ")
510 (< dabbrev--last-expansion-location (point))))
511 (setq dabbrev--last-expansion-location
512 (+ dabbrev--last-expansion-location
514 (goto-char dabbrev--last-expansion-location)
518 (concat "\\(?:" dabbrev--abbrev-char-regexp "\\)+"))
520 dabbrev--last-expansion-location (point)))
523 (setq dabbrev--last-expansion-location (point))))
524 ;; Indicate that dabbrev--last-expansion-location is
528 ;; We have a different abbrev to expand.
533 (setq abbrev (dabbrev--abbrev-at-point))
542 (dabbrev--find-expansion abbrev direction
547 (string= abbrev (downcase abbrev))))))))
554 ;; Put back the original abbrev with its original case pattern.
556 (insert abbrev)
559 (if old " further" "") abbrev))
570 (numberp dabbrev--last-expansion-location)
571 (and (> dabbrev--last-expansion-location (point))))
572 (setq dabbrev--last-expansion-location
573 (copy-marker dabbrev--last-expansion-location)))
576 (dabbrev--substitute-expansion old abbrev expansion
581 (setq dabbrev--last-abbreviation abbrev)
582 (setq dabbrev--last-abbrev-location (point-marker))))))
595 ;;; Back over all abbrev type characters and then moves forward over
597 (defun dabbrev--goto-start-of-abbrev ()
598 ;; Move backwards over abbrev chars
602 (while (and (looking-at dabbrev--abbrev-char-regexp)
607 (or (looking-at dabbrev--abbrev-char-regexp)
609 (and dabbrev-abbrev-skip-leading-regexp
610 (while (looking-at dabbrev-abbrev-skip-leading-regexp)
614 (defun dabbrev--abbrev-at-point ()
618 ;; Return abbrev at point
621 (setq dabbrev--last-abbrev-location (point))
630 (or dabbrev-abbrev-char-regexp
633 (if (re-search-backward (or dabbrev-abbrev-char-regexp
639 (dabbrev--goto-start-of-abbrev)
641 dabbrev--last-abbrev-location (point))))
649 dabbrev--last-abbrev-location nil
652 dabbrev--last-expansion-location nil
656 dabbrev--abbrev-char-regexp (or dabbrev-abbrev-char-regexp
661 "Return a list of other buffers to search for a possible abbrev.
677 (defun dabbrev--try-find (abbrev reverse n ignore-case)
680 Return the expansion found, and save the location of the start
681 of the expansion in `dabbrev--last-expansion-location'."
686 (and dabbrev--last-expansion-location
687 (goto-char dabbrev--last-expansion-location))
691 (setq expansion (dabbrev--search abbrev
700 (setq dabbrev--last-expansion-location (point)))
703 (defun dabbrev--find-all-expansions (abbrev ignore-case)
710 (while (setq expansion (dabbrev--find-expansion abbrev -1 ignore-case))
729 (defun dabbrev--find-expansion (abbrev direction ignore-case)
737 It sets `dabbrev--last-expansion-location' to the location
738 of the start of the occurrence."
752 (dabbrev--try-find abbrev t
763 (dabbrev--try-find abbrev nil
768 ;; Always start at (point-min) and look forward.
785 (setq dabbrev--last-expansion-location (point-min))
786 (setq expansion (dabbrev--try-find abbrev nil 1 ignore-case)))
842 (defun dabbrev--substitute-expansion (old abbrev expansion record-case-pattern)
856 (string= abbrev (downcase abbrev)))
864 (when (equal abbrev " ")
872 ;; or if the abbrev has mixed case,
873 ;; and if the given abbrev's case pattern
874 ;; matches the start of the expansion,
879 ;; characters) abbrev as "not all upper case", so as to force
883 (first-letter-position (string-match "[[:alpha:]]" abbrev)))
887 (or (string= abbrev (downcase abbrev))
888 (and (string= abbrev (upcase abbrev))
889 (> (- (length abbrev) first-letter-position)
891 (string= abbrev
892 (substring expansion 0 (length abbrev)))))
895 ;; If the abbrev and the expansion are both all-lower-case
900 (string= abbrev (downcase abbrev)))
912 (cond ((equal abbrev (upcase abbrev)) 'upcase)
913 ((equal abbrev (downcase abbrev)) 'downcase)))))
919 (let ((pos (length abbrev)))
928 (search-backward abbrev)
929 (search-forward abbrev))
943 (defun dabbrev--search (abbrev reverse ignore-case)
959 Leaves point at the location of the start of the expansion."
961 (let ((pattern1 (concat (regexp-quote abbrev)
962 "\\(" dabbrev--abbrev-char-regexp "\\)"))
963 (pattern2 (concat (regexp-quote abbrev)
964 "\\(\\(" dabbrev--abbrev-char-regexp "\\)+\\)"))
972 (narrow-to-region dabbrev--last-expansion-location
984 ;; back up to start of word and verify we still match.
985 (dabbrev--goto-start-of-abbrev)