From: "Sébastien Kirche" <sebastien.kirche@sage.com>
Subject: Re: how do i find out the platform emacs runs on?
Date: Thu, 27 Nov 2003 11:02:08 +0100 [thread overview]
Message-ID: <C33F77E1-20C0-11D8-B5D4-000393861220@sage.com> (raw)
In-Reply-To: <vfptff6ni5.fsf@rpc71.cs.man.ac.uk>
Le mercredi, 26 nov 2003, à 18:36 Europe/Paris, Phillip Lord a écrit :
> 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)
settings.
Mostly keyboard remapping, and some defuns.
With the keep in mind to have only one .emacs that i have just to copy
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
am still a learning user for emacs, especially for elisp.
I pasted the actual portion of .emacs (rewritten thanks to Kevin
Rogers) relative to that.
I left the french comments, but i guess still understandable for
english people :)
Thanks
Sébastien Kirche
;======= SPECIFIQUE PLATEFORME
==========================================================
(cond ((eq system-type 'darwin) ; réglages 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 "<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 ;(^[
(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)))
))
;=================================================================
((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
();rien d'autre
)
)
;=================================================================
((eq system-type 'linux); réglages pour Linux
(progn
;(message "on est avec le pingouin")
();nada
)
))
;=================================================================
; fonction pour insérer l'euro (fonction à 10^[€ ? ;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))))
--
E pluribus UNIX
next prev parent reply other threads:[~2003-11-27 10:02 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-24 4:42 how do i find out the platform emacs runs on? leo
2003-11-24 6:11 ` Ola Nilsson
2003-11-25 3:53 ` leo
2003-11-26 9:32 ` seki
2003-11-26 17:21 ` Kevin Rodgers
2003-11-26 17:35 ` Edi Weitz
2003-11-26 17:36 ` Phillip Lord
2003-11-26 22:29 ` Ehud Karni
2003-11-27 10:02 ` Sébastien Kirche [this message]
2003-11-24 6:20 ` Eli Zaretskii
[not found] ` <mailman.485.1069658500.399.help-gnu-emacs@gnu.org>
2003-11-24 9:39 ` apropos apropos [was: how do i find out the platform emacs runs on?] Alan Mackenzie
2003-11-24 12:46 ` Eli Zaretskii
2003-11-24 18:45 ` Kevin Rodgers
2003-11-24 21:03 ` Alan Mackenzie
2003-11-25 17:40 ` Kevin Rodgers
[not found] ` <mailman.496.1069681832.399.help-gnu-emacs@gnu.org>
2003-11-29 10:50 ` Alan Mackenzie
2003-11-30 6:53 ` Eli Zaretskii
2003-12-01 9:03 ` how do i find out the platform emacs runs on? Svend Tollak Munkejord
2003-12-01 13:17 ` Eli Zaretskii
2003-12-01 19:15 ` Kevin Rodgers
[not found] ` <mailman.851.1070328153.399.help-gnu-emacs@gnu.org>
2003-12-02 8:20 ` Svend Tollak Munkejord
2003-12-02 17:24 ` Eli Zaretskii
[not found] ` <mailman.924.1070390102.399.help-gnu-emacs@gnu.org>
2003-12-03 8:42 ` Svend Tollak Munkejord
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=C33F77E1-20C0-11D8-B5D4-000393861220@sage.com \
--to=sebastien.kirche@sage.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).