diff options
| author | Stefan Monnier | 2012-10-09 02:01:10 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2012-10-09 02:01:10 -0400 |
| commit | 94c66ce57bb8992de45349f8e8849797d4bdd3a7 (patch) | |
| tree | 1b03e1dddc1b0c60da54be6bdbfd7b6987fe3e37 | |
| parent | 7518fc1221d36f911b60abcaec42759c42292d78 (diff) | |
| download | emacs-94c66ce57bb8992de45349f8e8849797d4bdd3a7.tar.gz emacs-94c66ce57bb8992de45349f8e8849797d4bdd3a7.zip | |
* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Obey the :read-only property.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/emacs-lisp/cl-loaddefs.el | 2 | ||||
| -rw-r--r-- | lisp/emacs-lisp/cl-macs.el | 43 |
3 files changed, 29 insertions, 23 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index dc78d925544..184356f99fa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2012-10-09 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * emacs-lisp/cl-macs.el (cl-defstruct): Obey the :read-only property. | ||
| 4 | |||
| 1 | 2012-10-09 Fabián Ezequiel Gallina <fgallina@cuca> | 5 | 2012-10-09 Fabián Ezequiel Gallina <fgallina@cuca> |
| 2 | 6 | ||
| 3 | Implemented `backward-up-list'-like navigation. | 7 | Implemented `backward-up-list'-like navigation. |
| @@ -20,8 +24,7 @@ | |||
| 20 | 2012-10-08 Fabián Ezequiel Gallina <fgallina@cuca> | 24 | 2012-10-08 Fabián Ezequiel Gallina <fgallina@cuca> |
| 21 | 25 | ||
| 22 | Fix shell handling of unbalanced quotes and parens in output. | 26 | Fix shell handling of unbalanced quotes and parens in output. |
| 23 | * progmodes/python.el (python-rx-constituents): Added | 27 | * progmodes/python.el (python-rx-constituents): Add string-delimiter. |
| 24 | string-delimiter. | ||
| 25 | (python-syntax-propertize-function): Use it. | 28 | (python-syntax-propertize-function): Use it. |
| 26 | (python-shell-output-syntax-table): New var. | 29 | (python-shell-output-syntax-table): New var. |
| 27 | (inferior-python-mode): Prevent unbalanced parens/quotes from | 30 | (inferior-python-mode): Prevent unbalanced parens/quotes from |
diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el index e25ac5f9708..d05fbc42060 100644 --- a/lisp/emacs-lisp/cl-loaddefs.el +++ b/lisp/emacs-lisp/cl-loaddefs.el | |||
| @@ -260,7 +260,7 @@ Remove from SYMBOL's plist the property PROPNAME and its value. | |||
| 260 | ;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when | 260 | ;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when |
| 261 | ;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp | 261 | ;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp |
| 262 | ;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*) | 262 | ;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*) |
| 263 | ;;;;;; "cl-macs" "cl-macs.el" "6951d080daefb5194b1d21fe9b2deae4") | 263 | ;;;;;; "cl-macs" "cl-macs.el" "885919e79dbcd11081cfb2e039b470c7") |
| 264 | ;;; Generated autoloads from cl-macs.el | 264 | ;;; Generated autoloads from cl-macs.el |
| 265 | 265 | ||
| 266 | (autoload 'cl--compiler-macro-list* "cl-macs" "\ | 266 | (autoload 'cl--compiler-macro-list* "cl-macs" "\ |
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 99bae1944e8..592c33d21c5 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el | |||
| @@ -2324,26 +2324,29 @@ value, that slot cannot be set via `setf'. | |||
| 2324 | (if (= pos 0) '(car cl-x) | 2324 | (if (= pos 0) '(car cl-x) |
| 2325 | `(nth ,pos cl-x)))) forms) | 2325 | `(nth ,pos cl-x)))) forms) |
| 2326 | (push (cons accessor t) side-eff) | 2326 | (push (cons accessor t) side-eff) |
| 2327 | ;; Don't bother defining a setf-expander, since gv-get can use | 2327 | (if (cadr (memq :read-only (cddr desc))) |
| 2328 | ;; the compiler macro to get the same result. | 2328 | (push `(gv-define-expander ,accessor |
| 2329 | ;;(push `(gv-define-setter ,accessor (cl-val cl-x) | 2329 | (lambda (_cl-do _cl-x) |
| 2330 | ;; ,(if (cadr (memq :read-only (cddr desc))) | 2330 | (error "%s is a read-only slot" ',accessor))) |
| 2331 | ;; `(progn (ignore cl-x cl-val) | 2331 | forms) |
| 2332 | ;; (error "%s is a read-only slot" | 2332 | ;; For normal slots, we don't need to define a setf-expander, |
| 2333 | ;; ',accessor)) | 2333 | ;; since gv-get can use the compiler macro to get the |
| 2334 | ;; ;; If cl is loaded only for compilation, | 2334 | ;; same result. |
| 2335 | ;; ;; the call to cl--struct-setf-expander would | 2335 | ;; (push `(gv-define-setter ,accessor (cl-val cl-x) |
| 2336 | ;; ;; cause a warning because it may not be | 2336 | ;; ;; If cl is loaded only for compilation, |
| 2337 | ;; ;; defined at run time. Suppress that warning. | 2337 | ;; ;; the call to cl--struct-setf-expander would |
| 2338 | ;; `(progn | 2338 | ;; ;; cause a warning because it may not be |
| 2339 | ;; (declare-function | 2339 | ;; ;; defined at run time. Suppress that warning. |
| 2340 | ;; cl--struct-setf-expander "cl-macs" | 2340 | ;; (progn |
| 2341 | ;; (x name accessor pred-form pos)) | 2341 | ;; (declare-function |
| 2342 | ;; (cl--struct-setf-expander | 2342 | ;; cl--struct-setf-expander "cl-macs" |
| 2343 | ;; cl-val cl-x ',name ',accessor | 2343 | ;; (x name accessor pred-form pos)) |
| 2344 | ;; ,(and pred-check `',pred-check) | 2344 | ;; (cl--struct-setf-expander |
| 2345 | ;; ,pos)))) | 2345 | ;; cl-val cl-x ',name ',accessor |
| 2346 | ;; forms) | 2346 | ;; ,(and pred-check `',pred-check) |
| 2347 | ;; ,pos))) | ||
| 2348 | ;; forms) | ||
| 2349 | ) | ||
| 2347 | (if print-auto | 2350 | (if print-auto |
| 2348 | (nconc print-func | 2351 | (nconc print-func |
| 2349 | (list `(princ ,(format " %s" slot) cl-s) | 2352 | (list `(princ ,(format " %s" slot) cl-s) |