all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: MON KEY <monkey@sandpframing.com>
To: herring@lanl.gov
Cc: emacs-devel@gnu.org
Subject: Re: with a fresh emacs "(buffer-local-value fundamental-mode  (current-buffer))" error.
Date: Fri, 10 Apr 2009 12:53:02 -0400	[thread overview]
Message-ID: <d2afcfda0904100953j371d41b8l9b31df92e1ab7f99@mail.gmail.com> (raw)
In-Reply-To: <33849.128.165.123.18.1239316978.squirrel@webmail.lanl.gov>

On Thu, Apr 9, 2009 at 6:42 PM, Davis Herring <herring@lanl.gov> 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




  parent reply	other threads:[~2009-04-10 16:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-08 21:58 with a fresh emacs "(buffer-local-value fundamental-mode (current-buffer))" error MON KEY
2009-04-08 22:15 ` Jason Rumney
2009-04-09  2:22   ` MON KEY
2009-04-09  5:12     ` Kevin Rodgers
2009-04-08 22:32 ` Davis Herring
     [not found]   ` <d2afcfda0904081931n1f0d48fbo1253c6af08cd4bbc@mail.gmail.com>
2009-04-09 15:26     ` Davis Herring
     [not found]       ` <d2afcfda0904091341j6b1194a1ifb522b99535139f9@mail.gmail.com>
2009-04-09 22:42         ` Davis Herring
2009-04-10  3:12           ` MON KEY
2009-04-16 21:49             ` Davis Herring
2009-04-10 16:53           ` MON KEY [this message]
2009-04-10 17:38             ` Chong Yidong
2009-04-10 22:10               ` Stefan Monnier
2009-04-16 21:29                 ` Davis Herring

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=d2afcfda0904100953j371d41b8l9b31df92e1ab7f99@mail.gmail.com \
    --to=monkey@sandpframing.com \
    --cc=emacs-devel@gnu.org \
    --cc=herring@lanl.gov \
    /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.