[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] scratch/editorconfig-cc df95ca5e4f 203/351: Do not call mode fu
From: |
Stefan Monnier |
Subject: |
[nongnu] scratch/editorconfig-cc df95ca5e4f 203/351: Do not call mode func when current mode is a child mode of target (#179) |
Date: |
Thu, 13 Jun 2024 18:38:53 -0400 (EDT) |
branch: scratch/editorconfig-cc
commit df95ca5e4fa606aa00ec083b9f9807b45968de2d
Author: 10sr <8.slashes@gmail.com>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
Do not call mode func when current mode is a child mode of target (#179)
---
editorconfig.el | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/editorconfig.el b/editorconfig.el
index ec0a78efac..b8bc2c09bb 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -323,11 +323,9 @@ FILETYPE should be s string like `\"ini\"`, if not nil or
empty string."
""))
(intern (concat filetype
"-mode")))))
- (when (and mode
- (not (editorconfig--is-a-mode-p major-mode
- mode)))
+ (when mode
(if (fboundp mode)
- (funcall mode)
+ (editorconig-apply-major-mode-safely mode)
(display-warning :error (format "Major-mode `%S' not found"
mode))
nil))))
@@ -349,10 +347,13 @@ This funcion will avoid such cases and set `major-mode'
safely.
Just checking current `major-mode' value is not enough, because it can be
different from MODE value (for example, `conf-mode' will set `major-mode' to
`conf-unix-mode' or another conf mode)."
+ (cl-assert mode)
(when (and (not (eq mode
editorconfig--apply-major-mode-currently))
(not (eq mode
- major-mode)))
+ major-mode))
+ (not (editorconfig--is-a-mode-p major-mode
+ mode)))
(unwind-protect
(progn
(setq editorconfig--apply-major-mode-currently
- [nongnu] scratch/editorconfig-cc faba39ce8a 191/351: Use HTTPS link (#174), (continued)
- [nongnu] scratch/editorconfig-cc faba39ce8a 191/351: Use HTTPS link (#174), Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc a9dfdc4677 186/351: Fix brackets tests (#172), Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 0ebb188649 182/351: Disable delete-trailing-whitespace when buffer-read-only is nil, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc c71e282e4c 184/351: Remove numeric-range related vairables, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc c7975d6954 192/351: Update texi for HTTPS url, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc ad79062996 179/351: Use emacs 26.1 instead of 26-pretest (#166), Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 6f769c93b1 183/351: Stop checking numeric range separately, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc e0bf950716 194/351: Add ert-test for file_type_emacs (#177), Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 6ff678a856 200/351: Make conf-mode used when a file has .editorconfig extension, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 82af619ed5 206/351: Use derived-mode-p for major-mode check (#180), Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc df95ca5e4f 203/351: Do not call mode func when current mode is a child mode of target (#179),
Stefan Monnier <=
- [nongnu] scratch/editorconfig-cc 0072bcc14f 207/351: Update texi for hook name change, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc a365955dca 202/351: Use file_type_ext for test fixtures, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 60b39fadfb 209/351: Add variable -hack-properties-functions, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc f1b83aacd2 214/351: Fix hack-properties-functions example, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 10467ed9df 221/351: Use Markdown's code spans instead of Emacs style `' (#186), Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 658bfb9bd8 213/351: Fix README and texi, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc e24803269d 212/351: Update document, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 6929cad23b 223/351: Update get-properties-hash, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc cdbd60a8a6 234/351: M-x checkdoc, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 0bbf63616a 231/351: Stop using cl-defclass, Stefan Monnier, 2024/06/13