]> git.eshelyaron.com Git - emacs.git/commitdiff
Make ses-jump with completing input.
authorVincent Belaïche <vincentb1@users.sourceforge.net>
Thu, 2 Jun 2016 18:57:32 +0000 (20:57 +0200)
committerVincent Belaïche <vincentb1@users.sourceforge.net>
Thu, 2 Jun 2016 18:57:32 +0000 (20:57 +0200)
* lisp/ses.el (ses-jump): Make symbol input completing against list of
  named cells.

lisp/ses.el

index b2fd2bbe9a5df0a95135eef873918372fa77b61a..305027c73bb476e58b3ba389426b45ce76bebf5a 100644 (file)
@@ -2201,7 +2201,17 @@ Based on the current set of columns and `window-hscroll' position."
 
 (defun ses-jump (sym)
   "Move point to cell SYM."
-  (interactive "SJump to cell: ")
+  (interactive (let* (names
+                     (s (completing-read
+                         "Jump to cell: "
+                         (and ses--named-cell-hashmap
+                              (progn (maphash (lambda (key val) (push (symbol-name key) names))
+                                              ses--named-cell-hashmap)
+                                     names)))))
+                (if
+                    (string= s "")
+                    (error "Invalid cell name")
+                  (list (intern s)))))
   (let ((rowcol (ses-sym-rowcol sym)))
     (or rowcol (error "Invalid cell name"))
     (if (eq (symbol-value sym) '*skip*)