From 3f99e6e686e4a2db4b0c13679d211fdbb9b48dae Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 15 Feb 2012 09:38:21 -0500 Subject: * lisp/emacs-lisp/smie.el: Provide smarter auto-filling. (smie-auto-fill): New function. (smie-setup): Use it. --- lisp/emacs-lisp/smie.el | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el index cad7c8419b2..49ee051e62d 100644 --- a/lisp/emacs-lisp/smie.el +++ b/lisp/emacs-lisp/smie.el @@ -1539,6 +1539,38 @@ to which that point should be aligned, if we were to reindent it.") (save-excursion (indent-line-to indent)) (indent-line-to indent))))) +(defun smie-auto-fill () + (let ((fc (current-fill-column)) + (try-again nil)) + (while (and fc (> (current-column) fc)) + (cond + ((not (or (nth 8 (save-excursion + (syntax-ppss (line-beginning-position)))) + (nth 8 (syntax-ppss)))) + (save-excursion + (beginning-of-line) + (smie-indent-forward-token) + (let ((bsf (point)) + (gain 0) + curcol) + (while (<= (setq curcol (current-column)) fc) + ;; FIXME? `smie-indent-calculate' can (and often will) + ;; return a result that actually depends on the presence/absence + ;; of a newline, so the gain computed here may not be accurate, + ;; but in practice it seems to works well enough. + (let* ((newcol (smie-indent-calculate)) + (newgain (- curcol newcol))) + (when (> newgain gain) + (setq gain newgain) + (setq bsf (point)))) + (smie-indent-forward-token)) + (when (> gain 0) + (setq try-again) + (goto-char bsf) + (newline-and-indent))))) + (t (do-auto-fill)))))) + + (defun smie-setup (grammar rules-function &rest keywords) "Setup SMIE navigation and indentation. GRAMMAR is a grammar table generated by `smie-prec2->grammar'. @@ -1549,6 +1581,7 @@ KEYWORDS are additional arguments, which can use the following keywords: (set (make-local-variable 'smie-rules-function) rules-function) (set (make-local-variable 'smie-grammar) grammar) (set (make-local-variable 'indent-line-function) 'smie-indent-line) + (set (make-local-variable 'normal-auto-fill-function) 'smie-auto-fill) (set (make-local-variable 'forward-sexp-function) 'smie-forward-sexp-command) (while keywords -- cgit v1.2.3 From 2a718f6fbc7c06bed37d0c8441014b90f9c06b0e Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 10 Apr 2012 16:15:08 -0400 Subject: * lisp/emacs-lisp/autoload.el (autoload-make-program): Remove, unused. --- lisp/ChangeLog | 2 ++ lisp/emacs-lisp/autoload.el | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f5b00ded93d..135f01d6268 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2012-04-10 Stefan Monnier + * emacs-lisp/autoload.el (autoload-make-program): Remove, unused. + * international/quail.el: Use dolist and simplify. (quail-define-package, quail-update-keyboard-layout) (quail-define-rules): Use dolist. diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index 5af666b9ded..921b08b10a8 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el @@ -762,9 +762,6 @@ write its autoloads into the specified file instead." (define-obsolete-function-alias 'update-autoloads-from-directories 'update-directory-autoloads "22.1") -(defvar autoload-make-program (or (getenv "MAKE") "make") - "Name of the make program in use during the Emacs build process.") - ;;;###autoload (defun batch-update-autoloads () "Update loaddefs.el autoloads in batch mode. -- cgit v1.2.3 From 050cc68b402f5998193a6026d0eeeecb9d2cb9c4 Mon Sep 17 00:00:00 2001 From: Lennart Borgman Date: Wed, 11 Apr 2012 04:12:20 +0200 Subject: `narrow-to-defun' fixup * emacs-lisp/lisp.el (narrow-to-defun): `beginning-of-defun' goes to previous function when point is on the first character of a function. Take care of that in `narrow-to-defun'. Fixes: debbugs:6157 --- lisp/ChangeLog | 6 ++++++ lisp/emacs-lisp/lisp.el | 16 +++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 37e014751d7..51afe08d9a4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2012-04-11 Lennart Borgman + + * emacs-lisp/lisp.el (narrow-to-defun): `beginning-of-defun' goes + to previous function when point is on the first character of a + function. Take care of that in `narrow-to-defun' (bug#6157). + 2012-04-11 Glenn Morris * vc/vc-bzr.el (vc-bzr-status): Handle all errors, diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index 4efdc3240cd..bcb7fab026b 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -447,7 +447,21 @@ Optional ARG is ignored." ;; Try first in this order for the sake of languages with nested ;; functions where several can end at the same place as with ;; the offside rule, e.g. Python. - (beginning-of-defun) + + ;; Finding the start of the function is a bit problematic since + ;; `beginning-of-defun' when we are on the first character of + ;; the function might go to the previous function. + ;; + ;; Therefore we first move one character forward and then call + ;; `beginning-of-defun'. However now we must check that we did + ;; not move into the next function. + (let ((here (point))) + (unless (eolp) + (forward-char)) + (beginning-of-defun) + (when (< (point) here) + (goto-char here) + (beginning-of-defun))) (setq beg (point)) (end-of-defun) (setq end (point)) -- cgit v1.2.3 From 9c2d6a4ab2911db8c7ac531fe49d038df521f55b Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 14 Apr 2012 08:48:27 -0400 Subject: Avoid the use of ((lambda ...) ...) in lexical-binding code. * emacs-lisp/easy-mmode.el (define-minor-mode): Use funcall. Fixes: debbugs:11241 --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/easy-mmode.el | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4b031a5dfe9..caa11a84442 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-04-14 Stefan Monnier + + Avoid the use of ((lambda ...) ...) in lexical-binding code. + * emacs-lisp/easy-mmode.el (define-minor-mode):Use funcall (bug#11241). + 2012-04-13 Kim F. Storm * emulation/cua-base.el (cua-exchange-point-and-mark): Just call diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index 88698a1f069..0d6716a2e63 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -260,7 +260,7 @@ the mode if ARG is omitted or nil, and toggle it if ARG is `toggle'. ;; repeat-command still does the toggling correctly. (interactive (list (or current-prefix-arg 'toggle))) (let ((,last-message (current-message))) - (,@(if setter (list setter) + (,@(if setter `(funcall #',setter) (list (if (symbolp mode) 'setq 'setf) mode)) (if (eq arg 'toggle) (not ,mode) -- cgit v1.2.3 From c505aaeb00a1c4f01e79f6e82216f83e33a77426 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 16 Apr 2012 11:47:43 +0800 Subject: Call imagemagick-register-types automatically. * lisp/image.el (imagemagick--extension-regexp): New variable. (imagemagick-register-types): Use it. (imagemagick-types-inhibit): Add :set function. Allow new value of t to inhibit all types. * lisp/loadup.el (fboundp): Preload regexp-opt, needed by imagemagick-register-types. * lisp/emacs-lisp/regexp-opt.el (regexp-opt-charset): Avoid cl macros, so we can preload it. --- etc/NEWS | 8 +++++ lisp/ChangeLog | 13 ++++++++ lisp/emacs-lisp/regexp-opt.el | 27 ++++++++--------- lisp/image.el | 69 ++++++++++++++++++++++++++++--------------- lisp/loadup.el | 2 ++ 5 files changed, 80 insertions(+), 39 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/etc/NEWS b/etc/NEWS index 56a0c9bf95d..03ec5405803 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -35,6 +35,14 @@ been adding them there, put them somewhere else, eg site-lisp. ** If your Emacs was built from a bzr checkout, the new variable `emacs-bzr-version' contains information about which bzr revision was used. +** ImageMagick support, if available, is automatically enabled. +It is no longer necessary to call `imagemagick-register-types' +explicitly to install ImageMagick image types; that function is called +automatically when setting `imagemagick-types-inhibit'. + +*** Setting `imagemagick-types-inhibit' to t now disables the use of +ImageMagick to view images, set + * Editing Changes in Emacs 24.2 diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a21d5841346..f50af02a239 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,16 @@ +2012-04-16 Chong Yidong + + * image.el (imagemagick--extension-regexp): New variable. + (imagemagick-register-types): Use it. + (imagemagick-types-inhibit): Add :set function. Allow new value + of t to inhibit all types. + + * emacs-lisp/regexp-opt.el (regexp-opt-charset): Avoid cl macros, + so we can preload it. + + * loadup.el (fboundp): Preload regexp-opt, needed by + imagemagick-register-types. + 2012-04-15 Chong Yidong * frame.el (scrolling): Remove nearly unused customization group. diff --git a/lisp/emacs-lisp/regexp-opt.el b/lisp/emacs-lisp/regexp-opt.el index 6d12fe19277..72e3c398dc0 100644 --- a/lisp/emacs-lisp/regexp-opt.el +++ b/lisp/emacs-lisp/regexp-opt.el @@ -136,9 +136,6 @@ This means the number of non-shy regexp grouping constructs ;;; Workhorse functions. -(eval-when-compile - (require 'cl)) - (defun regexp-opt-group (strings &optional paren lax) "Return a regexp to match a string in the sorted list STRINGS. If PAREN non-nil, output regexp parentheses around returned regexp. @@ -248,15 +245,15 @@ Merges keywords to avoid backtracking in Emacs's regexp matcher." ;; ;; Make a character map but extract character set meta characters. (dolist (char chars) - (case char - (?\] - (setq bracket "]")) - (?^ - (setq caret "^")) - (?- - (setq dash "-")) - (otherwise - (aset charmap char t)))) + (cond + ((eq char ?\]) + (setq bracket "]")) + ((eq char ?^) + (setq caret "^")) + ((eq char ?-) + (setq dash "-")) + (t + (aset charmap char t)))) ;; ;; Make a character set from the map using ranges where applicable. (map-char-table @@ -268,14 +265,14 @@ Merges keywords to avoid backtracking in Emacs's regexp matcher." (setq charset (format "%s%c-%c" charset start end)) (while (>= end start) (setq charset (format "%s%c" charset start)) - (incf start))) + (setq start (1+ start)))) (setq start (car c) end (cdr c))) (if (= (1- c) end) (setq end c) (if (> end (+ start 2)) (setq charset (format "%s%c-%c" charset start end)) (while (>= end start) (setq charset (format "%s%c" charset start)) - (incf start))) + (setq start (1+ start)))) (setq start c end c))))) charmap) (when (>= end start) @@ -283,7 +280,7 @@ Merges keywords to avoid backtracking in Emacs's regexp matcher." (setq charset (format "%s%c-%c" charset start end)) (while (>= end start) (setq charset (format "%s%c" charset start)) - (incf start)))) + (setq start (1+ start))))) ;; ;; Make sure a caret is not first and a dash is first or last. (if (and (string-equal charset "") (string-equal bracket "")) diff --git a/lisp/image.el b/lisp/image.el index b094f2464ec..348c208781e 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -685,26 +685,16 @@ The minimum delay between successive frames is 0.01s." image n count time-elapsed limit)))) -(defcustom imagemagick-types-inhibit - '(C HTML HTM TXT PDF) - "ImageMagick types that should not be visited in Image mode. -This should be a list of symbols, each of which should be one of -the ImageMagick types listed in `imagemagick-types'. These image -types are not registered by `imagemagick-register-types'. - -If Emacs is compiled without ImageMagick support, this variable -has no effect." - :type '(choice (const :tag "Let ImageMagick handle all types it can" nil) - (repeat symbol)) - ;; Ideally, would have a :set function that checks if we already did - ;; imagemagick-register-types, and if so undoes it, then redoes it. - :version "24.1" - :group 'image) +(defvar imagemagick--file-regexp nil + "File extension regexp for ImageMagick files, if any. +This is the extension installed into `auto-mode-alist' and +`image-type-file-name-regexps' by `imagemagick-register-types'.") ;;;###autoload (defun imagemagick-register-types () "Register file types that can be handled by ImageMagick. -This registers the ImageMagick types listed in `imagemagick-types', +This function is called at startup, after loading the init file. +It registers the ImageMagick types listed in `imagemagick-types', excluding those listed in `imagemagick-types-inhibit'. Registered image types are added to `auto-mode-alist', so that @@ -714,14 +704,45 @@ recognizes these files as having image type `imagemagick'. If Emacs is compiled without ImageMagick support, do nothing." (when (fboundp 'imagemagick-types) - (let ((im-types '())) - (dolist (im-type (imagemagick-types)) - (unless (memq im-type imagemagick-types-inhibit) - (push (downcase (symbol-name im-type)) im-types))) - (let ((extension (concat "\\." (regexp-opt im-types) "\\'"))) - (push (cons extension 'image-mode) auto-mode-alist) - (push (cons extension 'imagemagick) - image-type-file-name-regexps))))) + (let ((re (if (eq imagemagick-types-inhibit t) + ;; Use a bogus regexp to inhibit matches. + "\\'a" + (let ((types)) + (dolist (type (imagemagick-types)) + (unless (memq type imagemagick-types-inhibit) + (push (downcase (symbol-name type)) types))) + (concat "\\." (regexp-opt types) "\\'")))) + (ama-elt (car (member (cons imagemagick--file-regexp 'image-mode) + auto-mode-alist))) + (itfnr-elt (car (member (cons imagemagick--file-regexp 'imagemagick) + image-type-file-name-regexps)))) + (if ama-elt + (setcar ama-elt re) + (push (cons re 'image-mode) auto-mode-alist)) + (if itfnr-elt + (setcar itfnr-elt re) + (push (cons re 'imagemagick) image-type-file-name-regexps)) + (setq imagemagick--file-regexp re)))) + +(defcustom imagemagick-types-inhibit + '(C HTML HTM TXT PDF) + "List of ImageMagick types that should not be treated as images. +This should be a list of symbols, each of which should be one of +the ImageMagick types listed in `imagemagick-types'. The listed +image types are not registered by `imagemagick-register-types'. + +If the value is t, inhibit the use of ImageMagick for images. + +If Emacs is compiled without ImageMagick support, this variable +has no effect." + :type '(choice (const :tag "Support all ImageMagick types" nil) + (const :tag "Disable all ImageMagick types" t) + (repeat symbol)) + :set (lambda (symbol value) + (set-default symbol value) + (imagemagick-register-types)) + :version "24.1" + :group 'image) (provide 'image) diff --git a/lisp/loadup.el b/lisp/loadup.el index 2ba24c8fe37..f7ffa27a9ed 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -193,6 +193,8 @@ (if (fboundp 'x-create-frame) (progn (load "fringe") + ;; Needed by `imagemagick-register-types' + (load "emacs-lisp/regexp-opt") (load "image") (load "international/fontset") (load "dnd") -- cgit v1.2.3 From bf350d6a5988d8098f88c39788b50a7a1701918a Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 16 Apr 2012 15:20:42 -0400 Subject: * lisp/emacs-lisp/cl-extra.el (*random-state*): Remove unnecessary declaration. --- lisp/ChangeLog | 3 +++ lisp/emacs-lisp/cl-extra.el | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 49509ae5624..8e85dd3c8c8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-04-16 Glenn Morris + * emacs-lisp/cl-extra.el (*random-state*): + Remove unnecessary declaration. + * calendar/cal-tex.el (cal-tex-end-document): Trivial clarification. * play/cookie1.el (cookie-snarf): diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el index 9ac5ce7d2f0..9a3d8cf705b 100644 --- a/lisp/emacs-lisp/cl-extra.el +++ b/lisp/emacs-lisp/cl-extra.el @@ -1,6 +1,6 @@ ;;; cl-extra.el --- Common Lisp features, part 2 -;; Copyright (C) 1993, 2000-2012 Free Software Foundation, Inc. +;; Copyright (C) 1993, 2000-2012 Free Software Foundation, Inc. ;; Author: Dave Gillespie ;; Keywords: extensions @@ -430,7 +430,6 @@ With two arguments, return rounding and remainder of their quotient." ;; Random numbers. -(defvar *random-state*) ;;;###autoload (defun random* (lim &optional state) "Return a random nonnegative number less than LIM, an integer or float. -- cgit v1.2.3 From 389c3aa7b2d5d4fca9281c5530bb8d307a167bbc Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 16 Apr 2012 15:21:32 -0400 Subject: Header comment trivial fix --- lisp/emacs-lisp/ert-x.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/ert-x.el b/lisp/emacs-lisp/ert-x.el index 257d0528cbc..a7916354c91 100644 --- a/lisp/emacs-lisp/ert-x.el +++ b/lisp/emacs-lisp/ert-x.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2008, 2010-2012 Free Software Foundation, Inc. ;; Author: Lennart Borgman (lennart O borgman A gmail O com) -;; Author: Christian Ohler +;; Christian Ohler ;; This file is part of GNU Emacs. -- cgit v1.2.3 From 099e72021d771b307875f1c4fc6dd1aedd786089 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 16 Apr 2012 15:25:59 -0400 Subject: * eieio-opt.el (describe-class, describe-generic): Autoload trivia. --- lisp/ChangeLog | 3 +++ lisp/emacs-lisp/eieio-opt.el | 6 ++---- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9b136de8961..8f790ab0dc5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-04-16 Glenn Morris + * emacs-lisp/eieio-opt.el (describe-class, describe-generic): + Autoload trivia. + * emacs-lisp/cl-extra.el (*random-state*): Remove unnecessary declaration. diff --git a/lisp/emacs-lisp/eieio-opt.el b/lisp/emacs-lisp/eieio-opt.el index 10816aaa43c..a899839f68a 100644 --- a/lisp/emacs-lisp/eieio-opt.el +++ b/lisp/emacs-lisp/eieio-opt.el @@ -72,8 +72,7 @@ Argument CH-PREFIX is another character prefix to display." ;;; CLASS COMPLETION / DOCUMENTATION -;;;###autoload -(defalias 'describe-class 'eieio-describe-class) +;;;###autoload(defalias 'describe-class 'eieio-describe-class) ;;;###autoload (defun eieio-describe-class (class &optional headerfcn) @@ -305,8 +304,7 @@ are not abstract." ;;; METHOD COMPLETION / DOC (defalias 'describe-method 'eieio-describe-generic) -;;;###autoload -(defalias 'describe-generic 'eieio-describe-generic) +;;;###autoload(defalias 'describe-generic 'eieio-describe-generic) (defalias 'eieio-describe-method 'eieio-describe-generic) ;;;###autoload -- cgit v1.2.3 From d96a4f88299679f64c49f44d94fd61d0548b351e Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 17 Apr 2012 06:21:15 -0400 Subject: Auto-commit of loaddefs files. --- lisp/dired.el | 2 +- lisp/emacs-lisp/cl-loaddefs.el | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/dired.el b/lisp/dired.el index d322752e15f..77fe9cb7614 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -3736,7 +3736,7 @@ Ask means pop up a menu for the user to select one of copy, move or link." ;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command ;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown ;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff -;;;;;; dired-diff) "dired-aux" "dired-aux.el" "58d623eb8e68e472e6164a1bcae83360") +;;;;;; dired-diff) "dired-aux" "dired-aux.el" "de7e4c64718c8ba8438a6397a460bf23") ;;; Generated autoloads from dired-aux.el (autoload 'dired-diff "dired-aux" "\ diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el index 5bb86628bb8..9e0099bb649 100644 --- a/lisp/emacs-lisp/cl-loaddefs.el +++ b/lisp/emacs-lisp/cl-loaddefs.el @@ -10,7 +10,7 @@ ;;;;;; ceiling* floor* isqrt lcm gcd cl-progv-before cl-set-frame-visible-p ;;;;;; cl-map-overlays cl-map-intervals cl-map-keymap-recursively ;;;;;; notevery notany every some mapcon mapcan mapl maplist map -;;;;;; cl-mapcar-many equalp coerce) "cl-extra" "cl-extra.el" "c172dda6770ce18b556561481bfefbb2") +;;;;;; cl-mapcar-many equalp coerce) "cl-extra" "cl-extra.el" "5a8a7f7ec2dc453113b8cbda577f2acb") ;;; Generated autoloads from cl-extra.el (autoload 'coerce "cl-extra" "\ -- cgit v1.2.3 From 2c070447bfad37262d292fe130db7db22da822fb Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 17 Apr 2012 23:07:21 +0800 Subject: * emacs-lisp/tabulated-list.el (tabulated-list-print): Fix typos. --- lisp/ChangeLog | 4 ++++ lisp/emacs-lisp/tabulated-list.el | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 06a794a79fb..026b99872f0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-04-17 Chong Yidong + + * emacs-lisp/tabulated-list.el (tabulated-list-print): Fix typos. + 2012-04-16 Alan Mackenzie Ensure searching for keywords is case sensitive. diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el index f17b12da6a0..9439fba2b86 100644 --- a/lisp/emacs-lisp/tabulated-list.el +++ b/lisp/emacs-lisp/tabulated-list.el @@ -215,7 +215,7 @@ buffer and inserts the entries with `tabulated-list-printer'. Optional argument REMEMBER-POS, if non-nil, means to move point to the entry with the same ID element as the current line." (let ((inhibit-read-only t) - (entries (if (functionp 'tabulated-list-entries) + (entries (if (functionp tabulated-list-entries) (funcall tabulated-list-entries) tabulated-list-entries)) entry-id saved-pt saved-col) @@ -246,7 +246,7 @@ to the entry with the same ID element as the current line." (setq entries (sort entries sorter)) (if (cdr tabulated-list-sort-key) (setq entries (nreverse entries))) - (unless (functionp 'tabulated-list-entries) + (unless (functionp tabulated-list-entries) (setq tabulated-list-entries entries))))) ;; Print the resulting list. (dolist (elt entries) -- cgit v1.2.3 From 4d6769e1bb5109e9cec202350d5252234970d525 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Thu, 19 Apr 2012 19:20:26 +0200 Subject: 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. --- lisp/ChangeLog | 73 +++++++++++++++++++++++++++++++++++++----- lisp/avoid.el | 3 +- lisp/emacs-lisp/authors.el | 7 ++--- lisp/emacs-lisp/avl-tree.el | 2 +- lisp/emacs-lisp/package.el | 15 +++++---- lisp/emacs-lisp/smie.el | 4 +-- lisp/emulation/cua-rect.el | 77 ++++++++++++++++++++++----------------------- lisp/imenu.el | 45 +++----------------------- lisp/mail/rmail.el | 3 ++ lisp/mail/sendmail.el | 3 +- lisp/mail/unrmail.el | 3 +- lisp/mouse.el | 3 +- lisp/net/dbus.el | 4 +-- lisp/net/tls.el | 3 +- lisp/nxml/nxml-mode.el | 13 ++++---- lisp/subr.el | 3 +- lisp/textmodes/picture.el | 3 +- lisp/tutorial.el | 3 +- 18 files changed, 138 insertions(+), 129 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 434e1a7f85f..9ad019328d6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,61 @@ +2012-04-19 Juanma Barranquero + + * 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 * net/tramp.el (tramp-action-password): Let-bind @@ -180,7 +238,7 @@ 2012-04-15 Stefan Monnier 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 @@ -392,7 +450,7 @@ 2012-04-11 Wolfgang Jenkner (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 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 @@ -1993,11 +2051,10 @@ 2012-02-06 Lars Ingebrigtsen - * 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 diff --git a/lisp/avoid.el b/lisp/avoid.el index eb8a4ad23a2..bfe15de0ca2 100644 --- a/lisp/avoid.el +++ b/lisp/avoid.el @@ -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)) diff --git a/lisp/emacs-lisp/authors.el b/lisp/emacs-lisp/authors.el index 6f2c6f73eca..a7f8dad54ed 100644 --- a/lisp/emacs-lisp/authors.el +++ b/lisp/emacs-lisp/authors.el @@ -1,4 +1,4 @@ -;;; 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) diff --git a/lisp/emacs-lisp/avl-tree.el b/lisp/emacs-lisp/avl-tree.el index 9f348767478..1f00677cd00 100644 --- a/lisp/emacs-lisp/avl-tree.el +++ b/lisp/emacs-lisp/avl-tree.el @@ -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) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 5b158eb994f..4b868f72899 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -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") diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el index 5382e601e67..cafa1942a09 100644 --- a/lisp/emacs-lisp/smie.el +++ b/lisp/emacs-lisp/smie.el @@ -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)))))) diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el index e3aade760dc..4286afba938 100644 --- a/lisp/emulation/cua-rect.el +++ b/lisp/emulation/cua-rect.el @@ -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) diff --git a/lisp/imenu.el b/lisp/imenu.el index 08e6338b39e..ceea9420c4c 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el @@ -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. diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 12d1e0c6c36..d2b9890805c 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -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.") diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el index 0b0f2795610..cd3862985bd 100644 --- a/lisp/mail/sendmail.el +++ b/lisp/mail/sendmail.el @@ -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. diff --git a/lisp/mail/unrmail.el b/lisp/mail/unrmail.el index af16bbf8c73..bf7b9abe2c1 100644 --- a/lisp/mail/unrmail.el +++ b/lisp/mail/unrmail.el @@ -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. diff --git a/lisp/mouse.el b/lisp/mouse.el index 3344bbec2cc..8e08f89f22c 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -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)) diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el index feef78a305f..e3144a53fab 100644 --- a/lisp/net/dbus.el +++ b/lisp/net/dbus.el @@ -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 diff --git a/lisp/net/tls.el b/lisp/net/tls.el index d232095444b..75d178e3225 100644 --- a/lisp/net/tls.el +++ b/lisp/net/tls.el @@ -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 diff --git a/lisp/nxml/nxml-mode.el b/lisp/nxml/nxml-mode.el index f9122e7245e..5adafc3845c 100644 --- a/lisp/nxml/nxml-mode.el +++ b/lisp/nxml/nxml-mode.el @@ -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) (if (< (point) value-start) @@ -1753,7 +1752,7 @@ single name. A character reference contains a character number." xmltok-name-end) (t end))) -(defun nxml-scan-backward-within (end) +(defun nxml-scan-backward-within (_end) (setq xmltok-start (+ xmltok-start (nxml-start-delimiter-length xmltok-type))) @@ -2263,7 +2262,7 @@ ENDP is t in the former case, nil in the latter." 'nxml-in-mixed-content-hook)) nil) ;; See if the matching tag does not start or end a line. - ((condition-case err + ((condition-case nil (progn (setq matching-tag-pos (xmltok-save @@ -2401,7 +2400,7 @@ Repeating \\[nxml-dynamic-markup-word] immediately after successful \\[nxml-dynamic-markup-word] removes the previously inserted markup and attempts to find another possible way to do the markup." (interactive "*") - (let (search-start-pos done) + (let (search-start-pos) (if (and (integerp nxml-dynamic-markup-prev-pos) (= nxml-dynamic-markup-prev-pos (point)) (eq last-command this-command) diff --git a/lisp/subr.el b/lisp/subr.el index 0cd00995f45..ff93cd22210 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -678,7 +678,6 @@ Subkeymaps may be modified but are not canonicalized." ;; Process the bindings starting from the end. (dolist (binding (prog1 bindings (setq bindings ()))) (let* ((key (car binding)) - (item (cdr binding)) (oldbind (assq key bindings))) (push (if (not oldbind) ;; The normal case: no duplicate bindings. @@ -2121,7 +2120,7 @@ by doing (clear-string STRING)." ;; Turn off electricity. (set (make-local-variable 'post-self-insert-hook) nil) (add-hook 'after-change-functions - (lambda (beg end len) + (lambda (beg end _len) (clear-this-command-keys) (setq beg (min end (max (minibuffer-prompt-end) beg))) diff --git a/lisp/textmodes/picture.el b/lisp/textmodes/picture.el index 3e2ab7892da..191e9f3672b 100644 --- a/lisp/textmodes/picture.el +++ b/lisp/textmodes/picture.el @@ -242,8 +242,7 @@ Use \"\\[command-apropos] picture-movement\" to see commands which control motio (spacing (when (display-graphic-p frame) (or (with-current-buffer (window-buffer window) line-spacing) - (frame-parameter frame 'line-spacing)))) - rows cols) + (frame-parameter frame 'line-spacing))))) (cond ((floatp spacing) (setq spacing (truncate (* spacing char-ht)))) ((null spacing) diff --git a/lisp/tutorial.el b/lisp/tutorial.el index b512700f5b9..e0e2a82fab9 100644 --- a/lisp/tutorial.el +++ b/lisp/tutorial.el @@ -585,7 +585,6 @@ with some explanatory links." (not (get-text-property (match-beginning 1) 'tutorial-remark)) (let* ((desc (car changed-key)) (ck (cdr changed-key)) - (key (nth 0 ck)) (def-fun (nth 1 ck)) (where (nth 3 ck)) s1 s2 help-string) @@ -724,7 +723,7 @@ See `tutorial--save-tutorial' for more information." saved-file (error-message-string err)))) ;; An error is raised here?? Is this a bug? - (condition-case err + (condition-case nil (undo-only) (error nil)) ;; Restore point -- cgit v1.2.3 From 539aa513944b1e780a7981f63a0cdf8d86f2303c Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 20 Apr 2012 08:47:55 +0300 Subject: Doc fixes for emacs-bzr-* facilities. lisp/version.el (emacs-bzr-version, emacs-bzr-get-version): Doc fixes. --- lisp/ChangeLog | 4 ++++ lisp/emacs-lisp/eieio.el | 4 +--- lisp/version.el | 8 +++++--- 3 files changed, 10 insertions(+), 6 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d89818e836e..5529db59a0c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-04-20 Eli Zaretskii + + * version.el (emacs-bzr-version, emacs-bzr-get-version): Doc fixes. + 2012-04-19 Stefan Monnier * electric.el (electric-indent-post-self-insert-function): Check that diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el index f1c1bf8965c..768eba58ee1 100644 --- a/lisp/emacs-lisp/eieio.el +++ b/lisp/emacs-lisp/eieio.el @@ -3051,7 +3051,7 @@ Optional argument GROUP is the sub-group of slots to display. ;;;### (autoloads (eieio-help-mode-augmentation-maybee eieio-describe-generic ;;;;;; eieio-describe-constructor eieio-describe-class eieio-browse) -;;;;;; "eieio-opt" "eieio-opt.el" "e2814881441ad23759409687502f0ee1") +;;;;;; "eieio-opt" "eieio-opt.el" "d808328f9c0156ecbd412d77ba8c569e") ;;; Generated autoloads from eieio-opt.el (autoload 'eieio-browse "eieio-opt" "\ @@ -3060,7 +3060,6 @@ If optional ROOT-CLASS, then start with that, otherwise start with variable `eieio-default-superclass'. \(fn &optional ROOT-CLASS)" t nil) - (defalias 'describe-class 'eieio-describe-class) (autoload 'eieio-describe-class "eieio-opt" "\ @@ -3075,7 +3074,6 @@ Describe the constructor function FCN. Uses `eieio-describe-class' to describe the class being constructed. \(fn FCN)" t nil) - (defalias 'describe-generic 'eieio-describe-generic) (autoload 'eieio-describe-generic "eieio-opt" "\ diff --git a/lisp/version.el b/lisp/version.el index 56e19147b2c..38be0e7fd57 100644 --- a/lisp/version.el +++ b/lisp/version.el @@ -81,13 +81,15 @@ to the system configuration; look at `system-configuration' instead." ;; Set during dumping, this is a defvar so that it can be setq'd. (defvar emacs-bzr-version nil "\ -String giving the bzr revision number from which this Emacs was built. -This is nil if Emacs was not built from a bzr checkout, or if we could +String giving the bzr revision from which this Emacs was built. +Value is the bzr revision number and a revision ID separated by a blank. +Value is nil if Emacs was not built from a bzr checkout, or if we could not determine the revision.") (defun emacs-bzr-get-version (&optional dir) "\ Try to return as a string the bzr revision number of the Emacs sources. -Returns nil if the sources do not seem to be under bzr, or if we could +Value is the bzr revision number and a revision ID separated by a blank. +Value is nil if the sources do not seem to be under bzr, or if we could not determine the revision. Note that this reports on the current state of the sources, which may not correspond to the running Emacs. -- cgit v1.2.3