aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBastien Guerry2008-02-15 16:32:39 +0000
committerBastien Guerry2008-02-15 16:32:39 +0000
commit6ad18d45df7f687f3eb3c2d18862e1717430a2cc (patch)
tree2e64d9672e42757363d652dd25a0ff2237fdcdda
parent1b6406b3b1a49da644698acd09ca94bb069c3ed3 (diff)
downloademacs-6ad18d45df7f687f3eb3c2d18862e1717430a2cc.tar.gz
emacs-6ad18d45df7f687f3eb3c2d18862e1717430a2cc.zip
2008-02-15 Lawrence Mitchell <wence@gmx.li> (tiny change)
* ielm.el (ielm-is-whitespace): Remove. (ielm-is-whitespace-or-comment): New function. (ielm-eval-input): Use it.
-rw-r--r--lisp/ielm.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/ielm.el b/lisp/ielm.el
index 764e78bc734..a9255587be5 100644
--- a/lisp/ielm.el
+++ b/lisp/ielm.el
@@ -300,9 +300,10 @@ simply inserts a newline."
300 300
301;;; Utility functions 301;;; Utility functions
302 302
303(defun ielm-is-whitespace (string) 303(defun ielm-is-whitespace-or-comment (string)
304 "Return non-nil if STRING is all whitespace." 304 "Return non-nil if STRING is all whitespace."
305 (or (string= string "") (string-match "\\`[ \t\n]+\\'" string))) 305 (or (string= string "")
306 (string-match "\\`[ \t\n]*\\(?:;.*\\)*\\'" string)))
306 307
307;;; Evaluation 308;;; Evaluation
308 309
@@ -327,7 +328,7 @@ simply inserts a newline."
327 (ielm-output "") ; result to display 328 (ielm-output "") ; result to display
328 (ielm-wbuf ielm-working-buffer) ; current buffer after evaluation 329 (ielm-wbuf ielm-working-buffer) ; current buffer after evaluation
329 (ielm-pmark (ielm-pm))) 330 (ielm-pmark (ielm-pm)))
330 (if (not (ielm-is-whitespace ielm-string)) 331 (if (not (ielm-is-whitespace-or-comment ielm-string))
331 (progn 332 (progn
332 (condition-case err 333 (condition-case err
333 (let (rout) 334 (let (rout)
@@ -342,7 +343,8 @@ simply inserts a newline."
342 (setq ielm-result "Working buffer has been killed" 343 (setq ielm-result "Working buffer has been killed"
343 ielm-error-type "IELM Error" 344 ielm-error-type "IELM Error"
344 ielm-wbuf (current-buffer)) 345 ielm-wbuf (current-buffer))
345 (if (ielm-is-whitespace (substring ielm-string ielm-pos)) 346 (if (ielm-is-whitespace-or-comment
347 (substring ielm-string ielm-pos))
346 ;; To correctly handle the ielm-local variables *, 348 ;; To correctly handle the ielm-local variables *,
347 ;; ** and ***, we need a temporary buffer to be 349 ;; ** and ***, we need a temporary buffer to be
348 ;; current at entry to the inner of the next two let 350 ;; current at entry to the inner of the next two let