Mercurial > hg > xemacs-beta
changeset 4556:a1f8c5c250c2
Automated merge with file:/Sources/xemacs-21.5-checked-out
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Sun, 11 May 2008 19:50:49 +0200 |
parents | 20c32e489235 (current diff) 1f0aa40cafe0 (diff) |
children | 790bd95b84c1 |
files | lisp/ChangeLog |
diffstat | 18 files changed, 619 insertions(+), 240 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Sun May 11 19:50:10 2008 +0200 +++ b/ChangeLog Sun May 11 19:50:49 2008 +0200 @@ -1,3 +1,21 @@ +2008-05-07 Aidan Kehoe <kehoea@parhasard.net> + + * configure.ac (XE_EXPAND_VARIABLE): Call AC_SUBST on + SHEBANG_PATHNAME, as suggested by Michael Sperber in + y9ly7aj1wfc.fsf@deinprogramm.de. + * Makefile.in.in: Regenerate. + * configure: Ditto. + +2008-01-20 Aidan Kehoe <kehoea@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-04-01 Andreas Schwab <schwab@suse.de> Thanks to Mike Fabian for posting a patch to the mainline, to Martin
--- a/Makefile.in.in Sun May 11 19:50:10 2008 +0200 +++ b/Makefile.in.in Sun May 11 19:50:49 2008 +0200 @@ -92,6 +92,7 @@ ## 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 ==================== @@ -414,10 +415,12 @@ ${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} ./${SHEBANG_PROGNAME} # endif /* CYGWIN */ #endif /* WIN32_NATIVE */ if test "${prefix}" != "${exec_prefix}"; then \
--- a/configure Sun May 11 19:50:10 2008 +0200 +++ b/configure Sun May 11 19:50:49 2008 +0200 @@ -706,6 +706,7 @@ build_cpu build_vendor build_os +SHEBANG_PROGNAME configuration CC CFLAGS @@ -4855,16 +4856,25 @@ version=${infodock_major_version}.${infodock_minor_version}.${infodock_build_version} PROGNAME=infodock + SHEBANG_PROGNAME=infodock-script CPPFLAGS="$CPPFLAGS -DINFODOCK" else PROGNAME=xemacs -fi + SHEBANG_PROGNAME=xemacs-script +fi + + cat >>confdefs.h <<_ACEOF #define EMACS_PROGNAME "$PROGNAME" _ACEOF +cat >>confdefs.h <<_ACEOF +#define SHEBANG_PROGNAME "${PROGNAME}-script" +_ACEOF + + if test -n "$emacs_is_beta"; then beta=yes; else beta=no; fi test "${enable_error_checking_extents:=$beta}" = yes && cat >>confdefs.h <<\_ACEOF #define ERROR_CHECK_EXTENTS 1 @@ -40452,6 +40462,7 @@ 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 @@ -40503,7 +40514,6 @@ 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 @@ -40545,6 +40555,7 @@ 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 @@ -40621,7 +40632,7 @@ 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
--- a/configure.ac Sun May 11 19:50:10 2008 +0200 +++ b/configure.ac Sun May 11 19:50:49 2008 +0200 @@ -1224,13 +1224,19 @@ 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 -fi + SHEBANG_PROGNAME=xemacs-script +fi + +AC_SUBST(SHEBANG_PROGNAME) AC_DEFINE_UNQUOTED(EMACS_PROGNAME, "$PROGNAME") +AC_DEFINE_UNQUOTED(SHEBANG_PROGNAME, "${PROGNAME}-script") + dnl ---------------------------------- dnl Error checking and debugging flags dnl ----------------------------------
--- a/lisp/ChangeLog Sun May 11 19:50:10 2008 +0200 +++ b/lisp/ChangeLog Sun May 11 19:50:49 2008 +0200 @@ -1,3 +1,71 @@ +2008-05-11 Aidan Kehoe <kehoea@parhasard.net> + + * disp-table.el (make-display-table): + Update the example code to make it more general, and more + 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@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@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. + +2008-01-20 Aidan Kehoe <kehoea@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-05-07 Aidan Kehoe <kehoea@parhasard.net> + + * mule/latin.el (windows-1250): Add the Central European Windows + coding system. + * mule/mule-win32-init.el: Don't use the Windows-specific CP1250 + implementation, rely on that in latin.el instead. + 2008-05-11 Aidan Kehoe <kehoea@parhasard.net> * coding.el (query-coding-clear-highlights):
--- a/lisp/disp-table.el Sun May 11 19:50:10 2008 +0200 +++ b/lisp/disp-table.el Sun May 11 19:50:49 2008 +0200 @@ -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,78 @@ ;;; 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. \" + (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. \" + (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." + (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 +111,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 +130,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,12 +178,9 @@ "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) "Display character C as character SC in the g1 character set. @@ -158,11 +188,8 @@ 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 +198,41 @@ 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)
--- a/lisp/font.el Sun May 11 19:50:10 2008 +0200 +++ b/lisp/font.el Sun May 11 19:50:49 2008 +0200 @@ -254,17 +254,17 @@ (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))
--- a/lisp/mule/cyril-util.el Sun May 11 19:50:10 2008 +0200 +++ b/lisp/mule/cyril-util.el Sun May 11 19:50:49 2008 +0200 @@ -26,17 +26,11 @@ ;;; Commentary: -;;; Code: +;;; #### 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! -;;;###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)) +;;; Code: ;; Display @@ -44,14 +38,13 @@ ;; Written by Valery Alexeev <valery@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) +(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'. @@ -59,137 +52,137 @@ 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)))) - - (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]) + (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 (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) + (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) - (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 "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)) - + (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)
--- a/lisp/mule/latin.el Sun May 11 19:50:10 2008 +0200 +++ b/lisp/mule/latin.el Sun May 11 19:50:49 2008 +0200 @@ -188,6 +188,137 @@ when used to write German (or English, of course). " '(mnemonic "Latin 2" aliases (iso-latin-2 latin-2))) + +(make-8-bit-coding-system + 'windows-1250 + '((#x80 ?\u20AC) ;; EURO SIGN + (#x82 ?\u201A) ;; SINGLE LOW-9 QUOTATION MARK + (#x84 ?\u201E) ;; DOUBLE LOW-9 QUOTATION MARK + (#x85 ?\u2026) ;; HORIZONTAL ELLIPSIS + (#x86 ?\u2020) ;; DAGGER + (#x87 ?\u2021) ;; DOUBLE DAGGER + (#x89 ?\u2030) ;; PER MILLE SIGN + (#x8A ?\u0160) ;; LATIN CAPITAL LETTER S WITH CARON + (#x8B ?\u2039) ;; SINGLE LEFT-POINTING ANGLE QUOTATION MARK + (#x8C ?\u015A) ;; LATIN CAPITAL LETTER S WITH ACUTE + (#x8D ?\u0164) ;; LATIN CAPITAL LETTER T WITH CARON + (#x8E ?\u017D) ;; LATIN CAPITAL LETTER Z WITH CARON + (#x8F ?\u0179) ;; LATIN CAPITAL LETTER Z WITH ACUTE + (#x91 ?\u2018) ;; LEFT SINGLE QUOTATION MARK + (#x92 ?\u2019) ;; RIGHT SINGLE QUOTATION MARK + (#x93 ?\u201C) ;; LEFT DOUBLE QUOTATION MARK + (#x94 ?\u201D) ;; RIGHT DOUBLE QUOTATION MARK + (#x95 ?\u2022) ;; BULLET + (#x96 ?\u2013) ;; EN DASH + (#x97 ?\u2014) ;; EM DASH + (#x99 ?\u2122) ;; TRADE MARK SIGN + (#x9A ?\u0161) ;; LATIN SMALL LETTER S WITH CARON + (#x9B ?\u203A) ;; SINGLE RIGHT-POINTING ANGLE QUOTATION MARK + (#x9C ?\u015B) ;; LATIN SMALL LETTER S WITH ACUTE + (#x9D ?\u0165) ;; LATIN SMALL LETTER T WITH CARON + (#x9E ?\u017E) ;; LATIN SMALL LETTER Z WITH CARON + (#x9F ?\u017A) ;; LATIN SMALL LETTER Z WITH ACUTE + (#xA0 ?\u00A0) ;; NO-BREAK SPACE + (#xA1 ?\u02C7) ;; CARON + (#xA2 ?\u02D8) ;; BREVE + (#xA3 ?\u0141) ;; LATIN CAPITAL LETTER L WITH STROKE + (#xA4 ?\u00A4) ;; CURRENCY SIGN + (#xA5 ?\u0104) ;; LATIN CAPITAL LETTER A WITH OGONEK + (#xA6 ?\u00A6) ;; BROKEN BAR + (#xA7 ?\u00A7) ;; SECTION SIGN + (#xA8 ?\u00A8) ;; DIAERESIS + (#xA9 ?\u00A9) ;; COPYRIGHT SIGN + (#xAA ?\u015E) ;; LATIN CAPITAL LETTER S WITH CEDILLA + (#xAB ?\u00AB) ;; LEFT-POINTING DOUBLE ANGLE QUOTATION MARK + (#xAC ?\u00AC) ;; NOT SIGN + (#xAD ?\u00AD) ;; SOFT HYPHEN + (#xAE ?\u00AE) ;; REGISTERED SIGN + (#xAF ?\u017B) ;; LATIN CAPITAL LETTER Z WITH DOT ABOVE + (#xB0 ?\u00B0) ;; DEGREE SIGN + (#xB1 ?\u00B1) ;; PLUS-MINUS SIGN + (#xB2 ?\u02DB) ;; OGONEK + (#xB3 ?\u0142) ;; LATIN SMALL LETTER L WITH STROKE + (#xB4 ?\u00B4) ;; ACUTE ACCENT + (#xB5 ?\u00B5) ;; MICRO SIGN + (#xB6 ?\u00B6) ;; PILCROW SIGN + (#xB7 ?\u00B7) ;; MIDDLE DOT + (#xB8 ?\u00B8) ;; CEDILLA + (#xB9 ?\u0105) ;; LATIN SMALL LETTER A WITH OGONEK + (#xBA ?\u015F) ;; LATIN SMALL LETTER S WITH CEDILLA + (#xBB ?\u00BB) ;; RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK + (#xBC ?\u013D) ;; LATIN CAPITAL LETTER L WITH CARON + (#xBD ?\u02DD) ;; DOUBLE ACUTE ACCENT + (#xBE ?\u013E) ;; LATIN SMALL LETTER L WITH CARON + (#xBF ?\u017C) ;; LATIN SMALL LETTER Z WITH DOT ABOVE + (#xC0 ?\u0154) ;; LATIN CAPITAL LETTER R WITH ACUTE + (#xC1 ?\u00C1) ;; LATIN CAPITAL LETTER A WITH ACUTE + (#xC2 ?\u00C2) ;; LATIN CAPITAL LETTER A WITH CIRCUMFLEX + (#xC3 ?\u0102) ;; LATIN CAPITAL LETTER A WITH BREVE + (#xC4 ?\u00C4) ;; LATIN CAPITAL LETTER A WITH DIAERESIS + (#xC5 ?\u0139) ;; LATIN CAPITAL LETTER L WITH ACUTE + (#xC6 ?\u0106) ;; LATIN CAPITAL LETTER C WITH ACUTE + (#xC7 ?\u00C7) ;; LATIN CAPITAL LETTER C WITH CEDILLA + (#xC8 ?\u010C) ;; LATIN CAPITAL LETTER C WITH CARON + (#xC9 ?\u00C9) ;; LATIN CAPITAL LETTER E WITH ACUTE + (#xCA ?\u0118) ;; LATIN CAPITAL LETTER E WITH OGONEK + (#xCB ?\u00CB) ;; LATIN CAPITAL LETTER E WITH DIAERESIS + (#xCC ?\u011A) ;; LATIN CAPITAL LETTER E WITH CARON + (#xCD ?\u00CD) ;; LATIN CAPITAL LETTER I WITH ACUTE + (#xCE ?\u00CE) ;; LATIN CAPITAL LETTER I WITH CIRCUMFLEX + (#xCF ?\u010E) ;; LATIN CAPITAL LETTER D WITH CARON + (#xD0 ?\u0110) ;; LATIN CAPITAL LETTER D WITH STROKE + (#xD1 ?\u0143) ;; LATIN CAPITAL LETTER N WITH ACUTE + (#xD2 ?\u0147) ;; LATIN CAPITAL LETTER N WITH CARON + (#xD3 ?\u00D3) ;; LATIN CAPITAL LETTER O WITH ACUTE + (#xD4 ?\u00D4) ;; LATIN CAPITAL LETTER O WITH CIRCUMFLEX + (#xD5 ?\u0150) ;; LATIN CAPITAL LETTER O WITH DOUBLE ACUTE + (#xD6 ?\u00D6) ;; LATIN CAPITAL LETTER O WITH DIAERESIS + (#xD7 ?\u00D7) ;; MULTIPLICATION SIGN + (#xD8 ?\u0158) ;; LATIN CAPITAL LETTER R WITH CARON + (#xD9 ?\u016E) ;; LATIN CAPITAL LETTER U WITH RING ABOVE + (#xDA ?\u00DA) ;; LATIN CAPITAL LETTER U WITH ACUTE + (#xDB ?\u0170) ;; LATIN CAPITAL LETTER U WITH DOUBLE ACUTE + (#xDC ?\u00DC) ;; LATIN CAPITAL LETTER U WITH DIAERESIS + (#xDD ?\u00DD) ;; LATIN CAPITAL LETTER Y WITH ACUTE + (#xDE ?\u0162) ;; LATIN CAPITAL LETTER T WITH CEDILLA + (#xDF ?\u00DF) ;; LATIN SMALL LETTER SHARP S + (#xE0 ?\u0155) ;; LATIN SMALL LETTER R WITH ACUTE + (#xE1 ?\u00E1) ;; LATIN SMALL LETTER A WITH ACUTE + (#xE2 ?\u00E2) ;; LATIN SMALL LETTER A WITH CIRCUMFLEX + (#xE3 ?\u0103) ;; LATIN SMALL LETTER A WITH BREVE + (#xE4 ?\u00E4) ;; LATIN SMALL LETTER A WITH DIAERESIS + (#xE5 ?\u013A) ;; LATIN SMALL LETTER L WITH ACUTE + (#xE6 ?\u0107) ;; LATIN SMALL LETTER C WITH ACUTE + (#xE7 ?\u00E7) ;; LATIN SMALL LETTER C WITH CEDILLA + (#xE8 ?\u010D) ;; LATIN SMALL LETTER C WITH CARON + (#xE9 ?\u00E9) ;; LATIN SMALL LETTER E WITH ACUTE + (#xEA ?\u0119) ;; LATIN SMALL LETTER E WITH OGONEK + (#xEB ?\u00EB) ;; LATIN SMALL LETTER E WITH DIAERESIS + (#xEC ?\u011B) ;; LATIN SMALL LETTER E WITH CARON + (#xED ?\u00ED) ;; LATIN SMALL LETTER I WITH ACUTE + (#xEE ?\u00EE) ;; LATIN SMALL LETTER I WITH CIRCUMFLEX + (#xEF ?\u010F) ;; LATIN SMALL LETTER D WITH CARON + (#xF0 ?\u0111) ;; LATIN SMALL LETTER D WITH STROKE + (#xF1 ?\u0144) ;; LATIN SMALL LETTER N WITH ACUTE + (#xF2 ?\u0148) ;; LATIN SMALL LETTER N WITH CARON + (#xF3 ?\u00F3) ;; LATIN SMALL LETTER O WITH ACUTE + (#xF4 ?\u00F4) ;; LATIN SMALL LETTER O WITH CIRCUMFLEX + (#xF5 ?\u0151) ;; LATIN SMALL LETTER O WITH DOUBLE ACUTE + (#xF6 ?\u00F6) ;; LATIN SMALL LETTER O WITH DIAERESIS + (#xF7 ?\u00F7) ;; DIVISION SIGN + (#xF8 ?\u0159) ;; LATIN SMALL LETTER R WITH CARON + (#xF9 ?\u016F) ;; LATIN SMALL LETTER U WITH RING ABOVE + (#xFA ?\u00FA) ;; LATIN SMALL LETTER U WITH ACUTE + (#xFB ?\u0171) ;; LATIN SMALL LETTER U WITH DOUBLE ACUTE + (#xFC ?\u00FC) ;; LATIN SMALL LETTER U WITH DIAERESIS + (#xFD ?\u00FD) ;; LATIN SMALL LETTER Y WITH ACUTE + (#xFE ?\u0163) ;; LATIN SMALL LETTER T WITH CEDILLA + (#xFF ?\u02D9)) ;; DOT ABOVE + "CP 1250, Microsoft's encoding for Central Europe. +See also `iso-8859-2' and `window-1252' for Western Europe. " + '(mnemonic "CP1250" + aliases (cp1250))) + ;; ;; Latin-3 (ISO-8859-3). Esperanto, Maltese and Turkish. Obsolescent.
--- a/lisp/mule/mule-win32-init.el Sun May 11 19:50:10 2008 +0200 +++ b/lisp/mule/mule-win32-init.el Sun May 11 19:50:49 2008 +0200 @@ -153,10 +153,9 @@ ;; http://blogs.msdn.com/michkap/archive/2005/08/01/446475.aspx ; ("ANSI" 1200 utf-16-little-endian "Unicode (BMP of ISO 10646)") - ("ANSI" 1250 no-conversion "Windows 3.1 Eastern European") - ;; We implement this ourselves, and keeping the same implementation ;; across platforms means behaviour is a bit more consistent. + ; ("ANSI" 1250 no-conversion "Windows 3.1 Eastern European") ; ("ANSI" 1251 no-conversion "Windows 3.1 Cyrillic") ; ("ANSI" 1252 no-conversion "Windows 3.1 US (ANSI)")
--- a/lisp/startup.el Sun May 11 19:50:10 2008 +0200 +++ b/lisp/startup.el Sun May 11 19:50:49 2008 +0200 @@ -234,6 +234,8 @@ ("-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) @@ -437,6 +439,12 @@ (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. <file>"
--- a/lisp/x-init.el Sun May 11 19:50:10 2008 +0200 +++ b/lisp/x-init.el Sun May 11 19:50:49 2008 +0200 @@ -336,11 +336,11 @@ ;; 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
--- a/man/ChangeLog Sun May 11 19:50:10 2008 +0200 +++ b/man/ChangeLog Sun May 11 19:50:49 2008 +0200 @@ -1,3 +1,8 @@ +2008-01-20 Aidan Kehoe <kehoea@parhasard.net> + + * xemacs/cmdargs.texi (Command Switches): + Describe --script, -script. + 2008-02-27 Stephen J. Turnbull <stephen@xemacs.org> * internals/internals.texi (Discussion -- KKCC):
--- a/man/xemacs/cmdargs.texi Sun May 11 19:50:10 2008 +0200 +++ b/man/xemacs/cmdargs.texi Sun May 11 19:50:49 2008 +0200 @@ -171,6 +171,27 @@ 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}.
--- a/src/ChangeLog Sun May 11 19:50:10 2008 +0200 +++ b/src/ChangeLog Sun May 11 19:50:49 2008 +0200 @@ -1,3 +1,15 @@ +2008-01-20 Aidan Kehoe <kehoea@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. + 2008-04-26 Mike Sperber <mike@xemacs.org> * window.c (set_window_pixsize): Round up when we're shrinking,
--- a/src/config.h.in Sun May 11 19:50:10 2008 +0200 +++ b/src/config.h.in Sun May 11 19:50:49 2008 +0200 @@ -91,6 +91,9 @@ /* 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. */ #undef OS_RELEASE
--- a/src/emacs.c Sun May 11 19:50:10 2008 +0200 +++ b/src/emacs.c Sun May 11 19:50:49 2008 +0200 @@ -955,6 +955,42 @@ 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 @@ 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 @@ { "-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 },
--- a/src/lread.c Sun May 11 19:50:10 2008 +0200 +++ b/src/lread.c Sun May 11 19:50:49 2008 +0200 @@ -744,6 +744,25 @@ 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); if (reading_elc)