emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/emacs-lisp/lisp-mode.el


From: Juri Linkov
Subject: [Emacs-diffs] Changes to emacs/lisp/emacs-lisp/lisp-mode.el
Date: Fri, 28 May 2004 22:37:04 -0400

Index: emacs/lisp/emacs-lisp/lisp-mode.el
diff -c emacs/lisp/emacs-lisp/lisp-mode.el:1.157 
emacs/lisp/emacs-lisp/lisp-mode.el:1.158
*** emacs/lisp/emacs-lisp/lisp-mode.el:1.157    Tue May 25 20:51:04 2004
--- emacs/lisp/emacs-lisp/lisp-mode.el  Fri May 28 21:09:05 2004
***************
*** 239,244 ****
--- 239,245 ----
      (set-keymap-parent emacs-lisp-mode-map lisp-mode-shared-map)
      (define-key emacs-lisp-mode-map "\e\t" 'lisp-complete-symbol)
      (define-key emacs-lisp-mode-map "\e\C-x" 'eval-defun)
+     (define-key emacs-lisp-mode-map "\e\C-q" 'indent-pp-sexp)
      (define-key emacs-lisp-mode-map [menu-bar] (make-sparse-keymap))
      (define-key emacs-lisp-mode-map [menu-bar emacs-lisp]
        (cons "Emacs-Lisp" map))
***************
*** 377,382 ****
--- 378,384 ----
    (let ((map (make-sparse-keymap)))
      (set-keymap-parent map lisp-mode-shared-map)
      (define-key map "\e\C-x" 'eval-defun)
+     (define-key map "\e\C-q" 'indent-pp-sexp)
      (define-key map "\e\t" 'lisp-complete-symbol)
      (define-key map "\n" 'eval-print-last-sexp)
      map)
***************
*** 532,544 ****
                         (prin1-to-string value)))
        (print-length eval-expression-print-length)
        (print-level eval-expression-print-level)
-       (char-string (prin1-char value))
        (beg (point))
        end)
      (prog1
        (prin1 value)
!       (if (and (eq standard-output t) char-string)
!         (princ (concat " = " char-string)))
        (setq end (point))
        (when (and (bufferp standard-output)
                 (or (not (null print-length))
--- 534,546 ----
                         (prin1-to-string value)))
        (print-length eval-expression-print-length)
        (print-level eval-expression-print-level)
        (beg (point))
        end)
      (prog1
        (prin1 value)
!       (if (eq standard-output t)
!           (let ((str (eval-expression-print-format value)))
!             (if str (princ str))))
        (setq end (point))
        (when (and (bufferp standard-output)
                 (or (not (null print-length))
***************
*** 1091,1096 ****
--- 1093,1111 ----
           (lisp-indent-line))
        (indent-sexp endmark)
        (set-marker endmark nil))))
+ 
+ (defun indent-pp-sexp (&optional arg)
+   "Indent each line of the list or, with prefix ARG, pretty-printify the 
list."
+   (interactive "P")
+   (if arg
+       (save-excursion
+         (save-restriction
+           (narrow-to-region (point) (progn (forward-sexp 1) (point)))
+           (pp-buffer)
+           (goto-char (point-max))
+           (if (eq (char-before) ?\n)
+               (delete-char -1)))))
+   (indent-sexp))
  
  ;;;; Lisp paragraph filling commands.
  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]