Subject: 24.2.91; Feature request: Add a macro always expanding to nil

From: Michael Heerdegen <[email-masked]>
Date: Sat, 12 Jan 2013 18:58:00 +0100

Hi,

I want to request to add something like this to subr.el or similar:

(defmacro-safe discard (&rest args)
  "Do nothing, do not even eval ARGS, and return nil."
  nil)

I.e., a counterpart of `ignore', as a macro.

What at first might seem a silly idea is indeed useful: I use it as a
possibility to uncomment code.  Compared with normal uncommenting (M-;),
it has several advantages:

1.  You can search for occurrences of `discard' to find such uncommented
code.  Searching for "^;" would also give you text comments.

2.  Paren matching, moving by sexps and such things, still work
normally.

3.  The code inside the `discard' is still font-locked.

4.  It is easy to copy and paste parts of discarded code.  Inside real
comments, you always copy the commenting characters (;) along with the
code and have to remove it manually, which is annoying.

Just an idea.  But it's IMHO useful for the end user, as a mean of
editing the Emacs init file.  Of course, it would be easy to define it
in the init file itself, but I doubt that many people would have the
idea to do so.

Thanks,

Michael.

In GNU Emacs 24.2.91.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.10)
 of 2012-12-30 on drachen
Bzr revision: [email-masked]
Windowing system distributor `The X.Org Foundation', version 11.0.10707000
System Description:	Debian GNU/Linux testing (wheezy)

Configured using:
 `configure '--prefix=/usr/local/built/''

Important settings:
  value of $LC_ALL: de_DE.utf8
  value of $LC_TIME: C
  value of $LANG: de_DE.utf8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t