unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Special Characters on Mac Emacs
@ 2005-03-10 16:18 Ulrich Hobelmann
  2005-03-23 11:20 ` YAMAMOTO Mitsuharu
  0 siblings, 1 reply; 14+ messages in thread
From: Ulrich Hobelmann @ 2005-03-10 16:18 UTC (permalink / raw)


Okay, let me wrap up how things work out for me:

(set-keyboard-coding-system 'mac-roman)

seems to be an easy way to make Emacs behave like one would expect it 
to: all special combinations (umlauts, euro symbol, accents) work.

To make Emacs display the stuff the following works:

(create-fontset-from-fontset-spec

"-apple-monaco-medium-r-normal--12-*-*-*-*-*-fontset-monaco,
         ascii:-apple-monaco-medium-r-normal--12-120-75-75-m-120-mac-roman,
         mule-unicode-0100-24ff:-apple-lucida 
grande-medium-r-normal--0-0-75-75-m-0-mac-roman,
         mule-unicode-2500-33ff:-apple-bitstream vera sans mono 
bold-medium-r-normal--0-0-75-75-m-0-mac-roman,

latin-iso8859-15:-apple-monaco-medium-r-normal--12-120-75-75-m-120-mac-roman,

latin-iso8859-1:-apple-monaco-medium-r-normal--12-120-75-75-m-120-mac-roman"
)

(set-face-font
  'default "-apple-monaco-medium-r-normal--12-*-*-*-*-*-fontset-monaco")

It seems, however, that Emacs really only uses the first (ascii) part, 
so I tried changing it to:

(create-fontset-from-fontset-spec

"-apple-Bitstream Vera Sans 
Mono-regular-r-normal--13-*-*-*-*-*-fontset-monaco,
         ascii:-apple-Bitstream Vera Sans 
Mono-regular-r-normal--13-140-75-75-m-120-mac-roman,
         mule-unicode-0100-24ff:-apple-lucida 
grande-medium-r-normal--0-0-75-75-m-0-mac-roman,
         mule-unicode-2500-33ff:-apple-bitstream vera sans mono 
bold-medium-r-normal--0-0-75-75-m-0-mac-roman,

latin-iso8859-15:-apple-monaco-medium-r-normal--12-120-75-75-m-120-mac-roman,

latin-iso8859-1:-apple-monaco-medium-r-normal--12-120-75-75-m-120-mac-roman"
)

Interestingly now Emacs explodes into the debugger and claims that no 
font matches.  For some reason the very same font works fine with:

(set-face-font 'default "-apple-Bitstream Vera Sans 
Mono-regular-r-normal--13-140-75-75-m-120-mac-roman").  Only then the 
special characters don't display correctly.

What is it that makes Emacs find the font in one instance and not in the 
  other?  And what makes Emacs accept the fontset containing a Monaco 
with mac-roman encoding(!) but display special characters, while loading 
the Bitstream font (also with mac-roman encoding) can't display special 
characters?

The emacs info pages can't really help me.  I don't really understand 
what all those characters and numbers in a fontset stand for...  But 
this doesn't change the fact that emacs doesn't even find my font to 
include it in the fontset.

Regards, Ulrich

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Special Characters on Mac Emacs
  2005-03-10 16:18 Special Characters on Mac Emacs Ulrich Hobelmann
@ 2005-03-23 11:20 ` YAMAMOTO Mitsuharu
  2005-03-23 15:49   ` Sébastien Kirche
  0 siblings, 1 reply; 14+ messages in thread
From: YAMAMOTO Mitsuharu @ 2005-03-23 11:20 UTC (permalink / raw)
  Cc: emacs-devel

>>>>> On Thu, 10 Mar 2005 10:18:02 -0600, Ulrich Hobelmann <u.hobelmann@web.de> said:

> To make Emacs display the stuff the following works:

> (create-fontset-from-fontset-spec
> "-apple-monaco-medium-r-normal--12-*-*-*-*-*-fontset-monaco,
> ascii:-apple-monaco-medium-r-normal--12-120-75-75-m-120-mac-roman,
(snip)
> latin-iso8859-15:-apple-monaco-medium-r-normal--12-120-75-75-m-120-mac-roman,
> latin-iso8859-1:-apple-monaco-medium-r-normal--12-120-75-75-m-120-mac-roman"
> )

> (set-face-font 'default
> "-apple-monaco-medium-r-normal--12-*-*-*-*-*-fontset-monaco")

I'd rather not recommend directly specifying mac-roman fonts for
latin-iso8859-1 or latin-iso8859-15 character set.  Because mac-roman
does not have all the characters for them, some characters are
displayed with wrong glyph.  If it had all,
`face-font-registry-alternatives' would be set accordingly.

 (If you do not care about wrong glyph, the easiest way is to add

  (custom-set-variables
    '(face-font-registry-alternatives
      '(("iso8859-1" "mac-roman") ("iso8859-15" "mac-roman"))))

 to ~/.emacs.  Then mac-roman fonts can be used in place of
 iso8859-1(15) fonts in many cases.)

Maybe `create-fontset-from-mac-roman-font' or `fontset-add-mac-fonts'
mentioned in 

  http://lists.gnu.org/archive/html/emacs-devel/2004-12/msg00004.html

would be of help.  Also, the following patch makes "fontset-mac" a
fallback fontset, and if one specifies a mac-roman font via the -fn
option or preferences like

  % defaults write org.gnu.Emacs Emacs.font '-apple-lucida sans typewriter-medium-r-normal--14-*-75-75-m-*-mac-roman'

then `create-fontset-from-mac-roman-font' is automatically used to
augment the specified font with many accented characters.

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp

Index: lisp/term/mac-win.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/term/mac-win.el,v
retrieving revision 1.35
diff -c -r1.35 mac-win.el
*** lisp/term/mac-win.el	16 Mar 2005 03:23:34 -0000	1.35
--- lisp/term/mac-win.el	23 Mar 2005 10:43:45 -0000
***************
*** 1577,1583 ****
  	  (new-fontset font (x-complement-fontset-spec xlfd-fields nil))
  	;; Create a fontset from FONT.  The fontset name is
  	;; generated from FONT.
! 	(create-fontset-from-ascii-font font resolved-name "startup"))))
  
  ;; Apply a geometry resource to the initial frame.  Put it at the end
  ;; of the alist, so that anything specified on the command line takes
--- 1577,1586 ----
  	  (new-fontset font (x-complement-fontset-spec xlfd-fields nil))
  	;; Create a fontset from FONT.  The fontset name is
  	;; generated from FONT.
! 	(if (and (string= "mac" (aref xlfd-fields xlfd-regexp-registry-subnum))
! 		 (string= "roman" (aref xlfd-fields xlfd-regexp-encoding-subnum)))
! 	    (create-fontset-from-mac-roman-font font resolved-name "startup")
! 	  (create-fontset-from-ascii-font font resolved-name "startup")))))
  
  ;; Apply a geometry resource to the initial frame.  Put it at the end
  ;; of the alist, so that anything specified on the command line takes
Index: src/macfns.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/macfns.c,v
retrieving revision 1.54
diff -c -r1.54 macfns.c
*** src/macfns.c	16 Mar 2005 08:06:33 -0000	1.54
--- src/macfns.c	23 Mar 2005 10:43:45 -0000
***************
*** 2632,2637 ****
--- 2632,2639 ----
        font = x_new_font (f, "-ETL-fixed-medium-r-*--*-160-*-*-*-*-iso8859-1");
      /* If those didn't work, look for something which will at least work.  */
      if (! STRINGP (font))
+       font = x_new_fontset (f, "-etl-fixed-medium-r-normal-*-16-*-*-*-*-*-fontset-mac");
+     if (! STRINGP (font))
        font = x_new_font (f, "-*-monaco-*-12-*-mac-roman");
      if (! STRINGP (font))
        font = x_new_font (f, "-*-courier-*-10-*-mac-roman");
***************
*** 3732,3737 ****
--- 3734,3741 ----
        font = x_new_font (f, "-ETL-fixed-medium-r-*--*-160-*-*-*-*-iso8859-1");
      /* If those didn't work, look for something which will at least work.  */
      if (! STRINGP (font))
+       font = x_new_fontset (f, "-etl-fixed-medium-r-normal-*-16-*-*-*-*-*-fontset-mac");
+     if (! STRINGP (font))
        font = x_new_font (f, "-*-monaco-*-12-*-mac-roman");
      if (! STRINGP (font))
        font = x_new_font (f, "-*-courier-*-10-*-mac-roman");

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Special Characters on Mac Emacs
  2005-03-23 11:20 ` YAMAMOTO Mitsuharu
@ 2005-03-23 15:49   ` Sébastien Kirche
  2005-03-24  3:00     ` YAMAMOTO Mitsuharu
  0 siblings, 1 reply; 14+ messages in thread
From: Sébastien Kirche @ 2005-03-23 15:49 UTC (permalink / raw)


Le 23 Mar 2005, YAMAMOTO Mitsuharu a dit :

>  On Thu, 10 Mar 2005 10:18:02 -0600, Ulrich Hobelmann <u.hobelmann@web.de>
>  said:
> 
> > To make Emacs display the stuff the following works:
> 
> > (create-fontset-from-fontset-spec
> > "-apple-monaco-medium-r-normal--12-*-*-*-*-*-fontset-monaco,
> > ascii:-apple-monaco-medium-r-normal--12-120-75-75-m-120-mac-roman,
> (snip)
> > latin-iso8859-15:-apple-monaco-medium-r-normal--12-120-75-75-m-120-mac-roman,
> > latin-iso8859-1:-apple-monaco-medium-r-normal--12-120-75-75-m-120-mac-roman"
> > )
> 
> > (set-face-font 'default
> > "-apple-monaco-medium-r-normal--12-*-*-*-*-*-fontset-monaco")
> 
> I'd rather not recommend directly specifying mac-roman fonts for
> latin-iso8859-1 or latin-iso8859-15 character set.  Because mac-roman
> does not have all the characters for them, some characters are
> displayed with wrong glyph.  If it had all,
> `face-font-registry-alternatives' would be set accordingly.
> 
> [...] 

I am  French and i have some  problems specifically with OSX  to use latin-9
(seems fixed now) and box-drawing unicode chars.

I used to configure  Emacs in the same way than Ulrich  by defining an Apple
Monaco  9 pt fontset  (I missed  your interesting  december 2004  post about
Cyrillic  characters display  support) for  ascii, latin-1  and  latin-9 and
trying    to   choose    (with   little    success)   unicode    fonts   for
mule-unicode-0100-24ff and mule-unicode-2500-33ff.

I defined  it like  that  to use  with later  default-frame-alist
font :
(create-fontset-from-fontset-spec
  "-apple-monaco-medium-r-normal--9-*-*-*-*-*-fontset-monaco,
   ascii:-apple-monaco-medium-r-normal--9-90-75-75-m-90-mac-roman,
   mule-unicode-0100-24ff:-apple-lucida grande-medium-r-normal--0-0-75-75-m-0-mac-roman,
   mule-unicode-2500-33ff:-apple-bitstream vera sans mono bold-medium-r-normal--0-0-75-75-m-0-mac-roman,
   latin-iso8859-15:-apple-monaco-medium-r-normal--9-90-75-75-m-90-mac-roman,
   latin-iso8859-1:-apple-monaco-medium-r-normal--9-90-75-75-m-90-mac-roman")

I just  updated my cvs this  morning (including the patch  you just provided
concerning fontset-mac) and i noticed  that my fontset definition is no more
taken into account.

Every    attempt    to    change     the    frame    fontset    by    either
create-fontset-from-fontset-spec,         create-fontset-from-mac-roman-font,
face-font-registry-alternatives  or set-frame-font  seems to  fall  into the
-etl-fixed-medium-r-normal-*-16-  fontset, even choosing  the font  from the
S-Mouse1 menu.

The only command that managed to change the fontset to something else is the
"defaults write" command  that is available since you  added the preferences
support...

-- 
Sébastien Kirche

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Special Characters on Mac Emacs
  2005-03-23 15:49   ` Sébastien Kirche
@ 2005-03-24  3:00     ` YAMAMOTO Mitsuharu
  2005-03-24 12:50       ` Sébastien Kirche
  0 siblings, 1 reply; 14+ messages in thread
From: YAMAMOTO Mitsuharu @ 2005-03-24  3:00 UTC (permalink / raw)
  Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1204 bytes --]

