summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2012-11-26 21:06:19 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2012-11-26 21:06:19 -0500
commit369f945d0b71738812f237123dbe24938d65999e (patch)
tree35b4a76b55adb33859bda419c5e2e0caf87ff2d1
parent999e745ef7ada0fcecd687fb7595e794577fa6ec (diff)
downloademacs-369f945d0b71738812f237123dbe24938d65999e.tar.gz
* lisp/textmodes/table.el (table-insert): Don't use `symbol-name' on
lexically scoped variables. Fixes: debbugs:13005
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/textmodes/table.el51
2 files changed, 35 insertions, 25 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d0c29dab0d8..79028d68f73 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2012-11-27 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * textmodes/table.el (table-insert): Don't use `symbol-name' on
+ lexically scoped variables (bug#13005).
+
2012-11-26 Glenn Morris <rgm@gnu.org>
* vc/vc-hooks.el (vc-mistrust-permissions):
@@ -27,8 +32,8 @@
2012-11-25 Eli Zaretskii <eliz@gnu.org>
- * descr-text.el (describe-char-padded-string): Call
- internal-char-font only on GUI frames. (Bug#11964)
+ * descr-text.el (describe-char-padded-string):
+ Call internal-char-font only on GUI frames. (Bug#11964)
2012-11-24 Andreas Schwab <schwab@linux-m68k.org>
diff --git a/lisp/textmodes/table.el b/lisp/textmodes/table.el
index 3d9f88a43c9..69762ce2a26 100644
--- a/lisp/textmodes/table.el
+++ b/lisp/textmodes/table.el
@@ -1570,8 +1570,7 @@ results.
Inside a table cell has a special keymap.
-\\{table-cell-map}
-"
+\\{table-cell-map}"
(interactive
(progn
(barf-if-buffer-read-only)
@@ -1583,41 +1582,47 @@ Inside a table cell has a special keymap.
("Cell width(s)" . table-cell-width-history)
("Cell height(s)" . table-cell-height-history)))))
(table--make-cell-map)
- ;; reform the arguments.
+ ;; Reform the arguments.
(if (null cell-width) (setq cell-width (car table-cell-width-history)))
(if (null cell-height) (setq cell-height (car table-cell-height-history)))
(if (stringp columns) (setq columns (string-to-number columns)))
(if (stringp rows) (setq rows (string-to-number rows)))
- (if (stringp cell-width) (setq cell-width (table--string-to-number-list cell-width)))
- (if (stringp cell-height) (setq cell-height (table--string-to-number-list cell-height)))
+ (if (stringp cell-width)
+ (setq cell-width (table--string-to-number-list cell-width)))
+ (if (stringp cell-height)
+ (setq cell-height (table--string-to-number-list cell-height)))
(if (numberp cell-width) (setq cell-width (cons cell-width nil)))
(if (numberp cell-height) (setq cell-height (cons cell-height nil)))
- ;; test validity of the arguments.
- (mapc (lambda (arg)
- (let* ((value (symbol-value arg))
- (error-handler
- (function (lambda ()
- (error "%s must be a positive integer%s" arg
- (if (listp value) " or a list of positive integers" ""))))))
- (if (null value) (funcall error-handler))
- (mapcar (function (lambda (arg1)
- (if (or (not (integerp arg1))
- (< arg1 1))
- (funcall error-handler))))
- (if (listp value) value
- (cons value nil)))))
- '(columns rows cell-width cell-height))
+ ;; Test validity of the arguments.
+ (dolist (arg `((columns . ,columns)
+ (rows . ,rows)
+ (cell-width . ,cell-width)
+ (cell-height . ,cell-height)))
+ (let* ((value (cdr arg))
+ (error-handler
+ (lambda ()
+ (error "%s must be a positive integer%s" (car arg)
+ (if (listp value)
+ " or a list of positive integers" "")))))
+ (if (null value) (funcall error-handler))
+ (dolist (arg1 (if (listp value) value
+ (cons value nil)))
+ (if (or (not (integerp arg1))
+ (< arg1 1))
+ (funcall error-handler)))))
(let ((orig-coord (table--get-coordinate))
(coord (table--get-coordinate))
r i cw ch cell-str border-str)
- ;; prefabricate the building blocks border-str and cell-str.
+ ;; Prefabricate the building blocks border-str and cell-str.
(with-temp-buffer
- ;; construct border-str
+ ;; Construct border-str.
(insert table-cell-intersection-char)
(setq cw cell-width)
(setq i 0)
(while (< i columns)
- (insert (make-string (car cw) (string-to-char table-cell-horizontal-chars)) table-cell-intersection-char)
+ (insert (make-string (car cw)
+ (string-to-char table-cell-horizontal-chars))
+ table-cell-intersection-char)
(if (cdr cw) (setq cw (cdr cw)))
(setq i (1+ i)))
(setq border-str (buffer-substring (point-min) (point-max)))