emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [elpa] externals/tempel 7fc015b652 1/2: Respect major-mode-remap-ali


From: Daniel Mendler
Subject: Re: [elpa] externals/tempel 7fc015b652 1/2: Respect major-mode-remap-alist (Emacs 29 major mode remapping)
Date: Fri, 16 Feb 2024 07:04:43 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> --- a/tempel.el
>> +++ b/tempel.el
>> @@ -494,7 +494,9 @@ This is meant to be a source in 
>> `tempel-template-sources'."
>>     (cl-loop
>>      for m in modes thereis
>>      (or (eq m #'fundamental-mode)
>> -        (derived-mode-p m)))
>> +        (derived-mode-p m)
>> +        (when-let ((remap (alist-get m (bound-and-true-p 
>> major-mode-remap-alist))))
>> +          (derived-mode-p remap))))
>
> We do the same in YASnippet, but note that it's a hack: it will work for
> those alternative modes activated via `major-mode-remap-alist` but not
> for those activated some other way (e.g. `M-x`, `auto-mode-alist`).
> :-(

Yes, I got reminded about the remap feature by your recent Yas commit. I
hadn't added this so far since I had hoped for a better solution.

Daniel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]