commit a9973a3c164060bde08a717b46023a3bf68909c8 (HEAD, refs/remotes/origin/master) Author: Alex Date: Fri Nov 18 11:02:55 2016 +0200 Extend 'indent-relative' when its arg is non-nil * lisp/indent.el (indent-relative-maybe): New obsolete alias. (indent-relative-first-indent-point): Renamed from 'indent-relative-maybe'. (indent-relative): Now accepts an additional optional argument. The first argument was renamed to FIRST-ONLY. Doc fix. Support the additional arg. (Bug#24766) diff --git a/lisp/indent.el b/lisp/indent.el index 0f6c68d..952a05a 100644 --- a/lisp/indent.el +++ b/lisp/indent.el @@ -559,26 +559,32 @@ column to indent to; if it is nil, use one of the three methods above." ;; by hand. (setq deactivate-mark t)) -(defun indent-relative-maybe () - "Indent a new line like previous nonblank line. -If the previous nonblank line has no indent points beyond the -column point starts at, this command does nothing. +(define-obsolete-function-alias 'indent-relative-maybe + 'indent-relative-first-indent-point "26.1") + +(defun indent-relative-first-indent-point () + "Indent the current line like the previous nonblank line. +Indent to the first indentation position in the previous nonblank +line if that position is greater than the current column. See also `indent-relative'." (interactive) (indent-relative t)) -(defun indent-relative (&optional unindented-ok) +(defun indent-relative (&optional first-only unindented-ok) "Space out to under next indent point in previous nonblank line. An indent point is a non-whitespace character following whitespace. The following line shows the indentation points in this line. ^ ^ ^ ^ ^ ^ ^ ^ ^ +If FIRST-ONLY is non-nil, then only the first indent point is +considered. + If the previous nonblank line has no indent points beyond the -column point starts at, `tab-to-tab-stop' is done instead, unless -this command is invoked with a numeric argument, in which case it -does nothing. +column point starts at, then `tab-to-tab-stop' is done, if both +FIRST-ONLY and UNINDENTED-OK are nil, otherwise nothing is done +in this case. -See also `indent-relative-maybe'." +See also `indent-relative-first-indent-point'." (interactive "P") (if (and abbrev-mode (eq (char-syntax (preceding-char)) ?w)) @@ -594,17 +600,18 @@ See also `indent-relative-maybe'." (if (> (current-column) start-column) (backward-char 1)) (or (looking-at "[ \t]") - unindented-ok + first-only (skip-chars-forward "^ \t" end)) (skip-chars-forward " \t" end) (or (= (point) end) (setq indent (current-column)))))) - (if indent - (let ((opoint (point-marker))) - (indent-to indent 0) - (if (> opoint (point)) - (goto-char opoint)) - (move-marker opoint nil)) - (tab-to-tab-stop)))) + (cond (indent + (let ((opoint (point-marker))) + (indent-to indent 0) + (if (> opoint (point)) + (goto-char opoint)) + (move-marker opoint nil))) + (unindented-ok nil) + (t (tab-to-tab-stop))))) (defcustom tab-stop-list nil "List of tab stop positions used by `tab-to-tab-stop'. commit 67df076793773c6226b8c08c435109aeb2e7a0d3 Author: Glenn Morris Date: Thu Nov 17 22:50:40 2016 -0800 ; Replace "25.2" with "26.1" where appropriate, which is almost everywhere Ref: http://lists.gnu.org/archive/html/emacs-devel/2016-09/msg00692.html http://lists.gnu.org/archive/html/emacs-devel/2016-01/msg01215.html diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index c7b6106..3d3122a 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -528,7 +528,7 @@ It also processes local variables specified in the file text. @deffn Command normal-mode &optional find-file This function establishes the proper major mode and buffer-local variable bindings for the current buffer. It calls -@code{set-auto-mode} (see below). As from Emacs 25.2, it no longer +@code{set-auto-mode} (see below). As of Emacs 26.1, it no longer runs @code{hack-local-variables}, this now being done in @code{run-mode-hooks} at the initialization of major modes (@pxref{Mode Hooks}). diff --git a/lisp/allout.el b/lisp/allout.el index 3a7b6e6..f47213d 100644 --- a/lisp/allout.el +++ b/lisp/allout.el @@ -1242,7 +1242,7 @@ Also refresh various data structures that hinge on the regexp." "[^" allout-primary-bullet "]")) "\\)" )))) -(define-obsolete-function-alias 'set-allout-regexp 'allout-set-regexp "25.2") +(define-obsolete-function-alias 'set-allout-regexp 'allout-set-regexp "26.1") ;;;_ : Menu bar (defvar allout-mode-exposure-menu) (defvar allout-mode-editing-menu) diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el index 20ad372..a1d946e 100644 --- a/lisp/calendar/time-date.el +++ b/lisp/calendar/time-date.el @@ -191,7 +191,7 @@ TIME should be either a time value or a date-time string." (time-subtract nil time)) ;;;###autoload -(define-obsolete-function-alias 'subtract-time 'time-subtract "25.2") +(define-obsolete-function-alias 'subtract-time 'time-subtract "26.1") ;;;###autoload (defun date-to-day (date) diff --git a/lisp/calendar/timeclock.el b/lisp/calendar/timeclock.el index f1f48e9..3d9e246 100644 --- a/lisp/calendar/timeclock.el +++ b/lisp/calendar/timeclock.el @@ -532,9 +532,9 @@ non-nil, the amount returned will be relative to past time worked." (message "%s" string) string))) -(define-obsolete-function-alias 'timeclock-time-to-seconds 'float-time "25.2") +(define-obsolete-function-alias 'timeclock-time-to-seconds 'float-time "26.1") (define-obsolete-function-alias 'timeclock-seconds-to-time 'seconds-to-time - "25.2") + "26.1") ;; Should today-only be removed in favor of timeclock-relative? - gm (defsubst timeclock-when-to-leave (&optional today-only) diff --git a/lisp/cus-start.el b/lisp/cus-start.el index b7cc626..08dfbdf 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el @@ -315,7 +315,7 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of (const :tag "Always" t) (repeat (symbol :tag "Parameter"))) "25.1") - (tooltip-reuse-hidden-frame tooltip boolean "25.2") + (tooltip-reuse-hidden-frame tooltip boolean "26.1") ;; fringe.c (overflow-newline-into-fringe fringe boolean) ;; image.c diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el index 80ac8ef..fd77654 100644 --- a/lisp/emacs-lisp/eieio.el +++ b/lisp/emacs-lisp/eieio.el @@ -679,7 +679,7 @@ This class is not stored in the `parent' slot of a class vector." (setq eieio-default-superclass (cl--find-class 'eieio-default-superclass)) (define-obsolete-function-alias 'standard-class - 'eieio-default-superclass "25.2") + 'eieio-default-superclass "26.1") (cl-defgeneric make-instance (class &rest initargs) "Make a new instance of CLASS based on INITARGS. @@ -815,7 +815,7 @@ first and modify the returned object.") (cl-defgeneric destructor (_this &rest _params) "Destructor for cleaning up any dynamic links to our object." - (declare (obsolete nil "25.2")) + (declare (obsolete nil "26.1")) ;; No cleanup... yet. nil) @@ -938,7 +938,7 @@ this object." This may create or delete slots, but does not affect the return value of `eq'." (error "EIEIO: `change-class' is unimplemented")) -(define-obsolete-function-alias 'change-class 'eieio-change-class "25.2") +(define-obsolete-function-alias 'change-class 'eieio-change-class "26.1") ;; Hook ourselves into help system for describing classes and methods. ;; FIXME: This is not actually needed any more since we can click on the diff --git a/lisp/gnus/gmm-utils.el b/lisp/gnus/gmm-utils.el index 7aa5279..61ef001 100644 --- a/lisp/gnus/gmm-utils.el +++ b/lisp/gnus/gmm-utils.el @@ -257,7 +257,7 @@ If mode is nil, use `major-mode' of the current buffer." (match-string 1 mode)))))) (define-obsolete-function-alias 'gmm-format-time-string 'format-time-string - "25.2") + "26.1") (provide 'gmm-utils) diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index b6ef433..7eb4462 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -81,7 +81,7 @@ If LITERAL is non-nil, insert NEWTEXT literally. Return a new string containing the replacements. This is a compatibility function for different Emacsen." - (declare (obsolete replace-regexp-in-string "25.2")) + (declare (obsolete replace-regexp-in-string "26.1")) (replace-regexp-in-string regexp newtext string nil literal)) (defun gnus-boundp (variable) diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 52eaff3..448ba7b 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -1353,7 +1353,7 @@ If nil, you might be asked to input the charset." :type 'symbol) (make-obsolete-variable 'message-default-charset - "The default charset comes from the language environment" "25.2") + "The default charset comes from the language environment" "26.1") (defcustom message-dont-reply-to-names mail-dont-reply-to-names "Addresses to prune when doing wide replies. diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el index adf2fda..59ab791 100644 --- a/lisp/gnus/mm-util.el +++ b/lisp/gnus/mm-util.el @@ -757,7 +757,7 @@ If INHIBIT is non-nil, inhibit `mm-inhibit-file-name-handlers'." (write-region start end filename append visit lockname))) (defalias 'mm-make-temp-file 'make-temp-file) -(define-obsolete-function-alias 'mm-make-temp-file 'make-temp-file "25.2") +(define-obsolete-function-alias 'mm-make-temp-file 'make-temp-file "26.1") (defvar mm-image-load-path-cache nil) diff --git a/lisp/net/network-stream.el b/lisp/net/network-stream.el index 50991fd..657672d 100644 --- a/lisp/net/network-stream.el +++ b/lisp/net/network-stream.el @@ -204,7 +204,7 @@ gnutls-boot (as returned by `gnutls-boot-parameters')." ;;;###autoload (defalias 'open-protocol-stream 'open-network-stream) (define-obsolete-function-alias 'open-protocol-stream 'open-network-stream - "25.2") + "26.1") (defun network-stream-open-plain (name buffer host service parameters) (let ((start (with-current-buffer buffer (point))) diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index d64de0f..66e6326 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -611,7 +611,7 @@ If ARG is non-nil, instead prompt for connection parameters." `(with-current-buffer rcirc-server-buffer ,@body)) -(define-obsolete-function-alias 'rcirc-float-time 'float-time "25.2") +(define-obsolete-function-alias 'rcirc-float-time 'float-time "26.1") (defun rcirc-prompt-for-encryption (server-plist) "Prompt the user for the encryption method to use. diff --git a/lisp/nxml/nxml-mode.el b/lisp/nxml/nxml-mode.el index 0b9975f..8c249d5 100644 --- a/lisp/nxml/nxml-mode.el +++ b/lisp/nxml/nxml-mode.el @@ -1500,7 +1500,7 @@ of the line. This expects the xmltok-* variables to be set up as by (t (back-to-indentation))) (current-column)) -(define-obsolete-function-alias 'nxml-complete #'completion-at-point "25.2") +(define-obsolete-function-alias 'nxml-complete #'completion-at-point "26.1") ;;; Movement diff --git a/lisp/obsolete/messcompat.el b/lisp/obsolete/messcompat.el index 5f50692..faebcc8 100644 --- a/lisp/obsolete/messcompat.el +++ b/lisp/obsolete/messcompat.el @@ -4,7 +4,7 @@ ;; Author: Lars Magne Ingebrigtsen ;; Keywords: mail, news -;; Obsolete-since: 25.2 +;; Obsolete-since: 26.1 ;; This file is part of GNU Emacs. diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el index 2e35c09..912ec5a 100644 --- a/lisp/org/org-compat.el +++ b/lisp/org/org-compat.el @@ -409,9 +409,9 @@ Pass BUFFER to the XEmacs version of `move-to-column'." (when focus-follows-mouse (set-mouse-position frame (1- (frame-width frame)) 0))))) -(define-obsolete-function-alias 'org-float-time 'float-time "25.2") +(define-obsolete-function-alias 'org-float-time 'float-time "26.1") -;; `user-error' is only available from 24.2.50 on +;; `user-error' is only available from 24.3 on (unless (fboundp 'user-error) (defalias 'user-error 'error)) diff --git a/lisp/subr.el b/lisp/subr.el index b23f605..eb9ab98 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1295,10 +1295,10 @@ be a list of the form returned by `event-start' and `event-end'." (make-obsolete 'buffer-has-markers-at nil "24.3") ;; bug#23850 -(make-obsolete 'string-to-unibyte "use `encode-coding-string'." "25.2") -(make-obsolete 'string-as-unibyte "use `encode-coding-string'." "25.2") -(make-obsolete 'string-to-multibyte "use `decode-coding-string'." "25.2") -(make-obsolete 'string-as-multibyte "use `decode-coding-string'." "25.2") +(make-obsolete 'string-to-unibyte "use `encode-coding-string'." "26.1") +(make-obsolete 'string-as-unibyte "use `encode-coding-string'." "26.1") +(make-obsolete 'string-to-multibyte "use `decode-coding-string'." "26.1") +(make-obsolete 'string-as-multibyte "use `decode-coding-string'." "26.1") (defun log10 (x) "Return (log X 10), the log base 10 of X." diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el index ddf8d3c..49809fa 100644 --- a/lisp/textmodes/rst.el +++ b/lisp/textmodes/rst.el @@ -277,7 +277,7 @@ in parentheses follows the development revision and the time stamp.") ("1.4.0" . "24.3") ("1.4.1" . "24.5") ("1.4.2" . "24.5") - ("1.5.0" . "25.2") + ("1.5.0" . "26.1") )) (unless (assoc rst-official-version rst-package-emacs-version-alist) diff --git a/lisp/vc/add-log.el b/lisp/vc/add-log.el index 7124df0..ba710b2 100644 --- a/lisp/vc/add-log.el +++ b/lisp/vc/add-log.el @@ -579,7 +579,7 @@ If a string, interpret as the ZONE argument of `format-time-string'.") (lambda (x) (or (booleanp x) (stringp x)))) (defun add-log-iso8601-time-zone (&optional time zone) - (declare (obsolete nil "25.2")) + (declare (obsolete nil "26.1")) (format-time-string "%:::z" time zone)) (defvar add-log-iso8601-with-time-zone nil) diff --git a/lisp/vc/emerge.el b/lisp/vc/emerge.el index 058b15c..9c25ec4 100644 --- a/lisp/vc/emerge.el +++ b/lisp/vc/emerge.el @@ -3177,7 +3177,7 @@ See also `auto-save-file-name-p'." "Obsolete, emerge now uses `shell-quote-argument'." :type 'regexp :group 'emerge) -(make-obsolete-variable 'emerge-metachars nil "25.2") +(make-obsolete-variable 'emerge-metachars nil "26.1") (provide 'emerge) diff --git a/lisp/vc/smerge-mode.el b/lisp/vc/smerge-mode.el index 5198624..1a7dece 100644 --- a/lisp/vc/smerge-mode.el +++ b/lisp/vc/smerge-mode.el @@ -82,7 +82,7 @@ Used in `smerge-diff-base-upper' and related functions." (((class color)) :foreground "red")) "Face for the `upper' version of a conflict.") -(define-obsolete-face-alias 'smerge-mine 'smerge-upper "25.2") +(define-obsolete-face-alias 'smerge-mine 'smerge-upper "26.1") (defvar smerge-upper-face 'smerge-upper) (defface smerge-lower @@ -93,7 +93,7 @@ Used in `smerge-diff-base-upper' and related functions." (((class color)) :foreground "green")) "Face for the `lower' version of a conflict.") -(define-obsolete-face-alias 'smerge-other 'smerge-lower "25.2") +(define-obsolete-face-alias 'smerge-other 'smerge-lower "26.1") (defvar smerge-lower-face 'smerge-lower) (defface smerge-base @@ -702,7 +702,7 @@ this keeps \"LLL\"." (smerge-keep-n 3) (smerge-auto-leave)) -(define-obsolete-function-alias 'smerge-keep-other 'smerge-keep-lower "25.2") +(define-obsolete-function-alias 'smerge-keep-other 'smerge-keep-lower "26.1") (defun smerge-keep-upper () "Keep the \"upper\" version of a merge conflict. @@ -719,7 +719,7 @@ this keeps \"UUU\"." (smerge-keep-n 1) (smerge-auto-leave)) -(define-obsolete-function-alias 'smerge-keep-mine 'smerge-keep-upper "25.2") +(define-obsolete-function-alias 'smerge-keep-mine 'smerge-keep-upper "26.1") (defun smerge-get-current () (let ((i 3)) @@ -760,7 +760,7 @@ this keeps \"UUU\"." (smerge-diff 2 1)) (define-obsolete-function-alias 'smerge-diff-base-mine - 'smerge-diff-base-upper "25.2") + 'smerge-diff-base-upper "26.1") (defun smerge-diff-base-lower () "Diff `base' and `lower' version in current conflict region." @@ -768,7 +768,7 @@ this keeps \"UUU\"." (smerge-diff 2 3)) (define-obsolete-function-alias 'smerge-diff-base-other - 'smerge-diff-base-lower "25.2") + 'smerge-diff-base-lower "26.1") (defun smerge-diff-upper-lower () "Diff `upper' and `lower' version in current conflict region." @@ -776,7 +776,7 @@ this keeps \"UUU\"." (smerge-diff 1 3)) (define-obsolete-function-alias 'smerge-diff-mine-other - 'smerge-diff-upper-lower "25.2") + 'smerge-diff-upper-lower "26.1") (defun smerge-match-conflict () "Get info about the conflict. Puts the info in the `match-data'. diff --git a/lisp/w32-fns.el b/lisp/w32-fns.el index 3c524e7..91c0253 100644 --- a/lisp/w32-fns.el +++ b/lisp/w32-fns.el @@ -143,7 +143,7 @@ You should set this to t when using a non-system shell.\n\n")))) '(undecided-dos . undecided-dos) '(raw-text-dos . raw-text-dos))))) (define-obsolete-function-alias 'set-default-process-coding-system - #'w32-set-default-process-coding-system "25.2") + #'w32-set-default-process-coding-system "26.1") (add-hook 'before-init-hook #'w32-set-default-process-coding-system) @@ -235,7 +235,7 @@ This function is provided for backward compatibility, since (check-coding-system coding-system) (setq locale-coding-system coding-system)) (define-obsolete-function-alias 'set-w32-system-coding-system - #'w32-set-system-coding-system "25.2") + #'w32-set-system-coding-system "26.1") ;; locale-coding-system was introduced to do the same thing as ;; w32-system-coding-system. Use that instead. diff --git a/lisp/widget.el b/lisp/widget.el index 54507cd..1574fb2 100644 --- a/lisp/widget.el +++ b/lisp/widget.el @@ -91,7 +91,7 @@ The third argument DOC is a documentation string for the widget." name) ;; This is used by external widget code (in W3, at least). -(define-obsolete-function-alias 'widget-plist-member #'plist-member "25.2") +(define-obsolete-function-alias 'widget-plist-member #'plist-member "26.1") ;;; The End. diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 4c3b83c..d88dbce 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -1937,7 +1937,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (ignore-errors (delete-file tmp-name1)) (ignore-errors (delete-directory tmp-name2 'recursive))))) -;; The functions have been introduced in Emacs 25.2. +;; The functions were introduced in Emacs 26.1. (ert-deftest tramp-test32-make-nearby-temp-file () "Check `make-nearby-temp-file' and `temporary-file-directory'." (skip-unless (tramp--test-enabled)) commit 03c00f716ff7d30c400995e42d7702ed2ba1a07d Author: Dmitry Gutov Date: Fri Nov 18 02:12:02 2016 +0200 Add example for bug#24854 * test/manual/indent/js.js: Add example for bug#24854. diff --git a/test/manual/indent/js.js b/test/manual/indent/js.js index b40d47b..806e949 100644 --- a/test/manual/indent/js.js +++ b/test/manual/indent/js.js @@ -69,6 +69,9 @@ a++ b += c +var re = /some value/ +str.match(re) + baz(`http://foo.bar/${tee}`) .qux(); commit 922426da38f18590228637b74043408656c2dd4d Author: Mark Oteiza Date: Thu Nov 17 18:27:38 2016 -0500 Port registry.el the rest of the way to cl-lib This file already is using cl-lib functions at runtime; eieio ultimately loads cl-lib, which explains why doing so wasn't an issue. * lisp/registry.el: Require cl-lib. (registry-db, registry--match, registry-search, registry-delete): (registry-insert, registry-reindex): Replace cl macros with cl-lib ones. (registry-collect-prune-candidates): Replace cl function with cl-lib one. diff --git a/lisp/registry.el b/lisp/registry.el index 3aaa8e8..20f8e8d 100644 --- a/lisp/registry.el +++ b/lisp/registry.el @@ -78,8 +78,7 @@ ;;; Code: -(eval-when-compile (require 'cl)) - +(require 'cl-lib) (require 'eieio) (require 'eieio-base) @@ -171,9 +170,9 @@ Returns an alist of the key followed by the entry in a list, not a cons cell." Returns an alist of the key followed by the entry in a list, not a cons cell." (let ((data (oref db data))) (delq nil - (loop for key in keys - when (gethash key data) - collect (list key (gethash key data)))))) + (cl-loop for key in keys + when (gethash key data) + collect (list key (gethash key data)))))) (cl-defmethod registry-lookup-secondary ((db registry-db) tracksym &optional create) @@ -207,7 +206,7 @@ When SET is not nil, set it for VAL (use t for an empty list)." (vals (cdr-safe (nth 0 check-list))) found) (while (and key vals (not found)) - (setq found (case mode + (setq found (cl-case mode (:member (member (car-safe vals) (cdr-safe (assoc key entry)))) (:regex @@ -230,16 +229,16 @@ The test order is to check :all first, then :member, then :regex." (let ((all (plist-get spec :all)) (member (plist-get spec :member)) (regex (plist-get spec :regex))) - (loop for k being the hash-keys of (oref db data) - using (hash-values v) - when (or - ;; :all non-nil returns all - all - ;; member matching - (and member (registry--match :member v member)) - ;; regex matching - (and regex (registry--match :regex v regex))) - collect k)))) + (cl-loop for k being the hash-keys of (oref db data) + using (hash-values v) + when (or + ;; :all non-nil returns all + all + ;; member matching + (and member (registry--match :member v member)) + ;; regex matching + (and regex (registry--match :regex v regex))) + collect k)))) (cl-defmethod registry-delete ((db registry-db) keys assert &rest spec) "Delete KEYS from the registry-db THIS. @@ -254,8 +253,7 @@ With assert non-nil, errors out if the key does not exist already." (dolist (key keys) (let ((entry (gethash key data))) (when assert - (assert entry nil - "Key %s does not exist in database" key)) + (cl-assert entry nil "Key %s does not exist in database" key)) ;; clean entry from the secondary indices (dolist (tr tracked) ;; is this tracked symbol indexed? @@ -288,13 +286,10 @@ This is the key count of the `data' slot." "Insert ENTRY under KEY into the registry-db THIS. Updates the secondary ('tracked') indices as well. Errors out if the key exists already." - - (assert (not (gethash key (oref db data))) nil - "Key already exists in database") - - (assert (not (registry-full db)) - nil - "registry max-size limit reached") + (cl-assert (not (gethash key (oref db data))) nil + "Key already exists in database") + (cl-assert (not (registry-full db)) nil + "registry max-size limit reached") ;; store the entry (puthash key entry (oref db data)) @@ -304,7 +299,7 @@ Errors out if the key exists already." ;; for every value in the entry under that key... (dolist (val (cdr-safe (assq tr entry))) (let* ((value-keys (registry-lookup-secondary-value db tr val))) - (pushnew key value-keys :test 'equal) + (cl-pushnew key value-keys :test 'equal) (registry-lookup-secondary-value db tr val value-keys)))) entry) @@ -316,7 +311,7 @@ Errors out if the key exists already." (let (values) (maphash (lambda (key v) - (incf count) + (cl-incf count) (when (and (< 0 expected) (= 0 (mod count 1000))) (message "reindexing: %d of %d (%.2f%%)" @@ -367,7 +362,7 @@ entries first and return candidates from beginning of list." (data (oref db data)) (candidates (cl-loop for k being the hash-keys of data using (hash-values v) - when (notany precious-p v) + when (cl-notany precious-p v) collect (cons k v)))) ;; We want the full entries for sorting, but should only return a ;; list of entry keys. commit 5b003caa21bb840e3aad1bfc37d941db2b253918 Author: Mark Oteiza Date: Thu Nov 17 17:58:20 2016 -0500 Fix arglist in python.el (Bug#24762) * lisp/progmodes/python.el: Remove unneeded second args. (python-define-auxiliary-skeleton): DOC arg should be &optional. diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index f9b28c3..9cd9cc8 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -4040,7 +4040,7 @@ be added to `python-mode-skeleton-abbrev-table'." "Abbrev table for Python mode." :parents (list python-mode-skeleton-abbrev-table)) -(defmacro python-define-auxiliary-skeleton (name doc &optional &rest skel) +(defmacro python-define-auxiliary-skeleton (name &optional doc &rest skel) "Define a `python-mode' auxiliary skeleton using NAME DOC and SKEL. The skeleton will be bound to python-skeleton-NAME." (declare (indent 2)) @@ -4060,11 +4060,11 @@ The skeleton will be bound to python-skeleton-NAME." (signal 'quit t)) ,@skel))) -(python-define-auxiliary-skeleton else nil) +(python-define-auxiliary-skeleton else) -(python-define-auxiliary-skeleton except nil) +(python-define-auxiliary-skeleton except) -(python-define-auxiliary-skeleton finally nil) +(python-define-auxiliary-skeleton finally) (python-skeleton-define if nil "Condition: " commit edda93cfb1a1da27adbda6bf43d826e492a135e5 Author: Simen Heggestøyl Date: Thu Nov 17 19:19:59 2016 +0100 Add tests for rot13.el * lisp/rot13.el (rot13): Docstring correction. * test/lisp/rot13-tests.el: New file with tests for rot13.el. diff --git a/lisp/rot13.el b/lisp/rot13.el index ee4f51d..5572547 100644 --- a/lisp/rot13.el +++ b/lisp/rot13.el @@ -63,7 +63,10 @@ ;;;###autoload (defun rot13 (object &optional start end) - "Return ROT13 encryption of OBJECT, a buffer or string." + "ROT13 encrypt OBJECT, a buffer or string. +If OBJECT is a buffer, encrypt the region between START and END. +If OBJECT is a string, encrypt it in its entirety, ignoring START +and END, and return the encrypted string." (if (bufferp object) (with-current-buffer object (rot13-region start end)) diff --git a/test/lisp/rot13-tests.el b/test/lisp/rot13-tests.el new file mode 100644 index 0000000..a31dc50 --- /dev/null +++ b/test/lisp/rot13-tests.el @@ -0,0 +1,54 @@ +;;; rot13-tests.el --- Tests for rot13.el -*- lexical-binding: t; -*- + +;; Copyright (C) 2016 Free Software Foundation, Inc. + +;; Author: Simen Heggestøyl +;; Keywords: + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;; + +;;; Code: + +(require 'ert) +(require 'rot13) + +(ert-deftest rot13-tests-rot13 () + (should (equal (rot13 "Super-secret text") "Fhcre-frperg grkg")) + (with-temp-buffer + (insert "Super-secret text") + (rot13 (current-buffer) (point-min) (point-max)) + (should (equal (buffer-string) "Fhcre-frperg grkg")) + (rot13 (current-buffer) (point-min) (+ (point-min) 5)) + (should (equal (buffer-string) "Super-frperg grkg")))) + +(ert-deftest rot13-tests-rot13-string () + (should (equal (rot13-string "") "")) + (should (equal (rot13-string (rot13-string "foo")) "foo")) + (should (equal (rot13-string "Super-secret text") + "Fhcre-frperg grkg"))) + +(ert-deftest rot13-tests-rot13-region () + (with-temp-buffer + (insert "Super-secret text") + (rot13-region (+ (point-min) 6) (+ (point-min) 12)) + (should (equal (buffer-string) "Super-frperg text")))) + +(provide 'rot13-tests) +;;; rot13-tests.el ends here commit 6653bb45d3697c9372cc77773c49f52399740b51 Author: Michael Albinus Date: Thu Nov 17 12:38:58 2016 +0100 Fix Bug#24947 (Tramp + ido) * lisp/ido.el (ido-read-internal): Prevent eager Tramp connection. * lisp/net/tramp.el (tramp-handle-file-name-case-insensitive-p): Run remote tests only if a connection is established only. (Bug#24947) diff --git a/lisp/ido.el b/lisp/ido.el index 0e74cbc..9df89c9 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -1882,6 +1882,7 @@ If INITIAL is non-nil, it specifies the initial input string." ido-selected ido-final-text (done nil) + (non-essential t) ;; prevent eager Tramp connection (icomplete-mode nil) ;; prevent icomplete starting up ;; Exported dynamic variables: ido-cur-list diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index b0391ec..e9697ff 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -2905,35 +2905,39 @@ User is always nil." (or ;; Maybe there is a default value. (tramp-get-method-parameter v 'tramp-case-insensitive) - ;; There isn't. So we must check. - (with-tramp-connection-property v "case-insensitive" - ;; The idea is to compare a file with lower case letters with - ;; the same file with upper case letters. - (let ((candidate (directory-file-name filename)) - tmpfile) - ;; Check, whether we find an existing file with lower case - ;; letters. This avoids us to create a temporary file. - (while (and (string-match "[a-z]" (file-remote-p candidate 'localname)) - (not (file-exists-p candidate))) - (setq candidate - (directory-file-name (file-name-directory candidate)))) - ;; Nothing found, so we must use a temporary file for - ;; comparision. `make-nearby-temp-file' is added to Emacs - ;; 26+ like `file-name-case-insensitive-p', so there is no - ;; compatibility problem calling it. - (unless (string-match "[a-z]" (file-remote-p candidate 'localname)) - (setq tmpfile - (let ((default-directory (file-name-directory filename))) - (tramp-compat-funcall 'make-nearby-temp-file "tramp.")) - candidate tmpfile)) - ;; Check for the existence of the same file with upper case letters. - (unwind-protect - (file-exists-p - (concat - (file-remote-p candidate) - (upcase (file-remote-p candidate 'localname)))) - ;; Cleanup. - (when tmpfile (delete-file tmpfile)))))))) + ;; There isn't. So we must check, in case there's a connection already. + (and (tramp-connectable-p filename) + (with-tramp-connection-property v "case-insensitive" + ;; The idea is to compare a file with lower case letters + ;; with the same file with upper case letters. + (let ((candidate (directory-file-name filename)) + tmpfile) + ;; Check, whether we find an existing file with lower case + ;; letters. This avoids us to create a temporary file. + (while (and (string-match + "[a-z]" (file-remote-p candidate 'localname)) + (not (file-exists-p candidate))) + (setq candidate + (directory-file-name (file-name-directory candidate)))) + ;; Nothing found, so we must use a temporary file for + ;; comparision. `make-nearby-temp-file' is added to + ;; Emacs 26+ like `file-name-case-insensitive-p', so + ;; there is no compatibility problem calling it. + (unless + (string-match "[a-z]" (file-remote-p candidate 'localname)) + (setq tmpfile + (let ((default-directory (file-name-directory filename))) + (tramp-compat-funcall 'make-nearby-temp-file "tramp.")) + candidate tmpfile)) + ;; Check for the existence of the same file with upper + ;; case letters. + (unwind-protect + (file-exists-p + (concat + (file-remote-p candidate) + (upcase (file-remote-p candidate 'localname)))) + ;; Cleanup. + (when tmpfile (delete-file tmpfile))))))))) (defun tramp-handle-file-name-completion (filename directory &optional predicate)