emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r106698: Ooops... undo changes of rev


From: Vincent Belaïche
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r106698: Ooops... undo changes of revision 106664, as trunk branch is feature frozen, and revision 106664 was a feature addition.
Date: Mon, 19 Dec 2011 07:30:36 +0100
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 106698
committer: Vincent Belaïche  <address@hidden>
branch nick: trunk
timestamp: Mon 2011-12-19 07:30:36 +0100
message:
  Ooops... undo changes of revision 106664, as trunk branch is feature frozen, 
and revision 106664 was a feature addition.
modified:
  lisp/ChangeLog
  lisp/ses.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-12-18 13:49:38 +0000
+++ b/lisp/ChangeLog    2011-12-19 06:30:36 +0000
@@ -1,3 +1,9 @@
+2011-12-19  Vincent Belaïche  <address@hidden>
+
+       * ses.el: Ooops... undo changes of revision 106664, as trunk
+       branch is feature frozen, and revision 106664 was a feature
+       addition.
+
 2011-12-18  Jan Djärv  <address@hidden>
 
        * term/ns-win.el (ns-get-selection-internal)

=== modified file 'lisp/ses.el'
--- a/lisp/ses.el       2011-12-11 17:08:11 +0000
+++ b/lisp/ses.el       2011-12-19 06:30:36 +0000
@@ -674,13 +674,6 @@
        (put sym 'ses-cell (cons xrow xcol))
        (make-local-variable sym)))))
 
