Re: [vim/vim] configure: honor `--disable-hardcopy-pango` with GTK (PR #20945)

Wei Tang (Vim Github Repository) <[email protected]> Wed, 05 Aug 2026 00:25:19 -0700
Newsgroups gmane.editors.vim.devel
Message-ID <vim/vim/pull/20945/[email protected]>

----==_mimepart_6a72e55f64eca_10b118031932
Content-Type: text/plain; charset="UTF-8"

Fuzzier left a comment (vim/vim#20945)

Thanks for your advices.
1. Actually, the updated part of `auto/configure` was re-generated by autoconf 2.71 from the updated `configure.ac`.
   Now autoconf 2.72 is used to re-generate `auto/configure`.
2. Indentation in `configure.ac` is now fixed.
3. The root cause is that, in the unfixed `configure.ac`,  when GTK is enabled, `enable_hardcopy_pango` was *unconditionally* set to "yes", even if user explicitly specified "no" or defaults to "no", as stated in the commit message.
```m4
AC_MSG_CHECKING(--enable-hardcopy-pango argument)
AC_ARG_ENABLE(hardcopy-pango,
	[  --enable-hardcopy-pango     Use Pango and Cairo for improved hardcopy printing. [default=yes when GTK GUI enabled]],
	,, enable_hardcopy_pango="no")

if test "x$have_pango" = "xno" || test "x$have_cairo" = "xno"; then
  AC_MSG_RESULT([no, Pango or Cairo not found])
else
  # ===== When GTK is enabled ====  if test "x$GUITYPE" = "xGTK" || test "x$GUITYPE" = "xGTK4"; then
    # ===== `enable_hardcopy_pango` was *unconditionally* set to "yes" ====    enable_hardcopy_pango="yes"
    AC_MSG_RESULT([yes, GTK GUI enabled])
  else
    if test "$enable_hardcopy_pango" = "yes"; then
      AC_MSG_RESULT([yes])
    else
      AC_MSG_RESULT([no])
    fi
  fi
fi
```
   The logic of the fix is that, if user did not specify `hardcopy-pango` (neither "yes" nor "no"), a third value "auto" is adopted, and GTK options is checked for that condition.

5. The check for `fail_is_missing` is added.
```m4
if test "x$have_pango" = "xno" || test "x$have_cairo" = "xno"; then
  # ===== Respect `fail_if_missing` ====  if test "$fail_if_missing" = "yes" -a "$enable_hardcopy_pango" = "yes"; then
    AC_MSG_ERROR([could not configure hardcopy-pango])
  fi
  enable_hardcopy_pango="no"
  AC_MSG_RESULT([no, Pango or Cairo not found])
else
  ...
fi
```
   The logic of the fix is that, if user explicitly specifies `--enable-hardcopy-pango`, but the dependencies (pango and cairo) are not satisfied, `hardcopy-pango` would be disabled.

I updated the pull request.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/vim/vim/pull/20945#issuecomment-5188828771
You are receiving this because you are subscribed to this thread.

Message ID: <vim/vim/pull/20945/[email protected]>

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/vim_dev/vim/vim/pull/20945/c5188828771%40github.com.

----==_mimepart_6a72e55f64eca_10b118031932
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div style=3D"display: flex; flex-wrap: wrap; white-space: pre-wrap; align-=
items: center; "><img height=3D"20" width=3D"20" style=3D"border-radius:50%=
; margin-right: 4px;" decoding=3D"async" src=3D"https://avatars.githubuserc=
ontent.com/u/1460232" /><strong>Fuzzier</strong> left a comment <a href=3D"=
https://github.com/vim/vim/pull/20945#issuecomment-5188828771">(vim/vim#209=
45)</a></div>
<p dir=3D"auto">Thanks for your advices.</p>
<ol dir=3D"auto">
<li>Actually, the updated part of <code class=3D"notranslate">auto/configur=
e</code> was re-generated by autoconf 2.71 from the updated <code class=3D"=
notranslate">configure.ac</code>.<br>
Now autoconf 2.72 is used to re-generate <code class=3D"notranslate">auto/c=
onfigure</code>.</li>
<li>Indentation in <code class=3D"notranslate">configure.ac</code> is now f=
ixed.</li>
<li>The root cause is that, in the unfixed <code class=3D"notranslate">conf=
igure.ac</code>,  when GTK is enabled, <code class=3D"notranslate">enable_h=
ardcopy_pango</code> was <em>unconditionally</em> set to "yes", even if use=
r explicitly specified "no" or defaults to "no", as stated in the commit me=
ssage.</li>
</ol>
<div class=3D"highlight highlight-source-m4" dir=3D"auto"><pre class=3D"not=
ranslate"><span class=3D"pl-k">AC_MSG_CHECKING</span><span class=3D"pl-pds"=
>(</span><span class=3D"pl-k">--</span><span class=3D"pl-c1">enable-hardcop=
y-pango</span> <span class=3D"pl-c1">argument</span><span class=3D"pl-pds">=
)</span>
<span class=3D"pl-k">AC_ARG_ENABLE</span><span class=3D"pl-pds">(</span><sp=
an class=3D"pl-c1">hardcopy-pango</span>,
	<span class=3D"pl-c1"><span class=3D"pl-pds">[</span>  --enable-hardcopy-p=
ango     Use Pango and Cairo for improved hardcopy printing. <span class=3D=
"pl-c1"><span class=3D"pl-pds">[</span>default=3Dyes when GTK GUI enabled<s=
pan class=3D"pl-pds">]</span></span><span class=3D"pl-pds">]</span></span>,
	,, <span class=3D"pl-c1">enable_hardcopy_pango=3D"no"</span><span class=3D=
"pl-pds">)</span>

if test "x$have_pango" =3D "xno" || test "x$have_cairo" =3D "xno"; then
  <span class=3D"pl-k">AC_MSG_RESULT</span><span class=3D"pl-pds">(</span><=
span class=3D"pl-c1"><span class=3D"pl-pds">[</span>no, Pango or Cairo not =
found<span class=3D"pl-pds">]</span></span><span class=3D"pl-pds">)</span>
else
  <span class=3D"pl-c"><span class=3D"pl-c">#</span> =3D=3D=3D=3D=3D When G=
TK is enabled =3D=3D=3D=3D=3D</span>
  if test "x$GUITYPE" =3D "xGTK" || test "x$GUITYPE" =3D "xGTK4"; then
    <span class=3D"pl-c"><span class=3D"pl-c">#</span> =3D=3D=3D=3D=3D `ena=
ble_hardcopy_pango` was *unconditionally* set to "yes" =3D=3D=3D=3D=3D</spa=
n>
    enable_hardcopy_pango=3D"yes"
    <span class=3D"pl-k">AC_MSG_RESULT</span><span class=3D"pl-pds">(</span=
><span class=3D"pl-c1"><span class=3D"pl-pds">[</span>yes, GTK GUI enabled<=
span class=3D"pl-pds">]</span></span><span class=3D"pl-pds">)</span>
  else
    if test "$enable_hardcopy_pango" =3D "yes"; then
      <span class=3D"pl-k">AC_MSG_RESULT</span><span class=3D"pl-pds">(</sp=
an><span class=3D"pl-c1"><span class=3D"pl-pds">[</span>yes<span class=3D"p=
l-pds">]</span></span><span class=3D"pl-pds">)</span>
    else
      <span class=3D"pl-k">AC_MSG_RESULT</span><span class=3D"pl-pds">(</sp=
an><span class=3D"pl-c1"><span class=3D"pl-pds">[</span>no<span class=3D"pl=
-pds">]</span></span><span class=3D"pl-pds">)</span>
    fi
  fi
fi</pre></div>
<p dir=3D"auto">The logic of the fix is that, if user did not specify <code=
 class=3D"notranslate">hardcopy-pango</code> (neither "yes" nor "no"), a th=
ird value "auto" is adopted, and GTK options is checked for that condition.=
</p>
<ol start=3D"5" dir=3D"auto">
<li>The check for <code class=3D"notranslate">fail_is_missing</code> is add=
ed.</li>
</ol>
<div class=3D"highlight highlight-source-m4" dir=3D"auto"><pre class=3D"not=
ranslate">if test "x$have_pango" =3D "xno" || test "x$have_cairo" =3D "xno"=
; then
  <span class=3D"pl-c"><span class=3D"pl-c">#</span> =3D=3D=3D=3D=3D Respec=
t `fail_if_missing` =3D=3D=3D=3D=3D</span>
  if test "$fail_if_missing" =3D "yes" -a "$enable_hardcopy_pango" =3D "yes=
"; then
    <span class=3D"pl-k">AC_MSG_ERROR</span><span class=3D"pl-pds">(</span>=
<span class=3D"pl-c1"><span class=3D"pl-pds">[</span>could not configure ha=
rdcopy-pango<span class=3D"pl-pds">]</span></span><span class=3D"pl-pds">)<=
/span>
  fi
  enable_hardcopy_pango=3D"no"
  <span class=3D"pl-k">AC_MSG_RESULT</span><span class=3D"pl-pds">(</span><=
span class=3D"pl-c1"><span class=3D"pl-pds">[</span>no, Pango or Cairo not =
found<span class=3D"pl-pds">]</span></span><span class=3D"pl-pds">)</span>
else
  ...
fi</pre></div>
<p dir=3D"auto">The logic of the fix is that, if user explicitly specifies =
<code class=3D"notranslate">--enable-hardcopy-pango</code>, but the depende=
ncies (pango and cairo) are not satisfied, <code class=3D"notranslate">hard=
copy-pango</code> would be disabled.</p>
<p dir=3D"auto">I updated the pull request.</p>

<p style=3D"font-size:small;-webkit-text-size-adjust:none;color:#666;">&mda=
sh;<br />Reply to this email directly, <a href=3D"https://github.com/vim/vi=
m/pull/20945#issuecomment-5188828771">view it on GitHub</a>, or <a href=3D"=
https://github.com/notifications/unsubscribe-auth/ACY5DGANYEY4HAJ6PKUCSKD5I=
LON7AVCNFSNUABEKJSXA33TNF2G64TZHM2DAOJZG42DQMR3JFZXG5LFHM2TANRXGEZTGNJXGOQX=
MAQ">unsubscribe</a>.<br />Triage notifications, keep track of coding agent=
 tasks and review pull requests on the go with GitHub Mobile for <a href=3D=
"https://github.com/notifications/mobile/ios/ACY5DGHYQEQZAMLHEJHPH6T5ILON7A=
5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKMJYHA4DEOBXG4Y2M4TFM=
FZW63VKON2WE43DOJUWEZLEUVSXMZLOOSVGM33PORSXEX3JN5ZQ">iOS</a> and <a href=3D=
"https://github.com/notifications/mobile/android/ACY5DGBEU4LH3TM2D6M3Y6D5IL=
ON7A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKMJYHA4DEOBXG4Y2M=
4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSXGM33PORSXEX3BNZSHE33JMQ">Android</a>.=
 Download it today!
<br />You are receiving this because you are subscribed to this thread.<img=
 src=3D"https://github.com/notifications/beacon/ACY5DGHZ7VEM4DIUEKA4AVL5ILO=
N7BFCNFSM6AAAAAC434OUYCWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3=
TUL5UWJTYAAAAACNKHHZR2M4TFMFZW63VKON2WE43DOJUWEZLE.gif" height=3D"1" width=
=3D"1" alt=3D"" /><span style=3D"color: transparent; font-size: 0; display:=
 none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: =
0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span>&lt;vim/vi=
m/pull/20945/c5188828771</span><span>@</span><span>github</span><span>.</sp=
an><span>com&gt;</span></span></p>

<script type=3D"application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/vim/vim/pull/20945#issuecomment-5188828771",
"url": "https://github.com/vim/vim/pull/20945#issuecomment-5188828771",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>

<p></p>

-- <br />
-- <br />
You received this message from the &quot;vim_dev&quot; maillist.<br />
Do not top-post! Type your reply below the text you are replying to.<br />
For more information, visit <a href=3D"http://www.vim.org/maillist.php">htt=
p://www.vim.org/maillist.php</a><br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;vim_dev&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]">vim_dev+uns=
[email protected]</a>.<br />
To view this discussion visit <a href=3D"https://groups.google.com/d/msgid/=
vim_dev/vim/vim/pull/20945/c5188828771%40github.com?utm_medium=3Demail&utm_=
source=3Dfooter">https://groups.google.com/d/msgid/vim_dev/vim/vim/pull/209=
45/c5188828771%40github.com</a>.<br />

----==_mimepart_6a72e55f64eca_10b118031932--