commit 06a796398646fd1a5e17bc7321e12ae8e061e7f7 (HEAD, refs/remotes/origin/master) Author: Stefan Monnier Date: Sat Mar 18 22:32:23 2017 -0400 Remove unused vars in cl-extra.el and tramp.el. * lisp/emacs-lisp/cl-extra.el (cl--print-table): Remove unused vars. * lisp/net/tramp.el (tramp-dissect-file-name): Remove unused `match'. (outline-regexp, ls-lisp-use-insert-directory-program): Declare. (tramp-find-foreign-file-name-handler): Mark unused arg, remove unused `v`. diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el index 8b3d6eecf5..021ef23274 100644 --- a/lisp/emacs-lisp/cl-extra.el +++ b/lisp/emacs-lisp/cl-extra.el @@ -877,16 +877,14 @@ including `cl-block' and `cl-eval-when'." (if (> newwidth curwidth) (setf (aref cols i) newwidth))))) (let ((formats '()) - (tmp-head header) (col 0)) (dotimes (i (length cols)) - (let ((head (pop tmp-head))) - (push (concat (propertize " " - 'display - `(space :align-to ,(+ col col-space))) - "%s") - formats) - (cl-incf col (+ col-space (aref cols i))))) + (push (concat (propertize " " + 'display + `(space :align-to ,(+ col col-space))) + "%s") + formats) + (cl-incf col (+ col-space (aref cols i)))) (let ((format (mapconcat #'identity (nreverse formats) ""))) (insert (apply #'format format (mapcar (lambda (str) (propertize str 'face 'italic)) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 969092f517..fdd4661dec 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1237,7 +1237,8 @@ values." (save-match-data (unless (tramp-tramp-file-p name) (tramp-compat-user-error nil "Not a Tramp file name: \"%s\"" name)) - (let ((match (string-match (nth 0 tramp-file-name-structure) name))) + (if (not (string-match (nth 0 tramp-file-name-structure) name)) + (error "`tramp-file-name-structure' didn't match!") (let ((method (match-string (nth 1 tramp-file-name-structure) name)) (user (match-string (nth 2 tramp-file-name-structure) name)) (host (match-string (nth 3 tramp-file-name-structure) name)) @@ -1373,6 +1374,8 @@ Point must be at the beginning of a header line. The outline level is equal to the verbosity of the Tramp message." (1+ (string-to-number (match-string 1)))) +(defvar outline-regexp) + (defun tramp-get-debug-buffer (vec) "Get the debug buffer for VEC." (with-current-buffer @@ -1969,11 +1972,10 @@ ARGS are the arguments OPERATION has been called with." ;; Unknown file primitive. (t (error "unknown file I/O primitive: %s" operation)))) -(defun tramp-find-foreign-file-name-handler (filename &optional operation) +(defun tramp-find-foreign-file-name-handler (filename &optional _operation) "Return foreign file name handler if exists." (when (tramp-tramp-file-p filename) - (let ((v (tramp-dissect-file-name filename t)) - (handler tramp-foreign-file-name-handler-alist) + (let ((handler tramp-foreign-file-name-handler-alist) elt res) (while handler (setq elt (car handler) @@ -2953,6 +2955,8 @@ User is always nil." backup-directory-alist))) (tramp-run-real-handler 'find-backup-file-name (list filename))))) +(defvar ls-lisp-use-insert-directory-program) + (defun tramp-handle-insert-directory (filename switches &optional wildcard full-directory-p) "Like `insert-directory' for Tramp files." commit 32bb5a945a47b14fa85dc1c2f1776b6baa3b0dcc Author: Stefan Monnier Date: Sat Mar 18 21:24:39 2017 -0400 Improve describe-symbol's layout of slots when describing types * lisp/emacs-lisp/cl-extra.el (cl--print-table): New function. (cl--describe-class-slots): Use it. diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el index 8cba913710..8b3d6eecf5 100644 --- a/lisp/emacs-lisp/cl-extra.el +++ b/lisp/emacs-lisp/cl-extra.el @@ -865,6 +865,40 @@ including `cl-block' and `cl-eval-when'." "\n"))) "\n")) +(defun cl--print-table (header rows) + ;; FIXME: Isn't this functionality already implemented elsewhere? + (let ((cols (apply #'vector (mapcar #'string-width header))) + (col-space 2)) + (dolist (row rows) + (dotimes (i (length cols)) + (let* ((x (pop row)) + (curwidth (aref cols i)) + (newwidth (if x (string-width x) 0))) + (if (> newwidth curwidth) + (setf (aref cols i) newwidth))))) + (let ((formats '()) + (tmp-head header) + (col 0)) + (dotimes (i (length cols)) + (let ((head (pop tmp-head))) + (push (concat (propertize " " + 'display + `(space :align-to ,(+ col col-space))) + "%s") + formats) + (cl-incf col (+ col-space (aref cols i))))) + (let ((format (mapconcat #'identity (nreverse formats) ""))) + (insert (apply #'format format + (mapcar (lambda (str) (propertize str 'face 'italic)) + header)) + "\n") + (insert (apply #'format format + (mapcar (lambda (str) (make-string (string-width str) ?—)) + header)) + "\n") + (dolist (row rows) + (insert (apply #'format format row) "\n")))))) + (defun cl--describe-class-slots (class) "Print help description for the slots in CLASS. Outputs to the current buffer." @@ -877,7 +911,22 @@ Outputs to the current buffer." (cl-struct-unknown-slot nil)))) (insert (propertize "Instance Allocated Slots:\n\n" 'face 'bold)) - (mapc #'cl--describe-class-slot slots) + (let* ((has-doc nil) + (slots-strings + (mapcar + (lambda (slot) + (list (cl-prin1-to-string (cl--slot-descriptor-name slot)) + (cl-prin1-to-string (cl--slot-descriptor-type slot)) + (cl-prin1-to-string (cl--slot-descriptor-initform slot)) + (let ((doc (alist-get :documentation + (cl--slot-descriptor-props slot)))) + (if (not doc) "" + (setq has-doc t) + (substitute-command-keys doc))))) + slots))) + (cl--print-table `("Name" "Type" "Default" . ,(if has-doc '("Doc"))) + slots-strings)) + (insert "\n") (when (> (length cslots) 0) (insert (propertize "\nClass Allocated Slots:\n\n" 'face 'bold)) (mapc #'cl--describe-class-slot cslots)))) commit e0eb1af55f7b6d0b41e6f0180438f8317628894b Author: Michael Albinus Date: Sat Mar 18 17:44:27 2017 +0100 Fix Bug#26156 * lisp/net/tramp.el (tramp-completion-file-name-handler-alist): : Remove handler. (Bug#26156) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index aadf09e48f..969092f517 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1052,7 +1052,7 @@ means to use always cached values for the directory contents." ;;;###autoload (defconst tramp-completion-file-name-handler-alist - '((expand-file-name . tramp-completion-handle-expand-file-name) + '(;(expand-file-name . tramp-completion-handle-expand-file-name) (file-name-all-completions . tramp-completion-handle-file-name-all-completions) (file-name-completion . tramp-completion-handle-file-name-completion)) commit cfb5f7e6ac3c8236a97b75fe87de585bd1f45075 Author: Stefan Monnier Date: Sat Mar 18 12:29:12 2017 -0400 * lisp/obarray.el (obarray-size): Avoid compiler warning. diff --git a/lisp/obarray.el b/lisp/obarray.el index a463185992..b1160ebea4 100644 --- a/lisp/obarray.el +++ b/lisp/obarray.el @@ -37,9 +37,9 @@ (make-vector size 0) (signal 'wrong-type-argument '(size 0))))) -(defun obarray-size (obarray) - "Return the number of slots of OBARRAY." - (length obarray)) +(defun obarray-size (ob) + "Return the number of slots of obarray OB." + (length ob)) (defun obarrayp (object) "Return t if OBJECT is an obarray." commit 12f8cfdcaed29d1feb2a43fd7c2b7dfbf4b010cf Author: Eli Zaretskii Date: Sat Mar 18 11:26:50 2017 +0200 Fix last change in lib/Makefile.in * lib/Makefile.in (srcdir): Define, as including $(srcdir)/../nt/gnulib-cfg.mk needs that. diff --git a/lib/Makefile.in b/lib/Makefile.in index bef5a8cb5a..4e51ac6b02 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -17,6 +17,7 @@ # You should have received a copy of the GNU General Public License # along with GNU Emacs. If not, see . +srcdir = @srcdir@ VPATH = @srcdir@ # Variables substituted by 'configure', and not autogenerated in gnulib.mk,