all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#13422: 24.2.91; Feature request: Add a macro always expanding to nil
@ 2013-01-12 17:58 Michael Heerdegen
  2013-01-12 20:19 ` Andreas Schwab
  2013-01-13  0:34 ` Stefan Monnier
  0 siblings, 2 replies; 8+ messages in thread
From: Michael Heerdegen @ 2013-01-12 17:58 UTC (permalink / raw)
  To: 13422

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






^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-01-13  2:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-12 17:58 bug#13422: 24.2.91; Feature request: Add a macro always expanding to nil Michael Heerdegen
2013-01-12 20:19 ` 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

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.