Re: test shell env in .muttrc

2022-12-05 Thread Kevin J. McCarthy

On Mon, Dec 05, 2022 at 06:18:05PM -0800, Will Yardley wrote:

I think there may be an internal way as well, but one option would be to
set an env var (e.g., TYPE) depending on the type of session, and then
do something like (untested):

source ~/.mutt/colors.${TYPE:-default}


See also  for some examples of 
MuttLisp.  For example:


source (concat "~/.mutt/colors." (or $TYPE default))

--
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA


signature.asc
Description: PGP signature


Re: test shell env in .muttrc

2022-12-05 Thread Will Yardley
On Mon, Dec 05, 2022 at 08:26:16PM -0500, Jon LaBadie wrote:

> Perhaps I've overlooked the facility.  Is there a way to test the
> shell environment in .muttrc?  Basically an "if" statement.
> 
> I enter mutt in several ways (direct, aliases, shell scripts,
> functions, etc) and from several devices.  My smart phone needs a
> different color scheme than the other devices.

I think there may be an internal way as well, but one option would be to
set an env var (e.g., TYPE) depending on the type of session, and then
do something like (untested):

source ~/.mutt/colors.${TYPE:-default}

Or you could key it on hostname, similar to this example:
https://lwn.net/Articles/587348/

You can also source a shell script to do some stuff
https://mutt-users.mutt.narkive.com/WovuIH31/conditionally-include-a-file-in-the-configuration

