Hi Christoph,
Would you mind changing the definition of PERL in the Makefile to
PERL=perl -w. I get the feeling that it is _much_ more likely to work
if you trust the user PATH instead of guessing where it is installed.
Same with ksh. You seem to already trust that ln can be found.
Second, I think that the binary package should be a binary package,
i.e. no additional changes required. I really want the MANIFEST to
contain everything so I can remove (i.e. upgrade) the package
easily. The pcf font files should come bundled with the binary
release. I'm not sure if the bdf files should be in the binary
package, but if the .el files are then why not?
X-Symbol should be a flagship XEmacs/Mule package. It should work out
of the box. It might be better to have a separate font package
x-symbol-fonts-pkg.tar.gz to help save down-loading time during an
upgrade. There could be a package with a different font format for
Windows.
Third, I really think that XEmacs should handle the font path issues
itself without asking the user (or administrator) to set it up. If
this means adding X(Set|Get)FontPath primitives to XEmacs then so be
it. I'm not sure if this is reasonable. I.e. does a "nice X citizen"
mess with the font path? If it is a problem then we can check for the
string x-symbol in the path and not modify the path if it is found.
I'd really like to see this work in XEmacs 21. I'll add the code to
x-symbol to call these functions if this code is accepted.
I thought I would never need Mule since I thought I only spoke one
language, but I realize that math is my second language and X-Symbol
is it key to seeing it in Emacs.
Here is my first pass at implementing x-(set|get)-font-path. It also
my first attempt at coding elisp in C so I'm forwarding this to the
xemacs-beta list to get suggestions and any other comments.
Thanks,
-Jim
1998-12-15 Jim Radford <radford(a)robby.caltech.edu>
* device-x.c (Fx_set_font_path, Fx_get_font_path): New
functions so that packages that distribute their own
fonts can access them.
Index: device-x.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs-20/src/device-x.c,v
retrieving revision 1.33
diff -u -r1.33 device-x.c
--- device-x.c 1998/05/27 20:42:02 1.33
+++ device-x.c 1998/12/16 09:35:41
@@ -1647,6 +1647,71 @@
return Qnil;
}
+DEFUN ("x-get-font-path", Fx_get_font_path, 0, 1, 0, /*
+Get the X Server's font path.
+
+See also `x-set-font-path'.
+*/
+ (device))
+{
+ Display *dpy = get_x_display (device);
+ int ndirs_return;
+ CONST char **directories = XGetFontPath (dpy, &ndirs_return);
+ Lisp_Object font_path = Qnil;
+
+ if (!directories)
+ signal_simple_error ("Can't get X font path.", device);
+
+ while (ndirs_return--)
+ font_path = Fcons (build_string (directories[ndirs_return]), font_path);
+
+ return font_path;
+}
+
+DEFUN ("x-set-font-path", Fx_set_font_path, 1, 2, 0, /*
+(DEVICE FONT-PATH)
+
+Set the X Server's font path to FONT-PATH.
+
+There is only one font path per server, not one per client. Use this
+sparingly. It uncaches all of the X server's font information.
+
+Font directories should end in the path separator and should contain
+a file called fonts.dir usually created with the program mkfontdir.
+
+Setting the FONT-PATH to NIL tells the X server to use the default
+font path.
+
+See also `x-get-font-path'.
+*/
+ (font_path, device))
+{
+ Display *dpy = get_x_display (device);
+ Lisp_Object path_entry;
+ CONST char **directories;
+ int i=0,ndirs=0;
+
+ EXTERNAL_LIST_LOOP (path_entry, font_path)
+ {
+ if (!STRINGP (XCAR (path_entry)))
+ signal_simple_error ("Path component not a string", XCAR
(path_entry));
+ ndirs++;
+ }
+
+ directories = alloca (ndirs * sizeof(*directories));
+
+ EXTERNAL_LIST_LOOP (path_entry, font_path)
+ {
+ GET_C_STRING_CTEXT_DATA_ALLOCA (XCAR (path_entry), directories[i++]);
+ }
+
+ expect_x_error (dpy);
+ XSetFontPath (dpy, directories, ndirs);
+ signal_if_x_error (dpy, 1/*resumable_p*/);
+
+ return Qnil;
+}
+
/************************************************************************/
/* initialization */
@@ -1674,6 +1739,9 @@
DEFSUBR (Fx_ungrab_pointer);
DEFSUBR (Fx_grab_keyboard);
DEFSUBR (Fx_ungrab_keyboard);
+
+ DEFSUBR (Fx_get_font_path);
+ DEFSUBR (Fx_set_font_path);
defsymbol (&Qx_error, "x-error");
defsymbol (&Qinit_pre_x_win, "init-pre-x-win");
emacs
Show replies by date