From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [ELPA] New package: Auto Correct Mode Date: Sun, 27 Aug 2017 19:34:26 +0300 Message-ID: <83shgd3r71.fsf@gnu.org> References: <87zialc7wx.fsf@escafil> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1503851786 15385 195.159.176.226 (27 Aug 2017 16:36:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 27 Aug 2017 16:36:26 +0000 (UTC) Cc: emacs-devel@gnu.org To: Ian Dunn Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Aug 27 18:36:13 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dm0Xc-0002wu-JG for ged-emacs-devel@m.gmane.org; Sun, 27 Aug 2017 18:36:04 +0200 Original-Received: from localhost ([::1]:33302 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dm0Xj-0006kz-7e for ged-emacs-devel@m.gmane.org; Sun, 27 Aug 2017 12:36:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46271) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dm0WG-0005sS-AO for emacs-devel@gnu.org; Sun, 27 Aug 2017 12:34:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dm0WC-00010z-CW for emacs-devel@gnu.org; Sun, 27 Aug 2017 12:34:40 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55431) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dm0WC-00010v-91 for emacs-devel@gnu.org; Sun, 27 Aug 2017 12:34:36 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2940 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dm0WB-0005Y6-BO; Sun, 27 Aug 2017 12:34:35 -0400 In-reply-to: <87zialc7wx.fsf@escafil> (message from Ian Dunn on Sun, 27 Aug 2017 12:06:06 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:217850 Archived-At: > From: Ian Dunn > Date: Sun, 27 Aug 2017 12:06:06 -0400 > > I'd like to submit auto-correct.el as a single-file package to ELPA. It's a small package that integrates with ispell and abbrev to provide auto-correct functionality in Emacs. It uses a separate abbrev table, which is only enabled in auto-correct-mode, and only auto-corrects if a buffer-local predicate returns true. > > As with the last two I've submitted today, if no one has any objections, I'll update the copyright and push it to the git repo. Thanks. Please allow me a few stylistic comments: > ;;; Commentary: > > ;;; Code: I suggest to say at least a few words about the package and what it does (or doesn't do) in the Commentary section. "Auto-correct" sounds very promising, so users might have their expectations too high... > (defgroup auto-correct nil > "*Auto correction support." We no longer use the leading asterisk in doc strings. > (defun auto-correct-fix-and-add (p) > "Call `ispell-word', then create an abbrev for it. > With prefix P, create local abbrev. Otherwise it will > be global. Our usual style is "With a non-nil argument P (interactively, the prefix argument), create ..." Also, we use the US English convention of leaving 2 spaces between sentences. > Originally pulled from endless parenthesis." ??? > ;; correction was entered by hand. Comments should preferably be full sentences, so start with a capital letter. > ;;;###autoload > (defun auto-correct-scan-buffer () > "Scans current buffer for misspelled words. Our usual style is to say "Scan", not "Scans". > When a misspelled word is found, offers to correct and add." ^^^^^^ Resp. "offer". Also, I'd elaborate a bit wrt "and add", as it otherwise sounds mysterious. > (defun auto-correct-scan-region (start end) > (interactive "r") Interactive functions should have a doc string. > (defun auto-correct-scan () > "Scans the buffer or region." This doc string sounds too minimal... Thanks again for working on this.