commit 375c70fd9ef024f1a8ac99604e89c9991ac69eea (HEAD, refs/remotes/origin/master) Author: Juanma Barranquero Date: Sat Jan 28 04:40:36 2017 +0100 test/*.el: Avoid byte-compiler warnings * test/lisp/abbrev-tests.el (abbrev-table-p-test): Remove unused 'let*'. * test/lisp/faces-tests.el (faces--test): New customization group. (faces--test1, faces--test2): Use it. * test/lisp/ffap-tests.el (ffap-tests-25243): Call 'mark-whole-buffer' interactively. * test/lisp/ibuffer-tests.el (ibuffer-filter-groups, ibuffer-filtering-alist) (ibuffer-filtering-qualifiers, ibuffer-save-with-custom) (ibuffer-saved-filter-groups, ibuffer-saved-filters): Defvar. (ibuffer-format-qualifier, ibuffer-unary-operand): Declare. * test/lisp/minibuffer-tests.el (completion-test1): Mark unused lexical arguments. * test/lisp/simple-tests.el (simple-test--dummy-buffer): Wrap result in 'with-no-warnings' to avoid them when the macro is invoked for effect. * test/lisp/emacs-lisp/cl-seq-tests.el (cl-seq-count-test): Mark unused lexical arguments. * test/lisp/emacs-lisp/let-alist-tests.el (let-alist-surface-test): Mark unused lexical arguments. (let-alist-cons): Remove unused let binding. * test/lisp/net/dbus-tests.el (dbus-debug): Defvar. (dbus-get-unique-name): Declare. * test/lisp/progmodes/python-tests.el (python-bob-infloop-avoid): Call 'font-lock-fontify-buffer' interactively. * test/lisp/textmodes/tildify-tests.el (tildify-space-undo-test--test): Mark unused lexical argument. diff --git a/test/lisp/abbrev-tests.el b/test/lisp/abbrev-tests.el index a454471ae3..1ffcd6ac0d 100644 --- a/test/lisp/abbrev-tests.el +++ b/test/lisp/abbrev-tests.el @@ -45,8 +45,7 @@ (should-not (abbrev-table-p [])) ;; Missing :abbrev-table-modiff counter: (should-not (abbrev-table-p (obarray-make))) - (let* ((table (obarray-make))) - (should (abbrev-table-empty-p (make-abbrev-table))))) + (should (abbrev-table-empty-p (make-abbrev-table)))) (ert-deftest abbrev-make-abbrev-table-test () ;; Table without properties: diff --git a/test/lisp/emacs-lisp/cl-seq-tests.el b/test/lisp/emacs-lisp/cl-seq-tests.el index 3740b5c183..61e3d72033 100644 --- a/test/lisp/emacs-lisp/cl-seq-tests.el +++ b/test/lisp/emacs-lisp/cl-seq-tests.el @@ -250,9 +250,9 @@ Body are forms defining the test." (should (= 0 (cl-count -5 list))) (should (= 0 (cl-count 2 list :start 2 :end 4))) (should (= 4 (cl-count 'foo list :key (lambda (x) (and (cl-evenp x) 'foo))))) - (should (= 4 (cl-count 'foo list :test (lambda (a b) (cl-evenp b))))) - (should (equal (cl-count 'foo list :test (lambda (a b) (cl-oddp b))) - (cl-count 'foo list :test-not (lambda (a b) (cl-evenp b))))))) + (should (= 4 (cl-count 'foo list :test (lambda (_a b) (cl-evenp b))))) + (should (equal (cl-count 'foo list :test (lambda (_a b) (cl-oddp b))) + (cl-count 'foo list :test-not (lambda (_a b) (cl-evenp b))))))) ;; keywords supported: :test :test-not :key :start1 :end1 :start2 :end2 :from-end (ert-deftest cl-seq-mismatch-test () diff --git a/test/lisp/emacs-lisp/let-alist-tests.el b/test/lisp/emacs-lisp/let-alist-tests.el index fbcde4e3cb..d04645709e 100644 --- a/test/lisp/emacs-lisp/let-alist-tests.el +++ b/test/lisp/emacs-lisp/let-alist-tests.el @@ -31,7 +31,7 @@ (.test-two (cdr (assq 'test-two symbol)))) (list .test-one .test-two .test-two .test-two))) - (cl-letf (((symbol-function #'make-symbol) (lambda (x) 'symbol))) + (cl-letf (((symbol-function #'make-symbol) (lambda (_x) 'symbol))) (macroexpand '(let-alist data (list .test-one .test-two .test-two .test-two)))))) @@ -51,8 +51,7 @@ (ert-deftest let-alist-cons () (should (equal - (let ((.external "ext") - (.external.too "et")) + (let ((.external "ext")) (let-alist '((test-two . 0) (test-three . 1) (sublist . ((foo . 2) diff --git a/test/lisp/faces-tests.el b/test/lisp/faces-tests.el index a30ba25f8f..2b3456d47f 100644 --- a/test/lisp/faces-tests.el +++ b/test/lisp/faces-tests.el @@ -23,13 +23,18 @@ (require 'ert) (require 'faces) +(defgroup faces--test nil "" + :group 'faces--test) + (defface faces--test1 '((t :background "black" :foreground "black")) - "") + "" + :group 'faces--test) (defface faces--test2 '((t :box 1)) - "") + "" + :group 'faces--test) (ert-deftest faces--test-color-at-point () (with-temp-buffer diff --git a/test/lisp/ffap-tests.el b/test/lisp/ffap-tests.el index a3fe350246..827d751be6 100644 --- a/test/lisp/ffap-tests.el +++ b/test/lisp/ffap-tests.el @@ -44,7 +44,7 @@ index 3d7cebadcf..ad4b70d737 100644 str (make-string ffap-max-region-length #xa) (format "%s ENDS HERE" file))) - (mark-whole-buffer) + (call-interactively 'mark-whole-buffer) (should (equal "" (ffap-string-at-point))) (should (equal '(1 1) ffap-string-at-point-region))))) (and (file-exists-p file) (delete-file file))))) diff --git a/test/lisp/ibuffer-tests.el b/test/lisp/ibuffer-tests.el index fb632e2073..b9f7fe7cde 100644 --- a/test/lisp/ibuffer-tests.el +++ b/test/lisp/ibuffer-tests.el @@ -23,6 +23,15 @@ (eval-when-compile (require 'ibuf-macs)) +(defvar ibuffer-filter-groups) +(defvar ibuffer-filtering-alist) +(defvar ibuffer-filtering-qualifiers) +(defvar ibuffer-save-with-custom) +(defvar ibuffer-saved-filter-groups) +(defvar ibuffer-saved-filters) +(declare-function ibuffer-format-qualifier "ibuf-ext" (qualifier)) +(declare-function ibuffer-unary-operand "ibuf-ext" (filter)) + (ert-deftest ibuffer-autoload () "Tests to see whether ibuffer has been autoloaded" (skip-unless (not (featurep 'ibuf-ext))) diff --git a/test/lisp/minibuffer-tests.el b/test/lisp/minibuffer-tests.el index efed8f8bed..7c5fcb4838 100644 --- a/test/lisp/minibuffer-tests.el +++ b/test/lisp/minibuffer-tests.el @@ -28,7 +28,7 @@ (ert-deftest completion-test1 () (with-temp-buffer - (cl-flet* ((test/completion-table (string pred action) + (cl-flet* ((test/completion-table (_string _pred action) (if (eq action 'lambda) nil "test: ")) diff --git a/test/lisp/net/dbus-tests.el b/test/lisp/net/dbus-tests.el index 525709b92e..0a59e3b42d 100644 --- a/test/lisp/net/dbus-tests.el +++ b/test/lisp/net/dbus-tests.el @@ -22,7 +22,8 @@ (require 'ert) (require 'dbus) -(setq dbus-debug nil) +(defvar dbus-debug nil) +(declare-function dbus-get-unique-name "dbusbind.c" (bus)) (defvar dbus--test-enabled-session-bus (and (featurep 'dbusbind) diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index 158c52f080..1e6b867d30 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el @@ -2478,7 +2478,7 @@ if x: (python-tests-with-temp-buffer " \"\n" (goto-char (point-min)) - (font-lock-fontify-buffer))) + (call-interactively 'font-lock-fontify-buffer))) ;;; Shell integration diff --git a/test/lisp/simple-tests.el b/test/lisp/simple-tests.el index 6194cada1c..f4849c4b21 100644 --- a/test/lisp/simple-tests.el +++ b/test/lisp/simple-tests.el @@ -30,8 +30,9 @@ (insert "(a b") (save-excursion (insert " c d)")) ,@body - (cons (buffer-substring (point-min) (point)) - (buffer-substring (point) (point-max))))) + (with-no-warnings + (cons (buffer-substring (point-min) (point)) + (buffer-substring (point) (point-max)))))) (defmacro simple-test--transpositions (&rest body) @@ -266,7 +267,6 @@ (with-temp-buffer (setq buffer-undo-list nil) (insert "hello") - (car buffer-undo-list) (undo-auto--boundaries 'test)))) ;;; Transposition with negative args (bug#20698, bug#21885) diff --git a/test/lisp/textmodes/tildify-tests.el b/test/lisp/textmodes/tildify-tests.el index 0a82b2521f..f958fbc547 100644 --- a/test/lisp/textmodes/tildify-tests.el +++ b/test/lisp/textmodes/tildify-tests.el @@ -226,7 +226,7 @@ The function must terminate as soon as callback returns nil." (defun tildify-space-undo-test--test - (modes nbsp env-open &optional set-space-string) + (modes nbsp _env-open &optional set-space-string) (with-temp-buffer (setq-local buffer-file-coding-system 'utf-8) (dolist (mode modes) commit 3979d8f45784ccf80cebbb5007da054a87ded2c9 Author: Eli Zaretskii Date: Fri Jan 27 21:58:10 2017 +0200 Restore a test that was removed by a recent commit * src/fileio.c (Ffile_accessible_directory_p): Don't overwrite the errno value unless it's necessary. (Bug#25419) diff --git a/src/fileio.c b/src/fileio.c index b8706e1e89..81eaa77118 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -2823,7 +2823,8 @@ really is a readable and searchable directory. */) avoids reporting "Success" for a failed operation. Perhaps someday we can fix this in a better way, by improving file-accessible-directory-p's API; see Bug#25419. */ - errno = EACCES; + if (!EQ (r, Qt)) + errno = EACCES; return r; } commit 2d07895151138fe4ddc87aa799687b41f6868c73 Author: Mark Oteiza Date: Fri Jan 27 13:09:01 2017 -0500 Fix a couple eww customization types * lisp/new/eww.el (eww-download-directory, eww-bookmarks-directory): Change customization type to "directory". diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 15911f6e85..0282fe68e6 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -59,7 +59,7 @@ "Directory where files will downloaded." :version "24.4" :group 'eww - :type 'string) + :type 'directory) ;;;###autoload (defcustom eww-suggest-uris @@ -81,7 +81,7 @@ duplicate entries (if any) removed." "Directory where bookmark files will be stored." :version "25.1" :group 'eww - :type 'string) + :type 'directory) (defcustom eww-desktop-remove-duplicates t "Whether to remove duplicates from the history when saving desktop data. commit 107a0c4caa649bad88cdbb67439f67ed8105e41a Author: Philipp Stephani Date: Tue Jan 17 18:24:29 2017 +0100 Don't require a shell when loading htmlfontify * lisp/htmlfontify.el (hfy-which-etags): Don't call a shell for detecting the etags version (Bug#25468). * test/lisp/htmlfontify-tests.el (htmlfontify-bug25468): Add unit test. diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el index 21aac1ab21..74393ffbae 100644 --- a/lisp/htmlfontify.el +++ b/lisp/htmlfontify.el @@ -365,9 +365,15 @@ commands in `hfy-etags-cmd-alist'." (defun hfy-which-etags () "Return a string indicating which flavor of etags we are using." - (let ((v (shell-command-to-string (concat hfy-etags-bin " --version")))) - (cond ((string-match "exube" v) "exuberant ctags") - ((string-match "GNU E" v) "emacs etags" )) )) + (with-temp-buffer + (condition-case nil + (when (eq (call-process hfy-etags-bin nil t nil "--version") 0) + (goto-char (point-min)) + (cond + ((looking-at-p "exube") "exuberant ctags") + ((looking-at-p "GNU E") "emacs etags"))) + ;; Return nil if the etags binary isn't executable (Bug#25468). + (file-error nil)))) (defcustom hfy-etags-cmd ;; We used to wrap this in a `eval-and-compile', but: diff --git a/test/lisp/htmlfontify-tests.el b/test/lisp/htmlfontify-tests.el index 15eb7c170c..4a1d566e96 100644 --- a/test/lisp/htmlfontify-tests.el +++ b/test/lisp/htmlfontify-tests.el @@ -30,5 +30,17 @@ (symbol-function 'htmlfontify-load-rgb-file)))) +(ert-deftest htmlfontify-bug25468 () + "Tests that htmlfontify can be loaded even if no shell is +available (Bug#25468)." + (should (equal (let ((process-environment + (cons "SHELL=/does/not/exist" process-environment))) + (call-process + (expand-file-name (invocation-name) (invocation-directory)) + nil nil nil + "--quick" "--batch" + (concat "--load=" (locate-library "htmlfontify")))) + 0))) + (provide 'htmlfontify-tests) ;; htmlfontify-tests.el ends here commit 412b8dac5277092e677b3cd57b0fd1a36893a26b Author: Paul Eggert Date: Fri Jan 27 08:56:34 2017 -0800 Slightly tune file-accessible-directory-p fix * src/fileio.c (Ffile_accessible_directory_p): Remove unnecessary test (Bug#25419). diff --git a/src/fileio.c b/src/fileio.c index 8e549a4485..b8706e1e89 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -2816,13 +2816,15 @@ really is a readable and searchable directory. */) { Lisp_Object r = call2 (handler, Qfile_accessible_directory_p, absname); - /* This might be a lie (e.g., the directory might not exist, or - be a regular file), but at least it does TRT in the "usual" - case of an existing directory that is not accessible by the - current user, and avoids reporting "Success" for a failed - operation. */ - if (!EQ (r, Qt)) - errno = EACCES; + /* Set errno in case the handler failed. EACCES might be a lie + (e.g., the directory might not exist, or be a regular file), + but at least it does TRT in the "usual" case of an existing + directory that is not accessible by the current user, and + avoids reporting "Success" for a failed operation. Perhaps + someday we can fix this in a better way, by improving + file-accessible-directory-p's API; see Bug#25419. */ + errno = EACCES; + return r; } commit 21d661d5f7e2dd59b6d427f94faf5cc281ecf719 Author: Arash Esbati Date: Thu Jan 26 20:25:16 2017 +0100 Add \citetitle to biblatex cite format * lisp/textmodes/reftex-vars.el (reftex-cite-format-builtin): Add \citetitle[*] to `reftex-cite-format' and bind them to keys i/I per user request http://lists.gnu.org/archive/html/auctex/2017-01/msg00049.html. diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el index 63abd048e9..03da584e96 100644 --- a/lisp/textmodes/reftex-vars.el +++ b/lisp/textmodes/reftex-vars.el @@ -164,6 +164,8 @@ distribution. Mixed-case symbols are convenience aliases.") (?U . "\\autocite*[][]{%l}") (?a . "\\citeauthor{%l}") (?A . "\\citeauthor*{%l}") + (?i . "\\citetitle{%l}") + (?I . "\\citetitle*{%l}") (?y . "\\citeyear{%l}") (?Y . "\\citeyear*{%l}") (?n . "\\nocite{%l}"))) commit 03c1080cd4c9b45fc9b7467e156085d4fce446a4 Author: Lars Ingebrigtsen Date: Fri Jan 27 13:53:47 2017 +0100 Fix charsets and encodings from non-file MIME parts * lisp/gnus/mml.el (mml-generate-mime-1): Get the charsets and encoding right for parts that do not originate from files. diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el index a0ca624909..3a31349d37 100644 --- a/lisp/gnus/mml.el +++ b/lisp/gnus/mml.el @@ -612,25 +612,32 @@ be \"related\" or \"alternate\"." (with-temp-buffer (set-buffer-multibyte nil) ;; First insert the data into the buffer. - (cond - ((cdr (assq 'buffer cont)) - (insert-buffer-substring (cdr (assq 'buffer cont)))) - ((and filename - (not (equal (cdr (assq 'nofile cont)) "yes"))) - (mm-insert-file-contents filename)) - ((eq 'mml (car cont)) - (insert (cdr (assq 'contents cont)))) - (t - (save-restriction - (narrow-to-region (point) (point)) - (insert (cdr (assq 'contents cont))) - ;; Remove quotes from quoted tags. - (goto-char (point-min)) - (while (re-search-forward - "<#!+/?\\(part\\|multipart\\|external\\|mml\\|secure\\)" - nil t) - (delete-region (+ (match-beginning 0) 2) - (+ (match-beginning 0) 3)))))) + (if (and filename + (not (equal (cdr (assq 'nofile cont)) "yes"))) + (mm-insert-file-contents filename) + (insert + (with-temp-buffer + (cond + ((cdr (assq 'buffer cont)) + (insert-buffer-substring (cdr (assq 'buffer cont)))) + ((eq 'mml (car cont)) + (insert (cdr (assq 'contents cont)))) + (t + (insert (cdr (assq 'contents cont))) + ;; Remove quotes from quoted tags. + (goto-char (point-min)) + (while (re-search-forward + "<#!+/?\\(part\\|multipart\\|external\\|mml\\|secure\\)" + nil t) + (delete-region (+ (match-beginning 0) 2) + (+ (match-beginning 0) 3))))) + (setq charset + (mm-coding-system-to-mime-charset + (detect-coding-region + (point-min) (point-max) t))) + (encode-coding-region (point-min) (point-max) + charset) + (buffer-string)))) (cond ((eq (car cont) 'mml) (let ((mml-boundary (mml-compute-boundary cont)) commit 90c76346740c097063b4a273ceb3af01327ff2a4 Author: Eli Zaretskii Date: Fri Jan 27 12:27:50 2017 +0200 Fix 'describe-variable' for longish variable values * lisp/help-fns.el (describe-variable): Don't accidentally remove the last character of a variable's value. (Bug#25545) diff --git a/lisp/help-fns.el b/lisp/help-fns.el index edbcd9099d..742c66919a 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -852,7 +852,7 @@ it is displayed along with the global value." (terpri) (pp val) ;; Remove trailing newline. - (delete-char -1)) + (and (= (char-before) ?\n) (delete-char -1))) (let* ((sv (get variable 'standard-value)) (origval (and (consp sv) (condition-case nil