emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Proper English Title Capitalization


From: Karl Voit
Subject: Re: Proper English Title Capitalization
Date: Wed, 3 Jun 2015 17:05:07 +0200
User-agent: slrn/pre1.0.0-18 (Linux)

* Karl Voit <address@hidden> 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) "<some special characters
| which I can't post here since they are obviously binary or
| something>" [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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]