From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: MON KEY Newsgroups: gmane.emacs.devel Subject: Re: with a fresh emacs "(buffer-local-value fundamental-mode (current-buffer))" error. Date: Fri, 10 Apr 2009 12:53:02 -0400 Message-ID: References: <50950.128.165.123.18.1239229924.squirrel@webmail.lanl.gov> <33049.128.165.123.18.1239290817.squirrel@webmail.lanl.gov> <33849.128.165.123.18.1239316978.squirrel@webmail.lanl.gov> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1239382419 3797 80.91.229.12 (10 Apr 2009 16:53:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 10 Apr 2009 16:53:39 +0000 (UTC) Cc: emacs-devel@gnu.org To: herring@lanl.gov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 10 18:54:58 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LsK0H-0001Zi-2j for ged-emacs-devel@m.gmane.org; Fri, 10 Apr 2009 18:54:57 +0200 Original-Received: from localhost ([127.0.0.1]:41680 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LsJys-0001fU-Nn for ged-emacs-devel@m.gmane.org; Fri, 10 Apr 2009 12:53:30 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LsJyX-0001Ri-Ti for emacs-devel@gnu.org; Fri, 10 Apr 2009 12:53:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LsJyS-0001ON-Pu for emacs-devel@gnu.org; Fri, 10 Apr 2009 12:53:09 -0400 Original-Received: from [199.232.76.173] (port=45799 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LsJyR-0001NW-Ji for emacs-devel@gnu.org; Fri, 10 Apr 2009 12:53:03 -0400 Original-Received: from mail-gx0-f208.google.com ([209.85.217.208]:63412) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LsJyR-0002fK-3y for emacs-devel@gnu.org; Fri, 10 Apr 2009 12:53:03 -0400 Original-Received: by gxk4 with SMTP id 4so2713329gxk.18 for ; Fri, 10 Apr 2009 09:53:02 -0700 (PDT) Original-Received: by 10.151.27.9 with SMTP id e9mr7044866ybj.55.1239382382240; Fri, 10 Apr 2009 09:53:02 -0700 (PDT) In-Reply-To: <33849.128.165.123.18.1239316978.squirrel@webmail.lanl.gov> X-Google-Sender-Auth: ad5a122511839a8c X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:110187 Archived-At: On Thu, Apr 9, 2009 at 6:42 PM, Davis Herring 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