• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/emacs-lisp/

Lines Matching +defs:last +defs:sexp

186                                        (progn (forward-sexp 1) t))
219 (make-local-variable 'parse-sexp-ignore-comments)
220 (setq parse-sexp-ignore-comments t)
263 (define-key map "\e\C-q" 'indent-sexp)
283 (define-key emacs-lisp-mode-map "\e\C-q" 'indent-pp-sexp)
298 (define-key map [eval-sexp] '("Evaluate Last S-expression" . eval-last-sexp))
320 ;; Recompile if file or buffer has changed since last compilation.
422 (define-key map "\e\C-q" 'indent-pp-sexp)
424 (define-key map "\n" 'eval-print-last-sexp)
432 Like Lisp mode except that \\[eval-print-last-sexp] evals the Lisp expression
445 (defun eval-print-last-sexp ()
446 "Evaluate sexp before point; print value into current buffer.
457 (eval-last-sexp t)
461 (defun last-sexp-setup-props (beg end value alt1 alt2)
462 "Set up text properties for the output of `eval-last-sexp-1'.
467 (define-key map "\C-m" 'last-sexp-toggle-display)
469 (define-key map [mouse-2] 'last-sexp-toggle-display)
480 (defun last-sexp-toggle-display (&optional arg)
497 (last-sexp-setup-props beg (point)
540 (defun eval-last-sexp-1 (eval-last-sexp-arg-internal)
541 "Evaluate sexp before point; print value in minibuffer.
543 (let ((standard-output (if eval-last-sexp-arg-internal (current-buffer) t)))
551 ;; If this sexp appears to be enclosed in `...'
556 (forward-sexp -1)
571 (forward-sexp -1))))
595 (eval-last-sexp-print-value value))))
597 (defun eval-last-sexp-print-value (value)
614 (last-sexp-setup-props beg end value
620 (defvar eval-last-sexp-fake-value (make-symbol "t"))
622 (defun eval-last-sexp (eval-last-sexp-arg-internal)
623 "Evaluate sexp before point; print value in minibuffer.
630 (eval-last-sexp-1 eval-last-sexp-arg-internal)
631 (let ((old-value eval-last-sexp-fake-value) new-value value)
633 (setq value (eval-last-sexp-1 eval-last-sexp-arg-internal))
767 ;; parse-partial-sexp from beginning-of-defun). I.e. It avoids the problem of
816 (forward-sexp 1)
824 (defvar calculate-lisp-indent-last-sexp)
844 calculate-lisp-indent-last-sexp containing-sexp)
848 ;; Find outermost containing sexp
850 (setq state (parse-partial-sexp (point) indent-point 0)))
851 ;; Find innermost containing sexp
856 (setq calculate-lisp-indent-last-sexp (elt state 2))
857 (setq containing-sexp (elt state 1))
858 ;; Position following last unclosed open.
859 (goto-char (1+ containing-sexp))
860 ;; Is there a complete sexp since then?
861 (if (and calculate-lisp-indent-last-sexp
862 (> calculate-lisp-indent-last-sexp (point)))
863 ;; Yes, but is there a containing sexp after that?
864 (let ((peek (parse-partial-sexp calculate-lisp-indent-last-sexp
869 ;; Innermost containing sexp found
870 (goto-char (1+ containing-sexp))
871 (if (not calculate-lisp-indent-last-sexp)
875 ;; Find the start of first element of containing sexp.
876 (parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t)
878 ;; First element of containing sexp is a list.
882 calculate-lisp-indent-last-sexp)
883 ;; This is the first line to start within the containing sexp.
885 (if (= (point) calculate-lisp-indent-last-sexp)
886 ;; Containing sexp has nothing before this line
891 (progn (forward-sexp 1)
892 (parse-partial-sexp (point)
893 calculate-lisp-indent-last-sexp
897 ;; Indent beneath first sexp on same line as
898 ;; `calculate-lisp-indent-last-sexp'. Again, it's
900 (goto-char calculate-lisp-indent-last-sexp)
902 (parse-partial-sexp (point) calculate-lisp-indent-last-sexp
912 ((and (integerp lisp-indent-offset) containing-sexp)
914 (goto-char containing-sexp)
916 ;; in this case calculate-lisp-indent-last-sexp is not nil
917 (calculate-lisp-indent-last-sexp
925 ;; try to align a constant-symbol under the last
927 ;; the last 2 preceding symbols, in the previous
933 (> calculate-lisp-indent-last-sexp
935 (goto-char (1+ containing-sexp))
936 (parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t)
938 (let ((parse-sexp-ignore-comments t)
940 (goto-char calculate-lisp-indent-last-sexp)
944 (prog2 (backward-sexp) (point)))
951 ;; in this case calculate-lisp-indent-last-sexp is nil
963 STATE is the `parse-partial-sexp' state for that position.
979 (parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t)
985 calculate-lisp-indent-last-sexp))
986 (progn (goto-char calculate-lisp-indent-last-sexp)
988 (parse-partial-sexp (point)
989 calculate-lisp-indent-last-sexp 0 t)))
990 ;; Indent under the list or under the first sexp on the same
991 ;; line as calculate-lisp-indent-last-sexp. Note that first
992 ;; thing on that line has to be complete sexp since we are
993 ;; inside the innermost containing sexp.
997 (progn (forward-sexp 1) (point))))
1028 (forward-sexp 1)
1029 ;; Now find the start of the last form.
1030 (parse-partial-sexp (point) indent-point 1 t)
1035 (forward-sexp 1)
1036 (parse-partial-sexp (point) indent-point 1 t))
1038 ;; Point is sitting on first character of last (or count) sexp.
1106 (defun indent-sexp (&optional endpos)
1119 (last-point (point))
1120 last-depth bol outer-loop-done inner-loop-done state this-indent)
1122 ;; Get error now if we don't have a complete sexp after point.
1123 (save-excursion (forward-sexp 1)))
1128 (setq last-depth next-depth
1136 (setq state (parse-partial-sexp (point) (progn (end-of-line) (point))
1144 ;; because parse-partial-sexp never sees the newlines.
1162 last-depth (- last-depth next-depth)
1171 ;; If no specified end, we are done if we have finished one sexp.
1175 (while (> last-depth next-depth)
1177 last-depth (1- last-depth)))
1178 (while (< last-depth next-depth)
1180 last-depth (1+ last-depth)))
1206 (setq outer-loop-done (= (point) last-point))
1207 (setq last-point (point)))))))
1216 (indent-sexp endmark)
1219 (defun indent-pp-sexp (&optional arg)
1226 (narrow-to-region (point) (progn (forward-sexp 1) (point)))
1231 (indent-sexp))
1297 The last is a regexp which, if matched at the beginning of a line,
1306 (setq state (parse-partial-sexp (point)
1319 (setq state (parse-partial-sexp (point)