unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Emanuel Berg <embe8573@student.uu.se>
To: emacs-devel@gnu.org
Subject: Re: Proper English Title Capitalization
Date: Sun, 24 May 2015 23:00:44 +0200	[thread overview]
Message-ID: <87fv6lelmr.fsf@debian.uxu> (raw)
In-Reply-To: 2015-05-24T13-06-14@devnull.Karl-Voit.at

Karl Voit <devnull@Karl-Voit.at> 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




  reply	other threads:[~2015-05-24 21:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-24 11:10 Proper English Title Capitalization Karl Voit
2015-05-24 21:00 ` Emanuel Berg [this message]
2015-05-25 10:13   ` Karl Voit
2015-05-25 10:36     ` Rasmus
2015-05-25 10:47     ` Karl Voit
2015-05-25 12:22       ` Karl Voit
2015-05-25 16:18         ` Rasmus
2015-05-26 15:38       ` Barry Fishman
2015-06-11 20:10         ` Karl Voit
2015-06-03 15:05       ` Karl Voit
2015-05-25 16:59     ` Emanuel Berg
2015-06-17 13:48 ` Karl Voit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fv6lelmr.fsf@debian.uxu \
    --to=embe8573@student.uu.se \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).