[Mlir-commits] [llvm] [mlir] [NFC][emacs] Fix emacs lints in the LLVM and MLIR modes (PR #182074)
Krzysztof Drewniak
llvmlistbot at llvm.org
Thu Feb 19 08:48:00 PST 2026
https://github.com/krzysz00 updated https://github.com/llvm/llvm-project/pull/182074
>From 716a188701345ba2cbb526ab55962eedfd8e15e4 Mon Sep 17 00:00:00 2001
From: Krzysztof Drewniak <Krzysztof.Drewniak at amd.com>
Date: Wed, 18 Feb 2026 17:37:36 +0000
Subject: [PATCH 1/2] [NFC][emacs] Fix emacs lists in the LLVM and MLIR modes
This mainly involved explicitly declaring minimum emacs versions for
setq-local and adding a lexical-binding annotaton.
The commit also removes some workarounds from the MLIR mode for Emacs
23 (!).
---
llvm/utils/emacs/llvm-mir-mode.el | 4 +++-
llvm/utils/emacs/llvm-mode.el | 4 +++-
mlir/utils/emacs/mlir-mode.el | 14 +++++---------
3 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/llvm/utils/emacs/llvm-mir-mode.el b/llvm/utils/emacs/llvm-mir-mode.el
index e53ffe825478b..d098a8c5528d3 100644
--- a/llvm/utils/emacs/llvm-mir-mode.el
+++ b/llvm/utils/emacs/llvm-mir-mode.el
@@ -1,7 +1,9 @@
-;;; llvm-mir-mode.el --- Major mode for LLVM Machine IR
+;;; llvm-mir-mode.el --- Major mode for LLVM Machine IR -*- lexical-binding: t -*-
;; Maintainer: The LLVM team, http://llvm.org/
;; Version: 1.0
+;; Homepage: http://llvm.org/
+;; Package-Requires: ((emacs "24.3"))
;;; Commentary:
diff --git a/llvm/utils/emacs/llvm-mode.el b/llvm/utils/emacs/llvm-mode.el
index 240c13319f634..844e9757021a7 100644
--- a/llvm/utils/emacs/llvm-mode.el
+++ b/llvm/utils/emacs/llvm-mode.el
@@ -1,7 +1,9 @@
-;;; llvm-mode.el --- Major mode for the LLVM assembler language.
+;;; llvm-mode.el --- Major mode for the LLVM assembler language -*- lexical-binding: t -*-
;; Maintainer: The LLVM team, http://llvm.org/
;; Version: 1.0
+;; Homepage: http://llvm.org/y
+;; Package-Requires: ((emacs "24.3"))
;;; Commentary:
diff --git a/mlir/utils/emacs/mlir-mode.el b/mlir/utils/emacs/mlir-mode.el
index e5947df03f86c..46a85bed19cc4 100644
--- a/mlir/utils/emacs/mlir-mode.el
+++ b/mlir/utils/emacs/mlir-mode.el
@@ -1,4 +1,4 @@
-;;; mlir-mode.el --- Major mode for the MLIR assembler language.
+;;; mlir-mode.el --- Major mode for the MLIR assembler language -*- lexical-binding: t -*-
;; Copyright (C) 2019 The MLIR Authors.
;;
@@ -14,7 +14,9 @@
;; See the License for the specific language governing permissions and
;; limitations under the License.
-;; Version: 0.1.0
+;; Version: 0.2.0
+;; Homepage: https://mlir.llvm.org/
+;; Package-Requires: ((emacs "24.3"))
;;; Commentary:
@@ -58,14 +60,8 @@
"br" "ceildiv" "func" "cond_br" "else" "extfunc" "false" "floordiv" "for" "if" "mod" "return" "size" "step" "to" "true" "??" ) 'symbols) . font-lock-keyword-face))
"Syntax highlighting for MLIR.")
-;; Emacs 23 compatibility.
-(defalias 'mlir-mode-prog-mode
- (if (fboundp 'prog-mode)
- 'prog-mode
- 'fundamental-mode))
-
;;;###autoload
-(define-derived-mode mlir-mode mlir-mode-prog-mode "MLIR"
+(define-derived-mode mlir-mode prog-mode "MLIR"
"Major mode for editing MLIR source files.
\\{mlir-mode-map}
Runs `mlir-mode-hook' on startup."
>From 1f08252cb8d2377b7673206545eef04e4f606f1a Mon Sep 17 00:00:00 2001
From: Krzysztof Drewniak <Krzysztof.Drewniak at amd.com>
Date: Thu, 19 Feb 2026 08:47:51 -0800
Subject: [PATCH 2/2] Fix typo
---
llvm/utils/emacs/llvm-mode.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/utils/emacs/llvm-mode.el b/llvm/utils/emacs/llvm-mode.el
index 844e9757021a7..ffbeb52eaf8da 100644
--- a/llvm/utils/emacs/llvm-mode.el
+++ b/llvm/utils/emacs/llvm-mode.el
@@ -2,7 +2,7 @@
;; Maintainer: The LLVM team, http://llvm.org/
;; Version: 1.0
-;; Homepage: http://llvm.org/y
+;; Homepage: http://llvm.org/
;; Package-Requires: ((emacs "24.3"))
;;; Commentary:
More information about the Mlir-commits
mailing list