there may be some patches to support more within the config itself.
neomutt (which I don't use personally) has some support via this hook:
https://neomutt.org/feature/ifdef




Re: Muttlisp question

2022-12-05 Thread Kevin J. McCarthy

On Mon, Dec 05, 2022 at 04:12:01PM -0800, Kevin J. McCarthy wrote:

set muttlisp_inline_eval

bind index j (if (equal $sidebar_visible "yes")  \
'sidebar-next'  \
'next-undeleted')


I realized after I sent that you might be wanting to dynamically 
determine if the sidebar is visible.  The above just affects what is 
bound to 'j' when evaluated.


To do that, you could try a macro:

macro index j 'run (if (equal $sidebar_visible "yes")  \
 "exec sidebar-next" \
 "exec next-undeleted")'

It's a bit less efficient, so if that's a concern, you could just use a 
macro to toggle $sidebar_visible and at the same time source a file with 
the special "sidebar toggling" bind commands.


--
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA


signature.asc
Description: PGP signature


test shell env in .muttrc

2022-12-05 Thread Jon LaBadie

Perhaps I've overlooked the facility.  Is there a way to
test the shell environment in .muttrc?  Basically an "if"
statement.

I enter mutt in several ways (direct, aliases, shell scripts,
functions, etc) and from several devices.  My smart phone
needs a different color scheme than the other devices.

It is easy enough to use a macro I have to rotate among
several color schemes, but I would prefer to automate it
on entry if possible.

Jon

--
Jon H. LaBadie j...@labadie.us
 154 Milkweed Dr (540) 868-8052 (H)
 Lake Frederick, VA 22630(703) 935-6720 (M)



Re: Muttlisp question

2022-12-05 Thread Kevin J. McCarthy

On Tue, Dec 06, 2022 at 12:24:58AM +0100, Andy Spiegl wrote:

I'm trying to bind the "j" key to the function "sidebar-next" if the sidebar is 
visible.
The only doable way seems to be using muttlisp.
I tried to follow the example in the mutt manual but I'm failing to write this 
tiny piece of lisp code.
Could someone help me please to correct the follwing?
Or maybe there is a better/easier way to do this?

--
# sidebar visible  -->  bind index j next-undeleted
# sidebar NOT visible  -->  bind index j sidebar-next
bind index j '\
 (or \
   (if (not $sidebar_visible) 'next-undeleted')  \
   ('sidebar-next')  \
 )   \
'


Try something like:

set muttlisp_inline_eval

bind index j (if (equal $sidebar_visible "yes")  \
 'sidebar-next'  \
 'next-undeleted')

The muttlisp can't be inside quotes, so I removed the outer single
quotes.

Also, boolean variables evaluate to "yes" or "no".  I will add this to
the documentation.

Hope that helps.

--
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA


signature.asc
Description: PGP signature


Muttlisp question

2022-12-05 Thread Andy Spiegl
Good evening,

I'm trying to bind the "j" key to the function "sidebar-next" if the sidebar is 
visible.
The only doable way seems to be using muttlisp.
I tried to follow the example in the mutt manual but I'm failing to write this 
tiny piece of lisp code.
Could someone help me please to correct the follwing?
Or maybe there is a better/easier way to do this?

--
# sidebar visible  -->  bind index j next-undeleted
# sidebar NOT visible  -->  bind index j sidebar-next
bind index j '\
  (or \
(if (not $sidebar_visible) 'next-undeleted')  \
('sidebar-next')  \
  )   \
'
--

Mutt complains like this:
Error in line 643:   (or
 (if (not $sidebar_visible) next-undeleted)  
(sidebar-next))  : no such function in map


Thanks a lot!
 Andy

-- 
 A paranoid is someone who knows a little of what's going on.
   (William S. Burroughs)


PGP signed messages and MS Outlook

2022-12-05 Thread Jan Eden via Mutt-users
Hi,

a couple of days ago, people using MS Outlook started complaing that my
messages looked "strange". I asked for an example and received this:

> > Subject: Re: Finanzierung
> > 
> > MIME-Version: 1.0
> > Content-Type: multipart/signed; micalg=pgp-sha512;
> > protocol="application/pgp-signature"; boundary="Zd5+bFLIq/fPSfy5"
> > 
> > --Zd5+bFLIq/fPSfy5
> > Content-Type: text/plain; charset=utf-8
> > Content-Disposition: inline
> > Content-Transfer-Encoding: quoted-printable
> > 
> > Lieber x,
> > 
> > vielen Dank. Wenn wir die Parallelit=C3=A4t ...

The headers below the Subject header are visible to the recipient, and
the quoted-printable content is not unquoted by the client. The message
in question is PGP signed and properly displayed in mutt (of course) and
Apple Mail. The source of the message (as received via MS Exchange)
looks like this:

> Subject: Re: Finanzierung
> Message-ID: 
> References: 
>  
> Content-Type: multipart/signed; micalg=pgp-sha512;
>   protocol="application/pgp-signature"; boundary="Zd5+bFLIq/fPSfy5"
> Content-Disposition: inline
> In-Reply-To: 
> Return-Path: my.addr...@hs-duesseldorf.de
> X-MS-Exchange-Organization-Network-Message-Id: 
> eededcf1-f439-486e-1257-08dad6c4c55a
> X-MS-Exchange-Organization-AuthSource: zvexch6.IT.lan
> X-MS-Exchange-Organization-AuthAs: Internal
> X-MS-Exchange-Organization-AuthMechanism: 07
> X-Originating-IP: [10.5.7.121]
> X-ClientProxiedBy: zvexch6.IT.lan (10.5.7.76) To zvexch6.IT.lan (10.5.7.76)
> X-MS-Exchange-Organization-AVStamp-Enterprise: 1.0
> X-MS-Exchange-Organization-Recipient-P2-Type: Bcc
> X-MS-Exchange-Transport-EndToEndLatency: 00:00:00.3281613
> X-MS-Exchange-Processed-By-BccFoldering: 15.01.2507.016
> MIME-Version: 1.0
> X-TUID: pVjn50NSefgW
> 
> --Zd5+bFLIq/fPSfy5
> Content-Type: text/plain; charset=utf-8
> Content-Disposition: inline
> Content-Transfer-Encoding: quoted-printable
> 
> Lieber ,
> 
> vielen Dank. Wenn wir die Parallelit=C3=A4t ...

The issue only occurs with signed messages – sending the very same
(plain text) message without the signature works fine for Outlook-using
recipients.  I have signed my messages for several months now, without
any negative feedback – is anyone aware of recent changes in Outlook
which might have caused this?

- Jan


signature.asc
Description: PGP signature