all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Štěpán Němec" <stepnem@gmail.com>
To: "Drew Adams" <drew.adams@oracle.com>
Cc: emacs-devel@gnu.org
Subject: Re: why does `variable-at-point' return 0?
Date: Thu, 19 Apr 2012 21:50:00 +0200	[thread overview]
Message-ID: <87wr5blcwn.fsf@gmail.com> (raw)
In-Reply-To: <717003EF5A184D8A91EF489C3A79EB92@us.oracle.com> (Drew Adams's message of "Mon, 16 Apr 2012 11:07:47 -0700")

On Mon, 16 Apr 2012 20:07:47 +0200
Drew Adams wrote:

> ping
>
>> Just curious.  Why doesn't `variable-at-point' return nil if 
>> there is no variable at point?

[...]

>> What am I missing?

Dunno if you're missing anything, but you're certainly not the only one
wondering. FWIW, for my purposes I've been using the function below ever
since I discovered `variable-at-point':

(defun .variable-at-point ()
  "Sanitized version of the utterly [CENSORED] `variable-at-point'.
\(The latter returns 0 as the failure value. Very useful,
indeed.)"
  (let ((v (variable-at-point)))
    (unless (eq v 0) v)))

-- 
Štěpán



  reply	other threads:[~2012-04-19 19:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-07  0:23 why does `variable-at-point' return 0? Drew Adams
2012-04-16 18:07 ` Drew Adams
2012-04-19 19:50   ` Štěpán Němec [this message]
2012-04-19 21:28     ` Drew Adams
2012-04-19 21:52   ` Stefan Monnier
2012-04-19 22:56     ` Juanma Barranquero
2012-04-20 18:14     ` Štěpán Němec
2012-04-20 22:57       ` Juanma Barranquero
2012-04-21  2:24       ` Stefan Monnier

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=87wr5blcwn.fsf@gmail.com \
    --to=stepnem@gmail.com \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@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.