From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Cecil Westerhof Newsgroups: gmane.emacs.help Subject: Re: Some functions I hope are useful for others to Date: Wed, 23 Dec 2009 21:10:05 +0100 Organization: Decebal Computing Message-ID: <871vil8naa.fsf@Traian.DecebalComp> References: <877hsdeh06.fsf@Traian.DecebalComp> <87ljgtqz64.fsf@hubble.informatimago.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1261600971 9981 80.91.229.12 (23 Dec 2009 20:42:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 23 Dec 2009 20:42:51 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 23 21:42:44 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NNY2d-0004XP-Vi for geh-help-gnu-emacs@m.gmane.org; Wed, 23 Dec 2009 21:42:44 +0100 Original-Received: from localhost ([127.0.0.1]:38712 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NNY2e-00071z-7O for geh-help-gnu-emacs@m.gmane.org; Wed, 23 Dec 2009 15:42:44 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Original-Newsgroups: gnu.emacs.help Set: dutch X-Homepage: http://www.decebal.nl/ User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) Cancel-Lock: sha1:MJRmdkR/dVXvknr1vdGVEvmqn/k= Original-Lines: 83 Original-NNTP-Posting-Host: 84.53.123.169 Original-X-Trace: 1261599006 news.xs4all.nl 22943 decebal/[::ffff:84.53.123.169]:10510 Original-X-Complaints-To: abuse@xs4all.nl Original-Xref: news.stanford.edu gnu.emacs.help:175755 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:70831 Archived-At: pjb@informatimago.com (Pascal J. Bourguignon) writes: > buffer-delete-lines --> kill-line Not complete. My buffer-delete-lines delete the complete line from the beginning, kill-line does it from the cursor position. > buffer-to-unix --> universal-coding-system-argument > set-default-coding-systems > etc. > > More precisely, when you load a file with DOS line termination, then > you get a (DOS) in the status line, and lines in the buffer (there's > no RET in the buffer!). When you save a buffer (C-x C-s), it's saved > with the same line termination. When you write out the buffer (C-x > C-w), the default-coding-systems are used, so if you specify a unix > coding system there, it will be saved as a unix text file. This works also when there are lines of all three types? And with my function you get immediately rid of those ^M at the end of the line. >> http://www.decebal.nl/EmacsLisp/sources/own-functions-general.el > > I find them quite specific. (I wouldn't need these funtions). I find log-message very handy. You do not have to search for messages of a certain process in *Messages*. (I use it for my gnus-idle-daemon.) I find exit-depends-on-interactive also very handy. When calling a function interactive it is nice to get a message in the mini buffer, but not when a function is not called interactive. >> http://www.decebal.nl/EmacsLisp/sources/own-functions-time.el > > time-difference-formatted: do not do more than one thing in a > function. Either compute a time difference, or format a time, but > don't do both! I do. For computing the time difference I call time-difference in time-difference-formatted. > Time formating is already provided by emacs format-time-string, > so your function is redundant. I do not think so, because in my function the format is dependent on the time difference. > Before an opening parenthesis, there can be only a quote, a space or > another opening parenthesis. I started to do this. I am used that the parenthesis in which the parameters are given are bound to the function name. In my newest code I am using a space, but this code is a little older and should be changed by me. > Finally, my own funtions are also my own-functions. You should > rather use a unique prefix, such as: > > nl.decebal.cecil-general.el > nl.decebal.cecil-buffer.el > nl.decebal.cecil-time.el That is a good idea. > and you could also prefix your functions with the same to avoid > collision with my own functions: > > nl.decebal.cecil.general/set-property-in-listo > nl.decebal.cecil.time/emacs-uptime Used with defalias that is also a good idea. But when I started writing those functions I did not think it would be interesting for others. I hope I was wrong. :-D -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof