diff options
| author | Stefan Monnier | 2006-01-23 22:04:36 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2006-01-23 22:04:36 +0000 |
| commit | 1e3b6bec727d28a561c86945a018416dd99fe2e2 (patch) | |
| tree | 0dfc6ae7caa85d62ce64fdcc7037ae87435c667d | |
| parent | 9dd28cae262b1f6d18244592175aae01364432b3 (diff) | |
| download | emacs-1e3b6bec727d28a561c86945a018416dd99fe2e2.tar.gz emacs-1e3b6bec727d28a561c86945a018416dd99fe2e2.zip | |
(ses-read-cell): Provide a default value.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/ses.el | 27 |
2 files changed, 17 insertions, 14 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bb821cdfcd3..1f65a3bfa90 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2006-01-23 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * ses.el (ses-read-cell): Provide a default value. | ||
| 4 | |||
| 1 | 2006-01-23 Juanma Barranquero <lekktu@gmail.com> | 5 | 2006-01-23 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 6 | ||
| 3 | * term/w32-win.el (image-library-alist): Add additional names for | 7 | * term/w32-win.el (image-library-alist): Add additional names for |
diff --git a/lisp/ses.el b/lisp/ses.el index 4c959c015a7..debb22d84db 100644 --- a/lisp/ses.el +++ b/lisp/ses.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; ses.el -- Simple Emacs Spreadsheet -*- coding: utf-8 -*- | 1 | ;;; ses.el -- Simple Emacs Spreadsheet -*- coding: utf-8 -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Jonathan Yavner <jyavner@member.fsf.org> | 5 | ;; Author: Jonathan Yavner <jyavner@member.fsf.org> |
| 6 | ;; Maintainer: Jonathan Yavner <jyavner@member.fsf.org> | 6 | ;; Maintainer: Jonathan Yavner <jyavner@member.fsf.org> |
| @@ -148,8 +148,7 @@ Each function is called with ARG=1." | |||
| 148 | (newmap (make-sparse-keymap))) | 148 | (newmap (make-sparse-keymap))) |
| 149 | (set-keymap-parent newmap minibuffer-local-map) | 149 | (set-keymap-parent newmap minibuffer-local-map) |
| 150 | (while keys | 150 | (while keys |
| 151 | (define-key newmap (car keys) (cadr keys)) | 151 | (define-key newmap (pop keys) (pop keys))) |
| 152 | (setq keys (cddr keys))) | ||
| 153 | newmap) | 152 | newmap) |
| 154 | "Local keymap for SES minibuffer cell-editing.") | 153 | "Local keymap for SES minibuffer cell-editing.") |
| 155 | 154 | ||
| @@ -1865,20 +1864,20 @@ cell formula was unsafe and user declined confirmation." | |||
| 1865 | (defun ses-read-cell (row col newval) | 1864 | (defun ses-read-cell (row col newval) |
| 1866 | "Self-insert for initial character of cell function." | 1865 | "Self-insert for initial character of cell function." |
| 1867 | (interactive | 1866 | (interactive |
| 1868 | (let ((initial (this-command-keys)) | 1867 | (let* ((initial (this-command-keys)) |
| 1869 | (rowcol (progn (ses-check-curcell) (ses-sym-rowcol ses--curcell)))) | 1868 | (rowcol (progn (ses-check-curcell) (ses-sym-rowcol ses--curcell))) |
| 1869 | (curval (ses-cell-formula (car rowcol) (cdr rowcol)))) | ||
| 1870 | (barf-if-buffer-read-only) | 1870 | (barf-if-buffer-read-only) |
| 1871 | (if (string= initial "\"") | ||
| 1872 | (setq initial "\"\"") ;Enter a string | ||
| 1873 | (if (string= initial "(") | ||
| 1874 | (setq initial "()"))) ;Enter a formula list | ||
| 1875 | (list (car rowcol) | 1871 | (list (car rowcol) |
| 1876 | (cdr rowcol) | 1872 | (cdr rowcol) |
| 1877 | (read-from-minibuffer (format "Cell %s: " ses--curcell) | 1873 | (read-from-minibuffer |
| 1878 | (cons initial 2) | 1874 | (format "Cell %s: " ses--curcell) |
| 1879 | ses-mode-edit-map | 1875 | (cons (if (equal initial "\"") "\"\"" |
| 1880 | t ;Convert to Lisp object | 1876 | (if (equal initial "(") "()" initial)) 2) |
| 1881 | 'ses-read-cell-history)))) | 1877 | ses-mode-edit-map |
| 1878 | t ;Convert to Lisp object | ||
| 1879 | 'ses-read-cell-history | ||
| 1880 | (prin1-to-string curval))))) | ||
| 1882 | (when (ses-edit-cell row col newval) | 1881 | (when (ses-edit-cell row col newval) |
| 1883 | (ses-command-hook) ;Update cell widths before movement | 1882 | (ses-command-hook) ;Update cell widths before movement |
| 1884 | (dolist (x ses-after-entry-functions) | 1883 | (dolist (x ses-after-entry-functions) |