projects
/
elisp
/
gnus.git-
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Synch to No Gnus 200510042243.
[elisp/gnus.git-]
/
lisp
/
score-mode.el
diff --git
a/lisp/score-mode.el
b/lisp/score-mode.el
index
24c31f6
..
dc2185c
100644
(file)
--- a/
lisp/score-mode.el
+++ b/
lisp/score-mode.el
@@
-1,5
+1,7
@@
;;; score-mode.el --- mode for editing Gnus score files
;;; score-mode.el --- mode for editing Gnus score files
-;; Copyright (C) 1996 Free Software Foundation, Inc.
+
+;; Copyright (C) 1996, 2001, 2002, 2003, 2004,
+;; 2005 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Keywords: news, mail
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Keywords: news, mail
@@
-18,16
+20,16
@@
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
;;; Commentary:
;;; Code:
;;; Commentary:
;;; Code:
-(require 'easymenu)
-(require 'timezone)
(eval-when-compile (require 'cl))
(eval-when-compile (require 'cl))
+(eval-when-compile (require 'static))
+(require 'gnus-util) ; for gnus-pp, gnus-run-mode-hooks
(defvar gnus-score-mode-hook nil
"*Hook run in score mode buffers.")
(defvar gnus-score-mode-hook nil
"*Hook run in score mode buffers.")
@@
-40,7
+42,8
@@
(defvar gnus-score-mode-map nil)
(unless gnus-score-mode-map
(defvar gnus-score-mode-map nil)
(unless gnus-score-mode-map
- (setq gnus-score-mode-map (copy-keymap emacs-lisp-mode-map))
+ (setq gnus-score-mode-map (make-sparse-keymap))
+ (set-keymap-parent gnus-score-mode-map emacs-lisp-mode-map)
(define-key gnus-score-mode-map "\C-c\C-c" 'gnus-score-edit-exit)
(define-key gnus-score-mode-map "\C-c\C-d" 'gnus-score-edit-insert-date)
(define-key gnus-score-mode-map "\C-c\C-p" 'gnus-score-pretty-print))
(define-key gnus-score-mode-map "\C-c\C-c" 'gnus-score-edit-exit)
(define-key gnus-score-mode-map "\C-c\C-d" 'gnus-score-edit-insert-date)
(define-key gnus-score-mode-map "\C-c\C-p" 'gnus-score-pretty-print))
@@
-51,6
+54,8
@@
table)
"Syntax table used in score-mode buffers.")
table)
"Syntax table used in score-mode buffers.")
+(defvar score-mode-coding-system 'ctext)
+
;;;###autoload
(defun gnus-score-mode ()
"Mode for editing Gnus score files.
;;;###autoload
(defun gnus-score-mode ()
"Mode for editing Gnus score files.
@@
-66,7
+71,7
@@
This mode is an extended emacs-lisp mode.
(setq mode-name "Score")
(lisp-mode-variables nil)
(make-local-variable 'gnus-score-edit-exit-function)
(setq mode-name "Score")
(lisp-mode-variables nil)
(make-local-variable 'gnus-score-edit-exit-function)
- (run-hooks 'emacs-lisp-mode-hook 'gnus-score-mode-hook))
+ (gnus-run-mode-hooks 'emacs-lisp-mode-hook 'gnus-score-mode-hook))
(defun gnus-score-make-menu-bar ()
(unless (boundp 'gnus-score-menu)
(defun gnus-score-make-menu-bar ()
(unless (boundp 'gnus-score-menu)
@@
-81,7
+86,7
@@
This mode is an extended emacs-lisp mode.
(defun gnus-score-edit-insert-date ()
"Insert date in numerical format."
(interactive)
(defun gnus-score-edit-insert-date ()
"Insert date in numerical format."
(interactive)
- (princ (gnus-score-day-number (current-time)) (current-buffer)))
+ (princ (time-to-days (current-time)) (current-buffer)))
(defun gnus-score-pretty-print ()
"Format the current score file."
(defun gnus-score-pretty-print ()
"Format the current score file."
@@
-90,7
+95,7
@@
This mode is an extended emacs-lisp mode.
(let ((form (read (current-buffer))))
(erase-buffer)
(let ((emacs-lisp-mode-syntax-table score-mode-syntax-table))
(let ((form (read (current-buffer))))
(erase-buffer)
(let ((emacs-lisp-mode-syntax-table score-mode-syntax-table))
- (pp form (current-buffer))))
+ (gnus-pp form)))
(goto-char (point-min)))
(defun gnus-score-edit-exit ()
(goto-char (point-min)))
(defun gnus-score-edit-exit ()
@@
-98,7
+103,7
@@
This mode is an extended emacs-lisp mode.
(interactive)
(unless (file-exists-p (file-name-directory (buffer-file-name)))
(make-directory (file-name-directory (buffer-file-name)) t))
(interactive)
(unless (file-exists-p (file-name-directory (buffer-file-name)))
(make-directory (file-name-directory (buffer-file-name)) t))
- (save-buffer)
+ (save-buffer-as-coding-system score-mode-coding-system)
(bury-buffer (current-buffer))
(let ((buf (current-buffer)))
(when gnus-score-edit-exit-function
(bury-buffer (current-buffer))
(let ((buf (current-buffer)))
(when gnus-score-edit-exit-function
@@
-106,11
+111,6
@@
This mode is an extended emacs-lisp mode.
(when (eq buf (current-buffer))
(switch-to-buffer (other-buffer (current-buffer))))))
(when (eq buf (current-buffer))
(switch-to-buffer (other-buffer (current-buffer))))))
-(defun gnus-score-day-number (time)
- (let ((dat (decode-time time)))
- (timezone-absolute-from-gregorian
- (nth 4 dat) (nth 3 dat) (nth 5 dat))))
-
(provide 'score-mode)
;;; score-mode.el ends here
(provide 'score-mode)
;;; score-mode.el ends here