>>>>> On Wed, 23 Mar 2005 16:49:10 +0100, Sébastien Kirche <sebastien.kirche.no@spam.free.fr.invalid> said:

> I just updated my cvs this morning (including the patch you just
> provided concerning fontset-mac) and i noticed that my fontset
> definition is no more taken into account.

I think specifying mac-roman fonts for mule-unicode-* charsets has
never been valid.  Only a few characters are displayed correctly (the
first attachment).

> Every attempt to change the frame fontset by either
> create-fontset-from-fontset-spec,
> create-fontset-from-mac-roman-font, face-font-registry-alternatives
> or set-frame-font seems to fall into the
> -etl-fixed-medium-r-normal-*-16- fontset, even choosing the font
> from the S-Mouse1 menu.

Could you show the concrete procedure about
create-fontset-from-mac-roman-font?  I can display some of
mule-unicode-0100-24ff characters with this (the second attachment).
As I said in the post in last December, Steven Tamm also failed in
displaying Cyrillic characters in his environment, and we couldn't
figure out the reason.  So, there maybe some common cause of that.

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp


[-- Attachment #2: screenshot1.png --]
[-- Type: image/png, Size: 42061 bytes --]

[-- Attachment #3: screenshot2.png --]
[-- Type: image/png, Size: 28112 bytes --]

[-- Attachment #4: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Special Characters on Mac Emacs
  2005-03-24  3:00     ` YAMAMOTO Mitsuharu
@ 2005-03-24 12:50       ` Sébastien Kirche
  2005-03-25  6:48         ` YAMAMOTO Mitsuharu
  0 siblings, 1 reply; 14+ messages in thread
From: Sébastien Kirche @ 2005-03-24 12:50 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 1968 bytes --]

Le 24 Mar 2005, YAMAMOTO Mitsuharu a dit :

> I think specifying mac-roman fonts for mule-unicode-* charsets has
> never been valid.  Only a few characters are displayed correctly (the
> first attachment).

Indeed. I have made  some attempts in that way to have  a correct display of
euro char  and box drawing chars for  the Gnus threads tree.  I only succeed
for the euro char. I added an attachment of my usual display.

> Could      you      show       the      concrete      procedure      about
> create-fontset-from-mac-roman-font?

To get back my display once I noticed that my fontset definition is ignored,
i tried several methods :
- selecting in the popup menu (S-Mouse1)
- following your example M-: (set-frame-font (create-fontset-from-mac-roman-font
       "-apple-monaco-medium-r-normal--9-90-75-75-m-90-mac-roman"))

I can  see that the  frame briefly flashes  then it redisplays with  the etl
font.

I also added the custom-set-variables for face-font-registry-alternatives as
you advised.

The only useful setting is the "defaults write" method.

> I  can display some  of mule-unicode-0100-24ff  characters with  this (the
> second attachment).  As I said in  the post in last  December, Steven Tamm
> also failed in  displaying Cyrillic characters in his  environment, and we
> couldn't figure out the reason. So, there maybe some common cause of that.

I  have noticed  formerly  that some  characters  displays correctly  (euro,
eastern Europe languages)  but many fail in the  range 2500-33ff and display
instead some Cyrillic.

It seems also  that now Chinese/Japanese messages that  i get sometimes with
Gnus in the forums are not displayed anymore : the glyphs are now all hollow
boxes.

Could you  give an  example of  a full fontset  definition ?  I am  not that
familiar with it and OSX is  the only platform where I have display problems
(GNU/Linux hopefully  provides the  unifont) and I  surely made  some errors
with it...

Regards.


[-- Attachment #2: previous display --]
[-- Type: image/png, Size: 19073 bytes --]

[-- Attachment #3: etl default font display --]
[-- Type: image/png, Size: 23258 bytes --]

[-- Attachment #4: Type: text/plain, Size: 22 bytes --]


-- 
Sébastien Kirche

[-- Attachment #5: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Special Characters on Mac Emacs
  2005-03-24 12:50       ` Sébastien Kirche
@ 2005-03-25  6:48         ` YAMAMOTO Mitsuharu
  2005-03-25  9:50           ` YAMAMOTO Mitsuharu
                             ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: YAMAMOTO Mitsuharu @ 2005-03-25  6:48 UTC (permalink / raw)
  Cc: emacs-devel

>>>>> On Thu, 24 Mar 2005 13:50:02 +0100, Sébastien Kirche <sebastien.kirche.no@spam.free.fr.invalid> said:

> - following your example M-: (set-frame-font
> (create-fontset-from-mac-roman-font
> "-apple-monaco-medium-r-normal--9-90-75-75-m-90-mac-roman"))

> I can see that the frame briefly flashes then it redisplays with the
> etl font.

I couldn't reproduce (even after installing ETL fonts from
http://members.shaw.ca/akochoi-emacs/stories/resources.html).  If you
tried without -Q option, could you try again with it?  Also, could you
show the result of (describe-font-set "fontset-mac_roman_9") ?

> I also added the custom-set-variables for
> face-font-registry-alternatives as you advised.

No, no.  I didn't recommend that.  What I wanted to say is:

 - The create-fontset-from-fontset-spec example introduces wrong
   glyph.
 - There is an easier way to do without messing up
   create-fontset-from-fontset-spec entries *if you don't care about
   wrong glyph*.

> I have noticed formerly that some characters displays correctly
> (euro, eastern Europe languages) but many fail in the range
> 2500-33ff and display instead some Cyrillic.

I suppose no characters in mule-unicode-2500-33ff is accessible from
QuickDraw Text API that Carbon Emacs is currently using for drawing
text, at least when using with bundled fonts.

> Could you give an example of a full fontset definition ?

I'm not quite sure what you mean by "a full fontset definition".
Anyway, the font setting in my ~/.emacs is as follows.

(when (eq window-system 'mac)
  (add-to-list 'default-frame-alist
	       `(font . ,(create-fontset-from-mac-roman-font "-apple-lucida sans typewriter-medium-r-normal--10-100-75-75-m-100-mac-roman")))
  (setq face-font-rescale-alist '(("^-apple-.*-jisx02" . 1.2)))
  (set-fontset-font "fontset-default" 'japanese-jisx0208
		    '("ヒラギノ角ゴ*" . "jisx0208.*"))
  (set-fontset-font "fontset-default" 'katakana-jisx0201
		    '("ヒラギノ角ゴ*" . "jisx0201.*")))

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Special Characters on Mac Emacs
  2005-03-25  6:48         ` YAMAMOTO Mitsuharu
@ 2005-03-25  9:50           ` YAMAMOTO Mitsuharu
  2005-03-25 15:34           ` Sébastien Kirche
  2005-03-29 10:03           ` Sébastien Kirche
  2 siblings, 0 replies; 14+ messages in thread
From: YAMAMOTO Mitsuharu @ 2005-03-25  9:50 UTC (permalink / raw)
  Cc: emacs-devel

>>>>> On Fri, 25 Mar 2005 15:48:19 +0900, YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> said:

> I suppose no characters in mule-unicode-2500-33ff is accessible from
> QuickDraw Text API that Carbon Emacs is currently using for drawing
> text, at least when using with bundled fonts.

Actually, there is one exception.  The "lozenge" character, which is
contained in mac-roman, can be displayed with (insert (make-char
'mule-unicode-2500-33ff 34 42)).

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Special Characters on Mac Emacs
  2005-03-25  6:48         ` YAMAMOTO Mitsuharu
  2005-03-25  9:50           ` YAMAMOTO Mitsuharu
@ 2005-03-25 15:34           ` Sébastien Kirche
  2005-03-26  5:00             ` YAMAMOTO Mitsuharu
  2005-03-29 10:03           ` Sébastien Kirche
  2 siblings, 1 reply; 14+ messages in thread
From: Sébastien Kirche @ 2005-03-25 15:34 UTC (permalink / raw)


Le 25 mar 2005, YAMAMOTO Mitsuharu a formulé :

> > > > > > On   Thu,  24   Mar  2005   13:50:02  +0100,   Sébastien  Kirche
> > > > > > <sebastien.kirche.no@spam.free.fr.invalid> said:
> 
> > - following your example M-: (set-frame-font
> > (create-fontset-from-mac-roman-font
> > "-apple-monaco-medium-r-normal--9-90-75-75-m-90-mac-roman"))
> 
> > I can see that the frame briefly flashes then it redisplays with the
> > etl font.
> 
> I couldn't reproduce (even after installing ETL fonts from
> http://members.shaw.ca/akochoi-emacs/stories/resources.html).  If you
> tried without -Q option, could you try again with it?  Also, could you
> show the result of (describe-font-set "fontset-mac_roman_9") ?

Yes i will show  it, but you will have to wait  4 days until Tuesday because
it is  Easter weekend and  this Friday is  holiday in my  area (my G4  is at
work). 

> > I also added the custom-set-variables for
> > face-font-registry-alternatives as you advised.
> 
> No, no.  I didn't recommend that.  What I wanted to say is:
> 
> - The create-fontset-from-fontset-spec example introduces wrong
> glyph.
> - There is an easier way to do without messing up
> create-fontset-from-fontset-spec entries *if you don't care about
> wrong glyph*.

Oh ? OK. I'll remove that.

> > I have noticed formerly that some characters displays correctly
> > (euro, eastern Europe languages) but many fail in the range
> > 2500-33ff and display instead some Cyrillic.
> 
> I suppose no characters in mule-unicode-2500-33ff is accessible from
> QuickDraw Text API that Carbon Emacs is currently using for drawing
> text, at least when using with bundled fonts.

What i can't figure out is that within OSX you can have any unicode char you
want providing that the application  is unicode compliant and that character
is accessible at least from the system character palette. 

But for Emacs there is that  strange remapping for parts of the unicode set.
So some chars are ok and some not. 

I will try to help as i can to fix that.

> > Could you give an example of a full fontset definition ?
> 
> I'm not quite sure what you mean by "a full fontset definition".
> Anyway, the font setting in my ~/.emacs is as follows.

I meant a working one :) I built mine with the help of the documentation and
by picking some bits from the web with lots of try and errors.

Given the fact  that some parts (mule-unicode) are  not fully functionnal, i
was not sure that my definition is correct. 

You pointed that it is not.

> (when (eq window-system 'mac)
> (add-to-list 'default-frame-alist
> 	       `(font  .  ,(create-fontset-from-mac-roman-font  "-apple-lucida
> 	       sans
> 	       typewriter-medium-r-normal--10-100-75-75-m-100-mac-roman")))
> (setq face-font-rescale-alist '(("^-apple-.*-jisx02" . 1.2)))
> (set-fontset-font "fontset-default" 'japanese-jisx0208
> 		    '("ヒラギノ角ゴ*" . "jisx0208.*"))
> (set-fontset-font "fontset-default" 'katakana-jisx0201
> 		    '("ヒラギノ角ゴ*" . "jisx0201.*")))

Interesting : i never noticed the face-font-rescale-alist parameter.
Thank you.

-- 
Sébastien Kirche

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Special Characters on Mac Emacs
  2005-03-25 15:34           ` Sébastien Kirche
@ 2005-03-26  5:00             ` YAMAMOTO Mitsuharu
  2005-03-31  3:43               ` Steven Tamm
  0 siblings, 1 reply; 14+ messages in thread
From: YAMAMOTO Mitsuharu @ 2005-03-26  5:00 UTC (permalink / raw)
  Cc: emacs-devel

>>>>> On Fri, 25 Mar 2005 16:34:55 +0100, Sébastien Kirche <sebastien.kirche.no@spam.free.fr.invalid> said:

>> I suppose no characters in mule-unicode-2500-33ff is accessible
>> from QuickDraw Text API that Carbon Emacs is currently using for
>> drawing text, at least when using with bundled fonts.

> What i can't figure out is that within OSX you can have any unicode
> char you want providing that the application is unicode compliant
> and that character is accessible at least from the system character
> palette.

> But for Emacs there is that strange remapping for parts of the
> unicode set.  So some chars are ok and some not.

Quote from "Internationalizing Your Software: File Encodings and Fonts":
http://developer.apple.com/documentation/MacOSX/Conceptual/BPInternational/Concepts/FileEncodings.html

  Carbon and QuickDraw Issues

  If you have existing QuickDraw code and want to draw text, you
  should be aware that the QuickDraw Text routines do not directly
  support Unicode.
				  :
  The fonts that are installed with Mac OS X have large character sets
  supporting a wide range of encodings and scripts. For example,
  Lucida, the system font, supports extended Latin, Greek, Cyrillic,
  Arabic, Hebrew, and Thai. But if you draw text through QuickDraw
  Text, you have access only to the MacRoman repertoire. To access the
  rest, you must use Cocoa or ATSUI.

Steven Tamm is working on ATSUI support, and he is planning to add it
to the unicode branch.  I also think that it is not time to add such a
drastic change into the upcoming release version.  My change about
Central European and Cyrillic display support is a "stopgap" that is
intended not to change existing mechanisms.

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Special Characters on Mac Emacs
  2005-03-25  6:48         ` YAMAMOTO Mitsuharu
  2005-03-25  9:50           ` YAMAMOTO Mitsuharu
  2005-03-25 15:34           ` Sébastien Kirche
@ 2005-03-29 10:03           ` Sébastien Kirche
  2005-04-01 11:02             ` YAMAMOTO Mitsuharu
  2 siblings, 1 reply; 14+ messages in thread
From: Sébastien Kirche @ 2005-03-29 10:03 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 3512 bytes --]

Le 25 Mar 2005, YAMAMOTO Mitsuharu vraute :

> > - following your example M-: (set-frame-font
> > (create-fontset-from-mac-roman-font
> > "-apple-monaco-medium-r-normal--9-90-75-75-m-90-mac-roman"))
> 
> > I can see that the frame briefly flashes then it redisplays with the
> > etl font.
> 
> I couldn't reproduce (even after installing ETL fonts from
> http://members.shaw.ca/akochoi-emacs/stories/resources.html).  If you
> tried without -Q option, could you try again with it? 

Checked. Problem seems to  be on my side as the same  command with -Q option
correctly changes the fontset.

I should investigate that but I don't know what to look for.
Maybe you will you see something wrong in my settings ?
,----
| ;; pour pas se prendre les pieds dans le tapis entre latin-1 et latin-9
| (require 'ucs-tables)
| (unify-8859-on-encoding-mode 1)
| ;;(unify-8859-on-decoding-mode 1) ;;plus pour emacs21/cvs ?
| 
| (set-language-environment 'latin-9)
| (prefer-coding-system 'latin-9)
`----
And the part relative to Macintosh
,----
| (cond ((eq system-type 'darwin)   ; réglages pour le mac
|        
| 	   ;;(message "on est sous mac")
| 	   
| 	   (setq process-connection-type t);en shell pour voir l'affichage
| 	   
| 	   (setq mac-command-key-is-meta t);pomme = méta
| 	   (setq mac-pass-command-to-system nil);évite de cacher emacs avec M-h
| 	   
| 	   ;; iso-latin-1 input encoding ?
| 	   ;;(setq mac-keyboard-text-encoding kTextEncodingISOLatin1)
| 	   ;;(set-keyboard-coding-system 'iso-latin-1)
| 	   ;; To modify mac/unix/dos encodings: CTRL-X RET f
| 	   
| 	   (set-terminal-coding-system 'latin-9)
| 	   (set-keyboard-coding-system 'mac-roman)
| 	   ;;(set-frame-font "fontset-mac")
| 	   ;;(setq default-buffer-file-coding-system 'iso-latin-9-mac) ;attention prefer-coding-system
| 
| 	   (setq mac-wheel-button-is-mouse-2 t);
| 	   (setq mac-emulate-three-button-mouse 1); option = mouse2 / command = mouse3
| 
| 	   (if window-system 
| 		   (progn
| 			 (set-background-color "gray90")
| 			 
| 			 ;;X fonts specs format (désignation des fontes X)
| 			 ;;-FOUNDRY-FAMILY-WEIGHT-SLANT-WIDTH--PIXELS-POINTS-HRES-VRES-SPACING-AVEWIDTH-CHARSET 
| 			 
| 			 ;; Set frame size, color and fonts
| 			 (create-fontset-from-fontset-spec
| 			  "-apple-monaco-medium-r-normal--9-*-*-*-*-*-fontset-monaco,
|         ascii:-apple-monaco-medium-r-normal--9-90-75-75-m-90-mac-roman,
|         mule-unicode-0100-24ff:-apple-lucida grande-medium-r-normal--0-0-75-75-m-0-mac-roman,
|         mule-unicode-2500-33ff:-apple-bitstream vera sans mono bold-medium-r-normal--0-0-75-75-m-0-mac-roman,
|         latin-iso8859-15:-apple-monaco-medium-r-normal--9-90-75-75-m-90-mac-roman,
|         latin-iso8859-1:-apple-monaco-medium-r-normal--9-90-75-75-m-90-mac-roman")
| 			 (setq default-frame-alist '((width . 120) 
| 										 (height . 44) 
| 										 (top . 440);pixels
| 										 (left . 260);pixels
| 										 (font . "fontset-monaco");fontset-mac
| 										 ))
| 			 )
| 		 )
| 	   (global-set-key (kbd "<kp-delete>") 'delete-char)    ;touche suppr
| 	   (global-set-key (kbd "<kp-divide>") "/")             ;touche division sur pavé num (inactif sur mon poste ?)
| 	   (global-set-key (kbd "<C-kp-home>") (kbd "<C-home>"));idem /
| 	   (global-set-key (kbd "<C-kp-end>") (kbd "<C-end>"))  ;idem /
 	   )
`----


> Also,    could    you    show    the    result    of    (describe-font-set
> "fontset-mac_roman_9") ?

I have attached the result of describe-fontset with and without -Q option.


[-- Attachment #2: with -Q --]
[-- Type: application/octet-stream, Size: 17274 bytes --]

[-- Attachment #3: without -Q --]
[-- Type: application/octet-stream, Size: 2654 bytes --]

[-- Attachment #4: Type: text/plain, Size: 32 bytes --]


Regards.

-- 
Sébastien Kirche

[-- Attachment #5: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Special Characters on Mac Emacs
  2005-03-26  5:00             ` YAMAMOTO Mitsuharu
@ 2005-03-31  3:43               ` Steven Tamm
  2005-03-31 11:20                 ` Sébastien Kirche
  0 siblings, 1 reply; 14+ messages in thread
From: Steven Tamm @ 2005-03-31  3:43 UTC (permalink / raw)
  Cc: Sébastien Kirche, emacs-devel

ATSUI means a rewrite of a large portion of the display code, with the  
benefit that it will display all unicode characters consistently.  The  
change from the emacs-unicode-2 branch for storing the internals as  
unicode will dramatically reduce the cost of implementing this feature.

However, I'm having much difficulty in keeping the font specificationss  
consistent between quickdraw and ATSUI (let alone the near  
impossibility of determining glyph widths in a manner that's fast).   
I'll have to write this up and send it around.

-Steven

On Mar 25, 2005, at 9:00 PM, YAMAMOTO Mitsuharu wrote:

>>>>>> On Fri, 25 Mar 2005 16:34:55 +0100, Sébastien Kirche  
>>>>>> <sebastien.kirche.no@spam.free.fr.invalid> said:
>
>>> I suppose no characters in mule-unicode-2500-33ff is accessible
>>> from QuickDraw Text API that Carbon Emacs is currently using for
>>> drawing text, at least when using with bundled fonts.
>
>> What i can't figure out is that within OSX you can have any unicode
>> char you want providing that the application is unicode compliant
>> and that character is accessible at least from the system character
>> palette.
>
>> But for Emacs there is that strange remapping for parts of the
>> unicode set.  So some chars are ok and some not.
>
> Quote from "Internationalizing Your Software: File Encodings and  
> Fonts":
> http://developer.apple.com/documentation/MacOSX/Conceptual/ 
> BPInternational/Concepts/FileEncodings.html
>
>   Carbon and QuickDraw Issues
>
>   If you have existing QuickDraw code and want to draw text, you
>   should be aware that the QuickDraw Text routines do not directly
>   support Unicode.
> 				  :
>   The fonts that are installed with Mac OS X have large character sets
>   supporting a wide range of encodings and scripts. For example,
>   Lucida, the system font, supports extended Latin, Greek, Cyrillic,
>   Arabic, Hebrew, and Thai. But if you draw text through QuickDraw
>   Text, you have access only to the MacRoman repertoire. To access the
>   rest, you must use Cocoa or ATSUI.
>
> Steven Tamm is working on ATSUI support, and he is planning to add it
> to the unicode branch.  I also think that it is not time to add such a
> drastic change into the upcoming release version.  My change about
> Central European and Cyrillic display support is a "stopgap" that is
> intended not to change existing mechanisms.
>
> 				     YAMAMOTO Mitsuharu
> 				mituharu@math.s.chiba-u.ac.jp
>
>
> _______________________________________________
> Emacs-devel mailing list
> Emacs-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Special Characters on Mac Emacs
  2005-03-31  3:43               ` Steven Tamm
@ 2005-03-31 11:20                 ` Sébastien Kirche
  0 siblings, 0 replies; 14+ messages in thread
From: Sébastien Kirche @ 2005-03-31 11:20 UTC (permalink / raw)


Le 31 Mar 2005, Steven Tamm s'est exprimé ainsi :

> However, I'm having much difficulty in keeping the font specificationss  
> consistent between quickdraw and ATSUI (let alone the near  
> impossibility of determining glyph widths in a manner that's fast).   
> I'll have to write this up and send it around.

I am quite sure  that I wont be able to help much for  the coding, but I can
offer some help for testing.

Do you know how many developers are working on the OSX port ?

-- 
Sébastien Kirche

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Special Characters on Mac Emacs
  2005-03-29 10:03           ` Sébastien Kirche
@ 2005-04-01 11:02             ` YAMAMOTO Mitsuharu
  2005-04-01 11:56               ` Sébastien Kirche
  0 siblings, 1 reply; 14+ messages in thread
From: YAMAMOTO Mitsuharu @ 2005-04-01 11:02 UTC (permalink / raw)
  Cc: emacs-devel

>>>>> On Tue, 29 Mar 2005 12:03:45 +0200, Sébastien Kirche <sebastien.kirche.no@spam.free.fr.invalid> said:

>> I couldn't reproduce (even after installing ETL fonts from
>> http://members.shaw.ca/akochoi-emacs/stories/resources.html).  If
>> you tried without -Q option, could you try again with it?

> Checked. Problem seems to be on my side as the same command with -Q
> option correctly changes the fontset.

> I should investigate that but I don't know what to look for.  Maybe
> you will you see something wrong in my settings ?

I created .emacs from your mail, but still I couldn't reproduce the
problem.  Do you have other settings that is read at startup time,
such as default.el?

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Special Characters on Mac Emacs
  2005-04-01 11:02             ` YAMAMOTO Mitsuharu
@ 2005-04-01 11:56               ` Sébastien Kirche
  0 siblings, 0 replies; 14+ messages in thread
From: Sébastien Kirche @ 2005-04-01 11:56 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 4050 bytes --]

Le 1 Apr 2005, YAMAMOTO Mitsuharu a dit :

> I created .emacs from your mail, but still I couldn't reproduce the
> problem. 

Oh. :/

> Do  you  have  other settings  that  is  read  at  startup time,  such  as
> default.el?

No. 
And  i  have just  checked  that  .emacs-custom  does not  contain  anything
relative to fonts/fontset except some custom faces for gnus.

But my .emacs is  longer than the part i posted. And  i have also a personal
directory for  testing packages that is  in the load-path. Maybe  there is a
another  setting  on my  .emacs  or  a package  in  the  load-path that  has
side-effects...

If you  are curious, here  I have attached  my .emacs. (that i  am currently
trying to re-arrange : work in progress ;)

And here is the content of my .elisp/ : almost all are standard packages.

,----[ ls -l ~/.elisp ]
| total 1068
| drwxr-xr-x   21 seki     staff         714 Feb  9 17:50 Pymacs-0.22
| drwxr-xr-x   11 seki     staff         374 Aug 15  2002 TwistedEmacs
| -rw-r--r--    1 seki     staff       33702 Jan  5  2004 ascii.el
| drwxrwxrwx   16 seki     staff         544 Jul  9  2003 auctex
| drwxr-xr-x   21 seki     staff         714 Feb  1 15:30 bbdb-2.35
| -rw-r--r--    1 seki     staff       17725 Sep  9  2003 boxquote.el
| -rw-r--r--    1 seki     staff        2911 Jan  5  2004 buffer-variables.el
| drwxr-xr-x   12 seki     staff         408 Feb 21 11:21 cedet
| -rwxrwxrwx    1 seki     staff        5594 Oct 17  2003 csv.el
| drwxr-xr-x    5 seki     staff         170 Oct 15  2003 dosbat
| drwxr-xr-x   40 seki     staff        1360 Feb 21 11:36 ecb-2.31
| drwxr-xr-x   61 seki     staff        2074 Dec 22  2003 emacs-goodies-el
| drwxr-xr-x    6 seki     staff         204 Apr 29  2004 emacs-wiki
| drwxr-xr-x   48 seki     staff        1632 Apr 23  2004 emu
| drwxr-xr-x   15 seki     staff         510 Sep 28  2004 etask-0.2.90
| -rw-r--r--    1 seki     staff        6221 Oct 11 22:02 find-this-file.el
| -rw-r--r--    1 seki     staff        4948 Jun 15  2003 fink-startup.el
| -rw-r--r--    1 seki     wheel       21760 Oct 26 14:02 fold.el
| -rw-r--r--    1 seki     staff      211255 Oct 26 11:20 folding.el
| drwxr-xr-x  315 seki     staff       10710 Mar 30 16:46 gnus
| drwxr-xr-x    9 seki     staff         306 Jan  4 13:42 htmlfontify
| -rw-r--r--    1 seki     staff       58149 Oct 11 13:59 htmlize.el
| -rw-r--r--    1 seki     staff        5225 Oct 11 21:47 kill-ring-rotate.el
| -rwxrwxrwx    1 seki     staff       24449 Oct 17  2003 lookout.el
| -rw-r--r--    1 seki     staff       16676 Sep 17  2004 moy-bbdb.el
| -rw-r--r--    1 seki     staff        1161 Sep 12  2003 my-buffer-variables.el
| drwxr-xr-x   26 seki     staff         884 Apr 29  2004 planner
| -rw-r--r--    1 seki     staff       94843 Jun 22  2003 po-mode.el
| -rw-r--r--    1 seki     staff       69842 Jun 22  2003 po-mode.elc
| -rwxr-xr-x    1 seki     staff      215757 Nov 18 13:48 printing.el
| -rw-r--r--    1 seki     staff           0 Feb  9 17:29 pymacs.el
| -rw-r--r--    1 seki     staff         585 Feb  9 17:31 pymacs.elc
| -rw-r--r--    1 seki     wheel      123488 Mar 15  2004 python-mode.el
| drwxr-xr-x    4 seki     staff         136 Apr 22  2004 ragent
| drwxr-xr-x    9 seki     staff         306 Apr 29  2004 remember
| -rw-r--r--    1 seki     staff        1358 Jan 17 10:47 scissors.el
| -rw-r--r--    1 seki     wheel       24052 Jul 19  2004 screen-lines.el
| -rw-r--r--    1 seki     staff        3506 Jan 31 14:24 screen-lines2.el
| -rw-r--r--    1 seki     staff         304 Oct 13  2003 semantic.cache
| drwxr-xr-x   13 seki     staff         442 Oct 31  2003 ses21-020426
| -rw-r--r--    1 seki     staff         106 Jul 30  2003 subdirs.el
| -rw-r--r--    1 seki     staff       43699 Dec 18  2003 tc.el
| -rw-r--r--    1 seki     staff        6396 Jun 16  2003 tex-site.el
| -rw-r--r--    1 seki     wheel       34011 Feb  7 12:27 visual-basic-mode.el
| drwxr-xr-x    5 seki     staff         170 Oct 14 10:03 w3m
`----

If you think of something else to investigate, ask me.


[-- Attachment #2: my config file --]
[-- Type: application/emacs-lisp, Size: 38230 bytes --]

;; -*- coding: latin-9 -*-
;;+----------------------------------------------------------+
;;|                                                          |
;;|                     Seki's dotemacs                      |
;;|                                                          |
;;+----------------------------------------------------------+        
;; Time-stamp: <01/04/2005 11:23 seki@goudurix>

;; Merci à Sébastien Dinot <sebastien.dinot@free.fr>
;; à Mathieu Roy <yeupou@gnu.org>
;; et aux différentes listes et newsgroups d'entraide d'utilisateurs :
;; fr.comp.applications.emacs
;; gnu.emacs.help
;; voir ici pour les listes : http://savannah.gnu.org/mail/?group_id=40

;; Déterminer si on emploie Emacs ou XEmacs
(defvar sk:is-xemacs (string-match "XEmacs" emacs-version) 
  "Variable interne différente de nil si on est dans XEmacs")

;;chez moi
(defvar sk:home (expand-file-name "~/") "Home sweet home")
;;(if sk:is-xemacs 
;;	(setq sk:home (expand-file-name sk:home)))

;; Ajouter mon répertoire personnel à la liste des chemins de recherche
(defvar sk:elisp-path (concat sk:home ".elisp/") "Chemin vers mes packages elisp")
;;(if  sk:is-xemacs
;;    (setq sk-elisp-path (expand-file-name sk:elisp-path)))

(add-to-list 'load-path sk:elisp-path)  
(progn (cd sk:elisp-path) 
	   (normal-top-level-add-subdirs-to-load-path) 
	   (cd sk:home))

;; chemin d'un Gnus custom (si présent)
(let ((gnusp (concat sk:elisp-path "gnus/")))
  (when (file-exists-p gnusp)
	(add-to-list 'load-path gnusp)))

;; localisation des fichiers gnus (ne peut pas être dans .gnus !)
(setq gnus-home-directory  (concat sk:home ".gnus.d/"))
(setq message-directory    (concat gnus-home-directory "Mail/"))
(setq gnus-directory       (concat gnus-home-directory "News/"))
(setq gnus-agent-directory (concat gnus-home-directory "agent/"))

;; Gnus est notre courielleur
(setq read-mail-command 'gnus) ;;marche pas terrible ?
(setq mail-user-agent 'gnus-user-agent
      ;smtpmail-default-smtp-server "lumiere.ens.fr"
      ;smtpmail-smtp-server "lumiere.ens.fr"
      ;message-mail-user-agent 'gnus-user-agent
)

;; pour pas se prendre les pieds dans le tapis entre latin-1 et latin-9
(require 'ucs-tables)
(unify-8859-on-encoding-mode 1)
;;(unify-8859-on-decoding-mode 1) ;;plus pour emacs21/cvs ?

(set-language-environment 'latin-9)
(prefer-coding-system 'latin-9)
         
;; Afficher les liens avec lynx si on est en mode console
(require 'browse-url)
;(if (eq window-system nil) (setq browse-url-browser-function browse-url-default-browser));browse-url-lynx-emacs))

;;======= SPECIFIQUE PLATEFORME ==========================================================
(cond ((eq system-type 'darwin)   ; réglages pour le mac
       
	   ;;(message "on est sous mac")
	   
	   (setq process-connection-type t);en shell pour voir l'affichage
	   
	   (setq mac-command-key-is-meta t);pomme = méta
	   (setq mac-pass-command-to-system nil);évite de cacher emacs avec M-h
	   
	   ;; iso-latin-1 input encoding ?
	   ;;(setq mac-keyboard-text-encoding kTextEncodingISOLatin1)
	   ;;(set-keyboard-coding-system 'iso-latin-1)
	   ;; To modify mac/unix/dos encodings: CTRL-X RET f
	   
	   (set-terminal-coding-system 'latin-9)
	   (set-keyboard-coding-system 'mac-roman)
	   ;;(set-frame-font "fontset-mac")
	   ;;(setq default-buffer-file-coding-system 'iso-latin-9-mac) ;attention prefer-coding-system + bas

	   (setq mac-wheel-button-is-mouse-2 t);???
	   (setq mac-emulate-three-button-mouse 1); option = mouse2 / command = mouse3

	   (if window-system 
		   (progn
			 (set-background-color "gray90")
			 
			 ;;X fonts specs format (désignation des fontes X)
			 ;;-FOUNDRY-FAMILY-WEIGHT-SLANT-WIDTH--PIXELS-POINTS-HRES-VRES-SPACING-AVEWIDTH-CHARSET 
			 
			 ;; Set frame size, color and fonts
			 (create-fontset-from-fontset-spec
			  "-apple-monaco-medium-r-normal--9-*-*-*-*-*-fontset-monaco,
        ascii:-apple-monaco-medium-r-normal--9-90-75-75-m-90-mac-roman,
        mule-unicode-0100-24ff:-apple-lucida grande-medium-r-normal--0-0-75-75-m-0-mac-roman,
        mule-unicode-2500-33ff:-apple-bitstream vera sans mono bold-medium-r-normal--0-0-75-75-m-0-mac-roman,
        latin-iso8859-15:-apple-monaco-medium-r-normal--9-90-75-75-m-90-mac-roman,
        latin-iso8859-1:-apple-monaco-medium-r-normal--9-90-75-75-m-90-mac-roman")
			 (setq default-frame-alist '((width . 120) 
										 (height . 44) 
										 (top . 440);pixels
										 (left . 260);pixels
										 (font . "fontset-monaco");fontset-mac
										 ;(font . (create-fontset-from-mac-roman-font "-apple-monaco-medium-r-normal--9-90-75-75-m-90-mac-roman"))
										 ))
			 )
		 )
	   (global-set-key (kbd "<kp-delete>") 'delete-char)    ;touche suppr
	   (global-set-key (kbd "<kp-divide>") "/")             ;touche division sur pavé num (inactif sur mon poste ?)
	   (global-set-key (kbd "<C-kp-home>") (kbd "<C-home>"));idem /
	   (global-set-key (kbd "<C-kp-end>") (kbd "<C-end>"))  ;idem /
	   ;;(global-set-key "?" (sk-insere-euro t));j'arrive pas avec l'euro ;( €€ et si !
	   
	   (setq printer-name "IMP_DEV_PROJ")
	   )

;;=================================================================

      ((eq system-type 'windows-nt); réglages pour windows
       (progn
         ;;(message "on est sous ouin-ouin")
         (global-set-key [128] 'sk-insere-euro); C-h l donne \200 pour l'euro soit 128 en décimal

		 ;; Mouse wheel
		 (defun up-slightly () (interactive) (scroll-up 5))
		 (defun down-slightly () (interactive) (scroll-down 5))
		 (global-set-key [mouse-4] 'down-slightly)
		 (global-set-key [mouse-5] 'up-slightly)
		 
		 (defun up-one () (interactive) (scroll-up 1))
		 (defun down-one () (interactive) (scroll-down 1))
		 (global-set-key [S-mouse-4] 'down-one)
		 (global-set-key [S-mouse-5] 'up-one)
		 
		 (defun up-a-lot () (interactive) (scroll-up))
		 (defun down-a-lot () (interactive) (scroll-down))
		 (global-set-key [C-mouse-4] 'down-a-lot)
		 (global-set-key [C-mouse-5] 'up-a-lot)
		 ;; Mouse wheel

         (if window-system 
			 (progn
			   (set-background-color "gray90")
			   ;;-outline-Lucida Console-normal-r-normal-normal-11-82-96-96-c-70-iso8859-1
			   ;; Set frame size, color and fonts
			   (create-fontset-from-fontset-spec
				"-*-lucida console-*-*-*-*-10-*-*-*-*-*-fontset-lucida,
          ascii:-*-lucida console-*-*-*-*-10-*-*-*-*-*-iso8859-1,
          latin-iso8859-1:-*-lucida console-*-*-*-*-10-*-*-*-*-*-iso8859-1")
			   ;;        (create-fontset-from-fontset-spec
			   ;;         "-apple-monaco-medium-r-normal--9-*-*-*-*-*-fontset-monaco,
			   ;;          ascii:-apple-monaco-medium-r-normal--9-90-75-75-m-90-mac-roman,
			   ;;          latin-iso8859-1:-apple-monaco-medium-r-normal--9-90-75-75-m-90-mac-roman") 
			   (setq default-frame-alist '((width . 100) 
										   (height . 44) 
										   (top . 50);pixels
										   (left . 50);pixels
										   (font . "fontset-lucida");fontset-mac
										   ))
			   )
		   )
         )
       )

;;=================================================================

      ((eq system-type 'gnu/linux); réglages pour Linux
       (progn
		 ;;(message "on est avec le pingouin")
         ();rien d'autre
		 
		 ;; Mouse wheel
		 ;; remplacé par mwheel (mouse-wheel-mode est t par défaut)
		 ;; (defun up-slightly () (interactive) (scroll-up 5))
		 ;; (defun down-slightly () (interactive) (scroll-down 5))
		 ;; (global-set-key [mouse-4] 'down-slightly)
		 ;; (global-set-key [mouse-5] 'up-slightly)
		 
		 ;; (defun up-one () (interactive) (scroll-up 1))
		 ;; (defun down-one () (interactive) (scroll-down 1))
		 ;; (global-set-key [S-mouse-4] 'down-one)
		 ;; (global-set-key [S-mouse-5] 'up-one)
		 
		 ;; (defun up-a-lot () (interactive) (scroll-up))
		 ;; (defun down-a-lot () (interactive) (scroll-down))
		 ;; (global-set-key [C-mouse-4] 'down-a-lot)
		 ;; (global-set-key [C-mouse-5] 'up-a-lot)
		 ;; Mouse wheel

         (if window-system 
			 (progn
			   (set-background-color "gray90")
			   (create-fontset-from-fontset-spec
				"-gnu-unifont-*-*-*-*-16-*-*-*-*-*-fontset-unifont,
          ascii:-gnu-unifont-medium-r-normal--16-160-75-75-c-80-iso10646-1,
          latin-iso8859-1:-gnu-unifont-medium-r-normal--16-160-75-75-c-80-iso10646-1")
			   ;;          ascii:-gnu-unifont-*-*-*-*-*-120-*-*-*-*-iso10646-1,
			   ;;         latin-iso8859-1:-gnu-unifont-*-*-*-*-*-120-*-*-*-*-iso10646-1")
			   
			   (setq default-frame-alist '((width . 110) 
										   (height . 45) 
										   (top . 80);pixels
										   (left . 180);pixels
										   ;;(font . "fontset-unifont")
										   (font . "6x12")
										   ))
			   ;;(setq browse-url-browser-function (quote browse-url-galeon)
			   ;;	 browse-url-galeon-arguments (quote ("-n")))
			   
			   (defun browse-url-firefox-new-tab (url &optional new-window)
				 "Open URL in a new tab in Firefox."
				 (interactive (browse-url-interactive-arg "URL: "))
				 (let ((cmd (shell-command-to-string
							 (concat "mozilla-firefox -a firefox -remote 'openURL("
									 url ",new-tab)' > /dev/null"))))
				   (unless (string= "" cmd)
					 (message "Starting Firefox...")
					 (start-process (concat "firefox " url) nil "/bin/sh" "-c" 
									(concat "mozilla-firefox " url "|| true"))
					 (message "Starting Firefox...done"))))
			   
			   (setq browse-url-browser-function 'browse-url-firefox-new-tab)
			   )
           )
		  (setq printer-name "Idefix")
         )
	   )
      )

;;=================================================================
;; Inhiber l'affichage du message d'accueil
(setq inhibit-startup-message t)
 
;; C'est fastidieux de taper « yes » pour confirmer, raccourcissons
;; cela à « y » (idem pour « no », désormais « n »).
(fset 'yes-or-no-p 'y-or-n-p)

;; Ne pas utiliser de boîte de dialogue mais le minibuffer pour poser une question
;; (les dialogues marchent mal sous OSX pour choisir un fichier inexistant)
(setq use-dialog-box nil
	  use-file-dialog nil)

;; Supprimer les fichiers de sauvegarde en quittant.
;; (vous savez, ces fameux fichiers dont le nom se termine par « ~ »)
(setq make-backup-files nil)

;; Gestion et affichage corrects des accents.
;;(require 'iso-acc) à éviter d'après f.c.a.emacs

;; Aide interne de la fonction ci-dessous
;; Non-nil means display unibyte text according to language environment.
;; Specifically this means that unibyte non-ASCII characters
;; are displayed by converting them to the equivalent multibyte characters
;; according to the current language environment.  As a result, they are
;; displayed according to the current fontset.
(setq unibyte-display-via-language-environment t)

;; Afficher les caractères de contrôle sous la forme d'un caractère
;; « ^ » suivi de la lettre correspondante au lieu de la forme octale.
(setq-default ctl-arrow 'latin-9)

;;ne pas afficher les espaces insécables précédés d'un "\"
;;nouveauté emacs 21.3.50 (cvs)
(setq show-nonbreak-escape nil)

;; Laisser le curseur en place lors d'un défilement par pages.
;; Par défaut, Emacs place le curseur en début ou fin d'écran
;; selon le sens du défilement.
(setq scroll-preserve-screen-position t)

;; Faire apparaître la position du curseur dans la ligne modale
(setq column-number-mode t)
(setq line-number-mode t)

;; mise à jour auto des time-stamps
(add-hook 'write-file-hooks 'time-stamp)

;; se rappeler de la position dans le fichier entre les sessions
(when (require 'saveplace)
  (setq-default save-place t))

;; Pour l'impression, du papier au format A4 est utilisé
(setq ps-paper-type 'a4)

;; Si cette variable est différente de 'nil', lorsque l'on est à la fin
;; d'une ligne, le déplacement vertical du curseur s'accompagne d'un
;; déplacement horizontal pour atteindre la fin de la ligne courante.
;; Si cette variable vaut 'nil', le déplacement est strictement vertical.
;;(setq track-eol nil)

;; La fin d'une phrase n'est pas marquée par un point suivi de deux espaces,
;; un seul suffit.
(setq sentence-end-double-space nil)

;; s'assurer que les fichiers comportent des newline finaux
;; nil		n'ajoute pas de newline
;; non-nil	pose la question
;; t		rajoute les newlines automatiquement
(setq require-final-newline 1)

;;========== ERGONOMIE =========================

;; Nouveauté 22.00 : mouse-1 sur un lien suit ce lien
;; je préfère l'ancien comportement
;; (setq mouse-1-click-follows-link nil)
;; en fait il suffit de cliquer plus longtemps que la valeur de cette
;; variable (par défaut 350 ms)

;; En rendant nulle la variable ci-dessous, l'insertion d'un texte par
;; « copier-coller » à la souris se fait au niveau du point cliqué et
;; non à la position du curseur texte.
(setq mouse-yank-at-point nil)
  
;; Mise en surbrillance des lignes sélectionnées et écrasement de ces
;; dernières lorsqu'on saisit du texte dans la foulée.
(if sk:is-xemacs
  ; on utilise XEmacs
  (progn 
    (require 'pending-del)
    (custom-set-variables '(pending-delete-mode t t)))
  ;; on utilise Emacs
  ;; Avec emacs 21, la surbrillance est disponible en mode console. Cool !
  (progn
    (delete-selection-mode t)
    (transient-mark-mode t))
)

;; Si cette variable est différente de 'nil', lorsque l'on est à la fin
;; d'une ligne, le déplacement vertical du curseur s'accompagne d'un
;; déplacement horizontal pour atteindre la fin de la ligne courante.
;; Si cette variable vaut 'nil', le déplacement est strictement vertical.
(setq track-eol 'nil)
 
;; saisie universelle des caractères accentués par c-' c-` c-" + lettre
;; pratique pour les majuscules
;;(define-key key-translation-map [(control ?^)] 'iso-transl-ctl-8-x-map)
(define-key key-translation-map [(control ?')] (lookup-key key-translation-map [(control ?x) ?8 ?']))
(define-key key-translation-map [(control ?`)] (lookup-key key-translation-map [(control ?x) ?8 ?`]))
(define-key key-translation-map [(control ?")] (lookup-key key-translation-map [(control ?x) ?8 ?"]))
(global-set-key [(control ?6)] (lookup-key key-translation-map [(control ?x) ?8 ?^]))

(if (eq system-type 'gnu/linux)
    (define-key key-translation-map [(control 2226)] (lookup-key key-translation-map [(control ?x) ?8]))
  (define-key key-translation-map [(control 178)] (lookup-key key-translation-map [(control ?x) ?8]))
)

;; Completion automatique via Shift-Tab (EmacsFR)
(global-set-key (quote [S-iso-lefttab]) (quote dabbrev-expand))
(global-set-key (quote [S-tab]) (quote dabbrev-expand))

;; Changement de fenetre moins fatigant que Ctrl-x o (EmacsFR)
(global-set-key [(control tab)] `other-window)
(global-set-key [C-S-iso-lefttab] '(lambda () (interactive) (other-window -1)))

;; Changement de buffer C-x b amélioré
;(iswitchb-mode)
(when (require 'ido nil t)
  (ido-mode t))

;; goto-line n'est mappé par défaut que dans le menu
(global-set-key "\C-cg" 'goto-line)

;; Suivi des fichiers récents
(when (require 'recentf)
  (setq recentf-auto-cleanup 'never) ;; évite de vérifier les fichiers distants au démarrage
  (recentf-mode 1))

;; parcours du kill-ring pour insertion
(require 'kill-ring-rotate nil t)

;;============== DATE et HEURE =====================================
;; La semaine commence le lundi
(setq calendar-week-start-day 1)
;; Afficher l'heure dans la barre d'état (format 24 heures)
(setq display-time-24hr-format t)
(display-time)

;; Nom en clair des jours et mois apparaissant dans le calendrier
(defvar calendar-day-abbrev-array
  ["dim" "lun" "mar" "mer" "jeu" "ven" "sam"])
(defvar calendar-day-name-array
  ["dimanche" "lundi" "mardi" "mercredi" "jeudi" "vendredi" "samedi"])
(defvar calendar-month-abbrev-array
  ["jan" "fév" "mar" "avr" "mai" "jun"
   "jul" "aoû" "sep" "oct" "nov" "déc"])
(defvar calendar-month-name-array
  ["janvier" "février" "mars" "avril" "mai" "juin"
   "juillet" "août" "septembre" "octobre" "novembre" "décembre"])

;;format de date français
(setq calendar-date-display-form '(dayname " " day " " monthname " " year))

;;localisation de Metz
(setq calendar-latitude [49 7 north])
(setq calendar-longitude [6 11 east])

;;;;;;CUSTOM;;;;;;;;;;;;;;;;;;;;;;;;
;;transféré dans .emacs-custom
;; customize ne doit pas écrire dans ~/.emacs
(setq custom-file "~/.emacs.d/.emacs-custom")
(load-file "~/.emacs.d/.emacs-custom")


;; ===== FONCTIONS =========================
; insertion de la date courante
(defun sk-insere-date ()
  (interactive)
  (insert (calendar-date-string (calendar-current-date))))

;; insertion de la date sélectionnée dans le calendrier
;; le focus doit être dans le buffer où l'on insère
(defun sk-insere-date-sel ()
  (interactive)
  (when (and (boundp 'calendar-buffer)
             (buffer-live-p (get-buffer calendar-buffer))
             (let ((str
                    (with-current-buffer calendar-buffer
                      (calendar-date-string (calendar-cursor-to-date t)))))
               (insert str)))))

;; fonction pour insérer l'euro (fonction à 10 EUR ;o)
(defun sk-insere-euro (&optional arg) "Insère le symbole Euro ISO 8859-15.

Avec un préfixe, insère la version Unicode."
  (interactive "*P")
  (if arg
      (insert (make-char 'mule-unicode-0100-24ff 116 76))
    (insert (make-char 'latin-iso8859-15 164))))

(if (eq system-type 'darwin)
    (progn
      (defvar sw-last-applescript nil
        "Stores the last Applescript command executed from Emacs.") 
      
      (defvar sw-applescript-buffer-name "*AppleScript output*"
        "Name for the buffer to display AppleScript output.") 
      
      (defun sw-applescript-run-buffer ()
        "Execute the whole buffer as an Applescript"
        (interactive)
        (setq sw-last-applescript (buffer-string))
        (sw-run-and-display-applescript (buffer-string))) 
      
      (defun sw-applescript-run-region ()
        "Execute the region as an Applescript"
        (interactive)
        (let ((region (buffer-substring (region-beginning) (region-end))))
          (setq sw-last-applescript region)
          (sw-run-and-display-applescript region))) 
      
      (defun sw-run-last-applescript ()
        "Run the last Applescript command again"
        (interactive)
        (sw-run-and-display-applescript sw-last-applescript)) 
      
      (defun sw-run-and-display-applescript (code)
        "Switch to the AppleScript buffer, erase it, run the code and display the results."
        (switch-to-buffer (get-buffer-create sw-applescript-buffer-name))
        (erase-buffer)
        (insert (do-applescript code)))
     ))

;;;;;;;;;;;;;TEMPO;;;;;;;;;;


;(require 'tex-site)

;box-quotes
(require 'boxquote)

; folding mode
(if (load "folding" 'nomessage 'noerror)
    (folding-mode-add-find-file-hook))

; Colorisation syntaxique maximale dans tous les modes
; Avec emacs 21, la colorisation est disponible en mode texte. Cool !
(global-font-lock-mode t)
(setq font-lock-maximum-decoration t)

; Montrer la correspondance des parenthèses
; (systématiquement et non seulement après la frappe)
(when (require 'paren)
  (show-paren-mode t)
  (setq blink-matching-paren t)
  (setq blink-matching-paren-on-screen t)
  (setq show-paren-style 'parenthesis)
  ;;(setq show-paren-style 'expression)
  (setq blink-matching-paren-dont-ignore-comments t))

; Effacer tous les espaces en fin de ligne
(defun delete-trailing-spaces ()
  "Effacer les espaces et tabulations en fin de chaque ligne du tampon"
  (interactive)
  (progn
    (save-excursion
      (goto-line 1)
      (replace-regexp "[ \t]+$" "")
    )
  )
)
; Conversion des fins de lignes du format MS-DOS au format Unix
(defun dos2unix ()
  (interactive)
  (goto-char (point-min))
  (while (search-forward "\r" nil t)
    (replace-match "")
  )
)


; Conversion des fins de ligne du format Unix au format MS-DOS
(defun unix2dos ()
  (interactive)
  (goto-char (point-min))
  (while (search-forward "\n" nil t)
    (replace-match "\r\n")
  )
)


; Montrer la table des caractères ASCII étendus
; Fonction fournie par Alex Schroeder <asc@bsiag.com>
(defun ascii-table ()
  "Afficher la table de caractères ASCII."
  (interactive)
  (switch-to-buffer "*ASCII*")
  (erase-buffer)
  (insert (format "Caractères ASCII de code 1 à 254.\n"))
  (let ((i 0))
    (while (< i 254) (setq i (+ i 1))
      (insert (format "%4d %c\n" i i))
    )
  )
  (beginning-of-buffer)
)

; choix de la base décimale pour la saisie de caractères quotés (C-q n°)
(setq read-quoted-char-radix 10)

;insertion date v2
; File: .emacs-key-time
; Purpose: Insert date and time into the current buffer.
;

; a remplacer quand je pourrais
(load-library "calendar.elc")

(defun emacs-key-time () "\
Return a string containing the current Emacs date and time from
the system."

  (interactive)
  (if (interactive-p)
    (insert (current-time-string))
  )
)

(global-set-key "\C-x\/" 'emacs-key-time)       ; define date and time key.
;(global-set-key "\e\/"   'emacs-key-time)       ; define date and time key.

; caractères OEM DOS
;  (require 'iso-oem)
;  (standard-display-iso-oem)


; Reglages DocBook
; DocBook IDE mode
;(autoload 'docbook-mode "docbookide" "Major mode for DocBook documents." t)

; Turn on font lock when in DocBook mode
(add-hook 'docbook-mode-hook
      'turn-on-font-lock)

;; Emacs/W3 Configuration
;(setq load-path (cons "/sw/share/emacs/site-lisp" load-path))
;(condition-case () (require 'w3-auto "w3-auto") (error nil))
(require 'w3m-load)
(if (string-match "\\`goudurix" system-name)
	(setq w3m-icon-directory "~/.elisp/w3m/icons"))

;gestionnaire de signal USR1 (possible avec USR2)
;(defun test-seki ()"" (interactive )(message "key usr1"))
;(global-set-key [usr1-signal] 'test-seki )
;(add-hook 'signal-USR1-hook (lambda () (test-seki)))

;gestionnaire timer
;   (run-with-idle-timer 60 'repeat
;      (lambda ()
;        (let ((buf (get-buffer "the bufferIwanttosave")))
;          (if buf
;              (with-current-buffer buf
;                (save-buffer))))))


;;;;TEST
; (autoload 'wl "wl" "Wanderlust" t)
; (autoload 'wl-other-frame "wl" "Wanderlust on new frame." t)
; (autoload 'wl-draft "wl-draft" "Write draft with Wanderlust." t)

;limite l'affichage de la charge système au dessus d'un certain seuil
(setq display-time-load-average-threshold 1.0)

;(require 'bbdb)
;(bbdb-initialize)

;(autoload 'pymacs-load "pymacs" nil t)
;     (autoload 'pymacs-eval "pymacs" nil t)
;     (autoload 'pymacs-apply "pymacs")
;     (autoload 'pymacs-call "pymacs")
;     (eval-after-load "pymacs"
;       '(add-to-list 'pymacs-load-path "~/.elisp/Pymacs-0.22")) 
;(put 'upcase-region 'disabled nil)


;(put 'dired-find-alternate-file 'disabled nil)
;; we want dired not not make always a new buffer if visiting a directory
    ;; but using only one dired buffer for all directories.
;; (eval-after-load "dired" 
;; '(progn
;;     (defadvice dired-advertised-find-file (around dired-subst-directory activate)
;;       "Replace current buffer if file is a directory."
;;       (interactive)
;;       (let ((orig (current-buffer))
;;             (filename (dired-get-filename)))
;;         ad-do-it
;;         (when (and (file-directory-p filename)
;;                    (not (eq (current-buffer) orig)))
;;           (kill-buffer orig))))))
(eval-after-load "dired"
  '(progn
     (defadvice dired-advertised-find-file (around dired-subst-directory activate)
       "Replace current buffer if file is a directory."
       (interactive)
       (let* ((orig (current-buffer))
              (filename (dired-get-filename))
              (bye-p (file-directory-p filename)))
         ad-do-it
         (when (and bye-p (not (string-match "[/\\\\]\\.$" filename)))
           (kill-buffer orig)))))) 


(defun sk-oe (&optional arg) "Insère le e dans l'o."
  (interactive "*P")
;  (if arg
;     (insert (make-char 'mule-unicode-0100-24ff 116 76))
    (insert (make-char 'latin-iso8859-15 #xBD)))

;;============== paramétrage BBDB =======================================
(when (require 'bbdb)
  (bbdb-initialize 'gnus 'message)
  (setq gnus-optional-headers 'bbdb/gnus-lines-and-from
		bbdb-complete-name-allow-cycling t
		bbdb-send-mail-style 'gnus);'message)
  (autoload 'bbdb/gnus-lines-and-from "bbdb-gnus")
  (autoload 'bbdb         "bbdb-com" "Insidious Big Brother Database" t)
  (autoload 'bbdb-name    "bbdb-com" "Insidious Big Brother Database" t)
  (autoload 'bbdb-company "bbdb-com" "Insidious Big Brother Database" t)
  (autoload 'bbdb-net     "bbdb-com" "Insidious Big Brother Database" t)
  (autoload 'bbdb-notes   "bbdb-com" "Insidious Big Brother Database" t)
  (autoload 'bbdb-insinuate-vm       "bbdb-vm"    "Hook BBDB into VM")
  (autoload 'bbdb-insinuate-rmail    "bbdb-rmail" "Hook BBDB into RMAIL")
  (autoload 'bbdb-insinuate-mh       "bbdb-mhe"   "Hook BBDB into MH-E")
  (autoload 'bbdb-insinuate-gnus     "bbdb-gnus"  "Hook BBDB into GNUS")
  (autoload 'bbdb-insinuate-sendmail "bbdb"       "Hook BBDB into sendmail")
  (add-hook 'gnus-startup-hook 'bbdb-insinuate-gnus)

  ;;ajout des contacts à l'envoi
  (autoload 'bbdb/send-hook "moy-bbdb" 
	"Function to be added to `message-send-hook' to notice records when sending messages" t)
  (add-hook 'message-send-hook 'bbdb/send-hook) 

  ;; par defaut bbdb est configure pour accepter les numeros de
  ;; telephone au format americain ici on desactive cette option
  (setq bbdb-north-american-phone-numbers-p nil)
  ;; permet d'eviter d'avoir une fenetre bbdb qui montre en permanence
  ;; les mises a jour dans bbdb lorsque l'on utilise VM, MH, RMAIL ou
  ;; GNUS
  (setq bbdb-use-pop-up nil)
  ;; pas de code de localisation par defaut pour les numeros de
  ;; telephone 
  (setq bbdb-default-area-code nil)
  ;; permet d'empecher a bbdb de creer une nouvelle entree a chaque fois
  ;; qu'un mail d'une nouvelle personne est lu avec GNUS, RMAIL, VM ou
  ;; MH. 
  (setq bbdb/mail-auto-create-p nil
		bbdb/news-auto-create-p nil
		;;bbdb/send-auto-create-p nil
		;;bbdb/send-prompt-for-create-p t
		);;de moy-bbdb
  ;; nombre de lignes desire dans la fenetre popup de bbdb lorsque l'on
  ;; utilise VM/MH/RMAIL ou GNUS.
  (setq bbdb-pop-up-target-lines 7)

  ;; ne pas m'enquiquiner si bbdb voit un correspondant connu avec une adresse différente
  (setq bbdb-always-add-addresses nil
		bbdb-quiet-about-name-mismatches t)

  ;; ne pas me demander si je veux sauver la base
  (setq bbdb-offer-save 'savenoprompt)

  ;; je veux insérer le nom complet même s'il est identique à l'adresse
  ;; exemple "John Doe <john.doe@someplace.com>
  (setq bbdb-dwim-net-address-allow-redundancy t)

  
)
;;============= BBDB =================================================



;  (require 'gnus-load ); Create the faces we need 
(when (require 'gnus-start)

  (make-face 'my-gnus-group-line-ticked-face)
  (make-face 'my-gnus-group-line-new-face)
  (make-face 'my-gnus-group-line-unread-face)
  (make-face 'my-gnus-topic-line-face)
  (make-face 'my-gnus-mouse-group-line-ticked-face)
  (make-face 'my-gnus-mouse-group-line-new-face)
  (make-face 'my-gnus-mouse-group-line-unread-face)
  (make-face 'my-gnus-mouse-group-line-groupname-face)
  (make-face 'my-gnus-mouse-topic-line-face)
  (make-face 'my-gnus-group-line-groupname-face)
  (make-face 'my-gnus-group-line-groupname-read-face-1)
  (make-face 'my-gnus-group-line-groupname-read-face-2)
  (make-face 'my-gnus-group-line-groupname-read-face-3)
  (make-face 'my-gnus-group-line-groupname-read-face-4)
  (make-face 'my-gnus-group-line-groupname-unread-face-1)
  (make-face 'my-gnus-group-line-groupname-unread-face-2)
  (make-face 'my-gnus-group-line-groupname-unread-face-3)
  (make-face 'my-gnus-group-line-groupname-unread-face-4) 

  ;; Here we assign the faces to the gnus-faces 
  (setq gnus-face-1 'my-gnus-group-line-ticked-face)
  (setq gnus-face-2 'my-gnus-group-line-new-face)
  (setq gnus-face-3 'my-gnus-group-line-unread-face)
  (setq gnus-face-5 'my-gnus-topic-line-face)
  (setq gnus-face-8 'my-gnus-summary-line-tree-face)
  (setq gnus-mouse-face-1 'my-gnus-mouse-group-line-ticked-face)
  (setq gnus-mouse-face-2 'my-gnus-mouse-group-line-new-face)
  (setq gnus-mouse-face-3 'my-gnus-mouse-group-line-unread-face)
  (setq gnus-mouse-face-4 'my-gnus-mouse-group-line-groupname-face)
  (setq gnus-mouse-face-5 'my-gnus-mouse-topic-line-face) 
)

;;; Spelling
(when (require 'ispell)
  (setq ispell-program-name "aspell")
  (setq ispell-dictionary "francais")
  (autoload 'flyspell-mode "flyspell" "On-the-fly spelling." t)
)
;; ;;régler le problème des accents ignorés 
;; (setq ispell-dictionary-alist
;;  '((nil  ; francais.aff
;;   "[A-Za-zÀÂÇ-ËÎÏÔÙÛÜàâç-ëîïôùûü]" "[^A-Za-zÀÂÇ-ËÎÏÔÙÛÜàâç-ëîïôùûü]"
;;   "[---']" nil ("-n") "~nroff")
;;  ("english"  ; rosbif
;;   "[A-Za-z]" "[^A-Za-z]" "[---']" nil ("-B") nil)
;;  ("american" ; yankee
;;   "[A-Za-z]" "[^A-Za-z]" "[---']" nil nil nil)
;;  ("francais" ; francais.aff
;;   "[A-Za-zÀÂÇ-ËÎÏÔÙÛÜàâç-ëîïôùûü]" "[^A-Za-zÀÂÇ-ËÎÏÔÙÛÜàâç-ëîïôùûü]"
;;   "[---']" nil ("-n") "~nroff")
;;  ("francais-TeX" ; francais.aff
;;   "[A-Za-zÀÂÇ-ËÎÏÔÙÛÜàâç-ëîïôùûü\\]" "[^A-Za-zÀÂÇ-ËÎÏÔÙÛÜàâç-ëîïôùûü\\]"
;;   "[---'^`\"]" t nil "~tex")
;;  ("espanol" ; espa~nol.aff
;;   "[A-Za-záéíóúüñÁÉÍÓÚÜÑ]" "[^A-Za-záéíóúüñÁÉÍÓÚÜÑ]"
;;   "[---'^`\"]" t nil "~nroff")
;;  ))

(autoload 'pymacs-load "pymacs" nil t)
(autoload 'pymacs-eval "pymacs" nil t)
(autoload 'pymacs-apply "pymacs")
(autoload 'pymacs-call "pymacs")
;;(eval-after-load "pymacs"
;;  '(add-to-list 'pymacs-load-path "your-pymacs-directory"))

;;démarrage du serveur pour que emacsclient fonctionne
(server-start)

;;démarrage de gnuserver
;(gnuserv-start)

;;===== Multimedia ========
;;interface cdcd
(require 'cdi nil t)

;;interface emms
(when (require 'emms nil t)
  (when (require 'emms-default nil t)
	(emms-setup 'advanced "~/mp3")))
;(require 'emms nil t)
;(when (fboundp 'emms-start)
;  (require 'emms-default nil t)
;  (emms-setup 'advanced "~/mp3")
;)


;; ===== Customization de ps-print =========================
;;masquer les local-variables à l'impression
(defvar sk:ps-hide-local-variables t
  "FIXME:...")

(defun sk:hide-local-variables ()
  (narrow-to-region (point-min)
					(progn
					  (end-of-buffer)
					  ;; TODO: Set the BOUND arg.
					  (re-search-backward "Local Variables" nil t);deux points omis volontairement
					  (forward-line -1)
					  (point))))

(defadvice ps-print-buffer
  (around sk:ps-print-buffer activate)
  "FIXME:..."
  (save-excursion
	(save-restriction
	  (when sk:ps-hide-local-variables
			(sk:hide-local-variables))
	  ad-do-it)))

(defadvice ps-print-buffer-with-faces
  (around sk:ps-print-buffer-with-faces activate)
  "FIXME:..."
  (save-excursion
	(save-restriction
	  (when sk:ps-hide-local-variables
		(sk:hide-local-variables))
	  ad-do-it)))

(defadvice ps-spool-buffer
  (around sk:ps-spool-buffer activate)
  "FIXME:..."
  (save-excursion
	(save-restriction
	  (when sk:ps-hide-local-variables
		(sk:hide-local-variables))
	  ad-do-it)))

(defadvice ps-spool-buffer-with-faces
  (around sk:ps-spool-buffer-with-faces activate)
  "FIXME:..."
  (save-excursion
	(save-restriction
	  (when sk:ps-hide-local-variables
		(sk:hide-local-variables))
	  ad-do-it)))

(defun sk:ps-date-format ()
  "Retourne le format de date dd/mm/yy"
  (format-time-string "%d/%m/%y"))

(setq ps-right-header '("/pagenumberstring load" 
						sk:ps-date-format
						ps-time-stamp-hh:mm:ss))
;; ============= ps-print =====================================

;; Recherche des infos dans Apropos : C-h a = apropos-command
;; ce qui ne recherche pas les variables et les fonctions non-interactives
;; alors que M-x apropos recherche tout. On va unifier les deux
(setq apropos-do-all t)
(global-set-key (kbd "C-h a") 'apropos)
;; ======================================================================
;;      `apropos-value()':
;;      ==================
;;
;;      Il est question ici de créer un advice autour de
;;      `apropos-value()' afin de permettre qu'un argument numérique
;;      négatif fixe `apropos-do-all' à nil.  En effet, cette commande
;;      est très lourde, et je fixe cette variable à t, ce qui
;;      n'arrange rien.  La version originale permet d'« activer »
;;      `apropos-do-all' par un argument préfixe, mais pas de le
;;      désactiver.
;;
;;      TODO: Implémentation à vérifier ...  Il serait sans doute plus
;;      judicieux de créer de nouvalles variables, ayant la même
;;      sémantique que `apropos-do-all', mais « spécialisées » pour
;;      chaque commande d'apropos.  De même, il serait intéressant de
;;      pouvoir limiter les symboles sur lesquels chercher (par
;;      exemple par une régexp, ou un préfixe).  Souvent, en effet, on
;;      connait le préfixe de package, et cela peut faire gagner
;;      beaucoup de temps sur cette fonction lente ...
;; ----------------------------------------------------------------------
(defadvice apropos-value (around drkm-my:apropos-value activate)
  "FIXME<docstring>: ..."
  (let ((apropos-do-all (if (let ((arg (ad-get-arg 1)))
							  (or (eq arg '-)
								  (and (numberp arg) (< arg 0))))
							(ad-set-arg 1 nil)
						  apropos-do-all)))
	ad-do-it))

;; ==== Comportement du MANuel =====================
;; les pages de manuel font frame à part
(setq Man-notify-method 'newframe ;;pushy
	  Man-frame-parameters
	  '((foreground-color . "black")
		(background-color . "grey90")
		(cursor-color . "black")
		(mouse-color . "gold")
		(width . 80)
		(tool-bar-lines . 0)))

;; ==== MAN ========================================

;; ==== Affichage d'Info dans une autre frame ======
;; code piqué chez Tony Finch http://dotat.at/prog/rcfiles/emacs
;; {{{ info

(require 'info) 

(setq Info-fontify-maximum-menu-size	1000000)

;; {{{ Info-other-frame

(defun Info-other-frame (&optional file)
  "Start *info* mode in another frame."
  (interactive (if current-prefix-arg
                   (list (read-file-name "Info file name: " nil nil t))))
  (let ((pop-up-frames t)
        (buffer (current-buffer)))
    (pop-to-buffer buffer t)
    (raise-frame (window-frame (selected-window)))
    (info file)))

;; }}}
;; {{{ Info-uniquify-buffer

(defun Info-uniquify-buffer ()
  "Rename an *info* buffer uniquely."
  (rename-buffer "*info*" 't))

;; }}}
;; {{{ Info-rename-buffer

(defun Info-rename-buffer (suffix)
  "Rename an *info* buffer according to the user's choice."
  (interactive "sBuffer name suffix: ")
  (rename-buffer (concat "*info-" suffix "*")))

;; }}}
;; {{{ Info-search-again

(defun Info-search-again (regexp)
  "Search an info file with a better user-interface than Info-search."
  (interactive (list (if Info-search-history
			 (car Info-search-history)
		       (read-string "Regexp search: "
				    nil 'Info-search-history))))
  (Info-search regexp))

;; }}}

(global-set-key "\C-x5i" 'Info-other-frame )
(add-hook 'Info-mode-hook 'Info-uniquify-buffer)
(define-key Info-mode-map "s" 'Info-search-again)
(define-key Info-mode-map "S" 'Info-search)
(define-key Info-mode-map "r" 'Info-rename-buffer)

;; }}}
;;====== Info ==================================


;; déplacement vertical dans les lignes wrappées
(require 'screen-lines2 nil t)

;; ouverture d'un fichier avec chemin relatif
;; et ouverture d'un fichier le nom est indiqué par le point
;; de Patrick Percot et Matthieu Moy
;; C-x a f: ltf-find-file
;; C-x a v: ltf-find-file-at-point
;; C-u C-x a v : find file at point, in another window.
(require 'find-this-file nil t)

;; réagir au signal USR1
;;(global-set-key [usr1-signal] 'sk-toto)
;;(defun sk-toto () (interactive)(insert "allo ?"))

;; Load CEDET
;;(setq semantic-load-turn-useful-things-on t)
(setq semantic-load-turn-everything-on t)
(when (file-exists-p "~/.elisp/cedet/common/cedet.el")
  (load-library "~/.elisp/cedet/common/cedet.el")
  ;; Enabling SEMANTIC minor modes.  See semantic/INSTALL for more ideas.
  ;;(semantic-load-enable-excessive-code-helpers)
)

;; ecb
(when (require 'ecb-autoloads nil t)
  ;;(setq semantic-load-turn-useful-things-on t)
  (setq semanticdb-default-save-directory "~/tmp"))

;; vb mode
(require 'visual-basic-mode nil t)

;; impression 
(require 'printing nil t)

;;évaluation xref
(when (string-match "\\`goudurix" system-name)
  (setq load-path (cons "/Users/seki/Appl/xref/emacs" load-path))
  (setq exec-path (cons "/Users/seki/Appl/xref" exec-path))
  (load "xrefactory"))

;; réglage du serveur LDAP
(when (string-match "\\`goudurix" system-name)
  (setq eudc-set-server '("metz-exchange" 'ldap t)
		eudc-server-hotlist 'nil
		ldap-host-parameters-alist (quote (("metz-exchange" base "o=SAGE" auth nil scope subtree)))
		eudc-inline-query-format (quote ((name) (firstname name) (Uid)))
		eudc-query-form-attributes (quote (name firstname email phone Uid))
		))

;; rescale des polices ==> pour la version de MacEmacs JP / Carbon Emacs
;; http://home.att.ne.jp/alpha/z123/emacs-mac-e.html
(setq face-font-rescale-alist '((".*osaka-bold.*" . 1.15)
								(".*osaka-medium-i.*" . 1.2)
								(".*osaka-medium-r.*" . 1.2)
								(".*courier-medium.*" . 1.0)
								(".*courier-bold.*" . 1.0)
								;;(".*monaco-bold.*" . 0.9)
								;;(".*ayuthaya-bold.*" . 0.9)
								("-cdac$" . 1.3)))

;;trucs utiles elisp
;; trouver le code d'une touche ->  M-: (read-key-sequence "")


;; Local Variables:
;; mode: emacs-lisp
;; c0ding-system: iso-8859-15-mac
;; time-stamp-format: "%02d/%02m/%:y %02H:%02M %u@%s"
;; End:

[-- Attachment #3: Type: text/plain, Size: 22 bytes --]


-- 
Sébastien Kirche

[-- Attachment #4: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2005-04-01 11:56 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-10 16:18 Special Characters on Mac Emacs Ulrich Hobelmann
2005-03-23 11:20 ` YAMAMOTO Mitsuharu
2005-03-23 15:49   ` Sébastien Kirche
2005-03-24  3:00     ` YAMAMOTO Mitsuharu
2005-03-24 12:50       ` Sébastien Kirche
2005-03-25  6:48         ` YAMAMOTO Mitsuharu
2005-03-25  9:50           ` YAMAMOTO Mitsuharu
2005-03-25 15:34           ` Sébastien Kirche
2005-03-26  5:00             ` YAMAMOTO Mitsuharu
2005-03-31  3:43               ` Steven Tamm
2005-03-31 11:20                 ` Sébastien Kirche
2005-03-29 10:03           ` Sébastien Kirche
2005-04-01 11:02             ` YAMAMOTO Mitsuharu
2005-04-01 11:56               ` Sébastien Kirche

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).