[PATCH] Support Carbon-specific package paths.
16 years, 7 months
Aidan Kehoe
Didier, you’ve mentioned wanting this a couple of times. The main thing I’m
not sure about with this patch is whether it’s worth separating out the path
into a variable on its own; probably not.
Michael, is this a kosher approach to take? It *works* fine for me.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1210510621 -7200
# Node ID 8554671821720be9c0a2a73b0e8b269a17039c87
# Parent 781e065f28a76678ca3109b917ababef5150bd17
Support ~/Library/Application Support/XEmacs/XEmacs Packages under Carbon.
2008-05-11 Aidan Kehoe <kehoea(a)parhasard.net>
* setup-paths.el (paths-emacs-data-root-p):
Also look for an xemacs-packages subdirectory under Carbon, don't
limit this to Win32.
(paths-find-emacs-roots):
Check for possible package directories under ~/Library and
/Library.
diff -r 781e065f28a7 -r 855467182172 lisp/ChangeLog
--- a/lisp/ChangeLog Sun May 11 14:29:05 2008 +0200
+++ b/lisp/ChangeLog Sun May 11 14:57:01 2008 +0200
@@ -1,3 +1,12 @@ 2008-01-20 Aidan Kehoe <kehoea@parhasa
+2008-05-11 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * setup-paths.el (paths-emacs-data-root-p):
+ Also look for an xemacs-packages subdirectory under Carbon, don't
+ limit this to Win32.
+ (paths-find-emacs-roots):
+ Check for possible package directories under ~/Library and
+ /Library.
+
2008-01-20 Aidan Kehoe <kehoea(a)parhasard.net>
* startup.el (command-line-do-script): New.
diff -r 781e065f28a7 -r 855467182172 lisp/setup-paths.el
--- a/lisp/setup-paths.el Sun May 11 14:29:05 2008 +0200
+++ b/lisp/setup-paths.el Sun May 11 14:57:01 2008 +0200
@@ -109,7 +109,7 @@ installation roots."
;; searching for a package directory
(and
- (string-match "win32" system-configuration)
+ (or (string-match "win32" system-configuration) (featurep 'carbon))
(paths-file-readable-directory-p (paths-construct-path (list directory
"xemacs-packages"))))))
@@ -145,13 +145,19 @@ ROOT-P is a function that tests whether
invocation-name
root-p))
(potential-installation-roots
- (paths-uniq-append
- (and configure-exec-prefix-directory
- (list (file-name-as-directory
- configure-exec-prefix-directory)))
- (and configure-prefix-directory
- (list (file-name-as-directory
- configure-prefix-directory)))))
+ (nconc
+ (paths-uniq-append
+ (and configure-exec-prefix-directory
+ (list (file-name-as-directory
+ configure-exec-prefix-directory)))
+ (and configure-prefix-directory
+ (list (file-name-as-directory
+ configure-prefix-directory))))
+ (and
+ (featurep 'carbon)
+ (list (expand-file-name
+ "~/Library/Application Support/XEmacs/XEmacs Packages/")
+ "/Library/Application Support/XEmacs/XEmacs Packages/"))))
(installation-roots
(paths-filter root-p potential-installation-roots)))
(paths-uniq-append invocation-roots
--
¿Dónde estará ahora mi sobrino Yoghurtu Nghé, que tuvo que huir
precipitadamente de la aldea por culpa de la escasez de rinocerontes?
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
carbon2-commit: Regenerate configure.
16 years, 7 months
Aidan Kehoe
changeset: 4476:781e065f28a76678ca3109b917ababef5150bd17
tag: tip
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Sun May 11 14:29:05 2008 +0200
files: ChangeLog.carbon2 configure
description:
Regenerate configure.
I need to do this to build; this seems to be a merge artefact.
diff -r 11515817d9ca86ee8caafb52872c0a0e7cd0705a -r 781e065f28a76678ca3109b917ababef5150bd17 ChangeLog.carbon2
--- a/ChangeLog.carbon2 Sun May 11 10:33:18 2008 +0200
+++ b/ChangeLog.carbon2 Sun May 11 14:29:05 2008 +0200
@@ -1,4 +1,6 @@ 2008-05-11 Aidan Kehoe <kehoea@parhasa
2008-05-11 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * configure: Regenerate.
* Makefile.in.in: Clean up a conditional after an automated merge
had a non-easily-resolved conflict.
diff -r 11515817d9ca86ee8caafb52872c0a0e7cd0705a -r 781e065f28a76678ca3109b917ababef5150bd17 configure
--- a/configure Sun May 11 10:33:18 2008 +0200
+++ b/configure Sun May 11 14:29:05 2008 +0200
@@ -40579,7 +40579,6 @@ OBJECT_TO_BUILD!$OBJECT_TO_BUILD$ac_deli
OBJECT_TO_BUILD!$OBJECT_TO_BUILD$ac_delim
ldap_libs!$ldap_libs$ac_delim
postgresql_libs!$postgresql_libs$ac_delim
-lwlib_objs!$lwlib_objs$ac_delim
_ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -40621,6 +40620,7 @@ ac_delim='%!_!# '
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
cat >conf$$subs.sed <<_ACEOF
+lwlib_objs!$lwlib_objs$ac_delim
canna_libs!$canna_libs$ac_delim
ALLOCA!$ALLOCA$ac_delim
have_esd_config!$have_esd_config$ac_delim
@@ -40698,7 +40698,7 @@ LTLIBOBJS!$LTLIBOBJS$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 75; then
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 76; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[PATCH] Use char-tables, not vectors, to instantiate the display table specifiers
16 years, 7 months
Aidan Kehoe
This change has the advantage that we can do helpful stuff with Unicode
error octets, like displaying them as, say, the corresponding Latin 1 or
koi8-r character (depending on language environment) in red. More generally,
without this patch, display tables couldn’t handle anything non-Latin-1,
which made them of limited usefulness.
5 files changed, 291 insertions(+), 228 deletions(-)
lisp/ChangeLog | 43 +++++++
lisp/disp-table.el | 203 +++++++++++++++++++++---------------
lisp/font.el | 6 -
lisp/mule/cyril-util.el | 259 ++++++++++++++++++++++-------------------------
lisp/x-init.el | 8 -
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1198524128 -3600
# Node ID e214ff9f9507794f61ad09d81e5f9272447c87d2
# Parent cc293ef846d240af187a523bb32eb5e26a083531
Use char-tables, not vectors, to instantiate the display table specifiers.
2007-07-21 Aidan Kehoe <kehoea(a)parhasard.net>
* mule/cyril-util.el:
* mule/cyril-util.el (cyrillic-encode-koi8-r-char): Removed.
* mule/cyril-util.el (cyrillic-encode-alternativnyj-char):
Removed. No-one uses these functions in google.com/codesearch,
GNU have a comment doubting their utility, and their
implementation is trivial.
* mule/cyril-util.el (cyrillic-language-alist):
Reformatted.
* mule/cyril-util.el (standard-display-table)): Removed. It wasn't
used anyway.
* mule/cyril-util.el (standard-display-cyrillic-translit):
Rewrite it to work with character tables as display tables, and
not to abort with an error.
2007-07-21 Aidan Kehoe <kehoea(a)parhasard.net>
* disp-table.el:
* disp-table.el (make-display-table): Moved earlier in the file in
a weak attempt at making syncing with GNU easier.
* disp-table.el (frob-display-table):
Autoload it, accept TAG-SET, for editing specifiers.
* disp-table.el (describe-display-table):
Have it handle character sets.
* disp-table.el (standard-display-8bit-1):
* disp-table.el (standard-display-8bit):
* disp-table.el (standard-display-default-1):
* disp-table.el (standard-display-ascii):
* disp-table.el (standard-display-g1):
* disp-table.el (standard-display-graphic):
* disp-table.el (standard-display-underline):
* disp-table.el (standard-display-european):
Rework them all to use put-char-table, remove-char-table instead
of aset. Limit standard-display-g1, standard-display-graphic to
TTYs; have standard-display-underline work on X11 too.
* font.el (font-caps-display-table):
Use put-char-table instead of aset when editing a display table.
* x-init.el:
* x-init.el (tab):
Create the initial display table as a char-table, not a vector.
diff -r cc293ef846d2 -r e214ff9f9507 lisp/ChangeLog
--- a/lisp/ChangeLog Mon Dec 24 14:00:51 2007 +0100
+++ b/lisp/ChangeLog Mon Dec 24 20:22:08 2007 +0100
@@ -1,3 +1,46 @@ 2007-12-22 Stephen J. Turnbull <stephe
+2007-07-21 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * mule/cyril-util.el:
+ * mule/cyril-util.el (cyrillic-encode-koi8-r-char): Removed.
+ * mule/cyril-util.el (cyrillic-encode-alternativnyj-char):
+ Removed. No-one uses these functions in google.com/codesearch,
+ GNU have a comment doubting their utility, and their
+ implementation is trivial.
+ * mule/cyril-util.el (cyrillic-language-alist):
+ Reformatted.
+ * mule/cyril-util.el (standard-display-table)): Removed. It wasn't
+ used anyway.
+ * mule/cyril-util.el (standard-display-cyrillic-translit):
+ Rewrite it to work with character tables as display tables, and
+ not to abort with an error.
+
+2007-07-21 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * disp-table.el:
+ * disp-table.el (make-display-table): Moved earlier in the file in
+ a weak attempt at making syncing with GNU easier.
+ * disp-table.el (frob-display-table):
+ Autoload it, accept TAG-SET, for editing specifiers.
+ * disp-table.el (describe-display-table):
+ Have it handle character sets.
+ * disp-table.el (standard-display-8bit-1):
+ * disp-table.el (standard-display-8bit):
+ * disp-table.el (standard-display-default-1):
+ * disp-table.el (standard-display-ascii):
+ * disp-table.el (standard-display-g1):
+ * disp-table.el (standard-display-graphic):
+ * disp-table.el (standard-display-underline):
+ * disp-table.el (standard-display-european):
+ Rework them all to use put-char-table, remove-char-table instead
+ of aset. Limit standard-display-g1, standard-display-graphic to
+ TTYs; have standard-display-underline work on X11 too.
+
+ * font.el (font-caps-display-table):
+ Use put-char-table instead of aset when editing a display table.
+ * x-init.el:
+ * x-init.el (tab):
+ Create the initial display table as a char-table, not a vector.
+
2007-12-22 Stephen J. Turnbull <stephen(a)xemacs.org>
Factor out lists of operators specially treated by `make-autoload'.
diff -r cc293ef846d2 -r e214ff9f9507 lisp/disp-table.el
--- a/lisp/disp-table.el Mon Dec 24 14:00:51 2007 +0100
+++ b/lisp/disp-table.el Mon Dec 24 20:22:08 2007 +0100
@@ -1,6 +1,6 @@
;;; disp-table.el --- functions for dealing with char tables.
-;; Copyright (C) 1987, 1994, 1997 Free Software Foundation, Inc.
+;; Copyright (C) 1987, 1994, 1997, 2007 Free Software Foundation, Inc.
;; Copyright (C) 1995 Sun Microsystems.
;; Author: Howard Gayle
@@ -28,56 +28,82 @@
;;; Commentary:
-;; #### Need lots of work. make-display-table depends on a value
-;; that is a define in the C code. Maybe we should just move the
-;; function into C.
-
-;; #### display-tables-as-vectors is really evil and a big pain in
-;; the ass.
-
;; Rewritten for XEmacs July 1995, Ben Wing.
;;; Code:
+;;;###autoload
+(defun make-display-table ()
+ "Return a new, empty display table.
+
+This returns a generic character table; previously it returned a vector, but
+that was not helpful when dealing with internationalized characters above
+#xFF. See `make-char-table' for details of character tables in general. To
+write code that works with both vectors and character tables, add something
+like the following to the beginning of your file, and use
+`put-display-table' to set what a given character is displayed as, and
+`get-display-table' to examine what that character is currently displayed
+as:
+
+\(defun-when-void put-display-table (range value display-table)
+ \"Set the value for char RANGE to VALUE in DISPLAY-TABLE. \"
+ (ecase (type-of display-table)
+ (vector
+ (aset display-table range value))
+ (char-table
+ (put-char-table range value display-table))))
+
+\(defun-when-void get-display-table (character display-table)
+ \"Find value for CHARACTER in DISPLAY-TABLE. \"
+ (ecase (type-of display-table)
+ (vector
+ (aref display-table character))
+ (char-table
+ (get-char-table character display-table))))
+
+In this implementation, `put-display-table' and `get-display-table' are
+aliases of `put-char-table' and `get-char-table' respectively, and are
+always available. "
+ (make-char-table 'generic))
+
+;;;###autoload
+(defalias 'put-display-table #'put-char-table)
+
+;;;###autoload
+(defalias 'get-display-table #'get-char-table)
+
(defun describe-display-table (dt)
"Describe the display table DT in a help buffer."
(with-displaying-help-buffer
(lambda ()
- (princ "\nCharacter display glyph sequences:\n")
- (save-excursion
- (let ((vector (make-vector 256 nil))
- (i 0))
- (while (< i 256)
- (aset vector i (aref dt i))
- (incf i))
- ;; FSF calls `describe-vector' here, but it is so incredibly
- ;; lame a function for that name that I cannot bring myself
- ;; to porting it. Here is what `describe-vector' does:
- (terpri)
- (let ((old (aref vector 0))
- (oldpos 0)
- (i 1)
- str)
- (while (<= i 256)
- (when (or (= i 256)
- (not (equal old (aref vector i))))
- (if (eq oldpos (1- i))
- (princ (format "%s\t\t%s\n"
- (single-key-description (int-char oldpos))
- old))
- (setq str (format "%s - %s"
- (single-key-description (int-char oldpos))
- (single-key-description (int-char (1- i)))))
- (princ str)
- (princ (make-string (max (- 2 (/ (length str)
- tab-width)) 1) ?\t))
- (princ old)
- (terpri))
- (or (= i 256)
- (setq old (aref vector i)
- oldpos i)))
- (incf i))))))))
+ (map-char-table
+ (lambda (range value)
+ (cond
+ ((eq range t)
+ (princ "\nAll characters: \n")
+ (princ (format " %S" value)))
+ ((eq 'charset (and (symbolp range) (type-of (find-charset range))))
+ (princ (format "\n\nCharset %S: \n" (charset-name range)))
+ (princ (format " %S" value)))
+ ((vectorp range)
+ (princ (format "\n\nCharset %S, row %d \n"
+ (charset-name (aref value 0))
+ (aref value 1)))
+ (princ (format " %S\n\n" value)))
+ ((characterp range)
+ (princ (format "\nCharacter U+%04X, %S: "
+ range (if (fboundp 'split-char)
+ (split-char range)
+ (list 'ascii (char-to-int range)))))
+ (princ (format " %S" value))))
+ nil) dt)
+ (princ
+ "\n\nFor some of the various other glyphs that GNU Emacs uses the display
+table for, see the XEmacs specifiers `truncation-glyph' ,
+`continuation-glyph', `control-arrow-glyph', `octal-escape-glyph' and the
+others described in the docstring of `make-glyph'. \n\n"))))
+
;;;###autoload
(defun describe-current-display-table (&optional domain)
@@ -89,21 +115,17 @@
(describe-display-table disptab)
(message "No display table"))))
-;;;###autoload
-(defun make-display-table ()
- "Return a new, empty display table."
- (make-vector 256 nil))
-
;; #### we need a generic frob-specifier function.
;; #### this also needs to be redone like frob-face-property.
;; Let me say one more time how much dynamic scoping sucks.
-(defun frob-display-table (fdt-function fdt-locale)
+;;;###autoload
+(defun frob-display-table (fdt-function fdt-locale &optional tag-set)
(or fdt-locale (setq fdt-locale 'global))
- (or (specifier-spec-list current-display-table fdt-locale)
+ (or (specifier-spec-list current-display-table fdt-locale tag-set)
(add-spec-to-specifier current-display-table (make-display-table)
- fdt-locale))
+ fdt-locale tag-set))
(add-spec-list-to-specifier
current-display-table
(list (cons fdt-locale
@@ -112,29 +134,44 @@
(funcall fdt-function (cdr fdt-x))
fdt-x)
(cdar (specifier-spec-list current-display-table
- fdt-locale)))))))
+ fdt-locale tag-set)))))))
(defun standard-display-8bit-1 (dt l h)
(while (<= l h)
- (aset dt l (char-to-string l))
+ (remove-char-table (int-to-char l) dt)
(setq l (1+ l))))
;;;###autoload
(defun standard-display-8bit (l h &optional locale)
- "Display characters in the range L to H literally."
+ "Display characters in the range L to H literally [sic].
+
+GNU Emacs includes this function. There, `literally' has no good meaning.
+Under XEmacs, this function makes characters with numeric values in the
+range L to H display as themselves; that is, as ASCII, latin-iso8859-1,
+latin-iso8859-2 or whatever. See `standard-display-default' for the inverse
+function. "
(frob-display-table
(lambda (x)
(standard-display-8bit-1 x l h))
locale))
(defun standard-display-default-1 (dt l h)
+ "Misnamed function under XEmacs. See `standard-display-default'."
(while (<= l h)
- (aset dt l nil)
+ (put-char-table (int-to-char l) (format "\\%o" l) dt)
(setq l (1+ l))))
;;;###autoload
(defun standard-display-default (l h &optional locale)
- "Display characters in the range L to H using the default notation."
+ "Display characters in the range L to H using octal escape notation.
+
+In the XEmacs context this function is misnamed. Under GNU Emacs,
+characters in the range #xA0 to #xFF display as octal escapes unless
+`standard-display-european' has been called; this function neutralizes the
+effects of `standard-display-european'. Under XEmacs, those characters
+normally do not display as octal escapes (this ignores hackery like
+specifying the X11 font character set on non-Mule builds) and this function
+sets them to display as octal escapes. "
(frob-display-table
(lambda (x)
(standard-display-default-1 x l h))
@@ -145,11 +182,8 @@
"Display character C using printable string S."
(frob-display-table
(lambda (x)
- (aset x c s))
+ (put-char-table c s x))
locale))
-
-
-;;; #### should frob in a 'tty locale.
;;;###autoload
(defun standard-display-g1 (c sc &optional locale)
@@ -158,11 +192,8 @@ it is meaningless for an X frame."
it is meaningless for an X frame."
(frob-display-table
(lambda (x)
- (aset x c (concat "\016" (char-to-string sc) "\017")))
- locale))
-
-
-;;; #### should frob in a 'tty locale.
+ (put-char-table c (concat "\016" (char-to-string sc) "\017") x))
+ locale '(tty)))
;;;###autoload
(defun standard-display-graphic (c gc &optional locale)
@@ -171,37 +202,41 @@ X frame."
X frame."
(frob-display-table
(lambda (x)
- (aset x c (concat "\e(0" (char-to-string gc) "\e(B")))
- locale))
-
-;;; #### should frob in a 'tty locale.
-;;; #### the FSF equivalent of this makes this character be displayed
-;;; in the 'underline face. There's no current way to do this with
-;;; XEmacs display tables.
+ (put-char-table c (concat "\e(0" (char-to-string gc) "\e(B") x))
+ locale '(tty)))
;;;###autoload
(defun standard-display-underline (c uc &optional locale)
"Display character C as character UC plus underlining."
(frob-display-table
(lambda (x)
- (aset x c (concat "\e[4m" (char-to-string uc) "\e[m")))
+ (let (glyph)
+ (setq glyph (make-glyph (vector 'string :data (char-to-string uc))))
+ (set-glyph-face glyph 'underline)
+ (put-char-table c glyph x)))
locale))
;;;###autoload
(defun standard-display-european (arg &optional locale)
- "Toggle display of European characters encoded with ISO 8859.
-When enabled, characters in the range of 160 to 255 display not
-as octal escapes, but as accented characters.
-With prefix argument, enable European character display iff arg is positive."
+ "Toggle display of European characters encoded with ISO 8859-1.
+When enabled (the default), characters in the range of 160 to 255 display
+as accented characters. With negative prefix argument, display characters in
+that range as octal escapes.
+
+If you want to work in a Western European language under XEmacs, it
+shouldn't be necessary to call this function--things should just work. But
+it's in a sufficient number of init files that we're not in a hurry to
+remove it. "
(interactive "P")
- (frob-display-table
- (lambda (x)
- (if (or (<= (prefix-numeric-value arg) 0)
- (and (null arg)
- (equal (aref x 160) (char-to-string 160))))
- (standard-display-default-1 x 160 255)
- (standard-display-8bit-1 x 160 255)))
- locale))
+ (if (<= (prefix-numeric-value arg) 0)
+ (frob-display-table
+ (lambda (x)
+ (standard-display-default-1 x 160 255))
+ locale)
+ (frob-display-table
+ (lambda (x)
+ (standard-display-8bit-1 x 160 255))
+ locale)))
(provide 'disp-table)
diff -r cc293ef846d2 -r e214ff9f9507 lisp/font.el
--- a/lisp/font.el Mon Dec 24 14:00:51 2007 +0100
+++ b/lisp/font.el Mon Dec 24 20:22:08 2007 +0100
@@ -254,17 +254,17 @@ for use in the 'weight' field of an X fo
(i 0))
;; Standard ASCII characters
(while (< i 26)
- (aset table (+ i ?a) (+ i ?A))
+ (put-display-table (+ i ?a) (+ i ?A) table)
(setq i (1+ i)))
;; Now ISO translations
;; #### FIXME what's this for??
(setq i 224)
(while (< i 247) ;; Agrave - Ouml
- (aset table i (- i 32))
+ (put-display-table i (- i 32) table)
(setq i (1+ i)))
(setq i 248)
(while (< i 255) ;; Oslash - Thorn
- (aset table i (- i 32))
+ (put-display-table i (- i 32) table)
(setq i (1+ i)))
table))
diff -r cc293ef846d2 -r e214ff9f9507 lisp/mule/cyril-util.el
--- a/lisp/mule/cyril-util.el Mon Dec 24 14:00:51 2007 +0100
+++ b/lisp/mule/cyril-util.el Mon Dec 24 20:22:08 2007 +0100
@@ -26,17 +26,11 @@
;;; Commentary:
+;;; #### Remove this, use the one in packages instead, but with the below
+;;; standard-display-cyrillic-translit. This file is unfortunately shadowed
+;;; if you have the Mule packages installed!
+
;;; Code:
-
-;;;###autoload
-(defun cyrillic-encode-koi8-r-char (char)
- "Return KOI8-R external character code of CHAR if appropriate."
- (get-char-table char cyrillic-koi8-r-to-external-code-table))
-
-;;;###autoload
-(defun cyrillic-encode-alternativnyj-char (char)
- "Return ALTERNATIVNYJ external character code of CHAR if appropriate."
- (get-char-table char cyrillic-alternativnyj-to-external-code-table))
;; Display
@@ -44,11 +38,9 @@
;; Written by Valery Alexeev <valery(a)math.uga.edu>.
(defvar cyrillic-language-alist
- (list '("Belorussian") '("Bulgarian") '("Macedonian")
- '("Russian") '("Serbian") '("Ukrainian"))
- "*List of known cyrillic languages")
-
-(defvar standard-display-table)
+ '(("Belorussian") ("Bulgarian") ("Macedonian") ("Russian") ("Serbian")
+ ("Ukrainian"))
+ "*List of known Cyrillic languages")
;;;###autoload
(defun standard-display-cyrillic-translit (&optional cyrillic-language)
@@ -67,129 +59,122 @@ If the argument is nil, we return the di
(completing-read
"Cyrillic language (default nil): "
cyrillic-language-alist nil t nil nil nil))))
+ (when (equal cyrillic-language "")
+ (setq cyrillic-language nil))
+ (frob-display-table
+ (lambda (display-table)
+ (if (null cyrillic-language)
+ (if (char-table-p display-table)
+ (remove-char-table 'cyrillic-iso8859-5 display-table))
+ (put-display-table ?а "a" display-table)
+ (put-display-table ?б "b" display-table)
+ (put-display-table ?в "v" display-table)
+ (put-display-table ?г "g" display-table)
+ (put-display-table ?д "d" display-table)
+ (put-display-table ?е "e" display-table)
+ (put-display-table ?ё "yo" display-table)
+ (put-display-table ?ж "zh" display-table)
+ (put-display-table ?з "z" display-table)
+ (put-display-table ?и "i" display-table)
+ (put-display-table ?й "j" display-table)
+ (put-display-table ?к "k" display-table)
+ (put-display-table ?л "l" display-table)
+ (put-display-table ?м "m" display-table)
+ (put-display-table ?н "n" display-table)
+ (put-display-table ?о "o" display-table)
+ (put-display-table ?п "p" display-table)
+ (put-display-table ?р "r" display-table)
+ (put-display-table ?с "s" display-table)
+ (put-display-table ?т "t" display-table)
+ (put-display-table ?у "u" display-table)
+ (put-display-table ?ф "f" display-table)
+ (put-display-table ?х "kh" display-table)
+ (put-display-table ?ц "ts" display-table)
+ (put-display-table ?ч "ch" display-table)
+ (put-display-table ?ш "sh" display-table)
+ (put-display-table ?щ "sch" display-table)
+ (put-display-table ?ъ "~" display-table)
+ (put-display-table ?ы "y" display-table)
+ (put-display-table ?ь "'" display-table)
+ (put-display-table ?э "e'" display-table)
+ (put-display-table ?ю "yu" display-table)
+ (put-display-table ?я "ya" display-table)
+ (put-display-table ?А "A" display-table)
+ (put-display-table ?Б "B" display-table)
+ (put-display-table ?В "V" display-table)
+ (put-display-table ?Г "G" display-table)
+ (put-display-table ?Д "D" display-table)
+ (put-display-table ?Е "E" display-table)
+ (put-display-table ?Ё "Yo" display-table)
+ (put-display-table ?Ж "Zh" display-table)
+ (put-display-table ?З "Z" display-table)
+ (put-display-table ?И "I" display-table)
+ (put-display-table ?Й "J" display-table)
+ (put-display-table ?К "K" display-table)
+ (put-display-table ?Л "L" display-table)
+ (put-display-table ?М "M" display-table)
+ (put-display-table ?Н "N" display-table)
+ (put-display-table ?О "O" display-table)
+ (put-display-table ?П "P" display-table)
+ (put-display-table ?Р "R" display-table)
+ (put-display-table ?С "S" display-table)
+ (put-display-table ?Т "T" display-table)
+ (put-display-table ?У "U" display-table)
+ (put-display-table ?Ф "F" display-table)
+ (put-display-table ?Х "Kh" display-table)
+ (put-display-table ?Ц "Ts" display-table)
+ (put-display-table ?Ч "Ch" display-table)
+ (put-display-table ?Ш "Sh" display-table)
+ (put-display-table ?Щ "Sch" display-table)
+ (put-display-table ?Ъ "~" display-table)
+ (put-display-table ?Ы "Y" display-table)
+ (put-display-table ?Ь "'" display-table)
+ (put-display-table ?Э "E'" display-table)
+ (put-display-table ?Ю "Yu" display-table)
+ (put-display-table ?Я "Ya" display-table)
+ (put-display-table ?є "ie" display-table)
+ (put-display-table ?ї "i" display-table)
+ (put-display-table ?ў "u" display-table)
+ (put-display-table ?ђ "dj" display-table)
+ (put-display-table ?ћ "chj" display-table)
+ (put-display-table ?ѓ "gj" display-table)
+ (put-display-table ?ѕ "s" display-table)
+ (put-display-table ?ќ "k" display-table)
+ (put-display-table ?і "i" display-table)
+ (put-display-table ?ј "j" display-table)
+ (put-display-table ?љ "lj" display-table)
+ (put-display-table ?њ "nj" display-table)
+ (put-display-table ?џ "dz" display-table)
+ (put-display-table ?Є "Ye" display-table)
+ (put-display-table ?Ї "Yi" display-table)
+ (put-display-table ?Ў "U" display-table)
+ (put-display-table ?Ђ "Dj" display-table)
+ (put-display-table ?Ћ "Chj" display-table)
+ (put-display-table ?Ѓ "Gj" display-table)
+ (put-display-table ?Ѕ "S" display-table)
+ (put-display-table ?Ќ "K" display-table)
+ (put-display-table ?І "I" display-table)
+ (put-display-table ?Ј "J" display-table)
+ (put-display-table ?Љ "Lj" display-table)
+ (put-display-table ?Њ "Nj" display-table)
+ (put-display-table ?Џ "Dj" display-table)
+
+ (when (equal cyrillic-language "Bulgarian")
+ (put-display-table ?щ "sht" display-table)
+ (put-display-table ?Щ "Sht" display-table)
+ (put-display-table ?ю "iu" display-table)
+ (put-display-table ?Ю "Iu" display-table)
+ (put-display-table ?я "ia" display-table)
+ (put-display-table ?Я "Ia" display-table))
- (or standard-display-table
- (setq standard-display-table (make-display-table)))
-
- (if (equal cyrillic-language "")
- (setq cyrillic-language nil))
-
- (if (null cyrillic-language)
- (setq standard-display-table (make-display-table))
- (aset standard-display-table ?а [?a])
- (aset standard-display-table ?б [?b])
- (aset standard-display-table ?в [?v])
- (aset standard-display-table ?г [?g])
- (aset standard-display-table ?д [?d])
- (aset standard-display-table ?е [?e])
- (aset standard-display-table ?ё [?y?o])
- (aset standard-display-table ?ж [?z?h])
- (aset standard-display-table ?з [?z])
- (aset standard-display-table ?и [?i])
- (aset standard-display-table ?й [?j])
- (aset standard-display-table ?к [?k])
- (aset standard-display-table ?л [?l])
- (aset standard-display-table ?м [?m])
- (aset standard-display-table ?н [?n])
- (aset standard-display-table ?о [?o])
- (aset standard-display-table ?п [?p])
- (aset standard-display-table ?р [?r])
- (aset standard-display-table ?с [?s])
- (aset standard-display-table ?т [?t])
- (aset standard-display-table ?у [?u])
- (aset standard-display-table ?ф [?f])
- (aset standard-display-table ?х [?k?h])
- (aset standard-display-table ?ц [?t?s])
- (aset standard-display-table ?ч [?c?h])
- (aset standard-display-table ?ш [?s?h])
- (aset standard-display-table ?щ [?s?c?h])
- (aset standard-display-table ?ъ [?~])
- (aset standard-display-table ?ы [?y])
- (aset standard-display-table ?ь [?'])
- (aset standard-display-table ?э [?e?'])
- (aset standard-display-table ?ю [?y?u])
- (aset standard-display-table ?я [?y?a])
-
- (aset standard-display-table ?А [?A])
- (aset standard-display-table ?Б [?B])
- (aset standard-display-table ?В [?V])
- (aset standard-display-table ?Г [?G])
- (aset standard-display-table ?Д [?D])
- (aset standard-display-table ?Е [?E])
- (aset standard-display-table ?Ё [?Y?o])
- (aset standard-display-table ?Ж [?Z?h])
- (aset standard-display-table ?З [?Z])
- (aset standard-display-table ?И [?I])
- (aset standard-display-table ?Й [?J])
- (aset standard-display-table ?К [?K])
- (aset standard-display-table ?Л [?L])
- (aset standard-display-table ?М [?M])
- (aset standard-display-table ?Н [?N])
- (aset standard-display-table ?О [?O])
- (aset standard-display-table ?П [?P])
- (aset standard-display-table ?Р [?R])
- (aset standard-display-table ?С [?S])
- (aset standard-display-table ?Т [?T])
- (aset standard-display-table ?У [?U])
- (aset standard-display-table ?Ф [?F])
- (aset standard-display-table ?Х [?K?h])
- (aset standard-display-table ?Ц [?T?s])
- (aset standard-display-table ?Ч [?C?h])
- (aset standard-display-table ?Ш [?S?h])
- (aset standard-display-table ?Щ [?S?c?h])
- (aset standard-display-table ?Ъ [?~])
- (aset standard-display-table ?Ы [?Y])
- (aset standard-display-table ?Ь [?'])
- (aset standard-display-table ?Э [?E?'])
- (aset standard-display-table ?Ю [?Y?u])
- (aset standard-display-table ?Я [?Y?a])
-
- (aset standard-display-table ?є [?i?e])
- (aset standard-display-table ?ї [?i])
- (aset standard-display-table ?ў [?u])
- (aset standard-display-table ?ђ [?d?j])
- (aset standard-display-table ?ћ [?c?h?j])
- (aset standard-display-table ?ѓ [?g?j])
- (aset standard-display-table ?ѕ [?s])
- (aset standard-display-table ?ќ [?k])
- (aset standard-display-table ?і [?i])
- (aset standard-display-table ?ј [?j])
- (aset standard-display-table ?љ [?l?j])
- (aset standard-display-table ?њ [?n?j])
- (aset standard-display-table ?џ [?d?z])
-
- (aset standard-display-table ?Є [?Y?e])
- (aset standard-display-table ?Ї [?Y?i])
- (aset standard-display-table ?Ў [?U])
- (aset standard-display-table ?Ђ [?D?j])
- (aset standard-display-table ?Ћ [?C?h?j])
- (aset standard-display-table ?Ѓ [?G?j])
- (aset standard-display-table ?Ѕ [?S])
- (aset standard-display-table ?Ќ [?K])
- (aset standard-display-table ?І [?I])
- (aset standard-display-table ?Ј [?J])
- (aset standard-display-table ?Љ [?L?j])
- (aset standard-display-table ?Њ [?N?j])
- (aset standard-display-table ?Џ [?D?j])
-
- (when (equal cyrillic-language "Bulgarian")
- (aset standard-display-table ?щ [?s?h?t])
- (aset standard-display-table ?Щ [?S?h?t])
- (aset standard-display-table ?ю [?i?u])
- (aset standard-display-table ?Ю [?I?u])
- (aset standard-display-table ?я [?i?a])
- (aset standard-display-table ?Я [?I?a]))
-
- (when (equal cyrillic-language "Ukrainian") ; based on the official
- ; transliteration table
- (aset standard-display-table ?и [?y])
- (aset standard-display-table ?И [?Y])
- (aset standard-display-table ?й [?i])
- (aset standard-display-table ?Й [?Y])
- (aset standard-display-table ?ю [?i?u])
- (aset standard-display-table ?я [?i?a]))))
-
-
+ (when (equal cyrillic-language "Ukrainian") ; based on the official
+ ; transliteration table
+ (put-display-table ?и "y" display-table)
+ (put-display-table ?И "Y" display-table)
+ (put-display-table ?й "i" display-table)
+ (put-display-table ?Й "Y" display-table)
+ (put-display-table ?ю "iu" display-table)
+ (put-display-table ?я "ia" display-table)))) nil))
;;
(provide 'cyril-util)
diff -r cc293ef846d2 -r e214ff9f9507 lisp/x-init.el
--- a/lisp/x-init.el Mon Dec 24 14:00:51 2007 +0100
+++ b/lisp/x-init.el Mon Dec 24 20:22:08 2007 +0100
@@ -336,11 +336,11 @@ This function is a trivial wrapper aroun
;; due to a universally crocked font width specification. Display it
;; as a space since that's what seems to be expected.
;;
-;; (make-vector 256 nil) instead of (make-display-table) because
-;; make-display-table doesn't exist when this file is loaded.
+;; (make-char-table 'generic) instead of (make-display-table) because
+;; make-display-table isn't dumped, and this file is.
-(let ((tab (make-vector 256 nil)))
- (aset tab 160 " ")
+(let ((tab (make-char-table 'generic)))
+ (put-char-table 160 " " tab)
(set-specifier current-display-table tab 'global 'x))
;;; x-init.el ends here
--
¿Dónde estará ahora mi sobrino Yoghurtu Nghé, que tuvo que huir
precipitadamente de la aldea por culpa de la escasez de rinocerontes?
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
commit: Small improvements in disp-table.el, mule/cyril-util.el.
16 years, 7 months
Aidan Kehoe
changeset: 4454:1f0aa40cafe090edac8b2a0584e86050da240da7
tag: tip
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Sun May 11 12:03:07 2008 +0200
files: lisp/ChangeLog lisp/disp-table.el lisp/mule/cyril-util.el
description:
Small improvements in disp-table.el, mule/cyril-util.el.
2008-05-11 Aidan Kehoe <kehoea(a)parhasard.net>
* disp-table.el (make-display-table):
[...] Also, I previously said #xFF when I meant
?\xFF; correct this.
* mule/cyril-util.el (standard-display-cyrillic-translit):
Make the selection of the default language more sensible; change
the API a little to make a sensible default Cyrillic language
available, checking current-language-environment.
diff -r 29efd169efe7d04bdb511dcd275f5691dc149997 -r 1f0aa40cafe090edac8b2a0584e86050da240da7 lisp/ChangeLog
--- a/lisp/ChangeLog Sun May 11 11:24:01 2008 +0200
+++ b/lisp/ChangeLog Sun May 11 12:03:07 2008 +0200
@@ -2,7 +2,12 @@ 2008-05-11 Aidan Kehoe <kehoea@parhasa
* disp-table.el (make-display-table):
Update the example code to make it more general, and more
- compatible with GNU.
+ compatible with GNU. Also, I previously said #xFF when I meant
+ ?\xFF; correct this.
+ * mule/cyril-util.el (standard-display-cyrillic-translit):
+ Make the selection of the default language more sensible; change
+ the API a little to make a sensible default Cyrillic language
+ available, checking current-language-environment.
2007-07-21 Aidan Kehoe <kehoea(a)parhasard.net>
diff -r 29efd169efe7d04bdb511dcd275f5691dc149997 -r 1f0aa40cafe090edac8b2a0584e86050da240da7 lisp/disp-table.el
--- a/lisp/disp-table.el Sun May 11 11:24:01 2008 +0200
+++ b/lisp/disp-table.el Sun May 11 12:03:07 2008 +0200
@@ -39,7 +39,7 @@
This returns a generic character table; previously it returned a vector, but
that was not helpful when dealing with internationalized characters above
-#xFF. See `make-char-table' for details of character tables in general. To
+?\xFF. See `make-char-table' for details of character tables in general. To
write code that works with both vectors and character tables, add something
like the following to the beginning of your file, and use
`put-display-table' to set what a given character is displayed as, and
diff -r 29efd169efe7d04bdb511dcd275f5691dc149997 -r 1f0aa40cafe090edac8b2a0584e86050da240da7 lisp/mule/cyril-util.el
--- a/lisp/mule/cyril-util.el Sun May 11 11:24:01 2008 +0200
+++ b/lisp/mule/cyril-util.el Sun May 11 12:03:07 2008 +0200
@@ -43,7 +43,8 @@
"*List of known Cyrillic languages")
;;;###autoload
-(defun standard-display-cyrillic-translit (&optional cyrillic-language)
+(defun standard-display-cyrillic-translit (&optional cyrillic-language
+ disable)
"Display a cyrillic buffer using a transliteration.
For readability, the table is slightly
different from the one used for the input method `cyrillic-translit'.
@@ -51,19 +52,26 @@ The argument is a string which specifies
The argument is a string which specifies which language you are using;
that affects the choice of transliterations slightly.
Possible values are listed in 'cyrillic-language-alist'.
-If the argument is t, we use the default cyrillic transliteration.
-If the argument is nil, we return the display table to its standard state."
+
+Specifying a prefix arg, by preceding
+\\[standard-display-cyrillic-translit] with \\[universal-argument]
+turns off Cyrillic display. Noninteractively, the DISABLE argument
+does the same thing. "
(interactive
(list
- (let* ((completion-ignore-case t))
- (completing-read
- "Cyrillic language (default nil): "
- cyrillic-language-alist nil t nil nil nil))))
- (when (equal cyrillic-language "")
- (setq cyrillic-language nil))
+ (let* ((completion-ignore-case t)
+ (default-language (if (assoc-ignore-case
+ current-language-environment
+ cyrillic-language-alist)
+ current-language-environment
+ "Russian")))
+ (or current-prefix-arg
+ (completing-read
+ (format "Cyrillic language (default %s): " default-language)
+ cyrillic-language-alist nil t nil nil default-language)))))
(frob-display-table
(lambda (display-table)
- (if (null cyrillic-language)
+ (if (or disable current-prefix-arg)
(if (char-table-p display-table)
(remove-char-table 'cyrillic-iso8859-5 display-table))
(put-display-table ?,LP(B "a" display-table)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
commit: Improve portable sample implementations for #'{put, get}-display-table
16 years, 7 months
Aidan Kehoe
changeset: 4452:82f8351e71c88a406868ece693e521789c8a7441
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Sun May 11 11:20:24 2008 +0200
files: lisp/ChangeLog lisp/disp-table.el
description:
Improve portable sample implementations for #'{put,get}-display-table
2008-05-11 Aidan Kehoe <kehoea(a)parhasard.net>
* disp-table.el (make-display-table):
Update the example code to make it more general, and more
compatible with GNU.
diff -r e214ff9f9507794f61ad09d81e5f9272447c87d2 -r 82f8351e71c88a406868ece693e521789c8a7441 lisp/ChangeLog
--- a/lisp/ChangeLog Mon Dec 24 20:22:08 2007 +0100
+++ b/lisp/ChangeLog Sun May 11 11:20:24 2008 +0200
@@ -1,3 +1,9 @@ 2007-07-21 Aidan Kehoe <kehoea@parhasa
+2008-05-11 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * disp-table.el (make-display-table):
+ Update the example code to make it more general, and more
+ compatible with GNU.
+
2007-07-21 Aidan Kehoe <kehoea(a)parhasard.net>
* mule/cyril-util.el:
diff -r e214ff9f9507794f61ad09d81e5f9272447c87d2 -r 82f8351e71c88a406868ece693e521789c8a7441 lisp/disp-table.el
--- a/lisp/disp-table.el Mon Dec 24 20:22:08 2007 +0100
+++ b/lisp/disp-table.el Sun May 11 11:20:24 2008 +0200
@@ -48,23 +48,19 @@ as:
\(defun-when-void put-display-table (range value display-table)
\"Set the value for char RANGE to VALUE in DISPLAY-TABLE. \"
- (ecase (type-of display-table)
- (vector
- (aset display-table range value))
- (char-table
- (put-char-table range value display-table))))
+ (if (sequencep display-table)
+ (aset display-table range value)
+ (put-char-table range value display-table)))
\(defun-when-void get-display-table (character display-table)
\"Find value for CHARACTER in DISPLAY-TABLE. \"
- (ecase (type-of display-table)
- (vector
- (aref display-table character))
- (char-table
- (get-char-table character display-table))))
+ (if (sequencep display-table)
+ (aref display-table character)
+ (get-char-table character display-table)))
In this implementation, `put-display-table' and `get-display-table' are
aliases of `put-char-table' and `get-char-table' respectively, and are
-always available. "
+always available."
(make-char-table 'generic))
;;;###autoload
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
commit: Use char-tables, not vectors, to instantiate the display table specifiers.
16 years, 7 months
Aidan Kehoe
changeset: 4451:e214ff9f9507794f61ad09d81e5f9272447c87d2
parent: 4356:cc293ef846d240af187a523bb32eb5e26a083531
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Mon Dec 24 20:22:08 2007 +0100
files: lisp/ChangeLog lisp/disp-table.el lisp/font.el lisp/mule/cyril-util.el lisp/x-init.el
description:
Use char-tables, not vectors, to instantiate the display table specifiers.
2007-07-21 Aidan Kehoe <kehoea(a)parhasard.net>
* mule/cyril-util.el:
* mule/cyril-util.el (cyrillic-encode-koi8-r-char): Removed.
* mule/cyril-util.el (cyrillic-encode-alternativnyj-char):
Removed. No-one uses these functions in google.com/codesearch,
GNU have a comment doubting their utility, and their
implementation is trivial.
* mule/cyril-util.el (cyrillic-language-alist):
Reformatted.
* mule/cyril-util.el (standard-display-table)): Removed. It wasn't
used anyway.
* mule/cyril-util.el (standard-display-cyrillic-translit):
Rewrite it to work with character tables as display tables, and
not to abort with an error.
2007-07-21 Aidan Kehoe <kehoea(a)parhasard.net>
* disp-table.el:
* disp-table.el (make-display-table): Moved earlier in the file in
a weak attempt at making syncing with GNU easier.
* disp-table.el (frob-display-table):
Autoload it, accept TAG-SET, for editing specifiers.
* disp-table.el (describe-display-table):
Have it handle character sets.
* disp-table.el (standard-display-8bit-1):
* disp-table.el (standard-display-8bit):
* disp-table.el (standard-display-default-1):
* disp-table.el (standard-display-ascii):
* disp-table.el (standard-display-g1):
* disp-table.el (standard-display-graphic):
* disp-table.el (standard-display-underline):
* disp-table.el (standard-display-european):
Rework them all to use put-char-table, remove-char-table instead
of aset. Limit standard-display-g1, standard-display-graphic to
TTYs; have standard-display-underline work on X11 too.
* font.el (font-caps-display-table):
Use put-char-table instead of aset when editing a display table.
* x-init.el:
* x-init.el (tab):
Create the initial display table as a char-table, not a vector.
diff -r cc293ef846d240af187a523bb32eb5e26a083531 -r e214ff9f9507794f61ad09d81e5f9272447c87d2 lisp/ChangeLog
--- a/lisp/ChangeLog Mon Dec 24 14:00:51 2007 +0100
+++ b/lisp/ChangeLog Mon Dec 24 20:22:08 2007 +0100
@@ -1,3 +1,46 @@ 2007-12-22 Stephen J. Turnbull <stephe
+2007-07-21 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * mule/cyril-util.el:
+ * mule/cyril-util.el (cyrillic-encode-koi8-r-char): Removed.
+ * mule/cyril-util.el (cyrillic-encode-alternativnyj-char):
+ Removed. No-one uses these functions in google.com/codesearch,
+ GNU have a comment doubting their utility, and their
+ implementation is trivial.
+ * mule/cyril-util.el (cyrillic-language-alist):
+ Reformatted.
+ * mule/cyril-util.el (standard-display-table)): Removed. It wasn't
+ used anyway.
+ * mule/cyril-util.el (standard-display-cyrillic-translit):
+ Rewrite it to work with character tables as display tables, and
+ not to abort with an error.
+
+2007-07-21 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * disp-table.el:
+ * disp-table.el (make-display-table): Moved earlier in the file in
+ a weak attempt at making syncing with GNU easier.
+ * disp-table.el (frob-display-table):
+ Autoload it, accept TAG-SET, for editing specifiers.
+ * disp-table.el (describe-display-table):
+ Have it handle character sets.
+ * disp-table.el (standard-display-8bit-1):
+ * disp-table.el (standard-display-8bit):
+ * disp-table.el (standard-display-default-1):
+ * disp-table.el (standard-display-ascii):
+ * disp-table.el (standard-display-g1):
+ * disp-table.el (standard-display-graphic):
+ * disp-table.el (standard-display-underline):
+ * disp-table.el (standard-display-european):
+ Rework them all to use put-char-table, remove-char-table instead
+ of aset. Limit standard-display-g1, standard-display-graphic to
+ TTYs; have standard-display-underline work on X11 too.
+
+ * font.el (font-caps-display-table):
+ Use put-char-table instead of aset when editing a display table.
+ * x-init.el:
+ * x-init.el (tab):
+ Create the initial display table as a char-table, not a vector.
+
2007-12-22 Stephen J. Turnbull <stephen(a)xemacs.org>
Factor out lists of operators specially treated by `make-autoload'.
diff -r cc293ef846d240af187a523bb32eb5e26a083531 -r e214ff9f9507794f61ad09d81e5f9272447c87d2 lisp/disp-table.el
--- a/lisp/disp-table.el Mon Dec 24 14:00:51 2007 +0100
+++ b/lisp/disp-table.el Mon Dec 24 20:22:08 2007 +0100
@@ -1,6 +1,6 @@
;;; disp-table.el --- functions for dealing with char tables.
-;; Copyright (C) 1987, 1994, 1997 Free Software Foundation, Inc.
+;; Copyright (C) 1987, 1994, 1997, 2007 Free Software Foundation, Inc.
;; Copyright (C) 1995 Sun Microsystems.
;; Author: Howard Gayle
@@ -28,56 +28,82 @@
;;; Commentary:
-;; #### Need lots of work. make-display-table depends on a value
-;; that is a define in the C code. Maybe we should just move the
-;; function into C.
-
-;; #### display-tables-as-vectors is really evil and a big pain in
-;; the ass.
-
;; Rewritten for XEmacs July 1995, Ben Wing.
;;; Code:
+
+;;;###autoload
+(defun make-display-table ()
+ "Return a new, empty display table.
+
+This returns a generic character table; previously it returned a vector, but
+that was not helpful when dealing with internationalized characters above
+#xFF. See `make-char-table' for details of character tables in general. To
+write code that works with both vectors and character tables, add something
+like the following to the beginning of your file, and use
+`put-display-table' to set what a given character is displayed as, and
+`get-display-table' to examine what that character is currently displayed
+as:
+
+\(defun-when-void put-display-table (range value display-table)
+ \"Set the value for char RANGE to VALUE in DISPLAY-TABLE. \"
+ (ecase (type-of display-table)
+ (vector
+ (aset display-table range value))
+ (char-table
+ (put-char-table range value display-table))))
+
+\(defun-when-void get-display-table (character display-table)
+ \"Find value for CHARACTER in DISPLAY-TABLE. \"
+ (ecase (type-of display-table)
+ (vector
+ (aref display-table character))
+ (char-table
+ (get-char-table character display-table))))
+
+In this implementation, `put-display-table' and `get-display-table' are
+aliases of `put-char-table' and `get-char-table' respectively, and are
+always available. "
+ (make-char-table 'generic))
+
+;;;###autoload
+(defalias 'put-display-table #'put-char-table)
+
+;;;###autoload
+(defalias 'get-display-table #'get-char-table)
(defun describe-display-table (dt)
"Describe the display table DT in a help buffer."
(with-displaying-help-buffer
(lambda ()
- (princ "\nCharacter display glyph sequences:\n")
- (save-excursion
- (let ((vector (make-vector 256 nil))
- (i 0))
- (while (< i 256)
- (aset vector i (aref dt i))
- (incf i))
- ;; FSF calls `describe-vector' here, but it is so incredibly
- ;; lame a function for that name that I cannot bring myself
- ;; to porting it. Here is what `describe-vector' does:
- (terpri)
- (let ((old (aref vector 0))
- (oldpos 0)
- (i 1)
- str)
- (while (<= i 256)
- (when (or (= i 256)
- (not (equal old (aref vector i))))
- (if (eq oldpos (1- i))
- (princ (format "%s\t\t%s\n"
- (single-key-description (int-char oldpos))
- old))
- (setq str (format "%s - %s"
- (single-key-description (int-char oldpos))
- (single-key-description (int-char (1- i)))))
- (princ str)
- (princ (make-string (max (- 2 (/ (length str)
- tab-width)) 1) ?\t))
- (princ old)
- (terpri))
- (or (= i 256)
- (setq old (aref vector i)
- oldpos i)))
- (incf i))))))))
+ (map-char-table
+ (lambda (range value)
+ (cond
+ ((eq range t)
+ (princ "\nAll characters: \n")
+ (princ (format " %S" value)))
+ ((eq 'charset (and (symbolp range) (type-of (find-charset range))))
+ (princ (format "\n\nCharset %S: \n" (charset-name range)))
+ (princ (format " %S" value)))
+ ((vectorp range)
+ (princ (format "\n\nCharset %S, row %d \n"
+ (charset-name (aref value 0))
+ (aref value 1)))
+ (princ (format " %S\n\n" value)))
+ ((characterp range)
+ (princ (format "\nCharacter U+%04X, %S: "
+ range (if (fboundp 'split-char)
+ (split-char range)
+ (list 'ascii (char-to-int range)))))
+ (princ (format " %S" value))))
+ nil) dt)
+ (princ
+ "\n\nFor some of the various other glyphs that GNU Emacs uses the display
+table for, see the XEmacs specifiers `truncation-glyph' ,
+`continuation-glyph', `control-arrow-glyph', `octal-escape-glyph' and the
+others described in the docstring of `make-glyph'. \n\n"))))
+
;;;###autoload
(defun describe-current-display-table (&optional domain)
@@ -89,21 +115,17 @@
(describe-display-table disptab)
(message "No display table"))))
-;;;###autoload
-(defun make-display-table ()
- "Return a new, empty display table."
- (make-vector 256 nil))
-
;; #### we need a generic frob-specifier function.
;; #### this also needs to be redone like frob-face-property.
;; Let me say one more time how much dynamic scoping sucks.
-(defun frob-display-table (fdt-function fdt-locale)
+;;;###autoload
+(defun frob-display-table (fdt-function fdt-locale &optional tag-set)
(or fdt-locale (setq fdt-locale 'global))
- (or (specifier-spec-list current-display-table fdt-locale)
+ (or (specifier-spec-list current-display-table fdt-locale tag-set)
(add-spec-to-specifier current-display-table (make-display-table)
- fdt-locale))
+ fdt-locale tag-set))
(add-spec-list-to-specifier
current-display-table
(list (cons fdt-locale
@@ -112,29 +134,44 @@
(funcall fdt-function (cdr fdt-x))
fdt-x)
(cdar (specifier-spec-list current-display-table
- fdt-locale)))))))
+ fdt-locale tag-set)))))))
(defun standard-display-8bit-1 (dt l h)
(while (<= l h)
- (aset dt l (char-to-string l))
+ (remove-char-table (int-to-char l) dt)
(setq l (1+ l))))
;;;###autoload
(defun standard-display-8bit (l h &optional locale)
- "Display characters in the range L to H literally."
+ "Display characters in the range L to H literally [sic].
+
+GNU Emacs includes this function. There, `literally' has no good meaning.
+Under XEmacs, this function makes characters with numeric values in the
+range L to H display as themselves; that is, as ASCII, latin-iso8859-1,
+latin-iso8859-2 or whatever. See `standard-display-default' for the inverse
+function. "
(frob-display-table
(lambda (x)
(standard-display-8bit-1 x l h))
locale))
(defun standard-display-default-1 (dt l h)
+ "Misnamed function under XEmacs. See `standard-display-default'."
(while (<= l h)
- (aset dt l nil)
+ (put-char-table (int-to-char l) (format "\\%o" l) dt)
(setq l (1+ l))))
;;;###autoload
(defun standard-display-default (l h &optional locale)
- "Display characters in the range L to H using the default notation."
+ "Display characters in the range L to H using octal escape notation.
+
+In the XEmacs context this function is misnamed. Under GNU Emacs,
+characters in the range #xA0 to #xFF display as octal escapes unless
+`standard-display-european' has been called; this function neutralizes the
+effects of `standard-display-european'. Under XEmacs, those characters
+normally do not display as octal escapes (this ignores hackery like
+specifying the X11 font character set on non-Mule builds) and this function
+sets them to display as octal escapes. "
(frob-display-table
(lambda (x)
(standard-display-default-1 x l h))
@@ -145,11 +182,8 @@
"Display character C using printable string S."
(frob-display-table
(lambda (x)
- (aset x c s))
- locale))
-
-
-;;; #### should frob in a 'tty locale.
+ (put-char-table c s x))
+ locale))
;;;###autoload
(defun standard-display-g1 (c sc &optional locale)
@@ -158,11 +192,8 @@ it is meaningless for an X frame."
it is meaningless for an X frame."
(frob-display-table
(lambda (x)
- (aset x c (concat "\016" (char-to-string sc) "\017")))
- locale))
-
-
-;;; #### should frob in a 'tty locale.
+ (put-char-table c (concat "\016" (char-to-string sc) "\017") x))
+ locale '(tty)))
;;;###autoload
(defun standard-display-graphic (c gc &optional locale)
@@ -171,37 +202,41 @@ X frame."
X frame."
(frob-display-table
(lambda (x)
- (aset x c (concat "\e(0" (char-to-string gc) "\e(B")))
- locale))
-
-;;; #### should frob in a 'tty locale.
-;;; #### the FSF equivalent of this makes this character be displayed
-;;; in the 'underline face. There's no current way to do this with
-;;; XEmacs display tables.
+ (put-char-table c (concat "\e(0" (char-to-string gc) "\e(B") x))
+ locale '(tty)))
;;;###autoload
(defun standard-display-underline (c uc &optional locale)
"Display character C as character UC plus underlining."
(frob-display-table
(lambda (x)
- (aset x c (concat "\e[4m" (char-to-string uc) "\e[m")))
+ (let (glyph)
+ (setq glyph (make-glyph (vector 'string :data (char-to-string uc))))
+ (set-glyph-face glyph 'underline)
+ (put-char-table c glyph x)))
locale))
;;;###autoload
(defun standard-display-european (arg &optional locale)
- "Toggle display of European characters encoded with ISO 8859.
-When enabled, characters in the range of 160 to 255 display not
-as octal escapes, but as accented characters.
-With prefix argument, enable European character display iff arg is positive."
+ "Toggle display of European characters encoded with ISO 8859-1.
+When enabled (the default), characters in the range of 160 to 255 display
+as accented characters. With negative prefix argument, display characters in
+that range as octal escapes.
+
+If you want to work in a Western European language under XEmacs, it
+shouldn't be necessary to call this function--things should just work. But
+it's in a sufficient number of init files that we're not in a hurry to
+remove it. "
(interactive "P")
- (frob-display-table
- (lambda (x)
- (if (or (<= (prefix-numeric-value arg) 0)
- (and (null arg)
- (equal (aref x 160) (char-to-string 160))))
- (standard-display-default-1 x 160 255)
- (standard-display-8bit-1 x 160 255)))
- locale))
+ (if (<= (prefix-numeric-value arg) 0)
+ (frob-display-table
+ (lambda (x)
+ (standard-display-default-1 x 160 255))
+ locale)
+ (frob-display-table
+ (lambda (x)
+ (standard-display-8bit-1 x 160 255))
+ locale)))
(provide 'disp-table)
diff -r cc293ef846d240af187a523bb32eb5e26a083531 -r e214ff9f9507794f61ad09d81e5f9272447c87d2 lisp/font.el
--- a/lisp/font.el Mon Dec 24 14:00:51 2007 +0100
+++ b/lisp/font.el Mon Dec 24 20:22:08 2007 +0100
@@ -254,17 +254,17 @@ for use in the 'weight' field of an X fo
(i 0))
;; Standard ASCII characters
(while (< i 26)
- (aset table (+ i ?a) (+ i ?A))
+ (put-display-table (+ i ?a) (+ i ?A) table)
(setq i (1+ i)))
;; Now ISO translations
;; #### FIXME what's this for??
(setq i 224)
(while (< i 247) ;; Agrave - Ouml
- (aset table i (- i 32))
+ (put-display-table i (- i 32) table)
(setq i (1+ i)))
(setq i 248)
(while (< i 255) ;; Oslash - Thorn
- (aset table i (- i 32))
+ (put-display-table i (- i 32) table)
(setq i (1+ i)))
table))
diff -r cc293ef846d240af187a523bb32eb5e26a083531 -r e214ff9f9507794f61ad09d81e5f9272447c87d2 lisp/mule/cyril-util.el
--- a/lisp/mule/cyril-util.el Mon Dec 24 14:00:51 2007 +0100
+++ b/lisp/mule/cyril-util.el Mon Dec 24 20:22:08 2007 +0100
@@ -26,17 +26,11 @@
;;; Commentary:
+;;; #### Remove this, use the one in packages instead, but with the below
+;;; standard-display-cyrillic-translit. This file is unfortunately shadowed
+;;; if you have the Mule packages installed!
+
;;; Code:
-
-;;;###autoload
-(defun cyrillic-encode-koi8-r-char (char)
- "Return KOI8-R external character code of CHAR if appropriate."
- (get-char-table char cyrillic-koi8-r-to-external-code-table))
-
-;;;###autoload
-(defun cyrillic-encode-alternativnyj-char (char)
- "Return ALTERNATIVNYJ external character code of CHAR if appropriate."
- (get-char-table char cyrillic-alternativnyj-to-external-code-table))
;; Display
@@ -44,11 +38,9 @@
;; Written by Valery Alexeev <valery(a)math.uga.edu>.
(defvar cyrillic-language-alist
- (list '("Belorussian") '("Bulgarian") '("Macedonian")
- '("Russian") '("Serbian") '("Ukrainian"))
- "*List of known cyrillic languages")
-
-(defvar standard-display-table)
+ '(("Belorussian") ("Bulgarian") ("Macedonian") ("Russian") ("Serbian")
+ ("Ukrainian"))
+ "*List of known Cyrillic languages")
;;;###autoload
(defun standard-display-cyrillic-translit (&optional cyrillic-language)
@@ -67,129 +59,122 @@ If the argument is nil, we return the di
(completing-read
"Cyrillic language (default nil): "
cyrillic-language-alist nil t nil nil nil))))
+ (when (equal cyrillic-language "")
+ (setq cyrillic-language nil))
+ (frob-display-table
+ (lambda (display-table)
+ (if (null cyrillic-language)
+ (if (char-table-p display-table)
+ (remove-char-table 'cyrillic-iso8859-5 display-table))
+ (put-display-table ?,LP(B "a" display-table)
+ (put-display-table ?,LQ(B "b" display-table)
+ (put-display-table ?,LR(B "v" display-table)
+ (put-display-table ?,LS(B "g" display-table)
+ (put-display-table ?,LT(B "d" display-table)
+ (put-display-table ?,LU(B "e" display-table)
+ (put-display-table ?,Lq(B "yo" display-table)
+ (put-display-table ?,LV(B "zh" display-table)
+ (put-display-table ?,LW(B "z" display-table)
+ (put-display-table ?,LX(B "i" display-table)
+ (put-display-table ?,LY(B "j" display-table)
+ (put-display-table ?,LZ(B "k" display-table)
+ (put-display-table ?,L[(B "l" display-table)
+ (put-display-table ?,L\(B "m" display-table)
+ (put-display-table ?,L](B "n" display-table)
+ (put-display-table ?,L^(B "o" display-table)
+ (put-display-table ?,L_(B "p" display-table)
+ (put-display-table ?,L`(B "r" display-table)
+ (put-display-table ?,La(B "s" display-table)
+ (put-display-table ?,Lb(B "t" display-table)
+ (put-display-table ?,Lc(B "u" display-table)
+ (put-display-table ?,Ld(B "f" display-table)
+ (put-display-table ?,Le(B "kh" display-table)
+ (put-display-table ?,Lf(B "ts" display-table)
+ (put-display-table ?,Lg(B "ch" display-table)
+ (put-display-table ?,Lh(B "sh" display-table)
+ (put-display-table ?,Li(B "sch" display-table)
+ (put-display-table ?,Lj(B "~" display-table)
+ (put-display-table ?,Lk(B "y" display-table)
+ (put-display-table ?,Ll(B "'" display-table)
+ (put-display-table ?,Lm(B "e'" display-table)
+ (put-display-table ?,Ln(B "yu" display-table)
+ (put-display-table ?,Lo(B "ya" display-table)
+ (put-display-table ?,L0(B "A" display-table)
+ (put-display-table ?,L1(B "B" display-table)
+ (put-display-table ?,L2(B "V" display-table)
+ (put-display-table ?,L3(B "G" display-table)
+ (put-display-table ?,L4(B "D" display-table)
+ (put-display-table ?,L5(B "E" display-table)
+ (put-display-table ?,L!(B "Yo" display-table)
+ (put-display-table ?,L6(B "Zh" display-table)
+ (put-display-table ?,L7(B "Z" display-table)
+ (put-display-table ?,L8(B "I" display-table)
+ (put-display-table ?,L9(B "J" display-table)
+ (put-display-table ?,L:(B "K" display-table)
+ (put-display-table ?,L;(B "L" display-table)
+ (put-display-table ?,L<(B "M" display-table)
+ (put-display-table ?,L=(B "N" display-table)
+ (put-display-table ?,L>(B "O" display-table)
+ (put-display-table ?,L?(B "P" display-table)
+ (put-display-table ?,L@(B "R" display-table)
+ (put-display-table ?,LA(B "S" display-table)
+ (put-display-table ?,LB(B "T" display-table)
+ (put-display-table ?,LC(B "U" display-table)
+ (put-display-table ?,LD(B "F" display-table)
+ (put-display-table ?,LE(B "Kh" display-table)
+ (put-display-table ?,LF(B "Ts" display-table)
+ (put-display-table ?,LG(B "Ch" display-table)
+ (put-display-table ?,LH(B "Sh" display-table)
+ (put-display-table ?,LI(B "Sch" display-table)
+ (put-display-table ?,LJ(B "~" display-table)
+ (put-display-table ?,LK(B "Y" display-table)
+ (put-display-table ?,LL(B "'" display-table)
+ (put-display-table ?,LM(B "E'" display-table)
+ (put-display-table ?,LN(B "Yu" display-table)
+ (put-display-table ?,LO(B "Ya" display-table)
+ (put-display-table ?,Lt(B "ie" display-table)
+ (put-display-table ?,Lw(B "i" display-table)
+ (put-display-table ?,L~(B "u" display-table)
+ (put-display-table ?,Lr(B "dj" display-table)
+ (put-display-table ?,L{(B "chj" display-table)
+ (put-display-table ?,Ls(B "gj" display-table)
+ (put-display-table ?,Lu(B "s" display-table)
+ (put-display-table ?,L|(B "k" display-table)
+ (put-display-table ?,Lv(B "i" display-table)
+ (put-display-table ?,Lx(B "j" display-table)
+ (put-display-table ?,Ly(B "lj" display-table)
+ (put-display-table ?,Lz(B "nj" display-table)
+ (put-display-table ?,L(B "dz" display-table)
+ (put-display-table ?,L$(B "Ye" display-table)
+ (put-display-table ?,L'(B "Yi" display-table)
+ (put-display-table ?,L.(B "U" display-table)
+ (put-display-table ?,L"(B "Dj" display-table)
+ (put-display-table ?,L+(B "Chj" display-table)
+ (put-display-table ?,L#(B "Gj" display-table)
+ (put-display-table ?,L%(B "S" display-table)
+ (put-display-table ?,L,(B "K" display-table)
+ (put-display-table ?,L&(B "I" display-table)
+ (put-display-table ?,L((B "J" display-table)
+ (put-display-table ?,L)(B "Lj" display-table)
+ (put-display-table ?,L*(B "Nj" display-table)
+ (put-display-table ?,L/(B "Dj" display-table)
+
+ (when (equal cyrillic-language "Bulgarian")
+ (put-display-table ?,Li(B "sht" display-table)
+ (put-display-table ?,LI(B "Sht" display-table)
+ (put-display-table ?,Ln(B "iu" display-table)
+ (put-display-table ?,LN(B "Iu" display-table)
+ (put-display-table ?,Lo(B "ia" display-table)
+ (put-display-table ?,LO(B "Ia" display-table))
- (or standard-display-table
- (setq standard-display-table (make-display-table)))
-
- (if (equal cyrillic-language "")
- (setq cyrillic-language nil))
-
- (if (null cyrillic-language)
- (setq standard-display-table (make-display-table))
- (aset standard-display-table ?,LP(B [?a])
- (aset standard-display-table ?,LQ(B [?b])
- (aset standard-display-table ?,LR(B [?v])
- (aset standard-display-table ?,LS(B [?g])
- (aset standard-display-table ?,LT(B [?d])
- (aset standard-display-table ?,LU(B [?e])
- (aset standard-display-table ?,Lq(B [?y?o])
- (aset standard-display-table ?,LV(B [?z?h])
- (aset standard-display-table ?,LW(B [?z])
- (aset standard-display-table ?,LX(B [?i])
- (aset standard-display-table ?,LY(B [?j])
- (aset standard-display-table ?,LZ(B [?k])
- (aset standard-display-table ?,L[(B [?l])
- (aset standard-display-table ?,L\(B [?m])
- (aset standard-display-table ?,L](B [?n])
- (aset standard-display-table ?,L^(B [?o])
- (aset standard-display-table ?,L_(B [?p])
- (aset standard-display-table ?,L`(B [?r])
- (aset standard-display-table ?,La(B [?s])
- (aset standard-display-table ?,Lb(B [?t])
- (aset standard-display-table ?,Lc(B [?u])
- (aset standard-display-table ?,Ld(B [?f])
- (aset standard-display-table ?,Le(B [?k?h])
- (aset standard-display-table ?,Lf(B [?t?s])
- (aset standard-display-table ?,Lg(B [?c?h])
- (aset standard-display-table ?,Lh(B [?s?h])
- (aset standard-display-table ?,Li(B [?s?c?h])
- (aset standard-display-table ?,Lj(B [?~])
- (aset standard-display-table ?,Lk(B [?y])
- (aset standard-display-table ?,Ll(B [?'])
- (aset standard-display-table ?,Lm(B [?e?'])
- (aset standard-display-table ?,Ln(B [?y?u])
- (aset standard-display-table ?,Lo(B [?y?a])
-
- (aset standard-display-table ?,L0(B [?A])
- (aset standard-display-table ?,L1(B [?B])
- (aset standard-display-table ?,L2(B [?V])
- (aset standard-display-table ?,L3(B [?G])
- (aset standard-display-table ?,L4(B [?D])
- (aset standard-display-table ?,L5(B [?E])
- (aset standard-display-table ?,L!(B [?Y?o])
- (aset standard-display-table ?,L6(B [?Z?h])
- (aset standard-display-table ?,L7(B [?Z])
- (aset standard-display-table ?,L8(B [?I])
- (aset standard-display-table ?,L9(B [?J])
- (aset standard-display-table ?,L:(B [?K])
- (aset standard-display-table ?,L;(B [?L])
- (aset standard-display-table ?,L<(B [?M])
- (aset standard-display-table ?,L=(B [?N])
- (aset standard-display-table ?,L>(B [?O])
- (aset standard-display-table ?,L?(B [?P])
- (aset standard-display-table ?,L@(B [?R])
- (aset standard-display-table ?,LA(B [?S])
- (aset standard-display-table ?,LB(B [?T])
- (aset standard-display-table ?,LC(B [?U])
- (aset standard-display-table ?,LD(B [?F])
- (aset standard-display-table ?,LE(B [?K?h])
- (aset standard-display-table ?,LF(B [?T?s])
- (aset standard-display-table ?,LG(B [?C?h])
- (aset standard-display-table ?,LH(B [?S?h])
- (aset standard-display-table ?,LI(B [?S?c?h])
- (aset standard-display-table ?,LJ(B [?~])
- (aset standard-display-table ?,LK(B [?Y])
- (aset standard-display-table ?,LL(B [?'])
- (aset standard-display-table ?,LM(B [?E?'])
- (aset standard-display-table ?,LN(B [?Y?u])
- (aset standard-display-table ?,LO(B [?Y?a])
-
- (aset standard-display-table ?,Lt(B [?i?e])
- (aset standard-display-table ?,Lw(B [?i])
- (aset standard-display-table ?,L~(B [?u])
- (aset standard-display-table ?,Lr(B [?d?j])
- (aset standard-display-table ?,L{(B [?c?h?j])
- (aset standard-display-table ?,Ls(B [?g?j])
- (aset standard-display-table ?,Lu(B [?s])
- (aset standard-display-table ?,L|(B [?k])
- (aset standard-display-table ?,Lv(B [?i])
- (aset standard-display-table ?,Lx(B [?j])
- (aset standard-display-table ?,Ly(B [?l?j])
- (aset standard-display-table ?,Lz(B [?n?j])
- (aset standard-display-table ?,L(B [?d?z])
-
- (aset standard-display-table ?,L$(B [?Y?e])
- (aset standard-display-table ?,L'(B [?Y?i])
- (aset standard-display-table ?,L.(B [?U])
- (aset standard-display-table ?,L"(B [?D?j])
- (aset standard-display-table ?,L+(B [?C?h?j])
- (aset standard-display-table ?,L#(B [?G?j])
- (aset standard-display-table ?,L%(B [?S])
- (aset standard-display-table ?,L,(B [?K])
- (aset standard-display-table ?,L&(B [?I])
- (aset standard-display-table ?,L((B [?J])
- (aset standard-display-table ?,L)(B [?L?j])
- (aset standard-display-table ?,L*(B [?N?j])
- (aset standard-display-table ?,L/(B [?D?j])
-
- (when (equal cyrillic-language "Bulgarian")
- (aset standard-display-table ?,Li(B [?s?h?t])
- (aset standard-display-table ?,LI(B [?S?h?t])
- (aset standard-display-table ?,Ln(B [?i?u])
- (aset standard-display-table ?,LN(B [?I?u])
- (aset standard-display-table ?,Lo(B [?i?a])
- (aset standard-display-table ?,LO(B [?I?a]))
-
- (when (equal cyrillic-language "Ukrainian") ; based on the official
- ; transliteration table
- (aset standard-display-table ?,LX(B [?y])
- (aset standard-display-table ?,L8(B [?Y])
- (aset standard-display-table ?,LY(B [?i])
- (aset standard-display-table ?,L9(B [?Y])
- (aset standard-display-table ?,Ln(B [?i?u])
- (aset standard-display-table ?,Lo(B [?i?a]))))
-
-
+ (when (equal cyrillic-language "Ukrainian") ; based on the official
+ ; transliteration table
+ (put-display-table ?,LX(B "y" display-table)
+ (put-display-table ?,L8(B "Y" display-table)
+ (put-display-table ?,LY(B "i" display-table)
+ (put-display-table ?,L9(B "Y" display-table)
+ (put-display-table ?,Ln(B "iu" display-table)
+ (put-display-table ?,Lo(B "ia" display-table)))) nil))
;;
(provide 'cyril-util)
diff -r cc293ef846d240af187a523bb32eb5e26a083531 -r e214ff9f9507794f61ad09d81e5f9272447c87d2 lisp/x-init.el
--- a/lisp/x-init.el Mon Dec 24 14:00:51 2007 +0100
+++ b/lisp/x-init.el Mon Dec 24 20:22:08 2007 +0100
@@ -336,11 +336,11 @@ This function is a trivial wrapper aroun
;; due to a universally crocked font width specification. Display it
;; as a space since that's what seems to be expected.
;;
-;; (make-vector 256 nil) instead of (make-display-table) because
-;; make-display-table doesn't exist when this file is loaded.
-
-(let ((tab (make-vector 256 nil)))
- (aset tab 160 " ")
+;; (make-char-table 'generic) instead of (make-display-table) because
+;; make-display-table isn't dumped, and this file is.
+
+(let ((tab (make-char-table 'generic)))
+ (put-char-table 160 " " tab)
(set-specifier current-display-table tab 'global 'x))
;;; x-init.el ends here
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
carbon2-commit: Merge one line in Makefile.in.in by hand.
16 years, 7 months
Aidan Kehoe
changeset: 4475:11515817d9ca86ee8caafb52872c0a0e7cd0705a
tag: tip
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Sun May 11 10:33:18 2008 +0200
files: ChangeLog.carbon2 Makefile.in.in
description:
Merge one line in Makefile.in.in by hand.
2008-05-11 Aidan Kehoe <kehoea(a)parhasard.net>
* Makefile.in.in: Clean up a conditional after an automated merge
had a non-easily-resolved conflict.
diff -r 80cf40f347031a446ee2dbeedfb6ecb17e6aedfc -r 11515817d9ca86ee8caafb52872c0a0e7cd0705a ChangeLog.carbon2
--- a/ChangeLog.carbon2 Sun May 11 10:05:47 2008 +0200
+++ b/ChangeLog.carbon2 Sun May 11 10:33:18 2008 +0200
@@ -1,3 +1,8 @@ 2008-01-24 Marcus Crestani <crestani@x
+2008-05-11 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * Makefile.in.in: Clean up a conditional after an automated merge
+ had a non-easily-resolved conflict.
+
2008-01-24 Marcus Crestani <crestani(a)xemacs.org>
* carbon/build.sh: Change package location from lib/ to share/.
diff -r 80cf40f347031a446ee2dbeedfb6ecb17e6aedfc -r 11515817d9ca86ee8caafb52872c0a0e7cd0705a Makefile.in.in
--- a/Makefile.in.in Sun May 11 10:05:47 2008 +0200
+++ b/Makefile.in.in Sun May 11 10:33:18 2008 +0200
@@ -446,7 +446,8 @@ install-arch-dep: mkdir
-chmod 0755 ${bindir}/${PROGNAME}-${version}
cd ${bindir} && $(RM) ./${PROGNAME} && ${LN_S} ${PROGNAME}-${version} ./${PROGNAME}
cd ${bindir} && $(RM) ./${SHEBANG_PROGNAME} && ${LN_S} ${PROGNAME}-${version} ./${SHEBANG_PROGNAME}
-# endif /* CYGWIN */
+# endif /* CYGWIN */
+# endif /* HAVE_CARBON */
#endif /* WIN32_NATIVE */
if test "${prefix}" != "${exec_prefix}"; then \
$(MAKEPATH) ${exec_prefix}/lib/${instvardir}; \
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
carbon2-commit: Call AC_SUBST on SHEBANG_PATHNAME, for #! support.
16 years, 7 months
Aidan Kehoe
changeset: 4472:13ce402e1736d4183b639aae50e08063d5056640
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Wed May 07 21:17:59 2008 +0200
files: ChangeLog Makefile.in.in configure configure.ac
description:
Call AC_SUBST on SHEBANG_PATHNAME, for #! support.
2008-05-07 Aidan Kehoe <kehoea(a)parhasard.net>
* configure.ac (XE_EXPAND_VARIABLE): Call AC_SUBST on
SHEBANG_PATHNAME, as suggested by Michael Sperber in
y9ly7aj1wfc.fsf(a)deinprogramm.de.
* Makefile.in.in: Regenerate.
* configure: Ditto.
diff -r fd8a9a4d81d944bffd5a1c3258dab652470b27d4 -r 13ce402e1736d4183b639aae50e08063d5056640 ChangeLog
--- a/ChangeLog Sun Jan 20 19:53:54 2008 +0100
+++ b/ChangeLog Wed May 07 21:17:59 2008 +0200
@@ -1,3 +1,11 @@ 2008-01-20 Aidan Kehoe <kehoea@parhasa
+2008-05-07 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * configure.ac (XE_EXPAND_VARIABLE): Call AC_SUBST on
+ SHEBANG_PATHNAME, as suggested by Michael Sperber in
+ y9ly7aj1wfc.fsf(a)deinprogramm.de.
+ * Makefile.in.in: Regenerate.
+ * configure: Ditto.
+
2008-01-20 Aidan Kehoe <kehoea(a)parhasard.net>
* Makefile.in.in (SHEBANG_PROGNAME):
diff -r fd8a9a4d81d944bffd5a1c3258dab652470b27d4 -r 13ce402e1736d4183b639aae50e08063d5056640 Makefile.in.in
--- a/Makefile.in.in Sun Jan 20 19:53:54 2008 +0100
+++ b/Makefile.in.in Wed May 07 21:17:59 2008 +0200
@@ -413,7 +413,7 @@ install-arch-dep: mkdir
${INSTALL_PROGRAM} src/${PROGNAME} ${bindir}/${PROGNAME}-${version}
-chmod 0755 ${bindir}/${PROGNAME}-${version}
cd ${bindir} && $(RM) ./${PROGNAME} && ${LN_S} ${PROGNAME}-${version} ./${PROGNAME}
- cd ${bindir} && $(RM) ./${SHEBANG_PROGNAME} && ${LN_S} ${PROGNAME}-${version}.exe ./${SHEBANG_PROGNAME}
+ cd ${bindir} && $(RM) ./${SHEBANG_PROGNAME} && ${LN_S} ${PROGNAME}-${version} ./${SHEBANG_PROGNAME}
# endif /* CYGWIN */
#endif /* WIN32_NATIVE */
if test "${prefix}" != "${exec_prefix}"; then \
diff -r fd8a9a4d81d944bffd5a1c3258dab652470b27d4 -r 13ce402e1736d4183b639aae50e08063d5056640 configure
--- a/configure Sun Jan 20 19:53:54 2008 +0100
+++ b/configure Wed May 07 21:17:59 2008 +0200
@@ -706,6 +706,7 @@ build_cpu
build_cpu
build_vendor
build_os
+SHEBANG_PROGNAME
configuration
CC
CFLAGS
@@ -4858,6 +4859,8 @@ else
SHEBANG_PROGNAME=xemacs-script
fi
+
+
cat >>confdefs.h <<_ACEOF
#define EMACS_PROGNAME "$PROGNAME"
_ACEOF
@@ -40455,6 +40458,7 @@ build_cpu!$build_cpu$ac_delim
build_cpu!$build_cpu$ac_delim
build_vendor!$build_vendor$ac_delim
build_os!$build_os$ac_delim
+SHEBANG_PROGNAME!$SHEBANG_PROGNAME$ac_delim
configuration!$configuration$ac_delim
CC!$CC$ac_delim
CFLAGS!$CFLAGS$ac_delim
@@ -40506,7 +40510,6 @@ ldap_libs!$ldap_libs$ac_delim
ldap_libs!$ldap_libs$ac_delim
postgresql_libs!$postgresql_libs$ac_delim
lwlib_objs!$lwlib_objs$ac_delim
-canna_libs!$canna_libs$ac_delim
_ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -40548,6 +40551,7 @@ ac_delim='%!_!# '
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
cat >conf$$subs.sed <<_ACEOF
+canna_libs!$canna_libs$ac_delim
ALLOCA!$ALLOCA$ac_delim
have_esd_config!$have_esd_config$ac_delim
SRC_SUBDIR_DEPS!$SRC_SUBDIR_DEPS$ac_delim
@@ -40624,7 +40628,7 @@ LTLIBOBJS!$LTLIBOBJS$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 74; then
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 75; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
diff -r fd8a9a4d81d944bffd5a1c3258dab652470b27d4 -r 13ce402e1736d4183b639aae50e08063d5056640 configure.ac
--- a/configure.ac Sun Jan 20 19:53:54 2008 +0100
+++ b/configure.ac Wed May 07 21:17:59 2008 +0200
@@ -1226,6 +1226,8 @@ else
SHEBANG_PROGNAME=xemacs-script
fi
+AC_SUBST(SHEBANG_PROGNAME)
+
AC_DEFINE_UNQUOTED(EMACS_PROGNAME, "$PROGNAME")
AC_DEFINE_UNQUOTED(SHEBANG_PROGNAME, "${PROGNAME}-script")
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
carbon2-commit: Support #!, to allow XEmacs to be called as a script interpreter.
16 years, 7 months
Aidan Kehoe
changeset: 4471:fd8a9a4d81d944bffd5a1c3258dab652470b27d4
parent: 4427:8bbabcab2c42867d7ed8338cc5f575551fd2443c
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Sun Jan 20 19:53:54 2008 +0100
files: ChangeLog Makefile.in.in configure configure.ac lisp/ChangeLog lisp/startup.el man/ChangeLog man/xemacs/cmdargs.texi src/ChangeLog src/config.h.in src/emacs.c src/lread.c
description:
Support #!, to allow XEmacs to be called as a script interpreter.
ChangeLog addition:
2008-01-20 Aidan Kehoe <kehoea(a)parhasard.net>
* Makefile.in.in (SHEBANG_PROGNAME):
New variable; a symbol link to the XEmacs binary to tell it it
should read a script from stdin.
* configure.ac (XE_EXPAND_VARIABLE):
Set SHEBANG_PROGNAME.
* configure:
Regenerate.
src/ChangeLog addition:
2008-01-20 Aidan Kehoe <kehoea(a)parhasard.net>
* config.h.in: Add SHEBANG_PROGNAME.
* emacs.c (main_1):
If we've been called using SHEBANG_PROGNAME, rewrite our arguments
to add a --script argument.
Also, handle the --script argument by setting noninteractive and
vanilla.
* lread.c (Fload_internal):
If the first two characters of a file are #!, replace them with ;!
before they get to the Lisp reader.
lisp/ChangeLog addition:
2008-01-20 Aidan Kehoe <kehoea(a)parhasard.net>
* startup.el (command-line-do-script): New.
(command-switch-alist): Use command-line-do-script.
New argument, compatible with GNU; --script or -script says "treat
the following argument as a file to load in batch mode".
man/ChangeLog addition:
2008-01-20 Aidan Kehoe <kehoea(a)parhasard.net>
* xemacs/cmdargs.texi (Command Switches):
Describe --script, -script.
diff -r 8bbabcab2c42867d7ed8338cc5f575551fd2443c -r fd8a9a4d81d944bffd5a1c3258dab652470b27d4 ChangeLog
--- a/ChangeLog Sun Jan 20 13:09:58 2008 +0100
+++ b/ChangeLog Sun Jan 20 19:53:54 2008 +0100
@@ -1,3 +1,13 @@ 2008-01-17 Aidan Kehoe <kehoea@parhasa
+2008-01-20 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * Makefile.in.in (SHEBANG_PROGNAME):
+ New variable; a symbol link to the XEmacs binary to tell it it
+ should read a script from stdin.
+ * configure.ac (XE_EXPAND_VARIABLE):
+ Set SHEBANG_PROGNAME.
+ * configure:
+ Regenerate.
+
2008-01-17 Aidan Kehoe <kehoea(a)parhasard.net>
* configure.ac:
diff -r 8bbabcab2c42867d7ed8338cc5f575551fd2443c -r fd8a9a4d81d944bffd5a1c3258dab652470b27d4 Makefile.in.in
--- a/Makefile.in.in Sun Jan 20 13:09:58 2008 +0100
+++ b/Makefile.in.in Sun Jan 20 19:53:54 2008 +0100
@@ -92,6 +92,7 @@ configuration=@configuration@
## This will be the name of the generated binary and is set automatically
## by configure.
PROGNAME=@PROGNAME@
+SHEBANG_PROGNAME=@SHEBANG_PROGNAME@
## ==================== Where To Install Things ====================
@@ -407,10 +408,12 @@ install-arch-dep: mkdir
${INSTALL_PROGRAM} src/${PROGNAME} ${bindir}/${PROGNAME}-${version}.exe
-chmod 0755 ${bindir}/${PROGNAME}-${version}.exe
cd ${bindir} && $(RM) ./${PROGNAME} && ${LN_S} ${PROGNAME}-${version}.exe ./${PROGNAME}
+ cd ${bindir} && $(RM) ./${SHEBANG_PROGNAME} && ${LN_S} ${PROGNAME}-${version}.exe ./${SHEBANG_PROGNAME}
# else
${INSTALL_PROGRAM} src/${PROGNAME} ${bindir}/${PROGNAME}-${version}
-chmod 0755 ${bindir}/${PROGNAME}-${version}
cd ${bindir} && $(RM) ./${PROGNAME} && ${LN_S} ${PROGNAME}-${version} ./${PROGNAME}
+ cd ${bindir} && $(RM) ./${SHEBANG_PROGNAME} && ${LN_S} ${PROGNAME}-${version}.exe ./${SHEBANG_PROGNAME}
# endif /* CYGWIN */
#endif /* WIN32_NATIVE */
if test "${prefix}" != "${exec_prefix}"; then \
diff -r 8bbabcab2c42867d7ed8338cc5f575551fd2443c -r fd8a9a4d81d944bffd5a1c3258dab652470b27d4 configure
--- a/configure Sun Jan 20 13:09:58 2008 +0100
+++ b/configure Sun Jan 20 19:53:54 2008 +0100
@@ -4851,13 +4851,20 @@ _ACEOF
version=${infodock_major_version}.${infodock_minor_version}.${infodock_build_version}
PROGNAME=infodock
+ SHEBANG_PROGNAME=infodock-script
CPPFLAGS="$CPPFLAGS -DINFODOCK"
else
PROGNAME=xemacs
+ SHEBANG_PROGNAME=xemacs-script
fi
cat >>confdefs.h <<_ACEOF
#define EMACS_PROGNAME "$PROGNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define SHEBANG_PROGNAME "${PROGNAME}-script"
_ACEOF
diff -r 8bbabcab2c42867d7ed8338cc5f575551fd2443c -r fd8a9a4d81d944bffd5a1c3258dab652470b27d4 configure.ac
--- a/configure.ac Sun Jan 20 13:09:58 2008 +0100
+++ b/configure.ac Sun Jan 20 19:53:54 2008 +0100
@@ -1219,12 +1219,16 @@ if test "$with_infodock" = "yes"; then
AC_DEFINE_UNQUOTED(INFODOCK_BUILD_VERSION, $infodock_build_version)
version=${infodock_major_version}.${infodock_minor_version}.${infodock_build_version}
PROGNAME=infodock
+ SHEBANG_PROGNAME=infodock-script
CPPFLAGS="$CPPFLAGS -DINFODOCK"
else
PROGNAME=xemacs
+ SHEBANG_PROGNAME=xemacs-script
fi
AC_DEFINE_UNQUOTED(EMACS_PROGNAME, "$PROGNAME")
+
+AC_DEFINE_UNQUOTED(SHEBANG_PROGNAME, "${PROGNAME}-script")
dnl ----------------------------------
dnl Error checking and debugging flags
diff -r 8bbabcab2c42867d7ed8338cc5f575551fd2443c -r fd8a9a4d81d944bffd5a1c3258dab652470b27d4 lisp/ChangeLog
--- a/lisp/ChangeLog Sun Jan 20 13:09:58 2008 +0100
+++ b/lisp/ChangeLog Sun Jan 20 19:53:54 2008 +0100
@@ -1,3 +1,10 @@ 2008-01-17 Mike Sperber <mike(a)xemacs.o
+2008-01-20 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * startup.el (command-line-do-script): New.
+ (command-switch-alist): Use command-line-do-script.
+ New argument, compatible with GNU; --script or -script says "treat
+ the following argument as a file to load in batch mode".
+
2008-01-17 Mike Sperber <mike(a)xemacs.org>
* files.el (insert-directory): Bind `coding-system-for-read' to
diff -r 8bbabcab2c42867d7ed8338cc5f575551fd2443c -r fd8a9a4d81d944bffd5a1c3258dab652470b27d4 lisp/startup.el
--- a/lisp/startup.el Sun Jan 20 13:09:58 2008 +0100
+++ b/lisp/startup.el Sun Jan 20 19:53:54 2008 +0100
@@ -234,6 +234,8 @@ after, and will not be true at any time
("-eval" . command-line-do-eval)
("-load" . command-line-do-load)
("-l" . command-line-do-load)
+ ("--script" . command-line-do-script)
+ ("-script" . command-line-do-script)
("-insert" . command-line-do-insert)
("-i" . command-line-do-insert)
("-kill" . command-line-do-kill)
@@ -436,6 +438,12 @@ Type ^H^H^H (Control-h Control-h Control
(if (file-exists-p (expand-file-name file))
(setq file (expand-file-name file)))
(load file nil t)))
+
+(defun command-line-do-script (arg)
+ "Load the named file of Lisp code into XEmacs.
+<file>"
+ (let ((file (pop command-line-args-left)))
+ (load file nil t t)))
(defun command-line-do-insert (arg)
"Insert file into the current buffer.
diff -r 8bbabcab2c42867d7ed8338cc5f575551fd2443c -r fd8a9a4d81d944bffd5a1c3258dab652470b27d4 man/ChangeLog
--- a/man/ChangeLog Sun Jan 20 13:09:58 2008 +0100
+++ b/man/ChangeLog Sun Jan 20 19:53:54 2008 +0100
@@ -1,3 +1,8 @@ 2007-12-17 Aidan Kehoe <kehoea@parhasa
+2008-01-20 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * xemacs/cmdargs.texi (Command Switches):
+ Describe --script, -script.
+
2007-12-17 Aidan Kehoe <kehoea(a)parhasard.net>
* lispref/strings.texi (Formatting Strings):
diff -r 8bbabcab2c42867d7ed8338cc5f575551fd2443c -r fd8a9a4d81d944bffd5a1c3258dab652470b27d4 man/xemacs/cmdargs.texi
--- a/man/xemacs/cmdargs.texi Sun Jan 20 13:09:58 2008 +0100
+++ b/man/xemacs/cmdargs.texi Sun Jan 20 19:53:54 2008 +0100
@@ -171,6 +171,27 @@ Do not process early packages. (For mor
Do not process early packages. (For more information on startup issues
concerning the package system, @xref{Startup Paths}.)
+@item -script @var{file}
+@item --script @var{file}
+Load @var{file} as a (compiled or interpreted) Lisp file; do not load
+any window-system or TTY code, do not load the user init file, the site
+file, or the early packages. This is comparable to running
+@samp{xemacs} @samp{-batch} @samp{-l} @var{file}.
+
+You can also specify this flag implicitly by calling the XEmacs binary
+with a value for @samp{argv[0]} of @samp{xemacs-script}, normally by
+means of a symbolic link. On a POSIX system, this means that adding the
+line:
+
+@example
+#!/usr/bin/env xemacs-script
+@end example
+
+at the start of an XEmacs Lisp file, and changing that file's
+permissions to executable, creates a script that can be invoked by
+typing the path to the file. XEmacs has logic to ignore the #! line at
+the start of the script, so that won't cause an error.
+
@item -vanilla
This is equivalent to @samp{-q -no-site-file -no-early-packages}.
diff -r 8bbabcab2c42867d7ed8338cc5f575551fd2443c -r fd8a9a4d81d944bffd5a1c3258dab652470b27d4 src/ChangeLog
--- a/src/ChangeLog Sun Jan 20 13:09:58 2008 +0100
+++ b/src/ChangeLog Sun Jan 20 19:53:54 2008 +0100
@@ -1,3 +1,15 @@ 2007-12-26 Aidan Kehoe <kehoea@parhasa
+2008-01-20 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * config.h.in: Add SHEBANG_PROGNAME.
+ * emacs.c (main_1):
+ If we've been called using SHEBANG_PROGNAME, rewrite our arguments
+ to add a --script argument.
+ Also, handle the --script argument by setting noninteractive and
+ vanilla.
+ * lread.c (Fload_internal):
+ If the first two characters of a file are #!, replace them with ;!
+ before they get to the Lisp reader.
+
2007-12-26 Aidan Kehoe <kehoea(a)parhasard.net>
* casetab.c:
diff -r 8bbabcab2c42867d7ed8338cc5f575551fd2443c -r fd8a9a4d81d944bffd5a1c3258dab652470b27d4 src/config.h.in
--- a/src/config.h.in Sun Jan 20 13:09:58 2008 +0100
+++ b/src/config.h.in Sun Jan 20 19:53:54 2008 +0100
@@ -90,6 +90,9 @@ things are arranged in config.h.in. In
/* Program name */
#undef EMACS_PROGNAME
+
+/* Name of the link to the program to be used with #! scripts */
+#undef SHEBANG_PROGNAME
/* Allow s&m files to differentiate OS versions without having
multiple files to maintain. */
diff -r 8bbabcab2c42867d7ed8338cc5f575551fd2443c -r fd8a9a4d81d944bffd5a1c3258dab652470b27d4 src/emacs.c
--- a/src/emacs.c Sun Jan 20 13:09:58 2008 +0100
+++ b/src/emacs.c Sun Jan 20 19:53:54 2008 +0100
@@ -955,6 +955,42 @@ main_1 (int argc, Wexttext **argv, Wextt
init_free_hook ();
#endif
+#define SHEBANG_PROGNAME_LENGTH \
+ (int)((sizeof (WEXTSTRING (SHEBANG_PROGNAME)) - sizeof (WEXTSTRING (""))))
+#define SHEBANG_EXE_PROGNAME_LENGTH \
+ (int)(sizeof (WEXTSTRING (SHEBANG_PROGNAME ".exe")) \
+ - sizeof (WEXTSTRING ("")))
+
+ {
+ int progname_len = wext_strlen (argv[0]);
+ if (progname_len >= SHEBANG_PROGNAME_LENGTH)
+ {
+ if (!wext_strcmp_ascii (argv[0] +
+ (progname_len - SHEBANG_PROGNAME_LENGTH),
+ SHEBANG_PROGNAME)
+ /* Allow trailing .exe. Don't check it, it could also be
+ .com. */
+ || (progname_len >= SHEBANG_EXE_PROGNAME_LENGTH &&
+ !wext_strncmp_ascii
+ (argv[0] + (progname_len - SHEBANG_EXE_PROGNAME_LENGTH),
+ SHEBANG_PROGNAME,
+ SHEBANG_PROGNAME_LENGTH)))
+ {
+ Wexttext **newarr = alloca_array (Wexttext *, argc + 2);
+ int j;
+
+ newarr[0] = argv[0];
+ newarr[1] = WEXTSTRING ("--script");
+ for (j = 1; j < argc; ++j)
+ {
+ newarr[j + 1] = argv[j];
+ }
+ argv = newarr;
+ argc++;
+ }
+ }
+ }
+
sort_args (argc, argv);
#if 0 /* defined (_SCO_DS)
@@ -1048,6 +1084,20 @@ main_1 (int argc, Wexttext **argv, Wextt
noninteractive = 1;
}
+ {
+ int count_before = skip_args;
+ /* Handle the -script switch, which implies batch and vanilla. The -l
+ part of its functionality is implemented in Lisp. */
+ if (argmatch (argv, argc, "-script", "--script", 0, NULL,
+ &skip_args))
+ {
+ noninteractive = 1;
+ vanilla_inhibiting = 1;
+ }
+
+ /* Don't actually discard this argument. */
+ skip_args = count_before;
+ }
#ifdef WIN32_NATIVE
{
/* Since we aren't a console application, we can't easily be terminated
@@ -2690,6 +2740,7 @@ static const struct standard_args standa
{ "-sd", "--show-dump-id", 105, 0 },
{ "-nd", "--no-dump-file", 95, 0 },
{ "-batch", "--batch", 88, 0 },
+ { "-script", "--script", 89, 1 },
#ifdef WIN32_NATIVE
{ "-mswindows-termination-handle", 0, 84, 1 },
{ "-nuni", "--no-unicode-lib-calls", 83, 0 },
diff -r 8bbabcab2c42867d7ed8338cc5f575551fd2443c -r fd8a9a4d81d944bffd5a1c3258dab652470b27d4 src/lread.c
--- a/src/lread.c Sun Jan 20 13:09:58 2008 +0100
+++ b/src/lread.c Sun Jan 20 19:53:54 2008 +0100
@@ -743,6 +743,25 @@ do { \
/* set it to nil; a call to #'domain will set it. */
internal_bind_lisp_object (&Vfile_domain, Qnil);
#endif
+
+ /* Is there a #!? If so, read it, and unread ;!.
+
+ GNU implement this by treating any #! anywhere in the source text as
+ commenting out the whole line. */
+ {
+ char shebangp[2];
+ int num_read;
+
+ num_read = Lstream_read (XLSTREAM (lispstream), shebangp,
+ sizeof(shebangp));
+ if (sizeof(shebangp) == num_read
+ && 0 == strncmp("#!", shebangp, sizeof(shebangp)))
+ {
+ shebangp[0] = ';';
+ }
+
+ Lstream_unread (XLSTREAM (lispstream), shebangp, num_read);
+ }
/* Now determine what sort of ELC file we're reading in. */
internal_bind_int (&load_byte_code_version, load_byte_code_version);
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches