* Re: lost my abbrev-defs file
2010-04-26 2:58 lost my abbrev-defs file Matt Price
@ 2010-04-26 5:28 ` filebat Mark
2010-04-26 12:00 ` Andreas Röhler
1 sibling, 0 replies; 3+ messages in thread
From: filebat Mark @ 2010-04-26 5:28 UTC (permalink / raw)
To: Matt Price; +Cc: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 1292 bytes --]
Hi Matt
This is really pathetic! My abbrev file is quite personal, so it shall be
useless to you.
As for backup, I strongly recommend you to use dropbox + svn/git.
# dropbox is a wonderful online storage: support versioning, 2 GB free
capacity, high liability and easy to use.
https://www.dropbox.com/
# git/svn: I used to deploy a local version control server, since public
server is not so reliable.
Public server like http://opensvn.csie.org, is not stable.
Google code/git hub force me to share my privacy with the
public.
Regards,
Denny
On 4/26/10, Matt Price <moptop99@gmail.com> 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
>
>
>
--
Thanks & Regards
Denny Zhang
[-- Attachment #2: Type: text/html, Size: 1789 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: lost my abbrev-defs file
2010-04-26 2:58 lost my abbrev-defs file Matt Price
2010-04-26 5:28 ` filebat Mark
@ 2010-04-26 12:00 ` Andreas Röhler
1 sibling, 0 replies; 3+ messages in thread
From: Andreas Röhler @ 2010-04-26 12:00 UTC (permalink / raw)
To: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 1366 bytes --]
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/
[-- Attachment #2: mode-abbrev-propose.el --]
[-- Type: text/x-emacs-lisp, Size: 3433 bytes --]
;;; mode-abbrev-propose.el --- initial content for mode-abbrevs
;; for all Emacsen
;; Author: Andreas Roehler;; <andreas.roehler@online.de>
;; 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
^ permalink raw reply [flat|nested] 3+ messages in thread