aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuanma Barranquero2013-06-22 04:33:33 +0200
committerJuanma Barranquero2013-06-22 04:33:33 +0200
commit388573ee7c3ef55d9d79039ea7ddeb5f7abb32f6 (patch)
tree75c0a86cc951dfb35406a040d626142b00b32c95
parent2663dd23eb43e9ebe20006f46feb6f410f13ac53 (diff)
downloademacs-388573ee7c3ef55d9d79039ea7ddeb5f7abb32f6.tar.gz
emacs-388573ee7c3ef55d9d79039ea7ddeb5f7abb32f6.zip
lisp/bs.el, emacs-lock.el: Use defvar-local, setq-local.
* lisp/bs.el (bs-buffer-show-mark): Make defvar-local. (bs-mode): Use setq-local. * lisp/emacs-lock.el (emacs-lock-mode, emacs-lock--old-mode) (emacs-lock--try-unlocking): Make defvar-local.
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/bs.el17
-rw-r--r--lisp/emacs-lock.el12
3 files changed, 19 insertions, 18 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 26cf6272289..ec5e91005ec 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
12013-06-22 Juanma Barranquero <lekktu@gmail.com>
2
3 * bs.el (bs-buffer-show-mark): Make defvar-local.
4 (bs-mode): Use setq-local.
5
6 * emacs-lock.el (emacs-lock-mode, emacs-lock--old-mode)
7 (emacs-lock--try-unlocking): Make defvar-local.
8
12013-06-22 Glenn Morris <rgm@fencepost.gnu.org> 92013-06-22 Glenn Morris <rgm@fencepost.gnu.org>
2 10
3 * play/cookie1.el (cookie-apropos): Minor simplification. 11 * play/cookie1.el (cookie-apropos): Minor simplification.
diff --git a/lisp/bs.el b/lisp/bs.el
index 9c6c4efd2bc..af213333a79 100644
--- a/lisp/bs.el
+++ b/lisp/bs.el
@@ -336,15 +336,13 @@ Used internally, only.")
336;; Internal globals 336;; Internal globals
337;; ---------------------------------------------------------------------- 337;; ----------------------------------------------------------------------
338 338
339(defvar bs-buffer-show-mark nil 339(defvar-local bs-buffer-show-mark nil
340 "Flag for the current mode for showing this buffer. 340 "Flag for the current mode for showing this buffer.
341A value of nil means buffer will be shown depending on the current 341A value of nil means buffer will be shown depending on the current
342configuration. 342configuration.
343A value of `never' means to never show the buffer. 343A value of `never' means to never show the buffer.
344A value of `always' means to show buffer regardless of the configuration.") 344A value of `always' means to show buffer regardless of the configuration.")
345 345
346(make-variable-buffer-local 'bs-buffer-show-mark)
347
348;; Make face named region (for XEmacs) 346;; Make face named region (for XEmacs)
349(unless (facep 'region) 347(unless (facep 'region)
350 (make-face 'region) 348 (make-face 'region)
@@ -648,17 +646,14 @@ available Buffer Selection Menu configuration.
648to show always. 646to show always.
649\\[bs-visit-tags-table] -- call `visit-tags-table' on current line's buffer. 647\\[bs-visit-tags-table] -- call `visit-tags-table' on current line's buffer.
650\\[bs-help] -- display this help text." 648\\[bs-help] -- display this help text."
651 (make-local-variable 'font-lock-defaults)
652 (make-local-variable 'font-lock-verbose)
653 (make-local-variable 'font-lock-global-modes)
654 (buffer-disable-undo) 649 (buffer-disable-undo)
655 (setq buffer-read-only t 650 (setq buffer-read-only t
656 truncate-lines t 651 truncate-lines t
657 show-trailing-whitespace nil 652 show-trailing-whitespace nil)
658 font-lock-global-modes '(not bs-mode) 653 (setq-local font-lock-defaults '(bs-mode-font-lock-keywords t))
659 font-lock-defaults '(bs-mode-font-lock-keywords t) 654 (setq-local font-lock-verbose nil)
660 font-lock-verbose nil) 655 (setq-local font-lock-global-modes '(not bs-mode))
661 (set (make-local-variable 'revert-buffer-function) 'bs-refresh) 656 (setq-local revert-buffer-function 'bs-refresh)
662 (add-hook 'window-size-change-functions 'bs--track-window-changes) 657 (add-hook 'window-size-change-functions 'bs--track-window-changes)
663 (add-hook 'kill-buffer-hook 'bs--remove-hooks nil t) 658 (add-hook 'kill-buffer-hook 'bs--remove-hooks nil t)
664 (add-hook 'change-major-mode-hook 'bs--remove-hooks nil t)) 659 (add-hook 'change-major-mode-hook 'bs--remove-hooks nil t))
diff --git a/lisp/emacs-lock.el b/lisp/emacs-lock.el
index 0b116ac9284..ac12c149b01 100644
--- a/lisp/emacs-lock.el
+++ b/lisp/emacs-lock.el
@@ -27,7 +27,7 @@
27;; This package defines a minor mode Emacs Lock to mark a buffer as 27;; This package defines a minor mode Emacs Lock to mark a buffer as
28;; protected against accidental killing, or exiting Emacs, or both. 28;; protected against accidental killing, or exiting Emacs, or both.
29;; Buffers associated with inferior modes, like shell or telnet, can 29;; Buffers associated with inferior modes, like shell or telnet, can
30;; be treated specially, by auto-unlocking them if their interior 30;; be treated specially, by auto-unlocking them if their inferior
31;; processes are dead. 31;; processes are dead.
32 32
33;;; Code: 33;;; Code:
@@ -88,26 +88,23 @@ The functions get one argument, the first locked buffer found."
88 :group 'emacs-lock 88 :group 'emacs-lock
89 :version "24.3") 89 :version "24.3")
90 90
91(defvar emacs-lock-mode nil 91(defvar-local emacs-lock-mode nil
92 "If non-nil, the current buffer is locked. 92 "If non-nil, the current buffer is locked.
93It can be one of the following values: 93It can be one of the following values:
94 exit -- Emacs cannot exit while the buffer is locked 94 exit -- Emacs cannot exit while the buffer is locked
95 kill -- the buffer cannot be killed, but Emacs can exit as usual 95 kill -- the buffer cannot be killed, but Emacs can exit as usual
96 all -- the buffer is locked against both actions 96 all -- the buffer is locked against both actions
97 nil -- the buffer is not locked") 97 nil -- the buffer is not locked")
98(make-variable-buffer-local 'emacs-lock-mode)
99(put 'emacs-lock-mode 'permanent-local t) 98(put 'emacs-lock-mode 'permanent-local t)
100 99
101(defvar emacs-lock--old-mode nil 100(defvar-local emacs-lock--old-mode nil
102 "Most recent locking mode set on the buffer. 101 "Most recent locking mode set on the buffer.
103Internal use only.") 102Internal use only.")
104(make-variable-buffer-local 'emacs-lock--old-mode)
105(put 'emacs-lock--old-mode 'permanent-local t) 103(put 'emacs-lock--old-mode 'permanent-local t)
106 104
107(defvar emacs-lock--try-unlocking nil 105(defvar-local emacs-lock--try-unlocking nil
108 "Non-nil if current buffer should be checked for auto-unlocking. 106 "Non-nil if current buffer should be checked for auto-unlocking.
109Internal use only.") 107Internal use only.")
110(make-variable-buffer-local 'emacs-lock--try-unlocking)
111(put 'emacs-lock--try-unlocking 'permanent-local t) 108(put 'emacs-lock--try-unlocking 'permanent-local t)
112 109
113(defun emacs-lock-live-process-p (buffer-or-name) 110(defun emacs-lock-live-process-p (buffer-or-name)
@@ -188,6 +185,7 @@ Return a value appropriate for `kill-buffer-query-functions' (which see)."
188 185
189(define-obsolete-variable-alias 'emacs-lock-from-exiting 186(define-obsolete-variable-alias 'emacs-lock-from-exiting
190 'emacs-lock-mode "24.1") 187 'emacs-lock-mode "24.1")
188
191;;;###autoload 189;;;###autoload
192(define-minor-mode emacs-lock-mode 190(define-minor-mode emacs-lock-mode
193 "Toggle Emacs Lock mode in the current buffer. 191 "Toggle Emacs Lock mode in the current buffer.