emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: prog-mode not available in earlier Emacsen, need help with cfengine.


From: Reiner Steib
Subject: Re: prog-mode not available in earlier Emacsen, need help with cfengine.el
Date: Sat, 26 Nov 2011 11:57:36 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

On Fri, Nov 25 2011, Ted Zlatanov wrote:

| On Tue, Nov 22 2011, Stefan Monnier wrote:
| > I think that
| >   (unless (fboundp 'prog-mode) (defalias 'prog-mode 'fundamental-mode))
| > should do the trick.

> I'll change the non-Emacs one so it explains this and has compatibility
> code.  

Please don't define/defalias prog-mode, because other code might test
for (fboundp 'prog-mode) an expect a real prog-mode.

,----[ (info "(elisp)Coding Conventions") ]
|    * If a package needs to define an alias or a new function for
|      compatibility with some other version of Emacs, name it with the
|      package prefix, not with the raw name with which it occurs in the
|      other version.  Here is an example from Gnus, which provides many
|      examples of such compatibility issues.
| 
|           (defalias 'gnus-point-at-bol
|             (if (fboundp 'point-at-bol)
|                 'point-at-bol
|               'line-beginning-position))
`----

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]