-(defun ses-create-cell-variable (sym row col)
-  "Create a buffer-local variable for cell with symbol
-SYM at position ROW COL.  Return nil in case of failure."
-  (unless (local-variable-p sym)
-    (make-local-variable  sym)
-    (put sym 'ses-cell (cons row col))))
-
 ;; We do not delete the ses-cell properties for the cell-variables, in
 ;; case a formula that refers to this cell is in the kill-ring and is
 ;; later pasted back in.
@@ -1406,8 +1399,7 @@
 Sets `ses-relocate-return' to 'delete if cell-references were removed."
   (let (rowcol result)
     (if (or (atom formula) (eq (car formula) 'quote))
-       (if (and (setq rowcol (ses-sym-rowcol formula))
-                (string-match "\\`[A-Z]+[0-9]+\\'" (symbol-name formula)))
+       (if (setq rowcol (ses-sym-rowcol formula))
            (ses-relocate-symbol formula rowcol
                                 startrow startcol rowincr colincr)
          formula) ; Pass through as-is.
@@ -1515,15 +1507,14 @@
 the rectangle (MINROW,MINCOL)..(NUMROWS,NUMCOLS) by adding ROWINCR and COLINCR
 to each symbol."
   (let (reform)
-    (let (mycell newval xrow)
+    (let (mycell newval)
       (dotimes-with-progress-reporter
          (row ses--numrows) "Relocating formulas..."
        (dotimes (col ses--numcols)
          (setq ses-relocate-return nil
                mycell (ses-get-cell row col)
                newval (ses-relocate-formula (ses-cell-formula mycell)
-                                            minrow mincol rowincr colincr)
-               xrow  (- row rowincr))
+                                            minrow mincol rowincr colincr))
          (ses-set-cell row col 'formula newval)
          (if (eq ses-relocate-return 'range)
              ;; This cell contains a (ses-range X Y) where a cell has been
@@ -1539,22 +1530,8 @@
                                             minrow mincol rowincr colincr))
          (ses-set-cell row col 'references newval)
          (and (>= row minrow) (>= col mincol)
-              (let ((sym (ses-cell-symbol row col))
-                    (xcol (- col colincr)))
-                (if (and
-                     sym
-                     (>= xrow 0)
-                     (>= xcol 0)
-                     (null (eq sym
-                               (ses-create-cell-symbol xrow xcol))))
-                    ;; This is a renamed cell, do not update the cell
-                    ;; name, but just update the coordinate property.
-                    (put sym 'ses-cell (cons row col))
-                  (ses-set-cell row col 'symbol
-                                (setq sym (ses-create-cell-symbol row col)))
-                  (unless (and (boundp sym) (local-variable-p sym))
-                    (set (make-local-variable sym) nil)
-                    (put sym 'ses-cell (cons row col)))))) )))
+              (ses-set-cell row col 'symbol
+                            (ses-create-cell-symbol row col))))))
     ;; Relocate the cell values.
     (let (oldval myrow mycol xrow xcol)
       (cond
@@ -1567,17 +1544,11 @@
            (setq mycol  (+ col mincol)
                  xrow   (- myrow rowincr)
                  xcol   (- mycol colincr))
-           (let ((sym (ses-cell-symbol myrow mycol))
-                 (xsym (ses-create-cell-symbol xrow xcol)))
-             ;; Make the value relocation only when if the cell is not
-             ;; a renamed cell.  Otherwise this is not needed.
-             (and (eq sym xsym)
-                 (ses-set-cell myrow mycol 'value
-                   (if (and (< xrow ses--numrows) (< xcol ses--numcols))
-                       (ses-cell-value xrow xcol)
-                     ;;Cell is off the end of the array
-                     (symbol-value xsym))))))))
-
+           (if (and (< xrow ses--numrows) (< xcol ses--numcols))
+               (setq oldval (ses-cell-value xrow xcol))
+             ;; Cell is off the end of the array.
+             (setq oldval (symbol-value (ses-create-cell-symbol xrow xcol))))
+           (ses-set-cell myrow mycol 'value oldval))))
        ((and (wholenump rowincr) (wholenump colincr))
        ;; Insertion of rows and/or columns.  Run the loop backwards.
        (let ((disty (1- ses--numrows))
@@ -1687,6 +1658,7 @@
        (message "Upgrading from SES-1 file format")))
     (or (= ses--file-format 2)
        (error "This file needs a newer version of the SES library code"))
+    (ses-create-cell-variable-range 0 (1- ses--numrows) 0 (1- ses--numcols))
     ;; Initialize cell array.
     (setq ses--cells (make-vector ses--numrows nil))
     (dotimes (row ses--numrows)
@@ -1706,10 +1678,11 @@
   (dotimes (row ses--numrows)
     (dotimes (col ses--numcols)
       (let* ((x      (read (current-buffer)))
-            (sym  (car-safe (cdr-safe x))))
+            (rowcol (ses-sym-rowcol (car-safe (cdr-safe x)))))
        (or (and (looking-at "\n")
                 (eq (car-safe x) 'ses-cell)
-                (ses-create-cell-variable sym row col))
+                (eq row (car rowcol))
+                (eq col (cdr rowcol)))
            (error "Cell-def error"))
        (eval x)))
     (or (looking-at "\n\n")
@@ -3166,60 +3139,6 @@
   (mouse-set-point event)
   (ses-insert-ses-range))
 
-(defun ses-replace-name-in-formula (formula old-name new-name)
-  (let ((new-formula formula))
-    (unless (and (consp formula)
-                (eq (car-safe formula) 'quote))
-      (while formula
-       (let ((elt (car-safe formula)))
-         (cond
-          ((consp elt)
-           (setcar formula (ses-replace-name-in-formula elt old-name 
new-name)))
-          ((and (symbolp elt)
-                (eq (car-safe formula) old-name))
-           (setcar formula new-name))))
-       (setq formula (cdr formula))))
-    new-formula))
-
-(defun ses-rename-cell (new-name)
-  "Rename current cell."
-  (interactive "*SEnter new name: ")
-  (ses-check-curcell)
-  (or
-   (and  (local-variable-p new-name)
-        (ses-sym-rowcol new-name)
-        (error "Already a cell name"))
-   (and (boundp new-name)
-       (null (yes-or-no-p (format "`%S' is already bound outside this buffer, 
continue? "
-                                  new-name)))
-       (error "Already a bound cell name")))
-  (let* ((rowcol (ses-sym-rowcol ses--curcell))
-        (cell (ses-get-cell (car rowcol) (cdr rowcol))))
-    (dolist (reference (ses-cell-references (car rowcol) (cdr rowcol)))
-      (let* ((rowcol (ses-sym-rowcol reference))
-            (cell  (ses-get-cell (car rowcol) (cdr rowcol))))
-       (ses-cell-set-formula (car rowcol)
-                             (cdr rowcol)
-                             (ses-replace-name-in-formula
-                              (ses-cell-formula cell)
-                              ses--curcell
-                              new-name))))
-    (put new-name 'ses-cell rowcol)
-    (set new-name (symbol-value ses--curcell))
-    (aset cell 0 new-name)
-    (put ses--curcell 'ses-cell nil)
-    (makunbound ses--curcell)
-    (setq ses--curcell new-name)
-    (let* ((pos (point))
-          (inhibit-read-only t)
-          (col (current-column))
-          (end (save-excursion
-                 (move-to-column (1+ col))
-                 (if (eolp)
-                     (+ pos (ses-col-width col) 1)
-                   (point)))))
-      (put-text-property pos end 'intangible new-name))) )
-
 
 ;;----------------------------------------------------------------------------
 ;; Checking formulas for safety


reply via email to

[Prev in Thread] Current Thread [Next in Thread]