From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Karl Voit Newsgroups: gmane.emacs.devel Subject: Re: Proper English Title Capitalization Date: Wed, 3 Jun 2015 17:05:07 +0200 Organization: www.karl-voit.at Message-ID: <2015-06-03T17-00-43@devnull.Karl-Voit.at> References: <2015-05-24T13-06-14@devnull.Karl-Voit.at> <87fv6lelmr.fsf@debian.uxu> <2015-05-25T12-05-49@devnull.Karl-Voit.at> <2015-05-25T12-45-36@devnull.Karl-Voit.at> Reply-To: Karl Voit NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1433344031 22621 80.91.229.3 (3 Jun 2015 15:07:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Jun 2015 15:07:11 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 03 17:06:56 2015 Return-path: Envelope-to: ged-emacs-devel@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 1Z0AFe-0000zC-5h for ged-emacs-devel@m.gmane.org; Wed, 03 Jun 2015 17:06:42 +0200 Original-Received: from localhost ([::1]:36086 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0AFd-0000uo-GX for ged-emacs-devel@m.gmane.org; Wed, 03 Jun 2015 11:06:41 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42474) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0AFG-0000lv-Ej for emacs-devel@gnu.org; Wed, 03 Jun 2015 11:06:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0AFA-0007ry-GI for emacs-devel@gnu.org; Wed, 03 Jun 2015 11:06:18 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:43335) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0AFA-0007qx-9O for emacs-devel@gnu.org; Wed, 03 Jun 2015 11:06:12 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Z0AEh-0000Gs-OT for emacs-devel@gnu.org; Wed, 03 Jun 2015 17:05:43 +0200 Original-Received: from friends.grml.info ([136.243.234.19]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 03 Jun 2015 17:05:43 +0200 Original-Received: from news1142 by friends.grml.info with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 03 Jun 2015 17:05:43 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 51 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: friends.grml.info X-GPG-Key: http://www.Karl-Voit.at/Karl_Voit_GnuPG_public_key.gpg X-Registered-Linux-User: 224337 X-Confession: Pastafarian http://www.venganza.org/ User-Agent: slrn/pre1.0.0-18 (Linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:186986 Archived-At: * Karl Voit wrote: > > ,---- >| (defun my-title-capitalization (beg end) >| (interactive "r") >| (save-excursion >| (let ( >| (do-not-capitalize '("a" "ago" "an" "and" "as" "at" "but" "by" "for" >| "from" "in" "into" "it" "next" "nor" "of" "off" >| "on" "onto" "or" "over" "past" "so" "the" "till" >| "to" "up" "yet" )) >| ) >| ;; go to begin of first word: >| (goto-char beg) >| (forward-word) >| (backward-word) >| ;; capitalize first word in any case: >| (capitalize-word 1) >| (forward-word) >| (backward-word) >| (while (< (point) end) >| ;; capitalize each word in between except it is list member: >| (if (member (thing-at-point 'word t) do-not-capitalize) >| (forward-word) >| (capitalize-word 1) ) >| (forward-word) >| (backward-word) ) >| ;; capitalize last word in any case: >| (backward-word) >| (capitalize-word 1) >| ) >| )) > `---- > With the version above and the version of others as well, I get errors on my Windows computer running GNU Emacs 24.3.1 (i386-mingw-nt6.1.7601): | let: Wrong number of arguments: #[(thing) "" [thing bounds thing-at-point bounds-of-thing-at-point] 3 | ("c:/Program Files/emacs-24.3/lisp/thingatpt.elc" . 2271)], 2 The weird text does not occur in the region at all. -- All in all, one of the most disturbing things today is the definitive fact that the NSA, GCHQ, and many more government organizations are massively terrorizing the freedom of us and the next generations. http://Karl-Voit.at