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

Lines Matching +defs:save +defs:point

61 ;;   You automatically save the completions you use to a file between
85 ;; (unless save-completions-flag or enable-completion is nil).
107 ;; control-u :: leave the point at the beginning of the completion rather
117 ;; kills the completion at point.
183 ;; Inserts a completion at point
187 ;; save them.
189 ;; save-completions-to-file &optional filename
247 ;; - Fix broken completion merging (in save-completions-to-file)
271 ;; - auto-save if haven't used for a 1/2 hour
272 ;; - save period extended to two weeks
274 ;; - added *completion-auto-save-period* to variables recorded.
276 ;; - added backup protection to save-completions-to-file (prevents
298 (defcustom save-completions-flag t
299 "Non-nil means save most-used completions when exiting Emacs.
300 See also `save-completions-retention-time'."
304 (defcustom save-completions-file-name
312 "The filename to save completions to."
316 (defcustom save-completions-retention-time 336
361 ;;(defvar *completion-auto-save-period* 1800
387 Used to decide whether to save completions.")
462 ;; The functions symbol-before-point, symbol-under-point, etc. quickly return
552 (defun symbol-under-point ()
553 "Return the symbol that the point is currently on.
558 (let ((saved-point (point)))
559 (setq cmpl-symbol-start (scan-sexps (1+ saved-point) -1)
560 cmpl-symbol-end (scan-sexps saved-point 1))
565 (setq cmpl-symbol-start (point))
566 (goto-char saved-point)))
571 (setq cmpl-symbol-end (point))
572 (goto-char saved-point)))
580 ;; tests for symbol-under-point
592 (defun symbol-before-point ()
593 "Return a string of the symbol immediately before point.
600 (setq cmpl-symbol-end (point)
606 (setq cmpl-symbol-start (point))
614 (let ((saved-point (point)))
615 (setq cmpl-symbol-start (scan-sexps saved-point -1))
618 (setq cmpl-symbol-end (point))
623 (setq cmpl-symbol-start (point))))
625 (goto-char saved-point)
633 ;; tests for symbol-before-point
647 (defun symbol-under-or-before-point ()
655 (symbol-under-point)
656 (symbol-before-point)))
659 (defun symbol-before-point-for-complete ()
660 ;; "Returns a string of the symbol immediately before point
661 ;; or nil if there isn't one. Like symbol-before-point but doesn't trim the
667 (setq cmpl-symbol-end (point)
673 (setq cmpl-symbol-start (point))
682 ;; tests for symbol-before-point-for-complete
750 (defvar cdabbrev-current-point 0)
751 ;; "The current point position the cdabbrev search is at.")
761 (defvar cdabbrev-start-point 0)
762 (defvar cdabbrev-stop-point)
803 (save-excursion
805 (setq cdabbrev-current-point (point)
806 cdabbrev-start-point cdabbrev-current-point
807 cdabbrev-stop-point
809 (max (point-min)
810 (- cdabbrev-start-point completion-search-distance))
811 (point-min))
821 (let (saved-point
824 downcase-expansion tried-list syntax saved-point-2)
825 (save-excursion
831 (setq saved-point (point)
835 (goto-char cdabbrev-current-point)
841 (search-backward cdabbrev-abbrev-string cdabbrev-stop-point t)
850 (setq saved-point-2 (point))
854 (goto-char saved-point-2)))))
856 (setq expansion (symbol-under-point))
867 ;; at this point tried-list will be nil if this
878 (goto-char (setq cdabbrev-current-point
880 (min (point-max) (+ cdabbrev-start-point completion-search-distance))
881 (point-max))))
889 cdabbrev-current-point (point)))))
891 (goto-char saved-point)))
955 ;; "The number of times it has used. Used to decide whether to save
961 ;; whether to save it. t if one should always save it."
1310 (let* ((default (symbol-under-or-before-point))
1367 (defun use-completion-under-point ()
1368 "Add the completion symbol underneath the point into the completion buffer."
1369 (let ((string (and enable-completion (symbol-under-point)))
1373 (defun use-completion-before-point ()
1374 "Add the completion symbol before point into the completion buffer."
1375 (let ((string (and enable-completion (symbol-before-point)))
1379 (defun use-completion-under-or-before-point ()
1380 "Add the completion symbol before point into the completion buffer."
1381 (let ((string (and enable-completion (symbol-under-or-before-point)))
1386 "Add the completion symbol before point into the completion buffer.
1389 (let ((string (and enable-completion (symbol-before-point)))
1498 ;; otherwise point to one before current
1602 (defvar cmpl-leave-point-at-start nil)
1605 "Fill out a completion of the word before point.
1608 control-u :: leave the point at the beginning of the completion rather
1617 (delete-region cmpl-last-insert-location (point))
1625 (setq cmpl-leave-point-at-start t))
1627 (setq cmpl-leave-point-at-start nil)))
1629 (setq cmpl-original-string (symbol-before-point-for-complete))
1632 (error "To complete, point must be after a symbol at least %d character long"
1644 ;; point is at the point to insert the new symbol
1649 (insert-point (point))
1665 ;; fixup and cache point
1666 (cond (cmpl-leave-point-at-start
1667 (setq cmpl-last-insert-location (point))
1668 (goto-char insert-point))
1669 (t;; point at end,
1670 (setq cmpl-last-insert-location insert-point)))
1748 mode (point-max)
1771 (save-excursion
1772 (goto-char (point-min))
1778 (and (setq string (symbol-under-point))
1810 (save-excursion
1811 (goto-char (point-min))
1815 (and (setq string (symbol-under-point))
1902 (let (string next-point char)
1903 (save-excursion
1904 (goto-char (point-min))
1920 (setq string (symbol-before-point))
1925 (setq next-point (point))
1927 next-point
1929 (setq next-point (scan-sexps next-point 1)))
1930 ;; position the point on the word we want to add
1931 (goto-char next-point)
1936 (setq next-point (scan-sexps (point) 1))))
1939 (if (setq string (symbol-under-point))
1947 (symbol-under-point))))
1950 (goto-char next-point)
1955 (setq next-point (scan-sexps next-point 1)
1956 char (char-after next-point)))
1959 (setq next-point nil)))))))
1979 ;; The version of save-completions-to-file called at kill-emacs time.
1980 (defun kill-emacs-save-completions ()
1981 (if (and save-completions-flag enable-completion cmpl-initialized-p)
1986 (save-completions-to-file))))
1989 ;; There is no point bothering to change this again
2007 (defun save-completions-to-file (&optional filename)
2009 If file name is not specified, use `save-completions-file-name'."
2011 (setq filename (expand-file-name (or filename save-completions-file-name)))
2028 (with-current-buffer (get-buffer-create " *completion-save-buffer*")
2057 ;; save-completions-retention-time is nil
2058 (or (not save-completions-retention-time)
2061 save-completions-retention-time)))))
2084 (save-buffer)
2090 (message "Couldn't save completion file `%s'" filename)))
2094 (record-save-completions total-in-db total-perm total-saved))))))
2096 ;;(defun auto-save-completions ()
2097 ;; (if (and save-completions-flag enable-completion cmpl-initialized-p
2098 ;; *completion-auto-save-period*
2099 ;; (> cmpl-emacs-idle-time *completion-auto-save-period*)
2101 ;; (save-completions-to-file)))
2103 ;;(add-hook 'cmpl-emacs-idle-time-hooks 'auto-save-completions)
2107 If file is not specified, then use `save-completions-file-name'."
2109 (setq filename (expand-file-name (or filename save-completions-file-name)))
2118 (with-current-buffer (get-buffer-create " *completion-save-buffer*")
2144 (goto-char (point-min))
2184 (if (= (point) (point-max))
2199 Also sets up so that exiting Emacs will automatically save the file."
2211 "Kill between point and mark.
2226 (delete-region (point) cmpl-last-insert-location)
2247 ;; symbol before point to the completion list (using ADD-COMPLETION).
2274 (:before . use-completion-before-point)
2277 (:under . use-completion-under-point)
2278 (:under-or-before . use-completion-under-or-before-point)
2287 (use-completion-under-point)
2300 'use-completion-under-or-before-point)))
2371 (kill-emacs-hook . kill-emacs-save-completions)
2490 (dolist (x '("^To complete, the point must be after a symbol at least [0-9]* character long\\.$"