]> code.delx.au - gnu-emacs/commitdiff
Convert some .el files to lexical scoping.
authorJuanma Barranquero <lekktu@gmail.com>
Mon, 4 Apr 2011 09:35:16 +0000 (11:35 +0200)
committerJuanma Barranquero <lekktu@gmail.com>
Mon, 4 Apr 2011 09:35:16 +0000 (11:35 +0200)
* 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.

lisp/ChangeLog
lisp/bs.el
lisp/ehelp.el
lisp/emacs-lisp/re-builder.el
lisp/help-fns.el
lisp/hexl.el
lisp/linum.el

index 3bdf91d8733985fcd8a2305907ff42385fdbf97e..142e6bc57e02ae431ff215388886fe16016bb075 100644 (file)
@@ -1,3 +1,21 @@
+2011-04-04  Juanma Barranquero  <lekktu@gmail.com>
+
+       Convert to lexical-binding.
+
+       * 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.
+
 2011-04-04  Daiki Ueno  <ueno@unixuser.org>
 
        * epa-dired.el:
 2011-03-31  Tassilo Horn  <tassilo@member.fsf.org>
 
        * net/rcirc.el (rcirc-handler-001): Only authenticate, if there's
-       an entry for that server in rcirc-authinfo. (Bug#8385)
+       an entry for that server in rcirc-authinfo.  (Bug#8385)
 
 2011-03-31  Glenn Morris  <rgm@gnu.org>
 
index 1f90304f1da579734aeebd508eb9dc26ef0aaf2b..72b3e4c6fef59c957ea03a5f31db94d183cc6bd5 100644 (file)
@@ -1,4 +1,4 @@
-;;; bs.el --- menu for selecting and displaying buffers
+;;; bs.el --- menu for selecting and displaying buffers -*- lexical-binding: t -*-
 
 ;; Copyright (C) 1998-2011  Free Software Foundation, Inc.
 ;; Author: Olaf Sylvester <Olaf.Sylvester@netsurf.de>
@@ -693,7 +693,7 @@ Refresh whole Buffer Selection Menu."
   (call-interactively 'bs-set-configuration)
   (bs--redisplay t))
 
-(defun bs-refresh (&rest ignored)
+(defun bs-refresh (&rest _ignored)
   "Refresh whole Buffer Selection Menu.
 Arguments are IGNORED (for `revert-buffer')."
   (interactive)
@@ -1017,7 +1017,7 @@ A value of t means BUFFER belongs to no file.
 A value of nil means BUFFER belongs to a file."
   (not (buffer-file-name buffer)))
 
-(defun bs-sort-buffer-interns-are-last (b1 b2)
+(defun bs-sort-buffer-interns-are-last (_b1 b2)
   "Function for sorting internal buffers at the end of all buffers."
   (string-match-p "^\\*" (buffer-name b2)))
 
@@ -1262,7 +1262,7 @@ or a string."
         fun)
        (t (apply fun args))))
 
-(defun bs--get-marked-string (start-buffer all-buffers)
+(defun bs--get-marked-string (start-buffer _all-buffers)
   "Return a string which describes whether current buffer is marked.
 START-BUFFER is the buffer where we started buffer selection.
 ALL-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',
    (t
     bs-string-show-always)))
 
-(defun bs--get-modified-string (start-buffer all-buffers)
+(defun bs--get-modified-string (_start-buffer _all-buffers)
   "Return a string which describes whether current buffer is modified.
 START-BUFFER is the buffer where we started buffer selection.
 ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu."
   (if (buffer-modified-p) "*" " "))
 
-(defun bs--get-readonly-string (start-buffer all-buffers)
+(defun bs--get-readonly-string (_start-buffer _all-buffers)
   "Return a string which describes whether current buffer is read only.
 START-BUFFER is the buffer where we started buffer selection.
 ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu."
   (if buffer-read-only "%" " "))
 
-(defun bs--get-size-string (start-buffer all-buffers)
+(defun bs--get-size-string (_start-buffer _all-buffers)
   "Return a string which describes the size of current buffer.
 START-BUFFER is the buffer where we started buffer selection.
 ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu."
   (int-to-string (buffer-size)))
 
-(defun bs--get-name (start-buffer all-buffers)
+(defun bs--get-name (_start-buffer _all-buffers)
   "Return name of current buffer for Buffer Selection Menu.
 The name of current buffer gets additional text properties
 for mouse highlighting.
@@ -1315,13 +1315,13 @@ ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu."
               'help-echo "mouse-2: select this buffer, mouse-3: select in other frame"
               'mouse-face 'highlight))
 
-(defun bs--get-mode-name (start-buffer all-buffers)
+(defun bs--get-mode-name (start-buffer _all-buffers)
   "Return the name of mode of current buffer for Buffer Selection Menu.
 START-BUFFER is the buffer where we started buffer selection.
 ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu."
   (format-mode-line mode-name nil nil start-buffer))
 
-(defun bs--get-file-name (start-buffer all-buffers)
+(defun bs--get-file-name (_start-buffer _all-buffers)
   "Return string for column 'File' in Buffer Selection Menu.
 This is the variable `buffer-file-name' of current buffer.
 If not visiting a file, `list-buffers-directory' is returned instead.
@@ -1420,18 +1420,18 @@ for buffer selection."
       (bs-show-in-buffer liste)
       (bs-message-without-log "%s" (bs--current-config-message)))))
 
-(defun bs--configuration-name-for-prefix-arg (prefix-arg)
-  "Convert prefix argument PREFIX-ARG to a name of a buffer configuration.
-If PREFIX-ARG is nil return `bs-default-configuration'.
-If PREFIX-ARG is an integer return PREFIX-ARG element of `bs-configurations'.
+(defun bs--configuration-name-for-prefix-arg (prefix)
+  "Convert prefix argument PREFIX to a name of a buffer configuration.
+If PREFIX is nil return `bs-default-configuration'.
+If PREFIX is an integer return PREFIX element of `bs-configurations'.
 Otherwise return `bs-alternative-configuration'."
   (cond ;; usually activation
-   ((null prefix-arg)
+   ((null prefix)
     bs-default-configuration)
    ;; call with integer as prefix argument
-   ((integerp prefix-arg)
-    (if (and (< 0 prefix-arg) (<= prefix-arg (length bs-configurations)))
-       (car (nth (1- prefix-arg) bs-configurations))
+   ((integerp prefix)
+    (if (and (< 0 prefix) (<= prefix (length bs-configurations)))
+       (car (nth (1- prefix) bs-configurations))
       bs-default-configuration))
    ;; call by prefix argument C-u
    (t bs-alternative-configuration)))
index 7745957b4c31e44a68bbbfb76a96a92ec3ab9ab4..b2bcf1f85cb86ba5a890480fba1dbc3131caf451 100644 (file)
@@ -1,4 +1,4 @@
-;;; ehelp.el --- bindings for electric-help mode
+;;; ehelp.el --- bindings for electric-help mode -*- lexical-binding: t -*-
 
 ;; Copyright (C) 1986, 1995, 2000-2011  Free Software Foundation, Inc.
 
@@ -347,14 +347,14 @@ will select it.)"
 
 ;; This is to be bound to M-x in ehelp mode. Retains ehelp buffer and then
 ;; continues with execute-extended-command.
-(defun electric-help-execute-extended (prefixarg)
+(defun electric-help-execute-extended (_prefixarg)
   (interactive "p")
   (setq electric-help-form-to-execute '(execute-extended-command nil))
   (electric-help-retain))
 
 ;; This is to be buond to C-x in ehelp mode. Retains ehelp buffer and then
 ;; continues with ctrl-x prefix.
-(defun electric-help-ctrl-x-prefix (prefixarg)
+(defun electric-help-ctrl-x-prefix (_prefixarg)
   (interactive "p")
   (setq electric-help-form-to-execute '(progn (message nil) (setq unread-command-char ?\C-x)))
   (electric-help-retain))
index 59a30d62b021e3ae031b67b9d18b7e48dccdeb20..50a65eb6bbb55531eb2543fb458d2746653b84a8 100644 (file)
@@ -1,4 +1,4 @@
-;;; re-builder.el --- building Regexps with visual feedback
+;;; re-builder.el --- building Regexps with visual feedback -*- lexical-binding: t -*-
 
 ;; Copyright (C) 1999-2011 Free Software Foundation, Inc.
 
@@ -506,7 +506,7 @@ If SUBEXP is non-nil mark only the corresponding sub-expressions."
   (reb-update-regexp)
   (reb-update-overlays subexp))
 
-(defun reb-auto-update (beg end lenold &optional force)
+(defun reb-auto-update (_beg _end _lenold &optional force)
   "Called from `after-update-functions' to update the display.
 BEG, END and LENOLD are passed in from the hook.
 An actual update is only done if the regexp has changed or if the
index 392e894965c55483def18c2d5d2e75c2aa2e2246..71316c102fcd73ab41c26c8ed515a63215f3171f 100644 (file)
@@ -1,4 +1,4 @@
-;;; help-fns.el --- Complex help functions
+;;; help-fns.el --- Complex help functions -*- lexical-binding: t -*-
 
 ;; Copyright (C) 1985-1986, 1993-1994, 1998-2011
 ;;   Free Software Foundation, Inc.
@@ -879,7 +879,7 @@ BUFFER defaults to the current buffer."
   (insert (cond
           ((null value) "default")
           ((char-table-p value) "deeper char-table ...")
-          (t (condition-case err
+          (t (condition-case nil
                  (category-set-mnemonics value)
                (error "invalid"))))))
 
index dd142f7cda4f7505da11af3f23cb168252c77d88..fdafd97cdab0cb44111b039bbff11d416d0b90f6 100644 (file)
@@ -1,4 +1,4 @@
-;;; hexl.el --- edit a file in a hex dump format using the hexl filter
+;;; hexl.el --- edit a file in a hex dump format using the hexl filter -*- lexical-binding: t -*-
 
 ;; Copyright (C) 1989, 1994, 1998, 2001-2011 Free Software Foundation, Inc.
 
@@ -355,7 +355,7 @@ You can use \\[hexl-find-file] to visit a file in Hexl mode.
 
     (hexl-mode--setq-local 'require-final-newline nil)
 
-    
+
     (hexl-mode--setq-local 'font-lock-defaults '(hexl-font-lock-keywords t))
 
     (hexl-mode--setq-local 'revert-buffer-function
@@ -437,7 +437,7 @@ and edit the file in `hexl-mode'."
   (if (not (eq major-mode 'hexl-mode))
       (hexl-mode)))
 
-(defun hexl-revert-buffer-function (ignore-auto noconfirm)
+(defun hexl-revert-buffer-function (_ignore-auto _noconfirm)
   (let ((coding-system-for-read 'no-conversion)
        revert-buffer-function)
     ;; Call the original `revert-buffer' without code conversion; also
@@ -492,7 +492,7 @@ With arg, don't unhexlify buffer."
     ;; since some of them may affect the minor modes.
     (dolist (mm mms)
       (funcall (car mm) (if (cdr mm) 1 -1))))
-  
+
   (force-mode-line-update))
 
 (defun hexl-maybe-dehexlify-buffer ()
index 11e6a7f8b4f17beab7076ef1dca5c02215680cab..db6e4c49977c6da1dfbf0fa67227926dd23e697f 100644 (file)
@@ -1,4 +1,4 @@
-;;; linum.el --- display line numbers in the left margin
+;;; linum.el --- display line numbers in the left margin -*- lexical-binding: t -*-
 
 ;; Copyright (C) 2008-2011 Free Software Foundation, Inc.
 
@@ -174,14 +174,14 @@ and you have to scroll or press \\[recenter-top-bottom] to update the numbers."
       (setq line (1+ line)))
     (set-window-margins win width (cdr (window-margins win)))))
 
-(defun linum-after-change (beg end len)
+(defun linum-after-change (beg end _len)
   ;; update overlays on deletions, and after newlines are inserted
   (when (or (= beg end)
             (= end (point-max))
             (string-match-p "\n" (buffer-substring-no-properties beg end)))
     (linum-update-current)))
 
-(defun linum-after-scroll (win start)
+(defun linum-after-scroll (win _start)
   (linum-update (window-buffer win)))
 
 ;; (defun linum-after-size (frame)