From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.devel Subject: Re: Proper English Title Capitalization Date: Sun, 24 May 2015 23:00:44 +0200 Message-ID: <87fv6lelmr.fsf@debian.uxu> References: <2015-05-24T13-06-14@devnull.Karl-Voit.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1432500959 17012 80.91.229.3 (24 May 2015 20:55:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 24 May 2015 20:55:59 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 24 22:55:47 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 1Ywcvz-0007IC-6A for ged-emacs-devel@m.gmane.org; Sun, 24 May 2015 22:55:47 +0200 Original-Received: from localhost ([::1]:40847 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ywcvy-0001Hh-Ni for ged-emacs-devel@m.gmane.org; Sun, 24 May 2015 16:55:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40820) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ywcvg-0001Gi-J6 for emacs-devel@gnu.org; Sun, 24 May 2015 16:55:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ywcvc-0000ES-Tt for emacs-devel@gnu.org; Sun, 24 May 2015 16:55:28 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:51749) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ywcvc-0000EL-NZ for emacs-devel@gnu.org; Sun, 24 May 2015 16:55:24 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Ywcva-00079v-3A for emacs-devel@gnu.org; Sun, 24 May 2015 22:55:22 +0200 Original-Received: from nl106-137-66.student.uu.se ([130.243.137.66]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 24 May 2015 22:55:22 +0200 Original-Received: from embe8573 by nl106-137-66.student.uu.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 24 May 2015 22:55:22 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 41 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: nl106-137-66.student.uu.se Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) Cancel-Lock: sha1:Rp0x51gOUZtLtVCmdyZEGrsjAjg= 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:186785 Archived-At: Karl Voit writes: > I was looking for a method to capitalize > headings/titles according to [1]. I found > ~s-titleise-s~ which simply capitalizes every word. > However, I was looking for a method which turns > stopwords into lower case and non-stopwords into > capitalized words. > > Is there something out there? > > No, I don't know enough Elisp to code it by myself > and I have no idea if there is a set of English > stopwords stored in Emacs. Good idea, I can never memorize those goofy rules. It could be a cool thing to have for example in BibLaTeX. You don't have to know a lot of Elisp to do that. Here is a start. Only you'll have to insert the "stopwords" yourself. (setq do-not-capitalize '("ah" "oh" "eh")) (defun make-a-title (beg end) (interactive "r") (save-excursion (goto-char beg) (forward-word) (backward-word) (while (< (point) end) (if (member (thing-at-point 'word t) do-not-capitalize) (forward-word) (capitalize-word 1) ) (forward-word) (backward-word) ))) -- underground experts united http://user.it.uu.se/~embe8573