From: William Case <billlinux@rogers.com>
To: EMACS List <help-gnu-emacs@gnu.org>
Subject: Tutorial question re conventions or usage ??
Date: Tue, 01 May 2007 13:44:18 -0400 [thread overview]
Message-ID: <1178041458.3157.37.camel@CASE> (raw)
Hi;
I am working my way through the Lisp tutorial.
I have come across the following example for the 'beginning-of-buffer'
function:
I can understand the Lisp in this code; the question is about normal
practises when writing similar code.
...
(if (> (buffer-size) 10000)
;; Avoid overflow for large buffer sizes!
(* (prefix-numeric-value arg)
(/ (buffer-size) 10))
(/ (+ 10 (* (buffer-size)
(prefix-numeric-value arg)))
...
In this code the writer has reduced the numbers by a factor of 10 in
order, it seems, to get the user to supply a one digit prefix that
none-the-less ends up being a percentage.
Is this a convention in emacs or the writer's one time personal choice?
It seems intuitive to me (and easier to follow the code) if it had been
written as a percentage from the beginning and doing any factoring by
100.
Should I always be looking for ways to make prefix numbers a single
digit?
Does it matter? Is there any gain or loss by using a longer or short
prefix digits?
--
Regards Bill
next reply other threads:[~2007-05-01 17:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-01 17:44 William Case [this message]
2007-05-01 19:31 ` Tutorial question re conventions or usage ?? Eli Zaretskii
2007-05-01 19:51 ` William Case
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=1178041458.3157.37.camel@CASE \
--to=billlinux@rogers.com \
--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.
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).