Mercurial > emacs
changeset 54571:54265a0f59a7
(ses-read-number): Move to subr.el.
(ses-set-header-row): Use read-number.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Fri, 26 Mar 2004 14:50:41 +0000 |
parents | cf58c77ee000 |
children | 2f882266c186 |
files | lisp/ses.el |
diffstat | 1 files changed, 1 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ses.el Fri Mar 26 14:49:12 2004 +0000 +++ b/lisp/ses.el Fri Mar 26 14:50:41 2004 +0000 @@ -2658,27 +2658,6 @@ ;;;; Other user commands ;;;---------------------------------------------------------------------------- -;; This should be used by `call-interactively'. -(defun ses-read-number (prompt &optional default) - (let ((n nil)) - (when default - (setq prompt - (if (string-match "\\(\\):[^:]*" prompt) - (replace-match (format " [%s]" default) t t prompt 1) - (concat prompt (format " [%s] " default))))) - (while - (progn - (let ((str (read-from-minibuffer prompt nil nil nil nil - (number-to-string default)))) - (setq n (cond - ((zerop (length str)) default) - ((stringp str) (read str))))) - (unless (numberp n) - (message "Please enter a number.") - (sit-for 1) - t))) - n)) - (defun ses-unset-header-row () "Select the default header row." (interactive) @@ -2694,7 +2673,7 @@ (list (if (numberp current-prefix-arg) current-prefix-arg (let ((currow (1+ (car (ses-sym-rowcol ses--curcell))))) (if current-prefix-arg - (ses-read-number "Header row: " currow) + (read-number "Header row: " currow) currow))))) (if (or (< row 0) (> row ses--numrows)) (error "Invalid header-row"))