GNU bug report logs - #13422
24.2.91; Feature request: Add a macro always expanding to nil

Previous Next

Package: emacs;

Reported by: michael_heerdegen <at> web.de

Date: Sat, 12 Jan 2013 17:58:02 UTC

Severity: wishlist

Tags: wontfix

Found in version 24.2.91

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.2.91; Feature request: Add a macro always expanding to nil
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: rgm <at> gnu.org-20121230122326-m6gw29pkwjgwqf9d
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





This bug report was last modified 12 years and 215 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.