1 ;;; riece-compat.el --- compatibility functions
2 ;; Copyright (C) 1998-2003 Daiki Ueno
4 ;; Author: Daiki Ueno <ueno@unixuser.org>
6 ;; Keywords: IRC, riece, APEL
8 ;; This file is part of Riece.
10 ;; This program is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
15 ;; This program is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 ;; Boston, MA 02110-1301, USA.
27 (if (featurep 'xemacs)
28 (require 'riece-xemacs)
29 (require 'riece-emacs))
31 (defalias 'riece-mode-line-buffer-identification
34 (defun riece-simplify-mode-line-format ()
35 "Remove unnecessary information from `mode-line-format'."
36 (let ((value (rassq 'mode-line-modified mode-line-format)))
38 (setq mode-line-format (delq value (copy-sequence mode-line-format)))
41 (defun riece-line-beginning-position ()
46 (defun riece-line-end-position ()
51 (autoload 'read-passwd "passwd")
52 (defvar riece-read-passwd #'read-passwd)
53 (defun riece-read-passwd (prompt)
54 (funcall riece-read-passwd prompt))
56 (if (string-match "0\\{0\\}" "")
57 (defun riece-make-interval-regexp (regexp min &optional max)
59 (format "%s\\{%d,%d\\}" regexp min max)
60 (format "%s\\{%d\\}" regexp min)))
61 ;; Emacs 20.7 doesn't support \{...\} in regexps.
62 (defun riece-make-interval-regexp (regexp min &optional max)
64 (nconc (make-list min regexp)
66 (make-list (- max min) (concat regexp "?"))))
69 (if (get 'make-local-hook 'byte-obsolete-info)
70 (defalias 'riece-make-local-hook 'ignore)
71 (defalias 'riece-make-local-hook 'make-local-hook))
73 (autoload 'derived-mode-class "derived")
74 (if (fboundp 'derived-mode-p)
75 (defalias 'riece-derived-mode-p 'derived-mode-p)
76 (defun riece-derived-mode-p (&rest modes)
77 (memq (derived-mode-class major-mode) modes)))
79 (if (fboundp 'set-process-query-on-exit-flag)
80 (defalias 'riece-set-process-query-on-exit-flag
81 'set-process-query-on-exit-flag)
82 (defalias 'riece-set-process-query-on-exit-flag
83 process-kill-without-query))
85 (provide 'riece-compat)
87 ;;; riece-compat.el ends here