aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuanma Barranquero2011-04-04 11:35:16 +0200
committerJuanma Barranquero2011-04-04 11:35:16 +0200
commit2fbc1934ae9a9610ef98578d59d478cb642363f9 (patch)
tree9bb8e2284beddb467fbbaf0d7bbfc213f9c904b6
parent6a56b5bd08535f8c7097868a23d729223e3d1178 (diff)
downloademacs-2fbc1934ae9a9610ef98578d59d478cb642363f9.tar.gz
emacs-2fbc1934ae9a9610ef98578d59d478cb642363f9.zip
Convert some .el files to lexical scoping.
* bs.el (bs-refresh, bs-sort-buffer-interns-are-last) (bs--get-marked-string, bs--get-modified-string) (bs--get-readonly-string, bs--get-size-string, bs--get-name) (bs--get-mode-name, bs--get-file-name): Mark unused arguments. (bs--configuration-name-for-prefix-arg): Rename argument PREFIX-ARG. * ehelp.el (electric-help-execute-extended) (electric-help-ctrl-x-prefix): * hexl.el (hexl-revert-buffer-function): * linum.el (linum-after-change, linum-after-scroll): * emacs-lisp/re-builder.el (reb-auto-update): Mark unused arguments. * help-fns.el (help-describe-category-set): Remove unused ERR variable.
-rw-r--r--lisp/ChangeLog20
-rw-r--r--lisp/bs.el36
-rw-r--r--lisp/ehelp.el6
-rw-r--r--lisp/emacs-lisp/re-builder.el4
-rw-r--r--lisp/help-fns.el4
-rw-r--r--lisp/hexl.el8
-rw-r--r--lisp/linum.el6
7 files changed, 51 insertions, 33 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3bdf91d8733..142e6bc57e0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,21 @@
12011-04-04 Juanma Barranquero <lekktu@gmail.com>
2
3 Convert to lexical-binding.
4
5 * bs.el (bs-refresh, bs-sort-buffer-interns-are-last)
6 (bs--get-marked-string, bs--get-modified-string)
7 (bs--get-readonly-string, bs--get-size-string, bs--get-name)
8 (bs--get-mode-name, bs--get-file-name): Mark unused arguments.
9 (bs--configuration-name-for-prefix-arg): Rename argument PREFIX-ARG.
10
11 * ehelp.el (electric-help-execute-extended)
12 (electric-help-ctrl-x-prefix):
13 * hexl.el (hexl-revert-buffer-function):
14 * linum.el (linum-after-change, linum-after-scroll):
15 * emacs-lisp/re-builder.el (reb-auto-update): Mark unused arguments.
16
17 * help-fns.el (help-describe-category-set): Remove unused ERR variable.
18
12011-04-04 Daiki Ueno <ueno@unixuser.org> 192011-04-04 Daiki Ueno <ueno@unixuser.org>
2 20
3 * epa-dired.el: 21 * epa-dired.el:
@@ -262,7 +280,7 @@
2622011-03-31 Tassilo Horn <tassilo@member.fsf.org> 2802011-03-31 Tassilo Horn <tassilo@member.fsf.org>
263 281
264 * net/rcirc.el (rcirc-handler-001): Only authenticate, if there's 282 * net/rcirc.el (rcirc-handler-001): Only authenticate, if there's
265 an entry for that server in rcirc-authinfo. (Bug#8385) 283 an entry for that server in rcirc-authinfo. (Bug#8385)
266 284
2672011-03-31 Glenn Morris <rgm@gnu.org> 2852011-03-31 Glenn Morris <rgm@gnu.org>
268 286
diff --git a/lisp/bs.el b/lisp/bs.el
index 1f90304f1da..72b3e4c6fef 100644
--- a/lisp/bs.el
+++ b/lisp/bs.el
@@ -1,4 +1,4 @@
1;;; bs.el --- menu for selecting and displaying buffers 1;;; bs.el --- menu for selecting and displaying buffers -*- lexical-binding: t -*-
2 2
3;; Copyright (C) 1998-2011 Free Software Foundation, Inc. 3;; Copyright (C) 1998-2011 Free Software Foundation, Inc.
4;; Author: Olaf Sylvester <Olaf.Sylvester@netsurf.de> 4;; Author: Olaf Sylvester <Olaf.Sylvester@netsurf.de>
@@ -693,7 +693,7 @@ Refresh whole Buffer Selection Menu."
693 (call-interactively 'bs-set-configuration) 693 (call-interactively 'bs-set-configuration)
694 (bs--redisplay t)) 694 (bs--redisplay t))
695 695
696(defun bs-refresh (&rest ignored) 696(defun bs-refresh (&rest _ignored)
697 "Refresh whole Buffer Selection Menu. 697 "Refresh whole Buffer Selection Menu.
698Arguments are IGNORED (for `revert-buffer')." 698Arguments are IGNORED (for `revert-buffer')."
699 (interactive) 699 (interactive)
@@ -1017,7 +1017,7 @@ A value of t means BUFFER belongs to no file.
1017A value of nil means BUFFER belongs to a file." 1017A value of nil means BUFFER belongs to a file."
1018 (not (buffer-file-name buffer))) 1018 (not (buffer-file-name buffer)))
1019 1019
1020(defun bs-sort-buffer-interns-are-last (b1 b2) 1020(defun bs-sort-buffer-interns-are-last (_b1 b2)
1021 "Function for sorting internal buffers at the end of all buffers." 1021 "Function for sorting internal buffers at the end of all buffers."
1022 (string-match-p "^\\*" (buffer-name b2))) 1022 (string-match-p "^\\*" (buffer-name b2)))
1023 1023
@@ -1262,7 +1262,7 @@ or a string."
1262 fun) 1262 fun)
1263 (t (apply fun args)))) 1263 (t (apply fun args))))
1264 1264
1265(defun bs--get-marked-string (start-buffer all-buffers) 1265(defun bs--get-marked-string (start-buffer _all-buffers)
1266 "Return a string which describes whether current buffer is marked. 1266 "Return a string which describes whether current buffer is marked.
1267START-BUFFER is the buffer where we started buffer selection. 1267START-BUFFER is the buffer where we started buffer selection.
1268ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu. 1268ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu.
@@ -1287,25 +1287,25 @@ The result string is one of `bs-string-current', `bs-string-current-marked',
1287 (t 1287 (t
1288 bs-string-show-always))) 1288 bs-string-show-always)))
1289 1289
1290(defun bs--get-modified-string (start-buffer all-buffers) 1290(defun bs--get-modified-string (_start-buffer _all-buffers)
1291 "Return a string which describes whether current buffer is modified. 1291 "Return a string which describes whether current buffer is modified.
1292START-BUFFER is the buffer where we started buffer selection. 1292START-BUFFER is the buffer where we started buffer selection.
1293ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu." 1293ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu."
1294 (if (buffer-modified-p) "*" " ")) 1294 (if (buffer-modified-p) "*" " "))
1295 1295
1296(defun bs--get-readonly-string (start-buffer all-buffers) 1296(defun bs--get-readonly-string (_start-buffer _all-buffers)
1297 "Return a string which describes whether current buffer is read only. 1297 "Return a string which describes whether current buffer is read only.
1298START-BUFFER is the buffer where we started buffer selection. 1298START-BUFFER is the buffer where we started buffer selection.
1299ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu." 1299ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu."
1300 (if buffer-read-only "%" " ")) 1300 (if buffer-read-only "%" " "))
1301 1301
1302(defun bs--get-size-string (start-buffer all-buffers) 1302(defun bs--get-size-string (_start-buffer _all-buffers)
1303 "Return a string which describes the size of current buffer. 1303 "Return a string which describes the size of current buffer.
1304START-BUFFER is the buffer where we started buffer selection. 1304START-BUFFER is the buffer where we started buffer selection.
1305ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu." 1305ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu."
1306 (int-to-string (buffer-size))) 1306 (int-to-string (buffer-size)))
1307 1307
1308(defun bs--get-name (start-buffer all-buffers) 1308(defun bs--get-name (_start-buffer _all-buffers)
1309 "Return name of current buffer for Buffer Selection Menu. 1309 "Return name of current buffer for Buffer Selection Menu.
1310The name of current buffer gets additional text properties 1310The name of current buffer gets additional text properties
1311for mouse highlighting. 1311for mouse highlighting.
@@ -1315,13 +1315,13 @@ ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu."
1315 'help-echo "mouse-2: select this buffer, mouse-3: select in other frame" 1315 'help-echo "mouse-2: select this buffer, mouse-3: select in other frame"
1316 'mouse-face 'highlight)) 1316 'mouse-face 'highlight))
1317 1317
1318(defun bs--get-mode-name (start-buffer all-buffers) 1318(defun bs--get-mode-name (start-buffer _all-buffers)
1319 "Return the name of mode of current buffer for Buffer Selection Menu. 1319 "Return the name of mode of current buffer for Buffer Selection Menu.
1320START-BUFFER is the buffer where we started buffer selection. 1320START-BUFFER is the buffer where we started buffer selection.
1321ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu." 1321ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu."
1322 (format-mode-line mode-name nil nil start-buffer)) 1322 (format-mode-line mode-name nil nil start-buffer))
1323 1323
1324(defun bs--get-file-name (start-buffer all-buffers) 1324(defun bs--get-file-name (_start-buffer _all-buffers)
1325 "Return string for column 'File' in Buffer Selection Menu. 1325 "Return string for column 'File' in Buffer Selection Menu.
1326This is the variable `buffer-file-name' of current buffer. 1326This is the variable `buffer-file-name' of current buffer.
1327If not visiting a file, `list-buffers-directory' is returned instead. 1327If not visiting a file, `list-buffers-directory' is returned instead.
@@ -1420,18 +1420,18 @@ for buffer selection."
1420 (bs-show-in-buffer liste) 1420 (bs-show-in-buffer liste)
1421 (bs-message-without-log "%s" (bs--current-config-message))))) 1421 (bs-message-without-log "%s" (bs--current-config-message)))))
1422 1422
1423(defun bs--configuration-name-for-prefix-arg (prefix-arg) 1423(defun bs--configuration-name-for-prefix-arg (prefix)
1424 "Convert prefix argument PREFIX-ARG to a name of a buffer configuration. 1424 "Convert prefix argument PREFIX to a name of a buffer configuration.
1425If PREFIX-ARG is nil return `bs-default-configuration'. 1425If PREFIX is nil return `bs-default-configuration'.
1426If PREFIX-ARG is an integer return PREFIX-ARG element of `bs-configurations'. 1426If PREFIX is an integer return PREFIX element of `bs-configurations'.
1427Otherwise return `bs-alternative-configuration'." 1427Otherwise return `bs-alternative-configuration'."
1428 (cond ;; usually activation 1428 (cond ;; usually activation
1429 ((null prefix-arg) 1429 ((null prefix)
1430 bs-default-configuration) 1430 bs-default-configuration)
1431 ;; call with integer as prefix argument 1431 ;; call with integer as prefix argument
1432 ((integerp prefix-arg) 1432 ((integerp prefix)
1433 (if (and (< 0 prefix-arg) (<= prefix-arg (length bs-configurations))) 1433 (if (and (< 0 prefix) (<= prefix (length bs-configurations)))
1434 (car (nth (1- prefix-arg) bs-configurations)) 1434 (car (nth (1- prefix) bs-configurations))
1435 bs-default-configuration)) 1435 bs-default-configuration))
1436 ;; call by prefix argument C-u 1436 ;; call by prefix argument C-u
1437 (t bs-alternative-configuration))) 1437 (t bs-alternative-configuration)))
diff --git a/lisp/ehelp.el b/lisp/ehelp.el
index 7745957b4c3..b2bcf1f85cb 100644
--- a/lisp/ehelp.el
+++ b/lisp/ehelp.el
@@ -1,4 +1,4 @@
1;;; ehelp.el --- bindings for electric-help mode 1;;; ehelp.el --- bindings for electric-help mode -*- lexical-binding: t -*-
2 2
3;; Copyright (C) 1986, 1995, 2000-2011 Free Software Foundation, Inc. 3;; Copyright (C) 1986, 1995, 2000-2011 Free Software Foundation, Inc.
4 4
@@ -347,14 +347,14 @@ will select it.)"
347 347
348;; This is to be bound to M-x in ehelp mode. Retains ehelp buffer and then 348;; This is to be bound to M-x in ehelp mode. Retains ehelp buffer and then
349;; continues with execute-extended-command. 349;; continues with execute-extended-command.
350(defun electric-help-execute-extended (prefixarg) 350(defun electric-help-execute-extended (_prefixarg)
351 (interactive "p") 351 (interactive "p")
352 (setq electric-help-form-to-execute '(execute-extended-command nil)) 352 (setq electric-help-form-to-execute '(execute-extended-command nil))
353 (electric-help-retain)) 353 (electric-help-retain))
354 354
355;; This is to be buond to C-x in ehelp mode. Retains ehelp buffer and then 355;; This is to be buond to C-x in ehelp mode. Retains ehelp buffer and then
356;; continues with ctrl-x prefix. 356;; continues with ctrl-x prefix.
357(defun electric-help-ctrl-x-prefix (prefixarg) 357(defun electric-help-ctrl-x-prefix (_prefixarg)
358 (interactive "p") 358 (interactive "p")
359 (setq electric-help-form-to-execute '(progn (message nil) (setq unread-command-char ?\C-x))) 359 (setq electric-help-form-to-execute '(progn (message nil) (setq unread-command-char ?\C-x)))
360 (electric-help-retain)) 360 (electric-help-retain))
diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el
index 59a30d62b02..50a65eb6bbb 100644
--- a/lisp/emacs-lisp/re-builder.el
+++ b/lisp/emacs-lisp/re-builder.el
@@ -1,4 +1,4 @@
1;;; re-builder.el --- building Regexps with visual feedback 1;;; re-builder.el --- building Regexps with visual feedback -*- lexical-binding: t -*-
2 2
3;; Copyright (C) 1999-2011 Free Software Foundation, Inc. 3;; Copyright (C) 1999-2011 Free Software Foundation, Inc.
4 4
@@ -506,7 +506,7 @@ If SUBEXP is non-nil mark only the corresponding sub-expressions."
506 (reb-update-regexp) 506 (reb-update-regexp)
507 (reb-update-overlays subexp)) 507 (reb-update-overlays subexp))
508 508
509(defun reb-auto-update (beg end lenold &optional force) 509(defun reb-auto-update (_beg _end _lenold &optional force)
510 "Called from `after-update-functions' to update the display. 510 "Called from `after-update-functions' to update the display.
511BEG, END and LENOLD are passed in from the hook. 511BEG, END and LENOLD are passed in from the hook.
512An actual update is only done if the regexp has changed or if the 512An actual update is only done if the regexp has changed or if the
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 392e894965c..71316c102fc 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -1,4 +1,4 @@
1;;; help-fns.el --- Complex help functions 1;;; help-fns.el --- Complex help functions -*- lexical-binding: t -*-
2 2
3;; Copyright (C) 1985-1986, 1993-1994, 1998-2011 3;; Copyright (C) 1985-1986, 1993-1994, 1998-2011
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
@@ -879,7 +879,7 @@ BUFFER defaults to the current buffer."
879 (insert (cond 879 (insert (cond
880 ((null value) "default") 880 ((null value) "default")
881 ((char-table-p value) "deeper char-table ...") 881 ((char-table-p value) "deeper char-table ...")
882 (t (condition-case err 882 (t (condition-case nil
883 (category-set-mnemonics value) 883 (category-set-mnemonics value)
884 (error "invalid")))))) 884 (error "invalid"))))))
885 885
diff --git a/lisp/hexl.el b/lisp/hexl.el
index dd142f7cda4..fdafd97cdab 100644
--- a/lisp/hexl.el
+++ b/lisp/hexl.el
@@ -1,4 +1,4 @@
1;;; hexl.el --- edit a file in a hex dump format using the hexl filter 1;;; hexl.el --- edit a file in a hex dump format using the hexl filter -*- lexical-binding: t -*-
2 2
3;; Copyright (C) 1989, 1994, 1998, 2001-2011 Free Software Foundation, Inc. 3;; Copyright (C) 1989, 1994, 1998, 2001-2011 Free Software Foundation, Inc.
4 4
@@ -355,7 +355,7 @@ You can use \\[hexl-find-file] to visit a file in Hexl mode.
355 355
356 (hexl-mode--setq-local 'require-final-newline nil) 356 (hexl-mode--setq-local 'require-final-newline nil)
357 357
358 358
359 (hexl-mode--setq-local 'font-lock-defaults '(hexl-font-lock-keywords t)) 359 (hexl-mode--setq-local 'font-lock-defaults '(hexl-font-lock-keywords t))
360 360
361 (hexl-mode--setq-local 'revert-buffer-function 361 (hexl-mode--setq-local 'revert-buffer-function
@@ -437,7 +437,7 @@ and edit the file in `hexl-mode'."
437 (if (not (eq major-mode 'hexl-mode)) 437 (if (not (eq major-mode 'hexl-mode))
438 (hexl-mode))) 438 (hexl-mode)))
439 439
440(defun hexl-revert-buffer-function (ignore-auto noconfirm) 440(defun hexl-revert-buffer-function (_ignore-auto _noconfirm)
441 (let ((coding-system-for-read 'no-conversion) 441 (let ((coding-system-for-read 'no-conversion)
442 revert-buffer-function) 442 revert-buffer-function)
443 ;; Call the original `revert-buffer' without code conversion; also 443 ;; Call the original `revert-buffer' without code conversion; also
@@ -492,7 +492,7 @@ With arg, don't unhexlify buffer."
492 ;; since some of them may affect the minor modes. 492 ;; since some of them may affect the minor modes.
493 (dolist (mm mms) 493 (dolist (mm mms)
494 (funcall (car mm) (if (cdr mm) 1 -1)))) 494 (funcall (car mm) (if (cdr mm) 1 -1))))
495 495
496 (force-mode-line-update)) 496 (force-mode-line-update))
497 497
498(defun hexl-maybe-dehexlify-buffer () 498(defun hexl-maybe-dehexlify-buffer ()
diff --git a/lisp/linum.el b/lisp/linum.el
index 11e6a7f8b4f..db6e4c49977 100644
--- a/lisp/linum.el
+++ b/lisp/linum.el
@@ -1,4 +1,4 @@
1;;; linum.el --- display line numbers in the left margin 1;;; linum.el --- display line numbers in the left margin -*- lexical-binding: t -*-
2 2
3;; Copyright (C) 2008-2011 Free Software Foundation, Inc. 3;; Copyright (C) 2008-2011 Free Software Foundation, Inc.
4 4
@@ -174,14 +174,14 @@ and you have to scroll or press \\[recenter-top-bottom] to update the numbers."
174 (setq line (1+ line))) 174 (setq line (1+ line)))
175 (set-window-margins win width (cdr (window-margins win))))) 175 (set-window-margins win width (cdr (window-margins win)))))
176 176
177(defun linum-after-change (beg end len) 177(defun linum-after-change (beg end _len)
178 ;; update overlays on deletions, and after newlines are inserted 178 ;; update overlays on deletions, and after newlines are inserted
179 (when (or (= beg end) 179 (when (or (= beg end)
180 (= end (point-max)) 180 (= end (point-max))
181 (string-match-p "\n" (buffer-substring-no-properties beg end))) 181 (string-match-p "\n" (buffer-substring-no-properties beg end)))
182 (linum-update-current))) 182 (linum-update-current)))
183 183
184(defun linum-after-scroll (win start) 184(defun linum-after-scroll (win _start)
185 (linum-update (window-buffer win))) 185 (linum-update (window-buffer win)))
186 186
187;; (defun linum-after-size (frame) 187;; (defun linum-after-size (frame)