From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: tpeplt Newsgroups: gmane.emacs.help Subject: Re: Print value of selected-window in some info buffer Date: Wed, 15 May 2024 09:14:03 -0400 Message-ID: <874jazw738.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19210"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Yuri Khan , Heime via Users list for the GNU Emacs text editor To: Heime Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 15 15:15:01 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s7ETE-0004mr-Vc for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 15 May 2024 15:15:00 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s7EST-0005ml-8i; Wed, 15 May 2024 09:14:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s7ESP-0005mR-AD for help-gnu-emacs@gnu.org; Wed, 15 May 2024 09:14:10 -0400 Original-Received: from mail-qk1-x729.google.com ([2607:f8b0:4864:20::729]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s7ESM-0004rE-0a for help-gnu-emacs@gnu.org; Wed, 15 May 2024 09:14:08 -0400 Original-Received: by mail-qk1-x729.google.com with SMTP id af79cd13be357-792c031ffdeso497801985a.2 for ; Wed, 15 May 2024 06:14:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715778844; x=1716383644; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Wemp7ywrNQTnQPFgMwM0MsBGUU4rhMEx3JJGPD7u7Bc=; b=XRHDkE1xV3Kb5L8vB+9XsL8jCXKE3RKpJKwqTc7d1oyuE4wBQpPw1/efXzAj3oYFuO sWOKlToMXLQaznKI7bMClCSDc6TjHDCQYc5eJO8GmDypoVoXcO/zxUoJfqUlNtHnqZt/ xHlTP69gJZGOfUYG74nyO5oRKmKgreiHekl/Ja5By5HsgUH3tC2hptfD4expIHG1unaz oZ/zg4dUycFoF+e6SEo50IR673NIx+qsz315hzeBwsa3pbIQoczsWnhYYgm28h5TQDSM lemwWzfVmqWX81ULye4l/ODyPXcqhTpGlcxyJHIWXx2Uhf+7XmnTIYAEuFXAd2NV4EEq XuDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715778844; x=1716383644; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Wemp7ywrNQTnQPFgMwM0MsBGUU4rhMEx3JJGPD7u7Bc=; b=pvl9h8HR993xrQIYPDLP5fz8hVtz4iEzx0Us17p9Ne9mkB7zG80ZU7McK1g1NbOsMK vfwJxWUBDpEEwmGuaST4wIXeWL9T3XIh0C5lvoTWYbPR7ArLg1yoPf8vCyfCvpNSNwvh qRc5GMqX9VlO9gMMfYpnnrVlCBWkb2aW6hFeg1LotrZR5L8FB0SpyuXqv1YdAQ9FYRPC LV+8fcScMgW6O0bN6rFXlVBKZ04dx6khEuj2UBwYTVxpXVVEUnVfhMi+8rS59XR6Uc35 gnmz1C+1Rvx3MGUsWrcftYqfT8n5UISfhiyz6aJHz/7aCz3OVuO79QU+ERFBTdYilymJ ZYkg== X-Forwarded-Encrypted: i=1; AJvYcCUvkM2QvZRhM6/2Pt4eJEBqVVxDMtMaxB/Hwthdb9uhn2fCkWW13i3nayM/aKH34udUYuGkrdfQyYvjM+dOJQ2NGdKtaZT/ X-Gm-Message-State: AOJu0YwGKVM9JtzQ2Z0jhmwkrSOAbJrhF3tJv3g8Coy1ZQfBzA2HYWXw 2cMeZM22Up478V5LHWPcVMJG/APHLqyL8Ee8hC3jg+7CC4OG/nwM X-Google-Smtp-Source: AGHT+IFomtglPd2bMeq8P4BWYWkNck66Cn9xtZBKMYErO+go9AhovAqc7DVVsygSyxE9AsxheEZNTg== X-Received: by 2002:a05:620a:2281:b0:792:c2d2:a5c7 with SMTP id af79cd13be357-792c7598705mr1544815985a.23.1715778844606; Wed, 15 May 2024 06:14:04 -0700 (PDT) Original-Received: from t530.local ([2600:8806:a801:3150:7329:d24d:52b3:6da6]) by smtp.gmail.com with ESMTPSA id af79cd13be357-792bf310713sm679968085a.109.2024.05.15.06.14.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 06:14:03 -0700 (PDT) In-Reply-To: (Heime's message of "Wed, 15 May 2024 11:52:23 +0000") Received-SPF: pass client-ip=2607:f8b0:4864:20::729; envelope-from=tpeplt@gmail.com; helo=mail-qk1-x729.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:146755 Archived-At: Heime writes: > > I want to print the string representation. The function will perform > something for a string, something else for an integer, ... > > How can one capture a window such as (selected-window) with a cond ? >=20=20 >> If you want to print specific properties of the window, extract those >> with the appropriate =E2=80=98window-*=E2=80=99 functions and pass them = into =E2=80=98format=E2=80=99. >> Provide placeholders in the format string for each value you print. >>=20 >>=20 >> Also, learn to use the debugger so you can solve this and similar >> issues yourself. Anywhere within the =E2=80=98bdrive-insert=E2=80=99 def= inition, type >> =E2=80=98C-u C-M-x=E2=80=99. This instruments your function to invoke th= e debugger >> when called. Next, evaluate your =E2=80=98(bdrive-insert (selected-windo= w))=E2=80=99 >> form. You get a window showing the function source, with point on the >> first subexpression to be evaluated, likely =E2=80=98bfname=E2=80=99, ec= ho area >> showing its value. Type =E2=80=98n=E2=80=99 for =E2=80=98next=E2=80=99. = Point moves to the next >> expression in evaluation order. Do this until you get to =E2=80=98objekt= =E2=80=99 >> (showing =E2=80=98#=E2=80=99) and then =E2=80=98(= stringp objekt)=E2=80=99 >> >> (showing =E2=80=98nil=E2=80=99). At this point, you can see that a windo= w is not a >> string. > Note that examples using the debugger are included in the Introduction to Emacs Lisp. To read the chapter on debugging, evaluate the following expression in Emacs: (info "(eintr) Debugging") It might also be useful to look at the buffer functions in the =E2=80=98shortdoc=E2=80=99 summary. To read it, evaluate the following exp= ression in Emacs: (shortdoc-display-group "buffer") =E2=80=98shortdoc=E2=80=99 was introduced in Emacs 28, so it is not availab= le if you are using an earlier version of Emacs. --=20 The lyf so short, the craft so long to lerne. - Geoffrey Chaucer, The Parliament of Birds.