From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christopher Dimech Newsgroups: gmane.emacs.help Subject: Re: Toggle appointment notification Date: Wed, 2 Dec 2020 15:10:28 +0100 Message-ID: References: <20201201195357.GA17507@tuxteam.de> <878sahgq1i.fsf@web.de> <20201202084116.GA14592@tuxteam.de> <20201202123740.GC14592@tuxteam.de> <20201202135234.GE14592@tuxteam.de> 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="38395"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: tomas@tuxteam.de Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 02 15:12:26 2020 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 1kkSrp-0009tk-JR for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 02 Dec 2020 15:12:25 +0100 Original-Received: from localhost ([::1]:44388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkSro-0005ai-EX for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 02 Dec 2020 09:12:24 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58572) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkSq6-0005ab-7Z for help-gnu-emacs@gnu.org; Wed, 02 Dec 2020 09:10:38 -0500 Original-Received: from mout.gmx.net ([212.227.17.21]:57367) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkSq3-0001qz-V7 for help-gnu-emacs@gnu.org; Wed, 02 Dec 2020 09:10:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1606918228; bh=13ffI1PLwV9CPn0V8yAEVgJodz4zkaedFBbkrrupNb0=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=VvwSMB56QE3+is4Vz78v8o0dZ9cfIo/p4hgmSlh/tqHG+fhW9UkfPcVhCfuzKvEx2 RO2JhO1+i51vc+9p+tA2sALnK5Efm0JSZS1dgkdvSkY0/Oj/zZY+0jz0cDtKwk72zb QqhHQsRL6Te8ZqF6tShyQOjiaxf9FBbyXulpqyGc= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [213.165.168.94] ([213.165.168.94]) by web-mail.gmx.net (3c-app-mailcom-bs14.server.lan [172.19.170.182]) (via HTTP); Wed, 2 Dec 2020 15:10:28 +0100 Importance: normal Sensitivity: Normal In-Reply-To: <20201202135234.GE14592@tuxteam.de> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:aWds3BkqZbUwe2UzPqL14X1X7EgUaL1cAMT+keL1uStz9RiRfIFUReghhSfqy2VUpkhNi eHm1m/AqR6IYif9nqgmchjpRcjmatVhZaxajLQJ2rykX9vXfMKhDIqefPOQfqI6STv+TOXz+/YjZ GhYVpjKXzjzZjyn5ApA99PCXWDiY3FVceoNsAXECRcqObR1mk2MT74/o4fwGUfIe09adMaq2PdbE qHkH1JWzl4tG9meyRqwG89rmCF8KvjnGnpJSuwGqwpJvUHonv/i3X6owoCWEW8oUmp5V1xBAcwFQ YU= X-UI-Out-Filterresults: notjunk:1;V03:K0:8Dm3eEF/HM0=:TTeci7w/lRFLmT1EFToezE fGVlJkBu55XQoR6neXGThI9hgjC1DcliT+HjqK/i1OuywW6lM99en+oQSQ/aqN6nLD3jRMl7B 28fzdZl7o2lDr+jT/LmgkIzzdMZ4Qf6CK06bKWvAEYaYSFJtPiH4zUrkWh4UO1gwpXOJyvOUT 0dfJpMVLsSV3s5dTmHmhJlpVZp8Zg5xYUVhHi1uAWcMzHFyesXbCzGG95rhXBjgBSiO9mcmxA +QQhA4otx8Yj4HGk+qIg0U2S3iT8Upn2yoiphMQuvTaxIHmE8jDEy0FMrGMw1Oe6dlmmZm5cM miPQutya0HfPSIVFAE8uBNP9hrY3/MLYS7DRXig/tbCnZenNCyrHOpc3XtSUDBjZ0my8XojQf +WebjNceqsQjqUcf/qIvxxo939USmMB9gtcK67WdfCl6YGgLMiq88XeBWq7/xV1aWFARZgUHo 6srBJESuToQ0OjYbwBWoKSRtt/oYzgIqgNkwJkQSQsBwhcE9pLoH9PW3FC1OWK6y0O31evkRQ jqPNo04m2Tvh6hv83sm0Kj5GllTC839LhaGMoQgUAksIqQjNE/BkcVPlewLrFzLBDyx2MGgLq alPdjpjjbmCCo= Received-SPF: pass client-ip=212.227.17.21; envelope-from=dimech@gmx.com; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, 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.23 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" Xref: news.gmane.io gmane.emacs.help:125831 Archived-At: > Sent: Wednesday, December 02, 2020 at 2:52 PM > From: tomas@tuxteam.de > To: "Christopher Dimech" > Cc: help-gnu-emacs@gnu.org > Subject: Re: Toggle appointment notification > > On Wed, Dec 02, 2020 at 02:15:20PM +0100, Christopher Dimech wrote: > > > Sent: Wednesday, December 02, 2020 at 1:37 PM > > > From: tomas@tuxteam.de > > > To: "Christopher Dimech" > > > Cc: help-gnu-emacs@gnu.org > > > Subject: Re: Toggle appointment notification > > > > > > On Wed, Dec 02, 2020 at 01:05:07PM +0100, Christopher Dimech wrote: > > > > > Sent: Wednesday, December 02, 2020 at 9:41 AM > > > > > From: tomas@tuxteam.de > > > > > To: help-gnu-emacs@gnu.org > > > > > Subject: Re: Toggle appointment notification > > > > > > > > > > On Tue, Dec 01, 2020 at 10:44:09PM +0100, Michael Heerdegen wrot= e: > > > > > > writes: > > > > > > > > > > > > > (message "my heading: %s" (prin1-to-string any)) > > > > > > > > > > > > Or equivalent > > > > > > > > > > > > (message "my heading: %S" any) > > > > > > > > > > > > , no? > > > > > > > > > > Indeed. Recommended reading "4.7 Formatting Strings" in the Emac= s Lisp > > > > > manual (in the Intertubes here [1]). > > > > > > > > How does one deal with conditionals (1, nil) in format? > > > > > > Care to pose a more complete example? > > > > > > As far as I understood you, you'd put a Lisp expression in the 2nd..= .nth > > > arguments of (message fmt ...), but I might be misunderstanding you > > > completely. > > > > As I read it, the format it is mainly for numerical and strings. > > > > (format "%s" arbitrary-string) > > > > Although it mentions printed representation of the object > > > > I am sure users would be more interested is printing results > > of expressions. > > But the result of an expression /is/ a Lisp object. That's > the whole point of Lisp! Correct. Must have got brain damage by working too much with C. > So you can do: > > (format "look here: %S" (list (+ 3 4) (list 'a 'b 'c) (current-time-st= ring) (current-fill-column))) > > =3D> "look here: (7 (a b c) \"Wed Dec 2 14:42:30 2020\" 70)" Did not know one may use a single format specifier for multiple objects. > > But I suppose one should use "print", "prin1", and "princ" > > for that. > > Use whatever is convenient, yes. > > > However, a valid format specification for conditional could be. > > > > (message "Result: %s" (> 5 3)) > > Yes, that works. Have you actually tried it? What is the result? > Does that match your expectations? If yes, why? If not, why not? Yes, matches expectations. > > %s mentions objects, but the sections seems to imply attention > > to strings in "4.7 Formatting Strings". > > > > I think this is quite valid: > > > > (format "%s" arbitrary-string) > > > > But perhaps not completely true. > > It is incomplete: the format specifier %s takes a generic > Lisp object, as does the %S. The difference is that %S puts > strings in quotes, and %s doesn't. With %s, the above example > yields > > =3D> look here: (7 (a b c) Wed Dec 2 14:46:19 2020 70) > > Roughly speaking: use %S if your target audience is a > computer program (or a human doing debugging, which > amounts to much the same), and %s if your target audience > is a human :) > > Now I'm again paraphrasing (badly) the manual for you. > I'm doing something wrong I guess. The manual explains it. Wrong? Must have been from the goodness of your heart. Yes, I understood about %S. > Cheers > - t >