emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r112726: * lisp/simple.el (read--expr


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r112726: * lisp/simple.el (read--expression): New function, extracted from
Date: Fri, 24 May 2013 22:21:49 -0400
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 112726
fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14465
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Fri 2013-05-24 22:21:49 -0400
message:
  * lisp/simple.el (read--expression): New function, extracted from
  eval-expression.  Set completion-at-point-functions.
  (eval-expression, eval-minibuffer): Use it.
  
  * lisp/progmodes/flymake.el (flymake-nop): Don't return a string.
  (flymake-set-at): Fix typo.
modified:
  lisp/ChangeLog
  lisp/progmodes/flymake.el
  lisp/simple.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-05-25 01:26:12 +0000
+++ b/lisp/ChangeLog    2013-05-25 02:21:49 +0000
@@ -1,3 +1,12 @@
+2013-05-25  Stefan Monnier  <address@hidden>
+
+       * progmodes/flymake.el (flymake-nop): Don't return a string.
+       (flymake-set-at): Fix typo.
+
+       * simple.el (read--expression): New function, extracted from
+       eval-expression.  Set completion-at-point-functions (bug#14465).
+       (eval-expression, eval-minibuffer): Use it.
+
 2013-05-25  Xue Fuqiao  <address@hidden>
 
        * progmodes/flymake.el (flymake-save-buffer-in-file)

=== modified file 'lisp/progmodes/flymake.el'
--- a/lisp/progmodes/flymake.el 2013-05-25 01:26:12 +0000
+++ b/lisp/progmodes/flymake.el 2013-05-25 02:21:49 +0000
@@ -170,7 +170,8 @@
 (if (featurep 'xemacs) (progn
 
 (defun flymake-nop ()
-  "Do nothing.")
+  "Do nothing."
+  nil)
 
 (defun flymake-make-xemacs-menu (menu-data)
   "Return a menu specifier using MENU-DATA."
@@ -251,15 +252,14 @@
 (defun flymake-ins-after (list pos val)
   "Insert VAL into LIST after position POS.
 POS counts from zero."
-  (let ((tmp (copy-sequence list)))    ; Bind `tmp' to a copy of LIST
+  (let ((tmp (copy-sequence list)))
     (setcdr (nthcdr pos tmp) (cons val (nthcdr (1+ pos) tmp)))
     tmp))
 
 (defun flymake-set-at (list pos val)
-)
-"Set VAL at position POS in LIST.
+  "Set VAL at position POS in LIST.
 POS counts from zero."
-(let ((tmp (copy-sequence list)))      ; Bind `tmp' to a copy of LIST
+  (let ((tmp (copy-sequence list)))
     (setcar (nthcdr pos tmp) val)
     tmp))
 

=== modified file 'lisp/simple.el'
--- a/lisp/simple.el    2013-05-23 21:01:47 +0000
+++ b/lisp/simple.el    2013-05-25 02:21:49 +0000
@@ -1268,9 +1268,7 @@
 \(INITIAL-CONTENTS can also be a cons of a string and an integer.
 Such arguments are used as in `read-from-minibuffer'.)"
   ;; Used for interactive spec `X'.
-  ;; FIXME: Share code with `eval-expression'.
-  (eval (read-from-minibuffer prompt initial-contents read-expression-map
-                              t read-expression-history)))
+  (eval (read--expression prompt initial-contents)))
 
 (defvar minibuffer-completing-symbol nil
   "Non-nil means completing a Lisp symbol in the minibuffer.")
@@ -1322,6 +1320,17 @@
 (defvar eval-expression-minibuffer-setup-hook nil
   "Hook run by `eval-expression' when entering the minibuffer.")
 
+(defun read--expression (prompt &optional initial-contents)
+  (let ((minibuffer-completing-symbol t))
+    (minibuffer-with-setup-hook
+        (lambda ()
+          (add-hook 'completion-at-point-functions
+                    #'lisp-completion-at-point nil t)
+          (run-hooks 'eval-expression-minibuffer-setup-hook))
+      (read-from-minibuffer prompt initial-contents
+                            read-expression-map t
+                            'read-expression-history))))
+
 ;; We define this, rather than making `eval' interactive,
 ;; for the sake of completion of names like eval-region, eval-buffer.
 (defun eval-expression (exp &optional insert-value)
@@ -1338,12 +1347,7 @@
 If `eval-expression-debug-on-error' is non-nil, which is the default,
 this command arranges for all errors to enter the debugger."
   (interactive
-   (list (let ((minibuffer-completing-symbol t))
-          (minibuffer-with-setup-hook
-              (lambda () (run-hooks 'eval-expression-minibuffer-setup-hook))
-            (read-from-minibuffer "Eval: "
-                                  nil read-expression-map t
-                                  'read-expression-history)))
+   (list (read--expression "Eval: ")
         current-prefix-arg))
 
   (if (null eval-expression-debug-on-error)


reply via email to

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