diff options
| author | Julien Danjou | 2010-10-29 13:51:15 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2010-10-29 13:51:15 +0000 |
| commit | 2ec4c9665d3766eea7bf2d131cabbc177d049b6b (patch) | |
| tree | 23fb51dc049c94b70dcce78c73fe843e00580fb1 | |
| parent | 8674173394ab9450429e7af6fc29a7e86cd9e2bc (diff) | |
| download | emacs-2ec4c9665d3766eea7bf2d131cabbc177d049b6b.tar.gz emacs-2ec4c9665d3766eea7bf2d131cabbc177d049b6b.zip | |
gnus.el (gnus-buffers, gnus-group-buffer): Add docstrings.
gnus.el (gnus-group-startup-message): Simplify/update code.
gnus-ems.el (gnus-x-splash): Remove.
gnus-start.el (gnus-1): Remove x-splash calls.
| -rw-r--r-- | lisp/gnus/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/gnus/gnus-ems.el | 96 | ||||
| -rw-r--r-- | lisp/gnus/gnus-start.el | 8 | ||||
| -rw-r--r-- | lisp/gnus/gnus.el | 100 |
4 files changed, 52 insertions, 158 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 84dc4258347..a56fe89b818 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,5 +1,11 @@ | |||
| 1 | 2010-10-29 Julien Danjou <julien@danjou.info> | 1 | 2010-10-29 Julien Danjou <julien@danjou.info> |
| 2 | 2 | ||
| 3 | * gnus-start.el (gnus-1): Remove x-splash calls. | ||
| 4 | |||
| 5 | * gnus-ems.el (gnus-x-splash): Remove. | ||
| 6 | |||
| 7 | * gnus.el (gnus-group-startup-message): Simplify/update code. | ||
| 8 | |||
| 3 | * gnus-group.el (gnus-group-make-tool-bar): Check for display graphic | 9 | * gnus-group.el (gnus-group-make-tool-bar): Check for display graphic |
| 4 | capability before doing anything. | 10 | capability before doing anything. |
| 5 | (gnus-group-insert-group-line): Remove useless | 11 | (gnus-group-insert-group-line): Remove useless |
diff --git a/lisp/gnus/gnus-ems.el b/lisp/gnus/gnus-ems.el index e1e37eb37c2..3a79e67801f 100644 --- a/lisp/gnus/gnus-ems.el +++ b/lisp/gnus/gnus-ems.el | |||
| @@ -162,102 +162,6 @@ | |||
| 162 | (autoload 'gnus-alive-p "gnus-util") | 162 | (autoload 'gnus-alive-p "gnus-util") |
| 163 | (autoload 'mm-disable-multibyte "mm-util") | 163 | (autoload 'mm-disable-multibyte "mm-util") |
| 164 | 164 | ||
| 165 | (defun gnus-x-splash () | ||
| 166 | "Show a splash screen using a pixmap in the current buffer." | ||
| 167 | (interactive) | ||
| 168 | (unless window-system | ||
| 169 | (error "`gnus-x-splash' requires running on the window system")) | ||
| 170 | (switch-to-buffer (gnus-get-buffer-create (if (or (gnus-alive-p) | ||
| 171 | (interactive-p)) | ||
| 172 | "*gnus-x-splash*" | ||
| 173 | gnus-group-buffer))) | ||
| 174 | (let ((inhibit-read-only t) | ||
| 175 | (file (nnheader-find-etc-directory "images/gnus/x-splash" t)) | ||
| 176 | pixmap fcw fch width height fringes sbars left yoffset top ls) | ||
| 177 | (erase-buffer) | ||
| 178 | (sit-for 0) ;; Necessary for measuring the window size correctly. | ||
| 179 | (when (and file | ||
| 180 | (ignore-errors | ||
| 181 | (let ((coding-system-for-read 'raw-text)) | ||
| 182 | (with-temp-buffer | ||
| 183 | (mm-disable-multibyte) | ||
| 184 | (insert-file-contents file) | ||
| 185 | (goto-char (point-min)) | ||
| 186 | (setq pixmap (read (current-buffer))))))) | ||
| 187 | (setq fcw (float (frame-char-width)) | ||
| 188 | fch (float (frame-char-height)) | ||
| 189 | width (/ (car pixmap) fcw) | ||
| 190 | height (/ (cadr pixmap) fch) | ||
| 191 | fringes (if (fboundp 'window-fringes) | ||
| 192 | (eval '(window-fringes)) | ||
| 193 | '(10 11 nil)) | ||
| 194 | sbars (frame-parameter nil 'vertical-scroll-bars)) | ||
| 195 | (cond ((eq sbars 'right) | ||
| 196 | (setq sbars | ||
| 197 | (cons 0 (/ (or (frame-parameter nil 'scroll-bar-width) 14) | ||
| 198 | fcw)))) | ||
| 199 | (sbars | ||
| 200 | (setq sbars | ||
| 201 | (cons (/ (or (frame-parameter nil 'scroll-bar-width) 14) | ||
| 202 | fcw) | ||
| 203 | 0))) | ||
| 204 | (t | ||
| 205 | (setq sbars '(0 . 0)))) | ||
| 206 | (setq left (- (* (round (/ (1- (/ (+ (window-width) | ||
| 207 | (car sbars) (cdr sbars) | ||
| 208 | (/ (+ (or (car fringes) 0) | ||
| 209 | (or (cadr fringes) 0)) | ||
| 210 | fcw)) | ||
| 211 | width)) | ||
| 212 | 2)) | ||
| 213 | width) | ||
| 214 | (car sbars) | ||
| 215 | (/ (or (car fringes) 0) fcw)) | ||
| 216 | yoffset (cadr (window-edges)) | ||
| 217 | top (max 0 (- (* (max (if (and (boundp 'tool-bar-mode) | ||
| 218 | tool-bar-mode | ||
| 219 | (not (featurep 'gtk)) | ||
| 220 | (eq (frame-first-window) | ||
| 221 | (selected-window))) | ||
| 222 | 1 0) | ||
| 223 | (round (/ (1- (/ (+ (1- (window-height)) | ||
| 224 | (* 2 yoffset)) | ||
| 225 | height)) | ||
| 226 | 2))) | ||
| 227 | height) | ||
| 228 | yoffset)) | ||
| 229 | ls (/ (or line-spacing 0) fch) | ||
| 230 | height (max 0 (- height ls))) | ||
| 231 | (cond ((>= (- top ls) 1) | ||
| 232 | (insert | ||
| 233 | (propertize | ||
| 234 | " " | ||
| 235 | 'display `(space :width 0 :ascent 100)) | ||
| 236 | "\n" | ||
| 237 | (propertize | ||
| 238 | " " | ||
| 239 | 'display `(space :width 0 :height ,(- top ls 1) :ascent 100)) | ||
| 240 | "\n")) | ||
| 241 | ((> (- top ls) 0) | ||
| 242 | (insert | ||
| 243 | (propertize | ||
| 244 | " " | ||
| 245 | 'display `(space :width 0 :height ,(- top ls) :ascent 100)) | ||
| 246 | "\n"))) | ||
| 247 | (if (and (> width 0) (> left 0)) | ||
| 248 | (insert (propertize | ||
| 249 | " " | ||
| 250 | 'display `(space :width ,left :height ,height :ascent 0))) | ||
| 251 | (setq width (+ width left))) | ||
| 252 | (when (> width 0) | ||
| 253 | (insert (propertize | ||
| 254 | " " | ||
| 255 | 'display `(space :width ,width :height ,height :ascent 0) | ||
| 256 | 'face `(gnus-splash :stipple ,pixmap)))) | ||
| 257 | (goto-char (if (<= (- top ls) 0) (1- (point)) (point-min))) | ||
| 258 | (redraw-frame (selected-frame)) | ||
| 259 | (sit-for 0)))) | ||
| 260 | |||
| 261 | ;;; Image functions. | 165 | ;;; Image functions. |
| 262 | 166 | ||
| 263 | (defun gnus-image-type-available-p (type) | 167 | (defun gnus-image-type-available-p (type) |
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index dafcd642727..857c7d5cb61 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el | |||
| @@ -775,14 +775,6 @@ prompt the user for the name of an NNTP server to use." | |||
| 775 | (if gnus-agent | 775 | (if gnus-agent |
| 776 | (gnus-agentize)) | 776 | (gnus-agentize)) |
| 777 | 777 | ||
| 778 | (when gnus-simple-splash | ||
| 779 | (setq gnus-simple-splash nil) | ||
| 780 | (cond | ||
| 781 | ((featurep 'xemacs) | ||
| 782 | (gnus-xmas-splash)) | ||
| 783 | (window-system | ||
| 784 | (gnus-x-splash)))) | ||
| 785 | |||
| 786 | (let ((level (and (numberp arg) (> arg 0) arg)) | 778 | (let ((level (and (numberp arg) (> arg 0) arg)) |
| 787 | did-connect) | 779 | did-connect) |
| 788 | (unwind-protect | 780 | (unwind-protect |
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index 965f789587e..baed48d7733 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el | |||
| @@ -350,7 +350,6 @@ be set in `.emacs' instead." | |||
| 350 | (list str)) | 350 | (list str)) |
| 351 | line))) | 351 | line))) |
| 352 | (defalias 'gnus-mode-line-buffer-identification 'identity)) | 352 | (defalias 'gnus-mode-line-buffer-identification 'identity)) |
| 353 | (defalias 'gnus-characterp 'numberp) | ||
| 354 | (defalias 'gnus-deactivate-mark 'deactivate-mark) | 353 | (defalias 'gnus-deactivate-mark 'deactivate-mark) |
| 355 | (defalias 'gnus-window-edges 'window-edges) | 354 | (defalias 'gnus-window-edges 'window-edges) |
| 356 | (defalias 'gnus-key-press-event-p 'numberp) | 355 | (defalias 'gnus-key-press-event-p 'numberp) |
| @@ -918,7 +917,8 @@ be set in `.emacs' instead." | |||
| 918 | ;;; Gnus buffers | 917 | ;;; Gnus buffers |
| 919 | ;;; | 918 | ;;; |
| 920 | 919 | ||
| 921 | (defvar gnus-buffers nil) | 920 | (defvar gnus-buffers nil |
| 921 | "List of buffers handled by Gnus.") | ||
| 922 | 922 | ||
| 923 | (defun gnus-get-buffer-create (name) | 923 | (defun gnus-get-buffer-create (name) |
| 924 | "Do the same as `get-buffer-create', but store the created buffer." | 924 | "Do the same as `get-buffer-create', but store the created buffer." |
| @@ -950,7 +950,8 @@ be set in `.emacs' instead." | |||
| 950 | 950 | ||
| 951 | ;;; Splash screen. | 951 | ;;; Splash screen. |
| 952 | 952 | ||
| 953 | (defvar gnus-group-buffer "*Group*") | 953 | (defvar gnus-group-buffer "*Group*" |
| 954 | "Name of the Gnus group buffer.") | ||
| 954 | 955 | ||
| 955 | (defface gnus-splash | 956 | (defface gnus-splash |
| 956 | '((((class color) | 957 | '((((class color) |
| @@ -989,8 +990,6 @@ be set in `.emacs' instead." | |||
| 989 | (while (search-forward "\t" nil t) | 990 | (while (search-forward "\t" nil t) |
| 990 | (replace-match " " t t)))))) | 991 | (replace-match " " t t)))))) |
| 991 | 992 | ||
| 992 | (defvar gnus-simple-splash nil) | ||
| 993 | |||
| 994 | ;;(format "%02x%02x%02x" 114 66 20) "724214" | 993 | ;;(format "%02x%02x%02x" 114 66 20) "724214" |
| 995 | 994 | ||
| 996 | (defvar gnus-logo-color-alist | 995 | (defvar gnus-logo-color-alist |
| @@ -1030,50 +1029,45 @@ be set in `.emacs' instead." | |||
| 1030 | "Insert startup message in current buffer." | 1029 | "Insert startup message in current buffer." |
| 1031 | ;; Insert the message. | 1030 | ;; Insert the message. |
| 1032 | (erase-buffer) | 1031 | (erase-buffer) |
| 1033 | (cond | 1032 | (unless (and |
| 1034 | ((and | 1033 | (fboundp 'find-image) |
| 1035 | (fboundp 'find-image) | 1034 | (display-graphic-p) |
| 1036 | (display-graphic-p) | 1035 | ;; Make sure the library defining `image-load-path' is loaded |
| 1037 | ;; Make sure the library defining `image-load-path' is loaded | 1036 | ;; (`find-image' is autoloaded) (and discard the result). Else, we may |
| 1038 | ;; (`find-image' is autoloaded) (and discard the result). Else, we may | 1037 | ;; get "defvar ignored because image-load-path is let-bound" when calling |
| 1039 | ;; get "defvar ignored because image-load-path is let-bound" when calling | 1038 | ;; `find-image' below. |
| 1040 | ;; `find-image' below. | 1039 | (or (find-image '(nil (:type xpm :file "gnus.xpm"))) t) |
| 1041 | (or (find-image '(nil (:type xpm :file "gnus.xpm"))) t) | 1040 | (let* ((data-directory (nnheader-find-etc-directory "images/gnus")) |
| 1042 | (let* ((data-directory (nnheader-find-etc-directory "images/gnus")) | 1041 | (image-load-path (cond (data-directory |
| 1043 | (image-load-path (cond (data-directory | 1042 | (list data-directory)) |
| 1044 | (list data-directory)) | 1043 | ((boundp 'image-load-path) |
| 1045 | ((boundp 'image-load-path) | 1044 | (symbol-value 'image-load-path)) |
| 1046 | (symbol-value 'image-load-path)) | 1045 | (t load-path))) |
| 1047 | (t load-path))) | 1046 | (image (find-image |
| 1048 | (image (find-image | 1047 | `((:type xpm :file "gnus.xpm" |
| 1049 | `((:type xpm :file "gnus.xpm" | 1048 | :color-symbols |
| 1050 | :color-symbols | 1049 | (("thing" . ,(car gnus-logo-colors)) |
| 1051 | (("thing" . ,(car gnus-logo-colors)) | 1050 | ("shadow" . ,(cadr gnus-logo-colors)))) |
| 1052 | ("shadow" . ,(cadr gnus-logo-colors)) | 1051 | (:type svg :file "gnus.svg") |
| 1053 | ("oort" . "#eeeeee") | 1052 | (:type png :file "gnus.png") |
| 1054 | ("background" . ,(face-background 'default)))) | 1053 | (:type pbm :file "gnus.pbm" |
| 1055 | (:type svg :file "gnus.svg") | 1054 | ;; Account for the pbm's background. |
| 1056 | (:type png :file "gnus.png") | 1055 | :background ,(face-foreground 'gnus-splash) |
| 1057 | (:type pbm :file "gnus.pbm" | 1056 | :foreground ,(face-background 'default)) |
| 1058 | ;; Account for the pbm's blackground. | 1057 | (:type xbm :file "gnus.xbm" |
| 1059 | :background ,(face-foreground 'gnus-splash) | 1058 | ;; Account for the xbm's background. |
| 1060 | :foreground ,(face-background 'default)) | 1059 | :background ,(face-foreground 'gnus-splash) |
| 1061 | (:type xbm :file "gnus.xbm" | 1060 | :foreground ,(face-background 'default)))))) |
| 1062 | ;; Account for the xbm's blackground. | 1061 | (when image |
| 1063 | :background ,(face-foreground 'gnus-splash) | 1062 | (let ((size (image-size image))) |
| 1064 | :foreground ,(face-background 'default)))))) | 1063 | (insert-char ?\n (max 0 (round (- (window-height) |
| 1065 | (when image | 1064 | (or y (cdr size)) 1) 2))) |
| 1066 | (let ((size (image-size image))) | 1065 | (insert-char ?\ (max 0 (round (- (window-width) |
| 1067 | (insert-char ?\n (max 0 (round (- (window-height) | 1066 | (or x (car size))) 2))) |
| 1068 | (or y (cdr size)) 1) 2))) | 1067 | (insert-image image)) |
| 1069 | (insert-char ?\ (max 0 (round (- (window-width) | 1068 | t))) |
| 1070 | (or x (car size))) 2))) | ||
| 1071 | (insert-image image)) | ||
| 1072 | (setq gnus-simple-splash nil) | ||
| 1073 | t)))) | ||
| 1074 | (t | ||
| 1075 | (insert | 1069 | (insert |
| 1076 | (format " %s | 1070 | (format " |
| 1077 | _ ___ _ _ | 1071 | _ ___ _ _ |
| 1078 | _ ___ __ ___ __ _ ___ | 1072 | _ ___ __ ___ __ _ ___ |
| 1079 | __ _ ___ __ ___ | 1073 | __ _ ___ __ ___ |
| @@ -1092,8 +1086,7 @@ be set in `.emacs' instead." | |||
| 1092 | _ | 1086 | _ |
| 1093 | __ | 1087 | __ |
| 1094 | 1088 | ||
| 1095 | " | 1089 | ")) |
| 1096 | "")) | ||
| 1097 | ;; And then hack it. | 1090 | ;; And then hack it. |
| 1098 | (gnus-indent-rigidly (point-min) (point-max) | 1091 | (gnus-indent-rigidly (point-min) (point-max) |
| 1099 | (/ (max (- (window-width) (or x 46)) 0) 2)) | 1092 | (/ (max (- (window-width) (or x 46)) 0) 2)) |
| @@ -1105,10 +1098,9 @@ be set in `.emacs' instead." | |||
| 1105 | (insert (make-string (max 0 (* 2 (/ rest 3))) ?\n))) | 1098 | (insert (make-string (max 0 (* 2 (/ rest 3))) ?\n))) |
| 1106 | ;; Fontify some. | 1099 | ;; Fontify some. |
| 1107 | (put-text-property (point-min) (point-max) 'face 'gnus-splash) | 1100 | (put-text-property (point-min) (point-max) 'face 'gnus-splash) |
| 1108 | (setq gnus-simple-splash t))) | 1101 | (goto-char (point-min)) |
| 1109 | (goto-char (point-min)) | 1102 | (setq mode-line-buffer-identification (concat " " gnus-version)) |
| 1110 | (setq mode-line-buffer-identification (concat " " gnus-version)) | 1103 | (set-buffer-modified-p t))) |
| 1111 | (set-buffer-modified-p t)) | ||
| 1112 | 1104 | ||
| 1113 | (eval-when (load) | 1105 | (eval-when (load) |
| 1114 | (let ((command (format "%s" this-command))) | 1106 | (let ((command (format "%s" this-command))) |