;;; Agent Category Mode
;;;
-(defvar gnus-category-mode-hook nil
- "Hook run in `gnus-category-mode' buffers.")
-
(defvar gnus-category-line-format " %(%20c%): %g\n"
"Format of category lines.
(defvar gnus-category-mode-line-format-spec nil)
(defvar gnus-category-mode-map nil)
-(put 'gnus-category-mode 'mode-class 'special)
(unless gnus-category-mode-map
(setq gnus-category-mode-map (make-sparse-keymap))
(gnus-run-hooks 'gnus-category-menu-hook)))
-(define-derived-mode gnus-category-mode fundamental-mode "Category"
+(define-derived-mode gnus-category-mode gnus-mode "Category"
"Major mode for listing and editing agent categories.
-
All normal editing commands are switched off.
\\<gnus-category-mode-map>
For more in-depth information on this mode, read the manual
(gnus-set-default-directory)
(setq mode-line-process nil)
(buffer-disable-undo)
- (setq truncate-lines t)
- (setq buffer-read-only t))
+ (setq truncate-lines t))
(defalias 'gnus-category-position-point 'gnus-goto-colon)
;;; Gnus article mode
;;;
-(put 'gnus-article-mode 'mode-class 'special)
-
(set-keymap-parent gnus-article-mode-map widget-keymap)
(gnus-define-keys gnus-article-mode-map
(defvar bookmark-make-record-function)
(defvar shr-put-image-function)
-(define-derived-mode gnus-article-mode fundamental-mode "Article"
+(define-derived-mode gnus-article-mode gnus-mode "Article"
"Major mode for displaying an article.
-
All normal editing commands are switched off.
The following commands are available in addition to all summary mode
(setq cursor-in-non-selected-windows nil))
(gnus-set-default-directory)
(buffer-disable-undo)
- (setq buffer-read-only t
- show-trailing-whitespace nil)
+ (setq show-trailing-whitespace nil)
(mm-enable-multibyte))
(defun gnus-article-setup-buffer ()
;;; Gnus group mode
;;;
-(put 'gnus-group-mode 'mode-class 'special)
-
(gnus-define-keys gnus-group-mode-map
" " gnus-group-read-group
"=" gnus-group-select-group
(set (make-local-variable 'tool-bar-map) map))))
gnus-group-tool-bar-map)
-(define-derived-mode gnus-group-mode fundamental-mode "Group"
+(define-derived-mode gnus-group-mode gnus-mode "Group"
"Major mode for reading news.
-
All normal editing commands are switched off.
\\<gnus-group-mode-map>
The group buffer lists (some of) the groups available. For instance,
(setq mode-line-process nil)
(buffer-disable-undo)
(setq truncate-lines t)
- (setq buffer-read-only t
- show-trailing-whitespace nil)
+ (setq show-trailing-whitespace nil)
(gnus-set-default-directory)
(gnus-update-format-specifications nil 'group 'group-mode)
(gnus-update-group-mark-positions)
(require 'gnus-art)
(require 'gnus-range)
-(defcustom gnus-kill-file-mode-hook nil
- "Hook for Gnus kill file mode."
- :group 'gnus-score-kill
- :type 'hook)
-
(defcustom gnus-kill-expiry-days 7
"Number of days before expiring unused kill file entries."
:group 'gnus-score-kill
(function :tag "Other" nil))
:group 'gnus-summary-tree)
-(defcustom gnus-tree-mode-hook nil
- "Hook run in tree mode buffers."
- :type 'hook
- :group 'gnus-summary-tree)
-
;;; Internal variables.
(defvar gnus-tmp-name)
'undefined 'gnus-tree-read-summary-keys map)
map))
-(put 'gnus-tree-mode 'mode-class 'special)
-
(defun gnus-tree-make-menu-bar ()
(unless (boundp 'gnus-tree-menu)
(easy-menu-define
'("Tree"
["Select article" gnus-tree-select-article t]))))
-(define-derived-mode gnus-tree-mode fundamental-mode "Tree"
+(define-derived-mode gnus-tree-mode gnus-mode "Tree"
"Major mode for displaying thread trees."
(gnus-set-format 'tree-mode)
(gnus-set-format 'tree t)
(autoload 'gnus-group-make-nnir-group "nnir")
-(defcustom gnus-server-mode-hook nil
- "Hook run in `gnus-server-mode' buffers."
- :group 'gnus-server
- :type 'hook)
-
(defcustom gnus-server-exit-hook nil
"Hook run when exiting the server buffer."
:group 'gnus-server
(defvar gnus-server-mode-line-format-spec nil)
(defvar gnus-server-killed-servers nil)
-(defvar gnus-server-mode-map)
+(defvar gnus-server-mode-map nil)
(defcustom gnus-server-menu-hook nil
"Hook run after the creation of the server mode menu."
(gnus-run-hooks 'gnus-server-menu-hook)))
-(defvar gnus-server-mode-map nil)
-(put 'gnus-server-mode 'mode-class 'special)
-
(unless gnus-server-mode-map
- (setq gnus-server-mode-map (make-sparse-keymap))
+ (setq gnus-server-mode-map (make-keymap))
(suppress-keymap gnus-server-mode-map)
(gnus-define-keys gnus-server-mode-map
("(\\(offline\\))" 1 'gnus-server-offline)
("(\\(denied\\))" 1 'gnus-server-denied)))
-(defun gnus-server-mode ()
+(define-derived-mode gnus-server-mode gnus-mode "Server"
"Major mode for listing and editing servers.
-
All normal editing commands are switched off.
\\<gnus-server-mode-map>
For more in-depth information on this mode, read the manual
The following commands are available:
\\{gnus-server-mode-map}"
- ;; FIXME: Use define-derived-mode.
- (interactive)
(when (gnus-visual-p 'server-menu 'menu)
(gnus-server-make-menu-bar))
- (kill-all-local-variables)
(gnus-simplify-mode-line)
- (setq major-mode 'gnus-server-mode)
- (setq mode-name "Server")
(gnus-set-default-directory)
(setq mode-line-process nil)
- (use-local-map gnus-server-mode-map)
(buffer-disable-undo)
(setq truncate-lines t)
- (setq buffer-read-only t)
(set (make-local-variable 'font-lock-defaults)
- '(gnus-server-font-lock-keywords t))
- (gnus-run-mode-hooks 'gnus-server-mode-hook))
+ '(gnus-server-font-lock-keywords t)))
+
(defun gnus-server-insert-server-line (name method)
(let* ((gnus-tmp-name name)
(defun gnus-enter-server-buffer ()
"Set up the server buffer."
- (gnus-server-setup-buffer)
(gnus-configure-windows 'server)
;; Usually `gnus-configure-windows' will finish with the
;; `gnus-server-buffer' selected as the current buffer, but not always (I
;; bumped into it when starting from a dedicated *Group* frame, and
;; gnus-configure-windows opened *Server* into its own dedicated frame).
- (with-current-buffer (get-buffer gnus-server-buffer)
+ (with-current-buffer (get-buffer-create gnus-server-buffer)
+ (gnus-server-mode)
(gnus-server-prepare)))
-(defun gnus-server-setup-buffer ()
- "Initialize the server buffer."
- (unless (get-buffer gnus-server-buffer)
- (with-current-buffer (gnus-get-buffer-create gnus-server-buffer)
- (gnus-server-mode))))
-
(defun gnus-server-prepare ()
(gnus-set-format 'server-mode)
(gnus-set-format 'server t)
function
(repeat function)))
-(defvar gnus-browse-mode-hook nil)
(defvar gnus-browse-mode-map nil)
-(put 'gnus-browse-mode 'mode-class 'special)
(unless gnus-browse-mode-map
(setq gnus-browse-mode-map (make-keymap))
(gnus-message 5 "Connecting to %s...done" (nth 1 method))
t))))
-(define-derived-mode gnus-browse-mode fundamental-mode "Browse Server"
+(define-derived-mode gnus-browse-mode gnus-mode "Browse Server"
"Major mode for browsing a foreign server.
-
All normal editing commands are switched off.
\\<gnus-browse-mode-map>
(setq mode-line-process nil)
(buffer-disable-undo)
(setq truncate-lines t)
- (gnus-set-default-directory)
- (setq buffer-read-only t))
+ (gnus-set-default-directory))
(defun gnus-browse-read-group (&optional no-article number)
"Enter the group at the current line.
;;; Gnus summary mode
;;;
-(put 'gnus-summary-mode 'mode-class 'special)
-
(defvar gnus-article-commands-menu)
;; Non-orthogonal keys
\f
(defvar bidi-paragraph-direction)
-(defun gnus-summary-mode (&optional group)
+(define-derived-mode gnus-summary-mode gnus-mode "Summary"
"Major mode for reading articles.
-
-All normal editing commands are switched off.
\\<gnus-summary-mode-map>
Each line in this buffer represents one article. To read an
article, you can, for instance, type `\\[gnus-summary-next-page]'. To move forwards
The following commands are available:
\\{gnus-summary-mode-map}"
- ;; FIXME: Use define-derived-mode.
- (interactive)
- (kill-all-local-variables)
(let ((gnus-summary-local-variables gnus-newsgroup-variables))
(gnus-summary-make-local-variables))
(gnus-summary-make-local-variables)
- (setq gnus-newsgroup-name group)
(when (gnus-visual-p 'summary-menu 'menu)
(gnus-summary-make-menu-bar)
(gnus-summary-make-tool-bar))
(gnus-make-thread-indent-array)
(gnus-simplify-mode-line)
- (setq major-mode 'gnus-summary-mode)
- (setq mode-name "Summary")
- (use-local-map gnus-summary-mode-map)
(buffer-disable-undo)
- (setq buffer-read-only t
- show-trailing-whitespace nil
+ (setq show-trailing-whitespace nil
truncate-lines t
bidi-paragraph-direction 'left-to-right)
(add-to-invisibility-spec '(gnus-sum . t))
(make-local-variable 'gnus-summary-dummy-line-format)
(make-local-variable 'gnus-summary-dummy-line-format-spec)
(make-local-variable 'gnus-summary-mark-positions)
+ (make-local-variable 'gnus-article-buffer)
+ (make-local-variable 'gnus-article-current)
+ (make-local-variable 'gnus-original-article-buffer)
(add-hook 'pre-command-hook 'gnus-set-global-variables nil t)
- (gnus-run-mode-hooks 'gnus-summary-mode-hook)
- (turn-on-gnus-mailing-list-mode)
(mm-enable-multibyte)
(set (make-local-variable 'bookmark-make-record-function)
- 'gnus-summary-bookmark-make-record)
- (gnus-update-format-specifications nil 'summary 'summary-mode 'summary-dummy)
- (gnus-update-summary-mark-positions))
+ 'gnus-summary-bookmark-make-record))
(defun gnus-summary-make-local-variables ()
"Make all the local summary buffer variables."
(current-buffer))))))
(defun gnus-summary-setup-buffer (group)
- "Initialize summary buffer.
-If the setup was successful, non-nil is returned."
+ "Initialize summary buffer for GROUP.
+This function does all setup work that relies on the specific
+value of GROUP, and puts the buffer in `gnus-summary-mode'.
+
+Returns non-nil if the setup was successful."
(let ((buffer (gnus-summary-buffer-name group))
(dead-name (concat "*Dead Summary "
(gnus-group-decoded-name group) "*")))
(not gnus-newsgroup-prepared))
(set-buffer (gnus-get-buffer-create buffer))
(setq gnus-summary-buffer (current-buffer))
- (gnus-summary-mode group)
+ (gnus-summary-mode)
(when (gnus-group-quit-config group)
(set (make-local-variable 'gnus-single-article-buffer) nil))
- (make-local-variable 'gnus-article-buffer)
- (make-local-variable 'gnus-article-current)
- (make-local-variable 'gnus-original-article-buffer)
(setq gnus-newsgroup-name group)
+ (turn-on-gnus-mailing-list-mode)
+ ;; These functions don't currently depend on GROUP, but might in
+ ;; the future.
+ (gnus-update-format-specifications nil 'summary 'summary-mode 'summary-dummy)
+ (gnus-update-summary-mark-positions)
;; Set any local variables in the group parameters.
(gnus-summary-set-local-parameters gnus-newsgroup-name)
t)))
(defun gnus-summary-read-group-1 (group show-all no-article
kill-buffer no-display
&optional select-articles)
+ "Display articles and threads in a Summary buffer for GROUP."
+ ;; This function calls `gnus-summary-setup-buffer' to create the
+ ;; buffer, put it in `gnus-summary-mode', and set local variables;
+ ;; `gnus-select-newsgroup' to update the group's active and marks
+ ;; from the server; and `gnus-summary-prepare' to actually insert
+ ;; lines for articles. The rest of the function is mostly concerned
+ ;; with limiting and positioning and windowing and other visual
+ ;; effects.
+
;; Killed foreign groups can't be entered.
;; (when (and (not (gnus-group-native-p group))
;; (not (gnus-gethash group gnus-newsrc-hashtb)))
"Face used for low interest read articles."
:group 'gnus-summary)
+;;; Base gnus-mode
+
+(define-derived-mode gnus-mode special-mode nil
+ "Base mode from which all other gnus modes derive.
+This does nothing but derive from `special-mode', and should not
+be used directly.")
;;;
;;; Gnus buffers