comparison lisp/gnus/score-mode.el @ 24357:15fc6acbae7a

Upgrading to Gnus 5.7; see ChangeLog
author Lars Magne Ingebrigtsen <larsi@gnus.org>
date Sat, 20 Feb 1999 14:05:57 +0000
parents e6935c08cf0b
children 9968f55ad26e
comparison
equal deleted inserted replaced
24356:a5a611ef40f6 24357:15fc6acbae7a
1 ;;; score-mode.el --- mode for editing Gnus score files 1 ;;; score-mode.el --- mode for editing Gnus score files
2 ;; Copyright (C) 1996 Free Software Foundation, Inc. 2 ;; Copyright (C) 1996 Free Software Foundation, Inc.
3 3
4 ;; Author: Lars Magne Ingebrigtsen <larsi@ifi.uio.no> 4 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
5 ;; Keywords: news, mail 5 ;; Keywords: news, mail
6 6
7 ;; This file is part of GNU Emacs. 7 ;; This file is part of GNU Emacs.
8 8
9 ;; GNU Emacs is free software; you can redistribute it and/or modify 9 ;; GNU Emacs is free software; you can redistribute it and/or modify
43 (setq gnus-score-mode-map (copy-keymap emacs-lisp-mode-map)) 43 (setq gnus-score-mode-map (copy-keymap emacs-lisp-mode-map))
44 (define-key gnus-score-mode-map "\C-c\C-c" 'gnus-score-edit-exit) 44 (define-key gnus-score-mode-map "\C-c\C-c" 'gnus-score-edit-exit)
45 (define-key gnus-score-mode-map "\C-c\C-d" 'gnus-score-edit-insert-date) 45 (define-key gnus-score-mode-map "\C-c\C-d" 'gnus-score-edit-insert-date)
46 (define-key gnus-score-mode-map "\C-c\C-p" 'gnus-score-pretty-print)) 46 (define-key gnus-score-mode-map "\C-c\C-p" 'gnus-score-pretty-print))
47 47
48 (defvar score-mode-syntax-table
49 (let ((table (copy-syntax-table lisp-mode-syntax-table)))
50 (modify-syntax-entry ?| "w" table)
51 table)
52 "Syntax table used in score-mode buffers.")
53
48 ;;;###autoload 54 ;;;###autoload
49 (defun gnus-score-mode () 55 (defun gnus-score-mode ()
50 "Mode for editing Gnus score files. 56 "Mode for editing Gnus score files.
51 This mode is an extended emacs-lisp mode. 57 This mode is an extended emacs-lisp mode.
52 58
53 \\{gnus-score-mode-map}" 59 \\{gnus-score-mode-map}"
54 (interactive) 60 (interactive)
55 (kill-all-local-variables) 61 (kill-all-local-variables)
56 (use-local-map gnus-score-mode-map) 62 (use-local-map gnus-score-mode-map)
57 (gnus-score-make-menu-bar) 63 (gnus-score-make-menu-bar)
58 (set-syntax-table emacs-lisp-mode-syntax-table) 64 (set-syntax-table score-mode-syntax-table)
59 (setq major-mode 'gnus-score-mode) 65 (setq major-mode 'gnus-score-mode)
60 (setq mode-name "Score") 66 (setq mode-name "Score")
61 (lisp-mode-variables nil) 67 (lisp-mode-variables nil)
62 (make-local-variable 'gnus-score-edit-exit-function) 68 (make-local-variable 'gnus-score-edit-exit-function)
63 (run-hooks 'emacs-lisp-mode-hook 'gnus-score-mode-hook)) 69 (run-hooks 'emacs-lisp-mode-hook 'gnus-score-mode-hook))
81 "Format the current score file." 87 "Format the current score file."
82 (interactive) 88 (interactive)
83 (goto-char (point-min)) 89 (goto-char (point-min))
84 (let ((form (read (current-buffer)))) 90 (let ((form (read (current-buffer))))
85 (erase-buffer) 91 (erase-buffer)
86 (pp form (current-buffer))) 92 (let ((emacs-lisp-mode-syntax-table score-mode-syntax-table))
93 (pp form (current-buffer))))
87 (goto-char (point-min))) 94 (goto-char (point-min)))
88 95
89 (defun gnus-score-edit-exit () 96 (defun gnus-score-edit-exit ()
90 "Stop editing the score file." 97 "Stop editing the score file."
91 (interactive) 98 (interactive)