From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.emacs.bugs Subject: bug#20486: 24.4; ispell.el new LocalWords together with existing Date: Sat, 02 May 2015 16:46:43 +1000 Message-ID: <878ud7zdbg.fsf@blah.blah> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1430549364 2865 80.91.229.3 (2 May 2015 06:49:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 2 May 2015 06:49:24 +0000 (UTC) To: 20486@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat May 02 08:49:12 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YoREc-0007fP-ID for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 May 2015 08:49:10 +0200 Original-Received: from localhost ([::1]:56222 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoREb-00089Z-US for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 May 2015 02:49:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55408) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoREY-00089O-MZ for bug-gnu-emacs@gnu.org; Sat, 02 May 2015 02:49:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YoREV-0006JP-6t for bug-gnu-emacs@gnu.org; Sat, 02 May 2015 02:49:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49102) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoREV-0006JE-2x for bug-gnu-emacs@gnu.org; Sat, 02 May 2015 02:49:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YoREU-0001Ps-Mz for bug-gnu-emacs@gnu.org; Sat, 02 May 2015 02:49:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Kevin Ryde Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 May 2015 06:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 20486 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14305493045380 (code B ref -1); Sat, 02 May 2015 06:49:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 May 2015 06:48:24 +0000 Original-Received: from localhost ([127.0.0.1]:59077 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YoRDr-0001Og-7Y for submit@debbugs.gnu.org; Sat, 02 May 2015 02:48:23 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:41799) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YoRDp-0001OR-2V for submit@debbugs.gnu.org; Sat, 02 May 2015 02:48:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YoRDi-0006CU-LO for submit@debbugs.gnu.org; Sat, 02 May 2015 02:48:15 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:37335) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoRDi-0006CQ-IT for submit@debbugs.gnu.org; Sat, 02 May 2015 02:48:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55302) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoRDh-000883-6J for bug-gnu-emacs@gnu.org; Sat, 02 May 2015 02:48:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YoRDd-0006Bw-U5 for bug-gnu-emacs@gnu.org; Sat, 02 May 2015 02:48:13 -0400 Original-Received: from nm2-vm1.bullet.mail.bf1.yahoo.com ([98.139.213.158]:38678) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoRDd-0006Bi-OS for bug-gnu-emacs@gnu.org; Sat, 02 May 2015 02:48:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com.au; s=s2048; t=1430549288; bh=Vil9ImUlrkUsOBY+PCC/kCnvsfEcG/7gi3obWJvq87o=; h=From:To:Subject:Date:From:Subject; b=hYkJ400QpXVxzfNmva0Z16Z6PgKBLNYmZdUidNtt7G4kMDxPg5AjYik5ZLXYrR7fjwo2q2hT6nvE+5gRKOFxA5mZe2HFNK4/QCFioszcfTGkltYtno6mX3zm5nK9yCdcO6o3yoxwFGz1fJ/E2dmdsXMMnh3lXAdfQp/nK4dPKvUbMgKDZHl4kB/063hIQT/DPMN6hETDkgdymooDKbkFxfqR//A2dTUK7xAJwy2OPJRHnUwjm04VIMLwUZ+ocaqkcNrogS6XD6xCKyt8r22yUUKZKeBBXinMH3ImTegFg2q+2oOJng9B86QE3Y7hiN+FBLJEvAUdRk/8v34B+BB6Sg== Original-Received: from [66.196.81.170] by nm2.bullet.mail.bf1.yahoo.com with NNFMP; 02 May 2015 06:48:08 -0000 Original-Received: from [68.142.230.75] by tm16.bullet.mail.bf1.yahoo.com with NNFMP; 02 May 2015 06:48:08 -0000 Original-Received: from [127.0.0.1] by smtp232.mail.bf1.yahoo.com with NNFMP; 02 May 2015 06:48:08 -0000 X-Yahoo-Newman-Id: 481850.78389.bm@smtp232.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: QdNt05MVM1klQ7KmVGTD2Nnw9C5Um.vG7hmTvc5o2ck3OiZ AWi6nMO89uVufOtmviPRL5ECbEEMOHevul6ZOMh5Kpm53JIsNeguG0f7.TDn Ff8VHvlf8_.j_v7vzmujQiEFkuR.KmOTSO0AYVXHRbbgdQREsLvSc5YXCFYn q9mF7ILD3tMYAgFWA0zMcmex5JZS.qOLzudeGWntC9iHy.djc7QuLk7WY8DT NDOkSQIlQgwBT8yFsilDdIkWKbrslrLsyONJ9SANApABsh6PEsumQ8203Bty TGnNwrcKxSCoyf0u_2Aju00hHgEKZVIhHKHcG2ElsuiZyok8SIPvru_PnZ5H oT5z7apx00IOlVEtkiQBmNK9YNi00No.fqW1kl2ielLQdrBPyIZAEsw41R2E f2xGAMarxfAQh91MGOpfzMJkjSsxl96FIHx8qWkGsHza878cNskEOe7awAXu LpwDtx8BD7vPcYj4s4m3txuHQjYEn6JVcKcdLh56FtIxCE.ElGv9rSOFIihB LG20Uf9F0KGAnNddjrEvL.xdBjLN4D9G0s7SJSYTM X-Yahoo-SMTP: U8NKAo6swBAxDIMUovTitGGHebxdYQBZ5A-- User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:102356 Archived-At: --=-=-= Content-Type: text/plain When ispell.el "A" adds a new LocalWords line it always puts it at the end of the file. It'd be good to put it with existing such lines if there are some. This helps if LocalWords are deliberately not at the very end of file, eg. before a special footer. foo.el below shows this in an elisp file M-x find-file foo.el M-x eval-buffer => alas new LocalWords line after the ";;; foo.el ends here" footer I hoped LocalWords with the existing ones would avoid upsetting the footer bit. I get some joy from the diff below. The existing (open-line) and (newline) are unchanged for the case no existing LocalWords so add at end of file. I'm fairly confident of my (insert "\n") when adding after an existing LocalWords line, since since don't want `newline' to auto-fill or otherwise mangle that line. (But I'm ready to be persuaded if there's some left indent or similar to apply which I don't know.) 2015-05-02 Kevin Ryde * textmodes/ispell.el (ispell-add-per-file-word-list): Add new LocalWords line just after existing such lines. Good to keep words together or if deliberately placed somewhere special. --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=foo.el Content-Transfer-Encoding: quoted-printable ;;; foo.el --- blah ;;; Code: (require 'ispell) (ispell-add-per-file-word-list "abc") ;; LocalWords: this is some local words lines which are full so must inse= rt a new ;; LocalWords: such line but would like it added here together with exist= ing lines ;; Local variables: ;; fill-column: 60 ;; tab-width: 8 ;; End: (provide 'foo) ;;; foo.el ends here --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=ispell.el.diff --- ispell.el.orig 2015-05-02 11:24:32.000000000 +1000 +++ ispell.el 2015-05-02 14:34:42.573950776 +1000 @@ -4320,7 +4320,7 @@ (let (line-okay search done found) (while (not done) (let ((case-fold-search nil)) - (setq search (search-forward ispell-words-keyword nil 'move) + (setq search (search-forward ispell-words-keyword nil t) found (or found search) line-okay (< (+ (length word) 1 ; 1 for space after word.. (progn (end-of-line) (current-column))) @@ -4331,8 +4331,10 @@ (setq done t) (if (null search) (progn - (open-line 1) - (unless found (newline)) + (if found (insert "\n") ;; after an existing LocalWords + (goto-char (point-max)) ;; no LocalWords, go to end of file + (open-line 1) + (newline)) (insert (if comment-start (concat (if (fboundp 'comment-padright) --=-=-= Content-Type: text/plain In GNU Emacs 24.4.1 (i586-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2015-03-08 on binet, modified by Debian Configured using: `configure --build i586-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes --enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.4/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.4/site-lisp:/usr/share/emacs/site-lisp --build i586-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes --enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.4/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.4/site-lisp:/usr/share/emacs/site-lisp --with-x=yes --with-x-toolkit=lucid --with-toolkit-scroll-bars --without-gconf --without-gsettings 'CFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wall' CPPFLAGS=-D_FORTIFY_SOURCE=2 LDFLAGS=-Wl,-z,relro' --=-=-=--