1

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

4
  • Note: I have also tried other regexp in auto-mode-alist with the same results. I tried (add-to-list 'auto-mode-alist '("\\.crt\\'" . x509-dwim)) for instance. Commented Nov 26, 2024 at 17:28
  • And I have tried (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. Commented Nov 26, 2024 at 18:53
  • I would have expected your last comment to have worked (x509-mode rather than x509-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. Commented Nov 27, 2024 at 15:23
  • 1
    Hi @NickD, I already posted a question on the Github site. I also would need to review the entire code. Commented Nov 27, 2024 at 15:40

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.