From: Stefan Kangas Date: Mon, 7 Dec 2020 15:45:46 +0000 (+0100) Subject: Prefer setq-local in calendar/*.el X-Git-Tag: emacs-28.0.90~4875 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=60cf0aa21ce618a7d2620a01977232dbe5c9c924;p=emacs.git Prefer setq-local in calendar/*.el * lisp/calendar/calendar.el (calendar-mode): * lisp/calendar/diary-lib.el (diary-list-entries, diary-mode): (diary-fancy-display-mode): Prefer setq-local. --- diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index de9b1f3ff53..d262b607796 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el @@ -1788,7 +1788,7 @@ For a complete description, see the info node `Calendar/Diary'. (setq buffer-read-only t buffer-undo-list t indent-tabs-mode nil) - (set (make-local-variable 'scroll-margin) 0) ; bug#10379 + (setq-local scroll-margin 0) ; bug#10379 (calendar-update-mode-line) (make-local-variable 'calendar-mark-ring) (make-local-variable 'displayed-month) ; month in middle of window diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index fbc13f59b2a..bf1e8ebf9d6 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el @@ -839,7 +839,7 @@ LIST-ONLY is non-nil, in which case it just returns the list." (goto-char (point-min)) (unless list-only (let ((ol (make-overlay (point-min) (point-max) nil t nil))) - (set (make-local-variable 'diary-selective-display) t) + (setq-local diary-selective-display t) (overlay-put ol 'invisible 'diary) (overlay-put ol 'evaporate t))) (dotimes (_ number) @@ -2381,10 +2381,9 @@ return a font-lock pattern matching array of MONTHS and marking SYMBOL." ;;;###autoload (define-derived-mode diary-mode fundamental-mode "Diary" "Major mode for editing the diary file." - (set (make-local-variable 'font-lock-defaults) - '(diary-font-lock-keywords t)) - (set (make-local-variable 'comment-start) diary-comment-start) - (set (make-local-variable 'comment-end) diary-comment-end) + (setq-local font-lock-defaults '(diary-font-lock-keywords t)) + (setq-local comment-start diary-comment-start) + (setq-local comment-end diary-comment-end) (add-to-invisibility-spec '(diary . nil)) (add-hook 'after-save-hook #'diary-redraw-calendar nil t) ;; In case the file was modified externally, refresh the calendar @@ -2465,13 +2464,13 @@ Fontify the region between BEG and END, quietly unless VERBOSE is non-nil." (define-derived-mode diary-fancy-display-mode special-mode "Diary" "Major mode used while displaying diary entries using Fancy Display." - (set (make-local-variable 'font-lock-defaults) - '(diary-fancy-font-lock-keywords - t nil nil nil - (font-lock-fontify-region-function - . diary-fancy-font-lock-fontify-region-function))) - (set (make-local-variable 'minor-mode-overriding-map-alist) - (list (cons t diary-fancy-overriding-map))) + (setq-local font-lock-defaults + '(diary-fancy-font-lock-keywords + t nil nil nil + (font-lock-fontify-region-function + . diary-fancy-font-lock-fontify-region-function))) + (setq-local minor-mode-overriding-map-alist + (list (cons t diary-fancy-overriding-map))) (view-mode 1)) ;; Following code from Dave Love .