[Top][All Lists]

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

Re: title-case function

From: Emanuel Berg
Subject: Re: title-case function
Date: Sun, 21 Apr 2019 07:29:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Paul W. Rankin wrote:

> Happy Easter to those who celebrate it!

The same to you :)
Here is some 2h 34m 56s of Easter trance [1] :)

> I couldn't find a title-case function

Did you look into this [2] ?
BTW make a search for "Emanuel Berg" :)

> [...] so I wrote the one below. Please take
> a look and let me know if there are any edge
> cases I've missed or improvements you
> might have.

       (if (looking-at "[:\x2013\x2014]")
           (capitalize-word 1)
         (skip-syntax-forward "-." last-word)
         (if (looking-at (concat "\\b" (regexp-opt title-case-minor-words)
                                 "\\b") )
             (downcase-word 1)
           (capitalize-word 1)))

It seems to work alright, but I don't
understand it? You don't need `progn' anymore?

(if nil
  (message "been here")
  1) ; 1 and got message




underground experts united

reply via email to

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