From: Cecil Westerhof <Cecil@decebal.nl>
To: help-gnu-emacs@gnu.org
Subject: Re: Some functions I hope are useful for others to
Date: Wed, 23 Dec 2009 21:10:05 +0100 [thread overview]
Message-ID: <871vil8naa.fsf@Traian.DecebalComp> (raw)
In-Reply-To: 87ljgtqz64.fsf@hubble.informatimago.com
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
next prev parent reply other threads:[~2009-12-23 20:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-23 17:29 Some functions I hope are useful for others to Cecil Westerhof
2009-12-23 17:48 ` Richard Riley
[not found] ` <mailman.84.1261590532.18930.help-gnu-emacs@gnu.org>
2009-12-23 18:19 ` Cecil Westerhof
2009-12-23 19:16 ` Pascal J. Bourguignon
2009-12-23 20:10 ` Cecil Westerhof [this message]
2009-12-23 23:34 ` Pascal J. Bourguignon
2009-12-23 19:44 ` Cecil Westerhof
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871vil8naa.fsf@Traian.DecebalComp \
--to=cecil@decebal.nl \
--cc=help-gnu-emacs@gnu.org \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.