aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2010-10-24 19:40:55 -0400
committerChong Yidong2010-10-24 19:40:55 -0400
commit01898dc200f1f8f6ee9f77b93aa0a0ed283bf84f (patch)
tree5345eb74ad3847f4ce7415b2686b6f0655f843bd
parent7c051dd87f3bf202cb80f91bb3dab6465e368635 (diff)
downloademacs-01898dc200f1f8f6ee9f77b93aa0a0ed283bf84f.tar.gz
emacs-01898dc200f1f8f6ee9f77b93aa0a0ed283bf84f.zip
Avoid inline image variables for checkboxes (Bug#7222).
* etc/images/checked.xpm: * etc/images/unchecked.xpm: New images. * image.el (image-checkbox-checked, image-checkbox-unchecked): Deleted (Bug#7222). * startup.el (fancy-startup-tail): Instead of using inline images, refer to image files from etc/. * wid-edit.el (checkbox): Likewise. (widget-image-find): Center image specs.
-rw-r--r--etc/ChangeLog5
-rw-r--r--etc/images/checked.xpm20
-rw-r--r--etc/images/unchecked.xpm20
-rw-r--r--lisp/ChangeLog11
-rw-r--r--lisp/image.el15
-rw-r--r--lisp/startup.el35
-rw-r--r--lisp/wid-edit.el7
7 files changed, 80 insertions, 33 deletions
diff --git a/etc/ChangeLog b/etc/ChangeLog
index ce5ec4cdff9..4d074790f22 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,8 @@
12010-10-24 Chong Yidong <cyd@stupidchicken.com>
2
3 * images/checked.xpm:
4 * images/unchecked.xpm: New images.
5
12010-10-20 Richard Stallman <rms@gnu.org> 62010-10-20 Richard Stallman <rms@gnu.org>
2 7
3 * DISTRIB: Update donation section. 8 * DISTRIB: Update donation section.
diff --git a/etc/images/checked.xpm b/etc/images/checked.xpm
new file mode 100644
index 00000000000..4dbcb9e6fdd
--- /dev/null
+++ b/etc/images/checked.xpm
@@ -0,0 +1,20 @@
1/* XPM */
2static char * checked_xpm[] = {
3"12 12 5 1",
4" c None",
5". c gray20",
6"+ c white",
7"@ c gray70",
8"# c black",
9"............",
10"............",
11"..@@@@@@##+.",
12"..@@@@@@##+.",
13"..#@@@@##@+.",
14"..##@@@##@+.",
15"..###@##@@+.",
16"..@#####@@+.",
17"..@@###@@@+.",
18"..@++##++++.",
19".@+++++++++.",
20"............"};
diff --git a/etc/images/unchecked.xpm b/etc/images/unchecked.xpm
new file mode 100644
index 00000000000..85eec75230e
--- /dev/null
+++ b/etc/images/unchecked.xpm
@@ -0,0 +1,20 @@
1/* XPM */
2static char * unchecked_xpm[] = {
3"12 12 5 1",
4" c None",
5". c gray20",
6"+ c white",
7"@ c gray70",
8"# c black",
9"............",
10"............",
11"..@@@@@@@@+.",
12"..@@@@@@@@+.",
13"..@@@@@@@@+.",
14"..@@@@@@@@+.",
15"..@@@@@@@@+.",
16"..@@@@@@@@+.",
17"..@@@@@@@@+.",
18"..@++++++++.",
19".@+++++++++.",
20"............"};
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 026aa993afe..9fd13d49ca4 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,14 @@
12010-10-24 Chong Yidong <cyd@stupidchicken.com>
2
3 * image.el (image-checkbox-checked, image-checkbox-unchecked):
4 Deleted (Bug#7222).
5
6 * startup.el (fancy-startup-tail): Instead of using inline images,
7 refer to image files from etc/.
8
9 * wid-edit.el (checkbox): Likewise.
10 (widget-image-find): Center image specs.
11
12010-10-24 Glenn Morris <rgm@gnu.org> 122010-10-24 Glenn Morris <rgm@gnu.org>
2 13
3 * term/ns-win.el (x-select-text): Doc fix. 14 * term/ns-win.el (x-select-text): Doc fix.
diff --git a/lisp/image.el b/lisp/image.el
index 0afdc71cb9e..f93fd03fba3 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -723,21 +723,6 @@ shall be displayed."
723 (cons (concat "\\." extension "\\'") 'imagemagick) 723 (cons (concat "\\." extension "\\'") 'imagemagick)
724 image-type-file-name-regexps))))) 724 image-type-file-name-regexps)))))
725 725
726
727;;; Inline stock images
728
729(defvar image-checkbox-checked
730 (create-image "\300\300\141\143\067\076\034\030"
731 'xbm t :width 8 :height 8 :background "grey75"
732 :foreground "black" :relief -2 :ascent 'center)
733 "Image of a checked checkbox.")
734
735(defvar image-checkbox-unchecked
736 (create-image (make-string 8 0)
737 'xbm t :width 8 :height 8 :background "grey75"
738 :foreground "black" :relief -2 :ascent 'center)
739 "Image of an unchecked checkbox.")
740
741(provide 'image) 726(provide 'image)
742 727
743;; arch-tag: 8e76a07b-eb48-4f3e-a7a0-1a7ba9f096b3 728;; arch-tag: 8e76a07b-eb48-4f3e-a7a0-1a7ba9f096b3
diff --git a/lisp/startup.el b/lisp/startup.el
index aa791f2a04a..a6ba865ce10 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -1563,21 +1563,26 @@ a face or button specification."
1563 (kill-buffer "*GNU Emacs*"))) 1563 (kill-buffer "*GNU Emacs*")))
1564 " ") 1564 " ")
1565 (when (or user-init-file custom-file) 1565 (when (or user-init-file custom-file)
1566 (insert-button 1566 (let ((checked (create-image "checked.xpm"
1567 " " 1567 nil nil :ascent 'center))
1568 :on-glyph image-checkbox-checked 1568 (unchecked (create-image "unchecked.xpm"
1569 :off-glyph image-checkbox-unchecked 1569 nil nil :ascent 'center)))
1570 'checked nil 'display image-checkbox-unchecked 'follow-link t 1570 (insert-button
1571 'action (lambda (button) 1571 " "
1572 (if (overlay-get button 'checked) 1572 :on-glyph checked
1573 (progn (overlay-put button 'checked nil) 1573 :off-glyph unchecked
1574 (overlay-put button 'display 1574 'checked nil 'display unchecked 'follow-link t
1575 (overlay-get button :off-glyph)) 1575 'action (lambda (button)
1576 (setq startup-screen-inhibit-startup-screen nil)) 1576 (if (overlay-get button 'checked)
1577 (overlay-put button 'checked t) 1577 (progn (overlay-put button 'checked nil)
1578 (overlay-put button 'display 1578 (overlay-put button 'display
1579 (overlay-get button :on-glyph)) 1579 (overlay-get button :off-glyph))
1580 (setq startup-screen-inhibit-startup-screen t)))) 1580 (setq startup-screen-inhibit-startup-screen
1581 nil))
1582 (overlay-put button 'checked t)
1583 (overlay-put button 'display
1584 (overlay-get button :on-glyph))
1585 (setq startup-screen-inhibit-startup-screen t)))))
1581 (fancy-splash-insert :face '(variable-pitch (:height 0.9)) 1586 (fancy-splash-insert :face '(variable-pitch (:height 0.9))
1582 " Never show it again."))))) 1587 " Never show it again.")))))
1583 1588
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index 3b9a0372de5..e905e8f2a87 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -638,7 +638,8 @@ extension (xpm, xbm, gif, jpg, or png) located in
638 specs) 638 specs)
639 (dolist (elt widget-image-conversion) 639 (dolist (elt widget-image-conversion)
640 (dolist (ext (cdr elt)) 640 (dolist (ext (cdr elt))
641 (push (list :type (car elt) :file (concat image ext)) specs))) 641 (push (list :type (car elt) :file (concat image ext)
642 :ascent 'center) specs)))
642 (find-image (nreverse specs)))) 643 (find-image (nreverse specs))))
643 (t 644 (t
644 ;; Oh well. 645 ;; Oh well.
@@ -2195,9 +2196,9 @@ when he invoked the menu."
2195 ;; We could probably do the same job as the images using single 2196 ;; We could probably do the same job as the images using single
2196 ;; space characters in a boxed face with a stretch specification to 2197 ;; space characters in a boxed face with a stretch specification to
2197 ;; make them square. 2198 ;; make them square.
2198 :on-glyph image-checkbox-checked 2199 :on-glyph "checked"
2199 :off "[ ]" 2200 :off "[ ]"
2200 :off-glyph image-checkbox-unchecked 2201 :off-glyph "unchecked"
2201 :help-echo "Toggle this item." 2202 :help-echo "Toggle this item."
2202 :action 'widget-checkbox-action) 2203 :action 'widget-checkbox-action)
2203 2204