[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/git-commit f5189a6a3e 19/20: magit-section: Ensure interna
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/git-commit f5189a6a3e 19/20: magit-section: Ensure internal slots are only set carefully |
Date: |
Sun, 28 Apr 2024 16:03:27 -0400 (EDT) |
branch: elpa/git-commit
commit f5189a6a3e92e010bbe21072c942a18b287a44ea
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
magit-section: Ensure internal slots are only set carefully
Certain slots should only be set using dedicated code.
This makes it impossible to set them by passing these
initargs to `magit-insert-section'.
---
lisp/magit-section.el | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/lisp/magit-section.el b/lisp/magit-section.el
index 1bd8a6199e..644c2b94a7 100644
--- a/lisp/magit-section.el
+++ b/lisp/magit-section.el
@@ -380,15 +380,15 @@ no effect. This also has no effect for Emacs >= 28, where
(defclass magit-section ()
((type :initform nil :initarg :type)
(keymap :initform nil)
- (value :initform nil :initarg :value)
- (start :initform nil :initarg :start)
+ (value :initform nil)
+ (start :initform nil)
(content :initform nil)
(end :initform nil)
(hidden :initform nil)
(washer :initform nil :initarg :washer)
(inserter :initform (symbol-value 'magit--current-section-hook))
(heading-highlight-face :initform nil :initarg :heading-highlight-face)
- (parent :initform nil :initarg :parent)
+ (parent :initform nil)
(children :initform nil)))
;;; Mode
@@ -1406,15 +1406,10 @@ anything this time around.
(setq type class)
(setq class (or (cdr (assq class magit--section-type-alist))
'magit-section)))
- (let ((obj (apply
- class
- :type type
- :value value
- :start (if magit-section-inhibit-markers
- (point)
- (point-marker))
- :parent magit-insert-section--parent
- args)))
+ (let ((obj (apply class :type type args)))
+ (oset obj value value)
+ (oset obj parent magit-insert-section--parent)
+ (oset obj start (if magit-section-inhibit-markers (point)
(point-marker)))
(oset obj hidden
(if-let ((value (run-hook-with-args-until-success
'magit-section-set-visibility-hook obj)))
- [nongnu] elpa/git-commit 8753fd9800 08/20: magit-insert-section--finish: New function, (continued)
- [nongnu] elpa/git-commit 8753fd9800 08/20: magit-insert-section--finish: New function, ELPA Syncer, 2024/04/28
- [nongnu] elpa/git-commit 4195508e2e 11/20: Set keymap slot of section classes, ELPA Syncer, 2024/04/28
- [nongnu] elpa/git-commit ff5cc5a69a 10/20: magit-log-section: Set keymap slot, ELPA Syncer, 2024/04/28
- [nongnu] elpa/git-commit 8cb278c2fc 04/20: magit-insert-section--create: Minor optimization, ELPA Syncer, 2024/04/28
- [nongnu] elpa/git-commit 4dd00058a1 16/20: Use module type instead of corresponding magit-module-section class, ELPA Syncer, 2024/04/28
- [nongnu] elpa/git-commit 73eb393aec 06/20: magit-insert-section: Cosmetics, ELPA Syncer, 2024/04/28
- [nongnu] elpa/git-commit 058ca81497 20/20: Bump magit-section dependency, ELPA Syncer, 2024/04/28
- [nongnu] elpa/git-commit 834b9632c3 13/20: magit-diff-wash-hunk: No longer set end slot explicitly, ELPA Syncer, 2024/04/28
- [nongnu] elpa/git-commit f5e32d64c1 15/20: magit-insert-section: Change indent spec, ELPA Syncer, 2024/04/28
- [nongnu] elpa/git-commit be2750e190 09/20: magit-insert-section: Cosmetics, ELPA Syncer, 2024/04/28
- [nongnu] elpa/git-commit f5189a6a3e 19/20: magit-section: Ensure internal slots are only set carefully,
ELPA Syncer <=
- [nongnu] elpa/git-commit 9531833452 07/20: magit-insert-section: Cosmetics, ELPA Syncer, 2024/04/28
- [nongnu] elpa/git-commit 4f2b55ecf5 17/20: magit-process-section: New class, ELPA Syncer, 2024/04/28
- [nongnu] elpa/git-commit f9078948fc 02/20: magit-insert-section: Cosmetics, ELPA Syncer, 2024/04/28
- [nongnu] elpa/git-commit b3d319786d 14/20: magit-insert-section: Pass along keyword arguments to constructor, ELPA Syncer, 2024/04/28