Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

index_format: conditional right justification does not work #4259

Closed
ernix opened this issue Apr 18, 2024 · 5 comments · Fixed by #4261
Closed

index_format: conditional right justification does not work #4259

ernix opened this issue Apr 18, 2024 · 5 comments · Fixed by #4261
Labels

Comments

@ernix
Copy link

ernix commented Apr 18, 2024

@flatcap @cyphar index_format looked broke again. See: #1074

Expected Behaviour

N F  4/18 13:42 To kojima@inter (0.1K) hello

Actual Behaviour

N F  4/18 13:42 To kojima@inter (0.1K) hello- [#00 ]>

Steps to Reproduce

set index_format = "%Z %[%b/%d %H:%M] %-15.15L %?y?[%4.4y]&(%4c)? %s%<M? %>- [#%03M]>"

How often does this happen?

  • Always

When did it start to happen?

  • When I upgraded from version 20231006

NeoMutt Version

NeoMutt 20240416-525-b01e1f
Copyright (C) 2015-2024 Richard Russon and friends
NeoMutt comes with ABSOLUTELY NO WARRANTY; for details type 'neomutt -vv'.
NeoMutt is free software, and you are welcome to redistribute it
under certain conditions; type 'neomutt -vv' for details.

System: Darwin 22.6.0 (arm64)
ncurses: ncurses 6.4.20221231 (compiled with 6.4.20221231)
libiconv: 1.17
libidn2: 2.3.7 (compiled with 2.3.7)
GPGME: 1.23.2
OpenSSL: OpenSSL 3.2.1 30 Jan 2024
libnotmuch: 5.6.0
PCRE2: 10.43 2024-02-16
storage: tokyocabinet, lmdb
compression: zlib

Configure options: --sysconfdir=/opt/homebrew/etc --autocrypt --gss --disable-idn --idn2 --lmdb --nls --notmuch --pcre2 --sasl --sqlite --tokyocabinet --zlib --with-idn2=/opt/homebrew/opt/libidn2 --with-lua=/opt/homebrew/opt/lua --with-ncurses=/opt/homebrew/opt/ncurses --with-ssl=/opt/homebrew/opt/openssl@3 --with-sqlite=/opt/homebrew/opt/sqlite --with-iconv=/opt/homebrew/opt/libiconv --disable-debug --disable-dependency-tracking --prefix=/opt/homebrew/Cellar/neomutt/HEAD-b01e1fd --libdir=/opt/homebrew/Cellar/neomutt/HEAD-b01e1fd/lib

Compilation CFLAGS: -D_ALL_SOURCE=1 -D_GNU_SOURCE=1 -D__EXTENSIONS__ -D_XOPEN_SOURCE_EXTENDED -I/opt/homebrew/opt/libgpg-error/include -I/opt/homebrew/Cellar/libassuan/2.5.7/include -I/opt/homebrew/Cellar/gpgme/1.23.2_1/include -I/opt/homebrew/Cellar/neomutt/HEAD-b01e1fd/include -I/opt/homebrew/include/lua -I/opt/homebrew/Cellar/neomutt/HEAD-b01e1fd/include -I/opt/homebrew/Cellar/neomutt/HEAD-b01e1fd/include -I/opt/homebrew/opt/sqlite/include -I/opt/homebrew/Cellar/neomutt/HEAD-b01e1fd/include -DNCURSES_WIDECHAR -I/opt/homebrew/opt/ncurses/include -I/opt/homebrew/opt/libiconv/include -I/opt/homebrew/Cellar/openssl@3/3.2.1/include -I/opt/homebrew/Cellar/libidn2/2.3.7/include -I/opt/homebrew/Cellar/pcre2/10.43/include -I/opt/homebrew/opt/lmdb/include -I/opt/homebrew/Cellar/tokyo-cabinet/1.4.48/include -I/opt/homebrew/Cellar/neomutt/HEAD-b01e1fd/include -O2

コンパイル時オプション:
  +autocrypt +fcntl -flock -fmemopen +futimens +getaddrinfo -gnutls +gpgme
  -gsasl +gss +hcache -homespool +idn -inotify -locales_hack +lua -mixmaster
  +nls +notmuch +openssl +pcre2 +pgp +sasl +smime +sqlite +truecolor

MAILPATH="/var/mail"
PKGDATADIR="/opt/homebrew/Cellar/neomutt/HEAD-b01e1fd/share/neomutt"
SENDMAIL="/usr/sbin/sendmail"
SYSCONFDIR="/opt/homebrew/etc"

To learn more about NeoMutt, visit: https://neomutt.org
If you find a bug in NeoMutt, please raise an issue at:
    https://github.com/neomutt/neomutt/issues
or send an email to: <neomutt-devel@neomutt.org>
@ernix ernix added the type:bug Bug label Apr 18, 2024
@freswa
Copy link

freswa commented Apr 18, 2024

I think I'm in the same boat, with

/home/frederik/.config/neomutt/layout:10: Option attach_format: Unknown expando: %

Which is this line:

set attach_format = "%u%D %?Q?& ? %T%-75.75d %?T?%&   ? %5s · %m/%M"

Can create a separate issue if this doesn't fit here.

@flatcap
Copy link
Member

flatcap commented Apr 18, 2024

@ernix
Thanks for the bug report.
Please can you give branch [devel/expando] a try.

It should fix your problem.
I'll add some tests later.

@flatcap
Copy link
Member

flatcap commented Apr 18, 2024

@freswa
I think your problem is actually just syntax.
The error message could be a bit more helpful, though :-)

First, let's upgrade your format to use the modern %<...> syntax:

set attach_format = "%u%D %?Q?📎& ? %T%-75.75d %?T?%&   ? %5s · %m/%M"
set attach_format = "%u%D %<Q?📎& > %T%-75.75d %<T?%&   > %5s · %m/%M"

The problem is in the middle of this conditional: %<T?%& >

There's a % that shouldn't be there.
Removing it, gives:

set attach_format = "%u%D %<Q?📎& > %T%-75.75d %<T?&   > %5s · %m/%M"

which works.
If there are tree characters (%T is true) print nothing.
If there aren't tree characters (%T is false), print 3 spaces.

@ernix
Copy link
Author

ernix commented Apr 19, 2024

@ernix Thanks for the bug report. Please can you give branch [devel/expando] a try.

It should fix your problem. I'll add some tests later.

Thanks, confirmed devel/expando branch fixes my issue.

@flatcap
Copy link
Member

flatcap commented Apr 20, 2024

I've updated the branch with an improved fix, several others and some tests.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants