From: Pascal Bourguignon <spam@mouse-potato.com>
Subject: Re: How to create my own mode?
Date: Thu, 17 Nov 2005 17:40:19 +0100 [thread overview]
Message-ID: <87lkzn6xe4.fsf@thalassa.informatimago.com> (raw)
In-Reply-To: 1132235806.806274.136230@f14g2000cwb.googlegroups.com
Jeckob@gmx.net writes:
> Hi, i have written some functions in elisp to get some strings
> formated. Now i want to have that only active when i open *.ci
> files....how can i do this in elisp? Here is my code:
Perhaps you don't really need a fullfleshed mode.
Adding a hook could be enough:
(add-hook 'find-file-hook
(lambda ()
(when (string-match "\\.ci$" (buffer-file-name))
(local-set-key (kbd "RET")hk (function format/align-and-newline))
(local-set-key (kbd "C-RET") (function newline)))))
You can still choose a default mode for your .ci files:
(require 'cl)
(push '("\\.ci$" . text-mode) auto-mode-alist) ; or some othe mode adapted
; to your data.
--
__Pascal Bourguignon__ http://www.informatimago.com/
Nobody can fix the economy. Nobody can be trusted with their finger
on the button. Nobody's perfect. VOTE FOR NOBODY.
next prev parent reply other threads:[~2005-11-17 16:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-17 13:56 How to create my own mode? Jeckob
2005-11-17 16:40 ` Pascal Bourguignon [this message]
2005-11-17 18:04 ` Henrik Enberg
[not found] ` <mailman.15669.1132250677.20277.help-gnu-emacs@gnu.org>
2005-11-18 10:23 ` Jeckob
2005-11-18 15:07 ` Pascal Bourguignon
2005-11-21 11:12 ` Jeckob
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=87lkzn6xe4.fsf@thalassa.informatimago.com \
--to=spam@mouse-potato.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).