From 9017f3be6b00c1d82e33409db4a178133fb39d47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20A=2E=20Aranda=20Guti=C3=A9rrez?= Date: Mon, 6 Oct 2025 22:38:27 +0200 Subject: [PATCH] Add lexical binding cookies (#389) * Add lexical binding cookies * multiple-cursors-core.el: Pacify lexical-binding frenzy in master * multiple-cursors-core.el: when saving mc/list-file, prepend a lexical binding flag to avoid emacs master from screaming. When inserting strings, use `\\n' instead of (newline). --- mc-cycle-cursors.el | 2 +- mc-edit-lines.el | 2 +- mc-hide-unmatched-lines-mode.el | 2 +- mc-mark-more.el | 2 +- mc-mark-pop.el | 2 +- mc-separate-operations.el | 2 +- multiple-cursors-core.el | 11 +++++------ multiple-cursors.el | 2 +- rectangular-region-mode.el | 2 +- 9 files changed, 13 insertions(+), 14 deletions(-) diff --git a/mc-cycle-cursors.el b/mc-cycle-cursors.el index 0248b9c..4e2b232 100644 --- a/mc-cycle-cursors.el +++ b/mc-cycle-cursors.el @@ -1,4 +1,4 @@ -;;; mc-cycle-cursors.el +;;; mc-cycle-cursors.el -*- lexical-binding: t; -*- ;; Copyright (C) 2012-2016 Magnar Sveen diff --git a/mc-edit-lines.el b/mc-edit-lines.el index 33e7df2..c837eaf 100644 --- a/mc-edit-lines.el +++ b/mc-edit-lines.el @@ -1,4 +1,4 @@ -;;; mc-edit-lines.el +;;; mc-edit-lines.el -*- lexical-binding: t; -*- ;; Copyright (C) 2012-2016 Magnar Sveen diff --git a/mc-hide-unmatched-lines-mode.el b/mc-hide-unmatched-lines-mode.el index 7565c0b..973a0aa 100644 --- a/mc-hide-unmatched-lines-mode.el +++ b/mc-hide-unmatched-lines-mode.el @@ -1,4 +1,4 @@ -;;; mc-hide-unmatched-lines-mode.el +;;; mc-hide-unmatched-lines-mode.el -*- lexical-binding: t; -*- ;; Copyright (C) 2014 Aleksey Fedotov diff --git a/mc-mark-more.el b/mc-mark-more.el index 51f867e..34dd357 100644 --- a/mc-mark-more.el +++ b/mc-mark-more.el @@ -1,4 +1,4 @@ -;;; mc-mark-more.el +;;; mc-mark-more.el -*- lexical-binding: t; -*- ;; Copyright (C) 2012-2016 Magnar Sveen diff --git a/mc-mark-pop.el b/mc-mark-pop.el index 8a18381..15a9c8b 100644 --- a/mc-mark-pop.el +++ b/mc-mark-pop.el @@ -1,4 +1,4 @@ -;;; mc-mark-pop.el --- Pop cursors off of the mark stack +;;; mc-mark-pop.el --- Pop cursors off of the mark stack -*- lexical-binding: t; -*- (require 'multiple-cursors-core) diff --git a/mc-separate-operations.el b/mc-separate-operations.el index ddc7395..9d9ab17 100644 --- a/mc-separate-operations.el +++ b/mc-separate-operations.el @@ -1,4 +1,4 @@ -;;; mc-separate-operations.el - functions that work differently on each cursor +;;; mc-separate-operations.el - functions that work differently on each cursor -*- lexical-binding: t; -*- ;; Copyright (C) 2012-2016 Magnar Sveen diff --git a/multiple-cursors-core.el b/multiple-cursors-core.el index 2ce92ac..4cc9dd9 100644 --- a/multiple-cursors-core.el +++ b/multiple-cursors-core.el @@ -1,4 +1,4 @@ -;;; multiple-cursors-core.el --- An experiment in multiple cursors for emacs. +;;; multiple-cursors-core.el --- An experiment in multiple cursors for emacs. -*- lexical-binding: t; -*- ;; Copyright (C) 2012-2016 Magnar Sveen @@ -885,11 +885,10 @@ for running commands with multiple cursors." "Saves preferences for running commands with multiple cursors to `mc/list-file'" (with-temp-file mc/list-file (emacs-lisp-mode) - (insert ";; This file is automatically generated by the multiple-cursors extension.") - (newline) - (insert ";; It keeps track of your preferences for running commands with multiple cursors.") - (newline) - (newline) + (when (> emacs-major-version 30) + (insert ";; -*- lexical-binding: t; -*-\n")) + (insert ";; This file is automatically generated by the multiple-cursors extension.\n") + (insert ";; It keeps track of your preferences for running commands with multiple cursors.\n\n") (mc/dump-list 'mc/cmds-to-run-for-all) (newline) (mc/dump-list 'mc/cmds-to-run-once))) diff --git a/multiple-cursors.el b/multiple-cursors.el index 309656b..c99963e 100644 --- a/multiple-cursors.el +++ b/multiple-cursors.el @@ -1,4 +1,4 @@ -;;; multiple-cursors.el --- Multiple cursors for emacs. +;;; multiple-cursors.el --- Multiple cursors for emacs. -*- lexical-binding: t; -*- ;; Copyright (C) 2012-2016 Magnar Sveen diff --git a/rectangular-region-mode.el b/rectangular-region-mode.el index e4683cf..2ce4b30 100644 --- a/rectangular-region-mode.el +++ b/rectangular-region-mode.el @@ -1,4 +1,4 @@ -;;; rectangular-region-mode.el +;;; rectangular-region-mode.el -*- lexical-binding: t; -*- ;; Copyright (C) 2012-2016 Magnar Sveen