Now on revision 113111. ------------------------------------------------------------ revno: 113111 committer: Leo Liu branch nick: trunk timestamp: Fri 2013-06-21 14:45:37 +0800 message: * progmodes/octave.el (octave-mode): Backward compatibility fix. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-21 06:37:44 +0000 +++ lisp/ChangeLog 2013-06-21 06:45:37 +0000 @@ -1,3 +1,7 @@ +2013-06-21 Leo Liu + + * progmodes/octave.el (octave-mode): Backward compatibility fix. + 2013-06-21 Glenn Morris * font-lock.el (lisp-font-lock-keywords-2): Add with-eval-after-load. === modified file 'lisp/progmodes/octave.el' --- lisp/progmodes/octave.el 2013-06-19 02:02:30 +0000 +++ lisp/progmodes/octave.el 2013-06-21 06:45:37 +0000 @@ -554,8 +554,13 @@ (setq-local fill-nobreak-predicate (lambda () (eq (octave-in-string-p) ?'))) - (add-function :around (local 'comment-line-break-function) - #'octave--indent-new-comment-line) + (with-no-warnings + (if (fboundp 'add-function) ; new in 24.4 + (add-function :around (local 'comment-line-break-function) + #'octave--indent-new-comment-line) + (setq-local comment-line-break-function + (apply-partially #'octave--indent-new-comment-line + #'comment-indent-new-line)))) (setq font-lock-defaults '(octave-font-lock-keywords)) @@ -1151,8 +1156,6 @@ ;;; Indentation (defun octave-indent-new-comment-line (&optional soft) - ;; FIXME: C-M-j should probably be bound globally to a function like - ;; this one. "Break Octave line at point, continuing comment if within one. Insert `octave-continuation-string' before breaking the line unless inside a list. Signal an error if within a single-quoted ------------------------------------------------------------ revno: 113110 committer: Glenn Morris branch nick: trunk timestamp: Thu 2013-06-20 23:37:44 -0700 message: * lisp/font-lock.el (lisp-font-lock-keywords-2): Add with-eval-after-load. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-21 03:08:47 +0000 +++ lisp/ChangeLog 2013-06-21 06:37:44 +0000 @@ -1,3 +1,7 @@ +2013-06-21 Glenn Morris + + * font-lock.el (lisp-font-lock-keywords-2): Add with-eval-after-load. + 2013-06-21 Stefan Monnier Daniel Hackney === modified file 'lisp/font-lock.el' --- lisp/font-lock.el 2013-06-06 21:35:45 +0000 +++ lisp/font-lock.el 2013-06-21 06:37:44 +0000 @@ -2292,7 +2292,7 @@ "eval-when-compile" "eval-when" "eval-next-after-load" "with-case-table" "with-category-table" "with-coding-priority" "with-current-buffer" "with-demoted-errors" - "with-electric-help" + "with-electric-help" "with-eval-after-load" "with-local-quit" "with-no-warnings" "with-output-to-string" "with-output-to-temp-buffer" "with-selected-window" "with-selected-frame" ------------------------------------------------------------ revno: 113109 committer: Glenn Morris branch nick: trunk timestamp: Thu 2013-06-20 23:32:50 -0700 message: * lisp/url/url-future.el (url-future-call): Remove useless value call. An earlier version of this function returned the value, ref http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00708.html but now it returns the function (see commentary). diff: === modified file 'lisp/url/ChangeLog' --- lisp/url/ChangeLog 2013-05-23 04:58:09 +0000 +++ lisp/url/ChangeLog 2013-06-21 06:32:50 +0000 @@ -1,3 +1,7 @@ +2013-06-21 Glenn Morris + + * url-future.el (url-future-call): Remove useless value call. + 2013-05-23 Glenn Morris * url.el (mm-dissect-buffer, mm-display-part): Declare. === modified file 'lisp/url/url-future.el' --- lisp/url/url-future.el 2013-01-01 09:11:05 +0000 +++ lisp/url/url-future.el 2013-06-21 06:32:50 +0000 @@ -84,7 +84,9 @@ (setf (url-future-value url-future) (funcall ff)) (error (url-future-errored url-future catcher))) - (url-future-value url-future))) + ;; Unused return value. +;;; (url-future-value url-future) + )) (if (url-future-errored-p url-future) url-future (url-future-finish url-future)))) ------------------------------------------------------------ revno: 113108 committer: Stefan Monnier branch nick: trunk timestamp: Thu 2013-06-20 23:08:47 -0400 message: * lisp/emacs-lisp/package.el: Use tar-mode rather than tar executable. Consolidate the single-file vs tarball code. (package-desc-suffix): New function. (package-desc-full-name): Don't bother inlining it. (package-load-descriptor): Return the new package-desc. (package-mark-obsolete): Remove unused arg `package'. (package-unpack): Make it work for single files as well. Make it update package-alist. (package--make-autoloads-and-stuff): Rename from package--make-autoloads-and-compile. Don't compile any more. (package--compile): New function. (package-generate-description-file): New function, extracted from package-unpack-single. (package-unpack-single): Remove. (package--with-work-buffer): Add indentation and debugging info. (package-download-single): Remove. (package-install-from-archive): Rename from package-download-tar, make it take a pkg-desc, and make it work for single files as well. (package-download-transaction): Simplify. (package-tar-file-info): Remove `file' arg. Rewrite not to use an external tar program. (package-install-from-buffer): Remove `pkg-desc' argument. Use package-tar-file-info for tar-mode buffers. (package-install-file): Simplify accordingly. (package-archive-base): Change to take a pkg-desc. * lisp/tar-mode.el (tar--check-descriptor): New function, extracted from tar-get-descriptor. (tar-get-descriptor): Use it. (tar-get-file-descriptor): New function. (tar--extract): New function, extracted from tar-extract. (tar--extract): Use it. * lisp/emacs-lisp/package-x.el (package-upload-file): Decode the file, in case the summary uses non-ascii. Adjust to new calling convention of package-tar-file-info. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-21 01:21:15 +0000 +++ lisp/ChangeLog 2013-06-21 03:08:47 +0000 @@ -1,7 +1,45 @@ +2013-06-21 Stefan Monnier + Daniel Hackney + + * emacs-lisp/package.el: Use tar-mode rather than tar executable. + Consolidate the single-file vs tarball code. + (package-desc-suffix): New function. + (package-desc-full-name): Don't bother inlining it. + (package-load-descriptor): Return the new package-desc. + (package-mark-obsolete): Remove unused arg `package'. + (package-unpack): Make it work for single files as well. + Make it update package-alist. + (package--make-autoloads-and-stuff): Rename from + package--make-autoloads-and-compile. Don't compile any more. + (package--compile): New function. + (package-generate-description-file): New function, extracted from + package-unpack-single. + (package-unpack-single): Remove. + (package--with-work-buffer): Add indentation and debugging info. + (package-download-single): Remove. + (package-install-from-archive): Rename from package-download-tar, make + it take a pkg-desc, and make it work for single files as well. + (package-download-transaction): Simplify. + (package-tar-file-info): Remove `file' arg. Rewrite not to use an + external tar program. + (package-install-from-buffer): Remove `pkg-desc' argument. + Use package-tar-file-info for tar-mode buffers. + (package-install-file): Simplify accordingly. + (package-archive-base): Change to take a pkg-desc. + * tar-mode.el (tar--check-descriptor): New function, extracted from + tar-get-descriptor. + (tar-get-descriptor): Use it. + (tar-get-file-descriptor): New function. + (tar--extract): New function, extracted from tar-extract. + (tar--extract): Use it. + * emacs-lisp/package-x.el (package-upload-file): Decode the file, in + case the summary uses non-ascii. Adjust to new calling convention of + package-tar-file-info. + 2013-06-21 Leo Liu - * comint.el (comint-redirect-results-list-from-process): Fix - random delay. (Bug#14681) + * comint.el (comint-redirect-results-list-from-process): + Fix random delay. (Bug#14681) 2013-06-21 Juanma Barranquero @@ -135,8 +173,8 @@ 2013-06-19 Michael Albinus * net/secrets.el (secrets-struct-secret-content-type): Replace - check of introspection data by a test call of "CreateItem". Some - servers do not offer introspection. + check of introspection data by a test call of "CreateItem". + Some servers do not offer introspection. 2013-06-19 Stefan Monnier === modified file 'lisp/emacs-lisp/package-x.el' --- lisp/emacs-lisp/package-x.el 2013-06-14 03:20:18 +0000 +++ lisp/emacs-lisp/package-x.el 2013-06-21 03:08:47 +0000 @@ -291,10 +291,11 @@ destination, prompt for one." (interactive "fPackage file name: ") (with-temp-buffer - (insert-file-contents-literally file) + (insert-file-contents file) (let ((pkg-desc (cond - ((string-match "\\.tar\\'" file) (package-tar-file-info file)) + ((string-match "\\.tar\\'" file) + (tar-mode) (package-tar-file-info)) ((string-match "\\.el\\'" file) (package-buffer-info)) (t (error "Unrecognized extension `%s'" (file-name-extension file)))))) === modified file 'lisp/emacs-lisp/package.el' --- lisp/emacs-lisp/package.el 2013-06-18 01:26:47 +0000 +++ lisp/emacs-lisp/package.el 2013-06-21 03:08:47 +0000 @@ -340,11 +340,17 @@ dir) ;; Pseudo fields. -(defsubst package-desc-full-name (pkg-desc) +(defun package-desc-full-name (pkg-desc) (format "%s-%s" (package-desc-name pkg-desc) (package-version-join (package-desc-version pkg-desc)))) +(defun package-desc-suffix (pkg-desc) + (pcase (package-desc-kind pkg-desc) + (`single ".el") + (`tar ".tar") + (kind (error "Unknown package kind: %s" kind)))) + ;; Package descriptor format used in finder-inf.el and package--builtins. (cl-defstruct (package--bi-desc (:constructor package-make-builtin (version summary)) @@ -422,7 +428,8 @@ (goto-char (point-min)) (let ((pkg-desc (package-process-define-package (read (current-buffer)) pkg-file))) - (setf (package-desc-dir pkg-desc) pkg-dir)))))) + (setf (package-desc-dir pkg-desc) pkg-dir) + pkg-desc))))) (defun package-load-all-descriptors () "Load descriptors for installed Emacs Lisp packages. @@ -529,13 +536,13 @@ ;; If all goes well, activate the package itself. (package-activate-1 pkg-vec))))))) -(defun package-mark-obsolete (package pkg-vec) - "Put package on the obsolete list, if not already there." - (push pkg-vec package-obsolete-list)) +(defun package-mark-obsolete (pkg-desc) + "Put PKG-DESC on the obsolete list, if not already there." + (push pkg-desc package-obsolete-list)) -(defun define-package (name-string version-string - &optional docstring requirements - &rest _extra-properties) +(defun define-package (_name-string _version-string + &optional _docstring _requirements + &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. @@ -559,13 +566,13 @@ ;; If it's not newer than a builtin version, mark it obsolete. ((let ((bi (assq name package--builtin-versions))) (and bi (version-list-<= version (cdr bi)))) - (package-mark-obsolete name new-pkg-desc)) + (package-mark-obsolete new-pkg-desc)) ;; If there's no old package, just add this to `package-alist'. ((null old-pkg) (push (cons name new-pkg-desc) package-alist)) ((version-list-< (package-desc-version (cdr old-pkg)) version) ;; Remove the old package and declare it obsolete. - (package-mark-obsolete name (cdr old-pkg)) + (package-mark-obsolete (cdr old-pkg)) (setq package-alist (cons (cons name new-pkg-desc) (delq old-pkg package-alist)))) ;; You can have two packages with the same version, e.g. one in @@ -573,10 +580,10 @@ ;; directory. We just let the first one win. ((not (version-list-= (package-desc-version (cdr old-pkg)) version)) ;; The package is born obsolete. - (package-mark-obsolete name new-pkg-desc))) + (package-mark-obsolete new-pkg-desc))) new-pkg-desc)) -;; From Emacs 22. +;; From Emacs 22, but changed so it adds to load-path. (defun package-autoload-ensure-default-file (file) "Make sure that the autoload file FILE exists and if not create it." (unless (file-exists-p file) @@ -632,74 +639,79 @@ (error "Package does not untar cleanly into directory %s/" dir))))) (tar-untar-buffer)) -(defun package-unpack (package version) - (let* ((name (symbol-name package)) - (dirname (concat name "-" version)) +(defun package-generate-description-file (pkg-desc pkg-dir) + "Create the foo-pkg.el file for single-file packages." + (let* ((name (package-desc-name pkg-desc)) + (pkg-file (expand-file-name (package--description-file pkg-dir) + pkg-dir))) + (let ((print-level nil) + (print-quoted t) + (print-length nil)) + (write-region + (concat + (prin1-to-string + (list 'define-package + (symbol-name name) + (package-version-join (package-desc-version pkg-desc)) + (package-desc-summary pkg-desc) + (let ((requires (package-desc-reqs pkg-desc))) + (list 'quote + ;; Turn version lists into string form. + (mapcar + (lambda (elt) + (list (car elt) + (package-version-join (cadr elt)))) + requires))))) + "\n") + nil + pkg-file)))) + +(defun package-unpack (pkg-desc) + "Install the contents of the current buffer as a package." + (let* ((name (package-desc-name pkg-desc)) + (dirname (package-desc-full-name pkg-desc)) (pkg-dir (expand-file-name dirname package-user-dir))) - (make-directory package-user-dir t) - ;; FIXME: should we delete PKG-DIR if it exists? - (let* ((default-directory (file-name-as-directory package-user-dir))) - (package-untar-buffer dirname) - (package--make-autoloads-and-compile package pkg-dir) - pkg-dir))) - -(defun package--make-autoloads-and-compile (name pkg-dir) - "Generate autoloads and do byte-compilation for package named NAME. -PKG-DIR is the name of the package directory." - (let ((auto-name (package-generate-autoloads name pkg-dir)) - (load-path (cons pkg-dir load-path))) - ;; We must load the autoloads file before byte compiling, in - ;; case there are magic cookies to set up non-trivial paths. - (load auto-name nil t) - ;; FIXME: Compilation should be done as a separate, optional, step. - ;; E.g. for multi-package installs, we should first install all packages - ;; and then compile them. - (byte-recompile-directory pkg-dir 0 t))) + (pcase (package-desc-kind pkg-desc) + (`tar + (make-directory package-user-dir t) + ;; FIXME: should we delete PKG-DIR if it exists? + (let* ((default-directory (file-name-as-directory package-user-dir))) + (package-untar-buffer dirname))) + (`single + (let ((el-file (expand-file-name (format "%s.el" name) pkg-dir))) + (make-directory pkg-dir t) + (package--write-file-no-coding el-file))) + (kind (error "Unknown package kind: %S" kind))) + (package--make-autoloads-and-stuff pkg-desc pkg-dir) + ;; Update package-alist. + (let ((new-desc (package-load-descriptor pkg-dir))) + ;; FIXME: Check that `new-desc' matches `desc'! + ;; FIXME: Compilation should be done as a separate, optional, step. + ;; E.g. for multi-package installs, we should first install all packages + ;; and then compile them. + (package--compile new-desc)) + ;; Try to activate it. + (package-activate name (package-desc-version pkg-desc)) + pkg-dir)) + +(defun package--make-autoloads-and-stuff (pkg-desc pkg-dir) + "Generate autoloads, description file, etc.. for PKG-DESC installed at PKG-DIR." + (package-generate-autoloads (package-desc-name pkg-desc) pkg-dir) + (let ((desc-file (package--description-file pkg-dir))) + (unless (file-exists-p desc-file) + (package-generate-description-file pkg-desc pkg-dir))) + ;; FIXME: Create foo.info and dir file from foo.texi? + ) + +(defun package--compile (pkg-desc) + "Byte-compile installed package PKG-DESC." + (package-activate-1 pkg-desc) + (byte-recompile-directory (package-desc-dir pkg-desc) 0 t)) (defun package--write-file-no-coding (file-name) (let ((buffer-file-coding-system 'no-conversion)) (write-region (point-min) (point-max) file-name))) -(defun package-unpack-single (name version desc requires) - "Install the contents of the current buffer as a package." - ;; Special case "package". FIXME: Should this still be supported? - (if (eq name 'package) - (package--write-file-no-coding - (expand-file-name (format "%s.el" name) package-user-dir)) - (let* ((pkg-dir (expand-file-name (format "%s-%s" name - (package-version-join - (version-to-list version))) - package-user-dir)) - (el-file (expand-file-name (format "%s.el" name) pkg-dir)) - (pkg-file (expand-file-name (package--description-file pkg-dir) - pkg-dir))) - (make-directory pkg-dir t) - (package--write-file-no-coding el-file) - (let ((print-level nil) - (print-quoted t) - (print-length nil)) - (write-region - (concat - (prin1-to-string - (list 'define-package - (symbol-name name) - version - desc - (when requires ;Don't bother quoting nil. - (list 'quote - ;; Turn version lists into string form. - (mapcar - (lambda (elt) - (list (car elt) - (package-version-join (cadr elt)))) - requires))))) - "\n") - nil - pkg-file - nil nil nil 'excl)) - (package--make-autoloads-and-compile name pkg-dir) - pkg-dir))) - (defmacro package--with-work-buffer (location file &rest body) "Run BODY in a buffer containing the contents of FILE at LOCATION. LOCATION is the base location of a package archive, and should be @@ -709,6 +721,7 @@ This macro retrieves FILE from LOCATION into a temporary buffer, and evaluates BODY while that buffer is current. This work buffer is killed afterwards. Return the last value in BODY." + (declare (indent 2) (debug t)) `(let* ((http (string-match "\\`https?:" ,location)) (buffer (if http @@ -741,19 +754,13 @@ (error "Error during download request:%s" (buffer-substring-no-properties (point) (line-end-position)))))) -(defun package-download-single (name version desc requires) - "Download and install a single-file package." - (let ((location (package-archive-base name)) - (file (concat (symbol-name name) "-" version ".el"))) - (package--with-work-buffer location file - (package-unpack-single name version desc requires)))) - -(defun package-download-tar (name version) +(defun package-install-from-archive (pkg-desc) "Download and install a tar package." - (let ((location (package-archive-base name)) - (file (concat (symbol-name name) "-" version ".tar"))) + (let ((location (package-archive-base pkg-desc)) + (file (concat (package-desc-full-name pkg-desc) + (package-desc-suffix pkg-desc)))) (package--with-work-buffer location file - (package-unpack name version)))) + (package-unpack pkg-desc)))) (defvar package--initialized nil) @@ -918,30 +925,8 @@ using `package-compute-transaction'." ;; FIXME: make package-list a list of pkg-desc. (dolist (elt package-list) - (let* ((desc (cdr (assq elt package-archive-contents))) - ;; As an exception, if package is "held" in - ;; `package-load-list', download the held version. - (hold (cadr (assq elt package-load-list))) - (v-string (or (and (stringp hold) hold) - (package-version-join (package-desc-version desc)))) - (kind (package-desc-kind desc)) - (pkg-dir - (cond - ((eq kind 'tar) - (package-download-tar elt v-string)) - ((eq kind 'single) - (package-download-single elt v-string - (package-desc-summary desc) - (package-desc-reqs desc))) - (t - (error "Unknown package kind: %s" (symbol-name kind)))))) - ;; Update package-alist. - ;; FIXME: Check that the installed package's descriptor matches `desc'! - (package-load-descriptor pkg-dir) - ;; If package A depends on package B, then A may `require' B - ;; during byte compilation. So we need to activate B before - ;; unpacking A. - (package-activate elt (version-to-list v-string))))) + (let ((desc (cdr (assq elt package-archive-contents)))) + (package-install-from-archive desc)))) ;;;###autoload (defun package-install (pkg-desc) @@ -1018,60 +1003,48 @@ (if requires-str (package-read-from-string requires-str)) :kind 'single)))) -(defun package-tar-file-info (file) +(defun package-tar-file-info () "Find package information for a tar file. -FILE is the name of the tar file to examine. -The return result is a vector like `package-buffer-info'." - (let* ((default-directory (file-name-directory file)) - (file (file-name-nondirectory file)) - (dir-name - (if (string-match "\\.tar\\'" file) - (substring file 0 (match-beginning 0)) - (error "Invalid package name `%s'" file))) +The return result is a `package-desc'." + (cl-assert (derived-mode-p 'tar-mode)) + (let* ((dir-name (file-name-directory + (tar-header-name (car tar-parse-info)))) (desc-file (package--description-file dir-name)) - ;; Extract the package descriptor. - (pkg-def-contents (shell-command-to-string - ;; Requires GNU tar. - (concat "tar -xOf " file " " - dir-name "/" desc-file))) - (pkg-def-parsed (package-read-from-string pkg-def-contents))) - (unless (eq (car pkg-def-parsed) 'define-package) - (error "Can't find define-package in %s" desc-file)) - (let ((pkg-desc - (apply #'package-desc-from-define (append (cdr pkg-def-parsed) - '(:kind tar))))) - (unless (equal dir-name (package-desc-full-name pkg-desc)) - ;; FIXME: Shouldn't this just be a message/warning? - (error "Package has inconsistent name")) - pkg-desc))) + (tar-desc (tar-get-file-descriptor (concat dir-name desc-file)))) + (unless tar-desc + (error "No package descriptor file found")) + (with-current-buffer (tar--extract tar-desc) + (goto-char (point-min)) + (unwind-protect + (let* ((pkg-def-parsed (read (current-buffer))) + (pkg-desc + (if (not (eq (car pkg-def-parsed) 'define-package)) + (error "Can't find define-package in %s" + (tar-header-name tar-desc)) + (apply #'package-desc-from-define + (append (cdr pkg-def-parsed)))))) + (setf (package-desc-kind pkg-desc) 'tar) + pkg-desc) + (kill-buffer (current-buffer)))))) ;;;###autoload -(defun package-install-from-buffer (pkg-desc) +(defun package-install-from-buffer () "Install a package from the current buffer. -When called interactively, the current buffer is assumed to be a -single .el file that follows the packaging guidelines; see info -node `(elisp)Packaging'. - -When called from Lisp, PKG-DESC is a `package-desc' describing the -information)." - (interactive (list (package-buffer-info))) - (save-excursion - (save-restriction - (let* ((name (package-desc-name pkg-desc)) - (requires (package-desc-reqs pkg-desc)) - (desc (package-desc-summary pkg-desc)) - (pkg-version (package-desc-version pkg-desc))) - ;; Download and install the dependencies. - (let ((transaction (package-compute-transaction nil requires))) - (package-download-transaction transaction)) - ;; Install the package itself. - (pcase (package-desc-kind pkg-desc) - (`single (package-unpack-single name pkg-version desc requires)) - (`tar (package-unpack name pkg-version)) - (type (error "Unknown type: %S" type))) - ;; Try to activate it. - (package-initialize))))) +The current buffer is assumed to be a single .el or .tar file that follows the +packaging guidelines; see info node `(elisp)Packaging'. +Downloads and installs required packages as needed." + (interactive) + (let ((pkg-desc (if (derived-mode-p 'tar-mode) + (package-tar-file-info) + (package-buffer-info)))) + ;; Download and install the dependencies. + (let* ((requires (package-desc-reqs pkg-desc)) + (transaction (package-compute-transaction nil requires))) + (package-download-transaction transaction)) + ;; Install the package itself. + (package-unpack pkg-desc) + pkg-desc)) ;;;###autoload (defun package-install-file (file) @@ -1080,12 +1053,8 @@ (interactive "fPackage file name: ") (with-temp-buffer (insert-file-contents-literally file) - (cond - ((string-match "\\.el\\'" file) - (package-install-from-buffer (package-buffer-info))) - ((string-match "\\.tar\\'" file) - (package-install-from-buffer (package-tar-file-info file))) - (t (error "Unrecognized extension `%s'" (file-name-extension file)))))) + (when (string-match "\\.tar\\'" file) (tar-mode)) + (package-install-from-buffer))) (defun package-delete (pkg-desc) (let ((dir (package-desc-dir pkg-desc))) @@ -1099,10 +1068,9 @@ (error "Package `%s' is a system package, not deleting" (package-desc-full-name pkg-desc))))) -(defun package-archive-base (name) +(defun package-archive-base (desc) "Return the archive containing the package NAME." - (let ((desc (cdr (assq (intern-soft name) package-archive-contents)))) - (cdr (assoc (package-desc-archive desc) package-archives)))) + (cdr (assoc (package-desc-archive desc) package-archives))) (defun package--download-one-archive (archive file) "Retrieve an archive file FILE from ARCHIVE, and cache it. @@ -1292,7 +1260,7 @@ ;; For elpa packages, try downloading the commentary. If that ;; fails, try an existing readme file in `package-user-dir'. (cond ((condition-case nil - (package--with-work-buffer (package-archive-base package) + (package--with-work-buffer (package-archive-base desc) (concat package-name "-readme.txt") (setq buffer-file-name (expand-file-name readme package-user-dir)) === modified file 'lisp/tar-mode.el' --- lisp/tar-mode.el 2013-05-09 01:42:00 +0000 +++ lisp/tar-mode.el 2013-06-21 03:08:47 +0000 @@ -740,10 +740,8 @@ nil (error "This line does not describe a tar-file entry")))) -(defun tar-get-descriptor () - (let* ((descriptor (tar-current-descriptor)) - (size (tar-header-size descriptor)) - (link-p (tar-header-link-type descriptor))) +(defun tar--check-descriptor (descriptor) + (let ((link-p (tar-header-link-type descriptor))) (if link-p (error "This is %s, not a real file" (cond ((eq link-p 5) "a directory") @@ -754,10 +752,24 @@ ((eq link-p 38) "a volume header") ((eq link-p 55) "a pax global extended header") ((eq link-p 72) "a pax extended header") - (t "a link")))) + (t "a link")))))) + +(defun tar-get-descriptor () + (let* ((descriptor (tar-current-descriptor)) + (size (tar-header-size descriptor))) + (tar--check-descriptor descriptor) (if (zerop size) (message "This is a zero-length file")) descriptor)) +(defun tar-get-file-descriptor (file) + ;; Used by package.el. + (let ((desc ())) + (dolist (hdr tar-parse-info) + (when (equal file (tar-header-name hdr)) + (setq desc hdr))) + (tar--check-descriptor desc) + desc)) + (defun tar-mouse-extract (event) "Extract a file whose tar directory line you click on." (interactive "e") @@ -776,96 +788,99 @@ (let ((file-name-handler-alist nil)) (apply op args)))) +(defun tar--extract (descriptor) + "Extract this entry of the tar file into its own buffer." + (let* ((name (tar-header-name descriptor)) + (size (tar-header-size descriptor)) + (start (tar-header-data-start descriptor)) + (end (+ start size)) + (tarname (buffer-name)) + (bufname (concat (file-name-nondirectory name) + " (" + tarname + ")")) + (buffer (generate-new-buffer bufname))) + (with-current-buffer buffer + (setq buffer-undo-list t)) + (with-current-buffer tar-data-buffer + (let (coding) + (narrow-to-region start end) + (goto-char start) + (setq coding (or coding-system-for-read + (and set-auto-coding-function + (funcall set-auto-coding-function + name (- end start))) + ;; The following binding causes + ;; find-buffer-file-type-coding-system + ;; (defined on dos-w32.el) to act as if + ;; the file being extracted existed, so + ;; that the file's contents' encoding and + ;; EOL format are auto-detected. + (let ((file-name-handler-alist + '(("" . tar-file-name-handler)))) + (car (find-operation-coding-system + 'insert-file-contents + (cons name (current-buffer)) t))))) + (if (or (not coding) + (eq (coding-system-type coding) 'undecided)) + (setq coding (detect-coding-region start end t))) + (if (and (default-value 'enable-multibyte-characters) + (coding-system-get coding :for-unibyte)) + (with-current-buffer buffer + (set-buffer-multibyte nil))) + (widen) + (decode-coding-region start end coding buffer))) + buffer)) + (defun tar-extract (&optional other-window-p) "In Tar mode, extract this entry of the tar file into its own buffer." (interactive) (let* ((view-p (eq other-window-p 'view)) (descriptor (tar-get-descriptor)) (name (tar-header-name descriptor)) - (size (tar-header-size descriptor)) - (start (tar-header-data-start descriptor)) - (end (+ start size))) - (let* ((tar-buffer (current-buffer)) - (tarname (buffer-name)) - (bufname (concat (file-name-nondirectory name) - " (" - tarname - ")")) - (read-only-p (or buffer-read-only view-p)) - (new-buffer-file-name (expand-file-name - ;; `:' is not allowed on Windows - (concat tarname "!" - (if (string-match "/" name) - name - ;; Make sure `name' contains a / - ;; so set-auto-mode doesn't try - ;; to look at `tarname' for hints. - (concat "./" name))))) - (buffer (get-file-buffer new-buffer-file-name)) - (just-created nil) - undo-list) - (unless buffer - (setq buffer (generate-new-buffer bufname)) - (with-current-buffer buffer - (setq undo-list buffer-undo-list - buffer-undo-list t)) - (setq bufname (buffer-name buffer)) - (setq just-created t) - (with-current-buffer tar-data-buffer - (let (coding) - (narrow-to-region start end) - (goto-char start) - (setq coding (or coding-system-for-read - (and set-auto-coding-function - (funcall set-auto-coding-function - name (- end start))) - ;; The following binding causes - ;; find-buffer-file-type-coding-system - ;; (defined on dos-w32.el) to act as if - ;; the file being extracted existed, so - ;; that the file's contents' encoding and - ;; EOL format are auto-detected. - (let ((file-name-handler-alist - '(("" . tar-file-name-handler)))) - (car (find-operation-coding-system - 'insert-file-contents - (cons name (current-buffer)) t))))) - (if (or (not coding) - (eq (coding-system-type coding) 'undecided)) - (setq coding (detect-coding-region start end t))) - (if (and (default-value 'enable-multibyte-characters) - (coding-system-get coding :for-unibyte)) - (with-current-buffer buffer - (set-buffer-multibyte nil))) - (widen) - (decode-coding-region start end coding buffer))) - (with-current-buffer buffer - (goto-char (point-min)) - (setq buffer-file-name new-buffer-file-name) - (setq buffer-file-truename - (abbreviate-file-name buffer-file-name)) - ;; Force buffer-file-coding-system to what - ;; decode-coding-region actually used. - (set-buffer-file-coding-system last-coding-system-used t) - ;; Set the default-directory to the dir of the - ;; superior buffer. - (setq default-directory - (with-current-buffer tar-buffer - default-directory)) - (rename-buffer bufname) - (set-buffer-modified-p nil) - (setq buffer-undo-list undo-list) - (normal-mode) ; pick a mode. - (set (make-local-variable 'tar-superior-buffer) tar-buffer) - (set (make-local-variable 'tar-superior-descriptor) descriptor) - (setq buffer-read-only read-only-p) - (tar-subfile-mode 1))) - (cond - (view-p - (view-buffer buffer (and just-created 'kill-buffer-if-not-modified))) - ((eq other-window-p 'display) (display-buffer buffer)) - (other-window-p (switch-to-buffer-other-window buffer)) - (t (switch-to-buffer buffer)))))) + (tar-buffer (current-buffer)) + (tarname (buffer-name)) + (read-only-p (or buffer-read-only view-p)) + (new-buffer-file-name (expand-file-name + ;; `:' is not allowed on Windows + (concat tarname "!" + (if (string-match "/" name) + name + ;; Make sure `name' contains a / + ;; so set-auto-mode doesn't try + ;; to look at `tarname' for hints. + (concat "./" name))))) + (buffer (get-file-buffer new-buffer-file-name)) + (just-created nil)) + (unless buffer + (setq buffer (tar--extract descriptor)) + (setq just-created t) + (with-current-buffer buffer + (goto-char (point-min)) + (setq buffer-file-name new-buffer-file-name) + (setq buffer-file-truename + (abbreviate-file-name buffer-file-name)) + ;; Force buffer-file-coding-system to what + ;; decode-coding-region actually used. + (set-buffer-file-coding-system last-coding-system-used t) + ;; Set the default-directory to the dir of the + ;; superior buffer. + (setq default-directory + (with-current-buffer tar-buffer + default-directory)) + (set-buffer-modified-p nil) + (setq buffer-undo-list t) + (normal-mode) ; pick a mode. + (set (make-local-variable 'tar-superior-buffer) tar-buffer) + (set (make-local-variable 'tar-superior-descriptor) descriptor) + (setq buffer-read-only read-only-p) + (tar-subfile-mode 1))) + (cond + (view-p + (view-buffer buffer (and just-created 'kill-buffer-if-not-modified))) + ((eq other-window-p 'display) (display-buffer buffer)) + (other-window-p (switch-to-buffer-other-window buffer)) + (t (switch-to-buffer buffer))))) (defun tar-extract-other-window () ------------------------------------------------------------ revno: 113107 committer: Glenn Morris branch nick: trunk timestamp: Thu 2013-06-20 19:17:37 -0700 message: Remove obsolete comments re postscript image printing diff: === modified file 'doc/lispintro/README' --- doc/lispintro/README 2013-01-01 09:11:05 +0000 +++ doc/lispintro/README 2013-06-21 02:17:37 +0000 @@ -12,43 +12,6 @@ This third edition of 2006 Oct 31 updates the previous editions to GNU Emacs 22. -The Texinfo source file `emacs-lisp-intro.texi', formats without -reported error using `pdfeTeXk', Version 3.141592-1.21a-2.2 (Web2C -7.5.4) and texinfo.tex version 2006-08-26.17 started by `texi2dvi' -version 4.8, and with `makeinfo' version 4.8. - -This directory contains the following Encapsulated PostScript figures: - - cons-1.eps, cons-2.eps, cons-2a.eps, cons-3.eps, cons-4.eps, cons-5.eps - drawers.eps, lambda-1.eps, lambda-2.eps, lambda-3.eps - -See the beginning of the `emacs-lisp-intro.texi' file for appropriate -settings. These figures are not necessary; they are merely nice to -look at --- without them you get the same figures printed with ASCII -characters. - -Whether and how you print PostScript depends on your site. You not -only need to set 'print-postscript-figures' before creating the .dvi -file, but then must convert the .dvi file to .ps with a 'dvips' or -equivalent command. - -On some systems you will see an error message when `psfig.tex' is -loaded for the last two .eps files: - - ! No room for a new \write . - -If this happens, try `epsf.tex' instead of `psfig.tex', or try typing -RET at the error; the formatting may continue successfully. - -Or else find the section that says: - - @c !!! Clear print-postscript-figures if the computer formatting this - @c document is too small and cannot handle all the diagrams and figures. - @c clear print-postscript-figures - -and change the file so it reads: @clear print-postscript-figures -This will prevent TeX from attempting to load the last few .eps files. - You will find additional instructions on formatting in the beginning of the Texinfo file 'emacs-lisp-intro.texi'. Best Wishes! === modified file 'doc/lispintro/emacs-lisp-intro.texi' --- doc/lispintro/emacs-lisp-intro.texi 2013-04-24 01:09:00 +0000 +++ doc/lispintro/emacs-lisp-intro.texi 2013-06-21 02:17:37 +0000 @@ -10,19 +10,44 @@ @include emacsver.texi -@c --------- +@c ================ How to Print a Book in Various Sizes ================ + +@c This book can be printed in any of three different sizes. +@c Set the following @-commands appropriately. + +@c 7 by 9.25 inches: +@c @smallbook +@c @clear largebook + +@c 8.5 by 11 inches: +@c @c smallbook +@c @set largebook + +@c European A4 size paper: +@c @c smallbook +@c @afourpaper +@c @set largebook + +@c (Note: if you edit the book so as to change the length of the +@c table of contents, you may have to change the value of `pageno' below.) + @c <<<< For hard copy printing, this file is now @c set for smallbook, which works for all sizes @c of paper, and with PostScript figures >>>> + @set smallbook @ifset smallbook @smallbook @clear largebook @end ifset + +@c ================ Included Figures ================ + +@c If you clear this, the figures will be printed as ASCII diagrams +@c rather than PostScript/PDF. +@c (This is not relevant to Info, since Info only handles ASCII.) @set print-postscript-figures -@c set largebook @c clear print-postscript-figures -@c --------- @comment %**end of header @@ -41,37 +66,6 @@ @set edition-number 3.10 @set update-date 28 October 2009 -@c ================ Included Figures ================ - -@c Set print-postscript-figures if you print PostScript figures. -@c If you clear this, the ten figures will be printed as ASCII diagrams. -@c (This is not relevant to Info, since Info only handles ASCII.) -@c Your site may require editing changes to print PostScript; in this -@c case, search for `print-postscript-figures' and make appropriate changes. - -@c ================ How to Print a Book in Various Sizes ================ - -@c This book can be printed in any of three different sizes. -@c In the above header, set @-commands appropriately. - -@c 7 by 9.25 inches: -@c @smallbook -@c @clear largebook - -@c 8.5 by 11 inches: -@c @c smallbook -@c @set largebook - -@c European A4 size paper: -@c @c smallbook -@c @afourpaper -@c @set largebook - -@c (Note: if you edit the book so as to change the length of the -@c table of contents, you may have to change the value of `pageno' below.) - -@c ================ End of Formatting Sections ================ - @c For next or subsequent edition: @c create function using with-output-to-temp-buffer @c create a major mode, with keymaps @@ -9523,10 +9517,6 @@ @sp 1 @tex @center @image{cons-1} -%%%% old method of including an image -% \input /usr/local/lib/tex/inputs/psfig.tex -% \centerline{\psfig{figure=/usr/local/lib/emacs/man/cons-1.eps}} -% \catcode`\@=0 % @end tex @sp 1 @end ifset @@ -9586,10 +9576,6 @@ @sp 1 @tex @center @image{cons-2} -%%%% old method of including an image -% \input /usr/local/lib/tex/inputs/psfig.tex -% \centerline{\psfig{figure=/usr/local/lib/emacs/man/cons-2.eps}} -% \catcode`\@=0 % @end tex @sp 1 @end ifset @@ -9635,10 +9621,6 @@ @sp 1 @tex @center @image{cons-2a} -%%%% old method of including an image -% \input /usr/local/lib/tex/inputs/psfig.tex -% \centerline{\psfig{figure=/usr/local/lib/emacs/man/cons-2a.eps}} -% \catcode`\@=0 % @end tex @sp 1 @end ifset @@ -9702,10 +9684,6 @@ @sp 1 @tex @center @image{cons-3} -%%%% old method of including an image -% \input /usr/local/lib/tex/inputs/psfig.tex -% \centerline{\psfig{figure=/usr/local/lib/emacs/man/cons-3.eps}} -% \catcode`\@=0 % @end tex @sp 1 @end ifset @@ -9774,10 +9752,6 @@ @sp 1 @tex @center @image{cons-4} -%%%% old method of including an image -% \input /usr/local/lib/tex/inputs/psfig.tex -% \centerline{\psfig{figure=/usr/local/lib/emacs/man/cons-4.eps}} -% \catcode`\@=0 % @end tex @sp 1 @end ifset @@ -9891,10 +9865,6 @@ @sp 1 @tex @center @image{drawers} -%%%% old method of including an image -% \input /usr/local/lib/tex/inputs/psfig.tex -% \centerline{\psfig{figure=/usr/local/lib/emacs/man/drawers.eps}} -% \catcode`\@=0 % @end tex @sp 1 @end ifset @@ -10067,10 +10037,6 @@ @sp 1 @tex @center @image{cons-5} -%%%% old method of including an image -% \input /usr/local/lib/tex/inputs/psfig.tex -% \centerline{\psfig{figure=/usr/local/lib/emacs/man/cons-5.eps}} -% \catcode`\@=0 % @end tex @sp 1 @end ifset @@ -20878,10 +20844,7 @@ @noindent If we want to multiply 3 by 7, we can write: -@c !!! Clear print-postscript-figures if the computer formatting this -@c document is too small and cannot handle all the diagrams and figures. @c clear print-postscript-figures -@c set print-postscript-figures @c lambda example diagram #1 @ifnottex @smallexample @@ -20897,10 +20860,6 @@ @sp 1 @tex @center @image{lambda-1} -%%%% old method of including an image -% \input /usr/local/lib/tex/inputs/psfig.tex -% \centerline{\psfig{figure=/usr/local/lib/emacs/man/lambda-1.eps}} -% \catcode`\@=0 % @end tex @sp 1 @end ifset @@ -20939,10 +20898,6 @@ @sp 1 @tex @center @image{lambda-2} -%%%% old method of including an image -% \input /usr/local/lib/tex/inputs/psfig.tex -% \centerline{\psfig{figure=/usr/local/lib/emacs/man/lambda-2.eps}} -% \catcode`\@=0 % @end tex @sp 1 @end ifset @@ -20978,10 +20933,6 @@ @sp 1 @tex @center @image{lambda-3} -%%%% old method of including an image -% \input /usr/local/lib/tex/inputs/psfig.tex -% \centerline{\psfig{figure=/usr/local/lib/emacs/man/lambda-3.eps}} -% \catcode`\@=0 % @end tex @sp 1 @end ifset ------------------------------------------------------------ revno: 113106 fixes bug: http://debbugs.gnu.org/14681 committer: Leo Liu branch nick: trunk timestamp: Fri 2013-06-21 09:21:15 +0800 message: * comint.el (comint-redirect-results-list-from-process): Fix random delay. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-21 00:53:33 +0000 +++ lisp/ChangeLog 2013-06-21 01:21:15 +0000 @@ -1,3 +1,8 @@ +2013-06-21 Leo Liu + + * comint.el (comint-redirect-results-list-from-process): Fix + random delay. (Bug#14681) + 2013-06-21 Juanma Barranquero * profiler.el (profiler-format-number): Use log, not log10. === modified file 'lisp/comint.el' --- lisp/comint.el 2013-05-25 02:40:33 +0000 +++ lisp/comint.el 2013-06-21 01:21:15 +0000 @@ -3725,8 +3725,8 @@ output-buffer process nil t) ;; Wait for the process to complete (set-buffer (process-buffer process)) - (while (null comint-redirect-completed) - (accept-process-output nil 1)) + (while (and (null comint-redirect-completed) + (accept-process-output process))) ;; Collect the output (set-buffer output-buffer) (goto-char (point-min)) ------------------------------------------------------------ revno: 113105 committer: YAMAMOTO Mitsuharu branch nick: trunk timestamp: Fri 2013-06-21 10:03:23 +0900 message: configure.ac (HAVE_LIBXML2): Try built-in libxml2 on OS X 10.8 as a fallback. diff: === modified file 'ChangeLog' --- ChangeLog 2013-06-20 20:01:51 +0000 +++ ChangeLog 2013-06-21 01:03:23 +0000 @@ -1,3 +1,8 @@ +2013-06-21 YAMAMOTO Mitsuharu + + * configure.ac (HAVE_LIBXML2): Try built-in libxml2 on OS X 10.8 + as a fallback. + 2013-06-20 Stefan Monnier * .bzrignore: Don't unignore cl-loaddefs.el. === modified file 'configure.ac' --- configure.ac 2013-06-20 14:15:42 +0000 +++ configure.ac 2013-06-21 01:03:23 +0000 @@ -3106,6 +3106,19 @@ if test "${with_xml2}" != "no"; then ### I'm not sure what the version number should be, so I just guessed. PKG_CHECK_MODULES(LIBXML2, libxml-2.0 > 2.6.17, HAVE_LIBXML2=yes, HAVE_LIBXML2=no) + # Built-in libxml2 on OS X 10.8 lacks libxml-2.0.pc. + if test "${HAVE_LIBXML2}" != "yes" -a "$opsys" = "darwin"; then + SAVE_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -I/usr/include/libxml2" + AC_CHECK_HEADER(libxml/HTMLparser.h, + [AC_CHECK_DECL(HTML_PARSE_RECOVER, HAVE_LIBXML2=yes, , + [#include ])]) + CPPFLAGS="$SAVE_CPPFLAGS" + if test "${HAVE_LIBXML2}" = "yes"; then + LIBXML2_LIBS="-lxml2" + LIBXML2_CFLAGS="-I/usr/include/libxml2" + fi + fi if test "${HAVE_LIBXML2}" = "yes"; then if test "${opsys}" != "mingw32"; then LIBS="$LIBXML2_LIBS $LIBS" ------------------------------------------------------------ revno: 113104 committer: Juanma Barranquero branch nick: trunk timestamp: Fri 2013-06-21 02:53:33 +0200 message: lisp/profiler.el (profiler-format-number): Use log, not log10. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-20 21:58:29 +0000 +++ lisp/ChangeLog 2013-06-21 00:53:33 +0000 @@ -1,3 +1,7 @@ +2013-06-21 Juanma Barranquero + + * profiler.el (profiler-format-number): Use log, not log10. + 2013-06-20 Juanma Barranquero * term/x-win.el (emacs-session-filename): Use `locate-user-emacs-file'. === modified file 'lisp/profiler.el' --- lisp/profiler.el 2013-03-30 16:55:47 +0000 +++ lisp/profiler.el 2013-06-21 00:53:33 +0000 @@ -60,7 +60,7 @@ (defun profiler-format-number (number) "Format NUMBER in human readable string." (if (and (integerp number) (> number 0)) - (cl-loop with i = (% (1+ (floor (log10 number))) 3) + (cl-loop with i = (% (1+ (floor (log number 10))) 3) for c in (append (number-to-string number) nil) if (= i 0) collect ?, into s ------------------------------------------------------------ revno: 113103 committer: Juanma Barranquero branch nick: trunk timestamp: Thu 2013-06-20 23:58:29 +0200 message: lisp/term/x-win.el (emacs-session-filename): Use `locate-user-emacs-file'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-20 20:01:51 +0000 +++ lisp/ChangeLog 2013-06-20 21:58:29 +0000 @@ -1,3 +1,7 @@ +2013-06-20 Juanma Barranquero + + * term/x-win.el (emacs-session-filename): Use `locate-user-emacs-file'. + 2013-06-20 Stefan Monnier * emacs-lisp/cl-loaddefs.el: Don't version-control any more. === modified file 'lisp/term/x-win.el' --- lisp/term/x-win.el 2013-04-06 14:06:39 +0000 +++ lisp/term/x-win.el 2013-06-20 21:58:29 +0000 @@ -118,13 +118,11 @@ (defun emacs-session-filename (session-id) "Construct a filename to save the session in based on SESSION-ID. -If the directory ~/.emacs.d exists, we make a filename in there, otherwise -a file in the home directory." - (let ((basename (concat "session." session-id)) - (emacs-dir user-emacs-directory)) - (expand-file-name (if (file-directory-p emacs-dir) - (concat emacs-dir basename) - (concat "~/.emacs-" basename))))) +Return a filename in `user-emacs-directory', unless the session file +already exists in the home directory." + (let ((basename (concat "session." session-id))) + (locate-user-emacs-file basename + (concat ".emacs-" basename)))) (defun emacs-session-save () "This function is called when the window system is shutting down. ------------------------------------------------------------ revno: 113102 committer: Stefan Monnier branch nick: trunk timestamp: Thu 2013-06-20 16:01:51 -0400 message: * lisp/emacs-lisp/cl-loaddefs.el: Don't version-control any more. * lisp/emacs-lisp/cl-lib.el: Load cl-macs when cl-loaddefs is not yet available. * lisp/Makefile.in (AUTOGEN_VCS): Move cl-loaddefs.el... (AUTOGENEL): ... here. * lisp/emacs-lisp/cl-macs.el (cl--sublis): New function. (cl--defsubst-expand): Use it. * .bzrignore: Don't unignore cl-loaddefs.el. diff: === modified file '.bzrignore' --- .bzrignore 2013-06-19 14:27:21 +0000 +++ .bzrignore 2013-06-20 20:01:51 +0000 @@ -144,7 +144,6 @@ lib-src/test-distrib lib-src/update-game-score lisp/**/*-loaddefs.el -!lisp/emacs-lisp/cl-loaddefs.el lisp/**/loaddefs.el lisp/cus-load.el lisp/eshell/esh-groups.el === modified file 'ChangeLog' --- ChangeLog 2013-06-20 14:15:42 +0000 +++ ChangeLog 2013-06-20 20:01:51 +0000 @@ -1,3 +1,7 @@ +2013-06-20 Stefan Monnier + + * .bzrignore: Don't unignore cl-loaddefs.el. + 2013-06-20 Rüdiger Sonderfeld * configure.ac (log2): Check for this function. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-20 14:15:42 +0000 +++ lisp/ChangeLog 2013-06-20 20:01:51 +0000 @@ -1,3 +1,13 @@ +2013-06-20 Stefan Monnier + + * emacs-lisp/cl-loaddefs.el: Don't version-control any more. + * emacs-lisp/cl-lib.el: Load cl-macs when cl-loaddefs is not + yet available. + * Makefile.in (AUTOGEN_VCS): Move cl-loaddefs.el... + (AUTOGENEL): ... here. + * emacs-lisp/cl-macs.el (cl--sublis): New function. + (cl--defsubst-expand): Use it. + 2013-06-20 Paul Eggert * subr.el (log10): Move here from C code, and declare as obsolete. === modified file 'lisp/Makefile.in' --- lisp/Makefile.in 2013-06-15 15:36:11 +0000 +++ lisp/Makefile.in 2013-06-20 20:01:51 +0000 @@ -68,6 +68,7 @@ cus-load.el \ finder-inf.el \ subdirs.el \ + emacs-lisp/cl-loaddefs.el \ calc/calc-loaddefs.el \ eshell/esh-groups.el \ cedet/semantic/loaddefs.el \ @@ -79,7 +80,6 @@ AUTOGEN_VCS = \ ps-print.el \ emulation/tpu-edt.el \ - emacs-lisp/cl-loaddefs.el \ mail/rmail.el \ dired.el \ ibuffer.el \ === modified file 'lisp/emacs-lisp/cl-lib.el' --- lisp/emacs-lisp/cl-lib.el 2013-06-15 15:36:11 +0000 +++ lisp/emacs-lisp/cl-lib.el 2013-06-20 20:01:51 +0000 @@ -725,9 +725,10 @@ (put 'cl-defsubst 'doc-string-elt 3) (put 'cl-defstruct 'doc-string-elt 2)) -(load "cl-loaddefs" nil 'quiet) - (provide 'cl-lib) +(or (load "cl-loaddefs" 'noerror 'quiet) + ;; When bootstrapping, cl-loaddefs hasn't been built yet! + (require 'cl-macs)) ;; Local variables: ;; byte-compile-dynamic: t === removed file 'lisp/emacs-lisp/cl-loaddefs.el' --- lisp/emacs-lisp/cl-loaddefs.el 2013-06-12 02:16:02 +0000 +++ lisp/emacs-lisp/cl-loaddefs.el 1970-01-01 00:00:00 +0000 @@ -1,1285 +0,0 @@ -;;; cl-loaddefs.el --- automatically extracted autoloads -;; -;;; Code: - - -;;;### (autoloads (cl-prettyexpand cl-remprop cl--do-remf cl--set-getf -;;;;;; cl-getf cl-get cl-tailp cl-list-length cl-nreconc cl-revappend -;;;;;; cl-concatenate cl-subseq cl-float-limits cl-random-state-p -;;;;;; cl-make-random-state cl-random cl-signum cl-rem cl-mod cl-round -;;;;;; cl-truncate cl-ceiling cl-floor cl-isqrt cl-lcm cl-gcd cl--set-frame-visible-p -;;;;;; cl--map-overlays cl--map-intervals cl--map-keymap-recursively -;;;;;; cl-notevery cl-notany cl-every cl-some cl-mapcon cl-mapcan -;;;;;; cl-mapl cl-mapc cl-maplist cl-map cl--mapcar-many cl-equalp -;;;;;; cl-coerce) "cl-extra" "cl-extra.el" "011111887a1f353218e59e14d0b09c68") -;;; Generated autoloads from cl-extra.el - -(autoload 'cl-coerce "cl-extra" "\ -Coerce OBJECT to type TYPE. -TYPE is a Common Lisp type specifier. - -\(fn OBJECT TYPE)" nil nil) - -(autoload 'cl-equalp "cl-extra" "\ -Return t if two Lisp objects have similar structures and contents. -This is like `equal', except that it accepts numerically equal -numbers of different types (float vs. integer), and also compares -strings case-insensitively. - -\(fn X Y)" nil nil) - -(autoload 'cl--mapcar-many "cl-extra" "\ - - -\(fn CL-FUNC CL-SEQS)" nil nil) - -(autoload 'cl-map "cl-extra" "\ -Map a FUNCTION across one or more SEQUENCEs, returning a sequence. -TYPE is the sequence type to return. - -\(fn TYPE FUNCTION SEQUENCE...)" nil nil) - -(autoload 'cl-maplist "cl-extra" "\ -Map FUNCTION to each sublist of LIST or LISTs. -Like `cl-mapcar', except applies to lists and their cdr's rather than to -the elements themselves. - -\(fn FUNCTION LIST...)" nil nil) - -(autoload 'cl-mapc "cl-extra" "\ -Like `cl-mapcar', but does not accumulate values returned by the function. - -\(fn FUNCTION SEQUENCE...)" nil nil) - -(autoload 'cl-mapl "cl-extra" "\ -Like `cl-maplist', but does not accumulate values returned by the function. - -\(fn FUNCTION LIST...)" nil nil) - -(autoload 'cl-mapcan "cl-extra" "\ -Like `cl-mapcar', but nconc's together the values returned by the function. - -\(fn FUNCTION SEQUENCE...)" nil nil) - -(autoload 'cl-mapcon "cl-extra" "\ -Like `cl-maplist', but nconc's together the values returned by the function. - -\(fn FUNCTION LIST...)" nil nil) - -(autoload 'cl-some "cl-extra" "\ -Return true if PREDICATE is true of any element of SEQ or SEQs. -If so, return the true (non-nil) value returned by PREDICATE. - -\(fn PREDICATE SEQ...)" nil nil) - -(autoload 'cl-every "cl-extra" "\ -Return true if PREDICATE is true of every element of SEQ or SEQs. - -\(fn PREDICATE SEQ...)" nil nil) - -(autoload 'cl-notany "cl-extra" "\ -Return true if PREDICATE is false of every element of SEQ or SEQs. - -\(fn PREDICATE SEQ...)" nil nil) - -(autoload 'cl-notevery "cl-extra" "\ -Return true if PREDICATE is false of some element of SEQ or SEQs. - -\(fn PREDICATE SEQ...)" nil nil) - -(autoload 'cl--map-keymap-recursively "cl-extra" "\ - - -\(fn CL-FUNC-REC CL-MAP &optional CL-BASE)" nil nil) - -(autoload 'cl--map-intervals "cl-extra" "\ - - -\(fn CL-FUNC &optional CL-WHAT CL-PROP CL-START CL-END)" nil nil) - -(autoload 'cl--map-overlays "cl-extra" "\ - - -\(fn CL-FUNC &optional CL-BUFFER CL-START CL-END CL-ARG)" nil nil) - -(autoload 'cl--set-frame-visible-p "cl-extra" "\ - - -\(fn FRAME VAL)" nil nil) - -(autoload 'cl-gcd "cl-extra" "\ -Return the greatest common divisor of the arguments. - -\(fn &rest ARGS)" nil nil) - -(autoload 'cl-lcm "cl-extra" "\ -Return the least common multiple of the arguments. - -\(fn &rest ARGS)" nil nil) - -(autoload 'cl-isqrt "cl-extra" "\ -Return the integer square root of the argument. - -\(fn X)" nil nil) - -(autoload 'cl-floor "cl-extra" "\ -Return a list of the floor of X and the fractional part of X. -With two arguments, return floor and remainder of their quotient. - -\(fn X &optional Y)" nil nil) - -(autoload 'cl-ceiling "cl-extra" "\ -Return a list of the ceiling of X and the fractional part of X. -With two arguments, return ceiling and remainder of their quotient. - -\(fn X &optional Y)" nil nil) - -(autoload 'cl-truncate "cl-extra" "\ -Return a list of the integer part of X and the fractional part of X. -With two arguments, return truncation and remainder of their quotient. - -\(fn X &optional Y)" nil nil) - -(autoload 'cl-round "cl-extra" "\ -Return a list of X rounded to the nearest integer and the remainder. -With two arguments, return rounding and remainder of their quotient. - -\(fn X &optional Y)" nil nil) - -(autoload 'cl-mod "cl-extra" "\ -The remainder of X divided by Y, with the same sign as Y. - -\(fn X Y)" nil nil) - -(autoload 'cl-rem "cl-extra" "\ -The remainder of X divided by Y, with the same sign as X. - -\(fn X Y)" nil nil) - -(autoload 'cl-signum "cl-extra" "\ -Return 1 if X is positive, -1 if negative, 0 if zero. - -\(fn X)" nil nil) - -(autoload 'cl-random "cl-extra" "\ -Return a random nonnegative number less than LIM, an integer or float. -Optional second arg STATE is a random-state object. - -\(fn LIM &optional STATE)" nil nil) - -(autoload 'cl-make-random-state "cl-extra" "\ -Return a copy of random-state STATE, or of the internal state if omitted. -If STATE is t, return a new state object seeded from the time of day. - -\(fn &optional STATE)" nil nil) - -(autoload 'cl-random-state-p "cl-extra" "\ -Return t if OBJECT is a random-state object. - -\(fn OBJECT)" nil nil) - -(autoload 'cl-float-limits "cl-extra" "\ -Initialize the Common Lisp floating-point parameters. -This sets the values of: `cl-most-positive-float', `cl-most-negative-float', -`cl-least-positive-float', `cl-least-negative-float', `cl-float-epsilon', -`cl-float-negative-epsilon', `cl-least-positive-normalized-float', and -`cl-least-negative-normalized-float'. - -\(fn)" nil nil) - -(autoload 'cl-subseq "cl-extra" "\ -Return the subsequence of SEQ from START to END. -If END is omitted, it defaults to the length of the sequence. -If START or END is negative, it counts from the end. - -\(fn SEQ START &optional END)" nil nil) - -(autoload 'cl-concatenate "cl-extra" "\ -Concatenate, into a sequence of type TYPE, the argument SEQUENCEs. - -\(fn TYPE SEQUENCE...)" nil nil) - -(autoload 'cl-revappend "cl-extra" "\ -Equivalent to (append (reverse X) Y). - -\(fn X Y)" nil nil) - -(autoload 'cl-nreconc "cl-extra" "\ -Equivalent to (nconc (nreverse X) Y). - -\(fn X Y)" nil nil) - -(autoload 'cl-list-length "cl-extra" "\ -Return the length of list X. Return nil if list is circular. - -\(fn X)" nil nil) - -(autoload 'cl-tailp "cl-extra" "\ -Return true if SUBLIST is a tail of LIST. - -\(fn SUBLIST LIST)" nil nil) - -(autoload 'cl-get "cl-extra" "\ -Return the value of SYMBOL's PROPNAME property, or DEFAULT if none. - -\(fn SYMBOL PROPNAME &optional DEFAULT)" nil nil) - -(eval-and-compile (put 'cl-get 'compiler-macro #'cl--compiler-macro-get)) - -(autoload 'cl-getf "cl-extra" "\ -Search PROPLIST for property PROPNAME; return its value or DEFAULT. -PROPLIST is a list of the sort returned by `symbol-plist'. - -\(fn PROPLIST PROPNAME &optional DEFAULT)" nil nil) - -(autoload 'cl--set-getf "cl-extra" "\ - - -\(fn PLIST TAG VAL)" nil nil) - -(autoload 'cl--do-remf "cl-extra" "\ - - -\(fn PLIST TAG)" nil nil) - -(autoload 'cl-remprop "cl-extra" "\ -Remove from SYMBOL's plist the property PROPNAME and its value. - -\(fn SYMBOL PROPNAME)" nil nil) - -(autoload 'cl-prettyexpand "cl-extra" "\ -Expand macros in FORM and insert the pretty-printed result. -Optional argument FULL non-nil means to expand all macros, -including `cl-block' and `cl-eval-when'. - -\(fn FORM &optional FULL)" nil nil) - -;;;*** - -;;;### (autoloads (cl--compiler-macro-adjoin cl-defsubst cl-compiler-macroexpand -;;;;;; cl-define-compiler-macro cl-assert cl-check-type cl-typep -;;;;;; cl-deftype cl-defstruct cl-callf2 cl-callf cl-letf* cl-letf -;;;;;; cl-rotatef cl-shiftf cl-remf cl-psetf cl-declare cl-the cl-locally -;;;;;; cl-multiple-value-setq cl-multiple-value-bind cl-symbol-macrolet -;;;;;; cl-macrolet cl-labels cl-flet* cl-flet cl-progv cl-psetq -;;;;;; cl-do-all-symbols cl-do-symbols cl-tagbody cl-dotimes cl-dolist -;;;;;; cl-do* cl-do cl-loop cl-return-from cl-return cl-block cl-etypecase -;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when -;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp -;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*) -;;;;;; "cl-macs" "cl-macs.el" "fd824d987086eafec0b1cb2efa8312f4") -;;; Generated autoloads from cl-macs.el - -(autoload 'cl--compiler-macro-list* "cl-macs" "\ - - -\(fn FORM ARG &rest OTHERS)" nil nil) - -(autoload 'cl--compiler-macro-cXXr "cl-macs" "\ - - -\(fn FORM X)" nil nil) - -(autoload 'cl-gensym "cl-macs" "\ -Generate a new uninterned symbol. -The name is made by appending a number to PREFIX, default \"G\". - -\(fn &optional PREFIX)" nil nil) - -(autoload 'cl-gentemp "cl-macs" "\ -Generate a new interned symbol with a unique name. -The name is made by appending a number to PREFIX, default \"G\". - -\(fn &optional PREFIX)" nil nil) - -(autoload 'cl-defun "cl-macs" "\ -Define NAME as a function. -Like normal `defun', except ARGLIST allows full Common Lisp conventions, -and BODY is implicitly surrounded by (cl-block NAME ...). - -\(fn NAME ARGLIST [DOCSTRING] BODY...)" nil t) - -(put 'cl-defun 'doc-string-elt '3) - -(put 'cl-defun 'lisp-indent-function '2) - -(autoload 'cl-defmacro "cl-macs" "\ -Define NAME as a macro. -Like normal `defmacro', except ARGLIST allows full Common Lisp conventions, -and BODY is implicitly surrounded by (cl-block NAME ...). - -\(fn NAME ARGLIST [DOCSTRING] BODY...)" nil t) - -(put 'cl-defmacro 'doc-string-elt '3) - -(put 'cl-defmacro 'lisp-indent-function '2) - -(autoload 'cl-function "cl-macs" "\ -Introduce a function. -Like normal `function', except that if argument is a lambda form, -its argument list allows full Common Lisp conventions. - -\(fn FUNC)" nil t) - -(autoload 'cl-destructuring-bind "cl-macs" "\ -Bind the variables in ARGS to the result of EXPR and execute BODY. - -\(fn ARGS EXPR &rest BODY)" nil t) - -(put 'cl-destructuring-bind 'lisp-indent-function '2) - -(autoload 'cl-eval-when "cl-macs" "\ -Control when BODY is evaluated. -If `compile' is in WHEN, BODY is evaluated when compiled at top-level. -If `load' is in WHEN, BODY is evaluated when loaded after top-level compile. -If `eval' is in WHEN, BODY is evaluated when interpreted or at non-top-level. - -\(fn (WHEN...) BODY...)" nil t) - -(put 'cl-eval-when 'lisp-indent-function '1) - -(autoload 'cl-load-time-value "cl-macs" "\ -Like `progn', but evaluates the body at load time. -The result of the body appears to the compiler as a quoted constant. - -\(fn FORM &optional READ-ONLY)" nil t) - -(autoload 'cl-case "cl-macs" "\ -Eval EXPR and choose among clauses on that value. -Each clause looks like (KEYLIST BODY...). EXPR is evaluated and compared -against each key in each KEYLIST; the corresponding BODY is evaluated. -If no clause succeeds, cl-case returns nil. A single atom may be used in -place of a KEYLIST of one atom. A KEYLIST of t or `otherwise' is -allowed only in the final clause, and matches if no other keys match. -Key values are compared by `eql'. - -\(fn EXPR (KEYLIST BODY...)...)" nil t) - -(put 'cl-case 'lisp-indent-function '1) - -(autoload 'cl-ecase "cl-macs" "\ -Like `cl-case', but error if no case fits. -`otherwise'-clauses are not allowed. - -\(fn EXPR (KEYLIST BODY...)...)" nil t) - -(put 'cl-ecase 'lisp-indent-function '1) - -(autoload 'cl-typecase "cl-macs" "\ -Evals EXPR, chooses among clauses on that value. -Each clause looks like (TYPE BODY...). EXPR is evaluated and, if it -satisfies TYPE, the corresponding BODY is evaluated. If no clause succeeds, -cl-typecase returns nil. A TYPE of t or `otherwise' is allowed only in the -final clause, and matches if no other keys match. - -\(fn EXPR (TYPE BODY...)...)" nil t) - -(put 'cl-typecase 'lisp-indent-function '1) - -(autoload 'cl-etypecase "cl-macs" "\ -Like `cl-typecase', but error if no case fits. -`otherwise'-clauses are not allowed. - -\(fn EXPR (TYPE BODY...)...)" nil t) - -(put 'cl-etypecase 'lisp-indent-function '1) - -(autoload 'cl-block "cl-macs" "\ -Define a lexically-scoped block named NAME. -NAME may be any symbol. Code inside the BODY forms can call `cl-return-from' -to jump prematurely out of the block. This differs from `catch' and `throw' -in two respects: First, the NAME is an unevaluated symbol rather than a -quoted symbol or other form; and second, NAME is lexically rather than -dynamically scoped: Only references to it within BODY will work. These -references may appear inside macro expansions, but not inside functions -called from BODY. - -\(fn NAME &rest BODY)" nil t) - -(put 'cl-block 'lisp-indent-function '1) - -(autoload 'cl-return "cl-macs" "\ -Return from the block named nil. -This is equivalent to `(cl-return-from nil RESULT)'. - -\(fn &optional RESULT)" nil t) - -(autoload 'cl-return-from "cl-macs" "\ -Return from the block named NAME. -This jumps out to the innermost enclosing `(cl-block NAME ...)' form, -returning RESULT from that form (or nil if RESULT is omitted). -This is compatible with Common Lisp, but note that `defun' and -`defmacro' do not create implicit blocks as they do in Common Lisp. - -\(fn NAME &optional RESULT)" nil t) - -(put 'cl-return-from 'lisp-indent-function '1) - -(autoload 'cl-loop "cl-macs" "\ -The Common Lisp `loop' macro. -Valid clauses include: - For clauses: - for VAR from/upfrom/downfrom EXPR1 to/upto/downto/above/below EXPR2 by EXPR3 - for VAR = EXPR1 then EXPR2 - for VAR in/on/in-ref LIST by FUNC - for VAR across/across-ref ARRAY - for VAR being: - the elements of/of-ref SEQUENCE [using (index VAR2)] - the symbols [of OBARRAY] - the hash-keys/hash-values of HASH-TABLE [using (hash-values/hash-keys V2)] - the key-codes/key-bindings/key-seqs of KEYMAP [using (key-bindings VAR2)] - the overlays/intervals [of BUFFER] [from POS1] [to POS2] - the frames/buffers - the windows [of FRAME] - Iteration clauses: - repeat INTEGER - while/until/always/never/thereis CONDITION - Accumulation clauses: - collect/append/nconc/concat/vconcat/count/sum/maximize/minimize FORM - [into VAR] - Miscellaneous clauses: - with VAR = INIT - if/when/unless COND CLAUSE [and CLAUSE]... else CLAUSE [and CLAUSE...] - named NAME - initially/finally [do] EXPRS... - do EXPRS... - [finally] return EXPR - -For more details, see Info node `(cl)Loop Facility'. - -\(fn CLAUSE...)" nil t) - -(autoload 'cl-do "cl-macs" "\ -The Common Lisp `do' loop. - -\(fn ((VAR INIT [STEP])...) (END-TEST [RESULT...]) BODY...)" nil t) - -(put 'cl-do 'lisp-indent-function '2) - -(autoload 'cl-do* "cl-macs" "\ -The Common Lisp `do*' loop. - -\(fn ((VAR INIT [STEP])...) (END-TEST [RESULT...]) BODY...)" nil t) - -(put 'cl-do* 'lisp-indent-function '2) - -(autoload 'cl-dolist "cl-macs" "\ -Loop over a list. -Evaluate BODY with VAR bound to each `car' from LIST, in turn. -Then evaluate RESULT to get return value, default nil. -An implicit nil block is established around the loop. - -\(fn (VAR LIST [RESULT]) BODY...)" nil t) - -(put 'cl-dolist 'lisp-indent-function '1) - -(autoload 'cl-dotimes "cl-macs" "\ -Loop a certain number of times. -Evaluate BODY with VAR bound to successive integers from 0, inclusive, -to COUNT, exclusive. Then evaluate RESULT to get return value, default -nil. - -\(fn (VAR COUNT [RESULT]) BODY...)" nil t) - -(put 'cl-dotimes 'lisp-indent-function '1) - -(autoload 'cl-tagbody "cl-macs" "\ -Execute statements while providing for control transfers to labels. -Each element of LABELS-OR-STMTS can be either a label (integer or symbol) -or a `cons' cell, in which case it's taken to be a statement. -This distinction is made before performing macroexpansion. -Statements are executed in sequence left to right, discarding any return value, -stopping only when reaching the end of LABELS-OR-STMTS. -Any statement can transfer control at any time to the statements that follow -one of the labels with the special form (go LABEL). -Labels have lexical scope and dynamic extent. - -\(fn &rest LABELS-OR-STMTS)" nil t) - -(autoload 'cl-do-symbols "cl-macs" "\ -Loop over all symbols. -Evaluate BODY with VAR bound to each interned symbol, or to each symbol -from OBARRAY. - -\(fn (VAR [OBARRAY [RESULT]]) BODY...)" nil t) - -(put 'cl-do-symbols 'lisp-indent-function '1) - -(autoload 'cl-do-all-symbols "cl-macs" "\ -Like `cl-do-symbols', but use the default obarray. - -\(fn (VAR [RESULT]) BODY...)" nil t) - -(put 'cl-do-all-symbols 'lisp-indent-function '1) - -(autoload 'cl-psetq "cl-macs" "\ -Set SYMs to the values VALs in parallel. -This is like `setq', except that all VAL forms are evaluated (in order) -before assigning any symbols SYM to the corresponding values. - -\(fn SYM VAL SYM VAL ...)" nil t) - -(autoload 'cl-progv "cl-macs" "\ -Bind SYMBOLS to VALUES dynamically in BODY. -The forms SYMBOLS and VALUES are evaluated, and must evaluate to lists. -Each symbol in the first list is bound to the corresponding value in the -second list (or to nil if VALUES is shorter than SYMBOLS); then the -BODY forms are executed and their result is returned. This is much like -a `let' form, except that the list of symbols can be computed at run-time. - -\(fn SYMBOLS VALUES &rest BODY)" nil t) - -(put 'cl-progv 'lisp-indent-function '2) - -(autoload 'cl-flet "cl-macs" "\ -Make local function definitions. -Like `cl-labels' but the definitions are not recursive. - -\(fn ((FUNC ARGLIST BODY...) ...) FORM...)" nil t) - -(put 'cl-flet 'lisp-indent-function '1) - -(autoload 'cl-flet* "cl-macs" "\ -Make local function definitions. -Like `cl-flet' but the definitions can refer to previous ones. - -\(fn ((FUNC ARGLIST BODY...) ...) FORM...)" nil t) - -(put 'cl-flet* 'lisp-indent-function '1) - -(autoload 'cl-labels "cl-macs" "\ -Make temporary function bindings. -The bindings can be recursive and the scoping is lexical, but capturing them -in closures will only work if `lexical-binding' is in use. - -\(fn ((FUNC ARGLIST BODY...) ...) FORM...)" nil t) - -(put 'cl-labels 'lisp-indent-function '1) - -(autoload 'cl-macrolet "cl-macs" "\ -Make temporary macro definitions. -This is like `cl-flet', but for macros instead of functions. - -\(fn ((NAME ARGLIST BODY...) ...) FORM...)" nil t) - -(put 'cl-macrolet 'lisp-indent-function '1) - -(autoload 'cl-symbol-macrolet "cl-macs" "\ -Make symbol macro definitions. -Within the body FORMs, references to the variable NAME will be replaced -by EXPANSION, and (setq NAME ...) will act like (setf EXPANSION ...). - -\(fn ((NAME EXPANSION) ...) FORM...)" nil t) - -(put 'cl-symbol-macrolet 'lisp-indent-function '1) - -(autoload 'cl-multiple-value-bind "cl-macs" "\ -Collect multiple return values. -FORM must return a list; the BODY is then executed with the first N elements -of this list bound (`let'-style) to each of the symbols SYM in turn. This -is analogous to the Common Lisp `cl-multiple-value-bind' macro, using lists to -simulate true multiple return values. For compatibility, (cl-values A B C) is -a synonym for (list A B C). - -\(fn (SYM...) FORM BODY)" nil t) - -(put 'cl-multiple-value-bind 'lisp-indent-function '2) - -(autoload 'cl-multiple-value-setq "cl-macs" "\ -Collect multiple return values. -FORM must return a list; the first N elements of this list are stored in -each of the symbols SYM in turn. This is analogous to the Common Lisp -`cl-multiple-value-setq' macro, using lists to simulate true multiple return -values. For compatibility, (cl-values A B C) is a synonym for (list A B C). - -\(fn (SYM...) FORM)" nil t) - -(put 'cl-multiple-value-setq 'lisp-indent-function '1) - -(autoload 'cl-locally "cl-macs" "\ -Equivalent to `progn'. - -\(fn &rest BODY)" nil t) - -(autoload 'cl-the "cl-macs" "\ -At present this ignores _TYPE and is simply equivalent to FORM. - -\(fn TYPE FORM)" nil t) - -(put 'cl-the 'lisp-indent-function '1) - -(autoload 'cl-declare "cl-macs" "\ -Declare SPECS about the current function while compiling. -For instance - - (cl-declare (warn 0)) - -will turn off byte-compile warnings in the function. -See Info node `(cl)Declarations' for details. - -\(fn &rest SPECS)" nil t) - -(autoload 'cl-psetf "cl-macs" "\ -Set PLACEs to the values VALs in parallel. -This is like `setf', except that all VAL forms are evaluated (in order) -before assigning any PLACEs to the corresponding values. - -\(fn PLACE VAL PLACE VAL ...)" nil t) - -(autoload 'cl-remf "cl-macs" "\ -Remove TAG from property list PLACE. -PLACE may be a symbol, or any generalized variable allowed by `setf'. -The form returns true if TAG was found and removed, nil otherwise. - -\(fn PLACE TAG)" nil t) - -(autoload 'cl-shiftf "cl-macs" "\ -Shift left among PLACEs. -Example: (cl-shiftf A B C) sets A to B, B to C, and returns the old A. -Each PLACE may be a symbol, or any generalized variable allowed by `setf'. - -\(fn PLACE... VAL)" nil t) - -(autoload 'cl-rotatef "cl-macs" "\ -Rotate left among PLACEs. -Example: (cl-rotatef A B C) sets A to B, B to C, and C to A. It returns nil. -Each PLACE may be a symbol, or any generalized variable allowed by `setf'. - -\(fn PLACE...)" nil t) - -(autoload 'cl-letf "cl-macs" "\ -Temporarily bind to PLACEs. -This is the analogue of `let', but with generalized variables (in the -sense of `setf') for the PLACEs. Each PLACE is set to the corresponding -VALUE, then the BODY forms are executed. On exit, either normally or -because of a `throw' or error, the PLACEs are set back to their original -values. Note that this macro is *not* available in Common Lisp. -As a special case, if `(PLACE)' is used instead of `(PLACE VALUE)', -the PLACE is not modified before executing BODY. - -\(fn ((PLACE VALUE) ...) BODY...)" nil t) - -(put 'cl-letf 'lisp-indent-function '1) - -(autoload 'cl-letf* "cl-macs" "\ -Temporarily bind to PLACEs. -Like `cl-letf' but where the bindings are performed one at a time, -rather than all at the end (i.e. like `let*' rather than like `let'). - -\(fn BINDINGS &rest BODY)" nil t) - -(put 'cl-letf* 'lisp-indent-function '1) - -(autoload 'cl-callf "cl-macs" "\ -Set PLACE to (FUNC PLACE ARGS...). -FUNC should be an unquoted function name. PLACE may be a symbol, -or any generalized variable allowed by `setf'. - -\(fn FUNC PLACE &rest ARGS)" nil t) - -(put 'cl-callf 'lisp-indent-function '2) - -(autoload 'cl-callf2 "cl-macs" "\ -Set PLACE to (FUNC ARG1 PLACE ARGS...). -Like `cl-callf', but PLACE is the second argument of FUNC, not the first. - -\(fn FUNC ARG1 PLACE ARGS...)" nil t) - -(put 'cl-callf2 'lisp-indent-function '3) - -(autoload 'cl-defstruct "cl-macs" "\ -Define a struct type. -This macro defines a new data type called NAME that stores data -in SLOTs. It defines a `make-NAME' constructor, a `copy-NAME' -copier, a `NAME-p' predicate, and slot accessors named `NAME-SLOT'. -You can use the accessors to set the corresponding slots, via `setf'. - -NAME may instead take the form (NAME OPTIONS...), where each -OPTION is either a single keyword or (KEYWORD VALUE) where -KEYWORD can be one of :conc-name, :constructor, :copier, :predicate, -:type, :named, :initial-offset, :print-function, or :include. - -Each SLOT may instead take the form (SNAME SDEFAULT SOPTIONS...), where -SDEFAULT is the default value of that slot and SOPTIONS are keyword-value -pairs for that slot. -Currently, only one keyword is supported, `:read-only'. If this has a non-nil -value, that slot cannot be set via `setf'. - -\(fn NAME SLOTS...)" nil t) - -(put 'cl-defstruct 'doc-string-elt '2) - -(put 'cl-defstruct 'lisp-indent-function '1) - -(autoload 'cl-deftype "cl-macs" "\ -Define NAME as a new data type. -The type name can then be used in `cl-typecase', `cl-check-type', etc. - -\(fn NAME ARGLIST &rest BODY)" nil t) - -(put 'cl-deftype 'doc-string-elt '3) - -(autoload 'cl-typep "cl-macs" "\ -Check that OBJECT is of type TYPE. -TYPE is a Common Lisp-style type specifier. - -\(fn OBJECT TYPE)" nil nil) - -(eval-and-compile (put 'cl-typep 'compiler-macro #'cl--compiler-macro-typep)) - -(autoload 'cl-check-type "cl-macs" "\ -Verify that FORM is of type TYPE; signal an error if not. -STRING is an optional description of the desired type. - -\(fn FORM TYPE &optional STRING)" nil t) - -(autoload 'cl-assert "cl-macs" "\ -Verify that FORM returns non-nil; signal an error if not. -Second arg SHOW-ARGS means to include arguments of FORM in message. -Other args STRING and ARGS... are arguments to be passed to `error'. -They are not evaluated unless the assertion fails. If STRING is -omitted, a default message listing FORM itself is used. - -\(fn FORM &optional SHOW-ARGS STRING &rest ARGS)" nil t) - -(autoload 'cl-define-compiler-macro "cl-macs" "\ -Define a compiler-only macro. -This is like `defmacro', but macro expansion occurs only if the call to -FUNC is compiled (i.e., not interpreted). Compiler macros should be used -for optimizing the way calls to FUNC are compiled; the form returned by -BODY should do the same thing as a call to the normal function called -FUNC, though possibly more efficiently. Note that, like regular macros, -compiler macros are expanded repeatedly until no further expansions are -possible. Unlike regular macros, BODY can decide to \"punt\" and leave the -original function call alone by declaring an initial `&whole foo' parameter -and then returning foo. - -\(fn FUNC ARGS &rest BODY)" nil t) - -(autoload 'cl-compiler-macroexpand "cl-macs" "\ -Like `macroexpand', but for compiler macros. -Expands FORM repeatedly until no further expansion is possible. -Returns FORM unchanged if it has no compiler macro, or if it has a -macro that returns its `&whole' argument. - -\(fn FORM)" nil nil) - -(autoload 'cl-defsubst "cl-macs" "\ -Define NAME as a function. -Like `defun', except the function is automatically declared `inline', -ARGLIST allows full Common Lisp conventions, and BODY is implicitly -surrounded by (cl-block NAME ...). - -\(fn NAME ARGLIST [DOCSTRING] BODY...)" nil t) - -(put 'cl-defsubst 'lisp-indent-function '2) - -(autoload 'cl--compiler-macro-adjoin "cl-macs" "\ - - -\(fn FORM A LIST &rest KEYS)" nil nil) - -;;;*** - -;;;### (autoloads (cl-tree-equal cl-nsublis cl-sublis cl-nsubst-if-not -;;;;;; cl-nsubst-if cl-nsubst cl-subst-if-not cl-subst-if cl-subsetp -;;;;;; cl-nset-exclusive-or cl-set-exclusive-or cl-nset-difference -;;;;;; cl-set-difference cl-nintersection cl-intersection cl-nunion -;;;;;; cl-union cl-rassoc-if-not cl-rassoc-if cl-rassoc cl-assoc-if-not -;;;;;; cl-assoc-if cl-assoc cl--adjoin cl-member-if-not cl-member-if -;;;;;; cl-member cl-merge cl-stable-sort cl-sort cl-search cl-mismatch -;;;;;; cl-count-if-not cl-count-if cl-count cl-position-if-not cl-position-if -;;;;;; cl-position cl-find-if-not cl-find-if cl-find cl-nsubstitute-if-not -;;;;;; cl-nsubstitute-if cl-nsubstitute cl-substitute-if-not cl-substitute-if -;;;;;; cl-substitute cl-delete-duplicates cl-remove-duplicates cl-delete-if-not -;;;;;; cl-delete-if cl-delete cl-remove-if-not cl-remove-if cl-remove -;;;;;; cl-replace cl-fill cl-reduce) "cl-seq" "cl-seq.el" "51a70dea9cbc225165a50135956609aa") -;;; Generated autoloads from cl-seq.el - -(autoload 'cl-reduce "cl-seq" "\ -Reduce two-argument FUNCTION across SEQ. - -Keywords supported: :start :end :from-end :initial-value :key - -\(fn FUNCTION SEQ [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-fill "cl-seq" "\ -Fill the elements of SEQ with ITEM. - -Keywords supported: :start :end - -\(fn SEQ ITEM [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-replace "cl-seq" "\ -Replace the elements of SEQ1 with the elements of SEQ2. -SEQ1 is destructively modified, then returned. - -Keywords supported: :start1 :end1 :start2 :end2 - -\(fn SEQ1 SEQ2 [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-remove "cl-seq" "\ -Remove all occurrences of ITEM in SEQ. -This is a non-destructive function; it makes a copy of SEQ if necessary -to avoid corrupting the original SEQ. - -Keywords supported: :test :test-not :key :count :start :end :from-end - -\(fn ITEM SEQ [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-remove-if "cl-seq" "\ -Remove all items satisfying PREDICATE in SEQ. -This is a non-destructive function; it makes a copy of SEQ if necessary -to avoid corrupting the original SEQ. - -Keywords supported: :key :count :start :end :from-end - -\(fn PREDICATE SEQ [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-remove-if-not "cl-seq" "\ -Remove all items not satisfying PREDICATE in SEQ. -This is a non-destructive function; it makes a copy of SEQ if necessary -to avoid corrupting the original SEQ. - -Keywords supported: :key :count :start :end :from-end - -\(fn PREDICATE SEQ [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-delete "cl-seq" "\ -Remove all occurrences of ITEM in SEQ. -This is a destructive function; it reuses the storage of SEQ whenever possible. - -Keywords supported: :test :test-not :key :count :start :end :from-end - -\(fn ITEM SEQ [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-delete-if "cl-seq" "\ -Remove all items satisfying PREDICATE in SEQ. -This is a destructive function; it reuses the storage of SEQ whenever possible. - -Keywords supported: :key :count :start :end :from-end - -\(fn PREDICATE SEQ [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-delete-if-not "cl-seq" "\ -Remove all items not satisfying PREDICATE in SEQ. -This is a destructive function; it reuses the storage of SEQ whenever possible. - -Keywords supported: :key :count :start :end :from-end - -\(fn PREDICATE SEQ [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-remove-duplicates "cl-seq" "\ -Return a copy of SEQ with all duplicate elements removed. - -Keywords supported: :test :test-not :key :start :end :from-end - -\(fn SEQ [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-delete-duplicates "cl-seq" "\ -Remove all duplicate elements from SEQ (destructively). - -Keywords supported: :test :test-not :key :start :end :from-end - -\(fn SEQ [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-substitute "cl-seq" "\ -Substitute NEW for OLD in SEQ. -This is a non-destructive function; it makes a copy of SEQ if necessary -to avoid corrupting the original SEQ. - -Keywords supported: :test :test-not :key :count :start :end :from-end - -\(fn NEW OLD SEQ [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-substitute-if "cl-seq" "\ -Substitute NEW for all items satisfying PREDICATE in SEQ. -This is a non-destructive function; it makes a copy of SEQ if necessary -to avoid corrupting the original SEQ. - -Keywords supported: :key :count :start :end :from-end - -\(fn NEW PREDICATE SEQ [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-substitute-if-not "cl-seq" "\ -Substitute NEW for all items not satisfying PREDICATE in SEQ. -This is a non-destructive function; it makes a copy of SEQ if necessary -to avoid corrupting the original SEQ. - -Keywords supported: :key :count :start :end :from-end - -\(fn NEW PREDICATE SEQ [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-nsubstitute "cl-seq" "\ -Substitute NEW for OLD in SEQ. -This is a destructive function; it reuses the storage of SEQ whenever possible. - -Keywords supported: :test :test-not :key :count :start :end :from-end - -\(fn NEW OLD SEQ [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-nsubstitute-if "cl-seq" "\ -Substitute NEW for all items satisfying PREDICATE in SEQ. -This is a destructive function; it reuses the storage of SEQ whenever possible. - -Keywords supported: :key :count :start :end :from-end - -\(fn NEW PREDICATE SEQ [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-nsubstitute-if-not "cl-seq" "\ -Substitute NEW for all items not satisfying PREDICATE in SEQ. -This is a destructive function; it reuses the storage of SEQ whenever possible. - -Keywords supported: :key :count :start :end :from-end - -\(fn NEW PREDICATE SEQ [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-find "cl-seq" "\ -Find the first occurrence of ITEM in SEQ. -Return the matching ITEM, or nil if not found. - -Keywords supported: :test :test-not :key :start :end :from-end - -\(fn ITEM SEQ [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-find-if "cl-seq" "\ -Find the first item satisfying PREDICATE in SEQ. -Return the matching item, or nil if not found. - -Keywords supported: :key :start :end :from-end - -\(fn PREDICATE SEQ [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-find-if-not "cl-seq" "\ -Find the first item not satisfying PREDICATE in SEQ. -Return the matching item, or nil if not found. - -Keywords supported: :key :start :end :from-end - -\(fn PREDICATE SEQ [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-position "cl-seq" "\ -Find the first occurrence of ITEM in SEQ. -Return the index of the matching item, or nil if not found. - -Keywords supported: :test :test-not :key :start :end :from-end - -\(fn ITEM SEQ [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-position-if "cl-seq" "\ -Find the first item satisfying PREDICATE in SEQ. -Return the index of the matching item, or nil if not found. - -Keywords supported: :key :start :end :from-end - -\(fn PREDICATE SEQ [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-position-if-not "cl-seq" "\ -Find the first item not satisfying PREDICATE in SEQ. -Return the index of the matching item, or nil if not found. - -Keywords supported: :key :start :end :from-end - -\(fn PREDICATE SEQ [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-count "cl-seq" "\ -Count the number of occurrences of ITEM in SEQ. - -Keywords supported: :test :test-not :key :start :end - -\(fn ITEM SEQ [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-count-if "cl-seq" "\ -Count the number of items satisfying PREDICATE in SEQ. - -Keywords supported: :key :start :end - -\(fn PREDICATE SEQ [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-count-if-not "cl-seq" "\ -Count the number of items not satisfying PREDICATE in SEQ. - -Keywords supported: :key :start :end - -\(fn PREDICATE SEQ [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-mismatch "cl-seq" "\ -Compare SEQ1 with SEQ2, return index of first mismatching element. -Return nil if the sequences match. If one sequence is a prefix of the -other, the return value indicates the end of the shorter sequence. - -Keywords supported: :test :test-not :key :start1 :end1 :start2 :end2 :from-end - -\(fn SEQ1 SEQ2 [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-search "cl-seq" "\ -Search for SEQ1 as a subsequence of SEQ2. -Return the index of the leftmost element of the first match found; -return nil if there are no matches. - -Keywords supported: :test :test-not :key :start1 :end1 :start2 :end2 :from-end - -\(fn SEQ1 SEQ2 [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-sort "cl-seq" "\ -Sort the argument SEQ according to PREDICATE. -This is a destructive function; it reuses the storage of SEQ if possible. - -Keywords supported: :key - -\(fn SEQ PREDICATE [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-stable-sort "cl-seq" "\ -Sort the argument SEQ stably according to PREDICATE. -This is a destructive function; it reuses the storage of SEQ if possible. - -Keywords supported: :key - -\(fn SEQ PREDICATE [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-merge "cl-seq" "\ -Destructively merge the two sequences to produce a new sequence. -TYPE is the sequence type to return, SEQ1 and SEQ2 are the two argument -sequences, and PREDICATE is a `less-than' predicate on the elements. - -Keywords supported: :key - -\(fn TYPE SEQ1 SEQ2 PREDICATE [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-member "cl-seq" "\ -Find the first occurrence of ITEM in LIST. -Return the sublist of LIST whose car is ITEM. - -Keywords supported: :test :test-not :key - -\(fn ITEM LIST [KEYWORD VALUE]...)" nil nil) - -(eval-and-compile (put 'cl-member 'compiler-macro #'cl--compiler-macro-member)) - -(autoload 'cl-member-if "cl-seq" "\ -Find the first item satisfying PREDICATE in LIST. -Return the sublist of LIST whose car matches. - -Keywords supported: :key - -\(fn PREDICATE LIST [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-member-if-not "cl-seq" "\ -Find the first item not satisfying PREDICATE in LIST. -Return the sublist of LIST whose car matches. - -Keywords supported: :key - -\(fn PREDICATE LIST [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl--adjoin "cl-seq" "\ - - -\(fn CL-ITEM CL-LIST &rest CL-KEYS)" nil nil) - -(autoload 'cl-assoc "cl-seq" "\ -Find the first item whose car matches ITEM in LIST. - -Keywords supported: :test :test-not :key - -\(fn ITEM LIST [KEYWORD VALUE]...)" nil nil) - -(eval-and-compile (put 'cl-assoc 'compiler-macro #'cl--compiler-macro-assoc)) - -(autoload 'cl-assoc-if "cl-seq" "\ -Find the first item whose car satisfies PREDICATE in LIST. - -Keywords supported: :key - -\(fn PREDICATE LIST [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-assoc-if-not "cl-seq" "\ -Find the first item whose car does not satisfy PREDICATE in LIST. - -Keywords supported: :key - -\(fn PREDICATE LIST [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-rassoc "cl-seq" "\ -Find the first item whose cdr matches ITEM in LIST. - -Keywords supported: :test :test-not :key - -\(fn ITEM LIST [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-rassoc-if "cl-seq" "\ -Find the first item whose cdr satisfies PREDICATE in LIST. - -Keywords supported: :key - -\(fn PREDICATE LIST [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-rassoc-if-not "cl-seq" "\ -Find the first item whose cdr does not satisfy PREDICATE in LIST. - -Keywords supported: :key - -\(fn PREDICATE LIST [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-union "cl-seq" "\ -Combine LIST1 and LIST2 using a set-union operation. -The resulting list contains all items that appear in either LIST1 or LIST2. -This is a non-destructive function; it makes a copy of the data if necessary -to avoid corrupting the original LIST1 and LIST2. - -Keywords supported: :test :test-not :key - -\(fn LIST1 LIST2 [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-nunion "cl-seq" "\ -Combine LIST1 and LIST2 using a set-union operation. -The resulting list contains all items that appear in either LIST1 or LIST2. -This is a destructive function; it reuses the storage of LIST1 and LIST2 -whenever possible. - -Keywords supported: :test :test-not :key - -\(fn LIST1 LIST2 [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-intersection "cl-seq" "\ -Combine LIST1 and LIST2 using a set-intersection operation. -The resulting list contains all items that appear in both LIST1 and LIST2. -This is a non-destructive function; it makes a copy of the data if necessary -to avoid corrupting the original LIST1 and LIST2. - -Keywords supported: :test :test-not :key - -\(fn LIST1 LIST2 [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-nintersection "cl-seq" "\ -Combine LIST1 and LIST2 using a set-intersection operation. -The resulting list contains all items that appear in both LIST1 and LIST2. -This is a destructive function; it reuses the storage of LIST1 and LIST2 -whenever possible. - -Keywords supported: :test :test-not :key - -\(fn LIST1 LIST2 [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-set-difference "cl-seq" "\ -Combine LIST1 and LIST2 using a set-difference operation. -The resulting list contains all items that appear in LIST1 but not LIST2. -This is a non-destructive function; it makes a copy of the data if necessary -to avoid corrupting the original LIST1 and LIST2. - -Keywords supported: :test :test-not :key - -\(fn LIST1 LIST2 [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-nset-difference "cl-seq" "\ -Combine LIST1 and LIST2 using a set-difference operation. -The resulting list contains all items that appear in LIST1 but not LIST2. -This is a destructive function; it reuses the storage of LIST1 and LIST2 -whenever possible. - -Keywords supported: :test :test-not :key - -\(fn LIST1 LIST2 [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-set-exclusive-or "cl-seq" "\ -Combine LIST1 and LIST2 using a set-exclusive-or operation. -The resulting list contains all items appearing in exactly one of LIST1, LIST2. -This is a non-destructive function; it makes a copy of the data if necessary -to avoid corrupting the original LIST1 and LIST2. - -Keywords supported: :test :test-not :key - -\(fn LIST1 LIST2 [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-nset-exclusive-or "cl-seq" "\ -Combine LIST1 and LIST2 using a set-exclusive-or operation. -The resulting list contains all items appearing in exactly one of LIST1, LIST2. -This is a destructive function; it reuses the storage of LIST1 and LIST2 -whenever possible. - -Keywords supported: :test :test-not :key - -\(fn LIST1 LIST2 [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-subsetp "cl-seq" "\ -Return true if LIST1 is a subset of LIST2. -I.e., if every element of LIST1 also appears in LIST2. - -Keywords supported: :test :test-not :key - -\(fn LIST1 LIST2 [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-subst-if "cl-seq" "\ -Substitute NEW for elements matching PREDICATE in TREE (non-destructively). -Return a copy of TREE with all matching elements replaced by NEW. - -Keywords supported: :key - -\(fn NEW PREDICATE TREE [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-subst-if-not "cl-seq" "\ -Substitute NEW for elts not matching PREDICATE in TREE (non-destructively). -Return a copy of TREE with all non-matching elements replaced by NEW. - -Keywords supported: :key - -\(fn NEW PREDICATE TREE [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-nsubst "cl-seq" "\ -Substitute NEW for OLD everywhere in TREE (destructively). -Any element of TREE which is `eql' to OLD is changed to NEW (via a call -to `setcar'). - -Keywords supported: :test :test-not :key - -\(fn NEW OLD TREE [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-nsubst-if "cl-seq" "\ -Substitute NEW for elements matching PREDICATE in TREE (destructively). -Any element of TREE which matches is changed to NEW (via a call to `setcar'). - -Keywords supported: :key - -\(fn NEW PREDICATE TREE [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-nsubst-if-not "cl-seq" "\ -Substitute NEW for elements not matching PREDICATE in TREE (destructively). -Any element of TREE which matches is changed to NEW (via a call to `setcar'). - -Keywords supported: :key - -\(fn NEW PREDICATE TREE [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-sublis "cl-seq" "\ -Perform substitutions indicated by ALIST in TREE (non-destructively). -Return a copy of TREE with all matching elements replaced. - -Keywords supported: :test :test-not :key - -\(fn ALIST TREE [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-nsublis "cl-seq" "\ -Perform substitutions indicated by ALIST in TREE (destructively). -Any matching element of TREE is changed via a call to `setcar'. - -Keywords supported: :test :test-not :key - -\(fn ALIST TREE [KEYWORD VALUE]...)" nil nil) - -(autoload 'cl-tree-equal "cl-seq" "\ -Return t if trees TREE1 and TREE2 have `eql' leaves. -Atoms are compared by `eql'; cons cells are compared recursively. - -Keywords supported: :test :test-not :key - -\(fn TREE1 TREE2 [KEYWORD VALUE]...)" nil nil) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; coding: utf-8 -;; End: -;;; cl-loaddefs.el ends here === modified file 'lisp/emacs-lisp/cl-macs.el' --- lisp/emacs-lisp/cl-macs.el 2013-06-12 02:16:02 +0000 +++ lisp/emacs-lisp/cl-macs.el 2013-06-20 20:01:51 +0000 @@ -2739,9 +2739,17 @@ (setq body (cond ((null substs) body) ((null (cdr substs)) (cl-subst (cdar substs) (caar substs) body)) - (t (cl-sublis substs body)))) + (t (cl--sublis substs body)))) (if lets `(let ,lets ,body) body)))) +(defun cl--sublis (alist tree) + "Perform substitutions indicated by ALIST in TREE (non-destructively)." + (let ((x (assq tree alist))) + (cond + (x (cdr x)) + ((consp tree) + (cons (cl--sublis alist (car tree)) (cl--sublis alist (cdr tree)))) + (t tree)))) ;; Compile-time optimizations for some functions defined in this package. ------------------------------------------------------------ revno: 113101 committer: Paul Eggert branch nick: trunk timestamp: Thu 2013-06-20 11:59:08 -0700 message: * syntax.c: Integer cleanups. (SYNTAX_FLAGS_COMMENT_STYLEC): Return a boolean, not 0-or-2. All uses that need 0-or-2 changed to: (SYNTAX_FLAGS_COMMENT_STYLEC2): New macro, with the same semantics as the old SYNTAX_FLAGS_COMMENT_STYLEC. (struct lisp_parse_state, syntax_prefix_flag_p, update_syntax_table) (char_quoted, prev_char_comend_first, back_comment) (Finternal_describe_syntax_value, skip_chars, skip_syntaxes) (in_classes, forw_comment, scan_lists, scan_sexps_forward): Use bool for boolean. (update_syntax_table, skip_chars, skip_syntaxes): Prefer int to unsigned when either will do. (back_comment): Return boolean success flag, like forw_comment, instead of positive-or-minus-1 (which might have overflowed int anyway). Don't stuff ptrdiff_t into int. (syntax_spec_code, syntax_code_spec): Now const. (Fmatching_paren, scan_lists, scan_sexps_forward): Use enum syntaxcode for syntax code. (Fmatching_paren): Check that arg is a character, not just an integer. (Fstring_to_syntax): Don't assume 0377 fits in enum syntaxcode. (Finternal_describe_syntax_value): Omit no-longer-needed comparison to 0. (skip_chars): Use char, not unsigned char, when the distinction doesn't matter. (forw_comment, scan_lists): Prefer A |= B to A = A || B when B's cheap. * bytecode.c (exec_byte_code): * syntax.c (syntax_spec_code, Fchar_syntax) (Finternal_describe_syntax_value, skip_chars, skip_syntaxes) (init_syntax_once): * syntax.h (SYNTAX_WITH_FLAGS): Omit unnecessary casts. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-06-20 17:36:24 +0000 +++ src/ChangeLog 2013-06-20 18:59:08 +0000 @@ -1,3 +1,37 @@ +2013-06-20 Paul Eggert + + * syntax.c: Integer cleanups. + (SYNTAX_FLAGS_COMMENT_STYLEC): Return a boolean, not 0-or-2. + All uses that need 0-or-2 changed to: + (SYNTAX_FLAGS_COMMENT_STYLEC2): New macro, with the same semantics + as the old SYNTAX_FLAGS_COMMENT_STYLEC. + (struct lisp_parse_state, syntax_prefix_flag_p, update_syntax_table) + (char_quoted, prev_char_comend_first, back_comment) + (Finternal_describe_syntax_value, skip_chars, skip_syntaxes) + (in_classes, forw_comment, scan_lists, scan_sexps_forward): + Use bool for boolean. + (update_syntax_table, skip_chars, skip_syntaxes): + Prefer int to unsigned when either will do. + (back_comment): Return boolean success flag, like forw_comment, + instead of positive-or-minus-1 (which might have overflowed int anyway). + Don't stuff ptrdiff_t into int. + (syntax_spec_code, syntax_code_spec): Now const. + (Fmatching_paren, scan_lists, scan_sexps_forward): + Use enum syntaxcode for syntax code. + (Fmatching_paren): Check that arg is a character, not just an integer. + (Fstring_to_syntax): Don't assume 0377 fits in enum syntaxcode. + (Finternal_describe_syntax_value): Omit no-longer-needed + comparison to 0. + (skip_chars): Use char, not unsigned char, when the distinction + doesn't matter. + (forw_comment, scan_lists): Prefer A |= B to A = A || B when B's cheap. + * bytecode.c (exec_byte_code): + * syntax.c (syntax_spec_code, Fchar_syntax) + (Finternal_describe_syntax_value, skip_chars, skip_syntaxes) + (init_syntax_once): + * syntax.h (SYNTAX_WITH_FLAGS): + Omit unnecessary casts. + 2013-06-20 Eli Zaretskii * w32fns.c (w32_wnd_proc): Don't compute the header line and mode === modified file 'src/bytecode.c' --- src/bytecode.c 2013-05-18 05:32:17 +0000 +++ src/bytecode.c 2013-06-20 18:59:08 +0000 @@ -1636,7 +1636,7 @@ c = XFASTINT (TOP); if (NILP (BVAR (current_buffer, enable_multibyte_characters))) MAKE_CHAR_MULTIBYTE (c); - XSETFASTINT (TOP, syntax_code_spec[(int) SYNTAX (c)]); + XSETFASTINT (TOP, syntax_code_spec[SYNTAX (c)]); } NEXT; === modified file 'src/syntax.c' --- src/syntax.c 2013-06-19 05:45:35 +0000 +++ src/syntax.c 2013-06-20 18:59:08 +0000 @@ -36,7 +36,7 @@ #include "intervals.h" #include "category.h" -/* Then there are seven single-bit flags that have the following meanings: +/* Eight single-bit flags have the following meanings: 1. This character is the first of a two-character comment-start sequence. 2. This character is the second of a two-character comment-start sequence. 3. This character is the first of a two-character comment-end sequence. @@ -48,16 +48,15 @@ Note that any two-character sequence whose first character has flag 1 and whose second character has flag 2 will be interpreted as a comment start. - bit 6 and 8 are used to discriminate between different comment styles. + Bits 6 and 8 discriminate among different comment styles. Languages such as C++ allow two orthogonal syntax start/end pairs - and bit 6 is used to determine whether a comment-end or Scommentend + and bit 6 determines whether a comment-end or Scommentend ends style a or b. Comment markers can start style a, b, c, or bc. Style a is always the default. - For 2-char comment markers, the style b flag is only looked up on the second + For 2-char comment markers, the style b flag is looked up only on the second char of the comment marker and on the first char of the comment ender. - For style c (like to for the nested flag), the flag can be placed on any - one of the chars. - */ + For style c (like the nested flag), the flag can be placed on any of + the chars. */ /* These macros extract specific flags from an integer that holds the syntax code and the flags. */ @@ -73,13 +72,14 @@ #define SYNTAX_FLAGS_PREFIX(flags) (((flags) >> 20) & 1) #define SYNTAX_FLAGS_COMMENT_STYLEB(flags) (((flags) >> 21) & 1) -#define SYNTAX_FLAGS_COMMENT_STYLEC(flags) (((flags) >> 22) & 2) +#define SYNTAX_FLAGS_COMMENT_STYLEC(flags) (((flags) >> 23) & 1) +#define SYNTAX_FLAGS_COMMENT_STYLEC2(flags) (((flags) >> 22) & 2) /* C * 2 */ /* FLAGS should be the flags of the main char of the comment marker, e.g. the second for comstart and the first for comend. */ #define SYNTAX_FLAGS_COMMENT_STYLE(flags, other_flags) \ (SYNTAX_FLAGS_COMMENT_STYLEB (flags) \ - | SYNTAX_FLAGS_COMMENT_STYLEC (flags) \ - | SYNTAX_FLAGS_COMMENT_STYLEC (other_flags)) + | SYNTAX_FLAGS_COMMENT_STYLEC2 (flags) \ + | SYNTAX_FLAGS_COMMENT_STYLEC2 (other_flags)) #define SYNTAX_FLAGS_COMMENT_NESTED(flags) (((flags) >> 22) & 1) @@ -114,7 +114,7 @@ int instring; /* -1 if not within string, else desired terminator. */ EMACS_INT incomment; /* -1 if in unnestable comment else comment nesting */ int comstyle; /* comment style a=0, or b=1, or ST_COMMENT_STYLE. */ - int quoted; /* Nonzero if just after an escape char at end of parsing */ + bool quoted; /* True if just after an escape char at end of parsing. */ EMACS_INT mindepth; /* Minimum depth seen while scanning. */ /* Char number of most recent start-of-expression at current level */ ptrdiff_t thislevelstart; @@ -143,13 +143,13 @@ static EMACS_INT find_start_modiff; -static Lisp_Object skip_chars (int, Lisp_Object, Lisp_Object, int); -static Lisp_Object skip_syntaxes (int, Lisp_Object, Lisp_Object); -static Lisp_Object scan_lists (EMACS_INT, EMACS_INT, EMACS_INT, int); +static Lisp_Object skip_chars (bool, Lisp_Object, Lisp_Object, bool); +static Lisp_Object skip_syntaxes (bool, Lisp_Object, Lisp_Object); +static Lisp_Object scan_lists (EMACS_INT, EMACS_INT, EMACS_INT, bool); static void scan_sexps_forward (struct lisp_parse_state *, ptrdiff_t, ptrdiff_t, ptrdiff_t, EMACS_INT, - int, Lisp_Object, int); -static int in_classes (int, Lisp_Object); + bool, Lisp_Object, int); +static bool in_classes (int, Lisp_Object); /* This setter is used only in this file, so it can be private. */ static void @@ -159,7 +159,8 @@ } /* Whether the syntax of the character C has the prefix flag set. */ -int syntax_prefix_flag_p (int c) +bool +syntax_prefix_flag_p (int c) { return SYNTAX_PREFIX (c); } @@ -183,12 +184,12 @@ start/end of OBJECT. */ void -update_syntax_table (ptrdiff_t charpos, EMACS_INT count, int init, +update_syntax_table (ptrdiff_t charpos, EMACS_INT count, bool init, Lisp_Object object) { Lisp_Object tmp_table; - unsigned cnt = 0; - int invalidate = 1; + int cnt = 0; + bool invalidate = 1; INTERVAL i; if (init) @@ -340,16 +341,16 @@ gl_state.b_property = gl_state.start; } -/* Returns TRUE if char at CHARPOS is quoted. +/* Returns true if char at CHARPOS is quoted. Global syntax-table data should be set up already to be good at CHARPOS or after. On return global syntax data is good for lookup at CHARPOS. */ -static int +static bool char_quoted (ptrdiff_t charpos, ptrdiff_t bytepos) { - register enum syntaxcode code; - register ptrdiff_t beg = BEGV; - register int quoted = 0; + enum syntaxcode code; + ptrdiff_t beg = BEGV; + bool quoted = 0; ptrdiff_t orig = charpos; while (charpos > beg) @@ -466,10 +467,11 @@ /* Return the SYNTAX_COMEND_FIRST of the character before POS, POS_BYTE. */ -static int +static bool prev_char_comend_first (ptrdiff_t pos, ptrdiff_t pos_byte) { - int c, val; + int c; + bool val; DEC_BOTH (pos, pos_byte); UPDATE_SYNTAX_TABLE_BACKWARD (pos); @@ -479,28 +481,11 @@ return val; } -/* Return the SYNTAX_COMSTART_FIRST of the character before POS, POS_BYTE. */ - -/* static int - * prev_char_comstart_first (pos, pos_byte) - * int pos, pos_byte; - * { - * int c, val; - * - * DEC_BOTH (pos, pos_byte); - * UPDATE_SYNTAX_TABLE_BACKWARD (pos); - * c = FETCH_CHAR (pos_byte); - * val = SYNTAX_COMSTART_FIRST (c); - * UPDATE_SYNTAX_TABLE_FORWARD (pos + 1); - * return val; - * } */ - -/* Checks whether charpos FROM is at the end of a comment. +/* Check whether charpos FROM is at the end of a comment. FROM_BYTE is the bytepos corresponding to FROM. Do not move back before STOP. - Return a positive value if we find a comment ending at FROM/FROM_BYTE; - return -1 otherwise. + Return true if we find a comment ending at FROM/FROM_BYTE. If successful, store the charpos of the comment's beginning into *CHARPOS_PTR, and the bytepos into *BYTEPOS_PTR. @@ -508,8 +493,10 @@ Global syntax data remains valid for backward search starting at the returned value (or at FROM, if the search was not successful). */ -static int -back_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop, int comnested, int comstyle, ptrdiff_t *charpos_ptr, ptrdiff_t *bytepos_ptr) +static bool +back_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop, + bool comnested, int comstyle, ptrdiff_t *charpos_ptr, + ptrdiff_t *bytepos_ptr) { /* Look back, counting the parity of string-quotes, and recording the comment-starters seen. @@ -521,13 +508,13 @@ which is I+2X quotes from the comment-end. PARITY is current parity of quotes from the comment end. */ int string_style = -1; /* Presumed outside of any string. */ - int string_lossage = 0; + bool string_lossage = 0; /* Not a real lossage: indicates that we have passed a matching comment starter plus a non-matching comment-ender, meaning that any matching comment-starter we might see later could be a false positive (hidden inside another comment). Test case: { a (* b } c (* d *) */ - int comment_lossage = 0; + bool comment_lossage = 0; ptrdiff_t comment_end = from; ptrdiff_t comment_end_byte = from_byte; ptrdiff_t comstart_pos = 0; @@ -536,8 +523,8 @@ or 0 if we didn't come across it yet. */ ptrdiff_t defun_start = 0; ptrdiff_t defun_start_byte = 0; - register enum syntaxcode code; - int nesting = 1; /* current comment nesting */ + enum syntaxcode code; + ptrdiff_t nesting = 1; /* current comment nesting */ int c; int syntax = 0; @@ -550,8 +537,8 @@ while (from != stop) { ptrdiff_t temp_byte; - int prev_syntax, com2start, com2end; - int comstart; + int prev_syntax; + bool com2start, com2end, comstart; /* Move back and examine a character. */ DEC_BOTH (from, from_byte); @@ -772,7 +759,7 @@ *charpos_ptr = from; *bytepos_ptr = from_byte; - return (from == comment_end) ? -1 : from; + return from != comment_end; } DEFUN ("syntax-table-p", Fsyntax_table_p, Ssyntax_table_p, 1, 1, 0, @@ -854,31 +841,28 @@ into the code it signifies. This is used by modify-syntax-entry, and other things. */ -unsigned char syntax_spec_code[0400] = +unsigned char const syntax_spec_code[0400] = { 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, - (char) Swhitespace, (char) Scomment_fence, (char) Sstring, 0377, - (char) Smath, 0377, 0377, (char) Squote, - (char) Sopen, (char) Sclose, 0377, 0377, - 0377, (char) Swhitespace, (char) Spunct, (char) Scharquote, - 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, - 0377, 0377, 0377, 0377, - (char) Scomment, 0377, (char) Sendcomment, 0377, - (char) Sinherit, 0377, 0377, 0377, 0377, 0377, 0377, 0377, /* @, A ... */ - 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, - 0377, 0377, 0377, 0377, 0377, 0377, 0377, (char) Sword, - 0377, 0377, 0377, 0377, (char) Sescape, 0377, 0377, (char) Ssymbol, + Swhitespace, Scomment_fence, Sstring, 0377, Smath, 0377, 0377, Squote, + Sopen, Sclose, 0377, 0377, 0377, Swhitespace, Spunct, Scharquote, + 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, + 0377, 0377, 0377, 0377, Scomment, 0377, Sendcomment, 0377, + Sinherit, 0377, 0377, 0377, 0377, 0377, 0377, 0377, /* @, A ... */ + 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, + 0377, 0377, 0377, 0377, 0377, 0377, 0377, Sword, + 0377, 0377, 0377, 0377, Sescape, 0377, 0377, Ssymbol, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, /* `, a, ... */ 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, - 0377, 0377, 0377, 0377, 0377, 0377, 0377, (char) Sword, - 0377, 0377, 0377, 0377, (char) Sstring_fence, 0377, 0377, 0377 + 0377, 0377, 0377, 0377, 0377, 0377, 0377, Sword, + 0377, 0377, 0377, 0377, Sstring_fence, 0377, 0377, 0377 }; /* Indexed by syntax code, give the letter that describes it. */ -char syntax_code_spec[16] = +char const syntax_code_spec[16] = { ' ', '.', 'w', '_', '(', ')', '\'', '\"', '$', '\\', '/', '<', '>', '@', '!', '|' @@ -904,15 +888,16 @@ CHECK_CHARACTER (character); char_int = XINT (character); SETUP_BUFFER_SYNTAX_TABLE (); - return make_number (syntax_code_spec[(int) SYNTAX (char_int)]); + return make_number (syntax_code_spec[SYNTAX (char_int)]); } DEFUN ("matching-paren", Fmatching_paren, Smatching_paren, 1, 1, 0, doc: /* Return the matching parenthesis of CHARACTER, or nil if none. */) (Lisp_Object character) { - int char_int, code; - CHECK_NUMBER (character); + int char_int; + enum syntaxcode code; + CHECK_CHARACTER (character); char_int = XINT (character); SETUP_BUFFER_SYNTAX_TABLE (); code = SYNTAX (char_int); @@ -929,19 +914,18 @@ the value of a `syntax-table' text property. */) (Lisp_Object string) { - register const unsigned char *p; - register enum syntaxcode code; + const unsigned char *p; int val; Lisp_Object match; CHECK_STRING (string); p = SDATA (string); - code = (enum syntaxcode) syntax_spec_code[*p++]; - if (((int) code & 0377) == 0377) + val = syntax_spec_code[*p++]; + if (val == 0377) error ("Invalid syntax description letter: %c", p[-1]); - if (code == Sinherit) + if (val == Sinherit) return Qnil; if (*p) @@ -956,7 +940,6 @@ else match = Qnil; - val = (int) code; while (*p) switch (*p++) { @@ -1078,10 +1061,8 @@ doc: /* Insert a description of the internal syntax description SYNTAX at point. */) (Lisp_Object syntax) { - register enum syntaxcode code; - int syntax_code; - char desc, start1, start2, end1, end2, prefix, - comstyleb, comstylec, comnested; + int code, syntax_code; + bool start1, start2, end1, end2, prefix, comstyleb, comstylec, comnested; char str[2]; Lisp_Object first, match_lisp, value = syntax; @@ -1113,7 +1094,7 @@ } syntax_code = XINT (first) & INT_MAX; - code = (enum syntaxcode) (syntax_code & 0377); + code = syntax_code & 0377; start1 = SYNTAX_FLAGS_COMSTART_FIRST (syntax_code); start2 = SYNTAX_FLAGS_COMSTART_SECOND (syntax_code);; end1 = SYNTAX_FLAGS_COMEND_FIRST (syntax_code); @@ -1123,14 +1104,13 @@ comstylec = SYNTAX_FLAGS_COMMENT_STYLEC (syntax_code); comnested = SYNTAX_FLAGS_COMMENT_NESTED (syntax_code); - if ((int) code < 0 || (int) code >= (int) Smax) + if (Smax <= code) { insert_string ("invalid"); return syntax; } - desc = syntax_code_spec[(int) code]; - str[0] = desc, str[1] = 0; + str[0] = syntax_code_spec[code], str[1] = 0; insert (str, 1); if (NILP (match_lisp)) @@ -1431,21 +1411,21 @@ } static Lisp_Object -skip_chars (int forwardp, Lisp_Object string, Lisp_Object lim, int handle_iso_classes) +skip_chars (bool forwardp, Lisp_Object string, Lisp_Object lim, + bool handle_iso_classes) { - register unsigned int c; - unsigned char fastmap[0400]; + int c; + char fastmap[0400]; /* Store the ranges of non-ASCII characters. */ int *char_ranges IF_LINT (= NULL); int n_char_ranges = 0; - int negate = 0; - register ptrdiff_t i, i_byte; - /* Set to 1 if the current buffer is multibyte and the region - contains non-ASCII chars. */ - int multibyte; - /* Set to 1 if STRING is multibyte and it contains non-ASCII - chars. */ - int string_multibyte; + bool negate = 0; + ptrdiff_t i, i_byte; + /* True if the current buffer is multibyte and the region contains + non-ASCII chars. */ + bool multibyte; + /* True if STRING is multibyte and it contains non-ASCII chars. */ + bool string_multibyte; ptrdiff_t size_byte; const unsigned char *str; int len; @@ -1489,7 +1469,7 @@ if (! string_multibyte) { - int string_has_eight_bit = 0; + bool string_has_eight_bit = 0; /* At first setup fastmap. */ while (i_byte < size_byte) @@ -1544,7 +1524,7 @@ if (i_byte + 1 < size_byte && str[i_byte] == '-') { - unsigned int c2; + int c2; /* Skip over the dash. */ i_byte++; @@ -1557,7 +1537,7 @@ if (c <= c2) { - unsigned lim2 = c2 + 1; + int lim2 = c2 + 1; while (c < lim2) fastmap[c++] = 1; if (! ASCII_CHAR_P (c2)) @@ -1610,9 +1590,7 @@ while (i_byte < size_byte) { - unsigned char leading_code; - - leading_code = str[i_byte]; + int leading_code = str[i_byte]; c = STRING_CHAR_AND_LENGTH (str + i_byte, len); i_byte += len; @@ -1666,8 +1644,7 @@ if (i_byte + 1 < size_byte && str[i_byte] == '-') { - unsigned int c2; - unsigned char leading_code2; + int c2, leading_code2; /* Skip over the dash. */ i_byte++; @@ -1681,7 +1658,7 @@ && i_byte < size_byte) { leading_code2 = str[i_byte]; - c2 =STRING_CHAR_AND_LENGTH (str + i_byte, len); + c2 = STRING_CHAR_AND_LENGTH (str + i_byte, len); i_byte += len; } @@ -1695,7 +1672,7 @@ } if (! ASCII_CHAR_P (c)) { - unsigned lim2 = leading_code2 + 1; + int lim2 = leading_code2 + 1; while (leading_code < lim2) fastmap[leading_code++] = 1; if (c <= c2) @@ -1728,7 +1705,7 @@ for (i = 0; i < n_char_ranges; i += 2) { int c1 = char_ranges[i]; - unsigned lim2 = char_ranges[i + 1] + 1; + int lim2 = char_ranges[i + 1] + 1; for (; c1 < lim2; c1++) { @@ -1924,13 +1901,13 @@ static Lisp_Object -skip_syntaxes (int forwardp, Lisp_Object string, Lisp_Object lim) +skip_syntaxes (bool forwardp, Lisp_Object string, Lisp_Object lim) { - register unsigned int c; + int c; unsigned char fastmap[0400]; - int negate = 0; - register ptrdiff_t i, i_byte; - int multibyte; + bool negate = 0; + ptrdiff_t i, i_byte; + bool multibyte; ptrdiff_t size_byte; unsigned char *str; @@ -2018,7 +1995,7 @@ stop = endp; } c = STRING_CHAR_AND_LENGTH (p, nbytes); - if (! fastmap[(int) SYNTAX (c)]) + if (! fastmap[SYNTAX (c)]) break; p += nbytes, pos++, pos_byte += nbytes; UPDATE_SYNTAX_TABLE_FORWARD (pos); @@ -2035,7 +2012,7 @@ p = GAP_END_ADDR; stop = endp; } - if (! fastmap[(int) SYNTAX (*p)]) + if (! fastmap[SYNTAX (*p)]) break; p++, pos++, pos_byte++; UPDATE_SYNTAX_TABLE_FORWARD (pos); @@ -2061,7 +2038,7 @@ prev_p = p; while (--p >= stop && ! CHAR_HEAD_P (*p)); c = STRING_CHAR (p); - if (! fastmap[(int) SYNTAX (c)]) + if (! fastmap[SYNTAX (c)]) break; pos--, pos_byte -= prev_p - p; } @@ -2078,7 +2055,7 @@ stop = endp; } UPDATE_SYNTAX_TABLE_BACKWARD (pos - 1); - if (! fastmap[(int) SYNTAX (p[-1])]) + if (! fastmap[SYNTAX (p[-1])]) break; p--, pos--, pos_byte--; } @@ -2092,14 +2069,14 @@ } } -/* Return 1 if character C belongs to one of the ISO classes +/* Return true if character C belongs to one of the ISO classes in the list ISO_CLASSES. Each class is represented by an integer which is its type according to re_wctype. */ -static int +static bool in_classes (int c, Lisp_Object iso_classes) { - int fits_class = 0; + bool fits_class = 0; while (CONSP (iso_classes)) { @@ -2119,26 +2096,26 @@ FROM_BYTE is the bytepos corresponding to FROM. Do not move past STOP (a charpos). The comment over which we have to jump is of style STYLE - (either SYNTAX_FLAGS_COMMENT_STYLE(foo) or ST_COMMENT_STYLE). + (either SYNTAX_FLAGS_COMMENT_STYLE (foo) or ST_COMMENT_STYLE). NESTING should be positive to indicate the nesting at the beginning for nested comments and should be zero or negative else. ST_COMMENT_STYLE cannot be nested. PREV_SYNTAX is the SYNTAX_WITH_FLAGS of the previous character (or 0 If the search cannot start in the middle of a two-character). - If successful, return 1 and store the charpos of the comment's end + If successful, return true and store the charpos of the comment's end into *CHARPOS_PTR and the corresponding bytepos into *BYTEPOS_PTR. - Else, return 0 and store the charpos STOP into *CHARPOS_PTR, the + Else, return false and store the charpos STOP into *CHARPOS_PTR, the corresponding bytepos into *BYTEPOS_PTR and the current nesting (as defined for state.incomment) in *INCOMMENT_PTR. The comment end is the last character of the comment rather than the - character just after the comment. + character just after the comment. Global syntax data is assumed to initially be valid for FROM and remains valid for forward search starting at the returned position. */ -static int +static bool forw_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop, EMACS_INT nesting, int style, int prev_syntax, ptrdiff_t *charpos_ptr, ptrdiff_t *bytepos_ptr, @@ -2244,14 +2221,12 @@ between them, return t; otherwise return nil. */) (Lisp_Object count) { - register ptrdiff_t from; - ptrdiff_t from_byte; - register ptrdiff_t stop; - register int c, c1; - register enum syntaxcode code; + ptrdiff_t from, from_byte, stop; + int c, c1; + enum syntaxcode code; int comstyle = 0; /* style of comment encountered */ - int comnested = 0; /* whether the comment is nestable or not */ - int found; + bool comnested = 0; /* whether the comment is nestable or not */ + bool found; EMACS_INT count1; ptrdiff_t out_charpos, out_bytepos; EMACS_INT dummy; @@ -2271,7 +2246,8 @@ { do { - int comstart_first, syntax, other_syntax; + bool comstart_first; + int syntax, other_syntax; if (from == stop) { @@ -2299,8 +2275,7 @@ the comment section. */ code = Scomment; comstyle = SYNTAX_FLAGS_COMMENT_STYLE (other_syntax, syntax); - comnested - = comnested || SYNTAX_FLAGS_COMMENT_NESTED (other_syntax); + comnested |= SYNTAX_FLAGS_COMMENT_NESTED (other_syntax); INC_BOTH (from, from_byte); UPDATE_SYNTAX_TABLE_FORWARD (from); } @@ -2336,7 +2311,8 @@ { while (1) { - int quoted, syntax; + bool quoted; + int syntax; if (from <= stop) { @@ -2370,14 +2346,13 @@ c1 = FETCH_CHAR_AS_MULTIBYTE (from_byte); other_syntax = SYNTAX_WITH_FLAGS (c1); comstyle = SYNTAX_FLAGS_COMMENT_STYLE (other_syntax, syntax); - comnested - = comnested || SYNTAX_FLAGS_COMMENT_NESTED (other_syntax); + comnested |= SYNTAX_FLAGS_COMMENT_NESTED (other_syntax); } if (code == Scomment_fence) { /* Skip until first preceding unquoted comment_fence. */ - int fence_found = 0; + bool fence_found = 0; ptrdiff_t ini = from, ini_byte = from_byte; while (1) @@ -2408,7 +2383,7 @@ { found = back_comment (from, from_byte, stop, comnested, comstyle, &out_charpos, &out_bytepos); - if (found == -1) + if (!found) { if (c == '\n') /* This end-of-line is not an end-of-comment. @@ -2458,26 +2433,25 @@ ? SYNTAX (c) : Ssymbol) static Lisp_Object -scan_lists (register EMACS_INT from, EMACS_INT count, EMACS_INT depth, int sexpflag) +scan_lists (EMACS_INT from, EMACS_INT count, EMACS_INT depth, bool sexpflag) { Lisp_Object val; - register ptrdiff_t stop = count > 0 ? ZV : BEGV; - register int c, c1; + ptrdiff_t stop = count > 0 ? ZV : BEGV; + int c, c1; int stringterm; - int quoted; - int mathexit = 0; - register enum syntaxcode code, temp_code; + bool quoted; + bool mathexit = 0; + enum syntaxcode code, temp_code, c_code; EMACS_INT min_depth = depth; /* Err out if depth gets less than this. */ int comstyle = 0; /* style of comment encountered */ - int comnested = 0; /* whether the comment is nestable or not */ + bool comnested = 0; /* whether the comment is nestable or not */ ptrdiff_t temp_pos; EMACS_INT last_good = from; - int found; + bool found; ptrdiff_t from_byte; ptrdiff_t out_bytepos, out_charpos; - int temp; EMACS_INT dummy; - int multibyte_symbol_p = sexpflag && multibyte_syntax_as_symbol; + bool multibyte_symbol_p = sexpflag && multibyte_syntax_as_symbol; if (depth > 0) min_depth = 0; @@ -2494,7 +2468,8 @@ { while (from < stop) { - int comstart_first, prefix, syntax, other_syntax; + bool comstart_first, prefix; + int syntax, other_syntax; UPDATE_SYNTAX_TABLE_FORWARD (from); c = FETCH_CHAR_AS_MULTIBYTE (from_byte); syntax = SYNTAX_WITH_FLAGS (c); @@ -2520,8 +2495,7 @@ the comment section */ code = Scomment; comstyle = SYNTAX_FLAGS_COMMENT_STYLE (other_syntax, syntax); - comnested - = comnested || SYNTAX_FLAGS_COMMENT_NESTED (other_syntax); + comnested |= SYNTAX_FLAGS_COMMENT_NESTED (other_syntax); INC_BOTH (from, from_byte); UPDATE_SYNTAX_TABLE_FORWARD (from); } @@ -2547,8 +2521,8 @@ /* Some compilers can't handle this inside the switch. */ c = FETCH_CHAR_AS_MULTIBYTE (from_byte); - temp = SYNTAX_WITH_MULTIBYTE_CHECK (c); - switch (temp) + c_code = SYNTAX_WITH_MULTIBYTE_CHECK (c); + switch (c_code) { case Scharquote: case Sescape: @@ -2631,8 +2605,8 @@ break; /* Some compilers can't handle this inside the switch. */ - temp = SYNTAX_WITH_MULTIBYTE_CHECK (c); - switch (temp) + c_code = SYNTAX_WITH_MULTIBYTE_CHECK (c); + switch (c_code) { case Scharquote: case Sescape: @@ -2691,8 +2665,7 @@ c2 = FETCH_CHAR_AS_MULTIBYTE (from_byte); other_syntax = SYNTAX_WITH_FLAGS (c2); comstyle = SYNTAX_FLAGS_COMMENT_STYLE (other_syntax, syntax); - comnested - = comnested || SYNTAX_FLAGS_COMMENT_NESTED (other_syntax); + comnested |= SYNTAX_FLAGS_COMMENT_NESTED (other_syntax); } /* Quoting turns anything except a comment-ender @@ -2777,13 +2750,13 @@ break; found = back_comment (from, from_byte, stop, comnested, comstyle, &out_charpos, &out_bytepos); - /* FIXME: if found == -1, then it really wasn't a comment-end. + /* FIXME: if !found, it really wasn't a comment-end. For single-char Sendcomment, we can't do much about it apart from skipping the char. For 2-char endcomments, we could try again, taking both chars as separate entities, but it's a lot of trouble for very little gain, so we don't bother either. -sm */ - if (found != -1) + if (found) from = out_charpos, from_byte = out_bytepos; break; @@ -2938,7 +2911,7 @@ /* Parse forward from FROM / FROM_BYTE to END, assuming that FROM has state OLDSTATE (nil means FROM is start of function), and return a description of the state of the parse at END. - If STOPBEFORE is nonzero, stop at the start of an atom. + If STOPBEFORE, stop at the start of an atom. If COMMENTSTOP is 1, stop at the start of a comment. If COMMENTSTOP is -1, stop at the start or end of a comment, after the beginning of a string, or after the end of a string. */ @@ -2946,30 +2919,29 @@ static void scan_sexps_forward (struct lisp_parse_state *stateptr, ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t end, - EMACS_INT targetdepth, int stopbefore, + EMACS_INT targetdepth, bool stopbefore, Lisp_Object oldstate, int commentstop) { struct lisp_parse_state state; - - register enum syntaxcode code; + enum syntaxcode code; int c1; - int comnested; + bool comnested; struct level { ptrdiff_t last, prev; }; struct level levelstart[100]; - register struct level *curlevel = levelstart; + struct level *curlevel = levelstart; struct level *endlevel = levelstart + 100; - register EMACS_INT depth; /* Paren depth of current scanning location. + EMACS_INT depth; /* Paren depth of current scanning location. level - levelstart equals this except when the depth becomes negative. */ EMACS_INT mindepth; /* Lowest DEPTH value seen. */ - int start_quoted = 0; /* Nonzero means starting after a char quote */ + bool start_quoted = 0; /* True means starting after a char quote. */ Lisp_Object tem; ptrdiff_t prev_from; /* Keep one character before FROM. */ ptrdiff_t prev_from_byte; int prev_from_syntax; - int boundary_stop = commentstop == -1; - int nofence; - int found; + bool boundary_stop = commentstop == -1; + bool nofence; + bool found; ptrdiff_t out_bytepos, out_charpos; int temp; @@ -3100,8 +3072,8 @@ terminates the comment section. */ state.comstyle = SYNTAX_FLAGS_COMMENT_STYLE (syntax, prev_from_syntax); - comnested = SYNTAX_FLAGS_COMMENT_NESTED (prev_from_syntax); - comnested = comnested || SYNTAX_FLAGS_COMMENT_NESTED (syntax); + comnested = (SYNTAX_FLAGS_COMMENT_NESTED (prev_from_syntax) + | SYNTAX_FLAGS_COMMENT_NESTED (syntax)); state.incomment = comnested ? 1 : -1; state.comstr_start = prev_from; INC_FROM; @@ -3146,9 +3118,9 @@ while (from < end) { /* Some compilers can't handle this inside the switch. */ - temp = FETCH_CHAR_AS_MULTIBYTE (from_byte); - temp = SYNTAX (temp); - switch (temp) + int symchar = FETCH_CHAR_AS_MULTIBYTE (from_byte); + enum syntaxcode symcharcode = SYNTAX (symchar); + switch (symcharcode) { case Scharquote: case Sescape: @@ -3230,19 +3202,20 @@ while (1) { int c; + enum syntaxcode c_code; if (from >= end) goto done; c = FETCH_CHAR_AS_MULTIBYTE (from_byte); /* Some compilers can't handle this inside the switch. */ - temp = SYNTAX (c); + c_code = SYNTAX (c); - /* Check TEMP here so that if the char has + /* Check C_CODE here so that if the char has a syntax-table property which says it is NOT a string character, it does not end the string. */ - if (nofence && c == state.instring && temp == Sstring) + if (nofence && c == state.instring && c_code == Sstring) break; - switch (temp) + switch (c_code) { case Sstring_fence: if (!nofence) goto string_end; @@ -3398,25 +3371,25 @@ create syntax tables. */ Fput (Qsyntax_table, Qchar_table_extra_slots, make_number (0)); - temp = AREF (Vsyntax_code_object, (int) Swhitespace); + temp = AREF (Vsyntax_code_object, Swhitespace); Vstandard_syntax_table = Fmake_char_table (Qsyntax_table, temp); /* Control characters should not be whitespace. */ - temp = AREF (Vsyntax_code_object, (int) Spunct); + temp = AREF (Vsyntax_code_object, Spunct); for (i = 0; i <= ' ' - 1; i++) SET_RAW_SYNTAX_ENTRY (Vstandard_syntax_table, i, temp); SET_RAW_SYNTAX_ENTRY (Vstandard_syntax_table, 0177, temp); /* Except that a few really are whitespace. */ - temp = AREF (Vsyntax_code_object, (int) Swhitespace); + temp = AREF (Vsyntax_code_object, Swhitespace); SET_RAW_SYNTAX_ENTRY (Vstandard_syntax_table, ' ', temp); SET_RAW_SYNTAX_ENTRY (Vstandard_syntax_table, '\t', temp); SET_RAW_SYNTAX_ENTRY (Vstandard_syntax_table, '\n', temp); SET_RAW_SYNTAX_ENTRY (Vstandard_syntax_table, 015, temp); SET_RAW_SYNTAX_ENTRY (Vstandard_syntax_table, 014, temp); - temp = AREF (Vsyntax_code_object, (int) Sword); + temp = AREF (Vsyntax_code_object, Sword); for (i = 'a'; i <= 'z'; i++) SET_RAW_SYNTAX_ENTRY (Vstandard_syntax_table, i, temp); for (i = 'A'; i <= 'Z'; i++) @@ -3440,18 +3413,18 @@ SET_RAW_SYNTAX_ENTRY (Vstandard_syntax_table, '}', Fcons (make_number (Sclose), make_number ('{'))); SET_RAW_SYNTAX_ENTRY (Vstandard_syntax_table, '"', - Fcons (make_number ((int) Sstring), Qnil)); + Fcons (make_number (Sstring), Qnil)); SET_RAW_SYNTAX_ENTRY (Vstandard_syntax_table, '\\', - Fcons (make_number ((int) Sescape), Qnil)); + Fcons (make_number (Sescape), Qnil)); - temp = AREF (Vsyntax_code_object, (int) Ssymbol); + temp = AREF (Vsyntax_code_object, Ssymbol); for (i = 0; i < 10; i++) { c = "_-+*/&|<>="[i]; SET_RAW_SYNTAX_ENTRY (Vstandard_syntax_table, c, temp); } - temp = AREF (Vsyntax_code_object, (int) Spunct); + temp = AREF (Vsyntax_code_object, Spunct); for (i = 0; i < 12; i++) { c = ".,;:?!#@~^'`"[i]; @@ -3459,7 +3432,7 @@ } /* All multibyte characters have syntax `word' by default. */ - temp = AREF (Vsyntax_code_object, (int) Sword); + temp = AREF (Vsyntax_code_object, Sword); char_table_set_range (Vstandard_syntax_table, 0x80, MAX_CHAR, temp); } === modified file 'src/syntax.h' --- src/syntax.h 2013-01-01 09:11:05 +0000 +++ src/syntax.h 2013-06-20 18:59:08 +0000 @@ -19,7 +19,7 @@ along with GNU Emacs. If not, see . */ -extern void update_syntax_table (ptrdiff_t, EMACS_INT, int, Lisp_Object); +extern void update_syntax_table (ptrdiff_t, EMACS_INT, bool, Lisp_Object); /* The standard syntax table is stored where it will automatically be used in all new buffers. */ @@ -99,7 +99,7 @@ _syntax_temp = SYNTAX_ENTRY (c); \ (CONSP (_syntax_temp) \ ? XINT (XCAR (_syntax_temp)) \ - : (int) Swhitespace); }) + : Swhitespace); }) #define SYNTAX_MATCH(c) \ ({ Lisp_Object _syntax_temp; \ @@ -112,14 +112,14 @@ #define SYNTAX(c) \ (syntax_temp = SYNTAX_ENTRY ((c)), \ (CONSP (syntax_temp) \ - ? (enum syntaxcode) (XINT (XCAR (syntax_temp)) & 0xff) \ + ? (enum syntaxcode) (XINT (XCAR (syntax_temp)) & 0xff) \ : Swhitespace)) #define SYNTAX_WITH_FLAGS(c) \ (syntax_temp = SYNTAX_ENTRY ((c)), \ (CONSP (syntax_temp) \ - ? XINT (XCAR (syntax_temp)) \ - : (int) Swhitespace)) + ? XINT (XCAR (syntax_temp)) \ + : Swhitespace)) #define SYNTAX_MATCH(c) \ (syntax_temp = SYNTAX_ENTRY ((c)), \ @@ -130,17 +130,17 @@ /* Whether the syntax of the character C has the prefix flag set. */ -extern int syntax_prefix_flag_p (int c); - -/* This array, indexed by a character, contains the syntax code which that - character signifies (as a char). For example, - (enum syntaxcode) syntax_spec_code['w'] is Sword. */ - -extern unsigned char syntax_spec_code[0400]; +extern bool syntax_prefix_flag_p (int c); + +/* This array, indexed by a character less than 256, contains the + syntax code which that character signifies (as an unsigned char). + For example, syntax_spec_code['w'] == Sword. */ + +extern unsigned char const syntax_spec_code[0400]; /* Indexed by syntax code, give the letter that describes it. */ -extern char syntax_code_spec[16]; +extern char const syntax_code_spec[16]; /* Convert the byte offset BYTEPOS into a character position, for the object recorded in gl_state with SETUP_SYNTAX_TABLE_FOR_OBJECT. ------------------------------------------------------------ revno: 113100 fixes bug: http://debbugs.gnu.org/14669 committer: Eli Zaretskii branch nick: trunk timestamp: Thu 2013-06-20 20:36:24 +0300 message: Yet another attempt at fixing bugs #14602, 14630, 14669. src/w32fns.c (w32_wnd_proc): Don't compute the header line and mode line dimensions here, to avoid race conditions with the main thread. src/w32term.c (w32_draw_window_cursor): Compute the header line and mode line dimensions here. : : New variables. src/w32term.h: Declare them. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-06-20 14:47:46 +0000 +++ src/ChangeLog 2013-06-20 17:36:24 +0000 @@ -1,3 +1,16 @@ +2013-06-20 Eli Zaretskii + + * w32fns.c (w32_wnd_proc): Don't compute the header line and mode + line dimensions here, to avoid race conditions with the main + thread. (Bug#14062, bug#14630, bug#14669) + + * w32term.c (w32_draw_window_cursor): Compute the header line and + mode line dimensions here. + : + : New variables. + + * w32term.h: Declare them. + 2013-06-20 Paul Eggert * alloc.c (die): Move "assertion failed" string here ... === modified file 'src/w32fns.c' --- src/w32fns.c 2013-06-17 16:28:47 +0000 +++ src/w32fns.c 2013-06-20 17:36:24 +0000 @@ -3175,23 +3175,39 @@ HIMC context; struct window *w; + /* Implementation note: The code below does something that + one shouldn't do: it accesses the window object from a + separate thread, while the main (a.k.a. "Lisp") thread + runs and can legitimately delete and even GC it. That is + why we are extra careful not to futz with a window that + is different from the one recorded when the system caret + coordinates were last modified. That is also why we are + careful not to move the IME window if the window + described by W was deleted, as indicated by its buffer + field being reset to nil. */ f = x_window_to_frame (dpyinfo, hwnd); w = XWINDOW (FRAME_SELECTED_WINDOW (f)); + /* Punt if someone changed the frame's selected window + behind our back. */ + if (w != w32_system_caret_window) + break; form.dwStyle = CFS_RECT; form.ptCurrentPos.x = w32_system_caret_x; form.ptCurrentPos.y = w32_system_caret_y; form.rcArea.left = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, 0); - form.rcArea.top = WINDOW_TOP_EDGE_Y (w); - if (BUFFERP (w->contents) - && FRAMEP (WINDOW_FRAME (w))) - form.rcArea.top += WINDOW_HEADER_LINE_HEIGHT (w); + form.rcArea.top = (WINDOW_TOP_EDGE_Y (w) + + w32_system_caret_hdr_height); form.rcArea.right = (WINDOW_BOX_RIGHT_EDGE_X (w) - WINDOW_RIGHT_MARGIN_WIDTH (w) - WINDOW_RIGHT_FRINGE_WIDTH (w)); form.rcArea.bottom = (WINDOW_BOTTOM_EDGE_Y (w) - - WINDOW_MODE_LINE_HEIGHT (w)); + - w32_system_caret_mode_height); + + /* Punt if the window was deleted behind our back. */ + if (!BUFFERP (w->contents)) + break; context = get_ime_context_fn (hwnd); === modified file 'src/w32term.c' --- src/w32term.c 2013-06-03 19:06:09 +0000 +++ src/w32term.c 2013-06-20 17:36:24 +0000 @@ -151,6 +151,9 @@ int w32_system_caret_height; int w32_system_caret_x; int w32_system_caret_y; +struct window *w32_system_caret_window; +int w32_system_caret_hdr_height; +int w32_system_caret_mode_height; DWORD dwWindowsThreadId = 0; HANDLE hWindowsThread = NULL; DWORD dwMainThreadId = 0; @@ -5328,6 +5331,9 @@ w32_system_caret_y = (WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y) + glyph_row->ascent - w->phys_cursor_ascent); + w32_system_caret_window = w; + w32_system_caret_hdr_height = WINDOW_HEADER_LINE_HEIGHT (w); + w32_system_caret_mode_height = WINDOW_MODE_LINE_HEIGHT (w); PostMessage (hwnd, WM_IME_STARTCOMPOSITION, 0, 0); === modified file 'src/w32term.h' --- src/w32term.h 2013-06-03 19:28:13 +0000 +++ src/w32term.h 2013-06-20 17:36:24 +0000 @@ -750,6 +750,9 @@ extern int w32_system_caret_height; extern int w32_system_caret_x; extern int w32_system_caret_y; +extern struct window *w32_system_caret_window; +extern int w32_system_caret_hdr_height; +extern int w32_system_caret_mode_height; #ifdef _MSC_VER #ifndef EnumSystemLocales ------------------------------------------------------------ revno: 113099 author: Paul Eggert committer: Paul Eggert branch nick: trunk timestamp: Thu 2013-06-20 07:47:46 -0700 message: * alloc.c (die): Move "assertion failed" string here ... * lisp.h (eassert): ... from here. Also, suppress evaluation of COND when SUPPRESS_CHECKING. This shrinks the executable text size by 0.8% to 2.2% when configured with --enable-checking, depending on optimization flags (GCC 4.8.1 x86-64). diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-06-20 14:15:42 +0000 +++ src/ChangeLog 2013-06-20 14:47:46 +0000 @@ -1,5 +1,11 @@ 2013-06-20 Paul Eggert + * alloc.c (die): Move "assertion failed" string here ... + * lisp.h (eassert): ... from here. Also, suppress evaluation of + COND when SUPPRESS_CHECKING. This shrinks the executable text + size by 0.8% to 2.2% when configured with --enable-checking, + depending on optimization flags (GCC 4.8.1 x86-64). + * floatfns.c (Flog10): Move to Lisp (marked obsolete there). 2013-06-20 Rüdiger Sonderfeld === modified file 'src/alloc.c' --- src/alloc.c 2013-06-17 06:03:19 +0000 +++ src/alloc.c 2013-06-20 14:47:46 +0000 @@ -6515,7 +6515,7 @@ void die (const char *msg, const char *file, int line) { - fprintf (stderr, "\r\n%s:%d: Emacs fatal error: %s\r\n", + fprintf (stderr, "\r\n%s:%d: Emacs fatal error: assertion failed: %s\r\n", file, line, msg); terminate_due_to_signal (SIGABRT, INT_MAX); } === modified file 'src/lisp.h' --- src/lisp.h 2013-06-18 17:15:25 +0000 +++ src/lisp.h 2013-06-20 14:47:46 +0000 @@ -130,9 +130,9 @@ extern bool suppress_checking EXTERNALLY_VISIBLE; # define eassert(cond) \ - ((cond) || suppress_checking \ + (suppress_checking || (cond) \ ? (void) 0 \ - : die ("assertion failed: " # cond, __FILE__, __LINE__)) + : die (# cond, __FILE__, __LINE__)) #endif /* ENABLE_CHECKING */ /* Use the configure flag --enable-check-lisp-object-type to make ------------------------------------------------------------ revno: 113098 committer: Paul Eggert branch nick: trunk timestamp: Thu 2013-06-20 07:15:42 -0700 message: Add log2 support and make log10 obsolete for consistency. * configure.ac (log2): Check for this function. * doc/lispref/numbers.texi (Math Functions): Remove obsolete function log10. * lisp/subr.el (log10): Move here from C code, and declare as obsolete. All uses of (log10 X) replaced with (log X 10). * src/floatfns.c (Flog) [HAVE_LOG2]: Use log2 if available and if the base is 2; this is more accurate. (Flog10): Move to Lisp (marked obsolete there). diff: === modified file 'ChangeLog' --- ChangeLog 2013-06-19 20:10:57 +0000 +++ ChangeLog 2013-06-20 14:15:42 +0000 @@ -1,3 +1,7 @@ +2013-06-20 Rüdiger Sonderfeld + + * configure.ac (log2): Check for this function. + 2013-06-19 Juanma Barranquero * .bzrignore: Add GNU GLOBAL files. === modified file 'configure.ac' --- configure.ac 2013-06-17 06:03:19 +0000 +++ configure.ac 2013-06-20 14:15:42 +0000 @@ -3235,7 +3235,7 @@ difftime posix_memalign \ getpwent endpwent getgrent endgrent \ touchlock \ -cfmakeraw cfsetspeed copysign __executable_start) +cfmakeraw cfsetspeed copysign __executable_start log2) ## Eric Backus says, HP-UX 9.x on HP 700 machines ## has a broken `rint' in some library versions including math library === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2013-06-19 13:51:47 +0000 +++ doc/lispref/ChangeLog 2013-06-20 14:15:42 +0000 @@ -1,3 +1,7 @@ +2013-06-20 Paul Eggert + + * numbers.texi (Math Functions): Remove obsolete function log10. + 2013-06-19 Stefan Monnier * modes.texi (Mode Line Data, Properties in Mode): Advertise `keymap' === modified file 'doc/lispref/numbers.texi' --- doc/lispref/numbers.texi 2013-01-01 09:11:05 +0000 +++ doc/lispref/numbers.texi 2013-06-20 14:15:42 +0000 @@ -1156,11 +1156,6 @@ returns a NaN. @end defun -@defun log10 arg -This function returns the logarithm of @var{arg}, with base 10: -@code{(log10 @var{x})} @equiv{} @code{(log @var{x} 10)}. -@end defun - @defun expt x y This function returns @var{x} raised to power @var{y}. If both arguments are integers and @var{y} is positive, the result is an === modified file 'etc/NEWS' --- etc/NEWS 2013-06-18 22:13:25 +0000 +++ etc/NEWS 2013-06-20 14:15:42 +0000 @@ -469,6 +469,7 @@ ** New macro with-eval-after-load. Like eval-after-load, but better behaved. ** Obsoleted functions: +*** `log10' *** `dont-compile' *** `lisp-complete-symbol' *** `field-complete' === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-20 11:57:33 +0000 +++ lisp/ChangeLog 2013-06-20 14:15:42 +0000 @@ -1,3 +1,8 @@ +2013-06-20 Paul Eggert + + * subr.el (log10): Move here from C code, and declare as obsolete. + All uses of (log10 X) replaced with (log X 10). + 2013-06-20 Juanma Barranquero * emacs-lisp/tabulated-list.el (tabulated-list-format): Fix typo. === modified file 'lisp/allout.el' --- lisp/allout.el 2013-06-10 14:37:02 +0000 +++ lisp/allout.el 2013-06-20 14:15:42 +0000 @@ -5342,7 +5342,7 @@ (cons (make-string (1+ (truncate (if (zerop (car flat-index)) 1 - (log10 (car flat-index))))) + (log (car flat-index) 10)))) ? ) result))) (setq flat-index (cdr flat-index))) @@ -5382,7 +5382,7 @@ (cons (make-string (1+ (truncate (if (zerop (car flat-index)) 1 - (log10 (car flat-index))))) + (log (car flat-index) 10)))) ? ) result))) (setq flat-index (cdr flat-index))) === modified file 'lisp/calc/calc.el' --- lisp/calc/calc.el 2013-04-28 16:39:10 +0000 +++ lisp/calc/calc.el 2013-06-20 14:15:42 +0000 @@ -2485,7 +2485,7 @@ (defconst math-bignum-digit-length - (truncate (/ (log10 (/ most-positive-fixnum 2)) 2)) + (truncate (/ (log (/ most-positive-fixnum 2) 10) 2)) "The length of a \"digit\" in Calc bignums. If a big integer is of the form (bigpos N0 N1 ...), this is the length of the allowable Emacs integers N0, N1,... === modified file 'lisp/subr.el' --- lisp/subr.el 2013-06-14 04:11:00 +0000 +++ lisp/subr.el 2013-06-20 14:15:42 +0000 @@ -1206,6 +1206,11 @@ (declare (obsolete make-hash-table "22.1")) (make-hash-table :test (or test 'eql))) +(defun log10 (x) + "Return (log X 10), the log base 10 of X." + (declare (obsolete log "24.4")) + (log x 10)) + ;; These are used by VM and some old programs (defalias 'focus-frame 'ignore "") (make-obsolete 'focus-frame "it does nothing." "22.1") === modified file 'lisp/textmodes/rst.el' --- lisp/textmodes/rst.el 2013-05-15 23:55:41 +0000 +++ lisp/textmodes/rst.el 2013-06-20 14:15:42 +0000 @@ -2419,8 +2419,8 @@ ;; for the numbers. (if (cdr node) (setq fmt (format "%%-%dd" - (1+ (floor (log10 (length - (cdr node)))))))))) + (1+ (floor (log (length (cdr node)) + 10)))))))) (dolist (child (cdr node)) (rst-toc-insert-node child === modified file 'src/ChangeLog' --- src/ChangeLog 2013-06-19 20:10:57 +0000 +++ src/ChangeLog 2013-06-20 14:15:42 +0000 @@ -1,3 +1,12 @@ +2013-06-20 Paul Eggert + + * floatfns.c (Flog10): Move to Lisp (marked obsolete there). + +2013-06-20 Rüdiger Sonderfeld + + * floatfns.c (Flog) [HAVE_LOG2]: Use log2 if available and if the + base is 2; this is more accurate. + 2013-06-19 Juanma Barranquero * sound.c (string_default): Move to !WINDOWSNT section. === modified file 'src/floatfns.c' --- src/floatfns.c 2013-06-20 01:19:43 +0000 +++ src/floatfns.c 2013-06-20 14:15:42 +0000 @@ -25,7 +25,8 @@ /* C89 requires only the following math.h functions, and Emacs omits the starred functions since we haven't found a use for them: acos, asin, atan, atan2, ceil, cos, *cosh, exp, fabs, floor, fmod, - frexp, ldexp, log, log10, *modf, pow, sin, *sinh, sqrt, tan, *tanh. + frexp, ldexp, log, log10 [via (log X 10)], *modf, pow, sin, *sinh, + sqrt, tan, *tanh. C99 and C11 require the following math.h functions in addition to the C89 functions. Of these, Emacs currently exports only the @@ -33,10 +34,10 @@ acosh, atanh, cbrt, *copysign, erf, erfc, exp2, expm1, fdim, fma, fmax, fmin, fpclassify, hypot, ilogb, isfinite, isgreater, isgreaterequal, isinf, isless, islessequal, islessgreater, *isnan, - isnormal, isunordered, lgamma, log1p, log2, *logb (approximately), - lrint/llrint, lround/llround, nan, nearbyint, nextafter, - nexttoward, remainder, remquo, *rint, round, scalbln, scalbn, - signbit, tgamma, trunc. + isnormal, isunordered, lgamma, log1p, *log2 [via (log X 2)], *logb + (approximately), lrint/llrint, lround/llround, nan, nearbyint, + nextafter, nexttoward, remainder, remquo, *rint, round, scalbln, + scalbn, signbit, tgamma, trunc. */ #include @@ -252,21 +253,16 @@ if (b == 10.0) d = log10 (d); +#if HAVE_LOG2 + else if (b == 2.0) + d = log2 (d); +#endif else d = log (d) / log (b); } return make_float (d); } -DEFUN ("log10", Flog10, Slog10, 1, 1, 0, - doc: /* Return the logarithm base 10 of ARG. */) - (Lisp_Object arg) -{ - double d = extract_float (arg); - d = log10 (d); - return make_float (d); -} - DEFUN ("sqrt", Fsqrt, Ssqrt, 1, 1, 0, doc: /* Return the square root of ARG. */) (Lisp_Object arg) @@ -564,7 +560,6 @@ defsubr (&Sexp); defsubr (&Sexpt); defsubr (&Slog); - defsubr (&Slog10); defsubr (&Ssqrt); defsubr (&Sabs); ------------------------------------------------------------ revno: 113097 committer: Juanma Barranquero branch nick: trunk timestamp: Thu 2013-06-20 13:57:33 +0200 message: lisp/emacs-lisp/tabulated-list.el: Use defvar-local, setq-local. (tabulated-list-format): Fix typo. Declare with `defvar-local'. (tabulated-list-use-header-line, tabulated-list-entries) (tabulated-list-padding, tabulated-list-printer) (tabulated-list-sort-key): Declare with `defvar-local'. (tabulated-list-init-header, tabulated-list-print-fake-header): Use `setq-local'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-20 11:46:59 +0000 +++ lisp/ChangeLog 2013-06-20 11:57:33 +0000 @@ -1,7 +1,17 @@ +2013-06-20 Juanma Barranquero + + * emacs-lisp/tabulated-list.el (tabulated-list-format): Fix typo. + Declare with `defvar-local'. + (tabulated-list-use-header-line, tabulated-list-entries) + (tabulated-list-padding, tabulated-list-printer) + (tabulated-list-sort-key): Declare with `defvar-local'. + (tabulated-list-init-header, tabulated-list-print-fake-header): + Use `setq-local'. + 2013-06-20 Michael Albinus - * arc-mode.el (archive-mode): Add `archive-write-file' - `write-contents-functions' to also for remote files. (Bug#14652) + * arc-mode.el (archive-mode): Add `archive-write-file' to + `write-contents-functions' also for remote files. (Bug#14652) 2013-06-20 Juanma Barranquero === modified file 'lisp/emacs-lisp/tabulated-list.el' --- lisp/emacs-lisp/tabulated-list.el 2013-05-14 07:35:21 +0000 +++ lisp/emacs-lisp/tabulated-list.el 2013-06-20 11:57:33 +0000 @@ -41,7 +41,7 @@ ;; major mode, switch back, and have the original Tabulated List data ;; still valid. See, for example, ebuff-menu.el. -(defvar tabulated-list-format nil +(defvar-local tabulated-list-format nil "The format of the current Tabulated List mode buffer. This should be a vector of elements (NAME WIDTH SORT . PROPS), where: @@ -58,17 +58,15 @@ of `tabulated-list-entries'. - PROPS is a plist of additional column properties. Currently supported properties are: - - `:right-align': if non-nil, the column should be right-aligned. + - `:right-align': If non-nil, the column should be right-aligned. - `:pad-right': Number of additional padding spaces to the right of the column (defaults to 1 if omitted).") -(make-variable-buffer-local 'tabulated-list-format) (put 'tabulated-list-format 'permanent-local t) -(defvar tabulated-list-use-header-line t +(defvar-local tabulated-list-use-header-line t "Whether the Tabulated List buffer should use a header line.") -(make-variable-buffer-local 'tabulated-list-use-header-line) -(defvar tabulated-list-entries nil +(defvar-local tabulated-list-entries nil "Entries displayed in the current Tabulated List buffer. This should be either a function, or a list. If a list, each element has the form (ID [DESC1 ... DESCN]), @@ -86,28 +84,25 @@ If `tabulated-list-entries' is a function, it is called with no arguments and must return a list of the above form.") -(make-variable-buffer-local 'tabulated-list-entries) (put 'tabulated-list-entries 'permanent-local t) -(defvar tabulated-list-padding 0 +(defvar-local tabulated-list-padding 0 "Number of characters preceding each Tabulated List mode entry. By default, lines are padded with spaces, but you can use the function `tabulated-list-put-tag' to change this.") -(make-variable-buffer-local 'tabulated-list-padding) (put 'tabulated-list-padding 'permanent-local t) (defvar tabulated-list-revert-hook nil "Hook run before reverting a Tabulated List buffer. This is commonly used to recompute `tabulated-list-entries'.") -(defvar tabulated-list-printer 'tabulated-list-print-entry +(defvar-local tabulated-list-printer 'tabulated-list-print-entry "Function for inserting a Tabulated List entry at point. It is called with two arguments, ID and COLS. ID is a Lisp object identifying the entry, and COLS is a vector of column descriptors, as documented in `tabulated-list-entries'.") -(make-variable-buffer-local 'tabulated-list-printer) -(defvar tabulated-list-sort-key nil +(defvar-local tabulated-list-sort-key nil "Sort key for the current Tabulated List mode buffer. If nil, no additional sorting is performed. Otherwise, this should be a cons cell (NAME . FLIP). @@ -115,7 +110,6 @@ `tabulated-list-format' (the corresponding SORT entry in `tabulated-list-format' then specifies how to sort). FLIP, if non-nil, means to invert the resulting sort.") -(make-variable-buffer-local 'tabulated-list-sort-key) (put 'tabulated-list-sort-key 'permanent-local t) (defsubst tabulated-list-get-id (&optional pos) @@ -246,7 +240,7 @@ (if tabulated-list-use-header-line (setq header-line-format cols) (setq header-line-format nil) - (set (make-local-variable 'tabulated-list--header-string) cols)))) + (setq-local tabulated-list--header-string cols)))) (defun tabulated-list-print-fake-header () "Insert a fake Tabulated List \"header line\" at the start of the buffer." @@ -255,8 +249,8 @@ (insert tabulated-list--header-string "\n") (if tabulated-list--header-overlay (move-overlay tabulated-list--header-overlay (point-min) (point)) - (set (make-local-variable 'tabulated-list--header-overlay) - (make-overlay (point-min) (point)))) + (setq-local tabulated-list--header-overlay + (make-overlay (point-min) (point)))) (overlay-put tabulated-list--header-overlay 'face 'underline))) (defun tabulated-list-revert (&rest ignored) @@ -351,7 +345,7 @@ (defun tabulated-list-print-col (n col-desc x) "Insert a specified Tabulated List entry at point. -N is the column number, COL-DESC is a column descriptor \(see +N is the column number, COL-DESC is a column descriptor (see `tabulated-list-entries'), and X is the column number at point. Return the column number after insertion." ;; TODO: don't truncate to `width' if the next column is align-right ------------------------------------------------------------ revno: 113096 committer: Michael Albinus branch nick: trunk timestamp: Thu 2013-06-20 13:46:59 +0200 message: Fix ChangeLog entry. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-20 11:45:45 +0000 +++ lisp/ChangeLog 2013-06-20 11:46:59 +0000 @@ -1,7 +1,7 @@ 2013-06-20 Michael Albinus - * arc-mode.el (archive-mode): Add `archive-write-file' also for - remote files. (Bug#14652) + * arc-mode.el (archive-mode): Add `archive-write-file' + `write-contents-functions' to also for remote files. (Bug#14652) 2013-06-20 Juanma Barranquero ------------------------------------------------------------ revno: 113095 committer: Michael Albinus branch nick: trunk timestamp: Thu 2013-06-20 13:45:45 +0200 message: * arc-mode.el (archive-mode): Add `archive-write-file' also for remote files. (Bug#14652) diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-20 11:29:30 +0000 +++ lisp/ChangeLog 2013-06-20 11:45:45 +0000 @@ -1,3 +1,8 @@ +2013-06-20 Michael Albinus + + * arc-mode.el (archive-mode): Add `archive-write-file' also for + remote files. (Bug#14652) + 2013-06-20 Juanma Barranquero * cus-edit.el (custom-commands): Fix typos. === modified file 'lisp/arc-mode.el' --- lisp/arc-mode.el 2013-02-09 12:52:01 +0000 +++ lisp/arc-mode.el 2013-06-20 11:45:45 +0000 @@ -689,9 +689,7 @@ (setq revert-buffer-function 'archive-mode-revert) (auto-save-mode 0) - ;; Remote archives are not written by a hook. - (if archive-remote nil - (add-hook 'write-contents-functions 'archive-write-file nil t)) + (add-hook 'write-contents-functions 'archive-write-file nil t) (make-local-variable 'require-final-newline) (setq require-final-newline nil) ------------------------------------------------------------ revno: 113094 committer: Juanma Barranquero branch nick: trunk timestamp: Thu 2013-06-20 13:29:30 +0200 message: lisp/(cus-edit,custom).el: Fix typos; use setq-local, string-match-p, looking-at-p. * lisp/cus-edit.el: (custom-commands): Fix typos. (custom-display): Fix tooltip text. (custom-magic-alist, custom-filter-face-spec, custom-group-members): Fix typos in docstrings. (custom--initialize-widget-variables, Custom-mode): Use `setq-local'. (custom-unlispify-menu-entry, custom-magic-value-create) (custom-add-see-also, custom-group-value-create): Use ?\s. (custom-guess-type, customize-apropos, editable-field) (custom-face-value-create): Use `string-match-p'. (custom-save-variables, custom-save-faces): Use `looking-at-p'. * lisp/custom.el (custom-load-symbol): Use `string-match-p'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-20 10:28:23 +0000 +++ lisp/ChangeLog 2013-06-20 11:29:30 +0000 @@ -1,5 +1,18 @@ 2013-06-20 Juanma Barranquero + * cus-edit.el (custom-commands): Fix typos. + (custom-display): Fix tooltip text. + (custom-magic-alist, custom-filter-face-spec, custom-group-members): + Fix typos in docstrings. + (custom--initialize-widget-variables, Custom-mode): Use `setq-local'. + (custom-unlispify-menu-entry, custom-magic-value-create) + (custom-add-see-also, custom-group-value-create): Use ?\s. + (custom-guess-type, customize-apropos, editable-field) + (custom-face-value-create): Use `string-match-p'. + (custom-save-variables, custom-save-faces): Use `looking-at-p'. + + * custom.el (custom-load-symbol): Use `string-match-p'. + * ansi-color.el: Convert to lexical binding. (ansi-colors): Fix URL. (ansi-color-context, ansi-color-context-region): Use defvar-local. === modified file 'lisp/cus-edit.el' --- lisp/cus-edit.el 2013-05-08 06:59:41 +0000 +++ lisp/cus-edit.el 2013-06-20 11:29:30 +0000 @@ -558,7 +558,7 @@ (setq prefixes nil) (delete-region (point-min) (point))) (setq prefixes (cdr prefixes)))))) - (subst-char-in-region (point-min) (point-max) ?- ?\ t) + (subst-char-in-region (point-min) (point-max) ?- ?\s t) (capitalize-region (point-min) (point-max)) (unless no-suffix (goto-char (point-max)) @@ -629,7 +629,7 @@ (while names (setq current (car names) names (cdr names)) - (when (string-match (nth 0 current) name) + (when (string-match-p (nth 0 current) name) (setq found (nth 1 current) names nil))) (unless found @@ -639,7 +639,7 @@ (while docs (setq current (car docs) docs (cdr docs)) - (when (string-match (nth 0 current) doc) + (when (string-match-p (nth 0 current) doc) (setq found (nth 1 current) docs nil)))))) found)) @@ -731,7 +731,7 @@ (defvar custom-commands '((" Apply " Custom-set t - "Apply settings (for the current session only)" + "Apply settings (for the current session only)." "index" "Apply") (" Apply and Save " Custom-save @@ -1421,8 +1421,8 @@ "Customize loaded options, faces and groups matching PATTERN. PATTERN can be a word, a list of words (separated by spaces), or a regexp (using some regexp special characters). If it is a word, -search for matches for that word as a substring. If it is a list of words, -search for matches for any two (or more) of those words. +search for matches for that word as a substring. If it is a list of +words, search for matches for any two (or more) of those words. If TYPE is `options', include only options. If TYPE is `faces', include only faces. @@ -1435,7 +1435,7 @@ (let (found) (mapatoms `(lambda (symbol) - (when (string-match apropos-regexp (symbol-name symbol)) + (when (string-match-p apropos-regexp (symbol-name symbol)) ,(if (memq type '(nil groups)) '(if (get symbol 'custom-group) (push (list symbol 'custom-group) found))) @@ -1832,7 +1832,7 @@ (widget-put (get 'editable-field 'widget-type) :custom-show (lambda (_widget value) (let ((pp (pp-to-string value))) - (cond ((string-match "\n" pp) + (cond ((string-match-p "\n" pp) nil) ((> (length pp) 40) nil) @@ -1973,7 +1973,7 @@ left out, ITEM-DESC will be used. The string %c in either description will be replaced with the -category of the item. These are `group'. `option', and `face'. +category of the item. These are `group', `option', and `face'. The list should be sorted most significant first.") @@ -2039,7 +2039,7 @@ (when (and (eq category 'group) (not (and (eq custom-buffer-style 'links) (> (widget-get parent :custom-level) 1)))) - (insert-char ?\ (* custom-buffer-indent + (insert-char ?\s (* custom-buffer-indent (widget-get parent :custom-level)))) (push (widget-create-child-and-convert widget 'choice-item @@ -2064,7 +2064,7 @@ (when (and (eq category 'group) (not (and (eq custom-buffer-style 'links) (> (widget-get parent :custom-level) 1)))) - (insert-char ?\ (* custom-buffer-indent + (insert-char ?\s (* custom-buffer-indent (widget-get parent :custom-level)))) (when custom-magic-show-button (when custom-magic-show @@ -2293,7 +2293,7 @@ (indent (widget-get widget :indent))) (when links (when indent - (insert-char ?\ indent)) + (insert-char ?\s indent)) (when prefix (insert prefix)) (insert "See also ") @@ -3227,7 +3227,7 @@ pm) (const :format "W32 " :sibling-args (:help-echo "\ -Windows NT/9X.") +MS Windows.") w32) (const :format "NS " :sibling-args (:help-echo "\ @@ -3348,7 +3348,7 @@ "Converted version of the `custom-face-all' widget.") (defun custom-filter-face-spec (spec filter-index &optional default-filter) - "Return a canonicalized version of SPEC using. + "Return a canonicalized version of SPEC. FILTER-INDEX is the index in the entry for each attribute in `custom-face-attributes' at which the appropriate filter function can be found, and DEFAULT-FILTER is the filter to apply for attributes that @@ -3473,7 +3473,7 @@ (widget-specify-sample widget opoint (point))) (insert (cond ((eq custom-buffer-style 'face) " ") - ((string-match "face\\'" tag) ":") + ((string-match-p "face\\'" tag) ":") (t " face: "))) ;; Face sample. @@ -3947,7 +3947,7 @@ (defun custom-group-members (symbol groups-only) "Return SYMBOL's custom group members. -If GROUPS-ONLY non-nil, return only those members that are groups." +If GROUPS-ONLY is non-nil, return only those members that are groups." (if (not groups-only) (get symbol 'custom-group) (let (members) @@ -4058,7 +4058,7 @@ :tag tag symbol) buttons) - (insert-char ?\ (* custom-buffer-indent (1- level))) + (insert-char ?\s (* custom-buffer-indent (1- level))) (insert "-- ") (push (widget-create-child-and-convert widget 'custom-group-visibility @@ -4098,7 +4098,7 @@ (when (eq level 1) (if (custom-add-parent-links widget "Parent groups:") (insert "\n"))) - (insert-char ?\ (* custom-buffer-indent (1- level))) + (insert-char ?\s (* custom-buffer-indent (1- level))) ;; Create tag. (let ((start (point))) (insert tag " group: ") @@ -4137,11 +4137,11 @@ (if nil ;;; This should test that the buffer ;;; was not made to display a group. (when (eq level 1) - (insert-char ?\ custom-buffer-indent) + (insert-char ?\s custom-buffer-indent) (custom-add-parent-links widget))) (custom-add-see-also widget (make-string (* custom-buffer-indent level) - ?\ )) + ?\s)) ;; Members. (message "Creating group...") (let* ((members (custom-sort-items @@ -4326,7 +4326,7 @@ save all customizations in this file, but does not load it. When you change this variable outside Custom, look in the -previous custom file \(usually your init file) for the +previous custom file (usually your init file) for the forms `(custom-set-variables ...)' and `(custom-set-faces ...)', and copy them (whichever ones you find) to the new custom file. This will preserve your existing customizations. @@ -4337,7 +4337,7 @@ `custom-set-variables' and `custom-set-faces' forms already present in that file. It will not delete any customizations from the old custom file. You should do that manually if that is what you -want. You also have to put something like `\(load \"CUSTOM-FILE\") +want. You also have to put something like `(load \"CUSTOM-FILE\") in your init file, where CUSTOM-FILE is the actual name of the file. Otherwise, Emacs will not load the file when it starts up, and hence will not set `custom-file' to that file either." @@ -4346,7 +4346,7 @@ :doc "Please read entire docstring below before setting \ this through Custom. -Click on \"More\" \(or position point there and press RETURN) +Click on \"More\" (or position point there and press RETURN) if only the first line of the docstring is shown.")) :group 'customize) @@ -4553,7 +4553,7 @@ (if (bolp) (princ " ")) (princ ")") - (unless (looking-at "\n") + (unless (looking-at-p "\n") (princ "\n"))))) (defun custom-save-faces () @@ -4608,7 +4608,7 @@ (if (bolp) (princ " ")) (princ ")") - (unless (looking-at "\n") + (unless (looking-at-p "\n") (princ "\n"))))) ;;; The Customize Menu. @@ -4759,22 +4759,22 @@ (message "To install your edits, invoke [State] and choose the Set operation"))) (defun custom--initialize-widget-variables () - (set (make-local-variable 'widget-documentation-face) 'custom-documentation) - (set (make-local-variable 'widget-button-face) custom-button) - (set (make-local-variable 'widget-button-pressed-face) custom-button-pressed) - (set (make-local-variable 'widget-mouse-face) custom-button-mouse) + (setq-local widget-documentation-face 'custom-documentation) + (setq-local widget-button-face custom-button) + (setq-local widget-button-pressed-face custom-button-pressed) + (setq-local widget-mouse-face custom-button-mouse) ;; We need this because of the "More" button on docstrings. ;; Otherwise clicking on "More" can push point offscreen, which ;; causes the window to recenter on point, which pushes the ;; newly-revealed docstring offscreen; which is annoying. -- cyd. - (set (make-local-variable 'widget-button-click-moves-point) t) + (setq-local widget-button-click-moves-point t) ;; When possible, use relief for buttons, not bracketing. This test ;; may not be optimal. (when custom-raised-buttons - (set (make-local-variable 'widget-push-button-prefix) "") - (set (make-local-variable 'widget-push-button-suffix) "") - (set (make-local-variable 'widget-link-prefix) "") - (set (make-local-variable 'widget-link-suffix) "")) + (setq-local widget-push-button-prefix "") + (setq-local widget-push-button-suffix "") + (setq-local widget-link-prefix "") + (setq-local widget-link-suffix "")) (setq show-trailing-whitespace nil)) (define-obsolete-variable-alias 'custom-mode-hook 'Custom-mode-hook "23.1") @@ -4802,17 +4802,17 @@ if that value is non-nil." (use-local-map custom-mode-map) (easy-menu-add Custom-mode-menu) - (set (make-local-variable 'tool-bar-map) - (or custom-tool-bar-map - ;; Set up `custom-tool-bar-map'. - (let ((map (make-sparse-keymap))) - (mapc - (lambda (arg) - (tool-bar-local-item-from-menu - (nth 1 arg) (nth 4 arg) map custom-mode-map - :label (nth 5 arg))) - custom-commands) - (setq custom-tool-bar-map map)))) + (setq-local tool-bar-map + (or custom-tool-bar-map + ;; Set up `custom-tool-bar-map'. + (let ((map (make-sparse-keymap))) + (mapc + (lambda (arg) + (tool-bar-local-item-from-menu + (nth 1 arg) (nth 4 arg) map custom-mode-map + :label (nth 5 arg))) + custom-commands) + (setq custom-tool-bar-map map)))) (make-local-variable 'custom-options) (make-local-variable 'custom-local-buffer) (custom--initialize-widget-variables) === modified file 'lisp/custom.el' --- lisp/custom.el 2013-01-02 16:13:04 +0000 +++ lisp/custom.el 2013-06-20 11:29:30 +0000 @@ -77,7 +77,7 @@ "Initialize SYMBOL based on VALUE. Set the symbol, using its `:set' function (or `set-default' if it has none). The value is either the symbol's current value - \(as obtained using the `:get' function), if any, + (as obtained using the `:get' function), if any, or the value in the symbol's `saved-value' property if any, or (last of all) VALUE." (funcall (or (get symbol 'custom-set) 'set-default) @@ -319,7 +319,7 @@ binding. This is normally not what you want. Thus, if you need to load a file defining variables with this form, or with `defvar' or `defconst', you should always load that file -_outside_ any bindings for these variables. \(`defvar' and +_outside_ any bindings for these variables. (`defvar' and `defconst' behave similarly in this respect.) See Info node `(elisp) Customization' in the Emacs Lisp manual @@ -541,8 +541,8 @@ (defun custom-add-dependencies (symbol value) "To the custom option SYMBOL, add dependencies specified by VALUE. VALUE should be a list of symbols. For each symbol in that list, -this specifies that SYMBOL should be set after the specified symbol, if -both appear in constructs like `custom-set-variables'." +this specifies that SYMBOL should be set after the specified symbol, +if both appear in constructs like `custom-set-variables'." (unless (listp value) (error "Invalid custom dependency `%s'" value)) (let* ((deps (get symbol 'custom-dependencies)) @@ -647,7 +647,7 @@ (found nil)) (dolist (loaded load-history) (and (stringp (car loaded)) - (string-match regexp (car loaded)) + (string-match-p regexp (car loaded)) (setq found t))) found)) ;; Without this, we would load cus-edit recursively. @@ -937,7 +937,7 @@ evaluates to the customized value. EXP will also be stored, without evaluating it, in SYMBOL's `saved-value' property, so that it can be restored via the Customize interface. It is also -added to the alist in SYMBOL's `theme-value' property \(by +added to the alist in SYMBOL's `theme-value' property (by calling `custom-push-theme'). NOW, if present and non-nil, means to install the variable's ------------------------------------------------------------ revno: 113093 committer: Juanma Barranquero branch nick: trunk timestamp: Thu 2013-06-20 12:28:23 +0200 message: Revert revno:113090. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-20 01:03:57 +0000 +++ lisp/ChangeLog 2013-06-20 10:28:23 +0000 @@ -6,9 +6,6 @@ (ansi-color-apply-sequence, ansi-color-map): Fix typos in docstrings. (ansi-color-make-color-map): Rename local var ansi-color-map to map. - * progmodes/prog-mode.el (prettify-symbols-mode) - (global-prettify-symbols-mode, prog-mode): Remove autoload cookies. - 2013-06-19 Lars Magne Ingebrigtsen * net/eww.el (eww-process-text-input): Display passwords as asterisks. === modified file 'lisp/progmodes/prog-mode.el' --- lisp/progmodes/prog-mode.el 2013-06-20 00:39:59 +0000 +++ lisp/progmodes/prog-mode.el 2013-06-20 10:28:23 +0000 @@ -89,6 +89,7 @@ (defvar-local prettify-symbols--keywords nil) +;;;###autoload (define-minor-mode prettify-symbols-mode "Toggle Prettify Symbols mode. With a prefix argument ARG, enable Prettify Symbols mode if ARG is @@ -131,9 +132,11 @@ (local-variable-p 'prettify-symbols-alist)) (prettify-symbols-mode 1))) +;;;###autoload (define-globalized-minor-mode global-prettify-symbols-mode prettify-symbols-mode turn-on-prettify-symbols-mode) +;;;###autoload (define-derived-mode prog-mode fundamental-mode "Prog" "Major mode for editing programming language source code." (setq-local require-final-newline mode-require-final-newline) ------------------------------------------------------------ revno: 113092 committer: Paul Eggert branch nick: trunk timestamp: Wed 2013-06-19 18:19:43 -0700 message: * floatfns.c: Add commentary re C99 and C11. diff: === modified file 'src/floatfns.c' --- src/floatfns.c 2013-06-17 06:03:19 +0000 +++ src/floatfns.c 2013-06-20 01:19:43 +0000 @@ -26,6 +26,17 @@ the starred functions since we haven't found a use for them: acos, asin, atan, atan2, ceil, cos, *cosh, exp, fabs, floor, fmod, frexp, ldexp, log, log10, *modf, pow, sin, *sinh, sqrt, tan, *tanh. + + C99 and C11 require the following math.h functions in addition to + the C89 functions. Of these, Emacs currently exports only the + starred ones to Lisp, since we haven't found a use for the others: + acosh, atanh, cbrt, *copysign, erf, erfc, exp2, expm1, fdim, fma, + fmax, fmin, fpclassify, hypot, ilogb, isfinite, isgreater, + isgreaterequal, isinf, isless, islessequal, islessgreater, *isnan, + isnormal, isunordered, lgamma, log1p, log2, *logb (approximately), + lrint/llrint, lround/llround, nan, nearbyint, nextafter, + nexttoward, remainder, remquo, *rint, round, scalbln, scalbn, + signbit, tgamma, trunc. */ #include