emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: why does `variable-at-point' return 0?


From: Štěpán Němec
Subject: Re: why does `variable-at-point' return 0?
Date: Thu, 19 Apr 2012 21:50:00 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]