Commit 4d6769e1 authored by Juanma Barranquero's avatar Juanma Barranquero

lisp/*: Add declarations, remove unused bindings, mark unused args.

* lisp/avoid.el (mouse-avoidance-mode): Mark unused arg.
  (mouse-avoidance-nudge-mouse): Remove unused binding.

* lisp/imenu.el (imenu-default-goto-function): Mark unused args.
  (imenu-progress-message): Remove obsolete macro; all callers changed.

* lisp/mouse.el (mouse-menu-major-mode-map):
* lisp/emacs-lisp/authors.el (authors-scan-change-log)
  (authors-add-to-author-list):
* lisp/emacs-lisp/avl-tree.el (avl-tree--enter-balance):
* lisp/emacs-lisp/smie.el (smie-auto-fill):
* lisp/mail/sendmail.el (mail-bury):
* lisp/mail/unrmail.el (unrmail):
* lisp/net/tls.el (open-tls-stream):
* lisp/textmodes/picture.el (picture-mouse-set-point):
  Remove unused bindings.

* lisp/subr.el (keymap-canonicalize): Remove unused binding.
  (read-passwd): Mark unused arg.

* lisp/tutorial.el (tutorial--display-changes): Remove unused binding.
  (tutorial--save-tutorial-to): Remove unused variable.

* lisp/emacs-lisp/package.el (define-package, package-menu-mark-delete)
  (package-menu-mark-install, package-menu-mark-unmark): Mark unused args.
  (package-generate-autoloads, package-menu--generate)
  (package-menu--find-upgrades): Remove unused bindings.

* lisp/emulation/cua-rect.el (cua-restrict-regexp-rectangle)
  (cua-restrict-prefix-rectangle): Doc fixes.  Remove unused bindings.
  (cua--mouse-ignore, cua--delete-rectangle, cua--extract-rectangle)
  (cua--indent-rectangle, cua-open-rectangle, cua-close-rectangle)
  (cua-blank-rectangle, cua-string-rectangle, cua-replace-in-rectangle)
  (cua-incr-rectangle, cua-sequence-rectangle, cua--convert-rectangle-as)
  (cua--rectangle-aux-replace, cua--left-fill-rectangle)
  (cua-scroll-rectangle-up, cua-scroll-rectangle-down)
  (cua-delete-char-rectangle): Mark unused args.
  (cua-align-rectangle): Remove unused binding.

* lisp/mail/rmail.el (compilation--message->loc)
  (epa--find-coding-system-for-mime-charset): Declare.

* lisp/net/dbus.el (dbus-register-service): Declare.
  (dbus-name-owner-changed-handler): Remove unused binding.

* lisp/nxml/nxml-mode.el (nxml-electric-slash, nxml-in-mixed-content-p)
  (nxml-compute-indent-from-matching-start-tag): Remove unused variables.
  (nxml-scan-backward-within): Mark unused arg.
  (nxml-dynamic-markup-word): Remove unused binding.
parent 376cbacc
2012-04-19 Juanma Barranquero <lekktu@gmail.com>
* avoid.el (mouse-avoidance-mode): Mark unused arg.
(mouse-avoidance-nudge-mouse): Remove unused binding.
* bs.el (bs-toggle-readonly): Call `toggle-read-only' interactively.
* descr-text.el (describe-char):
* progmodes/python.el (python-describe-symbol):
Don't call `toggle-read-only', set `buffer-read-only'.
* imenu.el (imenu-default-goto-function): Mark unused args.
(imenu-progress-message): Remove obsolete macro; all callers changed.
* subr.el (keymap-canonicalize): Remove unused binding.
(read-passwd): Mark unused arg.
* tutorial.el (tutorial--display-changes): Remove unused binding.
(tutorial--save-tutorial-to): Remove unused variable.
* emacs-lisp/package.el (define-package, package-menu-mark-delete)
(package-menu-mark-install, package-menu-mark-unmark): Mark unused args.
(package-generate-autoloads, package-menu--generate)
(package-menu--find-upgrades): Remove unused bindings.
* emulation/cua-rect.el (cua-restrict-regexp-rectangle)
(cua-restrict-prefix-rectangle): Doc fixes. Remove unused bindings.
(cua--mouse-ignore, cua--delete-rectangle, cua--extract-rectangle)
(cua--indent-rectangle, cua-open-rectangle, cua-close-rectangle)
(cua-blank-rectangle, cua-string-rectangle, cua-replace-in-rectangle)
(cua-incr-rectangle, cua-sequence-rectangle, cua--convert-rectangle-as)
(cua--rectangle-aux-replace, cua--left-fill-rectangle)
(cua-scroll-rectangle-up, cua-scroll-rectangle-down)
(cua-delete-char-rectangle): Mark unused args.
(cua-align-rectangle): Remove unused binding.
* mail/rmail.el (compilation--message->loc)
(epa--find-coding-system-for-mime-charset): Declare.
* net/dbus.el (dbus-register-service): Declare.
(dbus-name-owner-changed-handler): Remove unused binding.
* nxml/nxml-mode.el (nxml-electric-slash, nxml-in-mixed-content-p)
(nxml-compute-indent-from-matching-start-tag): Remove unused variables.
(nxml-scan-backward-within): Mark unused arg.
(nxml-dynamic-markup-word): Remove unused binding.
* mouse.el (mouse-menu-major-mode-map):
* emacs-lisp/authors.el (authors-scan-change-log)
(authors-add-to-author-list):
* emacs-lisp/avl-tree.el (avl-tree--enter-balance):
* emacs-lisp/smie.el (smie-auto-fill):
* mail/sendmail.el (mail-bury):
* mail/unrmail.el (unrmail):
* net/tls.el (open-tls-stream):
* textmodes/picture.el (picture-mouse-set-point):
Remove unused bindings.
2012-04-19 Michael Albinus <michael.albinus@gmx.de>
* net/tramp.el (tramp-action-password): Let-bind
......@@ -180,7 +238,7 @@
2012-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
Avoid the use of ((lambda ...) ...) in lexical-binding code.
* emacs-lisp/easy-mmode.el (define-minor-mode):Use funcall (bug#11241).
* emacs-lisp/easy-mmode.el (define-minor-mode): Use funcall (bug#11241).
2012-04-15 Glenn Morris <rgm@gnu.org>
......@@ -392,7 +450,7 @@
2012-04-11 Wolfgang Jenkner <wjenkner@inode.at> (tiny change)
* lisp/progmodes/grep.el (rgrep): Tweak the find command line so
* progmodes/grep.el (rgrep): Tweak the find command line so
that directories matching `grep-find-ignored-files' won't be
pruned (bug#10351).
......@@ -1730,7 +1788,7 @@
2012-02-12 Alan Mackenzie <acm@muc.de>
Fix infinite loop with long macros.
* cc-engine.el (c-state-safe-place): Handle macros properly.
* progmodes/cc-engine.el (c-state-safe-place): Handle macros properly.
2012-02-12 Chong Yidong <cyd@gnu.org>
......@@ -1993,11 +2051,10 @@
2012-02-06 Lars Ingebrigtsen <larsi@gnus.org>
* progmodes/cc-mode.el
(c-standard-font-lock-fontify-region-function): Set the default at
load time, too, so that `font-lock-fontify-buffer' can be called
without setting up the entire mode first. This fixes a bug in
`mm-inline-text' with C MIME parts.
* progmodes/cc-mode.el (c-standard-font-lock-fontify-region-function):
Set the default at load time, too, so that `font-lock-fontify-buffer'
can be called without setting up the entire mode first. This fixes
a bug in `mm-inline-text' with C MIME parts.
2012-02-06 Chong Yidong <cyd@gnu.org>
......
......@@ -80,7 +80,7 @@
See function `mouse-avoidance-mode' for possible values.
Setting this variable directly does not take effect;
use either \\[customize] or the function `mouse-avoidance-mode'."
:set (lambda (symbol value)
:set (lambda (_symbol value)
;; 'none below prevents toggling when value is nil.
(mouse-avoidance-mode (or value 'none)))
:initialize 'custom-initialize-default
......@@ -267,7 +267,6 @@ If you want the mouse banished to a different corner set
;; For these modes, state keeps track of the total offset that we've
;; accumulated, and tries to keep it close to zero.
(let* ((cur (mouse-position))
(cur-frame (car cur))
(cur-pos (cdr cur))
(pos (window-edges))
(wleft (pop pos))
......
;;; authors.el --- utility for maintaining Emacs's AUTHORS file -*-coding: utf-8;-*-
;;; authors.el --- utility for maintaining Emacs's AUTHORS file -*-coding: utf-8 -*-
;; Copyright (C) 2000-2012 Free Software Foundation, Inc.
......@@ -829,7 +829,7 @@ with the file and the number of each action:
(enable-local-eval nil)
(existing-buffer (get-file-buffer log-file))
(buffer (find-file-noselect log-file))
authors file pos)
authors pos)
(with-current-buffer buffer
(save-restriction
(widen)
......@@ -943,8 +943,7 @@ and changed by AUTHOR."
(file (car change))
(filestat (if (authors-public-domain-p file)
(concat file " (public domain)")
file))
slot)
file)))
(cond ((assq :wrote actions)
(setq wrote-list (cons filestat wrote-list)))
((assq :cowrote actions)
......
......@@ -260,7 +260,7 @@ Return t if the height of the tree has grown."
(opp (avl-tree--switch-dir dir))
;; direction 0,1 -> sign factor -1,+1
(sgn (avl-tree--dir-to-sign dir))
p1 p2 b2 result)
p1 p2 b2)
(cond
((< (* sgn (avl-tree--node-balance br)) 0)
(setf (avl-tree--node-balance br) 0)
......
......@@ -524,7 +524,7 @@ Required package `%s-%s' is unavailable"
(defun define-package (name-string version-string
&optional docstring requirements
&rest extra-properties)
&rest _extra-properties)
"Define a new package.
NAME-STRING is the name of the package, as a string.
VERSION-STRING is the version of the package, as a string.
......@@ -584,7 +584,7 @@ EXTRA-PROPERTIES is currently unused."
(defun package-generate-autoloads (name pkg-dir)
(require 'autoload) ;Load before we let-bind generated-autoload-file!
(let* ((auto-name (concat name "-autoloads.el"))
(ignore-name (concat name "-pkg.el"))
;;(ignore-name (concat name "-pkg.el"))
(generated-autoload-file (expand-file-name auto-name pkg-dir))
(version-control 'never))
(unless (fboundp 'autoload-ensure-default-file)
......@@ -1389,7 +1389,7 @@ If REMEMBER-POS is non-nil, keep point on the same entry.
PACKAGES should be t, which means to display all known packages,
or a list of package names (symbols) to display."
;; Construct list of ((PACKAGE . VERSION) STATUS DESCRIPTION).
(let (info-list name builtin)
(let (info-list name)
;; Installed packages:
(dolist (elt package-alist)
(setq name (car elt))
......@@ -1474,21 +1474,21 @@ If optional arg BUTTON is non-nil, describe its associated package."
(describe-package package))))
;; fixme numeric argument
(defun package-menu-mark-delete (&optional num)
(defun package-menu-mark-delete (&optional _num)
"Mark a package for deletion and move to the next line."
(interactive "p")
(if (member (package-menu-get-status) '("installed" "obsolete"))
(tabulated-list-put-tag "D" t)
(forward-line)))
(defun package-menu-mark-install (&optional num)
(defun package-menu-mark-install (&optional _num)
"Mark a package for installation and move to the next line."
(interactive "p")
(if (string-equal (package-menu-get-status) "available")
(tabulated-list-put-tag "I" t)
(forward-line)))
(defun package-menu-mark-unmark (&optional num)
(defun package-menu-mark-unmark (&optional _num)
"Clear any marks on a package and move to the next line."
(interactive "p")
(tabulated-list-put-tag " " t))
......@@ -1530,8 +1530,7 @@ If optional arg BUTTON is non-nil, describe its associated package."
(dolist (entry tabulated-list-entries)
;; ENTRY is ((NAME . VERSION) [NAME VERSION STATUS DOC])
(let ((pkg (car entry))
(status (aref (cadr entry) 2))
old)
(status (aref (cadr entry) 2)))
(cond ((equal status "installed")
(push pkg installed))
((equal status "available")
......
......@@ -1603,8 +1603,7 @@ to which that point should be aligned, if we were to reindent it.")
(indent-line-to indent)))))
(defun smie-auto-fill ()
(let ((fc (current-fill-column))
(try-again nil))
(let ((fc (current-fill-column)))
(while (and fc (> (current-column) fc))
(cond
((not (or (nth 8 (save-excursion
......@@ -1628,7 +1627,6 @@ to which that point should be aligned, if we were to reindent it.")
(setq bsf (point))))
(smie-indent-forward-token))
(when (> gain 0)
(setq try-again)
(goto-char bsf)
(newline-and-indent)))))
(t (do-auto-fill))))))
......
......@@ -465,7 +465,7 @@ If command is repeated at same position, delete the rectangle."
(cua-copy-rectangle arg)
(setq cua--mouse-last-pos (cons (point) cua--last-killed-rectangle)))))
(defun cua--mouse-ignore (event)
(defun cua--mouse-ignore (_event)
(interactive "e")
(setq this-command last-command))
......@@ -609,12 +609,12 @@ If command is repeated at same position, delete the rectangle."
(let ((lines 0))
(if (not (cua--rectangle-virtual-edges))
(cua--rectangle-operation nil nil t 2 t
(lambda (s e l r v)
(lambda (s e _l _r _v)
(setq lines (1+ lines))
(if (and (> e s) (<= e (point-max)))
(delete-region s e))))
(cua--rectangle-operation nil 1 t nil t
(lambda (s e l r v)
(lambda (s e _l _r _v)
(setq lines (1+ lines))
(when (and (> e s) (<= e (point-max)))
(delete-region s e)))))
......@@ -624,10 +624,10 @@ If command is repeated at same position, delete the rectangle."
(let (rect)
(if (not (cua--rectangle-virtual-edges))
(cua--rectangle-operation nil nil nil nil nil ; do not tabify
(lambda (s e l r)
(lambda (s e _l _r)
(setq rect (cons (cua--filter-buffer-noprops s e) rect))))
(cua--rectangle-operation nil 1 nil nil nil ; do not tabify
(lambda (s e l r v)
(lambda (s e l r _v)
(let ((copy t) (bs 0) (as 0) row)
(if (= s e) (setq e (1+ e)))
(goto-char s)
......@@ -840,7 +840,7 @@ If command is repeated at same position, delete the rectangle."
(pad (cua--rectangle-virtual-edges))
indent)
(cua--rectangle-operation (if clear 'clear 'corners) nil t pad nil
(lambda (s e l r)
(lambda (_s _e l _r)
(move-to-column col pad)
(if (and (eolp)
(< (current-column) col))
......@@ -905,10 +905,10 @@ With prefix argument, activate previous rectangle if possible."
(cua-help-for-region t))))
(defun cua-restrict-regexp-rectangle (arg)
"Restrict rectangle to lines (not) matching REGEXP.
With prefix argument, the toggle restriction."
"Restrict rectangle to lines (not) matching regexp.
With prefix argument, toggle restriction."
(interactive "P")
(let ((r (cua--rectangle-restriction)) regexp)
(let ((r (cua--rectangle-restriction)))
(if (and r (null (car (cdr r))))
(if arg
(cua--rectangle-restriction (car r) nil (not (car (cdr (cdr r)))))
......@@ -919,9 +919,9 @@ With prefix argument, the toggle restriction."
(defun cua-restrict-prefix-rectangle (arg)
"Restrict rectangle to lines (not) starting with CHAR.
With prefix argument, the toggle restriction."
With prefix argument, toggle restriction."
(interactive "P")
(let ((r (cua--rectangle-restriction)) regexp)
(let ((r (cua--rectangle-restriction)))
(if (and r (car (cdr r)))
(if arg
(cua--rectangle-restriction (car r) t (not (car (cdr (cdr r)))))
......@@ -1000,7 +1000,7 @@ The text previously in the region is not overwritten by the blanks,
but instead winds up to the right of the rectangle."
(interactive)
(cua--rectangle-operation 'corners nil t 1 nil
(lambda (s e l r)
(lambda (_s _e l r)
(skip-chars-forward " \t")
(let ((ws (- (current-column) l))
(p (point)))
......@@ -1015,7 +1015,7 @@ at that column is deleted.
With prefix arg, also delete whitespace to the left of that column."
(interactive "P")
(cua--rectangle-operation 'clear nil t 1 nil
(lambda (s e l r)
(lambda (s _e _l _r)
(when arg
(skip-syntax-backward " " (line-beginning-position))
(setq s (point)))
......@@ -1027,7 +1027,7 @@ With prefix arg, also delete whitespace to the left of that column."
The text previously in the rectangle is overwritten by the blanks."
(interactive)
(cua--rectangle-operation 'keep nil nil 1 nil
(lambda (s e l r)
(lambda (s e _l _r)
(goto-char e)
(skip-syntax-forward " " (line-end-position))
(setq e (point))
......@@ -1040,20 +1040,19 @@ The text previously in the rectangle is overwritten by the blanks."
(defun cua-align-rectangle ()
"Align rectangle lines to left column."
(interactive)
(let (x)
(cua--rectangle-operation 'clear nil t t nil
(lambda (s e l r)
(let ((b (line-beginning-position)))
(skip-syntax-backward "^ " b)
(skip-syntax-backward " " b)
(setq s (point)))
(skip-syntax-forward " " (line-end-position))
(delete-region s (point))
(indent-to l))
(lambda (l r)
(move-to-column l)
;; (setq cua-save-point (point))
))))
(cua--rectangle-operation 'clear nil t t nil
(lambda (s _e l _r)
(let ((b (line-beginning-position)))
(skip-syntax-backward "^ " b)
(skip-syntax-backward " " b)
(setq s (point)))
(skip-syntax-forward " " (line-end-position))
(delete-region s (point))
(indent-to l))
(lambda (l _r)
(move-to-column l)
;; (setq cua-save-point (point))
)))
(declare-function cua--cut-rectangle-to-global-mark "cua-gmrk" (as-text))
(declare-function cua--copy-rectangle-to-global-mark "cua-gmrk" (as-text))
......@@ -1087,7 +1086,7 @@ The text previously in the rectangle is overwritten by the blanks."
The length of STRING need not be the same as the rectangle width."
(interactive "sString rectangle: ")
(cua--rectangle-operation 'keep nil t t nil
(lambda (s e l r)
(lambda (s e l _r)
(delete-region s e)
(skip-chars-forward " \t")
(let ((ws (- (current-column) l)))
......@@ -1095,7 +1094,7 @@ The length of STRING need not be the same as the rectangle width."
(insert string)
(indent-to (+ (current-column) ws))))
(unless (cua--rectangle-restriction)
(lambda (l r)
(lambda (l _r)
(cua--rectangle-right (max l (+ l (length string) -1)))))))
(defun cua-fill-char-rectangle (character)
......@@ -1113,7 +1112,7 @@ The length of STRING need not be the same as the rectangle width."
(if buffer-read-only
(message "Cannot replace in read-only buffer")
(cua--rectangle-operation 'keep nil t 1 nil
(lambda (s e l r)
(lambda (_s e _l _r)
(if (re-search-forward regexp e t)
(replace-match newtext nil nil))))))
......@@ -1121,7 +1120,7 @@ The length of STRING need not be the same as the rectangle width."
"Increment each line of CUA rectangle by prefix amount."
(interactive "p")
(cua--rectangle-operation 'keep nil t 1 nil
(lambda (s e l r)
(lambda (_s e _l _r)
(cond
((re-search-forward "0x\\([0-9a-fA-F]+\\)" e t)
(let* ((txt (cua--filter-buffer-noprops (match-beginning 1) (match-end 1)))
......@@ -1154,14 +1153,14 @@ The numbers are formatted according to the FORMAT string."
(setq format cua--rectangle-seq-format)
(setq cua--rectangle-seq-format format))
(cua--rectangle-operation 'clear nil t 1 nil
(lambda (s e l r)
(lambda (s e _l _r)
(delete-region s e)
(insert (format format first))
(setq first (+ first incr)))))
(defmacro cua--convert-rectangle-as (command tabify)
`(cua--rectangle-operation 'clear nil nil nil ,tabify
(lambda (s e l r)
(lambda (s e _l _r)
(,command s e))))
(defun cua-upcase-rectangle ()
......@@ -1218,7 +1217,7 @@ The numbers are formatted according to the FORMAT string."
(if cua--debug
(print z auxbuf))
(cua--rectangle-operation nil nil t pad nil
(lambda (s e l r)
(lambda (s e l _r)
(let (cc)
(goto-char e)
(skip-chars-forward " \t")
......@@ -1249,7 +1248,7 @@ The numbers are formatted according to the FORMAT string."
(put 'cua--rectangle-aux-replace 'lisp-indent-function 4)
(defun cua--left-fill-rectangle (start end)
(defun cua--left-fill-rectangle (_start _end)
(beginning-of-line)
(while (< (point) (point-max))
(delete-horizontal-space nil)
......@@ -1298,7 +1297,7 @@ With prefix arg, replace rectangle with output from command."
"Remove the first line of the rectangle and scroll remaining lines up."
(interactive)
(cua--rectangle-aux-replace 0 t t t t
(lambda (s e)
(lambda (s _e)
(if (= (forward-line 1) 0)
(delete-region s (point))))))
......@@ -1307,7 +1306,7 @@ With prefix arg, replace rectangle with output from command."
The remaining lines are scrolled down, losing the last line."
(interactive)
(cua--rectangle-aux-replace 0 t t t t
(lambda (s e)
(lambda (s _e)
(goto-char s)
(insert "\n"))))
......@@ -1337,7 +1336,7 @@ With prefix arg, indent to that column."
(pad (cua--rectangle-virtual-edges))
indent)
(cua--rectangle-operation 'corners nil t pad nil
(lambda (s e l r)
(lambda (_s _e l r)
(move-to-column
(if (cua--rectangle-right-side t)
(max (1+ r) col) l)
......
......@@ -266,29 +266,6 @@ The function in this variable is called when selecting a normal index-item.")
(and (consp (cdr item)) (listp (cadr item))
(not (eq (car (cadr item)) 'lambda))))
;; Macro to display a progress message.
;; RELPOS is the relative position to display.
;; If RELPOS is nil, then the relative position in the buffer
;; is calculated.
;; PREVPOS is the variable in which we store the last position displayed.
(defmacro imenu-progress-message (prevpos &optional relpos reverse)
;; Made obsolete/empty, as computers are now faster than the eye, and
;; it had problems updating the messages correctly, and could shadow
;; more important messages/prompts in the minibuffer. KFS 2004-10-27.
;; `(and
;; imenu-scanning-message
;; (let ((pos ,(if relpos
;; relpos
;; `(imenu--relative-position ,reverse))))
;; (if ,(if relpos t
;; `(> pos (+ 5 ,prevpos)))
;; (progn
;; (message imenu-scanning-message pos)
;; (setq ,prevpos pos)))))
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
......@@ -338,13 +315,10 @@ Don't move point."
(let ((index-alist '())
(index-var-alist '())
(index-type-alist '())
(index-unknown-alist '())
prev-pos)
(index-unknown-alist '()))
(goto-char (point-max))
(imenu-progress-message prev-pos 0)
;; Search for the function
(while (beginning-of-defun)
(imenu-progress-message prev-pos nil t)
(save-match-data
(and (looking-at "(def")
(save-excursion
......@@ -371,7 +345,6 @@ Don't move point."
(forward-sexp 2)
(push (imenu-example--name-and-position)
index-unknown-alist)))))))
(imenu-progress-message prev-pos 100)
(and index-var-alist
(push (cons "Variables" index-var-alist)
index-alist))
......@@ -396,15 +369,13 @@ Don't move point."
(defun imenu-example--create-c-index (&optional regexp)
(let ((index-alist '())
prev-pos char)
char)
(goto-char (point-min))
(imenu-progress-message prev-pos 0)
;; Search for the function
(save-match-data
(while (re-search-forward
(or regexp imenu-example--function-name-regexp-c)
nil t)
(imenu-progress-message prev-pos)
(backward-up-list 1)
(save-excursion
(goto-char (scan-sexps (point) 1))
......@@ -412,7 +383,6 @@ Don't move point."
;; Skip this function name if it is a prototype declaration.
(if (not (eq char ?\;))
(push (imenu-example--name-and-position) index-alist))))
(imenu-progress-message prev-pos 100)
(nreverse index-alist)))
(make-obsolete 'imenu-example--create-c-index "your own" "23.2")
......@@ -684,22 +654,19 @@ The alternate method, which is the one most often used, is to call
(cond ((and imenu-prev-index-position-function
imenu-extract-index-name-function)
(let ((index-alist '()) (pos (point))
prev-pos name)
name)
(goto-char (point-max))
(imenu-progress-message prev-pos 0 t)
;; Search for the function
(while (funcall imenu-prev-index-position-function)
(when (= pos (point))
(error "Infinite loop at %s:%d: imenu-prev-index-position-function does not move point" (buffer-name) pos))
(setq pos (point))
(imenu-progress-message prev-pos nil t)
(save-excursion
(setq name (funcall imenu-extract-index-name-function)))
(and (stringp name)
;; [ydi] updated for imenu-use-markers
(push (cons name (if imenu-use-markers (point-marker) (point)))
index-alist)))
(imenu-progress-message prev-pos 100 t)
index-alist))
;; Use generic expression if possible.
((and imenu-generic-expression)
......@@ -765,7 +732,6 @@ They may also be nested index alists like:
depending on PATTERNS."
(let ((index-alist (list 'dummy))
prev-pos
(case-fold-search (if (or (local-variable-p 'imenu-case-fold-search)
(not (local-variable-p 'font-lock-defaults)))
imenu-case-fold-search
......@@ -782,7 +748,6 @@ depending on PATTERNS."
(modify-syntax-entry c (cdr syn) table))
(car syn))))
(goto-char (point-max))
(imenu-progress-message prev-pos 0 t)
(unwind-protect ; for syntax table
(save-match-data
(set-syntax-table table)
......@@ -820,7 +785,6 @@ depending on PATTERNS."
(goto-char (match-beginning index))
(beginning-of-line)
(setq beg (point))
(imenu-progress-message prev-pos nil t)
;; Add this sort of submenu only when we've found an
;; item for it, avoiding empty, duff menus.
(unless (assoc menu-title index-alist)
......@@ -845,7 +809,6 @@ depending on PATTERNS."
;; keep making progress backwards.
(goto-char start))))
(set-syntax-table old-table)))
(imenu-progress-message prev-pos 100 t)
;; Sort each submenu by position.
;; This is in case one submenu gets items from two different regexps.
(dolist (item index-alist)
......@@ -1039,7 +1002,7 @@ to `imenu-update-menubar'.")
(imenu item)
nil))
(defun imenu-default-goto-function (name position &optional rest)
(defun imenu-default-goto-function (_name position &optional _rest)
"Move to the given position.
NAME is ignored. POSITION is where to move. REST is also ignored.
......
......@@ -40,6 +40,9 @@
(require 'mail-utils)
(require 'rfc2047)
(declare-function compilation--message->loc "compile" (cl-x) t)
(declare-function epa--find-coding-system-for-mime-charset "epa" (mime-charset))
(defconst rmail-attribute-header "X-RMAIL-ATTRIBUTES"
"The header that stores the Rmail attribute data.")
......
......@@ -856,8 +856,7 @@ Prefix arg means don't delete this window."
(defun mail-bury (&optional arg)
"Bury this mail buffer."
(let ((newbuf (other-buffer (current-buffer)))
(return-action mail-return-action)
some-rmail)
(return-action mail-return-action))
(bury-buffer (current-buffer))
;; If there is an Rmail buffer, return to it nicely
;; even if this message was not started by an Rmail command.
......
......@@ -61,8 +61,7 @@ For example, invoke `emacs -batch -f batch-unrmail RMAIL'."
(error "This file is not in Babyl format"))
;; Decode the file contents just as Rmail did.
(let ((modifiedp (buffer-modified-p))
(coding-system rmail-file-coding-system)
(let ((coding-system rmail-file-coding-system)
from to)
(goto-char (point-min))
(search-forward "\n\^_" nil t) ; Skip BABYL header.
......
......@@ -194,8 +194,7 @@ items `Turn Off' and `Help'."
(newmap (if ancestor
(make-sparse-keymap (concat (format-mode-line mode-name)
" Mode"))
menu-bar-edit-menu))
uniq)
menu-bar-edit-menu)))
(if ancestor
(set-keymap-parent newmap ancestor))
newmap))
......
......@@ -37,6 +37,7 @@
(declare-function dbus-init-bus "dbusbind.c")
(declare-function dbus-method-return-internal "dbusbind.c")
(declare-function dbus-method-error-internal "dbusbind.c")
(declare-function dbus-register-service "dbusbind.c")
(declare-function dbus-register-signal "dbusbind.c")
(declare-function dbus-register-method "dbusbind.c")
(declare-function dbus-send-signal "dbusbind.c")
......@@ -275,8 +276,7 @@ usage: (dbus-name-owner-changed-handler service old-owner new-owner)"
(stringp (cadr args))
(stringp (caddr args)))
(let ((service (car args))
(old-owner (cadr args))
(new-owner (caddr args)))
(old-owner (cadr args)))
;; Check whether SERVICE is a known name.
(when (not (string-match "^:" service))
(maphash
......
......@@ -231,8 +231,7 @@ Fourth arg PORT is an integer specifying a port to connect to."
?h host
?p (if (integerp port)
(int-to-string port)
port))))
response)
port)))))
(message "Opening TLS connection with `%s'..." formatted-cmd)
(setq process (start-process
name buffer shell-file-name shell-command-switch
......
......@@ -1236,7 +1236,7 @@ on the line, reindent the line."
(unless arg
(if nxml-slash-auto-complete-flag
(if end-tag-p
(condition-case err
(condition-case nil
(let ((start-tag-end
(nxml-scan-element-backward (1- slash-pos) t)))
(when start-tag-end
......@@ -1434,7 +1434,7 @@ its line. Otherwise return nil."
(nxml-token-after)
(= xmltok-start bol))
(eq xmltok-type 'data))
(condition-case err
(condition-case nil
(nxml-scan-element-backward
(point)
nil
......@@ -1559,8 +1559,7 @@ This expects the xmltok-* variables to be set up as by `xmltok-forward'."
(off 0))
(if value-boundary
;; inside an attribute value
(let ((value-start (car value-boundary))
(value-end (cdr value-boundary)))
(let ((value-start (car value-boundary)))
(goto-char pos)
(forward-line -1)