APPROVE COMMIT
NOTE: This patch has been committed
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1510822386 0
# Thu Nov 16 08:53:06 2017 +0000
# Node ID 405c07ae230be01c54b036bab07d0c684f3f15d6
# Parent 1f4ff44e16576d064e9f7955ae59ce86428fd635
Update the list of directories searched by #'x-color-list-internal
lisp/ChangeLog addition:
2017-11-16 Aidan Kehoe <kehoea(a)parhasard.net>
* x-faces.el (x-library-search-path):
Update this variable to include share/ subdirectories of all the
potential prefixes, since rgb.txt is usually now in share/X11.
* x-faces.el (x-color-list-internal):
Use #'canoncase, not #'downcase when adding completion for the
lowercase form, avoiding problems with Turkish locales.
diff -r 1f4ff44e1657 -r 405c07ae230b lisp/ChangeLog
--- a/lisp/ChangeLog Wed Nov 15 23:05:39 2017 +0000
+++ b/lisp/ChangeLog Thu Nov 16 08:53:06 2017 +0000
@@ -1,3 +1,12 @@
+2017-11-16 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * x-faces.el (x-library-search-path):
+ Update this variable to include share/ subdirectories of all the
+ potential prefixes, since rgb.txt is usually now in share/X11.
+ * x-faces.el (x-color-list-internal):
+ Use #'canoncase, not #'downcase when adding completion for the
+ lowercase form, avoiding problems with Turkish locales.
+
2017-11-14 Aidan Kehoe <kehoea(a)parhasard.net>
* mule/cyrillic.el ("Cyrillic-ISO"):
diff -r 1f4ff44e1657 -r 405c07ae230b lisp/x-faces.el
--- a/lisp/x-faces.el Wed Nov 15 23:05:39 2017 +0000
+++ b/lisp/x-faces.el Thu Nov 16 08:53:06 2017 +0000
@@ -575,28 +575,36 @@
;; Ben wanted all of the possibilities from the `configure' script used
;; here, but I think this is way too many. I already trimmed the R4 variants
;; and a few obvious losers from the list. --Stig
-(defvar x-library-search-path '("/usr/X11R6/lib/X11/"
- "/usr/X11R5/lib/X11/"
- "/usr/lib/X11R6/X11/"
- "/usr/lib/X11R5/X11/"
- "/usr/local/X11R6/lib/X11/"
- "/usr/local/X11R5/lib/X11/"
- "/usr/local/lib/X11R6/X11/"
- "/usr/local/lib/X11R5/X11/"
- "/usr/X11/lib/X11/"
- "/usr/lib/X11/"
- "/usr/share/X11/"
- "/usr/local/lib/X11/"
- "/usr/local/share/X11/"
- "/usr/X386/lib/X11/"
- "/usr/x386/lib/X11/"
- "/usr/XFree86/lib/X11/"
- "/usr/unsupported/lib/X11/"
- "/usr/athena/lib/X11/"
- "/usr/local/x11r5/lib/X11/"
- "/usr/lpp/Xamples/lib/X11/"
- "/usr/openwin/lib/X11/"
- "/usr/openwin/share/lib/X11/")
+(defvar x-library-search-path
+ (mapcan #'(lambda (path)
+ (let (search)
+ (list* path (when (setq search (search "/lib/" path))
+ `(,(concat (subseq path 0 search)
+ ;; Newer X11 stores rgb.txt in
+ ;; share/, not lib/.
+ "/share/"
+ (subseq path
+ (+ search
+ (length "/lib/")))))))))
+ '("/usr/X11R6/lib/X11/"
+ "/usr/X11R5/lib/X11/"
+ "/usr/lib/X11R6/X11/"
+ "/usr/lib/X11R5/X11/"
+ "/usr/local/X11R6/lib/X11/"
+ "/usr/local/X11R5/lib/X11/"
+ "/usr/local/lib/X11R6/X11/"
+ "/usr/local/lib/X11R5/X11/"
+ "/usr/X11/lib/X11/"
+ "/usr/lib/X11/"
+ "/usr/local/lib/X11/"
+ "/usr/X386/lib/X11/"
+ "/usr/x386/lib/X11/"
+ "/usr/XFree86/lib/X11/"
+ "/usr/unsupported/lib/X11/"
+ "/usr/athena/lib/X11/"
+ "/usr/local/x11r5/lib/X11/"
+ "/usr/lpp/Xamples/lib/X11/"
+ "/usr/openwin/lib/X11/"))
"Search path used by `x-color-list-internal' to find rgb.txt.")
(defvar x-color-list-internal-cache)
@@ -608,6 +616,13 @@
;; strings as the TTY code does, and as expected by r-c-c-t.
;; -- sjt 2007-10-06
+;; Our completion no longer requires a list of lists, a list of strings is
+;; fine, and #'read-color just uses the output of #'color-list, which on X11
+;; becomes the value of the variable
+;; `x-color-list-internal-cache'. #'read-color-completion-table is still
+;; around for compatibility with facemenu.el in the packages, which needs that
+;; approach to be compatible with 21.4. Aidan Kehoe, 20171116.
+
;; This function is probably also used by the GTK platform. Cf.
;; gtk_color_list in src/fontcolor-gtk.c.
(defun x-color-list-internal ()
@@ -633,7 +648,7 @@
clist (cons color clist))
;; Ugh. If we want to be able to complete the lowercase form
;; of the color name, we need to add it twice! Yuck.
- (let ((dcase (downcase color)))
+ (let ((dcase (canoncase color)))
(or (string= dcase color)
(push dcase clist)))
(forward-char 1))
--
‘As I sat looking up at the Guinness ad, I could never figure out /
How your man stayed up on the surfboard after forty pints of stout’
(C. Moore)