[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: hard-newline changes in lisp/gnus/message.el
From: |
Reiner Steib |
Subject: |
Re: hard-newline changes in lisp/gnus/message.el |
Date: |
Sat, 19 Nov 2005 21:47:30 +0100 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) |
On Sat, Nov 19 2005, Chong Yidong wrote:
> Reiner Steib <address@hidden> writes:
>> As for `hard-newline': Obviously `hard-newline' is not defined in
>> Emacs < 22. I'm not sure what's the best way to deal with this. I'd
>> suggest to define `message-hard-newline' in `message.el' as follows
>> and use it instead of `hard-newline'.
>
> Why not:
>
> (if (not (boundp hard-newline))
> (defvar hard-newline (propertize "\n" 'hard t 'rear-nonsticky '(hard))))
(Your suggestion should read (unless (boundp 'hard-newline) ...).)
It violates Emacs Lisp coding conventions:
,----[ (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))
`----
The same applies to variables, IMO.
Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/