aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas2020-12-09 08:30:09 +0100
committerStefan Kangas2020-12-09 08:30:09 +0100
commitdbc044e5f772cdb55433cb7757975defeadba44e (patch)
treeda09b5d6bad31043e54362cb2ce3acea4909c4ce
parent7ebd7ba174800f26170c2e01209f849b90073fd8 (diff)
downloademacs-dbc044e5f772cdb55433cb7757975defeadba44e.tar.gz
emacs-dbc044e5f772cdb55433cb7757975defeadba44e.zip
Prefer setq-local in gdb-mi.el
* lisp/progmodes/gdb-mi.el (gdb--check-interpreter, gdb) (gdb-init-buffer, gdb-get-buffer-create, gdb-threads-mode) (gdb-memory-mode, gdb-disassembly-mode, gdb-frames-mode): Prefer setq-local.
-rw-r--r--lisp/progmodes/gdb-mi.el39
1 files changed, 17 insertions, 22 deletions
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index 903005610d7..4c248f771cd 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -744,7 +744,7 @@ NOARG must be t when this macro is used outside `gud-def'."
744 ;; Use the old gud-gbd filter, not because it works, but because it 744 ;; Use the old gud-gbd filter, not because it works, but because it
745 ;; will properly display GDB's answers rather than hanging waiting for 745 ;; will properly display GDB's answers rather than hanging waiting for
746 ;; answers that aren't coming. 746 ;; answers that aren't coming.
747 (set (make-local-variable 'gud-marker-filter) #'gud-gdb-marker-filter)) 747 (setq-local gud-marker-filter #'gud-gdb-marker-filter))
748 (funcall filter proc string))) 748 (funcall filter proc string)))
749 749
750(defvar gdb-control-level 0) 750(defvar gdb-control-level 0)
@@ -831,8 +831,8 @@ detailed description of this mode.
831 (let ((proc (get-buffer-process gud-comint-buffer))) 831 (let ((proc (get-buffer-process gud-comint-buffer)))
832 (add-function :around (process-filter proc) #'gdb--check-interpreter)) 832 (add-function :around (process-filter proc) #'gdb--check-interpreter))
833 833
834 (set (make-local-variable 'gud-minor-mode) 'gdbmi) 834 (setq-local gud-minor-mode 'gdbmi)
835 (set (make-local-variable 'gdb-control-level) 0) 835 (setq-local gdb-control-level 0)
836 (setq comint-input-sender 'gdb-send) 836 (setq comint-input-sender 'gdb-send)
837 (when (ring-empty-p comint-input-ring) ; cf shell-mode 837 (when (ring-empty-p comint-input-ring) ; cf shell-mode
838 (let ((hfile (expand-file-name (or (getenv "GDBHISTFILE") 838 (let ((hfile (expand-file-name (or (getenv "GDBHISTFILE")
@@ -861,9 +861,9 @@ detailed description of this mode.
861 (and (stringp hsize) 861 (and (stringp hsize)
862 (integerp (setq hsize (string-to-number hsize))) 862 (integerp (setq hsize (string-to-number hsize)))
863 (> hsize 0) 863 (> hsize 0)
864 (set (make-local-variable 'comint-input-ring-size) hsize)) 864 (setq-local comint-input-ring-size hsize))
865 (if (stringp hfile) 865 (if (stringp hfile)
866 (set (make-local-variable 'comint-input-ring-file-name) hfile)) 866 (setq-local comint-input-ring-file-name hfile))
867 (comint-read-input-ring t))) 867 (comint-read-input-ring t)))
868 (gud-def gud-tbreak "tbreak %f:%l" "\C-t" 868 (gud-def gud-tbreak "tbreak %f:%l" "\C-t"
869 "Set temporary breakpoint at current line.") 869 "Set temporary breakpoint at current line.")
@@ -966,8 +966,7 @@ detailed description of this mode.
966 (define-key gud-minor-mode-map [left-margin C-mouse-3] 966 (define-key gud-minor-mode-map [left-margin C-mouse-3]
967 'gdb-mouse-jump) 967 'gdb-mouse-jump)
968 968
969 (set (make-local-variable 'gud-gdb-completion-function) 969 (setq-local gud-gdb-completion-function 'gud-gdbmi-completions)
970 'gud-gdbmi-completions)
971 970
972 (add-hook 'completion-at-point-functions #'gud-gdb-completion-at-point 971 (add-hook 'completion-at-point-functions #'gud-gdb-completion-at-point
973 nil 'local) 972 nil 'local)
@@ -1141,8 +1140,8 @@ no input, and GDB is waiting for input."
1141 (lambda () (gdb-tooltip-print expr))))))) 1140 (lambda () (gdb-tooltip-print expr)))))))
1142 1141
1143(defun gdb-init-buffer () 1142(defun gdb-init-buffer ()
1144 (set (make-local-variable 'gud-minor-mode) 'gdbmi) 1143 (setq-local gud-minor-mode 'gdbmi)
1145 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map) 1144 (setq-local tool-bar-map gud-tool-bar-map)
1146 (when gud-tooltip-mode 1145 (when gud-tooltip-mode
1147 (make-local-variable 'gdb-define-alist) 1146 (make-local-variable 'gdb-define-alist)
1148 (gdb-create-define-alist) 1147 (gdb-create-define-alist)
@@ -1558,10 +1557,10 @@ this trigger is subscribed to `gdb-buf-publisher' and called with
1558 (when mode (funcall mode)) 1557 (when mode (funcall mode))
1559 (setq gdb-buffer-type buffer-type) 1558 (setq gdb-buffer-type buffer-type)
1560 (when thread 1559 (when thread
1561 (set (make-local-variable 'gdb-thread-number) thread)) 1560 (setq-local gdb-thread-number thread))
1562 (set (make-local-variable 'gud-minor-mode) 1561 (setq-local gud-minor-mode
1563 (buffer-local-value 'gud-minor-mode gud-comint-buffer)) 1562 (buffer-local-value 'gud-minor-mode gud-comint-buffer))
1564 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map) 1563 (setq-local tool-bar-map gud-tool-bar-map)
1565 (rename-buffer (funcall (gdb-rules-name-maker rules))) 1564 (rename-buffer (funcall (gdb-rules-name-maker rules)))
1566 (when trigger 1565 (when trigger
1567 (gdb-add-subscriber gdb-buf-publisher 1566 (gdb-add-subscriber gdb-buf-publisher
@@ -3364,8 +3363,7 @@ corresponding to the mode line clicked."
3364 (setq gdb-thread-position (make-marker)) 3363 (setq gdb-thread-position (make-marker))
3365 (add-to-list 'overlay-arrow-variable-list 'gdb-thread-position) 3364 (add-to-list 'overlay-arrow-variable-list 'gdb-thread-position)
3366 (setq header-line-format gdb-threads-header) 3365 (setq header-line-format gdb-threads-header)
3367 (set (make-local-variable 'font-lock-defaults) 3366 (setq-local font-lock-defaults '(gdb-threads-font-lock-keywords))
3368 '(gdb-threads-font-lock-keywords))
3369 'gdb-invalidate-threads) 3367 'gdb-invalidate-threads)
3370 3368
3371(defun gdb-thread-list-handler-custom () 3369(defun gdb-thread-list-handler-custom ()
@@ -3920,8 +3918,7 @@ DOC is an optional documentation string."
3920(define-derived-mode gdb-memory-mode gdb-parent-mode "Memory" 3918(define-derived-mode gdb-memory-mode gdb-parent-mode "Memory"
3921 "Major mode for examining memory." 3919 "Major mode for examining memory."
3922 (setq header-line-format gdb-memory-header) 3920 (setq header-line-format gdb-memory-header)
3923 (set (make-local-variable 'font-lock-defaults) 3921 (setq-local font-lock-defaults '(gdb-memory-font-lock-keywords))
3924 '(gdb-memory-font-lock-keywords))
3925 'gdb-invalidate-memory) 3922 'gdb-invalidate-memory)
3926 3923
3927(defun gdb-memory-buffer-name () 3924(defun gdb-memory-buffer-name ()
@@ -4013,9 +4010,8 @@ DOC is an optional documentation string."
4013 ;; TODO Rename overlay variable for disassembly mode 4010 ;; TODO Rename overlay variable for disassembly mode
4014 (add-to-list 'overlay-arrow-variable-list 'gdb-disassembly-position) 4011 (add-to-list 'overlay-arrow-variable-list 'gdb-disassembly-position)
4015 (setq fringes-outside-margins t) 4012 (setq fringes-outside-margins t)
4016 (set (make-local-variable 'gdb-disassembly-position) (make-marker)) 4013 (setq-local gdb-disassembly-position (make-marker))
4017 (set (make-local-variable 'font-lock-defaults) 4014 (setq-local font-lock-defaults '(gdb-disassembly-font-lock-keywords))
4018 '(gdb-disassembly-font-lock-keywords))
4019 'gdb-invalidate-disassembly) 4015 'gdb-invalidate-disassembly)
4020 4016
4021(defun gdb-disassembly-handler-custom () 4017(defun gdb-disassembly-handler-custom ()
@@ -4222,8 +4218,7 @@ member."
4222 (setq gdb-stack-position (make-marker)) 4218 (setq gdb-stack-position (make-marker))
4223 (add-to-list 'overlay-arrow-variable-list 'gdb-stack-position) 4219 (add-to-list 'overlay-arrow-variable-list 'gdb-stack-position)
4224 (setq truncate-lines t) ;; Make it easier to see overlay arrow. 4220 (setq truncate-lines t) ;; Make it easier to see overlay arrow.
4225 (set (make-local-variable 'font-lock-defaults) 4221 (setq-local font-lock-defaults '(gdb-frames-font-lock-keywords))
4226 '(gdb-frames-font-lock-keywords))
4227 'gdb-invalidate-frames) 4222 'gdb-invalidate-frames)
4228 4223
4229(defun gdb-select-frame (&optional event) 4224(defun gdb-select-frame (&optional event)