emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r118195: * ses.el (macroexp): add require for this p


From: Vincent Belaïche
Subject: [Emacs-diffs] trunk r118195: * ses.el (macroexp): add require for this package, so that function
Date: Fri, 24 Oct 2014 23:02:46 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 118195
revision-id: address@hidden
parent: address@hidden
committer: Vincent Belaïche  <address@hidden>
branch nick: trunk
timestamp: Sat 2014-10-25 01:02:25 +0200
message:
  * ses.el (macroexp): add require for this package, so that function
  `ses--cell gets macroexp-quote.
  (ses--cell): makes formula a macroexp-quote of value when formula
  is nil. The rationale of this changr is to allow in the future
  shorter SES files, e.g. we could have only `(ses-cell A1 1.0)'
  instead of `(ses-cell A1 1.0 1.0 nil REFLIST)'. In such a case
  reference list REFLIST would be re-computed after load --- thus
  trading off load time against file size.
  
  * emacs-lisp/package.el (package--alist-to-plist-args): use
  macroexp-quote instead of a lambda expression which has the same
  content as macroexp-quote.
  (macroexp): add require for this package, so that function
  `package--alist-to-plist-args' gets macroexp-quote.
  
  * emacs-lisp/macroexp.el (macroexp-quote): new defun.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/emacs-lisp/macroexp.el    
macroexp.el-20091113204419-o5vbwnq5f7feedwu-2966
  lisp/emacs-lisp/package.el     package.el-20100617020707-ybavz666awsxwin6-2
  lisp/ses.el                    ses.el-20091113204419-o5vbwnq5f7feedwu-2447
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-10-24 22:23:43 +0000
+++ b/lisp/ChangeLog    2014-10-24 23:02:25 +0000
@@ -1,3 +1,22 @@
+2014-10-24  Vincent Belaïche  <address@hidden>
+
+       * ses.el (macroexp): add require for this package, so that function
+       `ses--cell gets macroexp-quote.
+       (ses--cell): makes formula a macroexp-quote of value when formula
+       is nil. The rationale of this changr is to allow in the future
+       shorter SES files, e.g. we could have only `(ses-cell A1 1.0)'
+       instead of `(ses-cell A1 1.0 1.0 nil REFLIST)'. In such a case
+       reference list REFLIST would be re-computed after load --- thus
+       trading off load time against file size.
+
+       * emacs-lisp/package.el (package--alist-to-plist-args): use
+       macroexp-quote instead of a lambda expression which has the same
+       content as macroexp-quote.
+       (macroexp): add require for this package, so that function
+       `package--alist-to-plist-args' gets macroexp-quote.
+
+       * emacs-lisp/macroexp.el (macroexp-quote): new defun.
+
 2014-10-24  Stefan Monnier  <address@hidden>
 
        * term/ns-win.el (ns-store-cut-buffer-internal)

=== modified file 'lisp/emacs-lisp/macroexp.el'
--- a/lisp/emacs-lisp/macroexp.el       2014-04-22 07:04:34 +0000
+++ b/lisp/emacs-lisp/macroexp.el       2014-10-24 23:02:25 +0000
@@ -370,6 +370,18 @@
   "Return non-nil if EXP can be copied without extra cost."
   (or (symbolp exp) (macroexp-const-p exp)))
 
+(defun macroexp-quote (v)
+  "Returns an expression E such that `(eval E)' is V.
+
+E is either V or (quote V) depending on whether V evaluates to
+itself or not."
+  (if (and (not (consp v))
+          (or (keywordp v)
+              (not (symbolp v))
+              (memq v '(nil t))))
+      v
+    (list 'quote v)))
+
 ;;; Load-time macro-expansion.
 
 ;; Because macro-expansion used to be more lazy, eager macro-expansion

=== modified file 'lisp/emacs-lisp/package.el'
--- a/lisp/emacs-lisp/package.el        2014-10-23 21:38:56 +0000
+++ b/lisp/emacs-lisp/package.el        2014-10-24 23:02:25 +0000
@@ -165,6 +165,7 @@
 (eval-when-compile (require 'epg))      ;For setf accessors.
 
 (require 'tabulated-list)
+(require 'macroexp)
 
 (defgroup package nil
   "Manager for Emacs Lisp packages."
@@ -723,12 +724,7 @@
        nil pkg-file nil 'silent))))
 
 (defun package--alist-to-plist-args (alist)
-  (mapcar (lambda (x)
-            (if (and (not (consp x))
-                     (or (keywordp x)
-                         (not (symbolp x))
-                         (memq x '(nil t))))
-                x `',x))
+  (mapcar 'macroexp-quote
           (apply #'nconc
                  (mapcar (lambda (pair) (list (car pair) (cdr pair))) alist))))
 (defun package-unpack (pkg-desc)

=== modified file 'lisp/ses.el'
--- a/lisp/ses.el       2014-10-01 17:23:42 +0000
+++ b/lisp/ses.el       2014-10-24 23:02:25 +0000
@@ -491,7 +491,8 @@
   (let ((rowcol (ses-sym-rowcol sym)))
     (ses-formula-record formula)
     (ses-printer-record printer)
-    (unless formula (setq formula value))
+    (unless (or formula (eq formula '*skip*))
+      (setq formula (macroexp-quote value)))
     (or (atom formula)
        (eq safe-functions t)
        (setq formula `(ses-safe-formula ,formula)))


reply via email to

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