Mercurial > emacs
view lisp/erc/erc-spelling.el @ 93808:2c72483f42c9
(diary-view-entries-initially-flag): Rename view-diary-entries-initially.
Keep old name as alias, update users.
(calendar-mark-diary-entries-flag): Rename mark-diary-entries-in-calendar.
Keep old name as alias, update users.
(calendar-view-holidays-initially-flag): Rename
view-calendar-holidays-initially. Keep old name as alias, update users.
(calendar-mark-holidays-flag): Rename mark-holidays-in-calendar.
Keep old name as alias, update users.
(calendar-initial-window-hook): Rename initial-calendar-window-hook.
Keep old name as alias, update users.
(calendar-today-visible-hook): Rename today-visible-calendar-hook.
Keep old name as alias, update users.
(calendar-today-invisible-hook): Rename today-invisible-calendar-hook.
Keep old name as alias, update users.
(diary-iso-date-forms): Rename iso-date-diary-pattern. Update users.
(diary-american-date-forms): Rename american-date-diary-pattern.
Keep old name as alias, update users.
(diary-european-date-forms): Rename european-date-diary-pattern.
Keep old name as alias, update users.
(calendar-iso-date-display-form): Rename iso-calendar-display-form.
Keep old name as alias, update users.
(calendar-european-date-display-form): Rename european-calendar-display-form.
Keep old name as alias, update users.
(calendar-american-date-display-form): Rename european-calendar-display-form.
Keep old name as alias, update users.
(diary-show-holidays-flag): Rename holidays-in-diary-buffer.
Keep old name as alias, update users.
(holiday-general-holidays): Rename general-holidays. Keep old name as alias,
update users.
(holiday-oriental-holidays): Rename oriental-holidays. Keep old name as alias,
update users.
(holiday-local-holidays): Rename local-holidays. Keep old name as alias,
update users.
(holiday-other-holidays): Rename other-holidays. Keep old name as alias,
update users.
(holiday-hebrew-holidays): Rename hebrew-holidays. Keep old name as alias,
update users.
(holiday-christian-holidays): Rename christian-holidays.
Keep old name as alias, update users.
(holiday-islamic-holidays): Rename islamic-holidays. Keep old name as alias,
update users.
(holiday-bahai-holidays): Rename bahai-holidays. Keep old name as alias,
update users.
(holiday-solar-holidays): Rename solar-holidays. Keep old name as alias,
update users.
(diary-fancy-buffer): Rename fancy-diary-buffer. Keep old name as alias,
update users.
(calendar-other-calendars-buffer): Rename other-calendars-buffer. Update users.
(calendar-hebrew-yahrzeit-buffer): Rename cal-hebrew-yahrzeit-buffer.
Update users.
(calendar-increment-month): Rename increment-calendar-month.
Keep old name as alias, update callers.
(calendar-increment-month-cons): Rename old calendar-increment-month.
Update callers.
(calendar-extract-month): Rename extract-calendar-month.
Keep old name as alias, update callers
(calendar-extract-day): Rename extract-calendar-day. Keep old name as alias,
update callers.
(calendar-extract-year): Rename extract-calendar-year. Keep old name as alias,
update callers.
(calendar-generate-window): Rename generate-calendar-window. Update callers.
(calendar-generate): Rename generate-calendar. Update callers.
(calendar-generate-month): Rename generate-calendar-month. Update callers.
(calendar-redraw): Rename redraw-calendar. Update callers.
(calendar-describe-mode): Rename describe-calendar-mode. Update uses.
(calendar-mouse-other-month): Rename mouse-calendar-other-month.
Update callers.
(calendar-update-mode-line): Rename update-calendar-mode-line. Update callers.
(calendar-exit): Rename exit-calendar. Keep old name as alias, update callers.
(calendar-mark-visible-date): Rename mark-visible-calendar-date.
Keep old name as alias, update callers.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Mon, 07 Apr 2008 01:58:55 +0000 |
parents | 5f92874bde07 |
children | 2a734255bcc7 |
line wrap: on
line source
;;; erc-spelling.el --- use flyspell in ERC ;; Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc. ;; Author: Jorgen Schaefer <forcer@forcix.cx> ;; Keywords: irc ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcSpelling ;; This file is part of GNU Emacs. ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; 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., 51 Franklin Street, Fifth Floor, ;; Boston, MA 02110-1301, USA. ;;; Commentary: ;; This is an ERC module to enable flyspell mode in ERC buffers. This ;; ensures correct behavior of flyspell, and even sets up a ;; channel-local dictionary if so required. ;;; Code: (require 'erc) (require 'flyspell) ;;;###autoload (autoload 'erc-spelling-mode "erc-spelling" nil t) (define-erc-module spelling nil "Enable flyspell mode in ERC buffers." ;; Use erc-connect-pre-hook instead of erc-mode-hook as pre-hook is ;; called AFTER the server buffer is initialized. ((add-hook 'erc-connect-pre-hook 'erc-spelling-init) (dolist (buffer (erc-buffer-list)) (erc-spelling-init buffer))) ((remove-hook 'erc-connect-pre-hook 'erc-spelling-init) (dolist (buffer (erc-buffer-list)) (with-current-buffer buffer (flyspell-mode 0))))) (defcustom erc-spelling-dictionaries nil "An alist mapping buffer names to dictionaries. The `car' of every cell is a buffer name, the `cadr' is the string name of an associated dictionary. The dictionary is inherited from server buffers, so if you want a default dictionary for some server, you can use a server buffer name here." :type '(choice (const nil) (repeat (cons (string :tag "Buffer name") (string :tag "Dictionary")))) :group 'erc-spelling) (defun erc-spelling-init (buffer) "Enable flyspell mode in an ERC buffer. The current buffer is given by BUFFER." (with-current-buffer buffer (let ((name (downcase (buffer-name))) (dicts erc-spelling-dictionaries)) (when dicts (while (and dicts (not (string= name (downcase (caar dicts))))) (setq dicts (cdr dicts))) (setq ispell-local-dictionary (if dicts (cadr (car dicts)) (erc-with-server-buffer ispell-local-dictionary))))) (setq flyspell-generic-check-word-p 'erc-spelling-flyspell-verify) (flyspell-mode 1))) (defun erc-spelling-unhighlight-word (word) "Unhighlight the given WORD. The cadr is the beginning and the caddr is the end." (let ((beg (nth 1 word)) (end (nth 2 word))) (flyspell-unhighlight-at beg) (when (> end beg) (flyspell-unhighlight-at (1- end))))) (defun erc-spelling-flyspell-verify () "Flyspell only the input line, nothing else." (let ((word-data (and (boundp 'flyspell-word) flyspell-word))) (when word-data (cond ((< (point) erc-input-marker) nil) ;; don't spell-check names of users ((and erc-channel-users (erc-get-channel-user (car word-data))) (erc-spelling-unhighlight-word word-data) nil) ;; if '/' occurs before the word, don't spell-check it ((eq (char-before (nth 1 word-data)) ?/) (erc-spelling-unhighlight-word word-data) nil) (t t))))) (put 'erc-mode 'flyspell-mode-predicate 'erc-spelling-flyspell-verify) (provide 'erc-spelling) ;; arch-tag: 04ae1c46-0fd1-4e1a-8b80-55bfa471c945 ;;; erc-spelling.el ends here