From: Paul Eggert <eggert@cs.ucla.edu>
To: 10069@debbugs.gnu.org
Subject: bug#10069: colour -> color spelling change
Date: Wed, 16 Nov 2011 23:39:00 -0800 [thread overview]
Message-ID: <4EC4BA14.2010906@cs.ucla.edu> (raw)
Tags: patch
Severity: minor
Emacs consistently uses the American spelling "color" instead
of the British "colour", except for one or two modules. Here's
a patch to fix this inconsistency. This introduces an API change
so it should wait until after 24.1 is out.
=== modified file 'lisp/ChangeLog'
--- lisp/ChangeLog 2011-11-16 21:32:46 +0000
+++ lisp/ChangeLog 2011-11-17 03:47:59 +0000
@@ -1,3 +1,15 @@
+2011-11-17 Paul Eggert <eggert@cs.ucla.edu>
+
+ Consistently use the spelling "color".
+ * hfy-cmap.el (hfy-fallback-color-map):
+ Rename from hfy-fallback-colour-map.
+ (hfy-rgb-txt-color-map): Rename from hfy-rgb-txt-colour-map.
+ (hfy-fallback-color-values): Rename from hfy-fallback-colour-values.
+ * htmlfontify.el (hfy-color-vals): Rename from hfy-colour-vals.
+ (hfy-color): Rename from hfy-colour.
+ (hfy-box-to-border-assoc, hfy-box-to-style):
+ Spell it "color", not "colour", in strings.
+
2011-11-16 Michael Albinus <michael.albinus@gmx.de>
* net/tramp.el (tramp-handle-file-truename): Cache only the local
=== modified file 'lisp/hfy-cmap.el'
--- lisp/hfy-cmap.el 2011-01-25 04:08:28 +0000
+++ lisp/hfy-cmap.el 2011-11-17 02:04:05 +0000
@@ -1,4 +1,4 @@
-;;; hfy-cmap.el --- Fallback colour name -> rgb mapping for `htmlfontify'
+;;; hfy-cmap.el --- Fallback color name -> rgb mapping for `htmlfontify'
;; Copyright (C) 2002-2003, 2009-2011 Free Software Foundation, Inc.
@@ -6,11 +6,11 @@
;; Package: htmlfontify
;; Filename: hfy-cmap.el
;; Version: 0.20
-;; Keywords: colour, rgb
+;; Keywords: color, colour, rgb
;; Author: Vivek Dasmohapatra <vivek@etla.org>
;; Maintainer: Vivek Dasmohapatra <vivek@etla.org>
;; Created: 2002-01-20
-;; Description: fallback code for colour name -> rgb mapping
+;; Description: fallback code for color name -> rgb mapping
;; URL: http://rtfm.etla.org/emacs/htmlfontify/
;; Last-Updated: Sat 2003-02-15 03:49:32 +0000
;; Package: htmlfontify
@@ -34,7 +34,7 @@
;;; Code:
-(defconst hfy-fallback-colour-map
+(defconst hfy-fallback-color-map
'(("snow" 65535 64250 64250)
("ghost white" 63736 63736 65535)
("GhostWhite" 63736 63736 65535)
@@ -788,7 +788,7 @@
("light green" 37008 61166 37008)
("LightGreen" 37008 61166 37008)) )
-(defvar hfy-rgb-txt-colour-map nil)
+(defvar hfy-rgb-txt-color-map nil)
(defvar hfy-rgb-load-path
(list "/etc/X11"
@@ -808,8 +808,8 @@
(defun htmlfontify-load-rgb-file (&optional file)
"Load an X11 style rgb.txt FILE.
Search `hfy-rgb-load-path' if FILE is not specified.
-Loads the variable `hfy-rgb-txt-colour-map', which is used by
-`hfy-fallback-colour-values'."
+Loads the variable `hfy-rgb-txt-color-map', which is used by
+`hfy-fallback-color-values'."
(interactive
(list
(read-file-name "rgb.txt \(equivalent\) file: " "" nil t (hfy-rgb-file))))
@@ -824,25 +824,25 @@
(htmlfontify-unload-rgb-file)
(while (/= end-of-rgb 1)
(if (looking-at hfy-rgb-regex)
- (setq hfy-rgb-txt-colour-map
+ (setq hfy-rgb-txt-color-map
(cons (list (match-string 4)
(string-to-number (match-string 1))
(string-to-number (match-string 2))
(string-to-number (match-string 3)))
- hfy-rgb-txt-colour-map)) )
+ hfy-rgb-txt-color-map)) )
(setq end-of-rgb (forward-line)))
(kill-buffer rgb-buffer)))))
(defun htmlfontify-unload-rgb-file ()
"Unload the current color name -> rgb translation map."
(interactive)
- (setq hfy-rgb-txt-colour-map nil))
+ (setq hfy-rgb-txt-color-map nil))
;;;###autoload
-(defun hfy-fallback-colour-values (colour-string)
+(defun hfy-fallback-color-values (color-string)
"Use a fallback method for obtaining the rgb values for a color."
- (cdr (assoc-string colour-string (or hfy-rgb-txt-colour-map
- hfy-fallback-colour-map))) )
+ (cdr (assoc-string color-string (or hfy-rgb-txt-color-map
+ hfy-fallback-color-map))) )
(provide 'hfy-cmap)
=== modified file 'lisp/htmlfontify.el'
--- lisp/htmlfontify.el 2011-11-15 17:37:37 +0000
+++ lisp/htmlfontify.el 2011-11-17 02:06:14 +0000
@@ -566,22 +566,22 @@
(if (memq elt set-b) (setq interq (cons elt interq))))
interq))
-(defun hfy-colour-vals (colour)
- "Where COLOUR is a color name or #XXXXXX style triplet, return a
+(defun hfy-color-vals (color)
+ "Where COLOR is a color name or #XXXXXX style triplet, return a
list of three (16 bit) rgb values for said color.\n
-If a window system is unavailable, calls `hfy-fallback-colour-values'."
- (if (string-match hfy-triplet-regex colour)
+If a window system is unavailable, calls `hfy-fallback-color-values'."
+ (if (string-match hfy-triplet-regex color)
(mapcar
- (lambda (x) (* (string-to-number (match-string x colour) 16) 257))
+ (lambda (x) (* (string-to-number (match-string x color) 16) 257))
'(1 2 3))
- ;;(message ">> %s" colour)
+ ;;(message ">> %s" color)
(if window-system
(if (fboundp 'color-values)
- (color-values colour)
+ (color-values color)
;;(message "[%S]" window-system)
- (x-color-values colour))
- ;; blarg - tty colours are no good - go fetch some X colours:
- (hfy-fallback-colour-values colour))))
+ (x-color-values color))
+ ;; blarg - tty colors are no good - go fetch some X colors:
+ (hfy-fallback-color-values color))))
(defvar hfy-cperl-mode-kludged-p nil)
@@ -719,7 +719,7 @@
"Replace the end of a CSS style declaration STYLE-STRING with the contents
of the variable `hfy-src-doc-link-style', removing text matching the regex
`hfy-src-doc-link-unstyle' first, if necessary."
- ;;(message "hfy-colour-vals");;DBUG
+ ;;(message "hfy-color-vals");;DBUG
(if (string-match hfy-src-doc-link-unstyle style-string)
(setq style-string (replace-match "" 'fixed-case 'literal style-string)))
(if (and (not (string-match hfy-src-doc-link-style style-string))
@@ -732,15 +732,15 @@
;; utility functions - cast emacs style specification values into their
;; css2 equivalents:
-(defun hfy-triplet (colour)
- "Takes a COLOUR name (string) and return a CSS rgb(R, G, B) triplet string.
+(defun hfy-triplet (color)
+ "Takes a COLOR name (string) and return a CSS rgb(R, G, B) triplet string.
Uses the definition of \"white\" to map the numbers to the 0-255 range, so
if you've redefined white, (esp. if you've redefined it to have a triplet
member lower than that of the color you are processing) strange things
may happen."
- ;;(message "hfy-colour-vals");;DBUG
- (let ((white (mapcar (lambda (I) (float (1+ I))) (hfy-colour-vals "white")))
- (rgb16 (mapcar (lambda (I) (float (1+ I))) (hfy-colour-vals colour))))
+ ;;(message "hfy-color-vals");;DBUG
+ (let ((white (mapcar (lambda (I) (float (1+ I))) (hfy-color-vals "white")))
+ (rgb16 (mapcar (lambda (I) (float (1+ I))) (hfy-color-vals color))))
(if rgb16
;;(apply 'format "rgb(%d, %d, %d)"
;; Use #rrggbb instead, it is smaller
@@ -751,8 +751,8 @@
'(0 1 2))))))
(defun hfy-family (family) (list (cons "font-family" family)))
-(defun hfy-bgcol (colour) (list (cons "background" (hfy-triplet colour))))
-(defun hfy-colour (colour) (list (cons "color" (hfy-triplet colour))))
+(defun hfy-bgcol (color) (list (cons "background" (hfy-triplet color))))
+(defun hfy-color (color) (list (cons "color" (hfy-triplet color))))
(defun hfy-width (width) (list (cons "font-stretch" (symbol-name width))))
(defcustom hfy-font-zoom 1.05
@@ -800,17 +800,17 @@
(let ((tag (car spec))
(val (cadr spec)))
(cons (case tag
- (:color (cons "colour" val))
- (:width (cons "width" val))
- (:style (cons "style" val)))
+ (:color (cons "color" val))
+ (:width (cons "width" val))
+ (:style (cons "style" val)))
(hfy-box-to-border-assoc (cddr spec))))))
(defun hfy-box-to-style (spec)
(let* ((css (hfy-box-to-border-assoc spec))
- (col (cdr (assoc "colour" css)))
+ (col (cdr (assoc "color" css)))
(s (cdr (assoc "style" css))))
(list
- (if col (cons "border-color" (cdr (assoc "colour" css))))
+ (if col (cons "border-color" (cdr (assoc "color" css))))
(cons "border-width" (format "%dpx" (or (cdr (assoc "width" css)) 1)))
(cons "border-style" (case s
(released-button "outset")
@@ -989,7 +989,7 @@
(:width (hfy-width val))
(:weight (hfy-weight val))
(:slant (hfy-slant val))
- (:foreground (hfy-colour val))
+ (:foreground (hfy-color val))
(:background (hfy-bgcol val))
(:box (hfy-box val))
(:height (hfy-size val))
@@ -2314,22 +2314,22 @@
(load file 'NOERROR nil nil) ))
\f
-;;;### (autoloads (hfy-fallback-colour-values htmlfontify-load-rgb-file)
-;;;;;; "hfy-cmap" "hfy-cmap.el" "8dce008297f15826cc6ab82203c46fa6")
+;;;### (autoloads (hfy-fallback-color-values htmlfontify-load-rgb-file)
+;;;;;; "hfy-cmap" "hfy-cmap.el" "2e7bc2fe079a42e70fb284e070d001f1")
;;; Generated autoloads from hfy-cmap.el
(autoload 'htmlfontify-load-rgb-file "hfy-cmap" "\
Load an X11 style rgb.txt FILE.
Search `hfy-rgb-load-path' if FILE is not specified.
-Loads the variable `hfy-rgb-txt-colour-map', which is used by
-`hfy-fallback-colour-values'.
+Loads the variable `hfy-rgb-txt-color-map', which is used by
+`hfy-fallback-color-values'.
\(fn &optional FILE)" t nil)
-(autoload 'hfy-fallback-colour-values "hfy-cmap" "\
+(autoload 'hfy-fallback-color-values "hfy-cmap" "\
Use a fallback method for obtaining the rgb values for a color.
-\(fn COLOUR-STRING)" nil nil)
+\(fn COLOR-STRING)" nil nil)
;;;***
\f
next reply other threads:[~2011-11-17 7:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-17 7:39 Paul Eggert [this message]
2011-11-17 7:48 ` bug#10069: colour -> color spelling change Glenn Morris
2011-11-17 14:35 ` Drew Adams
2011-11-19 23:28 ` Juri Linkov
2011-12-31 9:25 ` Paul Eggert
2016-02-25 6:33 ` Lars Ingebrigtsen
2018-03-05 1:42 ` Paul Eggert
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4EC4BA14.2010906@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=10069@debbugs.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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.