From: Michael Heerdegen <michael_heerdegen@web.de>
To: 13422@debbugs.gnu.org
Subject: bug#13422: 24.2.91; Feature request: Add a macro always expanding to nil
Date: Sat, 12 Jan 2013 18:58:00 +0100 [thread overview]
Message-ID: <87ip72jnbr.fsf@web.de> (raw)
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@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
next reply other threads:[~2013-01-12 17:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-12 17:58 Michael Heerdegen [this message]
2013-01-12 20:19 ` bug#13422: 24.2.91; Feature request: Add a macro always expanding to nil Andreas Schwab
2013-01-12 21:50 ` Michael Heerdegen
2013-01-12 23:15 ` Andreas Schwab
2013-01-12 23:41 ` Michael Heerdegen
2013-01-12 23:58 ` Andreas Schwab
2013-01-13 0:34 ` Stefan Monnier
2013-01-13 2:36 ` Michael Heerdegen
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=87ip72jnbr.fsf@web.de \
--to=michael_heerdegen@web.de \
--cc=13422@debbugs.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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).