From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "T.V Raman" Newsgroups: gmane.emacs.devel Subject: Re: Faces for strong, emph and friends in Info? Date: Mon, 8 Apr 2024 15:29:44 -0700 Message-ID: <26132.28632.986421.497515@google.com> References: <86o7ajyk6v.fsf@gnu.org> <87o7ajssgp.fsf@gmail.com> 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="17848"; mail-complaints-to="usenet@ciao.gmane.io" Cc: eliz@gnu.org, raman@google.com, emacs-devel@gnu.org To: rpluim@gmail.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Apr 09 00:30:28 2024 Return-path: Envelope-to: ged-emacs-devel@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 1rtxVT-0004Rq-TT for ged-emacs-devel@m.gmane-mx.org; Tue, 09 Apr 2024 00:30:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rtxUw-0000vj-8O; Mon, 08 Apr 2024 18:29:54 -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 1rtxUu-0000ue-1S for emacs-devel@gnu.org; Mon, 08 Apr 2024 18:29:52 -0400 Original-Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rtxUs-0007KU-HC for emacs-devel@gnu.org; Mon, 08 Apr 2024 18:29:51 -0400 Original-Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-6ecfeefe94cso2374496b3a.0 for ; Mon, 08 Apr 2024 15:29:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1712615387; x=1713220187; darn=gnu.org; h=references:in-reply-to:subject:cc:to:date:message-id :content-transfer-encoding:mime-version:from:from:to:cc:subject:date :message-id:reply-to; bh=KYwEjpwJxZXvwT2tVNENdTnTHWw02vPCvXwtf7ffCqM=; b=At7E3Jp6sRShN5FSnxAi1jzTpHIEUq9Z5UEDg2LlSkecj1r7MBHjYhK+GtiVUMdBgF NmeA7Togm6fdmdV6J5jd9QUYvHBvhawIPTyAO48A5zCEPzx2QmcVNjb+fSGEx4RLxrGt GalxhTB83XROh8M97oFBAGnJB063inTP602sDaIBBrlaIjxmhOTl0l8IL7vdsRndfbOY N47MpdNta+D0p5QdjddAP0UlUpCA5LRdzjXoYdXGWgObjGtWPqV8KGwPPSl/6dOTtMuX UB30OGoo0JJZVXZ1LAikh3nCpc9Ifwv5IUhy5vN9SG1Z0QbBTkRs89TjOT5tu3EMaFUm kT6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712615387; x=1713220187; h=references:in-reply-to:subject:cc:to:date:message-id :content-transfer-encoding:mime-version:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=KYwEjpwJxZXvwT2tVNENdTnTHWw02vPCvXwtf7ffCqM=; b=o6cUs7LhmKwP8I78PXkiu7HczAFbX7QZ3buHejpFMOav8O0pE2zHqNPZmO7ae4ad2A B8FdmgpDR+PVmK3oHLthu2+5QhPpxrwo8GiIHJM36a6XNQ9jV/QKutLAkZfhxn1Meyku emJy1up36J9ei8RHvZOYkc6BQTtwVgcl0iv+J+fuPvoUfTcZOQyb2GlX7rt4obiia5TB /S1+6kYdXQAV6P+LSHyGuRzAF/8I1029rys7za9bXxJRxDp+NA49noGSNqPo4kgsaHBt bk1zUYGT6JyFwOPOr0iFJW91H1pfauwGMKx1VzgRgSKpnt1tuXIgIfJ6BZpaZR9ca99M gzQg== X-Forwarded-Encrypted: i=1; AJvYcCVMMUJg8rJ1l6LPY5wOqGEo3KTlqPJK/TE4YDPkUgVI4cmHYPDeCtbTYlCu8zS9FFZgTKIj95DGR2RtOkUXynjB6Mud X-Gm-Message-State: AOJu0YwI7W9JXUZPcCJiuWVJ4LPqw14krJbXIfqUsslof88oa8Q0QW6B Nz/qDJ62vLlVQjs25K2ebE0Dk9p7Cgvv4UJFha+G8vNxs02ynYu8ZHor0ordj8jx3v1gKof5+Cy sKQ== X-Google-Smtp-Source: AGHT+IGLAcyFBxOQNliUTuQVSrGI4qo9ZrPN3J6fGrQQaUi2fCjNM4vpxTJQrtc3vJ7qZ7dAj8pGeA== X-Received: by 2002:a05:6a00:2353:b0:6e6:c191:d581 with SMTP id j19-20020a056a00235300b006e6c191d581mr1381907pfj.14.1712615386961; Mon, 08 Apr 2024 15:29:46 -0700 (PDT) Original-Received: from raman9 (c-98-45-12-92.hsd1.ca.comcast.net. [98.45.12.92]) by smtp.gmail.com with ESMTPSA id k6-20020aa79986000000b006e729dd12d5sm7097285pfh.48.2024.04.08.15.29.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 15:29:46 -0700 (PDT) In-Reply-To: <87o7ajssgp.fsf@gmail.com> X-Mailer: VM 8.1.1 under 30.0.50 (x86_64-pc-linux-gnu) Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=raman@google.com; helo=mail-pf1-x434.google.com X-Spam_score_int: -186 X-Spam_score: -18.7 X-Spam_bar: ------------------ X-Spam_report: (-18.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, ENV_AND_HDR_SPF_MATCH=-0.5, NICE_REPLY_A=-1.071, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5, USER_IN_DEF_SPF_WL=-7.5 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:317629 Archived-At: After applying the patch, @strong is turning bold, but @emph is still showing up with '=5F'. As an example in node on dabbrevs: File: emacs.info, Node: Dabbrev Customization, Prev: Dynamic Abbrevs,= Up: Abbrevs Normally, dynamic abbrev expansion preserves the case pattern =5Fof = the Robert Pluim writes: > >>>>> On Mon, 08 Apr 2024 17:59:20 +0300, Eli Zaretskii said: > >> info.el defines faces for various structural contructs but th= ere > >> appears to be no info-strong and info-emph -- is that intenti= onal or > >> just a lay-over from the time we didn't have font faces=3F >=20 > Eli> I think it's just that no one has written the code to show = *foo* and > Eli> =5Ffoo=5F as italics and bold (and hide the =5F and * chara= cters). Of > Eli> course, this will cause some lines be shorter or longer tha= n they are > Eli> supposed to be, but maybe this is a worthwhile price to pay= =2E >=20 > Eli> Patches welcome. >=20 > How robust do you want this to be=3F (I took a quick look at using > font-lock for this, but I don=CA=BCt think that supports hiding stuf= f) >=20 > Probably needs (yet another) config variable as well. >=20 >=20 > diff --git a/lisp/info.el b/lisp/info.el > index 176bc9c0033..14ed026a568 100644 > --- a/lisp/info.el > +++ b/lisp/info.el > @@ -4491,6 +4491,16 @@ Info-quoted > '((t :inherit fixed-pitch-serif)) > "Face used for quoted elements.") > =20 > +(defface Info-strong > + '((t :inherit bold)) > + "Face used for *strong* elements." > + :version "30.1") > + > +(defface Info-emphasis > + '((t :inherit italic)) > + "Face used for =5Femphasis=5F elements." > + :version "30.1") > + > ;; We deliberately fontify only =E2=80=98..=E2=80=99 quoting, and n= ot `..', because > ;; the former can be done much more reliably, i.e. without risking > ;; false positives. > @@ -5134,6 +5144,20 @@ Info-fontify-node > (push (set-marker (make-marker) start) > paragraph-markers)))))) > =20 > + ;; Font-lock *foo* and =5Ffoo=5F and hide the marker characte= rs. > + (goto-char (point-min)) > + (while (re-search-forward "\\([*=5F]\\)\\([^*=5F\n]+\\)\\([*=5F= ]\\)" nil t) > + (when (string=3D (match-string 1) (match-string 3)) > + (add-text-properties (match-beginning 1) (match-end 1) > + '(invisible t front-sticky nil rear-= nonsticky t)) > + (add-text-properties (match-beginning 3) (match-end 3) > + '(invisible t front-sticky nil rear-= nonsticky t)) > + (put-text-property (match-beginning 2) (match-end 2) > + 'font-lock-face > + (if (string=3D (match-string 1) "*") > + 'Info-strong > + 'Info-emphasis)))) > + > ;; Refill paragraphs (experimental feature) > (when (and not-fontified-p > Info-refill-paragraphs >=20 >=20 > Robert > --=20 --=20 --