My code associates a .crt file to the x509-dwim function with:
(add-to-list 'auto-mode-alist '("\\.crt\\'" . x509-dwim)) When I open a .crt X.509 certificate file, the association works fine and the x509-dwim function correctly identifies the X.509 certificate and shows the extracted information as expected.
However, the association fails when I open the file from within the archive-mode buffer rendering of that .zip file: the buffer is opened in Fundamental mode.
Executing (buffer-name) on the buffer returns something like this:
"some.something.net.crt (somefile.something.net_Current.zip)"
Should another entry be placed in the auto-mode-alist to handle buffers that are created from the archive-mode buffer? Or is something else necessary?
Using Emacs 29.4
auto-mode-alistwith the same results. I tried(add-to-list 'auto-mode-alist '("\\.crt\\'" . x509-dwim))for instance.(add-to-list 'auto-mode-alist '("\\.crt\\'" . x509-mode)). My suspicion at this point is there is something wrong with the x509-mode.el code or my understanding of that code.x509-moderather thanx509-dwim) but the code is doing some funky things that I don't understand yet. You might want to post an issue on the github site.