Mercurial > emacs
changeset 91851:59ebf26b96e4
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.
author | Bastien Guerry <bzg@altern.org> |
---|---|
date | Fri, 15 Feb 2008 16:32:39 +0000 |
parents | d317101e8648 |
children | e05f6258e35f |
files | lisp/ielm.el |
diffstat | 1 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ielm.el Fri Feb 15 16:08:27 2008 +0000 +++ b/lisp/ielm.el Fri Feb 15 16:32:39 2008 +0000 @@ -300,9 +300,10 @@ ;;; Utility functions -(defun ielm-is-whitespace (string) +(defun ielm-is-whitespace-or-comment (string) "Return non-nil if STRING is all whitespace." - (or (string= string "") (string-match "\\`[ \t\n]+\\'" string))) + (or (string= string "") + (string-match "\\`[ \t\n]*\\(?:;.*\\)*\\'" string))) ;;; Evaluation @@ -327,7 +328,7 @@ (ielm-output "") ; result to display (ielm-wbuf ielm-working-buffer) ; current buffer after evaluation (ielm-pmark (ielm-pm))) - (if (not (ielm-is-whitespace ielm-string)) + (if (not (ielm-is-whitespace-or-comment ielm-string)) (progn (condition-case err (let (rout) @@ -342,7 +343,8 @@ (setq ielm-result "Working buffer has been killed" ielm-error-type "IELM Error" ielm-wbuf (current-buffer)) - (if (ielm-is-whitespace (substring ielm-string ielm-pos)) + (if (ielm-is-whitespace-or-comment + (substring ielm-string ielm-pos)) ;; To correctly handle the ielm-local variables *, ;; ** and ***, we need a temporary buffer to be ;; current at entry to the inner of the next two let