+2013-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * 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 <xfq.free@gmail.com>
* progmodes/flymake.el (flymake-save-buffer-in-file)
(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."
(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))
\(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.")
(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)
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)