[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: with a fresh emacs "(buffer-local-value fundamental-mode (current-b
From: |
MON KEY |
Subject: |
Re: with a fresh emacs "(buffer-local-value fundamental-mode (current-buffer))" error. |
Date: |
Fri, 10 Apr 2009 12:53:02 -0400 |
On Thu, Apr 9, 2009 at 6:42 PM, Davis Herring <address@hidden> wrote:
> If you need to detect (and not just suppress) longlines-mode without
> having to load it, you can do
> bound-and-true-p 'longlines-mode)
So, I go in to adjust my code this morning...
And you know man.... this form won't evaluate when longlines-mode is quoted!
GRrrrr!
Once initialzed:
(if (bound-and-true-p longlines-mode) "bubba" "no-bubba") => "bubba"
Whereas (initialized or otherwise):
(if (bound-and-true-p 'longlines-mode) "bubba" "no-bubba")
--------
Debugger entered--Lisp error: (wrong-type-argument symbolp (quote
longlines-mode))
boundp((quote longlines-mode))
(and (boundp (quote ...)) (quote longlines-mode))
(bound-and-true-p (quote longlines-mode))
(if (bound-and-true-p (quote longlines-mode)) "bubba" "no-bubba")
eval((if (bound-and-true-p (quote longlines-mode)) "bubba" "no-bubba"))
eval-last-sexp-1(nil)
eval-last-sexp(nil)
call-interactively(eval-last-sexp nil nil)
-------
(boundp longlines-mode) => `t' {once initialized else "VOID variable error"}
(boundp 'longlines-mode) => `t' {when unitialized _or_ intialized}
(bound-and-true-p longlines-mode) => `nil'|`t' {when unitialized _or_
intialized}
(bound-and-true-p 'longlines-mode)
=> {...(wrong-type-argument symbolp (quote longlines-mode))...}
Which leads me to suspect that I went down this route at some point in
the past found there were 'issues' with qouting around longlines-mode
with regards symbol vs. variable state and _might_ explain my funky
quoting.
Also, `bound-and-true-p' still won't address situations where
longlines-mode hasn't been initialized because it doesn't tell me if
it's been bound yet.
Per the docstring:
"Return the value of symbol var if it is bound, else nil."
What prob. will work is to test if symbol both symbol _and_ var are available:
(and (boundp 'longlines-mode) (bound-and-true-p longlines-mode))
which still pretty much bites.
s_P