all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Angelo Graziosi <angelo.g0@libero.it>
Cc: stefankangas@gmail.com, emacs-devel@gnu.org
Subject: Re: About the new frame title
Date: Fri, 25 Sep 2020 15:41:36 +0300	[thread overview]
Message-ID: <83pn6arptr.fsf@gnu.org> (raw)
In-Reply-To: <1215160860.42777.1601037524656@mail1.libero.it> (message from Angelo Graziosi on Fri, 25 Sep 2020 14:38:44 +0200 (CEST))

> Date: Fri, 25 Sep 2020 14:38:44 +0200 (CEST)
> From: Angelo Graziosi <angelo.g0@libero.it>
> Cc: emacs-devel@gnu.org
> 
> > Does this work?  AFAIK, 'sizeof (char *)' returns 8 on a 64-bit system
> > and 4 on a 32-bit system, regardless of the length of the text string
> > it points to.
> 
> I wonder if this can fix it:
> 
> ptrdiff_t nbytes = strlen(title)*sizeof (title[0]);

This will work, but the idea was to compute the value at compile time,
since sizeof is a compile-time operator.

> or better, given 'title' is a const hard coded,
> 
> ptrdiff_t nbytes = 13*sizeof (title[0]);

That's exactly what I wanted to avoid, since the constant needs to be
updated each time the text is modified.

Thanks.



  reply	other threads:[~2020-09-25 12:41 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-14  8:27 About the new frame title Angelo Graziosi
2020-09-14 15:17 ` Eli Zaretskii
2020-09-14 15:52   ` Angelo Graziosi
2020-09-19 13:21     ` Stefan Kangas
2020-09-19 14:39       ` Eli Zaretskii
2020-09-24  8:57         ` Stefan Kangas
2020-09-24 14:46           ` Eli Zaretskii
2020-09-25 12:38             ` Angelo Graziosi
2020-09-25 12:41               ` Eli Zaretskii [this message]
2020-09-25 13:31                 ` Angelo Graziosi
2020-09-25 13:42                   ` Eli Zaretskii
2020-11-13 23:10             ` Stefan Kangas
2020-11-13 23:51               ` Andrea Corallo via Emacs development discussions.
2020-11-14  7:26               ` Eli Zaretskii
2020-11-14 14:47                 ` Stefan Kangas
2020-11-14 15:10                   ` Eli Zaretskii
2020-11-15  1:44                     ` Stefan Kangas
2020-09-19 21:22       ` Angelo Graziosi
2020-09-24  8:37         ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83pn6arptr.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=angelo.g0@libero.it \
    --cc=emacs-devel@gnu.org \
    --cc=stefankangas@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.