From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Andreas_R=F6hler?= Newsgroups: gmane.emacs.help Subject: Re: lost my abbrev-defs file Date: Mon, 26 Apr 2010 14:00:02 +0200 Message-ID: <4BD58042.1030500@easy-emacs.de> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080208070006090905040206" X-Trace: dough.gmane.org 1272283154 754 80.91.229.12 (26 Apr 2010 11:59:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 26 Apr 2010 11:59:14 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Apr 26 13:59:12 2010 connect(): No such file or directory Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O6Mxv-0003HW-LL for geh-help-gnu-emacs@m.gmane.org; Mon, 26 Apr 2010 13:59:08 +0200 Original-Received: from localhost ([127.0.0.1]:54551 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O6Mxu-00036U-CA for geh-help-gnu-emacs@m.gmane.org; Mon, 26 Apr 2010 07:59:06 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O6MxR-00036E-9j for help-gnu-emacs@gnu.org; Mon, 26 Apr 2010 07:58:37 -0400 Original-Received: from [140.186.70.92] (port=56942 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O6MxP-00035o-Hv for help-gnu-emacs@gnu.org; Mon, 26 Apr 2010 07:58:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O6MxM-00008P-TJ for help-gnu-emacs@gnu.org; Mon, 26 Apr 2010 07:58:35 -0400 Original-Received: from moutng.kundenserver.de ([212.227.126.187]:61616) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O6MxL-00007y-68 for help-gnu-emacs@gnu.org; Mon, 26 Apr 2010 07:58:32 -0400 Original-Received: from [192.168.178.27] (p54BE8883.dip0.t-ipconnect.de [84.190.136.131]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0Lo3GS-1NV5Cd2nzU-00g2SK; Mon, 26 Apr 2010 13:58:28 +0200 User-Agent: Thunderbird 2.0.0.19 (X11/20081227) In-Reply-To: X-Provags-ID: V01U2FsdGVkX1+nUcffzxc+cJeHglblVaIvSK/DJQTcgTSUo7k Mc2XBjo1m3HGK811j7Y+Xv/gDBYAn0Tp7i9F6Zsn5QRJbKWlaO 3FKZUHhML0A8fh1ZS68EEMitHS3fOlwghdr//ZJc/4= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:72837 Archived-At: This is a multi-part message in MIME format. --------------080208070006090905040206 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Matt Price wrote: > after cultivating my abbrev_defs file for months i seem to have > accidentqally overwritten it with a blank one -- it's heartbreaking! > > so, having learned the importance of backups, or in this case maybe > version control, i'm wondering whether anyone out there has a nice > long abbrev_defs file with their commonly-mistyped English-language > words -- or if you know a place on the web i can find one. for > instance, notice that i'm typing 'i' in lowercase -- because i'm used > to having abbrev-mode correct it for me! anyway, if anyone cal help > i'd sure appreciate it. thanks much, > > matt > > > Hi, sorry, don't have that much english abbrevs, as german native speaking. Maybe there is some help though: attached mode-abbrev-propose.el makes defining of an mode-abbrev much faster: it takes a numerical argument - how many words before point being part of the expansion. Finally it offers the downcased first chars of these words as abbrev. Quite often it's just RET than to store it. Here some examples: ("atm" "at the moment" nil 0) ("atos" "At the other side" nil 0) ("belrin" "Berlin" nil 1) ("ec" "Emample code" nil 1) Should you need german abbrevs, could deliver some more... HTH Andreas -- https://code.launchpad.net/~a-roehler/python-mode https://code.launchpad.net/s-x-emacs-werkstatt/ --------------080208070006090905040206 Content-Type: text/x-emacs-lisp; name="mode-abbrev-propose.el" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="mode-abbrev-propose.el" ;;; mode-abbrev-propose.el --- initial content for mode-abbrevs ;; for all Emacsen ;; Author: Andreas Roehler;; ;; Keywords: abbrev ;; This file 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 2, or (at your option) ;; any later version. ;; This file 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: ;; A slightly modified `add-mode-abbrev' providing a ;; proposal for new abbrevs. Proposal is composed from ;; the initial character(s) of the expansion. ;;; Code: (defun add-abbrev-propose (table type arg &optional dont-ask) (save-excursion (let ((exp (and (>= arg 0) (buffer-substring-no-properties (point) (if (= arg 0) (mark) (save-excursion (forward-word (- arg)) (when (and (eq (char-before) 40) (eq major-mode 'emacs-lisp-mode)) (forward-char -1)) (point)))))) proposal name) (when (and (featurep 'xemacs)(eq major-mode 'emacs-lisp-mode)) ;; (when (eq major-mode 'emacs-lisp-mode) (setq exp (concat "(" exp))) (save-excursion (while (< 0 arg) (forward-word -1) (setq proposal (concat (downcase (buffer-substring-no-properties (point) (1+ (point)))) proposal)) (setq arg (1- arg)))) (setq name ;; ask only when interactive (if dont-ask proposal (read-string (format (if exp "%s abbrev for \"%s\": " "Undefine %s abbrev: ") type exp) proposal))) (set-text-properties 0 (length name) nil name) (when (or (null exp) (not (abbrev-expansion name table)) (y-or-n-p (format "%s expands to \"%s\"; redefine? " name (abbrev-expansion name table)))) (define-abbrev table (downcase name) exp ;; (replace-regexp-in-string "\n" " " exp) ))))) (defun add-mode-abbrev-propose (arg) "Define mode-specific abbrev for last word(s) before point. Argument is how many words before point form the expansion; or zero means the region is the expansion. A negative argument means to undefine the specified abbrev. Reads the abbreviation in the minibuffer. Don't use this function in a Lisp program; use `define-abbrev' instead." (interactive "p") (save-excursion (add-abbrev-propose (if only-global-abbrevs global-abbrev-table (or local-abbrev-table (error "No per-mode abbrev table"))) "Mode" arg))) (provide 'mode-abbrev-propose) ;;; mode-abbrev-propose.el ends here --------------080208070006090905040206--