comparison lisp/gnus.el @ 13700:7cbb1453aefd

(gnus-simplify-mode-line): New function to simplify the mode line in a safer manner. (gnus-group-mode, gnus-browse-mode, gnus-summary-mode, gnus-article-mode, gnus-server-mode): Use the function.
author Lars Magne Ingebrigtsen <larsi@gnus.org>
date Sat, 09 Dec 1995 08:52:17 +0000
parents e8358f30c41c
children b09b073f6b77
comparison
equal deleted inserted replaced
13699:e8358f30c41c 13700:7cbb1453aefd
2839 (assoc 'quit-config (gnus-find-method-for-group group))) 2839 (assoc 'quit-config (gnus-find-method-for-group group)))
2840 2840
2841 (defun gnus-group-quit-config (group) 2841 (defun gnus-group-quit-config (group)
2842 "Return the quit-config of GROUP." 2842 "Return the quit-config of GROUP."
2843 (nth 1 (assoc 'quit-config (gnus-find-method-for-group group)))) 2843 (nth 1 (assoc 'quit-config (gnus-find-method-for-group group))))
2844
2845 (defun gnus-simplify-mode-line ()
2846 "Make mode lines a bit simpler."
2847 (setq mode-line-modified "-- ")
2848 (if (listp mode-line-format)
2849 (progn
2850 (make-local-variable 'mode-line-format)
2851 (setq mode-line-format (copy-sequence mode-line-format))
2852 (and (equal (nth 3 mode-line-format) " ")
2853 (setcar (nthcdr 3 mode-line-format) "")))))
2844 2854
2845 ;;; List and range functions 2855 ;;; List and range functions
2846 2856
2847 (defun gnus-last-element (list) 2857 (defun gnus-last-element (list)
2848 "Return last element of LIST." 2858 "Return last element of LIST."
3216 3226
3217 \\{gnus-group-mode-map}" 3227 \\{gnus-group-mode-map}"
3218 (interactive) 3228 (interactive)
3219 (if gnus-visual (gnus-group-make-menu-bar)) 3229 (if gnus-visual (gnus-group-make-menu-bar))
3220 (kill-all-local-variables) 3230 (kill-all-local-variables)
3221 (setq mode-line-modified "-- ") 3231 (gnus-simplify-mode-line)
3222 (make-local-variable 'mode-line-format)
3223 (setq mode-line-format (copy-sequence mode-line-format))
3224 (and (equal (nth 3 mode-line-format) " ")
3225 (setcar (nthcdr 3 mode-line-format) ""))
3226 (setq major-mode 'gnus-group-mode) 3232 (setq major-mode 'gnus-group-mode)
3227 (setq mode-name "Group") 3233 (setq mode-name "Group")
3228 (gnus-group-set-mode-line) 3234 (gnus-group-set-mode-line)
3229 (setq mode-line-process nil) 3235 (setq mode-line-process nil)
3230 (use-local-map gnus-group-mode-map) 3236 (use-local-map gnus-group-mode-map)
5156 5162
5157 3) `\\[gnus-browse-exit]' to return to the group buffer." 5163 3) `\\[gnus-browse-exit]' to return to the group buffer."
5158 (interactive) 5164 (interactive)
5159 (kill-all-local-variables) 5165 (kill-all-local-variables)
5160 (if gnus-visual (gnus-browse-make-menu-bar)) 5166 (if gnus-visual (gnus-browse-make-menu-bar))
5161 (setq mode-line-modified "-- ") 5167 (gnus-simplify-mode-line)
5162 (make-local-variable 'mode-line-format)
5163 (setq mode-line-format (copy-sequence mode-line-format))
5164 (and (equal (nth 3 mode-line-format) " ")
5165 (setcar (nthcdr 3 mode-line-format) ""))
5166 (setq major-mode 'gnus-browse-mode) 5168 (setq major-mode 'gnus-browse-mode)
5167 (setq mode-name "Browse Server") 5169 (setq mode-name "Browse Server")
5168 (setq mode-line-process nil) 5170 (setq mode-line-process nil)
5169 (use-local-map gnus-browse-mode-map) 5171 (use-local-map gnus-browse-mode-map)
5170 (buffer-disable-undo (current-buffer)) 5172 (buffer-disable-undo (current-buffer))
5641 (set (car (car locals)) (eval (cdr (car locals))))) 5643 (set (car (car locals)) (eval (cdr (car locals)))))
5642 (make-local-variable (car locals)) 5644 (make-local-variable (car locals))
5643 (set (car locals) nil)) 5645 (set (car locals) nil))
5644 (setq locals (cdr locals)))) 5646 (setq locals (cdr locals))))
5645 (gnus-make-thread-indent-array) 5647 (gnus-make-thread-indent-array)
5646 (setq mode-line-modified "-- ") 5648 (gnus-simplify-mode-line)
5647 (make-local-variable 'mode-line-format)
5648 (setq mode-line-format (copy-sequence mode-line-format))
5649 (and (equal (nth 3 mode-line-format) " ")
5650 (setcar (nthcdr 3 mode-line-format) ""))
5651 (setq major-mode 'gnus-summary-mode) 5649 (setq major-mode 'gnus-summary-mode)
5652 (setq mode-name "Summary") 5650 (setq mode-name "Summary")
5653 (make-local-variable 'minor-mode-alist) 5651 (make-local-variable 'minor-mode-alist)
5654 (use-local-map gnus-summary-mode-map) 5652 (use-local-map gnus-summary-mode-map)
5655 (buffer-disable-undo (current-buffer)) 5653 (buffer-disable-undo (current-buffer))
10767 \\[gnus-article-describe-briefly]\t Describe the current mode briefly 10765 \\[gnus-article-describe-briefly]\t Describe the current mode briefly
10768 \\[gnus-info-find-node]\t Go to the Gnus info node" 10766 \\[gnus-info-find-node]\t Go to the Gnus info node"
10769 (interactive) 10767 (interactive)
10770 (if gnus-visual (gnus-article-make-menu-bar)) 10768 (if gnus-visual (gnus-article-make-menu-bar))
10771 (kill-all-local-variables) 10769 (kill-all-local-variables)
10772 (setq mode-line-modified "-- ") 10770 (gnus-simplify-mode-line)
10773 (make-local-variable 'mode-line-format)
10774 (setq mode-line-format (copy-sequence mode-line-format))
10775 (and (equal (nth 3 mode-line-format) " ")
10776 (setcar (nthcdr 3 mode-line-format) ""))
10777 (setq mode-name "Article") 10771 (setq mode-name "Article")
10778 (setq major-mode 'gnus-article-mode) 10772 (setq major-mode 'gnus-article-mode)
10779 (make-local-variable 'minor-mode-alist) 10773 (make-local-variable 'minor-mode-alist)
10780 (or (assq 'gnus-show-mime minor-mode-alist) 10774 (or (assq 'gnus-show-mime minor-mode-alist)
10781 (setq minor-mode-alist 10775 (setq minor-mode-alist
13615 13609
13616 \\{gnus-server-mode-map}" 13610 \\{gnus-server-mode-map}"
13617 (interactive) 13611 (interactive)
13618 (if gnus-visual (gnus-server-make-menu-bar)) 13612 (if gnus-visual (gnus-server-make-menu-bar))
13619 (kill-all-local-variables) 13613 (kill-all-local-variables)
13620 (setq mode-line-modified "-- ") 13614 (gnus-simplify-mode-line)
13621 (make-local-variable 'mode-line-format)
13622 (setq mode-line-format (copy-sequence mode-line-format))
13623 (and (equal (nth 3 mode-line-format) " ")
13624 (setcar (nthcdr 3 mode-line-format) ""))
13625 (setq major-mode 'gnus-server-mode) 13615 (setq major-mode 'gnus-server-mode)
13626 (setq mode-name "Server") 13616 (setq mode-name "Server")
13627 ; (gnus-group-set-mode-line) 13617 ; (gnus-group-set-mode-line)
13628 (setq mode-line-process nil) 13618 (setq mode-line-process nil)
13629 (use-local-map gnus-server-mode-map) 13619 (use-local-map gnus-server-mode-map)