all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Emanuel Berg <embe8573@student.uu.se>
To: help-gnu-emacs@gnu.org
Subject: Re: Byte-compiler warnings
Date: Thu, 25 Jun 2015 01:50:17 +0200	[thread overview]
Message-ID: <87h9pwis3q.fsf@nl106-137-147.student.uu.se> (raw)
In-Reply-To: 874mlxh2tk.fsf@mbork.pl

Marcin Borkowski <mbork@mbork.pl> writes:

> I remember someone somewhere writing that Emacs
> byte-compiler is useful even if you don't want the
> compiled code, since it issues various warnings
> about bad Elisp constructs.

Whoever said that must have been pretty cool :))

But yes. There are many such cases. The help should
have the exact same message, is the way I would do it.
But its not a big issue if it is there in some
other phrasing.

E.g.,

    (defun compile-me ()
      (beginning-of-buffer) )

The help says:

    Don't use this command in Lisp programs!
    (goto-char (point-min)) is faster.

The byte-compiler says:

    ~/.emacs:6:8:Warning: `beginning-of-buffer' is for
    interactive use only; use `(goto-char
    (point-min))' instead.

One question is: if (goto-char (point-min)) is
equivalent, why cannot the byte-compiler just use that
instead for the compiled version? (Granted, there
might be more complicated examples that
`beginning-of-buffer' vs. (goto-char (point-min))...)

> Are there other tools that assist in writing good
> Elisp code? I know about checkdoc, is there
> anything else?

When you have your program you can set up automatic
testing to test all possible arg values, and such
things. It won't have anything to do with good Lisp
but it will find the bugs. Which is much more
important. But I agree a set of such tools would be
cool insofar as what is needed cannot be incorporated
into either of the components already mentioned...

-- 
underground experts united
http://user.it.uu.se/~embe8573




  reply	other threads:[~2015-06-24 23:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-24  9:29 Byte-compiler warnings Marcin Borkowski
2015-06-24 23:50 ` Emanuel Berg [this message]
2015-06-25 12:56   ` Nicolas Richard
     [not found] ` <mailman.5606.1435189903.904.help-gnu-emacs@gnu.org>
2015-06-25  3:06   ` Stefan Monnier
     [not found] <mailman.5561.1435138202.904.help-gnu-emacs@gnu.org>
2015-06-24 11:27 ` Pascal J. Bourguignon
2015-06-25  1:52   ` Emanuel Berg
2015-06-25  2:30     ` Emanuel Berg
2015-06-25  3:19   ` Stefan Monnier
2015-06-25  3:42     ` Emanuel Berg
  -- strict thread matches above, loose matches on Subject: below --
2010-09-12 18:12 byte-compiler warnings Joost Kremers

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=87h9pwis3q.fsf@nl106-137-147.student.uu.se \
    --to=embe8573@student.uu.se \
    --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.