From 952395d3eb813e1c21b8bace10e54aa67bee9122 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Wed, 11 Nov 2015 22:30:22 +0000 Subject: [PATCH] * lisp/obarray.el: Fix shadowed variables MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit (obarray-map, obarray-remove, obarray-put, obarray-get): Change OBARRAY arg to OB to avoid shadowing ‘obarray’. --- lisp/obarray.el | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/lisp/obarray.el b/lisp/obarray.el index bf8bb3ee2ca..a93c9a94c33 100644 --- a/lisp/obarray.el +++ b/lisp/obarray.el @@ -42,24 +42,25 @@ (and (vectorp object) (< 0 (length object)))) -(defun obarray-get (obarray name) - "Return symbol named NAME if it is contained in OBARRAY. +;; Don’t use obarray as a variable name to avoid shadowing. +(defun obarray-get (ob name) + "Return symbol named NAME if it is contained in obarray OB. Return nil otherwise." - (intern-soft name obarray)) + (intern-soft name ob)) -(defun obarray-put (obarray name) - "Return symbol named NAME from OBARRAY. +(defun obarray-put (ob name) + "Return symbol named NAME from obarray OB. Creates and adds the symbol if doesn't exist." - (intern name obarray)) + (intern name ob)) -(defun obarray-remove (obarray name) - "Remove symbol named NAME if it is contained in OBARRAY. +(defun obarray-remove (ob name) + "Remove symbol named NAME if it is contained in obarray OB. Return t on success, nil otherwise." - (unintern name obarray)) + (unintern name ob)) -(defun obarray-map (fn obarray) - "Call function FN on every symbol in OBARRAY and return nil." - (mapatoms fn obarray)) +(defun obarray-map (fn ob) + "Call function FN on every symbol in obarray OB and return nil." + (mapatoms fn ob)) (provide 'obarray) ;;; obarray.el ends here -- 2.39.2