diff options
| author | Artur Malabarba | 2015-11-11 22:30:22 +0000 |
|---|---|---|
| committer | Artur Malabarba | 2015-11-11 22:30:22 +0000 |
| commit | 952395d3eb813e1c21b8bace10e54aa67bee9122 (patch) | |
| tree | 91ce9ffe74d5913807e98ecf8fd2fc801212081e /lisp/obarray.el | |
| parent | 436d3307211db86d5606e6cec51d6fbe9f7572a8 (diff) | |
| download | emacs-952395d3eb813e1c21b8bace10e54aa67bee9122.tar.gz emacs-952395d3eb813e1c21b8bace10e54aa67bee9122.zip | |
* lisp/obarray.el: Fix shadowed variables
(obarray-map, obarray-remove, obarray-put, obarray-get):
Change OBARRAY arg to OB to avoid shadowing ‘obarray’.
Diffstat (limited to 'lisp/obarray.el')
| -rw-r--r-- | lisp/obarray.el | 25 |
1 files 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 @@ | |||
| 42 | (and (vectorp object) | 42 | (and (vectorp object) |
| 43 | (< 0 (length object)))) | 43 | (< 0 (length object)))) |
| 44 | 44 | ||
| 45 | (defun obarray-get (obarray name) | 45 | ;; Don’t use obarray as a variable name to avoid shadowing. |
| 46 | "Return symbol named NAME if it is contained in OBARRAY. | 46 | (defun obarray-get (ob name) |
| 47 | "Return symbol named NAME if it is contained in obarray OB. | ||
| 47 | Return nil otherwise." | 48 | Return nil otherwise." |
| 48 | (intern-soft name obarray)) | 49 | (intern-soft name ob)) |
| 49 | 50 | ||
| 50 | (defun obarray-put (obarray name) | 51 | (defun obarray-put (ob name) |
| 51 | "Return symbol named NAME from OBARRAY. | 52 | "Return symbol named NAME from obarray OB. |
| 52 | Creates and adds the symbol if doesn't exist." | 53 | Creates and adds the symbol if doesn't exist." |
| 53 | (intern name obarray)) | 54 | (intern name ob)) |
| 54 | 55 | ||
| 55 | (defun obarray-remove (obarray name) | 56 | (defun obarray-remove (ob name) |
| 56 | "Remove symbol named NAME if it is contained in OBARRAY. | 57 | "Remove symbol named NAME if it is contained in obarray OB. |
| 57 | Return t on success, nil otherwise." | 58 | Return t on success, nil otherwise." |
| 58 | (unintern name obarray)) | 59 | (unintern name ob)) |
| 59 | 60 | ||
| 60 | (defun obarray-map (fn obarray) | 61 | (defun obarray-map (fn ob) |
| 61 | "Call function FN on every symbol in OBARRAY and return nil." | 62 | "Call function FN on every symbol in obarray OB and return nil." |
| 62 | (mapatoms fn obarray)) | 63 | (mapatoms fn ob)) |
| 63 | 64 | ||
| 64 | (provide 'obarray) | 65 | (provide 'obarray) |
| 65 | ;;; obarray.el ends here | 66 | ;;; obarray.el ends here |