From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.help Subject: Re: How to get the actual face attribute? Date: Wed, 24 Jun 2020 00:12:22 -0400 Message-ID: References: <60C41409-88B0-4F21-AC6D-2F18394A7C46@gmail.com> <41A32155-634A-4D5A-A878-2F92E6761917@gmail.com> <87pn9qbxl6.fsf@ebih.ebihd> Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="45044"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Emanuel Berg Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 24 06:12:58 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 1jnwmQ-000Bcf-ER for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 24 Jun 2020 06:12:58 +0200 Original-Received: from localhost ([::1]:45744 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnwmP-0004ra-Ez for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 24 Jun 2020 00:12:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52276) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnwly-0004rT-KH for help-gnu-emacs@gnu.org; Wed, 24 Jun 2020 00:12:30 -0400 Original-Received: from mail-qt1-x82f.google.com ([2607:f8b0:4864:20::82f]:45149) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnwlt-0006SL-EI for help-gnu-emacs@gnu.org; Wed, 24 Jun 2020 00:12:30 -0400 Original-Received: by mail-qt1-x82f.google.com with SMTP id u12so660908qth.12 for ; Tue, 23 Jun 2020 21:12:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=qfX9/StWQ0r+4u6rWaV8igXrnU/KzQ9/ELiE91mfCcs=; b=ABtbk6pQFiAmHTY468KOib3ueJhaGSX23ZQW8TKeIjkyifkmPhcy6KYvQ1XXS5/BzJ IbQAYKZSvIklEk53iHR/aVZjTUotZ/VY6hXkeAO/ddetJSkQhHRecFXzbZyOBPSUNixo 4z5/sF8cb40zIt9N6U7yGJO1FcRwSIO3qK60K5ay6GuOQVPZo+RCiArOrT4oH/2DgOKg OiZKK/RuvjsLvk7sl/Gstayag5GvFWlfTDJQoHtLnUZNoa205fl/JoP97j2/m2GrFoJO PcXhKaZvzKzMDsPuawlG93ackf/ZOVvsLtB0fuwCygX1DzXXQm33N3QMqZS/6M0pn3Hn dyng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=qfX9/StWQ0r+4u6rWaV8igXrnU/KzQ9/ELiE91mfCcs=; b=YnT+k8gTXNF1st//8bU1H2DOKSE8F+g3zAGvW/TN3I6iDuoHOPIJsxIiTyLCjuAk7M uW4KS9q9aiOf0fNEeAMTHpHsCpDbUjJIgDbItwiNs6gWK94Moozmo6rnRynaomiOD27i qx1t1ONEg5nMWGDjMntkPt8XwjDjDIzhTpU7dA/Ae1y82QY4YwmmkJ9H+U4I/Z+O+Cvj N/Yyd4wIbFRNPo45USH99EK9FV6vuiiIwzIMq7KrvOk2gCfaMyannoZ3hisOebHgPadi bs59V5SV+znv4ztTdODMN00XJGs2Z3cHQiG/6iiZKrlGcV0G3AUReaowc0opNGFc+z0k Xu2w== X-Gm-Message-State: AOAM532yFk9sKEX/p0ugqyFXPvtSgF2nu4bN1JZj1bVY/KYbf3cYnXLV dFgh5278KzALUNm3uehJX5w= X-Google-Smtp-Source: ABdhPJwQ/VdCNofFXLup7vZ+weN0IpJgJ/9m693UhlqazKBLahcozq7C28EvmgFS9AlubcgypQ79kQ== X-Received: by 2002:ac8:32e3:: with SMTP id a32mr25131132qtb.118.1592971943776; Tue, 23 Jun 2020 21:12:23 -0700 (PDT) Original-Received: from ?IPv6:2601:98a:4200:9210:d9ee:c420:2dfe:c49c? ([2601:98a:4200:9210:d9ee:c420:2dfe:c49c]) by smtp.gmail.com with ESMTPSA id a185sm2283205qkg.3.2020.06.23.21.12.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Jun 2020 21:12:23 -0700 (PDT) In-Reply-To: <87pn9qbxl6.fsf@ebih.ebihd> X-Mailer: Apple Mail (2.3608.80.23.2.2) Received-SPF: pass client-ip=2607:f8b0:4864:20::82f; envelope-from=casouri@gmail.com; helo=mail-qt1-x82f.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, T_SPF_TEMPERROR=0.01 autolearn=_AUTOLEARN 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:123435 Archived-At: > On Jun 22, 2020, at 5:27 PM, Emanuel Berg via Users list for the GNU = Emacs text editor wrote: >=20 > Yuan Fu wrote: >=20 >> (let* ((p (or point (point)))) >> (if (eq (char-after point) ?\t) >> (valign--tab-width (font-at p)) >> ;; (font-at 0 nil (buffer-substring p (1+ p))) doesn=E2=80=99t = work, the >> ;; font is sometimes wrong. (font-at p) doesn=E2=80=99t work, = because >> ;; it requires the buffer to be visible. >> (aref (aref (font-get-glyphs (font-at p) p (1+ p)) 0) 4))) >=20 > Hello Yuan Fu, you have a cool name :) >=20 > re: code, the byte compiler is always your friend: >=20 > geh.el:=20 > In do-something: > geh.el:10:17:Warning: reference to free variable =E2=80=98point=E2=80= =99 >=20 > In end of data: > geh.el:110:1:Warning: the function =E2=80=98valign--tab-width=E2=80=99= is not known to be > defined. >=20 > Also style point #1: >=20 > (aref (aref (font-get-glyphs (font-at p) p (1+ p)) 0) 4))) >=20 > Suggestion, break it up, do more `let*'. >=20 > ditto #2: >=20 > (or point (point)) >=20 > Straight long-ear [1] use of `or' :) However the > particular >=20 > point (point)=20 >=20 > is confusing IMO. >=20 It=E2=80=99s used to support optional argument POINT. > ditto #3: >=20 > ... 0) 4))) >=20 > hard-coded data can also be put into `let*' to > increase clarity, however if they only appear once > one is allowed... heh :) one is allowed to have them > hard-coded. if they ever appear twice names, > variables/bindings are compulsory, with the possible > exceptions of -1, 0, 1, nil and t :) Ok, I=E2=80=99ll use more let next time. Thanks! Yuan=