Now on revision 112985. ------------------------------------------------------------ revno: 112985 committer: Glenn Morris branch nick: trunk timestamp: Thu 2013-06-13 23:51:56 -0700 message: New defcustoms need :version tags diff: === modified file 'lisp/gnus/mml2015.el' --- lisp/gnus/mml2015.el 2013-06-14 03:24:05 +0000 +++ lisp/gnus/mml2015.el 2013-06-14 06:51:56 +0000 @@ -148,6 +148,7 @@ (defcustom mml2015-maximum-key-image-dimension 64 "The maximum dimension (width or height) of any key images." + :version "24.4" :group 'mime-security :type 'integer) ------------------------------------------------------------ revno: 112984 committer: Stefan Monnier branch nick: trunk timestamp: Fri 2013-06-14 00:11:00 -0400 message: * lisp/subr.el (eval-after-load, set-temporary-overlay-map): Use indirection through a symbol rather than letrec. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-14 03:20:18 +0000 +++ lisp/ChangeLog 2013-06-14 04:11:00 +0000 @@ -1,5 +1,8 @@ 2013-06-14 Stefan Monnier + * subr.el (eval-after-load, set-temporary-overlay-map): Use indirection + through a symbol rather than letrec. + * emacs-lisp/package.el: Don't recompute dir. Use pkg-descs more. (package-desc): Add `dir' field. (package-desc-full-name): New function. === modified file 'lisp/subr.el' --- lisp/subr.el 2013-06-13 22:24:52 +0000 +++ lisp/subr.el 2013-06-14 04:11:00 +0000 @@ -3794,12 +3794,15 @@ (if (not load-file-name) ;; Not being provided from a file, run func right now. (funcall func) - (let ((lfn load-file-name)) - (letrec ((fun (lambda (file) - (when (equal file lfn) - (remove-hook 'after-load-functions fun) - (funcall func))))) - (add-hook 'after-load-functions fun)))))))) + (let ((lfn load-file-name) + ;; Don't use letrec, because equal (in + ;; add/remove-hook) would get trapped in a cycle. + (fun (make-symbol "eval-after-load-helper"))) + (fset fun (lambda (file) + (when (equal file lfn) + (remove-hook 'after-load-functions fun) + (funcall func)))) + (add-hook 'after-load-functions fun))))))) ;; Add FORM to the element unless it's already there. (unless (member delayed-func (cdr elt)) (nconc elt (list delayed-func))))))) @@ -4282,23 +4285,26 @@ Optional ON-EXIT argument is a function that is called after the deactivation of MAP." - (letrec ((clearfun - (lambda () - ;; FIXME: Handle the case of multiple temporary-overlay-maps - ;; E.g. if isearch and C-u both use temporary-overlay-maps, Then - ;; the lifetime of the C-u should be nested within the isearch - ;; overlay, so the pre-command-hook of isearch should be - ;; suspended during the C-u one so we don't exit isearch just - ;; because we hit 1 after C-u and that 1 exits isearch whereas it - ;; doesn't exit C-u. - (unless (cond ((null keep-pred) nil) - ((eq t keep-pred) - (eq this-command - (lookup-key map (this-command-keys-vector)))) - (t (funcall keep-pred))) - (remove-hook 'pre-command-hook clearfun) - (internal-pop-keymap map 'overriding-terminal-local-map) - (when on-exit (funcall on-exit)))))) + (let ((clearfun (make-symbol "clear-temporary-overlay-map"))) + ;; Don't use letrec, because equal (in add/remove-hook) would get trapped + ;; in a cycle. + (fset clearfun + (lambda () + ;; FIXME: Handle the case of multiple temporary-overlay-maps + ;; E.g. if isearch and C-u both use temporary-overlay-maps, Then + ;; the lifetime of the C-u should be nested within the isearch + ;; overlay, so the pre-command-hook of isearch should be + ;; suspended during the C-u one so we don't exit isearch just + ;; because we hit 1 after C-u and that 1 exits isearch whereas it + ;; doesn't exit C-u. + (unless (cond ((null keep-pred) nil) + ((eq t keep-pred) + (eq this-command + (lookup-key map (this-command-keys-vector)))) + (t (funcall keep-pred))) + (remove-hook 'pre-command-hook clearfun) + (internal-pop-keymap map 'overriding-terminal-local-map) + (when on-exit (funcall on-exit))))) (add-hook 'pre-command-hook clearfun) (internal-push-keymap map 'overriding-terminal-local-map))) ------------------------------------------------------------ revno: 112983 committer: Katsumi Yamaoka branch nick: trunk timestamp: Fri 2013-06-14 03:26:34 +0000 message: lisp/gnus/eww.el: Fix indentation diff: === modified file 'lisp/gnus/eww.el' --- lisp/gnus/eww.el 2013-06-14 03:22:26 +0000 +++ lisp/gnus/eww.el 2013-06-14 03:26:34 +0000 @@ -331,11 +331,11 @@ (url-request-data (mm-url-encode-www-form-urlencoded values))) (eww-browse-url (shr-expand-url (cdr (assq :action form))))) (eww-browse-url - (concat + (concat (if (cdr (assq :action form)) (shr-expand-url (cdr (assq :action form))) eww-current-url) - "?" + "?" (mm-url-encode-www-form-urlencoded values))))))) (defun eww-convert-widgets () ------------------------------------------------------------ revno: 112982 author: David Edmondson committer: Katsumi Yamaoka branch nick: trunk timestamp: Fri 2013-06-14 03:24:05 +0000 message: lisp/gnus/mml2015.el (mml2015-maximum-key-image-dimension): New user option to control the maximum size of photo ID image (mml2015-epg-key-image-to-string): Respect it diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2013-06-14 03:22:26 +0000 +++ lisp/gnus/ChangeLog 2013-06-14 03:24:05 +0000 @@ -1,3 +1,9 @@ +2013-06-14 David Edmondson (tiny change) + + * mml2015.el (mml2015-maximum-key-image-dimension): New user option to + control the maximum size of photo ID image. + (mml2015-epg-key-image-to-string): Respect it. + 2013-06-13 Lars Magne Ingebrigtsen * shr.el (shr-tag-table-1): Mark the preliminary table renderings === modified file 'lisp/gnus/mml2015.el' --- lisp/gnus/mml2015.el 2013-05-22 13:18:40 +0000 +++ lisp/gnus/mml2015.el 2013-06-14 03:24:05 +0000 @@ -146,6 +146,11 @@ :group 'mime-security :type 'boolean) +(defcustom mml2015-maximum-key-image-dimension 64 + "The maximum dimension (width or height) of any key images." + :group 'mime-security + :type 'integer) + ;; Extract plaintext from cleartext signature. IMO, this kind of task ;; should be done by GnuPG rather than Elisp, but older PGP backends ;; (such as Mailcrypt, and PGG) discard the output from GnuPG. @@ -873,13 +878,20 @@ (insert (substring data 16)) (create-image (buffer-string) nil t))))) +(autoload 'gnus-rescale-image "gnus-util") + (defun mml2015-epg-key-image-to-string (key-id) "Return a string with the image of a key, if any" (let* ((result "") (key-image (mml2015-epg-key-image key-id))) (when key-image (setq result " ") - (put-text-property 1 2 'display key-image result)) + (put-text-property + 1 2 'display + (gnus-rescale-image key-image + (cons mml2015-maximum-key-image-dimension + mml2015-maximum-key-image-dimension)) + result)) result)) (defun mml2015-epg-signature-to-string (signature) ------------------------------------------------------------ revno: 112981 author: Lars Magne Ingebrigtsen committer: Katsumi Yamaoka branch nick: trunk timestamp: Fri 2013-06-14 03:22:26 +0000 message: lisp/gnus/shr.el (shr-tag-table-1): Mark the preliminary table renderings instead of the final one so that we can more easily distinguish them lisp/gnus/eww.el (eww-submit): Compute the submission URL correctly diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2013-06-13 17:05:22 +0000 +++ lisp/gnus/ChangeLog 2013-06-14 03:22:26 +0000 @@ -1,3 +1,10 @@ +2013-06-13 Lars Magne Ingebrigtsen + + * shr.el (shr-tag-table-1): Mark the preliminary table renderings + instead of the final one so that we can more easily distinguish them. + + * eww.el (eww-submit): Compute the submission URL correctly. + 2013-06-13 Stefan Monnier * sieve-manage.el (sieve-manage-open-server): Don't quote lambda. === modified file 'lisp/gnus/eww.el' --- lisp/gnus/eww.el 2013-06-13 14:31:52 +0000 +++ lisp/gnus/eww.el 2013-06-14 03:22:26 +0000 @@ -192,7 +192,9 @@ (start (point))) (shr-ensure-paragraph) (shr-generic cont) - (shr-ensure-paragraph) + (unless (bolp) + (insert "\n")) + (insert "\n") (when (> (point) start) (put-text-property start (1+ start) 'eww-form eww-form)))) @@ -235,11 +237,9 @@ :name (cdr (assq :name cont)) :eww-form eww-form))))) (if (eq (car widget) 'hidden) - (when shr-final-table-render - (nconc eww-form (list widget))) - (apply 'widget-create widget)) - (put-text-property start (point) 'eww-widget widget) - (insert " "))) + (nconc eww-form (list widget)) + (apply 'widget-create widget) + (put-text-property start (point) 'eww-widget widget)))) (defun eww-tag-select (cont) (shr-ensure-paragraph) @@ -331,11 +331,12 @@ (url-request-data (mm-url-encode-www-form-urlencoded values))) (eww-browse-url (shr-expand-url (cdr (assq :action form))))) (eww-browse-url - (shr-expand-url (concat - (cdr (assq :action form)) + (if (cdr (assq :action form)) + (shr-expand-url (cdr (assq :action form))) + eww-current-url) "?" - (mm-url-encode-www-form-urlencoded values)))))))) + (mm-url-encode-www-form-urlencoded values))))))) (defun eww-convert-widgets () (let ((start (point-min)) @@ -353,7 +354,9 @@ (plist-get (overlay-properties overlay) 'field)) (delete-overlay overlay))) (delete-region start end)) - (apply 'widget-create widget)) + (when (and widget + (not (eq (car widget) 'hidden))) + (apply 'widget-create widget))) (widget-setup) (eww-fix-widget-keymap))) === modified file 'lisp/gnus/shr.el' --- lisp/gnus/shr.el 2013-06-13 14:31:52 +0000 +++ lisp/gnus/shr.el 2013-06-14 03:22:26 +0000 @@ -115,7 +115,7 @@ (defvar shr-base nil) (defvar shr-ignore-cache nil) (defvar shr-external-rendering-functions nil) -(defvar shr-final-table-render nil) +(defvar shr-preliminary-table-render nil) (defvar shr-map (let ((map (make-sparse-keymap))) @@ -1167,6 +1167,7 @@ (setq cont (or (cdr (assq 'tbody cont)) cont)) (let* ((shr-inhibit-images t) + (shr-preliminary-table-render t) (shr-table-depth (1+ shr-table-depth)) (shr-kinsoku-shorten t) ;; Find all suggested widths. @@ -1188,8 +1189,8 @@ (frame-width)) (setq truncate-lines t)) ;; Then render the table again with these new "hard" widths. - (let ((shr-final-table-render t)) - (shr-insert-table (shr-make-table cont sketch-widths t) sketch-widths))) + (setq shr-preliminary-table-render nil) + (shr-insert-table (shr-make-table cont sketch-widths t) sketch-widths)) ;; Finally, insert all the images after the table. The Emacs buffer ;; model isn't strong enough to allow us to put the images actually ;; into the tables. ------------------------------------------------------------ revno: 112980 committer: Stefan Monnier branch nick: trunk timestamp: Thu 2013-06-13 23:20:18 -0400 message: * lisp/emacs-lisp/package.el: Don't recompute dir. Use pkg-descs more. (package-desc): Add `dir' field. (package-desc-full-name): New function. (package-load-descriptor): Combine the two arguments. Don't use `load'. (package-maybe-load-descriptor): Remove. (package-load-all-descriptors): Just call package-load-descriptor. (package--disabled-p): New function. (package-desc-vers, package-desc-doc): Remove aliases. (package--dir): Remove function. (package-activate): Check if a package is disabled. (package-process-define-package): New function, extracted from define-package. (define-package): Turn into a place holder. (package-unpack-single, package-tar-file-info): Use package--description-file. (package-compute-transaction): Use package--disabled-p. (package-download-transaction): Don't call package-maybe-load-descriptor since they're all loaded anyway. (package-install): Change argument to be a pkg-desc. (package-delete): Use a single pkg-desc argument. (describe-package-1): Use package-desc-dir instead of package--dir. Use package-desc property instead of package-symbol. (package-install-button-action): Adjust accordingly. (package--push): Rewrite. (package-menu--print-info): Adjust accordingly. Change the ID format to be a pkg-desc. (package-menu-describe-package, package-menu-get-status) (package-menu--find-upgrades, package-menu-mark-upgrades) (package-menu-execute, package-menu--name-predicate): Adjust accordingly. * lisp/startup.el (package--description-file): New function. (command-line): Use it. * lisp/emacs-lisp/package-x.el (package-upload-buffer-internal): Use package-desc-version. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-14 02:31:28 +0000 +++ lisp/ChangeLog 2013-06-14 03:20:18 +0000 @@ -1,5 +1,40 @@ 2013-06-14 Stefan Monnier + * emacs-lisp/package.el: Don't recompute dir. Use pkg-descs more. + (package-desc): Add `dir' field. + (package-desc-full-name): New function. + (package-load-descriptor): Combine the two arguments. Don't use `load'. + (package-maybe-load-descriptor): Remove. + (package-load-all-descriptors): Just call package-load-descriptor. + (package--disabled-p): New function. + (package-desc-vers, package-desc-doc): Remove aliases. + (package--dir): Remove function. + (package-activate): Check if a package is disabled. + (package-process-define-package): New function, extracted from + define-package. + (define-package): Turn into a place holder. + (package-unpack-single, package-tar-file-info): + Use package--description-file. + (package-compute-transaction): Use package--disabled-p. + (package-download-transaction): Don't call + package-maybe-load-descriptor since they're all loaded anyway. + (package-install): Change argument to be a pkg-desc. + (package-delete): Use a single pkg-desc argument. + (describe-package-1): Use package-desc-dir instead of package--dir. + Use package-desc property instead of package-symbol. + (package-install-button-action): Adjust accordingly. + (package--push): Rewrite. + (package-menu--print-info): Adjust accordingly. Change the ID format + to be a pkg-desc. + (package-menu-describe-package, package-menu-get-status) + (package-menu--find-upgrades, package-menu-mark-upgrades) + (package-menu-execute, package-menu--name-predicate): + Adjust accordingly. + * startup.el (package--description-file): New function. + (command-line): Use it. + * emacs-lisp/package-x.el (package-upload-buffer-internal): + Use package-desc-version. + * emacs-lisp/bytecomp.el (byte-compile-force-lexical-warnings): New var. (byte-compile-preprocess): Use it. (byte-compile-file-form-defalias): Try a bit harder to use macros we === modified file 'lisp/emacs-lisp/package-x.el' --- lisp/emacs-lisp/package-x.el 2013-06-12 00:49:33 +0000 +++ lisp/emacs-lisp/package-x.el 2013-06-14 03:20:18 +0000 @@ -224,7 +224,7 @@ (let ((elt (assq pkg-name (cdr contents)))) (if elt (if (version-list-<= split-version - (package-desc-vers (cdr elt))) + (package-desc-version (cdr elt))) (error "New package has smaller version: %s" pkg-version) (setcdr elt new-desc)) (setq contents (cons (car contents) === modified file 'lisp/emacs-lisp/package.el' --- lisp/emacs-lisp/package.el 2013-06-12 00:49:33 +0000 +++ lisp/emacs-lisp/package.el 2013-06-14 03:20:18 +0000 @@ -336,13 +336,22 @@ either `single' or `tar'. `archive' The name of the archive (as a string) whence this -package came." +package came. + +`dir' The directory where the package is installed (if installed)." name version (summary package--default-summary) reqs kind - archive) + archive + dir) + +;; Pseudo fields. +(defsubst package-desc-full-name (pkg-desc) + (format "%s-%s" + (package-desc-name pkg-desc) + (package-version-join (package-desc-version pkg-desc)))) ;; Package descriptor format used in finder-inf.el and package--builtins. (cl-defstruct (package--bi-desc @@ -422,17 +431,18 @@ (if (string-match (concat "\\`" package-subdirectory-regexp "\\'") dirname) (match-string 1 dirname))) -(defun package-load-descriptor (dir package) - "Load the description file in directory DIR for package PACKAGE. -Here, PACKAGE is a string of the form NAME-VERSION, where NAME is -the package name and VERSION is its version." - (let* ((pkg-dir (expand-file-name package dir)) - (pkg-file (expand-file-name - (concat (package-strip-version package) "-pkg") - pkg-dir))) - (when (and (file-directory-p pkg-dir) - (file-exists-p (concat pkg-file ".el"))) - (load pkg-file nil t)))) +(defun package-load-descriptor (pkg-dir) + "Load the description file in directory PKG-DIR." + (let ((pkg-file (expand-file-name (package--description-file pkg-dir) + pkg-dir))) + (when (file-exists-p pkg-file) + (with-temp-buffer + (insert-file-contents pkg-file) + (emacs-lisp-mode) + (goto-char (point-min)) + (let ((pkg-desc (package-process-define-package + (read (current-buffer)) pkg-file))) + (setf (package-desc-dir pkg-desc) pkg-dir)))))) (defun package-load-all-descriptors () "Load descriptors for installed Emacs Lisp packages. @@ -443,65 +453,34 @@ In each valid package subdirectory, this function loads the description file containing a call to `define-package', which updates `package-alist' and `package-obsolete-alist'." - (let ((regexp (concat "\\`" package-subdirectory-regexp "\\'"))) - (dolist (dir (cons package-user-dir package-directory-list)) - (when (file-directory-p dir) - (dolist (subdir (directory-files dir)) - (when (string-match regexp subdir) - (package-maybe-load-descriptor (match-string 1 subdir) - (match-string 2 subdir) - dir))))))) - -(defun package-maybe-load-descriptor (name version dir) - "Maybe load a specific package from directory DIR. -NAME and VERSION are the package's name and version strings. -This function checks `package-load-list', before actually loading -the package by calling `package-load-descriptor'." - (let ((force (assq (intern name) package-load-list)) - (subdir (concat name "-" version))) - (and (file-directory-p (expand-file-name subdir dir)) - ;; Check `package-load-list': - (cond ((null force) - (memq 'all package-load-list)) - ((null (setq force (cadr force))) - nil) ; disabled - ((eq force t) - t) - ((stringp force) ; held - (version-list-= (version-to-list version) - (version-to-list force))) - (t - (error "Invalid element in `package-load-list'"))) - ;; Actually load the descriptor: - (package-load-descriptor dir subdir)))) - -(define-obsolete-function-alias 'package-desc-vers 'package-desc-version "24.4") - -(define-obsolete-function-alias 'package-desc-doc 'package-desc-summary "24.4") - - -(defun package--dir (name version) - ;; FIXME: Keep this as a field in the package-desc. - "Return the directory where a package is installed, or nil if none. -NAME is a symbol and VERSION is a string." - (let* ((subdir (format "%s-%s" name version)) - (dir-list (cons package-user-dir package-directory-list)) - pkg-dir) - (while dir-list - (let ((subdir-full (expand-file-name subdir (car dir-list)))) - (if (file-directory-p subdir-full) - (setq pkg-dir subdir-full - dir-list nil) - (setq dir-list (cdr dir-list))))) - pkg-dir)) + (dolist (dir (cons package-user-dir package-directory-list)) + (when (file-directory-p dir) + (dolist (subdir (directory-files dir)) + (let ((pkg-dir (expand-file-name subdir dir))) + (when (file-directory-p pkg-dir) + (package-load-descriptor pkg-dir))))))) + +(defun package-disabled-p (pkg-name version) + "Return whether PKG-NAME at VERSION can be activated. +The decision is made according to `package-load-list'. +Return nil if the package can be activated. +Return t if the package is completely disabled. +Return the max version (as a string) if the package is held at a lower version." + (let ((force (assq pkg-name package-load-list))) + (cond ((null force) (not (memq 'all package-load-list))) + ((null (setq force (cadr force))) t) ; disabled + ((eq force t) nil) + ((stringp force) ; held + (unless (version-list-= version (version-to-list force)) + force)) + (t (error "Invalid element in `package-load-list'"))))) (defun package-activate-1 (pkg-desc) (let* ((name (package-desc-name pkg-desc)) - (version-str (package-version-join (package-desc-version pkg-desc))) - (pkg-dir (package--dir name version-str))) + (pkg-dir (package-desc-dir pkg-desc))) (unless pkg-dir - (error "Internal error: unable to find directory for `%s-%s'" - name version-str)) + (error "Internal error: unable to find directory for `%s'" + (package-desc-full-name pkg-desc))) ;; Add info node. (when (file-exists-p (expand-file-name "dir" pkg-dir)) ;; FIXME: not the friendliest, but simple. @@ -553,6 +532,8 @@ ;; If the package is already activated, just return t. ((memq package package-activated-list) t) + ;; If it's disabled, then just skip it. + ((package-disabled-p package available-version) nil) ;; Otherwise, proceed with activation. (t (let ((fail (catch 'dep-failure @@ -593,29 +574,32 @@ where OTHER-VERSION is a string. EXTRA-PROPERTIES is currently unused." - (let* ((name (intern name-string)) - (version (version-to-list version-string)) - (new-pkg-desc (cons name - (package-desc-from-define name-string - version-string - docstring - requirements))) - (old-pkg (assq name package-alist))) + ;; FIXME: Placeholder! Should we keep it? + (error "Don't call me!")) + +(defun package-process-define-package (exp origin) + (unless (eq (car-safe exp) 'define-package) + (error "Can't find define-package in %s" origin)) + (let* ((new-pkg-desc (apply #'package-desc-from-define (cdr exp))) + (name (package-desc-name new-pkg-desc)) + (version (package-desc-version new-pkg-desc)) + (old-pkg (assq name package-alist))) (cond ;; If there's no old package, just add this to `package-alist'. ((null old-pkg) - (push new-pkg-desc package-alist)) + (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)) - (setq package-alist (cons new-pkg-desc + (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 ;; the system package directory and one in your private ;; 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 (cdr new-pkg-desc)))))) + (package-mark-obsolete name new-pkg-desc))) + new-pkg-desc)) ;; From Emacs 22. (defun package-autoload-ensure-default-file (file) @@ -711,7 +695,8 @@ (version-to-list version))) package-user-dir)) (el-file (expand-file-name (format "%s.el" name) pkg-dir)) - (pkg-file (expand-file-name (format "%s-pkg.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) @@ -828,20 +813,15 @@ ;; A package is required, but not installed. It might also be ;; blocked via `package-load-list'. (let ((pkg-desc (cdr (assq next-pkg package-archive-contents))) - hold) - (when (setq hold (assq next-pkg package-load-list)) - (setq hold (cadr hold)) - (cond ((eq hold t)) - ((eq hold nil) - (error "Required package '%s' is disabled" - (symbol-name next-pkg))) - ((null (stringp hold)) - (error "Invalid element in `package-load-list'")) - ((version-list-< (version-to-list hold) next-version) - (error "Package `%s' held at version %s, \ + (disabled (package-disabled-p next-pkg next-version))) + (when disabled + (if (stringp disabled) + (error "Package `%s' held at version %s, \ but version %s required" - (symbol-name next-pkg) hold - (package-version-join next-version))))) + (symbol-name next-pkg) disabled + (package-version-join next-version)) + (error "Required package '%s' is disabled" + (symbol-name next-pkg)))) (unless pkg-desc (error "Package `%s-%s' is unavailable" (symbol-name next-pkg) @@ -954,6 +934,7 @@ This function assumes that all package requirements in PACKAGE-LIST are satisfied, i.e. that PACKAGE-LIST is computed 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 @@ -974,15 +955,13 @@ ;; 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-maybe-load-descriptor (symbol-name elt) v-string - package-user-dir) (package-activate elt (version-to-list v-string))))) ;;;###autoload -(defun package-install (name) - "Install the package named NAME. -NAME should be the name of one of the available packages in an -archive in `package-archives'. Interactively, prompt for NAME." +(defun package-install (pkg-desc) + "Install the package PKG-DESC. +PKG-DESC should be one of the available packages in an +archive in `package-archives'. Interactively, prompt for its name." (interactive (progn ;; Initialize the package system to get the list of package @@ -991,20 +970,22 @@ (package-initialize t)) (unless package-archive-contents (package-refresh-contents)) - (list (intern (completing-read - "Install package: " - (mapcar (lambda (elt) - (cons (symbol-name (car elt)) - nil)) - package-archive-contents) - nil t))))) - (let ((pkg-desc (assq name package-archive-contents))) - (unless pkg-desc - (error "Package `%s' is not available for installation" - (symbol-name name))) - (package-download-transaction - (package-compute-transaction (list name) - (package-desc-reqs (cdr pkg-desc)))))) + (let* ((name (intern (completing-read + "Install package: " + (mapcar (lambda (elt) + (cons (symbol-name (car elt)) + nil)) + package-archive-contents) + nil t))) + (pkg-desc (cdr (assq name package-archive-contents)))) + (unless pkg-desc + (error "Package `%s' is not available for installation" + name)) + (list pkg-desc)))) + (package-download-transaction + ;; FIXME: Use (list pkg-desc) instead of just the name. + (package-compute-transaction (list (package-desc-name pkg-desc)) + (package-desc-reqs pkg-desc)))) (defun package-strip-rcs-id (str) "Strip RCS version ID from the version string STR. @@ -1055,31 +1036,28 @@ "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))) - (unless (string-match (concat "\\`" package-subdirectory-regexp "\\.tar\\'") - file) - (error "Invalid package name `%s'" file)) - (let* ((pkg-name (match-string-no-properties 1 file)) - (pkg-version (match-string-no-properties 2 file)) - ;; Extract the package descriptor. - (pkg-def-contents (shell-command-to-string - ;; Requires GNU tar. - (concat "tar -xOf " file " " - pkg-name "-" pkg-version "/" - pkg-name "-pkg.el"))) - (pkg-def-parsed (package-read-from-string pkg-def-contents))) - (unless (eq (car pkg-def-parsed) 'define-package) - (error "No `define-package' sexp is present in `%s-pkg.el'" pkg-name)) - (let ((pkg-desc - (apply #'package-desc-from-define (append (cdr pkg-def-parsed) - '(:kind tar))))) - (unless (equal pkg-version - (package-version-join (package-desc-version pkg-desc))) - (error "Package has inconsistent versions")) - (unless (equal pkg-name (symbol-name (package-desc-name pkg-desc))) - (error "Package has inconsistent names")) - pkg-desc)))) + (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))) + (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))) ;;;###autoload @@ -1123,17 +1101,17 @@ (package-install-from-buffer (package-tar-file-info file))) (t (error "Unrecognized extension `%s'" (file-name-extension file)))))) -(defun package-delete (name version) - (let ((dir (package--dir name version))) +(defun package-delete (pkg-desc) + (let ((dir (package-desc-dir pkg-desc))) (if (string-equal (file-name-directory dir) (file-name-as-directory (expand-file-name package-user-dir))) (progn (delete-directory dir t t) - (message "Package `%s-%s' deleted." name version)) + (message "Package `%s' deleted." (package-desc-full-name pkg-desc))) ;; Don't delete "system" packages - (error "Package `%s-%s' is a system package, not deleting" - name version)))) + (error "Package `%s' is a system package, not deleting" + (package-desc-full-name pkg-desc))))) (defun package-archive-base (name) "Return the archive containing the package NAME." @@ -1212,7 +1190,7 @@ "Describe package: ") packages nil t nil nil guess)) (list (if (equal val "") guess (intern val))))) - (if (or (null package) (not (symbolp package))) + (if (not (and package (symbolp package))) (message "No package specified") (help-setup-xref (list #'describe-package package) (called-interactively-p 'interactive)) @@ -1231,7 +1209,7 @@ ;; Loaded packages are in `package-alist'. ((setq desc (cdr (assq package package-alist))) (setq version (package-version-join (package-desc-version desc))) - (if (setq pkg-dir (package--dir package-name version)) + (if (setq pkg-dir (package-desc-dir desc)) (insert "an installed package.\n\n") ;; This normally does not happen. (insert "a deleted package.\n\n"))) @@ -1279,7 +1257,7 @@ :foreground "black") 'link))) (insert-text-button button-text 'face button-face 'follow-link t - 'package-symbol package + 'package-desc desc 'action 'package-install-button-action))) (built-in (insert (propertize "Built-in." @@ -1343,9 +1321,10 @@ (goto-char (point-max)))))))) (defun package-install-button-action (button) - (let ((package (button-get button 'package-symbol))) - (when (y-or-n-p (format "Install package `%s'? " package)) - (package-install package) + (let ((pkg-desc (button-get button 'package-desc))) + (when (y-or-n-p (format "Install package `%s'? " + (package-desc-full-name pkg-desc))) + (package-install pkg-desc) (revert-buffer nil t) (goto-char (point-min))))) @@ -1434,29 +1413,26 @@ (setq tabulated-list-sort-key (cons "Status" nil)) (tabulated-list-init-header)) -(defmacro package--push (package desc status listname) +(defmacro package--push (pkg-desc status listname) "Convenience macro for `package-menu--generate'. If the alist stored in the symbol LISTNAME lacks an entry for a -package PACKAGE with descriptor DESC, add one. The alist is -keyed with cons cells (PACKAGE . VERSION-LIST), where PACKAGE is -a symbol and VERSION-LIST is a version list." - `(let* ((version (package-desc-version ,desc)) - (key (cons ,package version))) - (unless (assoc key ,listname) - (push (list key ,status (package-desc-summary ,desc)) ,listname)))) +package PKG-DESC, add one. The alist is keyed with PKG-DESC." + `(unless (assoc ,pkg-desc ,listname) + ;; FIXME: Should we move status into pkg-desc? + (push (cons ,pkg-desc ,status) ,listname))) (defun package-menu--generate (remember-pos packages) "Populate the Package Menu. If REMEMBER-POS is non-nil, keep point on the same entry. PACKAGES should be t, which means to display all known packages, or a list of package names (symbols) to display." - ;; Construct list of ((PACKAGE . VERSION) STATUS DESCRIPTION). + ;; Construct list of (PKG-DESC . STATUS). (let (info-list name) ;; Installed packages: (dolist (elt package-alist) (setq name (car elt)) (when (or (eq packages t) (memq name packages)) - (package--push name (cdr elt) + (package--push (cdr elt) (if (stringp (cadr (assq name package-load-list))) "held" "installed") info-list))) @@ -1466,14 +1442,14 @@ (setq name (car elt)) (when (and (not (eq name 'emacs)) ; Hide the `emacs' package. (or (eq packages t) (memq name packages))) - (package--push name (package--from-builtin elt) "built-in" info-list))) + (package--push (package--from-builtin elt) "built-in" info-list))) ;; Available and disabled packages: (dolist (elt package-archive-contents) (setq name (car elt)) (when (or (eq packages t) (memq name packages)) (let ((hold (assq name package-load-list))) - (package--push name (cdr elt) + (package--push (cdr elt) (cond ((and hold (null (cadr hold))) "disabled") ((memq name package-menu--new-package-list) "new") @@ -1484,7 +1460,7 @@ (dolist (elt package-obsolete-alist) (dolist (inner-elt (cdr elt)) (when (or (eq packages t) (memq (car elt) packages)) - (package--push (car elt) (cdr inner-elt) "obsolete" info-list)))) + (package--push (cdr inner-elt) "obsolete" info-list)))) ;; Print the result. (setq tabulated-list-entries (mapcar 'package-menu--print-info info-list)) @@ -1492,31 +1468,30 @@ (defun package-menu--print-info (pkg) "Return a package entry suitable for `tabulated-list-entries'. -PKG has the form ((PACKAGE . VERSION) STATUS DOC). -Return (KEY [NAME VERSION STATUS DOC]), where KEY is the -identifier (NAME . VERSION-LIST)." - (let* ((package (caar pkg)) - (version (cdr (car pkg))) - (status (nth 1 pkg)) - (doc (or (nth 2 pkg) "")) - (face (cond - ((string= status "built-in") 'font-lock-builtin-face) - ((string= status "available") 'default) - ((string= status "new") 'bold) - ((string= status "held") 'font-lock-constant-face) - ((string= status "disabled") 'font-lock-warning-face) - ((string= status "installed") 'font-lock-comment-face) - (t 'font-lock-warning-face)))) ; obsolete. - (list (cons package version) - (vector (list (symbol-name package) +PKG has the form (PKG-DESC . STATUS). +Return (PKG-DESC [NAME VERSION STATUS DOC])." + (let* ((pkg-desc (car pkg)) + (status (cdr pkg)) + (face (pcase status + (`"built-in" 'font-lock-builtin-face) + (`"available" 'default) + (`"new" 'bold) + (`"held" 'font-lock-constant-face) + (`"disabled" 'font-lock-warning-face) + (`"installed" 'font-lock-comment-face) + (_ 'font-lock-warning-face)))) ; obsolete. + (list pkg-desc + (vector (list (symbol-name (package-desc-name pkg-desc)) 'face 'link 'follow-link t - 'package-symbol package + 'package-desc pkg-desc 'action 'package-menu-describe-package) - (propertize (package-version-join version) + (propertize (package-version-join + (package-desc-version pkg-desc)) 'font-lock-face face) (propertize status 'font-lock-face face) - (propertize doc 'font-lock-face face))))) + (propertize (package-desc-summary pkg-desc) + 'font-lock-face face))))) (defun package-menu-refresh () "Download the Emacs Lisp package archive. @@ -1532,10 +1507,11 @@ "Describe the current package. If optional arg BUTTON is non-nil, describe its associated package." (interactive) - (let ((package (if button (button-get button 'package-symbol) - (car (tabulated-list-get-id))))) - (if package - (describe-package package)))) + (let ((pkg-desc (if button (button-get button 'package-desc) + (car (tabulated-list-get-id))))) + (if pkg-desc + ;; FIXME: We could actually describe this particular pkg-desc. + (describe-package (package-desc-name pkg-desc))))) ;; fixme numeric argument (defun package-menu-mark-delete (&optional _num) @@ -1582,8 +1558,8 @@ 'package-menu-view-commentary 'package-menu-describe-package "24.1") (defun package-menu-get-status () - (let* ((pkg (tabulated-list-get-id)) - (entry (and pkg (assq pkg tabulated-list-entries)))) + (let* ((id (tabulated-list-get-id)) + (entry (and id (assq id tabulated-list-entries)))) (if entry (aref (cadr entry) 2) ""))) @@ -1592,18 +1568,20 @@ (let (installed available upgrades) ;; Build list of installed/available packages in this buffer. (dolist (entry tabulated-list-entries) - ;; ENTRY is ((NAME . VERSION) [NAME VERSION STATUS DOC]) - (let ((pkg (car entry)) + ;; ENTRY is (PKG-DESC [NAME VERSION STATUS DOC]) + (let ((pkg-desc (car entry)) (status (aref (cadr entry) 2))) (cond ((equal status "installed") - (push pkg installed)) + (push pkg-desc installed)) ((member status '("available" "new")) - (push pkg available))))) - ;; Loop through list of installed packages, finding upgrades - (dolist (pkg installed) - (let ((avail-pkg (assq (car pkg) available))) + (push (cons (package-desc-name pkg-desc) pkg-desc) + available))))) + ;; Loop through list of installed packages, finding upgrades. + (dolist (pkg-desc installed) + (let ((avail-pkg (assq (package-desc-name pkg-desc) available))) (and avail-pkg - (version-list-< (cdr pkg) (cdr avail-pkg)) + (version-list-< (package-desc-version pkg-desc) + (package-desc-version (cdr avail-pkg))) (push avail-pkg upgrades)))) upgrades)) @@ -1623,11 +1601,11 @@ (save-excursion (goto-char (point-min)) (while (not (eobp)) - (let* ((pkg (tabulated-list-get-id)) - (upgrade (assq (car pkg) upgrades))) + (let* ((pkg-desc (tabulated-list-get-id)) + (upgrade (cdr (assq (package-desc-name pkg-desc) upgrades)))) (cond ((null upgrade) (forward-line 1)) - ((equal pkg upgrade) + ((equal pkg-desc upgrade) (package-menu-mark-install)) (t (package-menu-mark-delete)))))) @@ -1643,30 +1621,30 @@ (interactive) (unless (derived-mode-p 'package-menu-mode) (error "The current buffer is not in Package Menu mode")) - (let (install-list delete-list cmd id) + (let (install-list delete-list cmd pkg-desc) (save-excursion (goto-char (point-min)) (while (not (eobp)) (setq cmd (char-after)) (unless (eq cmd ?\s) - ;; This is the key (PACKAGE . VERSION-LIST). - (setq id (tabulated-list-get-id)) + ;; This is the key PKG-DESC. + (setq pkg-desc (tabulated-list-get-id)) (cond ((eq cmd ?D) - (push (cons (symbol-name (car id)) - (package-version-join (cdr id))) - delete-list)) + (push pkg-desc delete-list)) ((eq cmd ?I) - (push (car id) install-list)))) + (push pkg-desc install-list)))) (forward-line))) (when install-list (if (or noquery (yes-or-no-p - (if (= (length install-list) 1) - (format "Install package `%s'? " (car install-list)) - (format "Install these %d packages (%s)? " - (length install-list) - (mapconcat 'symbol-name install-list ", "))))) + (if (= (length install-list) 1) + (format "Install package `%s'? " + (package-desc-full-name (car install-list))) + (format "Install these %d packages (%s)? " + (length install-list) + (mapconcat #'package-desc-full-name + install-list ", "))))) (mapc 'package-install install-list))) ;; Delete packages, prompting if necessary. (when delete-list @@ -1674,18 +1652,15 @@ noquery (yes-or-no-p (if (= (length delete-list) 1) - (format "Delete package `%s-%s'? " - (caar delete-list) - (cdr (car delete-list))) + (format "Delete package `%s'? " + (package-desc-full-name (car delete-list))) (format "Delete these %d packages (%s)? " (length delete-list) - (mapconcat (lambda (elt) - (concat (car elt) "-" (cdr elt))) - delete-list - ", "))))) + (mapconcat #'package-desc-full-name + delete-list ", "))))) (dolist (elt delete-list) (condition-case-unless-debug err - (package-delete (car elt) (cdr elt)) + (package-delete elt) (error (message (cadr err))))) (error "Aborted"))) ;; If we deleted anything, regenerate `package-alist'. This is done @@ -1730,8 +1705,8 @@ (string< dA dB)))) (defun package-menu--name-predicate (A B) - (string< (symbol-name (caar A)) - (symbol-name (caar B)))) + (string< (symbol-name (package-desc-name (car A))) + (symbol-name (package-desc-name (car B))))) ;;;###autoload (defun list-packages (&optional no-fetch) === modified file 'lisp/startup.el' --- lisp/startup.el 2013-06-13 17:59:10 +0000 +++ lisp/startup.el 2013-06-14 03:20:18 +0000 @@ -422,6 +422,13 @@ The regexp should not contain a starting \"\\`\" or a trailing \"\\'\"; those are added automatically by callers.") +(defun package--description-file (dir) + (concat (let ((subdir (file-name-nondirectory + (directory-file-name dir)))) + (if (string-match package-subdirectory-regexp subdir) + (match-string 1 subdir) subdir)) + "-pkg.el")) + (defun normal-top-level-add-subdirs-to-load-path () "Add all subdirectories of `default-directory' to `load-path'. More precisely, this uses only the subdirectories whose names @@ -1194,10 +1201,10 @@ (dolist (dir dirs) (when (file-directory-p dir) (dolist (subdir (directory-files dir)) - (when (and (file-directory-p (expand-file-name subdir dir)) - (string-match - (concat "\\`" package-subdirectory-regexp "\\'") - subdir)) + (when (let ((subdir (expand-file-name subdir dir))) + (and (file-directory-p subdir) + (file-exists-p + (package--description-file subdir)))) (throw 'package-dir-found t))))))) (package-initialize)) ------------------------------------------------------------ revno: 112979 committer: Stefan Monnier branch nick: trunk timestamp: Thu 2013-06-13 22:31:28 -0400 message: * lisp/emacs-lisp/bytecomp.el (byte-compile-force-lexical-warnings): New var. (byte-compile-preprocess): Use it. (byte-compile-file-form-defalias): Try a bit harder to use macros we can't quite recognize. (byte-compile-add-to-list): Remove. * lisp/emacs-lisp/cconv.el (cconv-warnings-only): New function. (cconv-closure-convert): Add assertion. * lisp/emacs-lisp/map-ynp.el: Use lexical-binding. (map-y-or-n-p): Remove unused vars `tail' and `object'. Factor out some repeated code. * etc/NEWS (utf-8 for el): Move to the incompatible section. diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2013-06-13 17:52:21 +0000 +++ etc/ChangeLog 2013-06-14 02:31:28 +0000 @@ -1,3 +1,7 @@ +2013-06-14 Stefan Monnier + + * NEWS (utf-8 for el): Move to the incompatible section. + 2013-06-13 Paul Eggert * DEBUG: Document -Og and -fno-omit-frame-pointer. === modified file 'etc/NEWS' --- etc/NEWS 2013-06-13 22:24:52 +0000 +++ etc/NEWS 2013-06-14 02:31:28 +0000 @@ -414,6 +414,12 @@ * Incompatible Lisp Changes in Emacs 24.4 +** The default file coding for Emacs Lisp files is now utf-8. +(See file-coding-system-alist.) In most cases, this change is transparent, but +files that contain unusual characters without specifying an explicit coding +system may fail to load with obscure errors. +You should either convert them to utf-8 or add an explicit coding: cookie. + ** overriding-terminal-local-map does not replace the local keymaps any more. It used to disable the minor mode, major mode, and text-property keymaps, whereas now it simply has higher precedence. @@ -455,13 +461,6 @@ +++ ** New macro with-eval-after-load. Like eval-after-load, but better behaved. -** The default file coding for Emacs Lisp files is now utf-8. -(See file-coding-system-alist.) In most cases, this change is -totally transparent. Files that contain unusual characters but do -not specify an explicit coding system may fail to load with obscure -errors. You should either convert them to utf-8 or add an explicit -coding: cookie. - ** Obsoleted functions: *** `dont-compile' *** `lisp-complete-symbol' === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-13 22:43:33 +0000 +++ lisp/ChangeLog 2013-06-14 02:31:28 +0000 @@ -1,3 +1,17 @@ +2013-06-14 Stefan Monnier + + * emacs-lisp/bytecomp.el (byte-compile-force-lexical-warnings): New var. + (byte-compile-preprocess): Use it. + (byte-compile-file-form-defalias): Try a bit harder to use macros we + can't quite recognize. + (byte-compile-add-to-list): Remove. + * emacs-lisp/cconv.el (cconv-warnings-only): New function. + (cconv-closure-convert): Add assertion. + + * emacs-lisp/map-ynp.el: Use lexical-binding. + (map-y-or-n-p): Remove unused vars `tail' and `object'. + Factor out some repeated code. + 2013-06-13 Stefan Monnier * subr.el (with-eval-after-load): New macro. === modified file 'lisp/emacs-lisp/byte-opt.el' --- lisp/emacs-lisp/byte-opt.el 2013-01-02 16:13:04 +0000 +++ lisp/emacs-lisp/byte-opt.el 2013-06-14 02:31:28 +0000 @@ -287,6 +287,7 @@ (byte-compile--reify-function fn))))) (if (eq (car-safe newfn) 'function) (byte-compile-unfold-lambda `(,(cadr newfn) ,@(cdr form))) + ;; This can happen because of macroexp-warn-and-return &co. (byte-compile-log-warning (format "Inlining closure %S failed" name)) form)))) === modified file 'lisp/emacs-lisp/bytecomp.el' --- lisp/emacs-lisp/bytecomp.el 2013-06-08 01:35:47 +0000 +++ lisp/emacs-lisp/bytecomp.el 2013-06-14 02:31:28 +0000 @@ -2174,6 +2174,8 @@ byte-compile-maxdepth 0 byte-compile-output nil)))) +(defvar byte-compile-force-lexical-warnings nil) + (defun byte-compile-preprocess (form &optional _for-effect) (setq form (macroexpand-all form byte-compile-macro-environment)) ;; FIXME: We should run byte-optimize-form here, but it currently does not @@ -2182,9 +2184,10 @@ ;; macroexpand-all. ;; (if (memq byte-optimize '(t source)) ;; (setq form (byte-optimize-form form for-effect))) - (if lexical-binding - (cconv-closure-convert form) - form)) + (cond + (lexical-binding (cconv-closure-convert form)) + (byte-compile-force-lexical-warnings (cconv-warnings-only form)) + (t form))) ;; byte-hunk-handlers cannot call this! (defun byte-compile-toplevel-file-form (form) @@ -4240,6 +4243,12 @@ lam)) (unless (byte-compile-file-form-defmumble name macro arglist body rest) + (when macro + (if (null fun) + (message "Macro %s unrecognized, won't work in file" name) + (message "Macro %s partly recognized, trying our luck" name) + (push (cons name (eval fun)) + byte-compile-macro-environment))) (byte-compile-keep-pending form)))) ;; We used to just do: (byte-compile-normal-call form) @@ -4268,26 +4277,6 @@ 'byte-hunk-handler 'byte-compile-form-make-variable-buffer-local) (defun byte-compile-form-make-variable-buffer-local (form) (byte-compile-keep-pending form 'byte-compile-normal-call)) - -(byte-defop-compiler-1 add-to-list byte-compile-add-to-list) -(defun byte-compile-add-to-list (form) - ;; FIXME: This could be used for `set' as well, except that it's got - ;; its own opcode, so the final `byte-compile-normal-call' needs to - ;; be replaced with something else. - (pcase form - (`(,fun ',var . ,_) - (byte-compile-check-variable var 'assign) - (if (assq var byte-compile--lexical-environment) - (byte-compile-log-warning - (format "%s cannot use lexical var `%s'" fun var) - nil :error) - (unless (or (not (byte-compile-warning-enabled-p 'free-vars)) - (boundp var) - (memq var byte-compile-bound-variables) - (memq var byte-compile-free-references)) - (byte-compile-warn "assignment to free variable `%S'" var) - (push var byte-compile-free-references))))) - (byte-compile-normal-call form)) ;;; tags === modified file 'lisp/emacs-lisp/cconv.el' --- lisp/emacs-lisp/cconv.el 2013-06-05 02:35:40 +0000 +++ lisp/emacs-lisp/cconv.el 2013-06-14 02:31:28 +0000 @@ -143,7 +143,19 @@ ;; Analyze form - fill these variables with new information. (cconv-analyse-form form '()) (setq cconv-freevars-alist (nreverse cconv-freevars-alist)) - (cconv-convert form nil nil))) ; Env initially empty. + (prog1 (cconv-convert form nil nil) ; Env initially empty. + (cl-assert (null cconv-freevars-alist))))) + +;;;###autoload +(defun cconv-warnings-only (form) + "Add the warnings that closure conversion would encounter." + (let ((cconv-freevars-alist '()) + (cconv-lambda-candidates '()) + (cconv-captured+mutated '())) + ;; Analyze form - fill these variables with new information. + (cconv-analyse-form form '()) + ;; But don't perform the closure conversion. + form)) (defconst cconv--dummy-var (make-symbol "ignored")) === modified file 'lisp/emacs-lisp/map-ynp.el' --- lisp/emacs-lisp/map-ynp.el 2013-01-01 09:11:05 +0000 +++ lisp/emacs-lisp/map-ynp.el 2013-06-14 02:31:28 +0000 @@ -1,4 +1,4 @@ -;;; map-ynp.el --- general-purpose boolean question-asker +;;; map-ynp.el --- general-purpose boolean question-asker -*- lexical-binding:t -*- ;; Copyright (C) 1991-1995, 2000-2013 Free Software Foundation, Inc. @@ -79,7 +79,7 @@ Returns the number of actions taken." (let* ((actions 0) - user-keys mouse-event map prompt char elt tail def + user-keys mouse-event map prompt char elt def ;; Non-nil means we should use mouse menus to ask. use-menus delayed-switch-frame @@ -89,13 +89,15 @@ (next (if (functionp list) (lambda () (setq elt (funcall list))) (lambda () (when list - (setq elt (pop list)) - t))))) + (setq elt (pop list)) + t)))) + (try-again (lambda () + (let ((x next)) + (setq next (lambda () (setq next x) elt)))))) (if (and (listp last-nonmenu-event) use-dialog-box) ;; Make a list describing a dialog box. - (let ((object (if help (capitalize (nth 0 help)))) - (objects (if help (capitalize (nth 1 help)))) + (let ((objects (if help (capitalize (nth 1 help)))) (action (if help (capitalize (nth 2 help))))) (setq map `(("Yes" . act) ("No" . skip) ,@(mapcar (lambda (elt) @@ -129,8 +131,8 @@ (unwind-protect (progn (if (stringp prompter) - (setq prompter `(lambda (object) - (format ,prompter object)))) + (setq prompter (lambda (object) + (format prompter object)))) (while (funcall next) (setq prompt (funcall prompter elt)) (cond ((stringp prompt) @@ -176,9 +178,7 @@ next (lambda () nil))) ((eq def 'quit) (setq quit-flag t) - (setq next `(lambda () - (setq next ',next) - ',elt))) + (funcall try-again)) ((eq def 'automatic) ;; Act on this and all following objects. (if (funcall prompter elt) @@ -219,40 +219,30 @@ (with-current-buffer standard-output (help-mode))) - (setq next `(lambda () - (setq next ',next) - ',elt))) - ((and (symbolp def) (commandp def)) - (call-interactively def) - ;; Regurgitated; try again. - (setq next `(lambda () - (setq next ',next) - ',elt))) + (funcall try-again)) + ((and (symbolp def) (commandp def)) + (call-interactively def) + ;; Regurgitated; try again. + (funcall try-again)) ((vectorp def) ;; A user-defined key. (if (funcall (aref def 0) elt) ;Call its function. ;; The function has eaten this object. (setq actions (1+ actions)) ;; Regurgitated; try again. - (setq next `(lambda () - (setq next ',next) - ',elt)))) + (funcall try-again))) ((and (consp char) (eq (car char) 'switch-frame)) ;; switch-frame event. Put it off until we're done. (setq delayed-switch-frame char) - (setq next `(lambda () - (setq next ',next) - ',elt))) + (funcall try-again)) (t ;; Random char. (message "Type %s for help." (key-description (vector help-char))) (beep) (sit-for 1) - (setq next `(lambda () - (setq next ',next) - ',elt))))) + (funcall try-again)))) (prompt (funcall actor elt) (setq actions (1+ actions)))))) ------------------------------------------------------------ revno: 112978 committer: Xue Fuqiao branch nick: trunk timestamp: Fri 2013-06-14 06:43:33 +0800 message: ChangeLog fix. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2013-06-13 22:33:43 +0000 +++ doc/emacs/ChangeLog 2013-06-13 22:43:33 +0000 @@ -1,4 +1,4 @@ -2013-06-09 Xue Fuqiao +2013-06-12 Xue Fuqiao * vc1-xtra.texi (Revision Tags): Add a cross reference. (CVS Options): Fix the default value of `vc-cvs-stay-local'. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-13 22:33:43 +0000 +++ lisp/ChangeLog 2013-06-13 22:43:33 +0000 @@ -151,7 +151,7 @@ (cl-define-compiler-macro): Use eval-and-compile. Give a name to the compiler-macro function instead of setting `compiler-macro-file'. -2013-06-09 Xue Fuqiao +2013-06-12 Xue Fuqiao * vc/vc-cvs.el (vc-cvs-stay-local): Doc fix. * vc/vc-hooks.el (vc-stay-local): Doc fix. ------------------------------------------------------------ revno: 112977 committer: Xue Fuqiao branch nick: trunk timestamp: Fri 2013-06-14 06:33:43 +0800 message: ChangeLog fix. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2013-06-12 12:12:47 +0000 +++ doc/emacs/ChangeLog 2013-06-13 22:33:43 +0000 @@ -1,13 +1,13 @@ +2013-06-09 Xue Fuqiao + + * vc1-xtra.texi (Revision Tags): Add a cross reference. + (CVS Options): Fix the default value of `vc-cvs-stay-local'. + 2013-06-11 Glenn Morris * maintaining.texi (VC Directory Commands): Copyedit. (Branches): Put back milder version of pre 2013-06-07 text. -2013-06-09 Xue Fuqiao - - * vc1-xtra.texi (Revision Tags): Add a cross reference. - (CVS Options): Fix the default value of `vc-cvs-stay-local'. - 2013-06-07 Xue Fuqiao * maintaining.texi (Branches): Remove text copied from other sources. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-13 22:24:52 +0000 +++ lisp/ChangeLog 2013-06-13 22:33:43 +0000 @@ -151,6 +151,11 @@ (cl-define-compiler-macro): Use eval-and-compile. Give a name to the compiler-macro function instead of setting `compiler-macro-file'. +2013-06-09 Xue Fuqiao + + * vc/vc-cvs.el (vc-cvs-stay-local): Doc fix. + * vc/vc-hooks.el (vc-stay-local): Doc fix. + 2013-06-12 Stefan Monnier Daniel Hackney @@ -241,11 +246,6 @@ * epa.el (epa-read-file-name): New function. (Bug#14510) (epa-decrypt-file): Make plain-file optional. Use epa-read-file-name. -2013-06-09 Xue Fuqiao - - * vc/vc-cvs.el (vc-cvs-stay-local): Doc fix. - * vc/vc-hooks.el (vc-stay-local): Doc fix. - 2013-06-09 Aidan Gauland * eshell/em-term.el (eshell-visual-command-p): Fix bug that caused ------------------------------------------------------------ revno: 112976 committer: Stefan Monnier branch nick: trunk timestamp: Thu 2013-06-13 18:24:52 -0400 message: * lisp/subr.el (with-eval-after-load): New macro. (eval-after-load): Allow form to be a function. take advantage of lexical-binding. (do-after-load-evaluation): Use dolist and adjust to new format. * lisp/simple.el (bad-packages-alist): Use dolist and with-eval-after-load. * doc/lispref/loading.texi (Hooks for Loading): Document with-eval-after-load instead of eval-after-load. Don't document after-load-alist. * src/lread.c (syms_of_lread): * src/fns.c (Fprovide): Adjust to new format of after-load-alist. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2013-06-11 11:37:56 +0000 +++ doc/lispref/ChangeLog 2013-06-13 22:24:52 +0000 @@ -1,3 +1,8 @@ +2013-06-13 Stefan Monnier + + * loading.texi (Hooks for Loading): Don't document after-load-alist. + Document with-eval-after-load instead of eval-after-load. + 2013-06-11 Xue Fuqiao * files.texi (File Name Expansion): Make the example more === modified file 'doc/lispref/loading.texi' --- doc/lispref/loading.texi 2013-05-15 20:12:53 +0000 +++ doc/lispref/loading.texi 2013-06-13 22:24:52 +0000 @@ -990,19 +990,18 @@ @end defvar If you want code to be executed when a @emph{particular} library is -loaded, use the function @code{eval-after-load}: +loaded, use the macro @code{with-eval-after-load}: -@defun eval-after-load library form -This function arranges to evaluate @var{form} at the end of loading +@defmac with-eval-after-load library body@dots{} +This macro arranges to evaluate @var{body} at the end of loading the file @var{library}, each time @var{library} is loaded. If -@var{library} is already loaded, it evaluates @var{form} right away. -Don't forget to quote @var{form}! +@var{library} is already loaded, it evaluates @var{body} right away. You don't need to give a directory or extension in the file name @var{library}. Normally, you just give a bare file name, like this: @example -(eval-after-load "edebug" '(def-edebug-spec c-point t)) +(with-eval-after-load "edebug" (def-edebug-spec c-point t)) @end example To restrict which files can trigger the evaluation, include a @@ -1014,16 +1013,16 @@ @file{my_inst.el}: @example -(eval-after-load "foo/bar/my_inst.elc" @dots{}) +(with-eval-after-load "foo/bar/my_inst.elc" @dots{}) @end example @var{library} can also be a feature (i.e., a symbol), in which case -@var{form} is evaluated at the end of any file where +@var{body} is evaluated at the end of any file where @code{(provide @var{library})} is called. -An error in @var{form} does not undo the load, but does prevent -execution of the rest of @var{form}. -@end defun +An error in @var{body} does not undo the load, but does prevent +execution of the rest of @var{body}. +@end defmac Normally, well-designed Lisp programs should not use @code{eval-after-load}. If you need to examine and set the variables @@ -1031,18 +1030,3 @@ it immediately---there is no need to wait until the library is loaded. If you need to call functions defined by that library, you should load the library, preferably with @code{require} (@pxref{Named Features}). - -@defvar after-load-alist -This variable stores an alist built by @code{eval-after-load}, -containing the expressions to evaluate when certain libraries are -loaded. Each element looks like this: - -@example -(@var{regexp-or-feature} @var{forms}@dots{}) -@end example - -The key @var{regexp-or-feature} is either a regular expression or a -symbol, and the value is a list of forms. The forms are evaluated -when the key matches the absolute true name or feature name of the -library being loaded. -@end defvar === modified file 'etc/NEWS' --- etc/NEWS 2013-06-13 21:49:10 +0000 +++ etc/NEWS 2013-06-13 22:24:52 +0000 @@ -452,8 +452,9 @@ * Lisp Changes in Emacs 24.4 -FIXME - someone who knows what they are talking about, please improve -this - see http://debbugs.gnu.org/14596 ++++ +** New macro with-eval-after-load. Like eval-after-load, but better behaved. + ** The default file coding for Emacs Lisp files is now utf-8. (See file-coding-system-alist.) In most cases, this change is totally transparent. Files that contain unusual characters but do === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-13 22:08:45 +0000 +++ lisp/ChangeLog 2013-06-13 22:24:52 +0000 @@ -1,3 +1,11 @@ +2013-06-13 Stefan Monnier + + * subr.el (with-eval-after-load): New macro. + (eval-after-load): Allow form to be a function. + take advantage of lexical-binding. + (do-after-load-evaluation): Use dolist and adjust to new format. + * simple.el (bad-packages-alist): Use dolist and with-eval-after-load. + 2013-06-13 Juri Linkov * replace.el (perform-replace): Display "symbol " and other search === modified file 'lisp/simple.el' --- lisp/simple.el 2013-06-05 18:10:27 +0000 +++ lisp/simple.el 2013-06-13 22:24:52 +0000 @@ -7295,8 +7295,7 @@ "Alist of packages known to cause problems in this version of Emacs. Each element has the form (PACKAGE SYMBOL REGEXP STRING). PACKAGE is either a regular expression to match file names, or a -symbol (a feature name); see the documentation of -`after-load-alist', to which this variable adds functions. +symbol (a feature name), like for `with-eval-after-load'. SYMBOL is either the name of a string variable, or `t'. Upon loading PACKAGE, if SYMBOL is t or matches REGEXP, display a warning using STRING as the message.") @@ -7314,10 +7313,10 @@ (display-warning package (nth 3 list) :warning))) (error nil))) -(mapc (lambda (elem) - (eval-after-load (car elem) `(bad-package-check ',(car elem)))) - bad-packages-alist) - +(dolist (elem bad-packages-alist) + (let ((pkg (car elem))) + (with-eval-after-load pkg + (bad-package-check pkg)))) (provide 'simple) === modified file 'lisp/subr.el' --- lisp/subr.el 2013-06-13 20:43:53 +0000 +++ lisp/subr.el 2013-06-13 22:24:52 +0000 @@ -3729,6 +3729,8 @@ (defun eval-after-load (file form) "Arrange that if FILE is loaded, FORM will be run immediately afterwards. If FILE is already loaded, evaluate FORM right now. +FORM can be an Elisp expression (in which case it's passed to `eval'), +or a function (in which case it's passed to `funcall' with no argument). If a matching file is loaded again, FORM will be evaluated again. @@ -3756,43 +3758,58 @@ like 'font-lock. This function makes or adds to an entry on `after-load-alist'." + (declare (compiler-macro + (lambda (whole) + (if (eq 'quote (car-safe form)) + ;; Quote with lambda so the compiler can look inside. + `(eval-after-load ,file (lambda () ,(nth 1 form))) + whole)))) ;; Add this FORM into after-load-alist (regardless of whether we'll be ;; evaluating it now). (let* ((regexp-or-feature (if (stringp file) (setq file (purecopy (load-history-regexp file))) file)) - (elt (assoc regexp-or-feature after-load-alist))) + (elt (assoc regexp-or-feature after-load-alist)) + (func + (if (functionp form) form + ;; Try to use the "current" lexical/dynamic mode for `form'. + (eval `(lambda () ,form) lexical-binding)))) (unless elt (setq elt (list regexp-or-feature)) (push elt after-load-alist)) - ;; Make sure `form' is evalled in the current lexical/dynamic code. - (setq form `(funcall ',(eval `(lambda () ,form) lexical-binding))) ;; Is there an already loaded file whose name (or `provide' name) ;; matches FILE? (prog1 (if (if (stringp file) (load-history-filename-element regexp-or-feature) (featurep file)) - (eval form)) - (when (symbolp regexp-or-feature) - ;; For features, the after-load-alist elements get run when `provide' is - ;; called rather than at the end of the file. So add an indirection to - ;; make sure that `form' is really run "after-load" in case the provide - ;; call happens early. - (setq form - `(if load-file-name - (let ((fun (make-symbol "eval-after-load-helper"))) - (fset fun `(lambda (file) - (if (not (equal file ',load-file-name)) - nil - (remove-hook 'after-load-functions ',fun) - ,',form))) - (add-hook 'after-load-functions fun)) - ;; Not being provided from a file, run form right now. - ,form))) - ;; Add FORM to the element unless it's already there. - (unless (member form (cdr elt)) - (nconc elt (list form)))))) + (funcall func)) + (let ((delayed-func + (if (not (symbolp regexp-or-feature)) func + ;; For features, the after-load-alist elements get run when + ;; `provide' is called rather than at the end of the file. + ;; So add an indirection to make sure that `func' is really run + ;; "after-load" in case the provide call happens early. + (lambda () + (if (not load-file-name) + ;; Not being provided from a file, run func right now. + (funcall func) + (let ((lfn load-file-name)) + (letrec ((fun (lambda (file) + (when (equal file lfn) + (remove-hook 'after-load-functions fun) + (funcall func))))) + (add-hook 'after-load-functions fun)))))))) + ;; Add FORM to the element unless it's already there. + (unless (member delayed-func (cdr elt)) + (nconc elt (list delayed-func))))))) + +(defmacro with-eval-after-load (file &rest body) + "Execute BODY after FILE is loaded. +FILE is normally a feature name, but it can also be a file name, +in case that file does not provide any feature." + (declare (indent 1) (debug t)) + `(eval-after-load ,file (lambda () ,@body))) (defvar after-load-functions nil "Special hook run after loading a file. @@ -3804,12 +3821,11 @@ ABS-FILE, a string, should be the absolute true name of a file just loaded. This function is called directly from the C code." ;; Run the relevant eval-after-load forms. - (mapc #'(lambda (a-l-element) - (when (and (stringp (car a-l-element)) - (string-match-p (car a-l-element) abs-file)) - ;; discard the file name regexp - (mapc #'eval (cdr a-l-element)))) - after-load-alist) + (dolist (a-l-element after-load-alist) + (when (and (stringp (car a-l-element)) + (string-match-p (car a-l-element) abs-file)) + ;; discard the file name regexp + (mapc #'funcall (cdr a-l-element)))) ;; Complain when the user uses obsolete files. (when (string-match-p "/obsolete/[^/]*\\'" abs-file) (run-with-timer 0 nil === modified file 'src/ChangeLog' --- src/ChangeLog 2013-06-13 05:13:05 +0000 +++ src/ChangeLog 2013-06-13 22:24:52 +0000 @@ -1,3 +1,8 @@ +2013-06-13 Stefan Monnier + + * lread.c (syms_of_lread): + * fns.c (Fprovide): Adjust to new format of after-load-alist. + 2013-06-13 Kelly Dean (tiny change) * fileio.c (Fdo_auto_save): Trap errors in auto-save-hook. (Bug#14479) === modified file 'src/fns.c' --- src/fns.c 2013-04-08 18:04:58 +0000 +++ src/fns.c 2013-06-13 22:24:52 +0000 @@ -2545,6 +2545,8 @@ return (NILP (tem)) ? Qnil : Qt; } +static Lisp_Object Qfuncall; + DEFUN ("provide", Fprovide, Sprovide, 1, 2, 0, doc: /* Announce that FEATURE is a feature of the current Emacs. The optional argument SUBFEATURES should be a list of symbols listing @@ -2567,7 +2569,7 @@ /* Run any load-hooks for this file. */ tem = Fassq (feature, Vafter_load_alist); if (CONSP (tem)) - Fprogn (XCDR (tem)); + Fmapc (Qfuncall, XCDR (tem)); return feature; } @@ -4866,6 +4868,7 @@ Used by `featurep' and `require', and altered by `provide'. */); Vfeatures = Fcons (intern_c_string ("emacs"), Qnil); DEFSYM (Qsubfeatures, "subfeatures"); + DEFSYM (Qfuncall, "funcall"); #ifdef HAVE_LANGINFO_CODESET DEFSYM (Qcodeset, "codeset"); === modified file 'src/lread.c' --- src/lread.c 2013-05-15 20:12:53 +0000 +++ src/lread.c 2013-06-13 22:24:52 +0000 @@ -4485,15 +4485,15 @@ DEFSYM (Qload_in_progress, "load-in-progress"); DEFVAR_LISP ("after-load-alist", Vafter_load_alist, - doc: /* An alist of expressions to be evalled when particular files are loaded. -Each element looks like (REGEXP-OR-FEATURE FORMS...). + doc: /* An alist of functions to be evalled when particular files are loaded. +Each element looks like (REGEXP-OR-FEATURE FUNCS...). REGEXP-OR-FEATURE is either a regular expression to match file names, or a symbol \(a feature name). When `load' is run and the file-name argument matches an element's REGEXP-OR-FEATURE, or when `provide' is run and provides the symbol -REGEXP-OR-FEATURE, the FORMS in the element are executed. +REGEXP-OR-FEATURE, the FUNCS in the element are called. An error in FORMS does not undo the load, but does prevent execution of the rest of the FORMS. */); ------------------------------------------------------------ revno: 112975 committer: Juri Linkov branch nick: trunk timestamp: Fri 2013-06-14 01:08:45 +0300 message: * lisp/isearch.el (isearch-query-replace): Add " symbol" and other possible search modes from `isearch-message-prefix' to the prompt. (isearch-occur): Use `with-isearch-suspended' to not exit Isearch when reading a regexp to collect. * lisp/replace.el (perform-replace): Display "symbol " and other search modes from `isearch-message-prefix' in the *Help* buffer. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-13 21:49:10 +0000 +++ lisp/ChangeLog 2013-06-13 22:08:45 +0000 @@ -1,5 +1,15 @@ 2013-06-13 Juri Linkov + * replace.el (perform-replace): Display "symbol " and other search + modes from `isearch-message-prefix' in the *Help* buffer. + + * isearch.el (isearch-query-replace): Add " symbol" and other + possible search modes from `isearch-message-prefix' to the prompt. + (isearch-occur): Use `with-isearch-suspended' to not exit Isearch + when reading a regexp to collect. + +2013-06-13 Juri Linkov + * isearch.el (word-search-regexp): Match whitespace if the search string begins or ends in whitespace. The LAX arg is applied to both ends of the search string. Use `regexp-quote' and explicit === modified file 'lisp/isearch.el' --- lisp/isearch.el 2013-06-13 21:49:10 +0000 +++ lisp/isearch.el 2013-06-13 22:08:45 +0000 @@ -1678,9 +1678,10 @@ "Start `query-replace' with string to replace from last search string. The arg DELIMITED (prefix arg if interactive), if non-nil, means replace only matches surrounded by word boundaries. Note that using the prefix arg -is possible only when `isearch-allow-scroll' is non-nil, and it doesn't -always provide the correct matches for `query-replace', so the preferred -way to run word replacements from Isearch is `M-s w ... M-%'." +is possible only when `isearch-allow-scroll' is non-nil or +`isearch-allow-prefix' is non-nil, and it doesn't always provide the +correct matches for `query-replace', so the preferred way to run word +replacements from Isearch is `M-s w ... M-%'." (interactive (list current-prefix-arg)) (barf-if-buffer-read-only) @@ -1714,7 +1715,15 @@ (query-replace-read-to isearch-string (concat "Query replace" - (if (or delimited isearch-word) " word" "") + (if (or delimited isearch-word) + (let* ((symbol (or delimited isearch-word)) + (string (and symbol (symbolp symbol) + (get symbol 'isearch-message-prefix)))) + (if (stringp string) + ;; Move space from the end to the beginning. + (replace-regexp-in-string "\\(.*\\) \\'" " \\1" string) + " word")) + "") (if isearch-regexp " regexp" "") (if (and transient-mark-mode mark-active) " in region" "")) isearch-regexp) @@ -1756,12 +1765,14 @@ ;; No subexpression so collect the entire match. "\\&" ;; Get the regexp for collection pattern. - (isearch-done nil t) - (isearch-clean-overlays) - (let ((default (car occur-collect-regexp-history))) - (read-regexp - (format "Regexp to collect (default %s): " default) - default 'occur-collect-regexp-history))) + (let ((default (car occur-collect-regexp-history)) + regexp-collect) + (with-isearch-suspended + (setq regexp-collect + (read-regexp + (format "Regexp to collect (default %s): " default) + default 'occur-collect-regexp-history))) + regexp-collect)) ;; Otherwise normal occur takes numerical prefix argument. (when current-prefix-arg (prefix-numeric-value current-prefix-arg)))))) === modified file 'lisp/replace.el' --- lisp/replace.el 2013-06-11 16:51:12 +0000 +++ lisp/replace.el 2013-06-13 22:08:45 +0000 @@ -2156,7 +2156,10 @@ (with-output-to-temp-buffer "*Help*" (princ (concat "Query replacing " - (if delimited-flag "word " "") + (if delimited-flag + (or (and (symbolp delimited-flag) + (get delimited-flag 'isearch-message-prefix)) + "word ") "") (if regexp-flag "regexp " "") from-string " with " next-replacement ".\n\n" ------------------------------------------------------------ revno: 112974 fixes bug: http://debbugs.gnu.org/14602 committer: Juri Linkov branch nick: trunk timestamp: Fri 2013-06-14 00:49:10 +0300 message: * lisp/isearch.el (word-search-regexp): Match whitespace if the search string begins or ends in whitespace. The LAX arg is applied to both ends of the search string. Use `regexp-quote' and explicit \< and \> instead of \b. Use \` and \' instead of ^ and $. (isearch-symbol-regexp): Sync with `word-search-regexp' where word boundaries are replaced with symbol boundaries, and characters between symbols match non-word non-symbol syntax. diff: === modified file 'etc/NEWS' --- etc/NEWS 2013-06-13 20:50:51 +0000 +++ etc/NEWS 2013-06-13 21:49:10 +0000 @@ -300,6 +300,14 @@ `isearch-printing-char', `isearch-quote-char', `isearch-yank-word', `isearch-yank-line'. +*** Word search now matches whitespace at the beginning/end +of the search string if it contains leading/trailing whitespace. +In an incremental word search or when using a non-nil LAX argument +of `word-search-regexp', the lax matching can also match part of +the first word (in addition to the lax matching of the last word). +The same rules are now applied to the symbol search with the difference +that it matches symbols, and non-symbol characters between symbols. + ** MH-E has been updated to MH-E version 8.5. See MH-E-NEWS for details. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-13 21:11:42 +0000 +++ lisp/ChangeLog 2013-06-13 21:49:10 +0000 @@ -1,5 +1,15 @@ 2013-06-13 Juri Linkov + * isearch.el (word-search-regexp): Match whitespace if the search + string begins or ends in whitespace. The LAX arg is applied to + both ends of the search string. Use `regexp-quote' and explicit + \< and \> instead of \b. Use \` and \' instead of ^ and $. + (isearch-symbol-regexp): Sync with `word-search-regexp' where word + boundaries are replaced with symbol boundaries, and characters + between symbols match non-word non-symbol syntax. (Bug#14602) + +2013-06-13 Juri Linkov + * isearch.el (isearch-del-char): Don't exceed the length of `isearch-string' by the prefix arg. (Bug#14563) === modified file 'lisp/isearch.el' --- lisp/isearch.el 2013-06-13 21:11:42 +0000 +++ lisp/isearch.el 2013-06-13 21:49:10 +0000 @@ -1540,17 +1540,22 @@ "Return a regexp which matches words, ignoring punctuation. Given STRING, a string of words separated by word delimiters, compute a regexp that matches those exact words separated by -arbitrary punctuation. If LAX is non-nil, the end of the string -need not match a word boundary unless it ends in whitespace. +arbitrary punctuation. If the string begins or ends in whitespace, +the beginning or the end of the string matches arbitrary whitespace. +Otherwise if LAX is non-nil, the beginning or the end of the string +need not match a word boundary. Used in `word-search-forward', `word-search-backward', `word-search-forward-lax', `word-search-backward-lax'." - (if (string-match-p "^\\W*$" string) - "" - (concat - "\\b" - (mapconcat 'identity (split-string string "\\W+" t) "\\W+") - (if (or (not lax) (string-match-p "\\W$" string)) "\\b")))) + (cond + ((equal string "") "") + ((string-match-p "\\`\\W+\\'" string) "\\W+") + (t (concat + (if (string-match-p "\\`\\W" string) "\\W+" + (unless lax "\\<")) + (mapconcat 'regexp-quote (split-string string "\\W+" t) "\\W+") + (if (string-match-p "\\W\\'" string) "\\W+" + (unless lax "\\>")))))) (defun word-search-backward (string &optional bound noerror count) "Search backward from point for STRING, ignoring differences in punctuation. @@ -1625,8 +1630,24 @@ (defun isearch-symbol-regexp (string &optional lax) "Return a regexp which matches STRING as a symbol. Creates a regexp where STRING is surrounded by symbol delimiters \\_< and \\_>. -If LAX is non-nil, the end of the string need not match a symbol boundary." - (concat "\\_<" (regexp-quote string) (unless lax "\\_>"))) +If there are more than one symbol, then compute a regexp that matches +those exact symbols separated by non-symbol characters. If the string +begins or ends in whitespace, the beginning or the end of the string +matches arbitrary non-symbol whitespace. Otherwise if LAX is non-nil, +the beginning or the end of the string need not match a symbol boundary." + (let ((not-word-symbol-re + ;; This regexp matches all syntaxes except word and symbol syntax. + ;; FIXME: Replace it with something shorter if possible (bug#14602). + "\\(?:\\s-\\|\\s.\\|\\s(\\|\\s)\\|\\s\"\\|\\s\\\\|\\s/\\|\\s$\\|\\s'\\|\\s<\\|\\s>\\|\\s@\\|\\s!\\|\\s|\\)+")) + (cond + ((equal string "") "") + ((string-match-p (format "\\`%s\\'" not-word-symbol-re) string) not-word-symbol-re) + (t (concat + (if (string-match-p (format "\\`%s" not-word-symbol-re) string) not-word-symbol-re + (unless lax "\\_<")) + (mapconcat 'regexp-quote (split-string string not-word-symbol-re t) not-word-symbol-re) + (if (string-match-p (format "%s\\'" not-word-symbol-re) string) not-word-symbol-re + (unless lax "\\_>"))))))) (put 'isearch-symbol-regexp 'isearch-message-prefix "symbol ") ------------------------------------------------------------ revno: 112973 fixes bug: http://debbugs.gnu.org/14563 committer: Juri Linkov branch nick: trunk timestamp: Fri 2013-06-14 00:11:42 +0300 message: * lisp/isearch.el (isearch-del-char): Don't exceed the length of `isearch-string' by the prefix arg. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-13 20:50:51 +0000 +++ lisp/ChangeLog 2013-06-13 21:11:42 +0000 @@ -1,5 +1,10 @@ 2013-06-13 Juri Linkov + * isearch.el (isearch-del-char): Don't exceed the length of + `isearch-string' by the prefix arg. (Bug#14563) + +2013-06-13 Juri Linkov + * isearch.el (isearch-yank-word, isearch-yank-line) (isearch-char-by-name, isearch-quote-char) (isearch-printing-char, isearch-process-search-char): === modified file 'lisp/isearch.el' --- lisp/isearch.el 2013-06-13 20:50:51 +0000 +++ lisp/isearch.el 2013-06-13 21:11:42 +0000 @@ -1815,11 +1815,17 @@ (interactive "p") (if (= 0 (length isearch-string)) (ding) - (setq isearch-string (substring isearch-string 0 (- (or arg 1))) + (setq isearch-string (substring isearch-string 0 + (- (min (or arg 1) + (length isearch-string)))) isearch-message (mapconcat 'isearch-text-char-description isearch-string ""))) ;; Use the isearch-other-end as new starting point to be able ;; to find the remaining part of the search string again. + ;; This is like what `isearch-search-and-update' does, + ;; but currently it doesn't support deletion of characters + ;; for the case where unsuccessful search may become successful + ;; by deletion of characters. (if isearch-other-end (goto-char isearch-other-end)) (isearch-search) (isearch-push-state) ------------------------------------------------------------ revno: 112972 fixes bug: http://debbugs.gnu.org/14563 committer: Juri Linkov branch nick: trunk timestamp: Thu 2013-06-13 23:50:51 +0300 message: Add prefix arg to more isearch commands. * lisp/isearch.el (isearch-yank-word, isearch-yank-line) (isearch-char-by-name, isearch-quote-char) (isearch-printing-char, isearch-process-search-char): Add optional count prefix arg. * lisp/international/isearch-x.el (isearch-process-search-multibyte-characters): Add optional count prefix arg. diff: === modified file 'etc/NEWS' --- etc/NEWS 2013-06-13 06:35:32 +0000 +++ etc/NEWS 2013-06-13 20:50:51 +0000 @@ -296,6 +296,10 @@ *** By default, prefix arguments do not now terminate Isearch mode. Set `isearch-allow-prefix' to nil to restore old behavior. +*** More Isearch commands accept prefix arguments, namely +`isearch-printing-char', `isearch-quote-char', `isearch-yank-word', +`isearch-yank-line'. + ** MH-E has been updated to MH-E version 8.5. See MH-E-NEWS for details. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-13 20:43:53 +0000 +++ lisp/ChangeLog 2013-06-13 20:50:51 +0000 @@ -1,3 +1,14 @@ +2013-06-13 Juri Linkov + + * isearch.el (isearch-yank-word, isearch-yank-line) + (isearch-char-by-name, isearch-quote-char) + (isearch-printing-char, isearch-process-search-char): + Add optional count prefix arg. (Bug#14563) + + * international/isearch-x.el + (isearch-process-search-multibyte-characters): + Add optional count prefix arg. + 2013-06-13 Stefan Monnier * subr.el (internal-push-keymap, internal-pop-keymap): New functions. @@ -4667,7 +4678,7 @@ * progmodes/grep.el (grep-regexp-alist): Use variable grep-match-face instead of hard-coded default face `match'. (Bug#9438) -2012-02-01 Christopher Schmidt +2013-02-01 Christopher Schmidt * vc/vc-arch.el (vc-arch-registered): * vc/vc-bzr.el (vc-bzr-registered): === modified file 'lisp/international/isearch-x.el' --- lisp/international/isearch-x.el 2013-01-01 09:11:05 +0000 +++ lisp/international/isearch-x.el 2013-06-13 20:50:51 +0000 @@ -94,7 +94,7 @@ (exit-minibuffer))) ;;;###autoload -(defun isearch-process-search-multibyte-characters (last-char) +(defun isearch-process-search-multibyte-characters (last-char &optional count) (if (eq this-command 'isearch-printing-char) (let ((overriding-terminal-local-map nil) (prompt (isearch-message-prefix)) @@ -136,8 +136,11 @@ (if (and str (> (length str) 0)) (let ((unread-command-events nil)) - (isearch-process-search-string str str)) + (if (and (integerp count) (> count 1)) + (let ((strs (mapconcat 'identity (make-list count str) ""))) + (isearch-process-search-string strs strs)) + (isearch-process-search-string str str))) (isearch-update))) - (isearch-process-search-char last-char))) + (isearch-process-search-char last-char count))) ;;; isearch-x.el ends here === modified file 'lisp/isearch.el' --- lisp/isearch.el 2013-06-06 06:23:19 +0000 +++ lisp/isearch.el 2013-06-13 20:50:51 +0000 @@ -1919,29 +1919,33 @@ (forward-word 1)) (forward-char 1)) (point)))) -(defun isearch-yank-word () +(defun isearch-yank-word (&optional arg) "Pull next word from buffer into search string." - (interactive) - (isearch-yank-internal (lambda () (forward-word 1) (point)))) + (interactive "p") + (isearch-yank-internal (lambda () (forward-word arg) (point)))) -(defun isearch-yank-line () +(defun isearch-yank-line (&optional arg) "Pull rest of line from buffer into search string." - (interactive) + (interactive "p") (isearch-yank-internal (lambda () (let ((inhibit-field-text-motion t)) - (line-end-position (if (eolp) 2 1)))))) + (line-end-position (if (eolp) (1+ arg) arg)))))) -(defun isearch-char-by-name () +(defun isearch-char-by-name (&optional count) "Read a character by its Unicode name and add it to the search string. -Completion is available like in `read-char-by-name' used by `insert-char'." - (interactive) +Completion is available like in `read-char-by-name' used by `insert-char'. +With argument, add COUNT copies of the character." + (interactive "p") (with-isearch-suspended (let ((char (read-char-by-name "Add character to search (Unicode name or hex): "))) (when char - (setq isearch-new-string (concat isearch-string (string char)) - isearch-new-message (concat isearch-message - (mapconcat 'isearch-text-char-description - (string char) ""))))))) + (let ((string (if (and (integerp count) (> count 1)) + (make-string count char) + (char-to-string char)))) + (setq isearch-new-string (concat isearch-string string) + isearch-new-message (concat isearch-message + (mapconcat 'isearch-text-char-description + string "")))))))) (defun isearch-search-and-update () ;; Do the search and update the display. @@ -2382,9 +2386,10 @@ (t;; otherwise nil (isearch-process-search-string key key))))) -(defun isearch-quote-char () - "Quote special characters for incremental search." - (interactive) +(defun isearch-quote-char (&optional count) + "Quote special characters for incremental search. +With argument, add COUNT copies of the character." + (interactive "p") (let ((char (read-quoted-char (isearch-message t)))) ;; Assume character codes 0200 - 0377 stand for characters in some ;; single-byte character set, and convert them to Emacs @@ -2392,24 +2397,26 @@ (if (and isearch-regexp isearch-regexp-lax-whitespace (= char ?\s)) (if (subregexp-context-p isearch-string (length isearch-string)) (isearch-process-search-string "[ ]" " ") - (isearch-process-search-char char)) + (isearch-process-search-char char count)) (and enable-multibyte-characters (>= char ?\200) (<= char ?\377) (setq char (unibyte-char-to-multibyte char))) - (isearch-process-search-char char)))) + (isearch-process-search-char char count)))) -(defun isearch-printing-char () - "Add this ordinary printing character to the search string and search." - (interactive) - (let ((char last-command-event)) +(defun isearch-printing-char (&optional char count) + "Add this ordinary printing CHAR to the search string and search. +With argument, add COUNT copies of the character." + (interactive (list last-command-event + (prefix-numeric-value current-prefix-arg))) + (let ((char (or char last-command-event))) (if (= char ?\S-\ ) (setq char ?\s)) (if current-input-method - (isearch-process-search-multibyte-characters char) - (isearch-process-search-char char)))) + (isearch-process-search-multibyte-characters char count) + (isearch-process-search-char char count)))) -(defun isearch-process-search-char (char) +(defun isearch-process-search-char (char &optional count) ;; * and ? are special in regexps when not preceded by \. ;; } and | are special in regexps when preceded by \. ;; Nothing special for + because it matches at least once. @@ -2418,12 +2425,15 @@ ((eq char ?\}) (isearch-fallback t t)) ((eq char ?|) (isearch-fallback t nil t))) - ;; Append the char to the search string, update the message and re-search. - (isearch-process-search-string - (char-to-string char) - (if (>= char ?\200) - (char-to-string char) - (isearch-text-char-description char)))) + ;; Append the char(s) to the search string, + ;; update the message and re-search. + (let* ((string (if (and (integerp count) (> count 1)) + (make-string count char) + (char-to-string char))) + (message (if (>= char ?\200) + string + (mapconcat 'isearch-text-char-description string "")))) + (isearch-process-search-string string message))) (defun isearch-process-search-string (string message) (setq isearch-string (concat isearch-string string) ------------------------------------------------------------ revno: 112971 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14095 author: Vitalie Spinu , Stefan Monnier committer: Stefan Monnier branch nick: trunk timestamp: Thu 2013-06-13 16:43:53 -0400 message: * lisp/subr.el (internal-push-keymap, internal-pop-keymap): New functions. (set-temporary-overlay-map): Use them; and take advantage of lexical-binding. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-13 17:59:10 +0000 +++ lisp/ChangeLog 2013-06-13 20:43:53 +0000 @@ -1,3 +1,13 @@ +2013-06-13 Stefan Monnier + + * subr.el (internal-push-keymap, internal-pop-keymap): New functions. + (set-temporary-overlay-map): Use them (bug#14095); and take advantage of + lexical-binding. + +2013-06-13 Vitalie Spinu + + * subr.el (set-temporary-overlay-map): Add on-exit argument. + 2013-06-13 Glenn Morris * startup.el (tty-handle-args): === modified file 'lisp/subr.el' --- lisp/subr.el 2013-06-11 21:53:40 +0000 +++ lisp/subr.el 2013-06-13 20:43:53 +0000 @@ -4234,7 +4234,25 @@ (declare (obsolete called-interactively-p "23.2")) (called-interactively-p 'interactive)) -(defun set-temporary-overlay-map (map &optional keep-pred) +(defun internal-push-keymap (keymap symbol) + (let ((map (symbol-value symbol))) + (unless (memq keymap map) + (unless (memq 'add-keymap-witness (symbol-value symbol)) + (setq map (make-composed-keymap nil (symbol-value symbol))) + (push 'add-keymap-witness (cdr map)) + (set symbol map)) + (push keymap (cdr map))))) + +(defun internal-pop-keymap (keymap symbol) + (let ((map (symbol-value symbol))) + (when (memq keymap map) + (setf (cdr map) (delq keymap (cdr map)))) + (let ((tail (cddr map))) + (and (or (null tail) (keymapp tail)) + (eq 'add-keymap-witness (nth 1 map)) + (set symbol tail))))) + +(defun set-temporary-overlay-map (map &optional keep-pred on-exit) "Set MAP as a temporary keymap taking precedence over most other keymaps. Note that this does NOT take precedence over the \"overriding\" maps `overriding-terminal-local-map' and `overriding-local-map' (or the @@ -4244,29 +4262,29 @@ Normally, MAP is used only once. If the optional argument KEEP-PRED is t, MAP stays active if a key from MAP is used. KEEP-PRED can also be a function of no arguments: if it returns -non-nil then MAP stays active." - (let* ((clearfunsym (make-symbol "clear-temporary-overlay-map")) - (overlaysym (make-symbol "t")) - (alist (list (cons overlaysym map))) - (clearfun - ;; FIXME: Use lexical-binding. - `(lambda () - (unless ,(cond ((null keep-pred) nil) +non-nil then MAP stays active. + +Optional ON-EXIT argument is a function that is called after the +deactivation of MAP." + (letrec ((clearfun + (lambda () + ;; FIXME: Handle the case of multiple temporary-overlay-maps + ;; E.g. if isearch and C-u both use temporary-overlay-maps, Then + ;; the lifetime of the C-u should be nested within the isearch + ;; overlay, so the pre-command-hook of isearch should be + ;; suspended during the C-u one so we don't exit isearch just + ;; because we hit 1 after C-u and that 1 exits isearch whereas it + ;; doesn't exit C-u. + (unless (cond ((null keep-pred) nil) ((eq t keep-pred) - `(eq this-command - (lookup-key ',map - (this-command-keys-vector)))) - (t `(funcall ',keep-pred))) - (set ',overlaysym nil) ;Just in case. - (remove-hook 'pre-command-hook ',clearfunsym) - (setq emulation-mode-map-alists - (delq ',alist emulation-mode-map-alists)))))) - (set overlaysym overlaysym) - (fset clearfunsym clearfun) - (add-hook 'pre-command-hook clearfunsym) - ;; FIXME: That's the keymaps with highest precedence, except for - ;; the `keymap' text-property ;-( - (push alist emulation-mode-map-alists))) + (eq this-command + (lookup-key map (this-command-keys-vector)))) + (t (funcall keep-pred))) + (remove-hook 'pre-command-hook clearfun) + (internal-pop-keymap map 'overriding-terminal-local-map) + (when on-exit (funcall on-exit)))))) + (add-hook 'pre-command-hook clearfun) + (internal-push-keymap map 'overriding-terminal-local-map))) ;;;; Progress reporters. ------------------------------------------------------------ revno: 112970 committer: Glenn Morris branch nick: trunk timestamp: Thu 2013-06-13 13:59:10 -0400 message: tty-handle-args fix for bug#14608 * startup.el (tty-handle-args): Don't just discard "--" and anything after. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-13 16:44:26 +0000 +++ lisp/ChangeLog 2013-06-13 17:59:10 +0000 @@ -1,5 +1,8 @@ 2013-06-13 Glenn Morris + * startup.el (tty-handle-args): + Don't just discard "--" and anything after. (Bug#14608) + * emacs-lisp/lisp.el (forward-sexp, backward-sexp): Doc fixes. 2013-06-13 Michael Albinus === modified file 'lisp/startup.el' --- lisp/startup.el 2013-04-23 21:51:40 +0000 +++ lisp/startup.el 2013-06-13 17:59:10 +0000 @@ -715,7 +715,7 @@ default-frame-alist)) (t (push argi rest))))) - (nreverse rest))) + (nconc (nreverse rest) args))) (declare-function x-get-resource "frame.c" (attribute class &optional component subclass)) ------------------------------------------------------------ revno: 112969 committer: Paul Eggert branch nick: trunk timestamp: Thu 2013-06-13 10:52:21 -0700 message: * DEBUG: Document -fno-omit-frame-pointer. diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2013-06-13 17:04:08 +0000 +++ etc/ChangeLog 2013-06-13 17:52:21 +0000 @@ -1,6 +1,6 @@ 2013-06-13 Paul Eggert - * DEBUG: Document -Og. + * DEBUG: Document -Og and -fno-omit-frame-pointer. 2013-06-05 Teodor Zlatanov === modified file 'etc/DEBUG' --- etc/DEBUG 2013-06-13 17:04:08 +0000 +++ etc/DEBUG 2013-06-13 17:52:21 +0000 @@ -27,11 +27,11 @@ is essential to compile Emacs with flags suitable for debugging. With GCC 4.8 or later, you can invoke 'make' with CFLAGS="-Og -g3". With older GCC or non-GCC commpilers, you can use CFLAGS="-O0 -g3". -With GCC and higher optimization levels such as -O2, at least compile -with the -fno-crossjumping option in CFLAGS. Failure to do so may -make the compiler recycle the same abort call for all assertions in a -given function, rendering the stack backtrace useless for identifying -the specific failed assertion. +With GCC and higher optimization levels such as -O2, the +-fno-omit-frame-pointer and -fno-crossjumping options are often +essential. The latter prevents GCC from using the same abort call for +all assertions in a given function, rendering the stack backtrace +useless for identifying the specific failed assertion. ** It is a good idea to run Emacs under GDB (or some other suitable debugger) *all the time*. Then, when Emacs crashes, you will be able ------------------------------------------------------------ revno: 112968 committer: Stefan Monnier branch nick: trunk timestamp: Thu 2013-06-13 13:05:22 -0400 message: * lisp/gnus/sieve-manage.el (sieve-manage-open-server): Don't quote lambda. Use plist-get rather than CL's getf. (sieve-manage-parse-capability): Avoid CL's remove-if. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2013-06-13 14:31:52 +0000 +++ lisp/gnus/ChangeLog 2013-06-13 17:05:22 +0000 @@ -1,3 +1,9 @@ +2013-06-13 Stefan Monnier + + * sieve-manage.el (sieve-manage-open-server): Don't quote lambda. + Use plist-get rather than CL's getf. + (sieve-manage-parse-capability): Avoid CL's remove-if. + 2013-06-13 Lars Magne Ingebrigtsen * shr.el (shr-expand-url): Expansion should chop off the bits after the @@ -29,7 +35,7 @@ 2013-06-10 Albert Krewinkel - * sieve-manage.el (sieve-manage-open): work with STARTTLS: shorten + * sieve-manage.el (sieve-manage-open): Work with STARTTLS: shorten stream managing functions by using open-protocol-stream to do most of the work. Has the nice benefit of enabling STARTTLS. Wait for capabilities after STARTTLS: following RFC5804, the server === modified file 'lisp/gnus/sieve-manage.el' --- lisp/gnus/sieve-manage.el 2013-06-11 07:32:25 +0000 +++ lisp/gnus/sieve-manage.el 2013-06-13 17:05:22 +0000 @@ -206,15 +206,15 @@ :success "^OK.*\n" :return-list t :starttls-function - '(lambda (capabilities) - (when (string-match "\\bSTARTTLS\\b" capabilities) - "STARTTLS\r\n"))) + (lambda (capabilities) + (when (string-match "\\bSTARTTLS\\b" capabilities) + "STARTTLS\r\n"))) (setq sieve-manage-process proc) (setq sieve-manage-capability - (sieve-manage-parse-capability (getf props :capabilities))) + (sieve-manage-parse-capability (plist-get props :capabilities))) ;; Ignore new capabilities issues after successful STARTTLS (when (and (memq stream '(nil network starttls)) - (eq (getf props :type) 'tls)) + (eq (plist-get props :type) 'tls)) (sieve-manage-drop-next-answer)) (current-buffer)))) @@ -502,9 +502,9 @@ (defun sieve-manage-parse-capability (str) "Parse managesieve capability string `STR'. Set variable `sieve-manage-capability' to " - (let ((capas (remove-if #'null - (mapcar #'split-string-and-unquote - (split-string str "\n"))))) + (let ((capas (delq nil + (mapcar #'split-string-and-unquote + (split-string str "\n"))))) (when (string= "OK" (caar (last capas))) (setq sieve-manage-state 'nonauth)) capas)) ------------------------------------------------------------ revno: 112967 committer: Paul Eggert branch nick: trunk timestamp: Thu 2013-06-13 10:04:08 -0700 message: * DEBUG: Document -Og. diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2013-06-05 18:31:48 +0000 +++ etc/ChangeLog 2013-06-13 17:04:08 +0000 @@ -1,3 +1,7 @@ +2013-06-13 Paul Eggert + + * DEBUG: Document -Og. + 2013-06-05 Teodor Zlatanov * NEWS: Document new prog-mode symbol prettify support. === modified file 'etc/DEBUG' --- etc/DEBUG 2013-02-22 09:22:21 +0000 +++ etc/DEBUG 2013-06-13 17:04:08 +0000 @@ -24,8 +24,10 @@ described in the node "Auto-loading safe path" in the GDB user manual. ** When you are trying to analyze failed assertions or backtraces, it -will be essential to compile Emacs either completely without -optimizations (set CFLAGS to "-O0 -g3") or at least (when using GCC) +is essential to compile Emacs with flags suitable for debugging. +With GCC 4.8 or later, you can invoke 'make' with CFLAGS="-Og -g3". +With older GCC or non-GCC commpilers, you can use CFLAGS="-O0 -g3". +With GCC and higher optimization levels such as -O2, at least compile with the -fno-crossjumping option in CFLAGS. Failure to do so may make the compiler recycle the same abort call for all assertions in a given function, rendering the stack backtrace useless for identifying @@ -769,4 +771,3 @@ mode: outline paragraph-separate: "[ ]*$" end: - ------------------------------------------------------------ revno: 112966 committer: Glenn Morris branch nick: trunk timestamp: Thu 2013-06-13 09:44:26 -0700 message: * emacs-lisp/lisp.el (forward-sexp, backward-sexp): Doc fixes. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-13 10:12:34 +0000 +++ lisp/ChangeLog 2013-06-13 16:44:26 +0000 @@ -1,3 +1,7 @@ +2013-06-13 Glenn Morris + + * emacs-lisp/lisp.el (forward-sexp, backward-sexp): Doc fixes. + 2013-06-13 Michael Albinus Implement changes in Secret Service API. Make it backward compatible. === modified file 'lisp/emacs-lisp/lisp.el' --- lisp/emacs-lisp/lisp.el 2013-06-03 15:40:35 +0000 +++ lisp/emacs-lisp/lisp.el 2013-06-13 16:44:26 +0000 @@ -59,7 +59,8 @@ "Move forward across one balanced expression (sexp). With ARG, do it that many times. Negative arg -N means move backward across N balanced expressions. -This command assumes point is not in a string or comment." +This command assumes point is not in a string or comment. +Calls `forward-sexp-function' to do the work, if that is non-nil." (interactive "^p") (or arg (setq arg 1)) (if forward-sexp-function @@ -71,7 +72,8 @@ "Move backward across one balanced expression (sexp). With ARG, do it that many times. Negative arg -N means move forward across N balanced expressions. -This command assumes point is not in a string or comment." +This command assumes point is not in a string or comment. +Uses `forward-sexp' to do the work." (interactive "^p") (or arg (setq arg 1)) (forward-sexp (- arg))) ------------------------------------------------------------ revno: 112965 author: Lars Magne Ingebrigtsen committer: Katsumi Yamaoka branch nick: trunk timestamp: Thu 2013-06-13 14:31:52 +0000 message: lisp/gnus/shr.el (shr-expand-url): Expansion should chop off the bits after the last slash lisp/gnus/eww.el (eww-tag-select): Use the first value as the default value diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2013-06-13 06:07:43 +0000 +++ lisp/gnus/ChangeLog 2013-06-13 14:31:52 +0000 @@ -1,3 +1,10 @@ +2013-06-13 Lars Magne Ingebrigtsen + + * shr.el (shr-expand-url): Expansion should chop off the bits after the + last slash. + + * eww.el (eww-tag-select): Use the first value as the default value. + 2013-06-13 RĂ¼diger Sonderfeld * eww.el (eww): Prepend urls with http:// if scheme is missing. === modified file 'lisp/gnus/eww.el' --- lisp/gnus/eww.el 2013-06-13 06:07:43 +0000 +++ lisp/gnus/eww.el 2013-06-13 14:31:52 +0000 @@ -154,9 +154,12 @@ (set (make-local-variable 'browse-url-browser-function) 'eww-browse-url)) (defun eww-browse-url (url &optional new-window) - (push (list eww-current-url (point)) - eww-history) - (eww url)) + (let ((url-request-extra-headers + (append '(("User-Agent" . "eww/1.0")) + url-request-extra-headers))) + (push (list eww-current-url (point)) + eww-history) + (eww url))) (defun eww-quit () "Exit the Emacs Web Wowser." @@ -254,6 +257,9 @@ :value (cdr (assq :value (cdr elem))) :tag (cdr (assq 'text (cdr elem)))) options))) + ;; If we have no selected values, default to the first value. + (unless (plist-get (cdr menu) :value) + (nconc menu (list :value (nth 2 (car options))))) (nconc menu options) (apply 'widget-create menu) (put-text-property start (point) 'eww-widget menu) === modified file 'lisp/gnus/shr.el' --- lisp/gnus/shr.el 2013-06-12 22:32:33 +0000 +++ lisp/gnus/shr.el 2013-06-13 14:31:52 +0000 @@ -492,7 +492,10 @@ url (let ((base shr-base)) ;; Chop off query string. - (when (string-match "^\\([^?]+\\)[?]" base) + (when (string-match "\\`\\([^?]+\\)[?]" base) + (setq base (match-string 1 base))) + ;; Chop off the bit after the last slash. + (when (string-match "\\`\\(.*\\)[/][^/]+" base) (setq base (match-string 1 base))) (cond ((and (string-match "\\`//" url) ------------------------------------------------------------ revno: 112964 committer: Glenn Morris branch nick: trunk timestamp: Thu 2013-06-13 06:21:04 -0400 message: Auto-commit of loaddefs files. diff: === modified file 'lisp/ibuffer.el' --- lisp/ibuffer.el 2013-03-07 07:28:51 +0000 +++ lisp/ibuffer.el 2013-06-13 10:21:04 +0000 @@ -2652,7 +2652,7 @@ ;;;;;; ibuffer-backward-filter-group ibuffer-forward-filter-group ;;;;;; ibuffer-toggle-filter-group ibuffer-mouse-toggle-filter-group ;;;;;; ibuffer-interactive-filter-by-mode ibuffer-mouse-filter-by-mode -;;;;;; ibuffer-auto-mode) "ibuf-ext" "ibuf-ext.el" "9950bdf995e4b5e962a17d754a35f2c6") +;;;;;; ibuffer-auto-mode) "ibuf-ext" "ibuf-ext.el" "2c628e6cde385119c5f7b43cc1efe1a1") ;;; Generated autoloads from ibuf-ext.el (autoload 'ibuffer-auto-mode "ibuf-ext" "\ @@ -2984,7 +2984,7 @@ \(fn)" t nil) (autoload 'ibuffer-mark-help-buffers "ibuf-ext" "\ -Mark buffers like *Help*, *Apropos*, *Info*. +Mark buffers whose major mode is in variable `ibuffer-help-buffer-modes'. \(fn)" t nil) ------------------------------------------------------------ revno: 112963 committer: Michael Albinus branch nick: trunk timestamp: Thu 2013-06-13 12:12:34 +0200 message: Implement changes in Secret Service API. Make it backward compatible. * net/secrets.el (secrets-struct-secret-content-type): New defonst. (secrets-create-item): Use it. Prefix properties with interface. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-13 05:27:05 +0000 +++ lisp/ChangeLog 2013-06-13 10:12:34 +0000 @@ -1,3 +1,9 @@ +2013-06-13 Michael Albinus + + Implement changes in Secret Service API. Make it backward compatible. + * net/secrets.el (secrets-struct-secret-content-type): New defonst. + (secrets-create-item): Use it. Prefix properties with interface. + 2013-06-13 Michael Hoffman <9qobl2n02@sneakemail.com> (tiny change) * term.el (term-suppress-hard-newline): New option. (Bug#12017) === modified file 'lisp/net/secrets.el' --- lisp/net/secrets.el 2013-01-01 09:11:05 +0000 +++ lisp/net/secrets.el 2013-06-13 10:12:34 +0000 @@ -208,9 +208,9 @@ ;; ;; ;; -;; -;; -;; +;; +;; +;; ;; ;; ;; @@ -234,7 +234,7 @@ ;; ;; ;; -;; +;; ;; ;; ;; @@ -245,11 +245,11 @@ ;; ;; ;; -;; -;; -;; -;; -;; +;; +;; +;; +;; +;; ;; ;; ;; @@ -293,11 +293,11 @@ ;; ;; ;; -;; -;; +;; +;; ;; ;; -;; +;; ;; ;; ;; @@ -305,10 +305,22 @@ ;; OBJECT PATH session ;; ARRAY BYTE parameters ;; ARRAY BYTE value +;; STRING content_type ;; Added 2011/2/9 (defconst secrets-interface-item-type-generic "org.freedesktop.Secret.Generic" "The default item type we are using.") +(defconst secrets-struct-secret-content-type + (when (string-equal + (dbus-introspect-get-signature + :session secrets-service secrets-path secrets-interface-service + "GetSecrets" "out") + "a{o(oayays)}") + '("text/plain")) + "The content_type of a secret struct. +It must be wrapped as list, because we add it via `append'. This +is an interface introduced in 2011.") + (defconst secrets-interface-session "org.freedesktop.Secret.Session" "A session tracks state between the service and a client application.") @@ -616,16 +628,21 @@ ;; Properties. (append `(:array - (:dict-entry "Label" (:variant ,item)) - (:dict-entry - "Type" (:variant ,secrets-interface-item-type-generic))) + (:dict-entry ,(concat secrets-interface-item ".Label") + (:variant ,item)) + (:dict-entry ,(concat secrets-interface-item ".Type") + (:variant ,secrets-interface-item-type-generic))) (when props - `((:dict-entry - "Attributes" (:variant ,(append '(:array) props)))))) + `((:dict-entry ,(concat secrets-interface-item ".Attributes") + (:variant ,(append '(:array) props)))))) ;; Secret. - `(:struct :object-path ,secrets-session-path - (:array :signature "y") ;; no parameters. - ,(dbus-string-to-byte-array password)) + (append + `(:struct :object-path ,secrets-session-path + (:array :signature "y") ;; No parameters. + ,(dbus-string-to-byte-array password)) + ;; We add the content_type. In backward compatibility + ;; mode, nil is appended, which means nothing. + secrets-struct-secret-content-type) ;; Do not replace. Replace does not seem to work. nil)) (secrets-prompt (cadr result)) ------------------------------------------------------------ revno: 112962 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-06-12 23:35:32 -0700 message: * etc/NEWS: Mention term-suppress-hard-newline diff: === modified file 'etc/NEWS' --- etc/NEWS 2013-06-13 05:19:59 +0000 +++ etc/NEWS 2013-06-13 06:35:32 +0000 @@ -365,6 +365,8 @@ TRAMP-using variants can still be used by enabling the eshell-tramp module. +** New term.el option `term-suppress-hard-newline'. + ** Obsolete packages: *** longlines.el is obsolete; use visual-line-mode instead.