emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/ses.el,v


From: Jonathan Yavner
Subject: [Emacs-diffs] Changes to emacs/lisp/ses.el,v
Date: Thu, 25 Oct 2007 20:12:17 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Jonathan Yavner <JYavner>       07/10/25 20:12:17

Index: ses.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/ses.el,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -b -r1.34 -r1.35
--- ses.el      23 Sep 2007 01:08:25 -0000      1.34
+++ ses.el      25 Oct 2007 20:12:17 -0000      1.35
@@ -172,8 +172,10 @@
                "\""      ses-read-cell
                "'"       ses-read-symbol
                "="       ses-edit-cell
+               "c"       ses-recalculate-cell
                "j"       ses-jump
                "p"       ses-read-cell-printer
+               "t"       ses-truncate-cell
                "w"       ses-set-column-width
                "x"       ses-export-keymap
                "\M-p"    ses-read-column-printer))
@@ -271,6 +273,9 @@
     (make-local-variable x)
     (set x nil)))
 
+;;;This variable is documented as being permitted in file-locals:
+(put 'ses--symbolic-formulas 'safe-local-variable 'consp)
+
 (defconst ses-paramlines-plist
   '(ses--col-widths  -5 ses--col-printers -4 ses--default-printer -3
     ses--header-row  -2 ses--file-format   1 ses--numrows          2
@@ -507,10 +512,12 @@
                 (list (symbol-name (cadr formula))))))
 
 (defun ses-column-letter (col)
-  "Converts a column number to A..Z or AA..ZZ"
+  "Return the alphabetic name of column number COL.
+0-25 become A-Z; 26-701 become AA-ZZ, and so on."
+  (let ((units (char-to-string (+ ?A (% col 26)))))
   (if (< col 26)
-      (char-to-string (+ ?A col))
-    (string (+ ?@ (/ col 26)) (+ ?A (% col 26)))))
+        units
+      (concat (ses-column-letter (1- (/ col 26))) units))))
 
 (defun ses-create-cell-symbol (row col)
   "Produce a symbol that names the cell (ROW,COL).  (0,0) => 'A1."
@@ -738,6 +745,9 @@
     ;;Range
     (let ((bcell (get-text-property (region-beginning) 'intangible))
          (ecell (get-text-property (1- (region-end))  'intangible)))
+      (when (= (region-end) ses--data-marker)
+       ;;Correct for overflow
+       (setq ecell (get-text-property (- (region-end) 2)  'intangible)))
       (setq ses--curcell (if (and bcell ecell)
                             (cons bcell ecell)
                           nil))))
@@ -2328,6 +2338,9 @@
 (defun ses-copy-region (beg end)
   "Treat the region as rectangular.  Convert the intangible attributes to
 SES attributes recording the contents of the cell as of the time of copying."
+  (when (= end ses--data-marker)
+    ;;Avoid overflow situation
+    (setq end (1- ses--data-marker)))
   (let* ((inhibit-point-motion-hooks t)
         (x (mapconcat 'ses-copy-region-helper
                       (extract-rectangle beg (1- end)) "\n")))




reply via email to

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