From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: =?ISO-8859-1?Q?S=E9bastien_Kirche?= Newsgroups: gmane.emacs.help Subject: Re: how do i find out the platform emacs runs on? Date: Thu, 27 Nov 2003 11:02:08 +0100 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 (Apple Message framework v553) Content-Type: text/plain; charset=WINDOWS-1252; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1069927678 23801 80.91.224.253 (27 Nov 2003 10:07:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 27 Nov 2003 10:07:58 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Nov 27 11:07:55 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1APJ3z-0004wi-00 for ; Thu, 27 Nov 2003 11:07:55 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1APK00-0006CB-LD for geh-help-gnu-emacs@m.gmane.org; Thu, 27 Nov 2003 06:07:52 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1APJxU-0005u4-O0 for help-gnu-emacs@gnu.org; Thu, 27 Nov 2003 06:05:16 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1APJwW-0003ru-Qz for help-gnu-emacs@gnu.org; Thu, 27 Nov 2003 06:04:48 -0500 Original-Received: from [195.25.216.129] (helo=Mis.sage.fr) by monty-python.gnu.org with esmtp (Exim 4.24) id 1APJwG-0003Tb-WB for help-gnu-emacs@gnu.org; Thu, 27 Nov 2003 06:04:01 -0500 Original-Received: from sage.com (GOUDURIX [172.18.3.54]) by Mis.sage.fr with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2657.72) id X1N8R7JS; Thu, 27 Nov 2003 11:03:56 +0100 Original-To: emacs-help In-Reply-To: X-Mailer: Apple Mail (2.553) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:14645 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:14645 Le mercredi, 26 nov 2003, =E0 18:36 Europe/Paris, Phillip Lord a =E9crit = : > One important question to ask though, is why are you doing this? In > general its better to ask Emacs for its capabilities rather than its > platform. > > Checking between console and windowing environment seems a good way to > do things. > > This way if Emacs on different systems gains new functionality, it > should all just work. > > Of course there are times when you might just not be bothered to do > this, or when its too much effort (checking whether external programs > like diff are available for instance). > Well, i actually do that for platform specific (headaches cause)=20 settings. Mostly keyboard remapping, and some defuns. With the keep in mind to have only one .emacs that i have just to copy=20= from one platform to another if i made new settings. If you see a smarter way to do that, i am open to any suggestion, as i=20= am still a learning user for emacs, especially for elisp. I pasted the actual portion of .emacs (rewritten thanks to Kevin=20 Rogers) relative to that. I left the french comments, but i guess still understandable for=20 english people :) Thanks S=E9bastien Kirche ;=3D=3D=3D=3D=3D=3D=3D SPECIFIQUE PLATEFORME=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D (cond ((eq system-type 'darwin) ; r=E9glages pour le mac (progn ;(message "on est sous mac") ;(setq mac-command-key-is-meta nil) (set-keyboard-coding-system 'mac-roman) ;(set-frame-font "fontset-mac") (if window-system (setq default-frame-alist '((width . 100) = (height . 44) = (top . 50);pixels = (left . 50);pixels = (font . "fontset-mac"))) ) (global-set-key (kbd "") 'delete-char) = ;touche suppr (global-set-key (kbd "") "/") = ;touche=20 division sur pav=E9 num (inactif sur mon poste ?) (global-set-key (kbd "") (kbd = ""));idem / (global-set-key (kbd "") (kbd "")) = ;idem / ;(global-set-key "=80" (sk-insere-euro t));j'arrive pas = avec l'euro ;(=1B (defvar sw-last-applescript nil "Stores the last Applescript command executed from = Emacs.") =09 (defvar sw-applescript-buffer-name "*AppleScript = output*" "Name for the buffer to display AppleScript output.") =09 (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))) =09 (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))) =09 (defun sw-run-last-applescript () "Run the last Applescript command again" (interactive) (sw-run-and-display-applescript sw-last-applescript)) =09 (defun sw-run-and-display-applescript (code) "Switch to the AppleScript buffer, erase it, run the = code and=20 display the results." (switch-to-buffer (get-buffer-create = sw-applescript-buffer-name)) (erase-buffer) (insert (do-applescript code))) =09 )) ;=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ((eq system-type 'windows-nt); r=E9glages pour windows (progn ;(message "on est sous ouin-ouin") (global-set-key [128] 'sk-insere-euro); C-h l donne = \200 pour l'euro=20 soit 128 en d=E9cimal ();rien d'autre ) ) ;=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ((eq system-type 'linux); r=E9glages pour Linux (progn ;(message "on est avec le pingouin") ();nada ) )) ;=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ; fonction pour ins=E9rer l'euro (fonction =E0 10=1B=80 ? ;o)=1B (defun sk-insere-euro (&optional arg) "Ins=E8re le symbole Euro ISO=20 8859-15. Avec un pr=E9fixe, ins=E8re la version Unicode." (interactive "*P") (if arg (insert (make-char 'mule-unicode-0100-24ff 116 76)) (insert (make-char 'latin-iso8859-15 164)))) --=20 E pluribus UNIX