Re: VM and UTF-8
17 years, 1 month
Rodney Sparapani
Reiner Steib wrote:
> On Tue, Oct 16 2007, Aidan Kehoe wrote:
>
>> Ar an séú lá déag de mí Deireadh Fómhair, scríobh Reiner Steib:
> [...]
>> > I didn't see such mails or news articles yet. Is it frequent? The
>> > I'd add an entry to `mm-charset-synonym-alist' in Gnus [1].
>>
>> Not frequent, otherwise I would have added the alias and seen this bug years
>> ago. I believe it was someone in BeLUG ... ah, right, Michael Sucha in
>> 20071010191243.GC4137(a)mid.sucha.de to <linux-l(a)mlists.in-berlin.de>,
> [ gmane.org.user-groups.linux.berlin ]
>> and several more messages. And just him.
>
> He's using mutt. Hm, probably also a fault in his config. Maybe
> you'd like to ask him?
>
> Bye, Reiner.
He's probably a latex user. Working with Unicode (sometimes) can be a
simple as:
\usepackage[utf8]{inputenc}
So, I guess, many people will think that utf8 is what it is really called.
Rodney
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta
Re: [PATCH] Add Carbon-specific locale-determination code; respect the locale with mac-command-key-is-meta behaviour
17 years, 1 month
Aidan Kehoe
Ar an t-ochtú lá déag de mí Deireadh Fómhair, scríobh Sparapani, Rodney:
> [...] Maybe you have some other changes to checkin?
None independent of that; but do note that this is the carbon branch, not
the trunk.
> In any case, I am very interested in getting this working.
> Any thoughts?
Well, here’s a patch with the obvious compile failure fixed. If you want to
use the option key as meta, then you’ll need to call (setq
mac-command-key-is-meta nil) ; if your key layout needs option to generate
ASCII or any character necessary for the current language, as listed in the
Quail input method for that language, that character on its own will be
generated for that key, making it necessary to use the ESC prefix for meta +
thatkey; and other keys respect option as meta.
XEmacs Trunk source patch:
Diff command: cvs -q diff -Nu
Files affected: src/scrollbar-carbon.c
===================================================================
RCS src/intl-carbon.c
===================================================================
RCS src/event-carbon.c
===================================================================
RCS lisp/mule/mule-cmds.el
===================================================================
RCS
Index: lisp/mule/mule-cmds.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/mule/mule-cmds.el,v
retrieving revision 1.23.2.1
diff -u -u -r1.23.2.1 mule-cmds.el
--- lisp/mule/mule-cmds.el 2007/09/30 18:33:20 1.23.2.1
+++ lisp/mule/mule-cmds.el 2007/10/19 06:58:10
@@ -1464,17 +1464,25 @@
(declare-fboundp (mswindows-set-current-locale userdef)))
;; Unix:
(let (locstring)
- ;; Init the POSIX locale from the environment--this calls the C
- ;; library's setlocale(3).
- (set-current-locale "")
- ;; Can't let locstring be the result of (set-current-locale "")
- ;; because that can return a more detailed string than we know how
- ;; to handle.
- (setq locstring (current-locale)
- ;; assume C lib locale and LANG env var are set correctly.
- ;; use them to find the langenv.
- langenv
- (and locstring (get-language-environment-from-locale
+ (unless (and-fboundp
+ #'carbon-current-locale
+ ;; If Carbon provides us with the locale string, we want
+ ;; to use that, instead of the code that checks the
+ ;; C environment below.
+ (setq locstring
+ (carbon-current-locale)))
+ ;; Init the POSIX locale from the environment--this calls the C
+ ;; library's setlocale(3).
+ (set-current-locale "")
+ ;; Can't let locstring be the result of (set-current-locale "")
+ ;; because that can return a more detailed string than we know how
+ ;; to handle.
+ (setq locstring (current-locale)))
+
+ ;; assume C lib locale and LANG env var are set correctly.
+ ;; use them to find the langenv.
+ (setq langenv
+ (and locstring (get-language-environment-from-locale
locstring)))))
;; All systems:
(unless langenv (setq langenv "English"))
@@ -1515,8 +1523,36 @@
(setq Manual-use-rosetta-man nil))
;; Register available input methods by loading LEIM list file.
- (load "leim-list.el" 'noerror 'nomessage 'nosuffix)
- )
+ (load leim-list-file-name 'noerror 'nomessage 'nosuffix)
+
+ (when-boundp 'carbon-current-language-unicode-set
+ (unless carbon-current-language-unicode-set
+ (setq carbon-current-language-unicode-set
+ (make-hash-table :size 256)))
+ (loop
+ for i from #x20 to #x7e
+ do (puthash i t carbon-current-language-unicode-set))
+ (let ((input-method (get-language-info current-language-environment 'input-method)))
+ (when (assoc input-method input-method-alist)
+ (flet ((map-tree
+ (tree)
+ (loop for branch in tree
+ do
+ (cond ((consp branch)
+ (map-tree branch))
+ ((or (stringp branch) (vectorp branch))
+ (map-tree (append branch nil)))
+ ((characterp branch)
+ (unless (< branch #x80)
+ (puthash (encode-char branch 'ucs) t
+ carbon-current-language-unicode-set))))))
+ (append-message (&rest args) ())
+ (clear-message (&rest args) ()))
+ (set-input-method input-method)
+ (loop for mapped in (mapcar #'cdr (cdr (quail-map)))
+ do
+ (map-tree mapped)))
+ (inactivate-input-method)))))
;; Code deleted: init-mule-tm (Enable the tm package by default)
Index: src/event-carbon.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/Attic/event-carbon.c,v
retrieving revision 1.1.2.3
diff -u -u -r1.1.2.3 event-carbon.c
--- src/event-carbon.c 2007/09/30 19:48:26 1.1.2.3
+++ src/event-carbon.c 2007/10/19 06:58:10
@@ -27,16 +27,35 @@
#include "sysproc.h"
#include "systime.h"
+#include "elhash.h"
#include "console-carbon-impl.h"
+#ifdef DEBUG_XEMACS
+static Fixnum debug_carbon_events;
+# define DEBUG_CARBON_EVENTS(FORMAT, ...) \
+ do { if (debug_carbon_events) stderr_out(FORMAT, __VA_ARGS__); } while (0)
+#else /* DEBUG_XEMACS */
+# define DEBUG_CARBON_EVENTS(format, ...)
+#endif /* DEBUG_XEMACS */
+
+
+#ifdef DEBUG_XEMACS
+extern Fixnum debug_emacs_events;
+#endif
+
EXFUN (Funicode_to_char, 2); /* In unicode.c. */
+extern Lisp_Object Vcarbon_current_language_unicode_set;
+
extern Lisp_Object Qcarbon_unicode; /* From intl-carbon.c. */
extern SELECT_TYPE process_only_mask; /* From event-unixoid.c. */
extern int track_mouse_down_on_scrollbar (void); /* from scrollbar-carbon.c. */
+/* true if using command key as meta key */
+Lisp_Object Vmac_command_key_is_meta;
+
static struct event_stream *carbon_event_stream;
static Lisp_Object carbon_user_event_queue;
@@ -50,8 +69,6 @@
static EventLoopTimerUPP timer_proc_UPP;
-static int debug_carbon_events = 0;
-
/* Used in frame-carbon.c. */
void carbon_enqueue_user_event (Lisp_Object);
@@ -250,7 +267,7 @@
{
int emacs_modifiers = 0;
- if (modifiers & cmdKey)
+ if (modifiers & (NILP (Vmac_command_key_is_meta) ? optionKey : cmdKey))
emacs_modifiers |= XEMACS_MOD_META;
if (modifiers & controlKey)
emacs_modifiers |= XEMACS_MOD_CONTROL;
@@ -343,6 +360,108 @@
}
}
+static void
+retranslate_option (EventRef keyboard_event, UInt32 modifiers,
+ UniChar *text, UInt32 text_size)
+{
+ UInt32 new_modifiers = modifiers & ~optionKey;
+ UInt32 keycode;
+ KeyboardLayoutRef layoutRef;
+ KeyboardLayoutKind layout_kind;
+
+ GetEventParameter (keyboard_event, kEventParamKeyCode, typeUInt32, NULL,
+ sizeof (keycode), NULL, &keycode);
+
+ if (KLGetCurrentKeyboardLayout (&layoutRef) != noErr)
+ invalid_operation ("Can't get keyboard layout ref", Qunbound);
+
+ if (KLGetKeyboardLayoutProperty (layoutRef, kKLKind,
+ (const void **)&layout_kind) != noErr)
+ invalid_operation ("Can't get keyboard layout kind", Qunbound);
+
+ /* Depending on whether KCHR or uchr keyboard layout data is
+ available, call KeyTranslate or UCKeyTranslate to determine the
+ actual character code that should be enqueued. */
+ if (layout_kind == kKLKCHRKind)
+ {
+ void *kchr_ptr;
+ UInt16 new_keycode;
+ static UInt32 deadKeyState = 0;
+ UniChar char_code;
+
+ DEBUG_CARBON_EVENTS ("%s", "layout kind is KCHR\n");
+
+ if (KLGetKeyboardLayoutProperty (layoutRef, kKLKCHRData,
+ (const void **)&kchr_ptr) != noErr)
+ invalid_operation ("Can't get KCHR keyboard layout", Qunbound);
+
+ new_keycode = new_modifiers & 0xff00;
+
+ if (GetEventKind (keyboard_event) == kEventRawKeyUp)
+ new_keycode |= (1 << 7);
+
+ new_keycode |= (keycode & 0x7f);
+
+ deadKeyState = 0;
+ char_code = KeyTranslate (kchr_ptr, new_keycode, &deadKeyState);
+
+ DEBUG_CARBON_EVENTS ("char_code is %x, text[0] is %x, check is %x\n",
+ char_code, text[0],
+ (!NILP (Vcarbon_current_language_unicode_set) &&
+ !NILP (Fgethash (make_int (text[0]),
+ Vcarbon_current_language_unicode_set, Qnil))));
+
+ if (2 == text_size && char_code != text[0] &&
+ (!NILP (Vcarbon_current_language_unicode_set) &&
+ !NILP (Fgethash (make_int (text[0]),
+ Vcarbon_current_language_unicode_set, Qnil))))
+ {
+ DEBUG_CARBON_EVENTS ("%s", "with a normal keylayout, are modifying event\n");
+ enqueue_input (text, text_size / 2, new_modifiers);
+ }
+ else
+ {
+ DEBUG_CARBON_EVENTS ("%s", "with a normal keylayout, not modifying event\n");
+ enqueue_input (&char_code, 1, modifiers);
+ }
+ }
+ else /* layout_kind == kKLuchrKind || layout_kind == kKLKCHRuchrKind */
+ {
+ UCKeyboardLayout *layout;
+ static UInt32 deadKeyState = 0;
+ UniChar output[16];
+ UniCharCount output_length;
+
+ DEBUG_CARBON_EVENTS ("%s", "layout kind is Unicode\n");
+
+ if (KLGetKeyboardLayoutProperty (layoutRef, kKLuchrData,
+ (const void**)&layout) != noErr)
+ invalid_operation ("Can't get uchr keyboard layout", Qunbound);
+
+ if (UCKeyTranslate (layout, keycode, kUCKeyActionDown, new_modifiers >> 8,
+ LMGetKbdType (), 0, &deadKeyState, 16,
+ &output_length, output) != noErr)
+ invalid_operation ("Can't translate key using uchr", Qunbound);
+
+ DEBUG_CARBON_EVENTS ("output[0] is %x, text[0] is %x\n", output[0], text[0]);
+
+
+ if (2 == text_size && output[0] != text[0] &&
+ (!NILP (Vcarbon_current_language_unicode_set) &&
+ !NILP (Fgethash (make_int (text[0]),
+ Vcarbon_current_language_unicode_set, Qnil))))
+ {
+ DEBUG_CARBON_EVENTS ("%s", "with a normal keylayout, are modifying event\n");
+ enqueue_input (text, text_size / 2, new_modifiers);
+ }
+ else
+ {
+ DEBUG_CARBON_EVENTS ("%s", "with a normal keylayout, not modifying event\n");
+ enqueue_input (output, output_length, modifiers);
+ }
+ }
+}
+
static char *ascii_to_keysymstr_table[] = {
/*0x00*/ 0, "home", 0, "kp-enter", "end", "help", 0, 0,
/*0x08*/ "backspace", "tab", 0, "prior", "next", "return", 0, 0,
@@ -419,34 +538,49 @@
UniChar *text = (UniChar *)alloca_extbytes (text_size);
if (GetEventParameter (event, kEventParamTextInputSendText, typeUnicodeText, NULL, text_size, NULL, text) != noErr)
invalid_operation ("Can't get input text", Qunbound);
+
+ DEBUG_CARBON_EVENTS ("modifiers are %x, keycode is %x, text_size is %x\n",
+ modifiers, keycode, text_size);
+ DEBUG_CARBON_EVENTS ("optionKey is %x\n",
+ optionKey);
+
+ if (text_size == 2 && text[0] <= 127 &&
+ (modifiers & (controlKey | cmdKey)) && keycode_needs_retranslate[keycode])
+ {
+ retranslate_keycode (keyboard_event, modifiers);
+ return noErr;
+ }
+ if (NILP(Vmac_command_key_is_meta) && (modifiers & optionKey))
+ {
+ DEBUG_CARBON_EVENTS ("%s",
+ "command key is not meta, and the modifiers include option\n");
+ retranslate_option (keyboard_event, modifiers, text, text_size);
+ return noErr;
+ }
+
if (text_size == 2 && text[0] <= 127)
{
- if ((modifiers & (controlKey | cmdKey)) && keycode_needs_retranslate[keycode])
- retranslate_keycode (keyboard_event, modifiers);
+ char *keysymstr = ascii_to_keysymstr_table[text[0]];
+ if (keysymstr)
+ enqueue_one_input_event (KEYSYM (keysymstr), carbon_modifiers_to_emacs_modifiers (modifiers));
else
- {
- char *keysymstr = ascii_to_keysymstr_table[text[0]];
- if (keysymstr)
- enqueue_one_input_event (KEYSYM (keysymstr), carbon_modifiers_to_emacs_modifiers (modifiers));
- else
- {
- if (ascii_needs_keycode_lookup[text[0]])
- {
- char *keysymstr = keycode_to_keysymstr_table[keycode];
- if (keysymstr)
- enqueue_one_input_event (KEYSYM (keysymstr), carbon_modifiers_to_emacs_modifiers (modifiers));
- else
- enqueue_input (text, text_size / 2, modifiers);
- }
- else
- enqueue_input (text, text_size / 2, modifiers);
- }
- }
+ {
+ if (ascii_needs_keycode_lookup[text[0]])
+ {
+ char *keysymstr = keycode_to_keysymstr_table[keycode];
+ if (keysymstr)
+ enqueue_one_input_event (KEYSYM (keysymstr), carbon_modifiers_to_emacs_modifiers (modifiers));
+ else
+ enqueue_input (text, text_size / 2, modifiers);
+ }
+ else
+ enqueue_input (text, text_size / 2, modifiers);
+ }
+ return noErr;
}
- else
- enqueue_input (text, text_size / 2, modifiers);
-
+
+ enqueue_input (text, text_size / 2, modifiers);
return noErr;
}
@@ -503,8 +637,12 @@
stderr_out ("Can't convert to event record.\n");
OSErr s = AEProcessAppleEvent (&event_record);
- if (s != noErr && debug_carbon_events)
- stderr_out ("Apple event not processed (error = %d).\n", s);
+
+
+ if (s != noErr)
+ {
+ DEBUG_CARBON_EVENTS ("Apple event not processed (error = %d).\n", s);
+ }
}
static void
@@ -517,9 +655,9 @@
EventClass event_class = GetEventClass (event);
UInt32 event_kind = GetEventKind (event);
- stderr_out ("Event not sent to or ignored by target: ");
+ DEBUG_CARBON_EVENTS ("%s", "Event not sent to or ignored by target: ");
debug_print_event (event_class, event_kind);
- stderr_out ("\n");
+ DEBUG_CARBON_EVENTS ("%s", "\n");
}
}
@@ -922,6 +1060,10 @@
vars_of_event_carbon (void)
{
/* reinit_vars_of_event_carbon (); */
+ DEFVAR_LISP ("mac-command-key-is-meta", &Vmac_command_key_is_meta /*
+Non-nil means that the command key is used as the XEmacs meta key.
+Otherwise the option key is used. */ );
+ Vmac_command_key_is_meta = Qt;
}
void
Index: src/intl-carbon.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/Attic/intl-carbon.c,v
retrieving revision 1.1.2.3
diff -u -u -r1.1.2.3 intl-carbon.c
--- src/intl-carbon.c 2007/09/30 21:40:13 1.1.2.3
+++ src/intl-carbon.c 2007/10/19 06:58:10
@@ -20,13 +20,322 @@
#include <config.h>
#include "lisp.h"
+#include "text.h"
+#include <Carbon/Carbon.h>
+#include <ApplicationServices/ApplicationServices.h>
+
+Lisp_Object Vcarbon_current_language_unicode_set;
+
+#if !defined(__COREFOUNDATION_CFLOCALE__)
+typedef void* CFLocaleRef;
+#endif
+
+struct iso_lang_map
+{
+ Ascbyte* iso_code;
+ short mac_lang_code;
+ short mac_script_code;
+};
+
+typedef struct iso_lang_map iso_lang_map;
+
+iso_lang_map lang_list[] = {
+ { "sq", langAlbanian, smRoman },
+ { "am", langAmharic, smEthiopic },
+ { "ar", langArabic, smArabic },
+ { "hy", langArmenian, smArmenian},
+ { "as", langAssamese, smBengali },
+ { "ay", langAymara, smRoman},
+ { "eu", langBasque, smRoman},
+ { "bn", langBengali, smBengali },
+ { "dz", langDzongkha, smTibetan },
+ { "br", langBreton, smRoman },
+ { "bg", langBulgarian, smCyrillic },
+ { "my", langBurmese, smBurmese },
+ { "km", langKhmer, smKhmer },
+ { "ca", langCatalan, smRoman },
+ { "zh", langTradChinese, smTradChinese },
+ { "hr", langCroatian, smRoman },
+ { "cs", langCzech, smCentralEuroRoman },
+ { "da", langDanish, smRoman },
+ { "nl", langDutch, smRoman },
+ { "en", langEnglish, smRoman },
+ { "eo", langEsperanto, smRoman },
+ { "et", langEstonian, smCentralEuroRoman},
+ { "fo", langFaeroese, smRoman },
+ { "fa", langFarsi, smArabic },
+ { "fi", langFinnish, smRoman },
+ { "fr", langFrench, smRoman },
+ { "ka", langGeorgian, smGeorgian },
+ { "de", langGerman, smRoman },
+ { "el", langGreek, smGreek },
+ { "gn", langGuarani, smRoman },
+ { "gu", langGujarati, smGujarati },
+ { "he", langHebrew, smHebrew },
+ { "iw", langHebrew, smHebrew },
+ { "hu", langHungarian, smCentralEuroRoman },
+ { "is", langIcelandic, smRoman },
+ { "in", langIndonesian, smRoman },
+ { "id", langIndonesian, smRoman },
+ { "iu", langInuktitut, smEthiopic },
+ { "ga", langIrish, smRoman },
+ { "it", langItalian, smRoman },
+ { "ja", langJapanese, smJapanese },
+ { "jw", langJavaneseRom, smRoman },
+ { "kn", langKannada, smKannada },
+ { "ks", langKashmiri, smArabic },
+ { "kk", langKazakh, smCyrillic },
+ { "ky", langKirghiz, smCyrillic },
+ { "ko", langKorean, smKorean },
+ { "ku", langKurdish, smArabic },
+ { "lo", langLao, smLao },
+ { "la", langLatin, smRoman },
+ { "lv", langLatvian, smCentralEuroRoman },
+ { "lt", langLithuanian, smCentralEuroRoman },
+ { "mk", langMacedonian, smCyrillic },
+ { "mg", langMalagasy, smRoman },
+ { "ml", langMalayalam, smMalayalam },
+ { "mt", langMaltese, smRoman },
+ { "mr", langMarathi, smDevanagari },
+ { "mo", langMoldavian, smCyrillic },
+ { "ne", langNepali, smDevanagari },
+ { "no", langNorwegian, smRoman },
+ { "or", langOriya, smOriya },
+ { "om", langOromo, smEthiopic },
+ { "ps", langPashto, smArabic },
+ { "pl", langPolish, smCentralEuroRoman },
+ { "pt", langPortuguese, smRoman },
+ { "pa", langPunjabi, smGurmukhi },
+ { "ro", langRomanian, smRoman },
+ { "ru", langRussian, smCyrillic },
+ { "sa", langSanskrit, smDevanagari },
+ { "sr", langSerbian, smCyrillic },
+ { "sd", langSindhi, smArabic },
+ { "si", langSinhalese, smSinhalese },
+ { "sk", langSlovak, smCentralEuroRoman },
+ { "sl", langSlovenian, smRoman },
+ { "so", langSomali, smRoman },
+ { "es", langSpanish, smRoman },
+ { "su", langSundaneseRom, smRoman },
+ { "sw", langSwahili, smRoman },
+ { "sv", langSwedish, smRoman },
+ { "tl", langTagalog, smRoman },
+ { "tg", langTajiki, smCyrillic },
+ { "ta", langTamil, smTamil },
+ { "tt", langTatar, smCyrillic },
+ { "te", langTelugu, smTelugu },
+ { "th", langThai, smThai },
+ { "bo", langTibetan, smTibetan },
+ { "ti", langTigrinya, smEthiopic },
+ { "tr", langTurkish, smRoman },
+ { "tk", langTurkmen, smCyrillic },
+ { "ug", langUighur, smCyrillic },
+ { "uk", langUkrainian, smCyrillic },
+ { "ur", langUrdu, smArabic },
+ { "uz", langUzbek, smCyrillic },
+ { "vi", langVietnamese, smVietnamese },
+ { "cy", langWelsh, smRoman },
+ { "ji", langYiddish, smHebrew },
+ { "yi", langYiddish, smHebrew },
+ { NULL, 0, 0}
+};
+
+struct iso_country_map
+{
+ Ascbyte* iso_code;
+ short mac_region_code;
+};
+
+typedef struct iso_country_map iso_country_map;
+
+iso_country_map country_list[] = {
+ { "US", verUS},
+ { "EG", verArabic},
+ { "DZ", verArabic},
+ { "AU", verAustralia},
+ { "BE", verFrBelgium },
+ { "CA", verEngCanada },
+ { "CN", verChina },
+ { "HR", verYugoCroatian },
+ { "CY", verCyprus },
+ { "DK", verDenmark },
+ { "EE", verEstonia },
+ { "FI", verFinland },
+ { "FR", verFrance },
+ { "DE", verGermany },
+ { "EL", verGreece },
+ { "HU", verHungary },
+ { "IS", verIceland },
+ { "IN", verIndiaHindi},
+ { "IR", verIran },
+ { "IQ", verArabic },
+ { "IE", verIreland },
+ { "IL", verIsrael },
+ { "IT", verItaly },
+ { "JP", verJapan },
+ { "KP", verKorea },
+ { "LV", verLatvia },
+ { "LY", verArabic },
+ { "LT", verLithuania },
+ { "LU", verFrBelgiumLux },
+ { "MT", verMalta },
+ { "MA", verArabic },
+ { "NL", verNetherlands },
+ { "NO", verNorway },
+ { "PK", verPakistan },
+ { "PL", verPoland },
+ { "PT", verPortugal },
+ { "RU", verRussia },
+ { "SA", verArabic },
+ { "ES", verSpain },
+ { "SE", verSweden },
+ { "CH", verFrSwiss },
+ { "TW", verTaiwan},
+ { "TH", verThailand },
+ { "TN", verArabic},
+ { "TR", verTurkey },
+ { "GB", verBritain },
+ { NULL, 0 }
+};
+
+typedef CFLocaleRef (*fpCFLocaleCopyCurrent_type) (void);
+typedef CFStringRef (*fpCFLocaleGetIdentifier_type) (CFLocaleRef);
+
+static Ibyte *
+carbon_get_pseudo_posix_locale (short scriptCode, short langCode, short regionCode)
+{
+ int i;
+ Bytecount len;
+ int validResultFound = 0;
+ DECLARE_EISTRING (res);
+
+ /* parse language */
+ for (i=0; NULL != lang_list[i].iso_code; i++)
+ {
+ if (langCode == lang_list[i].mac_lang_code &&
+ scriptCode == lang_list[i].mac_script_code)
+ {
+ eicpy_ascii (res, lang_list[i].iso_code);
+ validResultFound = true;
+ break;
+ }
+ }
+
+ /* parse region */
+ for (i=0; NULL != country_list[i].iso_code; i++)
+ {
+ if (regionCode==country_list[i].mac_region_code)
+ {
+ eicat_ch (res, '-');
+ eicat_ascii (res, country_list[i].iso_code);
+ validResultFound = true;
+ break;
+ }
+ }
+
+ if (validResultFound)
+ {
+ len = eilen (res);
+ return eicpyout_malloc (res, &len);
+ }
+
+ return NULL;
+}
+
Lisp_Object Qcarbon_unicode;
+DEFUN ("carbon-current-locale", Fcarbon_current_locale, 0, 0, 0, /*
+Return the current OS X locale.
+
+This reflects the locale used by the Carbon programs on your system, and
+follows the POSIX format, that is, ab_BC, where ab is a language code and BC
+is a country code.
+*/
+ ())
+{
+ /* On MacOSX, the recommended way to get the user's current locale is to use
+ the CFLocale APIs. However, these are only available on 10.3 and later.
+ So for the older systems, we have to keep using the Script Manager APIs. */
+ static int checked = 0;
+ static fpCFLocaleCopyCurrent_type fpCFLocaleCopyCurrent = NULL;
+ static fpCFLocaleGetIdentifier_type fpCFLocaleGetIdentifier = NULL;
+ Lisp_Object res = Qnil;
+
+ if (!checked)
+ {
+ CFBundleRef bundle =
+ CFBundleGetBundleWithIdentifier(CFSTR("com.apple.Carbon"));
+ if (bundle)
+ {
+ // We dynamically load these two functions and only use them if
+ // they are available (OS 10.3+).
+ fpCFLocaleCopyCurrent = (fpCFLocaleCopyCurrent_type)
+ CFBundleGetFunctionPointerForName(bundle,
+ CFSTR("CFLocaleCopyCurrent"));
+ fpCFLocaleGetIdentifier = (fpCFLocaleGetIdentifier_type)
+ CFBundleGetFunctionPointerForName(bundle,
+ CFSTR("CFLocaleGetIdentifier"));
+ }
+ checked = 1;
+ }
+
+ if (fpCFLocaleCopyCurrent)
+ {
+ // Get string representation of user's current locale
+ CFLocaleRef userLocaleRef = fpCFLocaleCopyCurrent();
+ CFStringRef userLocaleStr = fpCFLocaleGetIdentifier(userLocaleRef);
+ int size;
+ Extbyte *buf;
+
+ CFRetain(userLocaleStr);
+
+ size = CFStringGetLength(userLocaleStr);
+ size = (size + 1) * 2;
+ buf = alloca_extbytes (size);
+
+ if (!CFStringGetCString (userLocaleStr, (char *) buf, size,
+ kCFStringEncodingUnicode))
+ {
+ signal_error (Qtext_conversion_error,
+ "Error converting from Carbon text format for locale",
+ Qunbound);
+ }
+
+ res = make_ext_string (buf, size - 2, Qcarbon_unicode);
+
+ CFRelease(userLocaleStr);
+ CFRelease(userLocaleRef);
+ }
+ else
+ {
+ /* Legacy MacOSX locale code */
+ long script = GetScriptManagerVariable(smSysScript);
+ long lang = GetScriptVariable(smSystemScript,smScriptLang);
+ long region = GetScriptManagerVariable(smRegionCode);
+
+ Ibyte *text = carbon_get_pseudo_posix_locale((short)script, (short)lang,
+ (short)region);
+ if (text)
+ {
+ res = make_string (text, qxestrlen(text));
+ }
+ }
+ return res;
+}
+
void
syms_of_intl_carbon (void)
{
+ DEFSUBR (Fcarbon_current_locale);
DEFSYMBOL (Qcarbon_unicode);
+ DEFVAR_LISP ("carbon-current-language-unicode-set",
+ &Vcarbon_current_language_unicode_set /*
+Hash table mapping those Unicode code points needed for the current langenv to t.
+
+Can also be nil; if it is non-nil will normally include all of ASCII.
+*/);
+ Vcarbon_current_language_unicode_set = Qnil;
}
void
Index: src/scrollbar-carbon.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/Attic/scrollbar-carbon.c,v
retrieving revision 1.1.2.3
diff -u -u -r1.1.2.3 scrollbar-carbon.c
--- src/scrollbar-carbon.c 2007/09/30 19:48:31 1.1.2.3
+++ src/scrollbar-carbon.c 2007/10/19 06:58:10
@@ -307,7 +307,7 @@
}
static void
-carbon_update_scrollbar_instance_status (struct window *w, int active, int size, struct scrollbar_instance *sb)
+carbon_update_scrollbar_instance_status (struct window * UNUSED (w), int active, int size, struct scrollbar_instance *sb)
{
SetControlVisibility ((ControlRef) sb->scrollbar_data, active && size, TRUE);
}
--
On the quay of the little Black Sea port, where the rescued pair came once
more into contact with civilization, Dobrinton was bitten by a dog which was
assumed to be mad, though it may only have been indiscriminating. (Saki)
>
> Thanks,
>
> Rodney
>
> -----Original Message-----
> From: Aidan Kehoe [mailto:kehoea@parhasard.net]
> Sent: Thu 10/18/2007 4:53 PM
> To: xemacs-patches(a)xemacs.org
> Cc: Sparapani, Rodney
> Subject: [PATCH] Add Carbon-specific locale-determination code; respect the locale with mac-command-key-is-meta behaviour
>
>
> I don't propose to commit this right now, but I suppose it's worth posting
> as a putative solution on the lines of
> http://mid.gmane.org/18187.60360.900893.282407@parhasard.net .
>
> lisp/ChangeLog addition:
>
> 2007-10-18 Aidan Kehoe <kehoea(a)parhasard.net>
>
> * mule/mule-cmds.el (init-locale-at-early-startup):
> Use the Carbon locale if it is available.
> * mule/mule-cmds.el (init-mule-at-startup):
> Init carbon-current-language-unicode-set from the current language
> environment's input method if necessary
>
>
> src/ChangeLog addition:
>
> 2007-10-18 Aidan Kehoe <kehoea(a)parhasard.net>
>
> * event-carbon.c:
> Add much more debugging infrastructure.
> * event-carbon.c (carbon_modifiers_to_emacs_modifiers):
> Support the Option key as meta.
> * event-carbon.c (retranslate_option):
> Add; retranslate the option key if that is appropriate, that is,
> if the character generated with option both:
>
> 1. Differs from the character generated without option and
> 2. Is either ASCII (because our users are programmers) or is necessary to
> write the currently active language
>
> then option + char-without-option should generate char-with-option;
> otherwise option + char-without-option should generate
> M-char-without-option.
>
> * event-carbon.c (text_input_event_handler):
> * event-carbon.c (handle_apple_event):
> * event-carbon.c (generic_send_event_to_target):
> * event-carbon.c (vars_of_event_carbon):
> Provide mac-command-key-is-meta.
>
> * intl-carbon.c:
> * intl-carbon.c (carbon_get_pseudo_posix_locale):
> New function, to pull a simulacrum of the current Carbon locale in
> POSIX form based on the script, language and region codes.
> * intl-carbon.c (Fcarbon_current_locale):
> New function, on the model of mswindows-current-locale; algorithm
> and code based on that of Mozilla.
> * intl-carbon.c (syms_of_intl_carbon):
> Make carbon-current-locale available.
> * scrollbar-carbon.c (carbon_update_scrollbar_instance_status):
> First argument is unused, mark it as so for the sake of the
> compiler.
>
>
> XEmacs Trunk source patch:
> Diff command: cvs -q diff -Nu
> Files affected: src/scrollbar-carbon.c
> ===================================================================
> RCS src/intl-carbon.c
> ===================================================================
> RCS src/event-carbon.c
> ===================================================================
> RCS lisp/mule/mule-cmds.el
> ===================================================================
> RCS
>
> Index: lisp/mule/mule-cmds.el
> ===================================================================
> RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/mule/mule-cmds.el,v
> retrieving revision 1.23.2.1
> diff -u -u -r1.23.2.1 mule-cmds.el
> --- lisp/mule/mule-cmds.el 2007/09/30 18:33:20 1.23.2.1
> +++ lisp/mule/mule-cmds.el 2007/10/18 21:44:11
> @@ -1464,17 +1464,25 @@
> (declare-fboundp (mswindows-set-current-locale userdef)))
> ;; Unix:
> (let (locstring)
> - ;; Init the POSIX locale from the environment--this calls the C
> - ;; library's setlocale(3).
> - (set-current-locale "")
> - ;; Can't let locstring be the result of (set-current-locale "")
> - ;; because that can return a more detailed string than we know how
> - ;; to handle.
> - (setq locstring (current-locale)
> - ;; assume C lib locale and LANG env var are set correctly.
> - ;; use them to find the langenv.
> - langenv
> - (and locstring (get-language-environment-from-locale
> + (unless (and-fboundp
> + #'carbon-current-locale
> + ;; If Carbon provides us with the locale string, we want
> + ;; to use that, instead of the code that checks the
> + ;; C environment below.
> + (setq locstring
> + (carbon-current-locale)))
> + ;; Init the POSIX locale from the environment--this calls the C
> + ;; library's setlocale(3).
> + (set-current-locale "")
> + ;; Can't let locstring be the result of (set-current-locale "")
> + ;; because that can return a more detailed string than we know how
> + ;; to handle.
> + (setq locstring (current-locale)))
> +
> + ;; assume C lib locale and LANG env var are set correctly.
> + ;; use them to find the langenv.
> + (setq langenv
> + (and locstring (get-language-environment-from-locale
> locstring)))))
> ;; All systems:
> (unless langenv (setq langenv "English"))
> @@ -1515,8 +1523,36 @@
> (setq Manual-use-rosetta-man nil))
>
> ;; Register available input methods by loading LEIM list file.
> - (load "leim-list.el" 'noerror 'nomessage 'nosuffix)
> - )
> + (load leim-list-file-name 'noerror 'nomessage 'nosuffix)
> +
> + (when-boundp 'carbon-current-language-unicode-set
> + (unless carbon-current-language-unicode-set
> + (setq carbon-current-language-unicode-set
> + (make-hash-table :size 256)))
> + (loop
> + for i from #x20 to #x7e
> + do (puthash i t carbon-current-language-unicode-set))
> + (let ((input-method (get-language-info current-language-environment 'input-method)))
> + (when (assoc input-method input-method-alist)
> + (flet ((map-tree
> + (tree)
> + (loop for branch in tree
> + do
> + (cond ((consp branch)
> + (map-tree branch))
> + ((or (stringp branch) (vectorp branch))
> + (map-tree (append branch nil)))
> + ((characterp branch)
> + (unless (< branch #x80)
> + (puthash (encode-char branch 'ucs) t
> + carbon-current-language-unicode-set))))))
> + (append-message (&rest args) ())
> + (clear-message (&rest args) ()))
> + (set-input-method input-method)
> + (loop for mapped in (mapcar #'cdr (cdr (quail-map)))
> + do
> + (map-tree mapped)))
> + (inactivate-input-method)))))
>
> ;; Code deleted: init-mule-tm (Enable the tm package by default)
>
> Index: src/event-carbon.c
> ===================================================================
> RCS file: /pack/xemacscvs/XEmacs/xemacs/src/Attic/event-carbon.c,v
> retrieving revision 1.1.2.3
> diff -u -u -r1.1.2.3 event-carbon.c
> --- src/event-carbon.c 2007/09/30 19:48:26 1.1.2.3
> +++ src/event-carbon.c 2007/10/18 21:44:11
> @@ -30,13 +30,31 @@
>
> #include "console-carbon-impl.h"
>
> +#ifdef DEBUG_XEMACS
> +static Fixnum debug_carbon_events;
> +# define DEBUG_CARBON_EVENTS(FORMAT, ...) \
> + do { if (debug_carbon_events) stderr_out(FORMAT, __VA_ARGS__); } while (0)
> +#else /* DEBUG_XEMACS */
> +# define DEBUG_CARBON_EVENTS(format, ...)
> +#endif /* DEBUG_XEMACS */
> +
> +
> +#ifdef DEBUG_XEMACS
> +extern Fixnum debug_emacs_events;
> +#endif
> +
> EXFUN (Funicode_to_char, 2); /* In unicode.c. */
>
> +extern Lisp_Object Vcarbon_current_language_unicode_set;
> +
> extern Lisp_Object Qcarbon_unicode; /* From intl-carbon.c. */
>
> extern SELECT_TYPE process_only_mask; /* From event-unixoid.c. */
> extern int track_mouse_down_on_scrollbar (void); /* from scrollbar-carbon.c. */
>
> +/* true if using command key as meta key */
> +Lisp_Object Vmac_command_key_is_meta;
> +
> static struct event_stream *carbon_event_stream;
>
> static Lisp_Object carbon_user_event_queue;
> @@ -50,8 +68,6 @@
>
> static EventLoopTimerUPP timer_proc_UPP;
>
> -static int debug_carbon_events = 0;
> -
> /* Used in frame-carbon.c. */
> void carbon_enqueue_user_event (Lisp_Object);
>
> @@ -250,7 +266,7 @@
> {
> int emacs_modifiers = 0;
>
> - if (modifiers & cmdKey)
> + if (modifiers & (NILP (Vmac_command_key_is_meta) ? optionKey : cmdKey))
> emacs_modifiers |= XEMACS_MOD_META;
> if (modifiers & controlKey)
> emacs_modifiers |= XEMACS_MOD_CONTROL;
> @@ -343,6 +359,108 @@
> }
> }
>
> +static void
> +retranslate_option (EventRef keyboard_event, UInt32 modifiers,
> + UniChar *text, UInt32 text_size)
> +{
> + UInt32 new_modifiers = modifiers & ~optionKey;
> + UInt32 keycode;
> + KeyboardLayoutRef layoutRef;
> + KeyboardLayoutKind layout_kind;
> +
> + GetEventParameter (keyboard_event, kEventParamKeyCode, typeUInt32, NULL,
> + sizeof (keycode), NULL, &keycode);
> +
> + if (KLGetCurrentKeyboardLayout (&layoutRef) != noErr)
> + invalid_operation ("Can't get keyboard layout ref", Qunbound);
> +
> + if (KLGetKeyboardLayoutProperty (layoutRef, kKLKind,
> + (const void **)&layout_kind) != noErr)
> + invalid_operation ("Can't get keyboard layout kind", Qunbound);
> +
> + /* Depending on whether KCHR or uchr keyboard layout data is
> + available, call KeyTranslate or UCKeyTranslate to determine the
> + actual character code that should be enqueued. */
> + if (layout_kind == kKLKCHRKind)
> + {
> + void *kchr_ptr;
> + UInt16 new_keycode;
> + static UInt32 deadKeyState = 0;
> + UniChar char_code;
> +
> + DEBUG_CARBON_EVENTS ("%s", "layout kind is KCHR\n");
> +
> + if (KLGetKeyboardLayoutProperty (layoutRef, kKLKCHRData,
> + (const void **)&kchr_ptr) != noErr)
> + invalid_operation ("Can't get KCHR keyboard layout", Qunbound);
> +
> + new_keycode = new_modifiers & 0xff00;
> +
> + if (GetEventKind (keyboard_event) == kEventRawKeyUp)
> + new_keycode |= (1 << 7);
> +
> + new_keycode |= (keycode & 0x7f);
> +
> + deadKeyState = 0;
> + char_code = KeyTranslate (kchr_ptr, new_keycode, &deadKeyState);
> +
> + DEBUG_CARBON_EVENTS ("char_code is %x, text[0] is %x, check is %x\n",
> + char_code, text[0],
> + (!NILP (Vcarbon_current_language_unicode_set) &&
> + !NILP (Fgethash (make_int (text[0]),
> + Vcarbon_current_language_unicode_set, Qnil))));
> +
> + if (2 == text_size && char_code != text[0] &&
> + (!NILP (Vcarbon_current_language_unicode_set) &&
> + !NILP (Fgethash (make_int (text[0]),
> + Vcarbon_current_language_unicode_set, Qnil))))
> + {
> + DEBUG_CARBON_EVENTS ("%s", "with a normal keylayout, are modifying event\n");
> + enqueue_input (text, text_size / 2, new_modifiers);
> + }
> + else
> + {
> + DEBUG_CARBON_EVENTS ("%s", "with a normal keylayout, not modifying event\n");
> + enqueue_input (&char_code, 1, modifiers);
> + }
> + }
> + else /* layout_kind == kKLuchrKind || layout_kind == kKLKCHRuchrKind */
> + {
> + UCKeyboardLayout *layout;
> + static UInt32 deadKeyState = 0;
> + UniChar output[16];
> + UniCharCount output_length;
> +
> + DEBUG_CARBON_EVENTS ("%s", "layout kind is Unicode\n");
> +
> + if (KLGetKeyboardLayoutProperty (layoutRef, kKLuchrData,
> + (const void**)&layout) != noErr)
> + invalid_operation ("Can't get uchr keyboard layout", Qunbound);
> +
> + if (UCKeyTranslate (layout, keycode, kUCKeyActionDown, new_modifiers >> 8,
> + LMGetKbdType (), 0, &deadKeyState, 16,
> + &output_length, output) != noErr)
> + invalid_operation ("Can't translate key using uchr", Qunbound);
> +
> + DEBUG_CARBON_EVENTS ("output[0] is %x, text[0] is %x\n", output[0], text[0]);
> +
> +
> + if (2 == text_size && char_code != text[0] &&
> + (!NILP (Vcarbon_current_language_unicode_set) &&
> + !NILP (Fgethash (make_int (text[0]),
> + Vcarbon_current_language_unicode_set, Qnil))))
> + {
> + DEBUG_CARBON_EVENTS ("%s", "with a normal keylayout, are modifying event\n");
> + enqueue_input (text, text_size / 2, new_modifiers);
> + }
> + else
> + {
> + DEBUG_CARBON_EVENTS ("%s", "with a normal keylayout, not modifying event\n");
> + enqueue_input (&char_code, 1, modifiers);
> + }
> + }
> +}
> +
> static char *ascii_to_keysymstr_table[] = {
> /*0x00*/ 0, "home", 0, "kp-enter", "end", "help", 0, 0,
> /*0x08*/ "backspace", "tab", 0, "prior", "next", "return", 0, 0,
> @@ -419,34 +537,49 @@
> UniChar *text = (UniChar *)alloca_extbytes (text_size);
> if (GetEventParameter (event, kEventParamTextInputSendText, typeUnicodeText, NULL, text_size, NULL, text) != noErr)
> invalid_operation ("Can't get input text", Qunbound);
> +
> + DEBUG_CARBON_EVENTS ("modifiers are %x, keycode is %x, text_size is %x\n",
> + modifiers, keycode, text_size);
> + DEBUG_CARBON_EVENTS ("optionKey is %x\n",
> + optionKey);
> +
> + if (text_size == 2 && text[0] <= 127 &&
> + (modifiers & (controlKey | cmdKey)) && keycode_needs_retranslate[keycode])
> + {
> + retranslate_keycode (keyboard_event, modifiers);
> + return noErr;
> + }
>
> + if (NILP(Vmac_command_key_is_meta) && (modifiers & optionKey))
> + {
> + DEBUG_CARBON_EVENTS ("%s",
> + "command key is not meta, and the modifiers include option\n");
> + retranslate_option (keyboard_event, modifiers, text, text_size);
> + return noErr;
> + }
> +
> if (text_size == 2 && text[0] <= 127)
> {
> - if ((modifiers & (controlKey | cmdKey)) && keycode_needs_retranslate[keycode])
> - retranslate_keycode (keyboard_event, modifiers);
> + char *keysymstr = ascii_to_keysymstr_table[text[0]];
> + if (keysymstr)
> + enqueue_one_input_event (KEYSYM (keysymstr), carbon_modifiers_to_emacs_modifiers (modifiers));
> else
> - {
> - char *keysymstr = ascii_to_keysymstr_table[text[0]];
> - if (keysymstr)
> - enqueue_one_input_event (KEYSYM (keysymstr), carbon_modifiers_to_emacs_modifiers (modifiers));
> - else
> - {
> - if (ascii_needs_keycode_lookup[text[0]])
> - {
> - char *keysymstr = keycode_to_keysymstr_table[keycode];
> - if (keysymstr)
> - enqueue_one_input_event (KEYSYM (keysymstr), carbon_modifiers_to_emacs_modifiers (modifiers));
> - else
> - enqueue_input (text, text_size / 2, modifiers);
> - }
> - else
> - enqueue_input (text, text_size / 2, modifiers);
> - }
> - }
> + {
> + if (ascii_needs_keycode_lookup[text[0]])
> + {
> + char *keysymstr = keycode_to_keysymstr_table[keycode];
> + if (keysymstr)
> + enqueue_one_input_event (KEYSYM (keysymstr), carbon_modifiers_to_emacs_modifiers (modifiers));
> + else
> + enqueue_input (text, text_size / 2, modifiers);
> + }
> + else
> + enqueue_input (text, text_size / 2, modifiers);
> + }
> + return noErr;
> }
> - else
> - enqueue_input (text, text_size / 2, modifiers);
> -
> +
> + enqueue_input (text, text_size / 2, modifiers);
> return noErr;
> }
>
> @@ -503,8 +636,12 @@
> stderr_out ("Can't convert to event record.\n");
>
> OSErr s = AEProcessAppleEvent (&event_record);
> - if (s != noErr && debug_carbon_events)
> - stderr_out ("Apple event not processed (error = %d).\n", s);
> +
> +
> + if (s != noErr)
> + {
> + DEBUG_CARBON_EVENTS ("Apple event not processed (error = %d).\n", s);
> + }
> }
>
> static void
> @@ -517,9 +654,9 @@
> EventClass event_class = GetEventClass (event);
> UInt32 event_kind = GetEventKind (event);
>
> - stderr_out ("Event not sent to or ignored by target: ");
> + DEBUG_CARBON_EVENTS ("%s", "Event not sent to or ignored by target: ");
> debug_print_event (event_class, event_kind);
> - stderr_out ("\n");
> + DEBUG_CARBON_EVENTS ("%s", "\n");
> }
> }
>
> @@ -922,6 +1059,10 @@
> vars_of_event_carbon (void)
> {
> /* reinit_vars_of_event_carbon (); */
> + DEFVAR_LISP ("mac-command-key-is-meta", &Vmac_command_key_is_meta /*
> +Non-nil means that the command key is used as the XEmacs meta key.
> +Otherwise the option key is used. */ );
> + Vmac_command_key_is_meta = Qt;
> }
>
> void
> Index: src/intl-carbon.c
> ===================================================================
> RCS file: /pack/xemacscvs/XEmacs/xemacs/src/Attic/intl-carbon.c,v
> retrieving revision 1.1.2.3
> diff -u -u -r1.1.2.3 intl-carbon.c
> --- src/intl-carbon.c 2007/09/30 21:40:13 1.1.2.3
> +++ src/intl-carbon.c 2007/10/18 21:44:12
> @@ -20,13 +20,322 @@
>
> #include <config.h>
> #include "lisp.h"
> +#include "text.h"
>
> +#include <Carbon/Carbon.h>
> +#include <ApplicationServices/ApplicationServices.h>
> +
> +Lisp_Object Vcarbon_current_language_unicode_set;
> +
> +#if !defined(__COREFOUNDATION_CFLOCALE__)
> +typedef void* CFLocaleRef;
> +#endif
> +
> +struct iso_lang_map
> +{
> + Ascbyte* iso_code;
> + short mac_lang_code;
> + short mac_script_code;
> +};
> +
> +typedef struct iso_lang_map iso_lang_map;
> +
> +iso_lang_map lang_list[] = {
> + { "sq", langAlbanian, smRoman },
> + { "am", langAmharic, smEthiopic },
> + { "ar", langArabic, smArabic },
> + { "hy", langArmenian, smArmenian},
> + { "as", langAssamese, smBengali },
> + { "ay", langAymara, smRoman},
> + { "eu", langBasque, smRoman},
> + { "bn", langBengali, smBengali },
> + { "dz", langDzongkha, smTibetan },
> + { "br", langBreton, smRoman },
> + { "bg", langBulgarian, smCyrillic },
> + { "my", langBurmese, smBurmese },
> + { "km", langKhmer, smKhmer },
> + { "ca", langCatalan, smRoman },
> + { "zh", langTradChinese, smTradChinese },
> + { "hr", langCroatian, smRoman },
> + { "cs", langCzech, smCentralEuroRoman },
> + { "da", langDanish, smRoman },
> + { "nl", langDutch, smRoman },
> + { "en", langEnglish, smRoman },
> + { "eo", langEsperanto, smRoman },
> + { "et", langEstonian, smCentralEuroRoman},
> + { "fo", langFaeroese, smRoman },
> + { "fa", langFarsi, smArabic },
> + { "fi", langFinnish, smRoman },
> + { "fr", langFrench, smRoman },
> + { "ka", langGeorgian, smGeorgian },
> + { "de", langGerman, smRoman },
> + { "el", langGreek, smGreek },
> + { "gn", langGuarani, smRoman },
> + { "gu", langGujarati, smGujarati },
> + { "he", langHebrew, smHebrew },
> + { "iw", langHebrew, smHebrew },
> + { "hu", langHungarian, smCentralEuroRoman },
> + { "is", langIcelandic, smRoman },
> + { "in", langIndonesian, smRoman },
> + { "id", langIndonesian, smRoman },
> + { "iu", langInuktitut, smEthiopic },
> + { "ga", langIrish, smRoman },
> + { "it", langItalian, smRoman },
> + { "ja", langJapanese, smJapanese },
> + { "jw", langJavaneseRom, smRoman },
> + { "kn", langKannada, smKannada },
> + { "ks", langKashmiri, smArabic },
> + { "kk", langKazakh, smCyrillic },
> + { "ky", langKirghiz, smCyrillic },
> + { "ko", langKorean, smKorean },
> + { "ku", langKurdish, smArabic },
> + { "lo", langLao, smLao },
> + { "la", langLatin, smRoman },
> + { "lv", langLatvian, smCentralEuroRoman },
> + { "lt", langLithuanian, smCentralEuroRoman },
> + { "mk", langMacedonian, smCyrillic },
> + { "mg", langMalagasy, smRoman },
> + { "ml", langMalayalam, smMalayalam },
> + { "mt", langMaltese, smRoman },
> + { "mr", langMarathi, smDevanagari },
> + { "mo", langMoldavian, smCyrillic },
> + { "ne", langNepali, smDevanagari },
> + { "no", langNorwegian, smRoman },
> + { "or", langOriya, smOriya },
> + { "om", langOromo, smEthiopic },
> + { "ps", langPashto, smArabic },
> + { "pl", langPolish, smCentralEuroRoman },
> + { "pt", langPortuguese, smRoman },
> + { "pa", langPunjabi, smGurmukhi },
> + { "ro", langRomanian, smRoman },
> + { "ru", langRussian, smCyrillic },
> + { "sa", langSanskrit, smDevanagari },
> + { "sr", langSerbian, smCyrillic },
> + { "sd", langSindhi, smArabic },
> + { "si", langSinhalese, smSinhalese },
> + { "sk", langSlovak, smCentralEuroRoman },
> + { "sl", langSlovenian, smRoman },
> + { "so", langSomali, smRoman },
> + { "es", langSpanish, smRoman },
> + { "su", langSundaneseRom, smRoman },
> + { "sw", langSwahili, smRoman },
> + { "sv", langSwedish, smRoman },
> + { "tl", langTagalog, smRoman },
> + { "tg", langTajiki, smCyrillic },
> + { "ta", langTamil, smTamil },
> + { "tt", langTatar, smCyrillic },
> + { "te", langTelugu, smTelugu },
> + { "th", langThai, smThai },
> + { "bo", langTibetan, smTibetan },
> + { "ti", langTigrinya, smEthiopic },
> + { "tr", langTurkish, smRoman },
> + { "tk", langTurkmen, smCyrillic },
> + { "ug", langUighur, smCyrillic },
> + { "uk", langUkrainian, smCyrillic },
> + { "ur", langUrdu, smArabic },
> + { "uz", langUzbek, smCyrillic },
> + { "vi", langVietnamese, smVietnamese },
> + { "cy", langWelsh, smRoman },
> + { "ji", langYiddish, smHebrew },
> + { "yi", langYiddish, smHebrew },
> + { NULL, 0, 0}
> +};
> +
> +struct iso_country_map
> +{
> + Ascbyte* iso_code;
> + short mac_region_code;
> +};
> +
> +typedef struct iso_country_map iso_country_map;
> +
> +iso_country_map country_list[] = {
> + { "US", verUS},
> + { "EG", verArabic},
> + { "DZ", verArabic},
> + { "AU", verAustralia},
> + { "BE", verFrBelgium },
> + { "CA", verEngCanada },
> + { "CN", verChina },
> + { "HR", verYugoCroatian },
> + { "CY", verCyprus },
> + { "DK", verDenmark },
> + { "EE", verEstonia },
> + { "FI", verFinland },
> + { "FR", verFrance },
> + { "DE", verGermany },
> + { "EL", verGreece },
> + { "HU", verHungary },
> + { "IS", verIceland },
> + { "IN", verIndiaHindi},
> + { "IR", verIran },
> + { "IQ", verArabic },
> + { "IE", verIreland },
> + { "IL", verIsrael },
> + { "IT", verItaly },
> + { "JP", verJapan },
> + { "KP", verKorea },
> + { "LV", verLatvia },
> + { "LY", verArabic },
> + { "LT", verLithuania },
> + { "LU", verFrBelgiumLux },
> + { "MT", verMalta },
> + { "MA", verArabic },
> + { "NL", verNetherlands },
> + { "NO", verNorway },
> + { "PK", verPakistan },
> + { "PL", verPoland },
> + { "PT", verPortugal },
> + { "RU", verRussia },
> + { "SA", verArabic },
> + { "ES", verSpain },
> + { "SE", verSweden },
> + { "CH", verFrSwiss },
> + { "TW", verTaiwan},
> + { "TH", verThailand },
> + { "TN", verArabic},
> + { "TR", verTurkey },
> + { "GB", verBritain },
> + { NULL, 0 }
> +};
> +
> +typedef CFLocaleRef (*fpCFLocaleCopyCurrent_type) (void);
> +typedef CFStringRef (*fpCFLocaleGetIdentifier_type) (CFLocaleRef);
> +
> +static Ibyte *
> +carbon_get_pseudo_posix_locale (short scriptCode, short langCode, short regionCode)
> +{
> + int i;
> + Bytecount len;
> + int validResultFound = 0;
> + DECLARE_EISTRING (res);
> +
> + /* parse language */
> + for (i=0; NULL != lang_list[i].iso_code; i++)
> + {
> + if (langCode == lang_list[i].mac_lang_code &&
> + scriptCode == lang_list[i].mac_script_code)
> + {
> + eicpy_ascii (res, lang_list[i].iso_code);
> + validResultFound = true;
> + break;
> + }
> + }
> +
> + /* parse region */
> + for (i=0; NULL != country_list[i].iso_code; i++)
> + {
> + if (regionCode==country_list[i].mac_region_code)
> + {
> + eicat_ch (res, '-');
> + eicat_ascii (res, country_list[i].iso_code);
> + validResultFound = true;
> + break;
> + }
> + }
> +
> + if (validResultFound)
> + {
> + len = eilen (res);
> + return eicpyout_malloc (res, &len);
> + }
> +
> + return NULL;
> +}
> +
> Lisp_Object Qcarbon_unicode;
>
> +DEFUN ("carbon-current-locale", Fcarbon_current_locale, 0, 0, 0, /*
> +Return the current OS X locale.
> +
> +This reflects the locale used by the Carbon programs on your system, and
> +follows the POSIX format, that is, ab_BC, where ab is a language code and BC
> +is a country code.
> +*/
> + ())
> +{
> + /* On MacOSX, the recommended way to get the user's current locale is to use
> + the CFLocale APIs. However, these are only available on 10.3 and later.
> + So for the older systems, we have to keep using the Script Manager APIs. */
> + static int checked = 0;
> + static fpCFLocaleCopyCurrent_type fpCFLocaleCopyCurrent = NULL;
> + static fpCFLocaleGetIdentifier_type fpCFLocaleGetIdentifier = NULL;
> + Lisp_Object res = Qnil;
> +
> + if (!checked)
> + {
> + CFBundleRef bundle =
> + CFBundleGetBundleWithIdentifier(CFSTR("com.apple.Carbon"));
> + if (bundle)
> + {
> + // We dynamically load these two functions and only use them if
> + // they are available (OS 10.3+).
> + fpCFLocaleCopyCurrent = (fpCFLocaleCopyCurrent_type)
> + CFBundleGetFunctionPointerForName(bundle,
> + CFSTR("CFLocaleCopyCurrent"));
> + fpCFLocaleGetIdentifier = (fpCFLocaleGetIdentifier_type)
> + CFBundleGetFunctionPointerForName(bundle,
> + CFSTR("CFLocaleGetIdentifier"));
> + }
> + checked = 1;
> + }
> +
> + if (fpCFLocaleCopyCurrent)
> + {
> + // Get string representation of user's current locale
> + CFLocaleRef userLocaleRef = fpCFLocaleCopyCurrent();
> + CFStringRef userLocaleStr = fpCFLocaleGetIdentifier(userLocaleRef);
> + int size;
> + Extbyte *buf;
> +
> + CFRetain(userLocaleStr);
> +
> + size = CFStringGetLength(userLocaleStr);
> + size = (size + 1) * 2;
> + buf = alloca_extbytes (size);
> +
> + if (!CFStringGetCString (userLocaleStr, (char *) buf, size,
> + kCFStringEncodingUnicode))
> + {
> + signal_error (Qtext_conversion_error,
> + "Error converting from Carbon text format for locale",
> + Qunbound);
> + }
> +
> + res = make_ext_string (buf, size - 2, Qcarbon_unicode);
> +
> + CFRelease(userLocaleStr);
> + CFRelease(userLocaleRef);
> + }
> + else
> + {
> + /* Legacy MacOSX locale code */
> + long script = GetScriptManagerVariable(smSysScript);
> + long lang = GetScriptVariable(smSystemScript,smScriptLang);
> + long region = GetScriptManagerVariable(smRegionCode);
> +
> + Ibyte *text = carbon_get_pseudo_posix_locale((short)script, (short)lang,
> + (short)region);
> + if (text)
> + {
> + res = make_string (text, qxestrlen(text));
> + }
> + }
> + return res;
> +}
> +
> void
> syms_of_intl_carbon (void)
> {
> + DEFSUBR (Fcarbon_current_locale);
> DEFSYMBOL (Qcarbon_unicode);
> + DEFVAR_LISP ("carbon-current-language-unicode-set",
> + &Vcarbon_current_language_unicode_set /*
> +Hash table mapping those Unicode code points needed for the current langenv to t.
> +
> +Can also be nil; if it is non-nil will normally include all of ASCII.
> +*/);
> + Vcarbon_current_language_unicode_set = Qnil;
> }
>
> void
> Index: src/scrollbar-carbon.c
> ===================================================================
> RCS file: /pack/xemacscvs/XEmacs/xemacs/src/Attic/scrollbar-carbon.c,v
> retrieving revision 1.1.2.3
> diff -u -u -r1.1.2.3 scrollbar-carbon.c
> --- src/scrollbar-carbon.c 2007/09/30 19:48:31 1.1.2.3
> +++ src/scrollbar-carbon.c 2007/10/18 21:44:12
> @@ -307,7 +307,7 @@
> }
>
> static void
> -carbon_update_scrollbar_instance_status (struct window *w, int active, int size, struct scrollbar_instance *sb)
> +carbon_update_scrollbar_instance_status (struct window * UNUSED (w), int active, int size, struct scrollbar_instance *sb)
> {
> SetControlVisibility ((ControlRef) sb->scrollbar_data, active && size, TRUE);
> }
>
> --
> On the quay of the little Black Sea port, where the rescued pair came once
> more into contact with civilization, Dobrinton was bitten by a dog which was
> assumed to be mad, though it may only have been indiscriminating. (Saki)
--
On the quay of the little Black Sea port, where the rescued pair came once
more into contact with civilization, Dobrinton was bitten by a dog which was
assumed to be mad, though it may only have been indiscriminating. (Saki)
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta
abbrev-mode - toggle-abbrev-mode
17 years, 1 month
Andreas Röhler
It seems as `toggle-abbrev-mode' in GNU Emacs and
`abbrev-mode' in XEmacs are reciprocal.
As I'm going to adapt my GNU Emacs Lisp stuff to run at
XEmacs too, I would like to keep the diffs as small as
possible.
I'm not going to say, abbrev-mode in XEmacs isn't as
good as in GNU, rather I'm campaigning to take the
X-way there.
However, in cases were commands only differ by name,
what about to give RMS the honour and simply follow GNU
convention?
Thanks all
Andreas Röhler
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta
crypt.el trivial comment changes
17 years, 1 month
Ulrich Mueller
Yo! XEmacs Developers,
crypt.el contains a duplicate line in the comments of the
"INSTALLATION" section.
Furthermore, throughout the file version numbers 2.84, 2.93, and 2.94
appear. This should be changed consistently. (Taking the highest of
these numbers will probably minimise confusion. The last Karl Berry
version was 2.92.)
See attached patch.
Regards
Ulrich
Emacs: GNU Emacs 22.1.1 (i686-pc-linux-gnu, GTK+ Version 2.12.0)
of 2007-10-01 on a1iulm2
Package: crypt.el 2.94
--- crypt.el~ 2007-10-18 05:02:16.000000000 +0200
+++ crypt.el 2007-10-18 05:12:57.000000000 +0200
@@ -6,7 +6,7 @@
;; Kyle E. Jones <kyle(a)uunet.uu.net>
;; Maintainer: xemacs-beta(a)xemacs.org
;; Created: crypt.el in 1988, crypt++.el on 18 Jan 1993
-;; Version: 2.93
+;; Version: 2.94
;; Date: 1994/03/31 12:30:17
;; Keywords: extensions
@@ -38,7 +38,7 @@
;;; LCD Archive Entry:
;;; crypt++|Rod Whitby and Lawrence R. Dodd|xemacs-beta(a)xemacs.org|
;;; Code for handling all sorts of compressed and encrypted files.|
-;;; 1994/03/31 12:30:17|2.84|~/misc/crypt++.el.Z|
+;;; 1994/03/31 12:30:17|2.94|~/misc/crypt++.el.Z|
;;; BUG REPORTS:
;;;
@@ -59,7 +59,7 @@
;;; VERSION:
;;;
-;;; Version: 2.84
+;;; Version: 2.94
;;; Ident: crypt++.el,v 2.82 1994/03/31 12:30:17 dodd Exp
;;; Date: 1994/03/31 12:30:17
@@ -74,8 +74,6 @@
;;;
;;; in your ~/.emacs file or in the file default.el in the ../lisp directory
;;; of the Emacs distribution.
-
-;;; of the Emacs distribution.
;;;
;;; For reliable operation with Emacs versions with coding system
;;; support, you also need:
@@ -712,7 +710,7 @@
;;; (crypt-encoded-disable-auto-save, crypt-encrypted-disable-auto-save):
;;; New user-defined variables. (crypt-encoded-mode, crypt-encrypted-mode):
;;; Use them.
-;;; 2.84 -
+;;; 2.83 -
;;; hniksic: Added custom.
;;; 2.94 -
;;; Aidan Kehoe: imported Karl Berry's Crypt++. See ChangeLog for details
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta
How to mimic some GNU Emacs mouse behavior in XEmacs?
17 years, 1 month
Skip Montanaro
A colleague at work is trying to mimic some GNU Emacs behavior in XEmacs. I
have never done anything with the mouse in either dialect, so I couldn't
help him out. Can someone here suggest how to do what he wants?
> I am trying to imitate the following FSF emacs behavior in xemacs: When I
> double-click mouse button3, I would like it to kill the region selected
> from the last position of 'point' position. Also button2 yanks the
> selection. Here is what I have so far:
> (define-key global-map 'button3 'mouse-track-adjust)
> (add-hook 'mouse-track-click-hook
> (lambda (event count)
> (if (or (/= (event-button event) 3)
> (/= count 2))
> nil
> (kill-region (point) (mark))
> t
> )))
> (setq mouse-yank-at-point t)
> I am not able to get it to select the region spanning the last point where
> button1 was clicked, to the current mouse location. To do that I have to
> highlight the region by dragging the mouse. Presumably, I have to invoke
> some 'mark the point' function in the code above when button1 is clicked
> in the above conditional?
Thanks,
Skip
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta
[Bug: 21.5-b28] msprinter error on non-MS system
17 years, 1 month
robert delius royar
================================================================
Dear Bug Team!
When I try to print a buffer, I now see two errors: 1) there is no longer any
pretty-printing option, and 2) standard printing returns the "Invalid constant:
Invalid device type, msprinter" error perhaps alluded to in the thread
http://calypso.tux.org/pipermail/xemacs-beta/2007-September/012317.html
Although I doubt it is related, there appear to be some "odd" lisp shadows
(e.g. shadows from the same directories).
================================================================
System Info to help track down your bug:
---------------------------------------
uname -a: Darwin grendel.frinabulax.org 8.10.0 Darwin Kernel Version 8.10.0: Wed May 23 16:50:59 PDT 2007; root:xnu-792.21.3~1/RELEASE_PPC Power Macintosh powerpc
./configure '--with-mule' '--with-widgets=athena' '--with-athena=3d' '--with-dialogs=athena' '--with-scrollbars=lucid' '--without-debug' '--with-union-type' '--without-error-checking' '--with-x11' '--prefix=/Users/royar/usr/local' '--with-png' '--with-jpeg' '--with-tiff' '--with-xmu' '--with-xim=no' '--enable-sound=esd' '--disable-xfs' '--enable-dump-in-exec' '--with-modules' '--enable-external-widget' '--with-dynamic' '--disable-kkcc' '--disable-mc-alloc' '--enable-optimization' '--with-cflags-optimization=-Os -pipe -mcpu=970 -mtune=970 -mpim-altivec' '--with-site-runtime-libraries=/opt/local/lib:/usr/X11R6/lib' '--with-site-libraries=/opt/local/lib:/usr/X11R6/lib' '--with-xft=emacs,gauges,notabs,nomenubars' '--with-neon' '--with-curl' '--with-compiler=gcc-4.0' 'CPPFLAGS=-I/opt/local/include' 'LDFLAGS=-L/opt/local/lib' 'CFLAGS='
XEmacs 21.5-b28 "fuki" (+CVS-20071016) configured for `powerpc-apple-darwin8.10.0'.
Compilation Environment and Installation Defaults:
Source code location: /Users/royar/src/xemacs
Installation prefix: /Users/royar/usr/local
Additional libraries: /opt/local/lib /usr/X11R6/lib
Operating system description file: `s/darwin.h'
Machine description file: `m/powerpc.h'
Compiler version: powerpc-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5367)
- GCC specs file: specs.
- Compiler command: gcc-4.0 -Wall -Wno-switch -Wundef -Wsign-compare -Wno-char-subscripts -Wpacked -Wpointer-arith -Wunused-parameter -g -Os -pipe -mcpu=970 -mtune=970 -mpim-altivec
libc version:
Relocating allocator for buffers: no
GNU version of malloc: no
- The GNU allocators don't work with this system configuration.
Window System:
Compiling in support for the X window system:
- X Windows headers location: /usr/X11R6/include
- X Windows libraries location: /usr/X11R6/lib
- Handling WM_COMMAND properly.
- Using fontconfig to manage fonts.
- Compiling in support for Xft antialiased fonts (EXPERIMENTAL).
Compiling in support for the Athena widget set:
- Athena headers location: X11/Xaw3d
- Athena library to link: Xaw3d
Using Lucid menubars.
Using Lucid scrollbars.
Using Athena dialog boxes.
Using Athena native widgets.
- Using Xft to render antialiased fonts in progress bars.
WARNING: This feature will be replaced with a face.
WARNING: This feature not yet implemented; setting ignored.
TTY:
Compiling in support for ncurses.
Images:
Compiling in support for GIF images (builtin).
Compiling in support for XPM images.
Compiling in support for PNG images.
Compiling in support for JPEG images.
Compiling in support for TIFF images.
Sound:
Compiling in support for ESD (Enlightened Sound Daemon).
Databases:
Compiling in support for Berkeley database.
Compiling in support for GNU DBM.
Compiling in support for LDAP.
Internationalization:
Compiling in support for Mule (multi-lingual Emacs).
Mail:
Compiling in support for "file" mail spool file locking method.
Other Features:
Inhibiting IPv6 canonicalization at startup.
Compiling in support for dynamic shared object modules.
Using the union type for Lisp_Objects.
WARNING: ---------------------------------------------------------
WARNING: This tends to trigger compiler bugs, especially when
WARNING: combined with MULE and ERROR_CHECKING. Crashes have
WARNING: been seen with various versions of GCC (up to about 2.95),
WARNING: and recently with Visual C++ as well (mid-2003).
WARNING: More recent versions may be safer, or not.
WARNING: ---------------------------------------------------------
Using the new portable dumper.
Dumping into executable.
Load-Path Lisp Shadows:
----------------------
(/Users/royar/usr/local/share/xemacs/site-lisp/worklog
/Users/royar/usr/local/share/xemacs/site-lisp/worklog
/Users/royar/usr/local/share/xemacs/site-lisp/tcl-mode-patch
/Users/royar/usr/local/share/xemacs/site-lisp/tcl-mode-patch
/Users/royar/usr/local/share/xemacs/site-lisp/spread
/Users/royar/usr/local/share/xemacs/site-lisp/spread
/Users/royar/usr/local/share/xemacs/site-lisp/skribe
/Users/royar/usr/local/share/xemacs/site-lisp/skribe
/Users/royar/usr/local/share/xemacs/site-lisp/psgml-mode-patch
/Users/royar/usr/local/share/xemacs/site-lisp/psgml-mode-patch
/Users/royar/usr/local/share/xemacs/site-lisp/notes-xemacs
/Users/royar/usr/local/share/xemacs/site-lisp/notes-xemacs
/Users/royar/usr/local/share/xemacs/site-lisp/notes-variables
/Users/royar/usr/local/share/xemacs/site-lisp/notes-variables
/Users/royar/usr/local/share/xemacs/site-lisp/notes-url
/Users/royar/usr/local/share/xemacs/site-lisp/notes-url
/Users/royar/usr/local/share/xemacs/site-lisp/notes-mode
/Users/royar/usr/local/share/xemacs/site-lisp/notes-mode
/Users/royar/usr/local/share/xemacs/site-lisp/notes-index-mode
/Users/royar/usr/local/share/xemacs/site-lisp/notes-index-mode
/Users/royar/usr/local/share/xemacs/site-lisp/notes-first
/Users/royar/usr/local/share/xemacs/site-lisp/notes-first
/Users/royar/usr/local/share/xemacs/site-lisp/notes-emacs
/Users/royar/usr/local/share/xemacs/site-lisp/notes-emacs
/Users/royar/usr/local/share/xemacs/site-lisp/notes-bootstrap
/Users/royar/usr/local/share/xemacs/site-lisp/notes-bootstrap
/Users/royar/usr/local/share/xemacs/site-lisp/notes-aux
/Users/royar/usr/local/share/xemacs/site-lisp/notes-aux
/Users/royar/usr/local/share/xemacs/site-lisp/multr
/Users/royar/usr/local/share/xemacs/site-lisp/multr
/Users/royar/usr/local/share/xemacs/site-lisp/html-mine
/Users/royar/usr/local/share/xemacs/site-lisp/html-mine
/Users/royar/usr/local/share/xemacs/site-lisp/filladapt
/Users/royar/usr/local/share/xemacs/site-lisp/filladapt
/Users/royar/usr/local/share/xemacs/site-lisp/color-theme
/Users/royar/usr/local/share/xemacs/site-lisp/color-theme
/Users/royar/usr/local/share/xemacs/site-lisp/cc-mode-patch
/Users/royar/usr/local/share/xemacs/site-lisp/cc-mode-patch
/Users/royar/usr/local/share/xemacs/site-lisp/boxquote
/Users/royar/usr/local/share/xemacs/site-lisp/boxquote
/Users/royar/usr/local/share/xemacs/site-lisp/aliases
/Users/royar/usr/local/share/xemacs/site-lisp/aliases
/Users/royar/usr/local/share/xemacs/site-lisp/filladapt
/Users/royar/usr/local/share/xemacs/xemacs-packages/lisp/text-modes/filladapt
/Users/royar/usr/local/share/xemacs/xemacs-packages/lisp/xemacs-base/regexp-opt
/Users/royar/usr/local/share/xemacs-21.5-b28/lisp/regexp-opt
/Users/royar/usr/local/share/xemacs/xemacs-packages/lisp/xemacs-base/easy-mmode
/Users/royar/usr/local/share/xemacs-21.5-b28/lisp/easy-mmode)
Internationalization Settings:
-------------------------
Environment:
Value of LC_ALL : C
Value of LC_COLLATE : en_US.ISO8859-1
Value of LC_CTYPE : en_US.ISO8859-1
Value of LC_MESSAGES : en_US.ISO8859-1
Value of LC_MONETARY : en_US.ISO8859-1
Value of LC_NUMERIC : en_US.ISO8859-1
Value of LC_TIME : en_US.ISO8859-1
Value of LANG : C
Lisp locale settings:
current-language-environment => "English"
default-buffer-file-coding-system => iso-8859-1
default-process-coding-system => (undecided . iso-8859-1)
(current-locale) => "C"
keyboard-coding-system => iso-8859-1
terminal-coding-system => iso-8859-1
(coding-priority-list) =>
(no-conversion utf-16-little-endian-bom utf-16-bom utf-8-bom iso-7 utf-8
iso-8-1 iso-8-2 iso-8-designate iso-lock-shift shift-jis big5
utf-16-little-endian utf-16 ucs-4)
Coding system aliases:
'native is aliased to iso-8859-1
'file-name is aliased to utf-8
'mswindows-multibyte-system-default is not a coding system alias
Installed XEmacs Packages:
-------------------------
(xslt-process ver: 1.12 upstream: 1.2.1)
(xslide ver: 1.09 upstream: 0.2.2)
(xemacs-devel ver: 1.76 upstream: No-Upstream-Ver)
(xemacs-base ver: 2.11 upstream: No-Upstream-Ver)
(vm ver: 7.26 upstream: 7.19)
(view-process ver: 1.13 upstream: 2.4)
(vc ver: 1.44 upstream: No-Upstream-Ver)
(time ver: 1.14 upstream: 1.17)
(text-modes ver: 1.95 upstream: No-Upstream-Ver)
(texinfo ver: 1.3 upstream: No-Upstream-Ver)
(strokes ver: 1.1 upstream: No-Upstream-Ver)
(speedbar ver: 1.28 upstream: 0.14beta4)
(sounds-wav ver: 1.12 upstream: No-Upstream-Ver)
(sounds-au ver: 1.12 upstream: No-Upstream-Ver)
(slider ver: 1.15 upstream: 0.3x1)
(sh-script ver: 1.22 upstream: 2.0f)
(sgml ver: 1.11 upstream: No-Upstream-Ver)
(re-builder ver: 1.05 upstream: 1.20)
(psgml-dtds ver: 1.03 upstream: No-Upstream-Ver)
(psgml ver: 1.45 upstream: 1.3.2)
(ps-print ver: 1.11 upstream: 6.5.6)
(prog-modes ver: 2.14 upstream: No-Upstream-Ver)
(perl-modes ver: 1.09 upstream: No-Upstream-Ver)
(pcomplete ver: 1.04 upstream: 1.1.6)
(pc ver: 1.28 upstream: No-Upstream-Ver)
(os-utils ver: 1.4 upstream: No-Upstream-Ver)
(oo-browser ver: 1.05 upstream: 4.08)
(net-utils ver: 1.53 upstream: N/A)
(mmm-mode ver: 1.02 upstream: 0.4.7)
(mew ver: 1.19 upstream: 1.94.2)
(mail-lib ver: 1.79 upstream: No-Upstream-Ver)
(ispell ver: 1.32 upstream: 3.6)
(ilisp ver: 1.34 upstream: 5.12.0)
(igrep ver: 1.15 upstream: 2.111)
(ibuffer ver: 1.09 upstream: No-Upstream-Ver)
(hyperbole ver: 1.17 upstream: 5.0)
(hm--html-menus ver: 1.24 upstream: 5.9)
(gnats ver: 1.17 upstream: 3.101)
(general-docs ver: 1.05 upstream: No-Upstream-Ver)
(fsf-compat ver: 1.15 upstream: No-Upstream-Ver)
(footnote ver: 1.16 upstream: 0.18x)
(eterm ver: 1.17 upstream: No-Upstream-Ver)
(eshell ver: 1.12 upstream: 2.4.1)
(escreen ver: 1.01 upstream: 1.16)
(emerge ver: 1.11 upstream: No-Upstream-Ver)
(elib ver: 1.11 upstream: 1.0)
(eieio ver: 1.05 upstream: 0.17)
(efs ver: 1.34 upstream: 1.24)
(edit-utils ver: 2.38 upstream: No-Upstream-Ver)
(ediff ver: 1.71 upstream: 2.75)
(edebug ver: 1.22 upstream: No-Upstream-Ver)
(ecrypto ver: 0.2 upstream: 2.0)
(ecb ver: 1.22 upstream: 2.31)
(docbookide ver: 0.08 upstream: 0.1)
(dired ver: 1.17 upstream: 7.13)
(dictionary ver: 1.16 upstream: 1.8)
(cookie ver: 1.15 upstream: No-Upstream-Ver)
(cc-mode ver: 1.45 upstream: 5.30.10)
(calendar ver: 1.34 upstream: No-Upstream-Ver)
(calc ver: 1.26 upstream: 2.02fX3)
(c-support ver: 1.22 upstream: No-Upstream-Ver)
(apel ver: 1.33 upstream: 10.6)
Installed Modules:
-----------------
Features:
--------
(mail-abbrevs xemacsbug shadow sendmail rfc822 gnuserv javascript-mode comint
ring cc-mode cc-fonts cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars
cc-defs apache-mode css-mode edmacro apropos cperl-mode m4-mode regexp-opt
sh-script executable blink-cursor font-lock paren blink-paren mthomas-backup
advice advice-preload font disp-table notes-variables notes-xemacs efs-cu
filladapt iso-acc iso-syntax flyspell ispell rtf-support cus-face tempo
sgml-mode psgml psgml-html pending-del recent-files saveconf saveplace
xslt-process-autoloads xslide-autoloads xemacs-devel-autoloads
xemacs-base-autoloads vm-autoloads view-process-autoloads vc-autoloads
time-autoloads text-modes-autoloads texinfo-autoloads strokes-autoloads
speedbar-autoloads sounds-wav-autoloads sounds-au-autoloads slider-autoloads
sh-script-autoloads sgml-autoloads re-builder-autoloads psgml-dtds-autoloads
psgml-autoloads ps-print-autoloads prog-modes-autoloads perl-modes-autoloads
pcomplete-autoloads pc-autoloads os-utils-autoloads oo-browser-autoloads
net-utils-autoloads mmm-mode-autoloads mew-autoloads mail-lib-autoloads
ispell-autoloads ilisp-autoloads igrep-autoloads ibuffer-autoloads
hyperbole-autoloads hm--html-menus-autoloads gnats-autoloads
general-docs-autoloads fsf-compat-autoloads footnote-autoloads eterm-autoloads
eshell-autoloads escreen-autoloads emerge-autoloads elib-autoloads
eieio-autoloads efs-autoloads edit-utils-autoloads ediff-autoloads
edebug-autoloads ecrypto-autoloads ecb-autoloads docbookide-autoloads
dired-autoloads dictionary-autoloads cookie-autoloads cc-mode-autoloads
calendar-autoloads calc-autoloads c-support-autoloads apel-autoloads
modules-autoloads mule-autoloads auto-autoloads auto-show fontl-hooks canna-leim
tibetan slovenian czech romanian lao devanagari indian cyrillic code-cmds
gutter-items menubar-items x-menubar mode-motion mouse behavior itimer auto-save
lisp-mode easymenu easy-mmode iso8859-1 page buff-menu lib-complete loadhist
cus-file derived newcomment rsz-minibuf env text-props fontconfig frame obsolete
cus-start custom widget cl-extra cl cl-19 packages backquote unicode font-mgr
lucid-scrollbars cut-buffer xft-fonts lucid-menubars external-widget
athena-dialogs x c-balloon-help tty-frames tty toolbar esd-sound scrollbar
unix-processes multicast network-streams subprocesses modules
menu-accelerator-support menubar berkeley-db dbm md5 xemacs mule gutter tiff png
gif jpeg xpm xbm lisp-float-type file-coding darwin dialog devices window-system
base64)
Recent keystrokes:
-----------------
misc-user misc-user ESC x r e p o r t - x e m TAB
RET
Recent messages (most recent first):
-----------------------------------
Parsing /Users/royar/.mailrc... done
Fontifying *mail*... done.
Parsing /Users/royar/.mailrc...
Fontifying *mail*...
Loading xemacsbug...done
Loading xemacsbug...
Invalid constant: Invalid device type, msprinter
XEmacs 21.5 (beta28) "fuki" (+CVS-20071016) [Lucid] (powerpc-apple-darwin8.10.0, Mule) of Wed Oct 17 2007 on grendel.frinabulax.org
Fontifying presidentletter.pl... done.
Loading gnuserv...done
Loading gnuserv...
Loading /Users/royar/usr/local/share/xemacs/site-lisp/psgml-mode-patch.elc...done
Loading /Users/royar/usr/local/share/xemacs/site-lisp/psgml-mode-patch.elc...
Loading /Users/royar/usr/local/share/xemacs/site-lisp/tcl-mode-patch.elc...done
Loading /Users/royar/usr/local/share/xemacs/site-lisp/tcl-mode-patch.elc...
Loading /Users/royar/usr/local/share/xemacs/site-lisp/cc-mode-patch.elc...done
Loading /Users/royar/usr/local/share/xemacs/site-lisp/cc-mode-patch.elc...
Loading /Users/royar/usr/local/share/xemacs/site-lisp/html-mine.elc...done
Loading /Users/royar/usr/local/share/xemacs/site-lisp/html-mine.elc...
Loading javascript-mode...done
--
Robert Delius Royar Making Meaning One Message at a Time
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta
Re: I'm unclear what to do w.r.t. ~/.emacs & ~/.xemacs/init.el
17 years, 1 month
Stephen J. Turnbull
Sorry, Skip, this was supposed to be reply to all I guess you'll get a dupe.
On 10/16/07, Stephen J. Turnbull <stephen(a)xemacs.org> wrote:
> On 10/16/07, skip(a)pobox.com <skip(a)pobox.com> wrote:
> > We recently switched from 21.4.something to 21.5.28 at work, mostly because
> > the powers-that-be wanted to dump some older shared library to which 21.4
> > was linked. I had built and installed 21.5.28 and was using it personally
> > without any significant problems but hadn't yet made it the default.
>
> GNU Emacs users should not share .emacs between XEmacs and GNU Emacs
> unless they really know what they're doing.
>
> I recommend moving to the .xemacs/init.el model because it separates init.el
> from custom.el. The best way to do this is to just cp .emacs
> .xemacs/init.el, then
> copy the custom-set-* forms to .xemacs/custom.el and remove them from init.el.
> After that XEmacs should ignore .emacs (but it's there as a backup, or for GNU
> Emacs!) If you have significant custom-izations migration can be dangerous (I
> think Mike has fixed the most recent problem, and most problems I can imagine,
> but I'm not sure the risk of losing custom-izations is zero yet).
>
> .xemacs is a reasonable place to keep shared init code, eg in
> shared-init.el. Then
> put (load-library "shared-init") in your .emacs and init.el.
>
> custom.el may be sharable, but there are a number of tricks you can do
> with faces
> in GNU Emacs that don't work in XEmacs yet. It's probably preferable
> to keep those
> separate, too. (And I don't know if GNU Emacs will write
> customizations to a file
> other than .emacs.) Sorry.
>
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta
Re: VM and UTF-8
17 years, 1 month
Aidan Kehoe
Ar an séú lá déag de mí Deireadh Fómhair, scríobh Reiner Steib:
> On Tue, Oct 16 2007, Aidan Kehoe wrote:
>
> > Ar an séú lá déag de mí Deireadh Fómhair, scríobh Reiner Steib:
> [...]
> > > "charset=utf8" is bogus. It should be "utf-8", with hyphen.
> >
> > Yes, my mistake. I had added '("utf8" utf-8) to the beginning of
> > vm-mime-mule-charset-to-coding-alist, after seeing some mails with that as
> > the specified character set--
>
> I didn't see such mails or news articles yet. Is it frequent? The
> I'd add an entry to `mm-charset-synonym-alist' in Gnus [1].
Not frequent, otherwise I would have added the alias and seen this bug years
ago. I believe it was someone in BeLUG ... ah, right, Michael Sucha in
20071010191243.GC4137(a)mid.sucha.de to <linux-l(a)mlists.in-berlin.de>, and
several more messages. And just him.
> > without realising that the first MIME name in that list for the Mule
> > coding system would be used. Here’s the correct code, if anyone else
> > wants to add it to their ~/.vm :
> >
> > (unless (assoc "utf8" vm-mime-mule-charset-to-coding-alist)
> > (nconc
> > vm-mime-mule-charset-to-coding-alist
> > ;; Needs to be at the end, otherwise we get the wrong MIME name when
> > ;; sending.
> > '(("utf8" utf-8))))
>
> Maybe VM should not use these for sending and a "mapping from unknown
> or invalid charset names to the real charset names" instead (like
> `mm-charset-synonym-alist' in Gnus).
VM doesn’t, actually, which is part of what put me in the embarrassing
position of sending that last mail with utf8 as the MIME character set. It
uses vm-mime-mule-coding-to-charset-alist , which the XEmacs packages
version of VM initialises based on vm-mime-mule-charset-to-coding-alist .
- Aidan (carefully doing a pre-emptive
M-: (vm-mime-xemacs-encode-composition) RET ...)
--
On the quay of the little Black Sea port, where the rescued pair came once
more into contact with civilization, Dobrinton was bitten by a dog which was
assumed to be mad, though it may only have been indiscriminating. (Saki)
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta
I'm unclear what to do w.r.t. ~/.emacs & ~/.xemacs/init.el
17 years, 1 month
Skip Montanaro
We recently switched from 21.4.something to 21.5.28 at work, mostly because
the powers-that-be wanted to dump some older shared library to which 21.4
was linked. I had built and installed 21.5.28 and was using it personally
without any significant problems but hadn't yet made it the default.
Now that it's loose in the wild the occasional problem/question from users
pops up. Today, one guy complained about problems with cut-n-paste between
xemacs sessions. First thing I noticed was XEmacs complaining about not
being able to open ~/.xemacs/init.el. I fixed that by creating an empty
file. His cut-n-paste errors disappeared as well. Alas, now it fails to
load his ~/.emacs file.
Bearing in mind the recent flurry of messages about auto-conversion of
~/.emacs to ~/.xemacs/init.el (which I almost completely ignored), what is
the best (read: most foolproof) way to convert his ~/.emacs file to
~/.xemacs/init.el without hosing his .emacs file? (Lots of people here use
both emacs and xemacs, either by accident or design, so ~/.emacs must be
preserved.)
Thanks,
Skip
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta
Re: VM and UTF-8 (was: [COMMIT] Eliminate some non-X11 build failures)
17 years, 1 month
Aidan Kehoe
Ar an séú lá déag de mí Deireadh Fómhair, scríobh Reiner Steib:
> On Tue, Oct 16 2007, Aidan Kehoe wrote:
>
> | Content-Type: text/plain; charset=utf8
> | X-Mailer: VM 7.19 under 21.5 (beta28) "fuki" (+CVS-20070826) XEmacs Lucid
>
> "charset=utf8" is bogus. It should be "utf-8", with hyphen.
Yes, my mistake. I had added '("utf8" utf-8) to the beginning of
vm-mime-mule-charset-to-coding-alist, after seeing some mails with that as
the specified character set--without realising that the first MIME name in
that list for the Mule coding system would be used. Here’s the correct code,
if anyone else wants to add it to their ~/.vm :
(unless (assoc "utf8" vm-mime-mule-charset-to-coding-alist)
(nconc
vm-mime-mule-charset-to-coding-alist
;; Needs to be at the end, otherwise we get the wrong MIME name when
;; sending.
'(("utf8" utf-8))))
--
On the quay of the little Black Sea port, where the rescued pair came once
more into contact with civilization, Dobrinton was bitten by a dog which was
assumed to be mad, though it may only have been indiscriminating. (Saki)
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta