Now on revision 113185. ------------------------------------------------------------ revno: 113185 fixes bug: http://debbugs.gnu.org/14668 committer: Glenn Morris branch nick: trunk timestamp: Tue 2013-06-25 23:59:48 -0700 message: * lisp/htmlfontify.el (hfy-triplet): Handle unspecified-fg, bg. (hfy-size): Handle ttys. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-26 01:52:09 +0000 +++ lisp/ChangeLog 2013-06-26 06:59:48 +0000 @@ -1,5 +1,8 @@ 2013-06-26 Glenn Morris + * htmlfontify.el (hfy-triplet): Handle unspecified-fg, bg. + (hfy-size): Handle ttys. (Bug#14668) + * info-xref.el: Update for Texinfo 5 change in *note format. (info-xref-node-re, info-xref-note-re): New constants. (info-xref-check-buffer): Use info-xref-note-re. === modified file 'lisp/htmlfontify.el' --- lisp/htmlfontify.el 2013-02-22 01:32:45 +0000 +++ lisp/htmlfontify.el 2013-06-26 06:59:48 +0000 @@ -748,6 +748,10 @@ member lower than that of the color you are processing) strange things may happen." ;;(message "hfy-colour-vals");;DBUG + ;; TODO? Can we do somehow do better than this? + (cond + ((equal colour "unspecified-fg") (setq colour "black")) + ((equal colour "unspecified-bg") (setq colour "white"))) (let ((white (mapcar (lambda (I) (float (1+ I))) (hfy-colour-vals "white"))) (rgb16 (mapcar (lambda (I) (float (1+ I))) (hfy-colour-vals colour)))) (if rgb16 @@ -773,6 +777,8 @@ "Derive a CSS font-size specifier from an Emacs font :height attribute HEIGHT. Does not cope with the case where height is a function to be applied to the height of the underlying font." + ;; In ttys, the default face has :height == 1. + (and (not (display-graphic-p)) (equal 1 height) (setq height 100)) (list (cond ;;(t (cons "font-size" ": 1em")) ------------------------------------------------------------ revno: 113184 committer: Glenn Morris branch nick: trunk timestamp: Tue 2013-06-25 18:52:09 -0700 message: info-xref.el: Update for Texinfo 5 change in *note format * lisp/info-xref.el (info-xref-node-re, info-xref-note-re): New constants. (info-xref-check-buffer): Use info-xref-note-re. * test/automated/info-xref.el: New file. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-26 00:50:50 +0000 +++ lisp/ChangeLog 2013-06-26 01:52:09 +0000 @@ -1,3 +1,9 @@ +2013-06-26 Glenn Morris + + * info-xref.el: Update for Texinfo 5 change in *note format. + (info-xref-node-re, info-xref-note-re): New constants. + (info-xref-check-buffer): Use info-xref-note-re. + 2013-06-26 Stefan Monnier * simple.el (set-variable): Use read-from-minibuffer (bug#14710). === modified file 'lisp/info-xref.el' --- lisp/info-xref.el 2013-01-01 09:11:05 +0000 +++ lisp/info-xref.el 2013-06-26 01:52:09 +0000 @@ -367,13 +367,28 @@ (forward-line))) (info-xref-check-buffer)))))))) +(defconst info-xref-node-re "\\(?1:\\(([^)]*)\\)[^.,]+\\)" + "Regexp with subexp 1 matching (manual)node.") + +;; "@xref{node,crossref,manual}." produces: +;; texinfo 4 or 5: +;; *Note crossref: (manual)node. +;; "@xref{node,,manual}." produces: +;; texinfo 4: +;; *Note node: (manual)node. +;; texinfo 5: +;; *Note (manual)node::. +(defconst info-xref-note-re + (concat "\\*[Nn]ote[ \n\t]+\\(?:" + "[^:]*:[ \n\t]+" info-xref-node-re "\\|" + info-xref-node-re "::\\)[.,]") + "Regexp matching a \"*note...\" link.") + (defun info-xref-check-buffer () "Check external references in the info file in the current buffer. This should be the raw file contents, not `Info-mode'." (goto-char (point-min)) - (while (re-search-forward - "\\*[Nn]ote[ \n\t]+[^:]*:[ \n\t]+\\(\\(([^)]*)\\)[^.,]+\\)[.,]" - nil t) + (while (re-search-forward info-xref-note-re nil t) (save-excursion (goto-char (match-beginning 1)) ;; start of nodename as error position (info-xref-check-node (match-string 1))))) === modified file 'test/ChangeLog' --- test/ChangeLog 2013-06-25 02:24:32 +0000 +++ test/ChangeLog 2013-06-26 01:52:09 +0000 @@ -1,3 +1,7 @@ +2013-06-26 Glenn Morris + + * automated/info-xref.el: New file. + 2013-06-25 Glenn Morris * automated/occur-tests.el (occur-test-create): New function. === added file 'test/automated/info-xref.el' --- test/automated/info-xref.el 1970-01-01 00:00:00 +0000 +++ test/automated/info-xref.el 2013-06-26 01:52:09 +0000 @@ -0,0 +1,148 @@ +;;; info-xref.el --- tests for info-xref.el + +;; Copyright (C) 2013 Free Software Foundation, Inc. + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;;; Code: + +(require 'ert) +(require 'info-xref) + +(defun info-xref-test-internal (body result) + "Body of a basic info-xref ert test. +BODY is a string from an info buffer. +RESULT is a list (NBAD NGOOD NUNAVAIL)." + (get-buffer-create info-xref-output-buffer) + (setq info-xref-xfile-alist nil) + (require 'info) + (let ((Info-directory-list '(".")) + Info-additional-directory-list) + (info-xref-with-output + (with-temp-buffer + (insert body) + (info-xref-check-buffer)))) + (should (equal result (list info-xref-bad info-xref-good info-xref-unavail))) + ;; If there was an error, we can leave this around. + (kill-buffer info-xref-output-buffer)) + +(ert-deftest info-xref-test-node-crossref () + "Test parsing of @xref{node,crossref,,manual} with Texinfo 4/5." + (info-xref-test-internal " +*Note crossref: (manual-foo)node. Texinfo 4/5 format with crossref. +" '(0 0 1))) + +(ert-deftest info-xref-test-node-4 () + "Test parsing of @xref{node,,,manual} with Texinfo 4." + (info-xref-test-internal " +*Note node: (manual-foo)node. Texinfo 4 format with no crossref. +" '(0 0 1))) + +(ert-deftest info-xref-test-node-5 () + "Test parsing of @xref{node,,,manual} with Texinfo 5." + (info-xref-test-internal " +*Note (manual-foo)node::. Texinfo 5 format with no crossref. +" '(0 0 1))) + +;; TODO Easier to have static data files in the repo? +(defun info-xref-test-write-file (file body) + "Write BODY to texi FILE." + (with-temp-buffer + (insert "\ +\input texinfo +@setfilename " + (format "%s.info\n" (file-name-sans-extension file)) + "\ +@settitle test + +@ifnottex +@node Top +@top test +@end ifnottex + +@menu +* Chapter One:: +@end menu + +@node Chapter One +@chapter Chapter One + +text. + +" + body + "\ +@bye +" + ) + (write-region nil nil file nil 'silent)) + (should (equal 0 (call-process "makeinfo" file)))) + +(ert-deftest info-xref-test-makeinfo () + "Test that info-xref can parse basic makeinfo output." + :expected-result (if (executable-find "makeinfo") :passed :failed) + (should (executable-find "makeinfo")) + (let ((tempfile (make-temp-file "info-xref-test" nil ".texi")) + (tempfile2 (make-temp-file "info-xref-test2" nil ".texi")) + (errflag t)) + (unwind-protect + (progn + ;; tempfile contains xrefs to various things, including tempfile2. + (info-xref-test-write-file + tempfile + (concat "\ +@xref{nodename,,,missing,Missing Manual}. + +@xref{nodename,crossref,title,missing,Missing Manual}. + +@xref{Chapter One}. + +@xref{Chapter One,Something}. + +" + (format "@xref{Chapter One,,,%s,Present Manual}.\n" + (file-name-sans-extension (file-name-nondirectory + tempfile2))))) + ;; Something for tempfile to xref to. + (info-xref-test-write-file tempfile2 "") + (require 'info) + (save-window-excursion + (let ((Info-directory-list + (list + (or (file-name-directory tempfile) "."))) + Info-additional-directory-list) + (info-xref-check (format "%s.info" (file-name-sans-extension + tempfile)))) + (should (equal (list info-xref-bad info-xref-good + info-xref-unavail) + '(0 1 2))) + (setq errflag nil) + ;; If there was an error, we can leave this around. + (kill-buffer info-xref-output-buffer))) + ;; Useful diagnostic in case of problems. + (if errflag + (with-temp-buffer + (call-process "makeinfo" nil t nil "--version") + (message "%s" (buffer-string)))) + (mapc 'delete-file (list tempfile tempfile2 + (format "%s.info" (file-name-sans-extension + tempfile)) + (format "%s.info" (file-name-sans-extension + tempfile2))))))) + +;;; info-xref.el ends here ------------------------------------------------------------ revno: 113183 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14710 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2013-06-25 20:50:50 -0400 message: * lisp/simple.el (set-variable): Use read-from-minibuffer. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-26 00:44:35 +0000 +++ lisp/ChangeLog 2013-06-26 00:50:50 +0000 @@ -1,5 +1,7 @@ 2013-06-26 Stefan Monnier + * simple.el (set-variable): Use read-from-minibuffer (bug#14710). + * emacs-lisp/package.el (package--add-to-archive-contents): Add missing nil terminate the loop (bug#14718). === modified file 'lisp/simple.el' --- lisp/simple.el 2013-06-18 20:24:44 +0000 +++ lisp/simple.el 2013-06-26 00:50:50 +0000 @@ -6448,10 +6448,10 @@ (call-interactively `(lambda (arg) (interactive ,prop) arg)) - (read - (read-string prompt nil - 'set-variable-value-history - (format "%S" (symbol-value var)))))))) + (read-from-minibuffer prompt nil + read-expression-map t + 'set-variable-value-history + (format "%S" (symbol-value var))))))) (list var val current-prefix-arg))) (and (custom-variable-p variable) ------------------------------------------------------------ revno: 113182 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14718 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2013-06-25 20:44:35 -0400 message: * lisp/emacs-lisp/package.el (package--add-to-archive-contents): Add missing nil to terminate the loop. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-25 22:29:01 +0000 +++ lisp/ChangeLog 2013-06-26 00:44:35 +0000 @@ -1,3 +1,8 @@ +2013-06-26 Stefan Monnier + + * emacs-lisp/package.el (package--add-to-archive-contents): Add missing + nil terminate the loop (bug#14718). + 2013-06-25 Lars Magne Ingebrigtsen * net/eww.el: Rework history traversal. When going forward/back, @@ -24,7 +29,7 @@ 2013-06-25 Lars Magne Ingebrigtsen - * net/eww.el (eww-copy-page-url): Changed name of command. + * net/eww.el (eww-copy-page-url): Change name of command. * net/shr.el (shr-map): Change `shr-copy-url' from `u' to `w' to be more consistent with Info and dired. === modified file 'lisp/emacs-lisp/package.el' --- lisp/emacs-lisp/package.el 2013-06-25 16:13:49 +0000 +++ lisp/emacs-lisp/package.el 2013-06-26 00:44:35 +0000 @@ -3,6 +3,7 @@ ;; Copyright (C) 2007-2013 Free Software Foundation, Inc. ;; Author: Tom Tromey +;; Daniel Hackney ;; Created: 10 Mar 2007 ;; Version: 1.0.1 ;; Keywords: tools @@ -924,7 +925,8 @@ (version-list-< version (package-desc-version (cadr existing-packages)))) (setq existing-packages (cdr existing-packages)) - (push pkg-desc (cdr existing-packages)))))))) + (push pkg-desc (cdr existing-packages)) + nil)))))) (defun package-download-transaction (packages) "Download and install all the packages in PACKAGES. ------------------------------------------------------------ revno: 113181 committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Wed 2013-06-26 00:29:01 +0200 message: (eww-render): Move the history reset to the correct buffer. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-25 22:24:43 +0000 +++ lisp/ChangeLog 2013-06-25 22:29:01 +0000 @@ -3,6 +3,7 @@ * net/eww.el: Rework history traversal. When going forward/back, put these actions into the history, too, so that they can be replayed. + (eww-render): Move the history reset to the correct buffer. 2013-06-25 Juri Linkov === modified file 'lisp/net/eww.el' --- lisp/net/eww.el 2013-06-25 22:24:43 +0000 +++ lisp/net/eww.el 2013-06-25 22:29:01 +0000 @@ -118,7 +118,6 @@ (unless (string-match-p "\\'file:" url) (setq url (concat eww-search-prefix (replace-regexp-in-string " " "+" url))))) - (setq eww-history-position 0) (url-retrieve url 'eww-render (list url))) ;;;###autoload @@ -161,6 +160,7 @@ (eww-display-image)) (t (eww-display-raw charset))) + (setq eww-history-position 0) (cond (point (goto-char point)) ------------------------------------------------------------ revno: 113180 committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Wed 2013-06-26 00:24:43 +0200 message: * net/eww.el: Rework history traversal. When going forward/back, put these actions into the history, too, so that they can be replayed. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-25 20:48:54 +0000 +++ lisp/ChangeLog 2013-06-25 22:24:43 +0000 @@ -1,3 +1,9 @@ +2013-06-25 Lars Magne Ingebrigtsen + + * net/eww.el: Rework history traversal. When going forward/back, + put these actions into the history, too, so that they can be + replayed. + 2013-06-25 Juri Linkov * files-x.el (modify-dir-local-variable): Change the header comment === modified file 'lisp/net/eww.el' --- lisp/net/eww.el 2013-06-25 19:50:05 +0000 +++ lisp/net/eww.el 2013-06-25 22:24:43 +0000 @@ -118,6 +118,7 @@ (unless (string-match-p "\\'file:" url) (setq url (concat eww-search-prefix (replace-regexp-in-string " " "+" url))))) + (setq eww-history-position 0) (url-retrieve url 'eww-render (list url))) ;;;###autoload @@ -309,10 +310,11 @@ (defun eww-setup-buffer () (pop-to-buffer (get-buffer-create "*eww*")) - (remove-overlays) (let ((inhibit-read-only t)) + (remove-overlays) (erase-buffer)) - (eww-mode)) + (unless (eq major-mode 'eww-mode) + (eww-mode))) (defvar eww-mode-map (let ((map (make-sparse-keymap))) @@ -342,18 +344,16 @@ (set (make-local-variable 'eww-current-url) 'author) (set (make-local-variable 'browse-url-browser-function) 'eww-browse-url) (set (make-local-variable 'after-change-functions) 'eww-process-text-input) + (set (make-local-variable 'eww-history) nil) + (set (make-local-variable 'eww-history-position) 0) ;;(setq buffer-read-only t) ) (defun eww-save-history () - (let ((elem (list :url eww-current-url - :point (point) - :text (buffer-string)))) - (if (or (zerop eww-history-position) - (= eww-history-position (length eww-history))) - (push elem eww-history) - (setcdr (nthcdr eww-history-position eww-history) - (cons elem (nthcdr eww-history-position eww-history)))))) + (push (list :url eww-current-url + :point (point) + :text (buffer-string)) + eww-history)) (defun eww-browse-url (url &optional new-window) (when (and (equal major-mode 'eww-mode) @@ -372,20 +372,17 @@ (interactive) (when (>= eww-history-position (length eww-history)) (error "No previous page")) - (eww-restore-history - (if (not (zerop eww-history-position)) - (elt eww-history eww-history-position) - (eww-save-history) - (elt eww-history (1+ eww-history-position)))) - (setq eww-history-position (1+ eww-history-position))) + (eww-save-history) + (setq eww-history-position (+ eww-history-position 2)) + (eww-restore-history (elt eww-history (1- eww-history-position)))) (defun eww-forward-url () "Go to the next displayed page." (interactive) (when (zerop eww-history-position) (error "No next page")) - (eww-restore-history (elt eww-history (1- eww-history-position))) - (setq eww-history-position (1- eww-history-position))) + (eww-save-history) + (eww-restore-history (elt eww-history (1- eww-history-position)))) (defun eww-restore-history (elem) (let ((inhibit-read-only t)) ------------------------------------------------------------ revno: 113179 fixes bug: http://debbugs.gnu.org/14710 committer: Juri Linkov branch nick: trunk timestamp: Tue 2013-06-25 23:48:54 +0300 message: * lisp/files-x.el (read-file-local-variable-value): Add `default'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-25 20:23:10 +0000 +++ lisp/ChangeLog 2013-06-25 20:48:54 +0000 @@ -3,6 +3,9 @@ * files-x.el (modify-dir-local-variable): Change the header comment in the file with directory local variables. (Bug#14692) + * files-x.el (read-file-local-variable-value): Add `default'. + (Bug#14710) + 2013-06-25 Lars Magne Ingebrigtsen * net/eww.el (eww-make-unique-file-name): Create a unique file === modified file 'lisp/files-x.el' --- lisp/files-x.el 2013-06-25 20:23:10 +0000 +++ lisp/files-x.el 2013-06-25 20:48:54 +0000 @@ -90,7 +90,8 @@ (minibuffer-completing-symbol t)) (read-from-minibuffer (format "Add %s with value: " variable) nil read-expression-map t - 'set-variable-value-history))))) + 'set-variable-value-history + default))))) (defun read-file-local-variable-mode () "Read per-directory file-local variable's mode using completion. ------------------------------------------------------------ revno: 113178 fixes bug: http://debbugs.gnu.org/14692 committer: Juri Linkov branch nick: trunk timestamp: Tue 2013-06-25 23:23:10 +0300 message: * lisp/files-x.el (modify-dir-local-variable): Change the header comment in the file with directory local variables. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-25 19:50:05 +0000 +++ lisp/ChangeLog 2013-06-25 20:23:10 +0000 @@ -1,3 +1,8 @@ +2013-06-25 Juri Linkov + + * files-x.el (modify-dir-local-variable): Change the header comment + in the file with directory local variables. (Bug#14692) + 2013-06-25 Lars Magne Ingebrigtsen * net/eww.el (eww-make-unique-file-name): Create a unique file === modified file 'lisp/files-x.el' --- lisp/files-x.el 2013-06-25 13:07:04 +0000 +++ lisp/files-x.el 2013-06-25 20:23:10 +0000 @@ -475,7 +475,7 @@ ;; Insert modified alist of directory-local variables. (insert ";;; Directory Local Variables\n") - (insert ";;; See Info node `(emacs) Directory Variables' for more information.\n\n") + (insert ";;; For more information see (info \"(emacs) Directory Variables\")\n\n") (pp (sort variables (lambda (a b) (cond ------------------------------------------------------------ revno: 113177 author: Ivan Kanis committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Tue 2013-06-25 21:50:05 +0200 message: * net/eww.el (eww-download): New command and keystroke. * net/eww.el (eww-make-unique-file-name): Create a unique file name before saving to entering `y' accidentally asynchronously. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-25 19:25:14 +0000 +++ lisp/ChangeLog 2013-06-25 19:50:05 +0000 @@ -1,5 +1,14 @@ 2013-06-25 Lars Magne Ingebrigtsen + * net/eww.el (eww-make-unique-file-name): Create a unique file + name before saving to entering `y' accidentally asynchronously. + +2013-06-25 Ivan Kanis + + * net/eww.el (eww-download): New command and keystroke. + +2013-06-25 Lars Magne Ingebrigtsen + * net/eww.el (eww-copy-page-url): Changed name of command. * net/shr.el (shr-map): Change `shr-copy-url' from `u' to `w' to === modified file 'lisp/net/eww.el' --- lisp/net/eww.el 2013-06-25 19:25:14 +0000 +++ lisp/net/eww.el 2013-06-25 19:50:05 +0000 @@ -50,6 +50,12 @@ :group 'eww :type 'string) +(defcustom eww-download-path "~/Downloads/" + "Path where files will downloaded." + :version "24.4" + :group 'eww + :type 'string) + (defface eww-form-submit '((((type x w32 ns) (class color)) ; Like default mode line :box (:line-width 2 :style released-button) @@ -325,6 +331,7 @@ (define-key map "u" 'eww-up-url) (define-key map "t" 'eww-top-url) (define-key map "&" 'eww-browse-with-external-browser) + (define-key map "d" 'eww-download) (define-key map "w" 'eww-copy-page-url) map)) @@ -876,6 +883,40 @@ (message "%s" eww-current-url) (kill-new eww-current-url)) +(defun eww-download () + "Download URL under point to `eww-download-directory'." + (interactive) + (let ((url (get-text-property (point) 'shr-url))) + (if (not url) + (message "No URL under point") + (url-retrieve url 'eww-download-callback (list url))))) + +(defun eww-download-callback (status url) + (unless (plist-get status :error) + (let* ((obj (url-generic-parse-url url)) + (path (car (url-path-and-query obj))) + (file (eww-make-unique-file-name (file-name-nondirectory path) + eww-download-path))) + (write-file file) + (message "Saved %s" file)))) + +(defun eww-make-unique-file-name (file directory) + (cond + ((zerop (length file)) + (setq file "!")) + ((string-match "\\`[.]" file) + (setq file (concat "!" file)))) + (let ((base file) + (count 1)) + (while (file-exists-p (expand-file-name file directory)) + (setq file + (if (string-match "\\`\\(.*\\)\\([.][^.]+\\)" file) + (format "%s(%d)%s" (match-string 1 file) + count (match-string 2 file)) + (format "%s(%d)" file count))) + (setq count (1+ count))) + (expand-file-name file directory))) + (provide 'eww) ;;; eww.el ends here ------------------------------------------------------------ revno: 113176 committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Tue 2013-06-25 21:25:14 +0200 message: Use `w' for copying URLs in shr and eww * net/eww.el (eww-mode-map): Ditto. * net/eww.el (eww-copy-page-url): Changed name of command. * net/shr.el (shr-map): Change `shr-copy-url' from `u' to `w' to be more consistent with Info and dired. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-25 16:13:49 +0000 +++ lisp/ChangeLog 2013-06-25 19:25:14 +0000 @@ -1,3 +1,12 @@ +2013-06-25 Lars Magne Ingebrigtsen + + * net/eww.el (eww-copy-page-url): Changed name of command. + + * net/shr.el (shr-map): Change `shr-copy-url' from `u' to `w' to + be more consistent with Info and dired. + + * net/eww.el (eww-mode-map): Ditto. + 2013-06-25 Stefan Monnier * emacs-lisp/package.el: Use lexical-binding. Include obsolete === modified file 'lisp/net/eww.el' --- lisp/net/eww.el 2013-06-25 15:39:13 +0000 +++ lisp/net/eww.el 2013-06-25 19:25:14 +0000 @@ -324,8 +324,8 @@ (define-key map "p" 'eww-previous-url) (define-key map "u" 'eww-up-url) (define-key map "t" 'eww-top-url) - (define-key map "w" 'eww-browse-with-external-browser) - (define-key map "y" 'eww-yank-page-url) + (define-key map "&" 'eww-browse-with-external-browser) + (define-key map "w" 'eww-copy-page-url) map)) (define-derived-mode eww-mode nil "eww" @@ -871,10 +871,11 @@ (interactive) (funcall shr-external-browser eww-current-url)) -(defun eww-yank-page-url () +(defun eww-copy-page-url () (interactive) - (message eww-current-url) + (message "%s" eww-current-url) (kill-new eww-current-url)) + (provide 'eww) ;;; eww.el ends here === modified file 'lisp/net/shr.el' --- lisp/net/shr.el 2013-06-24 17:41:26 +0000 +++ lisp/net/shr.el 2013-06-25 19:25:14 +0000 @@ -144,7 +144,7 @@ (define-key map [backtab] 'shr-previous-link) (define-key map [follow-link] 'mouse-face) (define-key map "I" 'shr-insert-image) - (define-key map "u" 'shr-copy-url) + (define-key map "w" 'shr-copy-url) (define-key map "v" 'shr-browse-url) (define-key map "o" 'shr-save-contents) (define-key map "\r" 'shr-browse-url) ------------------------------------------------------------ revno: 113175 author: Stefan Monnier committer: Juanma Barranquero branch nick: trunk timestamp: Tue 2013-06-25 19:20:19 +0200 message: lisp/window.el: Fix previous change (revno:113170). diff: === modified file 'lisp/window.el' --- lisp/window.el 2013-06-25 15:44:42 +0000 +++ lisp/window.el 2013-06-25 17:20:19 +0000 @@ -4259,7 +4259,7 @@ (normal-height . ,(window-normal-size window)) (normal-width . ,(window-normal-size window t)) ,@(unless (window-live-p window) - `(combination-limit . ,(window-combination-limit window))) + `((combination-limit . ,(window-combination-limit window)))) ,@(let ((parameters (window-parameters window)) list) ;; Make copies of those window parameters whose ------------------------------------------------------------ revno: 113174 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2013-06-25 12:13:49 -0400 message: * lisp/emacs-lisp/package.el: Include obsolete packages from archives. Use lexical-binding. (package-archive-contents): Change format; include obsolete packages. (package-desc): Use `dir' to mark builtin packages. (package--from-builtin): Set the `dir' field to `builtin'. (generated-autoload-file, version-control): Declare. (package-compute-transaction): Change first arg and return value to be lists of package-descs. Adjust to new package-archive-contents format. (package--add-to-archive-contents): Adjust to new package-archive-contents format. (package-download-transaction): Arg is now a list of package-descs. (package-install): If `pkg' is a package name, pass it as a requirement, so it is subject to the usual (e.g. disabled) checks. (describe-package): Accept package-desc as well. (describe-package-1): Describe a specific package-desc. Add links to other package-descs for the same package name. (package-menu-describe-package): Pass the actual package-desc. (package-menu-mode): Add to tabulated-list-revert-hook so revert-buffer works correctly. (package-desc-status): New function. (package-menu--refresh): New function, extracted from package-menu--generate. (package-menu--generate): Use it. (package-delete): Update package-alist. (package-menu-execute): Don't call package-initialize. * lisp/progmodes/idlw-toolbar.el, lisp/progmodes/idlw-shell.el, lisp/progmodes/idlw-help.el, lisp/progmodes/idlw-complete-structtag.el, lisp/progmodes/ebnf-yac.el, lisp/progmodes/ebnf-otz.el, lisp/progmodes/ebnf-iso.el, lisp/progmodes/ebnf-ebx.el, lisp/progmodes/ebnf-dtd.el, lisp/progmodes/ebnf-bnf.el, lisp/progmodes/ebnf-abn.el, lisp/emacs-lisp/package-x.el, lisp/emacs-lisp/cl-seq.el, lisp/emacs-lisp/cl-macs.el lisp/cedet/data-debug.el, lisp/cedet/cedet-idutils.el: Neuter the "Version:" header. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-25 15:44:42 +0000 +++ lisp/ChangeLog 2013-06-25 16:13:49 +0000 @@ -1,3 +1,38 @@ +2013-06-25 Stefan Monnier + + * emacs-lisp/package.el: Use lexical-binding. Include obsolete + packages from archives. + (package-archive-contents): Change format; include obsolete packages. + (package-desc): Use `dir' to mark builtin packages. + (package--from-builtin): Set the `dir' field to `builtin'. + (generated-autoload-file, version-control): Declare. + (package-compute-transaction): Change first arg and return value to be + lists of package-descs. Adjust to new package-archive-contents format. + (package--add-to-archive-contents): Adjust to new + package-archive-contents format. + (package-download-transaction): Arg is now a list of package-descs. + (package-install): If `pkg' is a package name, pass it as + a requirement, so it is subject to the usual (e.g. disabled) checks. + (describe-package): Accept package-desc as well. + (describe-package-1): Describe a specific package-desc. Add links to + other package-descs for the same package name. + (package-menu-describe-package): Pass the actual package-desc. + (package-menu-mode): Add to tabulated-list-revert-hook so revert-buffer + works correctly. + (package-desc-status): New function. + (package-menu--refresh): New function, extracted + from package-menu--generate. + (package-menu--generate): Use it. + (package-delete): Update package-alist. + (package-menu-execute): Don't call package-initialize. + + * progmodes/idlw-toolbar.el, progmodes/idlw-shell.el, + progmodes/idlw-help.el, progmodes/idlw-complete-structtag.el, + progmodes/ebnf-yac.el, progmodes/ebnf-otz.el, progmodes/ebnf-iso.el, + progmodes/ebnf-ebx.el, progmodes/ebnf-dtd.el, progmodes/ebnf-bnf.el, + progmodes/ebnf-abn.el, emacs-lisp/package-x.el, emacs-lisp/cl-seq.el, + emacs-lisp/cl-macs.el: Neuter the "Version:" header. + 2013-06-25 Martin Rudalics * window.el (window--state-get-1): Workaround for bug#14527. === modified file 'lisp/cedet/ChangeLog' --- lisp/cedet/ChangeLog 2013-06-19 20:29:09 +0000 +++ lisp/cedet/ChangeLog 2013-06-25 16:13:49 +0000 @@ -1,3 +1,7 @@ +2013-06-25 Stefan Monnier + + * data-debug.el, cedet-idutils.el: Neuter the "Version:" header. + 2013-06-19 Glenn Morris * semantic/idle.el (define-semantic-idle-service): === modified file 'lisp/cedet/cedet-idutils.el' --- lisp/cedet/cedet-idutils.el 2013-01-01 09:11:05 +0000 +++ lisp/cedet/cedet-idutils.el 2013-06-25 16:13:49 +0000 @@ -3,7 +3,7 @@ ;; Copyright (C) 2009-2013 Free Software Foundation, Inc. ;; Author: Eric M. Ludlam -;; Version: 0.2 +;; Old-Version: 0.2 ;; Keywords: OO, lisp ;; Package: cedet === modified file 'lisp/cedet/data-debug.el' --- lisp/cedet/data-debug.el 2013-01-01 09:11:05 +0000 +++ lisp/cedet/data-debug.el 2013-06-25 16:13:49 +0000 @@ -3,7 +3,7 @@ ;; Copyright (C) 2007-2013 Free Software Foundation, Inc. ;; Author: Eric M. Ludlam -;; Version: 0.2 +;; Old-Version: 0.2 ;; Keywords: OO, lisp ;; Package: cedet === modified file 'lisp/emacs-lisp/cl-macs.el' --- lisp/emacs-lisp/cl-macs.el 2013-06-20 20:01:51 +0000 +++ lisp/emacs-lisp/cl-macs.el 2013-06-25 16:13:49 +0000 @@ -3,7 +3,7 @@ ;; Copyright (C) 1993, 2001-2013 Free Software Foundation, Inc. ;; Author: Dave Gillespie -;; Version: 2.02 +;; Old-Version: 2.02 ;; Keywords: extensions ;; Package: emacs === modified file 'lisp/emacs-lisp/cl-seq.el' --- lisp/emacs-lisp/cl-seq.el 2013-01-02 16:13:04 +0000 +++ lisp/emacs-lisp/cl-seq.el 2013-06-25 16:13:49 +0000 @@ -3,7 +3,7 @@ ;; Copyright (C) 1993, 2001-2013 Free Software Foundation, Inc. ;; Author: Dave Gillespie -;; Version: 2.02 +;; Old-Version: 2.02 ;; Keywords: extensions ;; Package: emacs === modified file 'lisp/emacs-lisp/package-x.el' --- lisp/emacs-lisp/package-x.el 2013-06-21 03:08:47 +0000 +++ lisp/emacs-lisp/package-x.el 2013-06-25 16:13:49 +0000 @@ -4,7 +4,6 @@ ;; Author: Tom Tromey ;; Created: 10 Mar 2007 -;; Version: 0.9 ;; Keywords: tools ;; Package: package === modified file 'lisp/emacs-lisp/package.el' --- lisp/emacs-lisp/package.el 2013-06-22 20:09:19 +0000 +++ lisp/emacs-lisp/package.el 2013-06-25 16:13:49 +0000 @@ -1,4 +1,4 @@ -;;; package.el --- Simple package system for Emacs +;;; package.el --- Simple package system for Emacs -*- lexical-binding:t -*- ;; Copyright (C) 2007-2013 Free Software Foundation, Inc. @@ -253,7 +253,7 @@ (defvar package-archive-contents nil "Cache of the contents of the Emacs Lisp Package Archive. This is an alist mapping package names (symbols) to -`package-desc' structures.") +non-empty lists of `package-desc' structures.") (put 'package-archive-contents 'risky-local-variable t) (defcustom package-user-dir (locate-user-emacs-file "elpa") @@ -306,27 +306,27 @@ (nth 1 requirements) requirements)))))) "Structure containing information about an individual package. - Slots: -`name' Name of the package, as a symbol. +`name' Name of the package, as a symbol. `version' Version of the package, as a version list. `summary' Short description of the package, typically taken from -the first line of the file. - -`reqs' Requirements of the package. A list of (PACKAGE -VERSION-LIST) naming the dependent package and the minimum -required version. - -`kind' The distribution format of the package. Currently, it is -either `single' or `tar'. + the first line of the file. + +`reqs' Requirements of the package. A list of (PACKAGE + VERSION-LIST) naming the dependent package and the minimum + required version. + +`kind' The distribution format of the package. Currently, it is + 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)." +`dir' The directory where the package is installed (if installed), + `builtin' if it is built-in, or nil otherwise." name version (summary package--default-summary) @@ -488,7 +488,8 @@ (defun package--from-builtin (bi-desc) (package-desc-create :name (pop bi-desc) :version (package--bi-desc-version bi-desc) - :summary (package--bi-desc-summary bi-desc))) + :summary (package--bi-desc-summary bi-desc) + :dir 'builtin)) ;; This function goes ahead and activates a newer version of a package ;; if an older one was already activated. This is not ideal; we'd at @@ -583,6 +584,9 @@ nil file)) file) +(defvar generated-autoload-file) +(defvar version-control) + (defun package-generate-autoloads (name pkg-dir) (require 'autoload) ;Load before we let-bind generated-autoload-file! (let* ((auto-name (format "%s-autoloads.el" name)) @@ -756,9 +760,9 @@ ;; Also check built-in packages. (package-built-in-p package min-version))) -(defun package-compute-transaction (package-list requirements) - "Return a list of packages to be installed, including PACKAGE-LIST. -PACKAGE-LIST should be a list of package names (symbols). +(defun package-compute-transaction (packages requirements) + "Return a list of packages to be installed, including PACKAGES. +PACKAGES should be a list of `package-desc'. REQUIREMENTS should be a list of additional requirements; each element in this list should have the form (PACKAGE VERSION-LIST), @@ -769,40 +773,65 @@ packages in REQUIREMENTS, and returns a list of all the packages that must be installed. Packages that are already installed are not included in this list." + ;; FIXME: We really should use backtracking to explore the whole + ;; search space (e.g. if foo require bar-1.3, and bar-1.4 requires toto-1.1 + ;; whereas bar-1.3 requires toto-1.0 and the user has put a hold on toto-1.0: + ;; the current code might fail to see that it could install foo by using the + ;; older bar-1.3). (dolist (elt requirements) (let* ((next-pkg (car elt)) - (next-version (cadr elt))) - (unless (package-installed-p next-pkg next-version) + (next-version (cadr elt)) + (already ())) + (dolist (pkg packages) + (if (eq next-pkg (package-desc-name pkg)) + (setq already pkg))) + (cond + (already + (if (version-list-< next-version (package-desc-version already)) + ;; Move to front, so it gets installed early enough (bug#14082). + (setq packages (cons already (delq already packages))) + (error "Need package `%s-%s', but only %s is available" + next-pkg (package-version-join next-version) + (package-version-join (package-desc-version already))))) + + ((package-installed-p next-pkg next-version) nil) + + (t ;; 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))) - ;; FIXME: package-disabled-p needs to use a <= test! - (disabled (package-disabled-p next-pkg next-version))) - (when disabled - (if (stringp disabled) - (error "Package `%s' held at version %s, \ + (let ((pkg-descs (cdr (assq next-pkg package-archive-contents))) + (found nil) + (problem nil)) + (while (and pkg-descs (not found)) + (let* ((pkg-desc (pop pkg-descs)) + (version (package-desc-version pkg-desc)) + (disabled (package-disabled-p next-pkg version))) + (cond + ((version-list-< version next-version) + (error + "Need package `%s-%s', but only %s is available" + next-pkg (package-version-join next-version) + (package-version-join version))) + (disabled + (unless problem + (setq problem + (if (stringp disabled) + (format "Package `%s' held at version %s, \ but version %s required" - (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) - (package-version-join next-version))) - (unless (version-list-<= next-version - (package-desc-version pkg-desc)) - (error - "Need package `%s-%s', but only %s is available" - (symbol-name next-pkg) (package-version-join next-version) - (package-version-join (package-desc-version pkg-desc)))) - ;; Move to front, so it gets installed early enough (bug#14082). - (setq package-list (cons next-pkg (delq next-pkg package-list))) - (setq package-list - (package-compute-transaction package-list - (package-desc-reqs - pkg-desc))))))) - package-list) + next-pkg disabled + (package-version-join next-version)) + (format "Required package '%s' is disabled" + next-pkg))))) + (t (setq found pkg-desc))))) + (unless found + (if problem + (error problem) + (error "Package `%s-%s' is unavailable" + next-pkg (package-version-join next-version)))) + (setq packages + (package-compute-transaction (cons found packages) + (package-desc-reqs found)))))))) + packages) (defun package-read-from-string (str) "Read a Lisp expression from STR. @@ -875,40 +904,35 @@ :summary (package--ac-desc-summary (cdr package)) :kind (package--ac-desc-kind (cdr package)) :archive archive)) - (entry (cons name pkg-desc)) - (existing-package (assq name package-archive-contents)) + (existing-packages (assq name package-archive-contents)) (pinned-to-archive (assoc name package-pinned-packages))) (cond - ;; Skip entirely if pinned to another archive or if no more recent - ;; than what we already have installed. + ;; Skip entirely if pinned to another archive or already installed. ((or (and pinned-to-archive (not (equal (cdr pinned-to-archive) archive))) (let ((bi (assq name package--builtin-versions))) - (and bi (version-list-<= version (cdr bi)))) + (and bi (version-list-= version (cdr bi)))) (let ((ins (cdr (assq name package-alist)))) - (and ins (version-list-<= version - (package-desc-version (car ins)))))) + (and ins (version-list-= version + (package-desc-version (car ins)))))) nil) - ((not existing-package) - (push entry package-archive-contents)) - ((version-list-< (package-desc-version (cdr existing-package)) - version) - ;; Replace the entry with this one. - (setq package-archive-contents - (cons entry - (delq existing-package - package-archive-contents))))))) + ((not existing-packages) + (push (list name pkg-desc) package-archive-contents)) + (t + (while + (if (and (cdr existing-packages) + (version-list-< + version (package-desc-version (cadr existing-packages)))) + (setq existing-packages (cdr existing-packages)) + (push pkg-desc (cdr existing-packages)))))))) -(defun package-download-transaction (package-list) - "Download and install all the packages in PACKAGE-LIST. -PACKAGE-LIST should be a list of package names (symbols). +(defun package-download-transaction (packages) + "Download and install all the packages in PACKAGES. +PACKAGES should be a list of package-desc. This function assumes that all package requirements in -PACKAGE-LIST are satisfied, i.e. that PACKAGE-LIST is computed +PACKAGES are satisfied, i.e. that PACKAGES 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)))) - (package-install-from-archive desc)))) + (mapc #'package-install-from-archive packages)) ;;;###autoload (defun package-install (pkg) @@ -924,21 +948,16 @@ (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) + "Install package: " + (mapcar (lambda (elt) (symbol-name (car elt))) + package-archive-contents) nil t))))) - (let ((pkg-desc - (if (package-desc-p pkg) pkg - (cdr (assq pkg package-archive-contents))))) - (unless pkg-desc - (error "Package `%s' is not available for installation" pkg)) (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))))) + (if (package-desc-p pkg) + (package-compute-transaction (list pkg) + (package-desc-reqs pkg)) + (package-compute-transaction () + (list (list pkg)))))) (defun package-strip-rcs-id (str) "Strip RCS version ID from the version string STR. @@ -1043,15 +1062,17 @@ (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' deleted." (package-desc-full-name pkg-desc))) - ;; Don't delete "system" packages - (error "Package `%s' is a system package, not deleting" - (package-desc-full-name pkg-desc))))) + (if (not (string-prefix-p (file-name-as-directory + (expand-file-name package-user-dir)) + (expand-file-name dir))) + ;; Don't delete "system" packages. + (error "Package `%s' is a system package, not deleting" + (package-desc-full-name pkg-desc)) + (delete-directory dir t t) + ;; Update package-alist. + (let* ((name (package-desc-name pkg-desc))) + (delete pkg-desc (assq name package-alist))) + (message "Package `%s' deleted." (package-desc-full-name pkg-desc))))) (defun package-archive-base (desc) "Return the archive containing the package NAME." @@ -1110,26 +1131,25 @@ (defun describe-package (package) "Display the full documentation of PACKAGE (a symbol)." (interactive - (let* ((guess (function-called-at-point)) - packages val) + (let* ((guess (function-called-at-point))) (require 'finder-inf nil t) ;; Load the package list if necessary (but don't activate them). (unless package--initialized (package-initialize t)) - (setq packages (append (mapcar 'car package-alist) - (mapcar 'car package-archive-contents) - (mapcar 'car package--builtins))) - (unless (memq guess packages) - (setq guess nil)) - (setq packages (mapcar 'symbol-name packages)) - (setq val - (completing-read (if guess - (format "Describe package (default %s): " - guess) - "Describe package: ") - packages nil t nil nil guess)) - (list (if (equal val "") guess (intern val))))) - (if (not (and package (symbolp package))) + (let ((packages (append (mapcar 'car package-alist) + (mapcar 'car package-archive-contents) + (mapcar 'car package--builtins)))) + (unless (memq guess packages) + (setq guess nil)) + (setq packages (mapcar 'symbol-name packages)) + (let ((val + (completing-read (if guess + (format "Describe package (default %s): " + guess) + "Describe package: ") + packages nil t nil nil guess))) + (list (intern val)))))) + (if (not (or (package-desc-p package) (and package (symbolp package)))) (message "No package specified") (help-setup-xref (list #'describe-package package) (called-interactively-p 'interactive)) @@ -1137,57 +1157,52 @@ (with-current-buffer standard-output (describe-package-1 package))))) -(defun describe-package-1 (package) +(defun describe-package-1 (pkg) (require 'lisp-mnt) - (let ((package-name (symbol-name package)) - (built-in (assq package package--builtins)) - desc pkg-dir reqs version installable archive) - (prin1 package) + (let* ((desc (or + (if (package-desc-p pkg) pkg) + (cadr (assq pkg package-alist)) + (let ((built-in (assq pkg package--builtins))) + (if built-in + (package--from-builtin built-in) + (cadr (assq pkg package-archive-contents)))))) + (name (if desc (package-desc-name desc) pkg)) + (pkg-dir (if desc (package-desc-dir desc))) + (reqs (if desc (package-desc-reqs desc))) + (version (if desc (package-desc-version desc))) + (archive (if desc (package-desc-archive desc))) + (built-in (eq pkg-dir 'builtin)) + (installable (and archive (not built-in))) + (status (if desc (package-desc-status desc) "orphan"))) + (prin1 name) (princ " is ") - (cond - ;; Loaded packages are in `package-alist'. - ((setq desc (cadr (assq package package-alist))) - (setq version (package-version-join (package-desc-version desc))) - (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"))) - ;; Available packages are in `package-archive-contents'. - ((setq desc (cdr (assq package package-archive-contents))) - (setq version (package-version-join (package-desc-version desc)) - archive (package-desc-archive desc) - installable t) - (if built-in - (insert "a built-in package.\n\n") - (insert "an uninstalled package.\n\n"))) - (built-in - (setq desc (package--from-builtin built-in) - version (package-version-join (package-desc-version desc))) - (insert "a built-in package.\n\n")) - (t - (insert "an orphan package.\n\n"))) + (princ (if (memq (aref status 0) '(?a ?e ?i ?o ?u)) "an " "a ")) + (princ status) + (princ " package.\n\n") (insert " " (propertize "Status" 'font-lock-face 'bold) ": ") - (cond (pkg-dir - (insert (propertize "Installed" + (cond (built-in + (insert (propertize (capitalize status) + 'font-lock-face 'font-lock-builtin-face) + ".")) + (pkg-dir + (insert (propertize (capitalize status) ;FIXME: Why comment-face? 'font-lock-face 'font-lock-comment-face)) (insert " in `") ;; Todo: Add button for uninstalling. - (help-insert-xref-button (file-name-as-directory pkg-dir) + (help-insert-xref-button (abbreviate-file-name + (file-name-as-directory pkg-dir)) 'help-package-def pkg-dir) - (if built-in + (if (and (package-built-in-p name) + (not (package-built-in-p name version))) (insert "',\n shadowing a " (propertize "built-in package" 'font-lock-face 'font-lock-builtin-face) ".") (insert "'."))) (installable - (if built-in - (insert (propertize "Built-in." - 'font-lock-face 'font-lock-builtin-face) - " Alternate version available") - (insert "Available")) - (insert " from " archive) + (insert (capitalize status)) + (insert " from " (format "%s" archive)) (insert " -- ") (let ((button-text (if (display-graphic-p) "Install" "[Install]")) (button-face (if (display-graphic-p) @@ -1198,14 +1213,12 @@ (insert-text-button button-text 'face button-face 'follow-link t 'package-desc desc 'action 'package-install-button-action))) - (built-in - (insert (propertize "Built-in." - 'font-lock-face 'font-lock-builtin-face))) - (t (insert "Deleted."))) + (t (insert (capitalize status) "."))) (insert "\n") - (and version (> (length version) 0) + (and version (insert " " - (propertize "Version" 'font-lock-face 'bold) ": " version "\n")) + (propertize "Version" 'font-lock-face 'bold) ": " + (package-version-join version) "\n")) (setq reqs (if desc (package-desc-reqs desc))) (when reqs @@ -1225,11 +1238,38 @@ (help-insert-xref-button text 'help-package name)) (insert "\n"))) (insert " " (propertize "Summary" 'font-lock-face 'bold) - ": " (if desc (package-desc-summary desc)) "\n\n") + ": " (if desc (package-desc-summary desc)) "\n") + + (let* ((all-pkgs (append (cdr (assq name package-alist)) + (cdr (assq name package-archive-contents)) + (let ((bi (assq name package--builtins))) + (if bi (list (package--from-builtin bi)))))) + (other-pkgs (delete desc all-pkgs))) + (when other-pkgs + (insert " " (propertize "Other versions" 'font-lock-face 'bold) ": " + (mapconcat + (lambda (opkg) + (let* ((ov (package-desc-version opkg)) + (dir (package-desc-dir opkg)) + (from (or (package-desc-archive opkg) + (if (stringp dir) "installed" dir)))) + (if (not ov) (format "%s" from) + (format "%s (%s)" + (make-text-button (package-version-join ov) nil + 'face 'link + 'follow-link t + 'action + (lambda (_button) + (describe-package opkg))) + from)))) + other-pkgs ", ") + ".\n"))) + + (insert "\n") (if built-in ;; For built-in packages, insert the commentary. - (let ((fn (locate-file (concat package-name ".el") load-path + (let ((fn (locate-file (format "%s.el" name) load-path load-file-rep-suffixes)) (opoint (point))) (insert (or (lm-commentary fn) "")) @@ -1239,14 +1279,15 @@ (replace-match "")) (while (re-search-forward "^\\(;+ ?\\)" nil t) (replace-match "")))) - (let ((readme (expand-file-name (concat package-name "-readme.txt") + (let ((readme (expand-file-name (format "%s-readme.txt" name) package-user-dir)) readme-string) ;; For elpa packages, try downloading the commentary. If that ;; fails, try an existing readme file in `package-user-dir'. (cond ((condition-case nil - (package--with-work-buffer (package-archive-base desc) - (concat package-name "-readme.txt") + (package--with-work-buffer + (package-archive-base desc) + (format "%s-readme.txt" name) (setq buffer-file-name (expand-file-name readme package-user-dir)) (let ((version-control 'never)) @@ -1350,6 +1391,7 @@ ("Description" 0 nil)]) (setq tabulated-list-padding 2) (setq tabulated-list-sort-key (cons "Status" nil)) + (add-hook 'tabulated-list-revert-hook 'package-menu--refresh) (tabulated-list-init-header)) (defmacro package--push (pkg-desc status listname) @@ -1363,34 +1405,49 @@ (defvar package-list-unversioned nil "If non-nil include packages that don't have a version in `list-package'.") -(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." +(defun package-desc-status (pkg-desc) + (let* ((name (package-desc-name pkg-desc)) + (dir (package-desc-dir pkg-desc)) + (lle (assq name package-load-list)) + (held (cadr lle)) + (version (package-desc-version pkg-desc))) + (cond + ((eq dir 'builtin) "built-in") + ((and lle (null held)) "disabled") + ((stringp held) + (let ((hv (if (stringp held) (version-to-list held)))) + (cond + ((version-list-= version hv) "held") + ((version-list-< version hv) "obsolete") + (t "disabled")))) + ((package-built-in-p name version) "obsolete") + (dir ;One of the installed packages. + (cond + ((not (file-exists-p (package-desc-dir pkg-desc))) "deleted") + ((eq pkg-desc (cadr (assq name package-alist))) "installed") + (t "obsolete"))) + (t + (let* ((ins (cadr (assq name package-alist))) + (ins-v (if ins (package-desc-version ins)))) + (cond + ((or (null ins) (version-list-< ins-v version)) + (if (memq name package-menu--new-package-list) + "new" "available")) + ((version-list-< version ins-v) "obsolete") + ((version-list-= version ins-v) "installed"))))))) + +(defun package-menu--refresh (&optional packages) + "Re-populate the `tabulated-list-entries'. +PACKAGES should be nil or t, which means to display all known packages." ;; Construct list of (PKG-DESC . STATUS). + (unless packages (setq packages t)) (let (info-list name) ;; Installed packages: (dolist (elt package-alist) (setq name (car elt)) (when (or (eq packages t) (memq name packages)) - (let* ((lle (assq name package-load-list)) - (held (cadr lle)) - (hv (if (stringp held) (version-to-list held)))) - (dolist (pkg (cdr elt)) - (let ((version (package-desc-version pkg))) - (package--push pkg - (cond - ((and lle (null held)) "disabled") - (hv - (cond - ((version-list-= version hv) "held") - ((version-list-< version hv) "obsolete") - (t "disabled"))) - ((package-built-in-p name version) "obsolete") - ((eq pkg (cadr elt)) "installed") - (t "obsolete")) - info-list)))))) + (dolist (pkg (cdr elt)) + (package--push pkg (package-desc-status pkg) info-list)))) ;; Built-in packages: (dolist (elt package--builtins) @@ -1405,17 +1462,23 @@ (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 (cdr elt) - (cond - ((and hold (null (cadr hold))) "disabled") - ((memq name package-menu--new-package-list) "new") - (t "available")) - info-list)))) + (dolist (pkg (cdr elt)) + ;; Hide obsolete packages. + (unless (package-installed-p (package-desc-name pkg) + (package-desc-version pkg)) + (package--push pkg (package-desc-status pkg) info-list))))) ;; Print the result. - (setq tabulated-list-entries (mapcar 'package-menu--print-info info-list)) - (tabulated-list-print remember-pos))) + (setq tabulated-list-entries + (mapcar #'package-menu--print-info info-list)))) + +(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." + (package-menu--refresh packages) + (tabulated-list-print remember-pos)) (defun package-menu--print-info (pkg) "Return a package entry suitable for `tabulated-list-entries'. @@ -1461,8 +1524,8 @@ (let ((pkg-desc (if button (button-get button 'package-desc) (tabulated-list-get-id)))) (if pkg-desc - ;; FIXME: We could actually describe this particular pkg-desc. - (describe-package (package-desc-name pkg-desc))))) + (describe-package pkg-desc) + (error "No package here")))) ;; fixme numeric argument (defun package-menu-mark-delete (&optional _num) @@ -1614,10 +1677,6 @@ (package-delete elt) (error (message (cadr err))))) (error "Aborted"))) - ;; If we deleted anything, regenerate `package-alist'. This is done - ;; automatically if we installed a package. - (and delete-list (null install-list) - (package-initialize)) (if (or delete-list install-list) (package-menu--generate t t) (message "No operations specified.")))) === modified file 'lisp/progmodes/ebnf-abn.el' --- lisp/progmodes/ebnf-abn.el 2013-01-01 09:11:05 +0000 +++ lisp/progmodes/ebnf-abn.el 2013-06-25 16:13:49 +0000 @@ -5,7 +5,7 @@ ;; Author: Vinicius Jose Latorre ;; Maintainer: Vinicius Jose Latorre ;; Keywords: wp, ebnf, PostScript -;; Version: 1.2 +;; Old-Version: 1.2 ;; Package: ebnf2ps ;; This file is part of GNU Emacs. === modified file 'lisp/progmodes/ebnf-bnf.el' --- lisp/progmodes/ebnf-bnf.el 2013-01-01 09:11:05 +0000 +++ lisp/progmodes/ebnf-bnf.el 2013-06-25 16:13:49 +0000 @@ -5,7 +5,7 @@ ;; Author: Vinicius Jose Latorre ;; Maintainer: Vinicius Jose Latorre ;; Keywords: wp, ebnf, PostScript -;; Version: 1.10 +;; Old-Version: 1.10 ;; Package: ebnf2ps ;; This file is part of GNU Emacs. === modified file 'lisp/progmodes/ebnf-dtd.el' --- lisp/progmodes/ebnf-dtd.el 2013-01-01 09:11:05 +0000 +++ lisp/progmodes/ebnf-dtd.el 2013-06-25 16:13:49 +0000 @@ -5,7 +5,7 @@ ;; Author: Vinicius Jose Latorre ;; Maintainer: Vinicius Jose Latorre ;; Keywords: wp, ebnf, PostScript -;; Version: 1.1 +;; Old-Version: 1.1 ;; Package: ebnf2ps ;; This file is part of GNU Emacs. === modified file 'lisp/progmodes/ebnf-ebx.el' --- lisp/progmodes/ebnf-ebx.el 2013-01-01 09:11:05 +0000 +++ lisp/progmodes/ebnf-ebx.el 2013-06-25 16:13:49 +0000 @@ -5,7 +5,7 @@ ;; Author: Vinicius Jose Latorre ;; Maintainer: Vinicius Jose Latorre ;; Keywords: wp, ebnf, PostScript -;; Version: 1.2 +;; Old-Version: 1.2 ;; Package: ebnf2ps ;; This file is part of GNU Emacs. === modified file 'lisp/progmodes/ebnf-iso.el' --- lisp/progmodes/ebnf-iso.el 2013-01-01 09:11:05 +0000 +++ lisp/progmodes/ebnf-iso.el 2013-06-25 16:13:49 +0000 @@ -5,7 +5,7 @@ ;; Author: Vinicius Jose Latorre ;; Maintainer: Vinicius Jose Latorre ;; Keywords: wp, ebnf, PostScript -;; Version: 1.9 +;; Old-Version: 1.9 ;; Package: ebnf2ps ;; This file is part of GNU Emacs. === modified file 'lisp/progmodes/ebnf-otz.el' --- lisp/progmodes/ebnf-otz.el 2013-01-01 09:11:05 +0000 +++ lisp/progmodes/ebnf-otz.el 2013-06-25 16:13:49 +0000 @@ -5,7 +5,7 @@ ;; Author: Vinicius Jose Latorre ;; Maintainer: Vinicius Jose Latorre ;; Keywords: wp, ebnf, PostScript -;; Version: 1.0 +;; Old-Version: 1.0 ;; Package: ebnf2ps ;; This file is part of GNU Emacs. === modified file 'lisp/progmodes/ebnf-yac.el' --- lisp/progmodes/ebnf-yac.el 2013-01-01 09:11:05 +0000 +++ lisp/progmodes/ebnf-yac.el 2013-06-25 16:13:49 +0000 @@ -5,7 +5,7 @@ ;; Author: Vinicius Jose Latorre ;; Maintainer: Vinicius Jose Latorre ;; Keywords: wp, ebnf, PostScript -;; Version: 1.4 +;; Old-Version: 1.4 ;; Package: ebnf2ps ;; This file is part of GNU Emacs. === modified file 'lisp/progmodes/idlw-complete-structtag.el' --- lisp/progmodes/idlw-complete-structtag.el 2013-01-01 09:11:05 +0000 +++ lisp/progmodes/idlw-complete-structtag.el 2013-06-25 16:13:49 +0000 @@ -4,7 +4,7 @@ ;; Author: Carsten Dominik ;; Maintainer: J.D. Smith -;; Version: 1.2 +;; Old-Version: 1.2 ;; Keywords: languages ;; Package: idlwave === modified file 'lisp/progmodes/idlw-help.el' --- lisp/progmodes/idlw-help.el 2013-05-22 03:16:05 +0000 +++ lisp/progmodes/idlw-help.el 2013-06-25 16:13:49 +0000 @@ -5,7 +5,6 @@ ;; Authors: J.D. Smith ;; Carsten Dominik ;; Maintainer: J.D. Smith -;; Version: 6.1.22 ;; Package: idlwave ;; This file is part of GNU Emacs. === modified file 'lisp/progmodes/idlw-shell.el' --- lisp/progmodes/idlw-shell.el 2013-01-01 09:11:05 +0000 +++ lisp/progmodes/idlw-shell.el 2013-06-25 16:13:49 +0000 @@ -6,7 +6,6 @@ ;; Carsten Dominik ;; Chris Chase ;; Maintainer: J.D. Smith -;; Version: 6.1.22 ;; Keywords: processes ;; Package: idlwave === modified file 'lisp/progmodes/idlw-toolbar.el' --- lisp/progmodes/idlw-toolbar.el 2013-01-01 09:11:05 +0000 +++ lisp/progmodes/idlw-toolbar.el 2013-06-25 16:13:49 +0000 @@ -4,7 +4,6 @@ ;; Author: Carsten Dominik ;; Maintainer: J.D. Smith -;; Version: 6.1.22 ;; Keywords: processes ;; Package: idlwave ------------------------------------------------------------ revno: 113173 committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Tue 2013-06-25 17:49:02 +0200 message: Mention eww diff: === modified file 'etc/NEWS' --- etc/NEWS 2013-06-23 19:24:27 +0000 +++ etc/NEWS 2013-06-25 15:49:02 +0000 @@ -150,6 +150,9 @@ pager by default. See `eshell-visual-subcommands' and `eshell-visual-options'. +** If your Emacs is compiled with libxml2 support, you can use the new +built-in web browser `eww'. + ** `remember' can now store notes in separates files You can use the new function `remember-store-in-files' within the `remember-handler-functions' option. ------------------------------------------------------------ revno: 113172 fixes bug: http://debbugs.gnu.org/14527 author: Martin Rudalics committer: Juanma Barranquero branch nick: trunk timestamp: Tue 2013-06-25 17:44:42 +0200 message: lisp/window.el (window--state-get-1): Workaround for bug#14527. http://lists.gnu.org/archive/html/emacs-devel/2013-06/msg00941.html diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-25 15:39:13 +0000 +++ lisp/ChangeLog 2013-06-25 15:44:42 +0000 @@ -1,3 +1,8 @@ +2013-06-25 Martin Rudalics + + * window.el (window--state-get-1): Workaround for bug#14527. + http://lists.gnu.org/archive/html/emacs-devel/2013-06/msg00941.html + 2013-06-25 Lars Magne Ingebrigtsen * net/eww.el (eww-back-url): Implement the history by stashing all === modified file 'lisp/window.el' --- lisp/window.el 2013-04-13 14:37:20 +0000 +++ lisp/window.el 2013-06-25 15:44:42 +0000 @@ -4258,7 +4258,8 @@ (total-width . ,(window-total-size window t)) (normal-height . ,(window-normal-size window)) (normal-width . ,(window-normal-size window t)) - (combination-limit . ,(window-combination-limit window)) + ,@(unless (window-live-p window) + `(combination-limit . ,(window-combination-limit window))) ,@(let ((parameters (window-parameters window)) list) ;; Make copies of those window parameters whose ------------------------------------------------------------ revno: 113171 committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Tue 2013-06-25 17:39:13 +0200 message: (eww-forward-url) Allow going forward in the history, too. This may not be the most intuitive way to implement this. Perhaps following links should flush "forwards"... diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-25 14:59:13 +0000 +++ lisp/ChangeLog 2013-06-25 15:39:13 +0000 @@ -2,6 +2,7 @@ * net/eww.el (eww-back-url): Implement the history by stashing all the data into a list. + (eww-forward-url): Allow going forward in the history, too. 2013-06-25 Stefan Monnier === modified file 'lisp/net/eww.el' --- lisp/net/eww.el 2013-06-25 14:59:13 +0000 +++ lisp/net/eww.el 2013-06-25 15:39:13 +0000 @@ -86,6 +86,7 @@ (defvar eww-current-title "" "Title of current page.") (defvar eww-history nil) +(defvar eww-history-position 0) (defvar eww-next-url nil) (defvar eww-previous-url nil) @@ -318,6 +319,7 @@ (define-key map "\177" 'scroll-down-command) (define-key map " " 'scroll-up-command) (define-key map "l" 'eww-back-url) + (define-key map "f" 'eww-forward-url) (define-key map "n" 'eww-next-url) (define-key map "p" 'eww-previous-url) (define-key map "u" 'eww-up-url) @@ -336,13 +338,20 @@ ;;(setq buffer-read-only t) ) +(defun eww-save-history () + (let ((elem (list :url eww-current-url + :point (point) + :text (buffer-string)))) + (if (or (zerop eww-history-position) + (= eww-history-position (length eww-history))) + (push elem eww-history) + (setcdr (nthcdr eww-history-position eww-history) + (cons elem (nthcdr eww-history-position eww-history)))))) + (defun eww-browse-url (url &optional new-window) (when (and (equal major-mode 'eww-mode) eww-current-url) - (push (list :url eww-current-url - :point (point) - :text (buffer-string)) - eww-history)) + (eww-save-history)) (eww url)) (defun eww-quit () @@ -354,14 +363,29 @@ (defun eww-back-url () "Go to the previously displayed page." (interactive) - (when (zerop (length eww-history)) + (when (>= eww-history-position (length eww-history)) (error "No previous page")) - (let ((prev (pop eww-history)) - (inhibit-read-only t)) + (eww-restore-history + (if (not (zerop eww-history-position)) + (elt eww-history eww-history-position) + (eww-save-history) + (elt eww-history (1+ eww-history-position)))) + (setq eww-history-position (1+ eww-history-position))) + +(defun eww-forward-url () + "Go to the next displayed page." + (interactive) + (when (zerop eww-history-position) + (error "No next page")) + (eww-restore-history (elt eww-history (1- eww-history-position))) + (setq eww-history-position (1- eww-history-position))) + +(defun eww-restore-history (elem) + (let ((inhibit-read-only t)) (erase-buffer) - (insert (plist-get prev :text)) - (goto-char (plist-get prev :point)) - (setq eww-current-url (plist-get prev :url)))) + (insert (plist-get elem :text)) + (goto-char (plist-get elem :point)) + (setq eww-current-url (plist-get elem :url)))) (defun eww-next-url () "Go to the page marked `next'. ------------------------------------------------------------ revno: 113170 committer: Juanma Barranquero branch nick: trunk timestamp: Tue 2013-06-25 17:08:47 +0200 message: nt/configure.bat: Warn about deprecation status. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2013-06-10 14:58:52 +0000 +++ nt/ChangeLog 2013-06-25 15:08:47 +0000 @@ -1,3 +1,8 @@ +2013-06-25 Juanma Barranquero + + * configure.bat: Add warning to the help text about using the + MSYS/MinGW building procedure. + 2013-06-07 Eli Zaretskii * INSTALL.MSYS: mingw-get is not a GUI program (yet). === modified file 'nt/configure.bat' --- nt/configure.bat 2013-01-03 01:35:49 +0000 +++ nt/configure.bat 2013-06-25 15:08:47 +0000 @@ -174,6 +174,11 @@ echo. character depends on command extensions. This batch file attempts to echo. enable command extensions. If command extensions cannot be enabled, a echo. warning message will be displayed. +echo. +echo. IMPORTANT: This method of building Emacs for MS-Windows is deprecated, +echo. and could be removed in a future version of Emacs. The preferred way +echo to build Emacs for MS-Windows from now on is using the MSYS environment +echo. and MinGW development tools. Please see nt/INSTALL.MSYS for details. goto end rem ---------------------------------------------------------------------- ------------------------------------------------------------ revno: 113169 committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Tue 2013-06-25 16:59:13 +0200 message: (eww) Reimplement the history functionality * net/eww.el (eww-back-url): Implement the history by stashing all the data into a list. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-25 13:07:04 +0000 +++ lisp/ChangeLog 2013-06-25 14:59:13 +0000 @@ -1,3 +1,8 @@ +2013-06-25 Lars Magne Ingebrigtsen + + * net/eww.el (eww-back-url): Implement the history by stashing all + the data into a list. + 2013-06-25 Stefan Monnier * files-x.el (read-file-local-variable-value): Use read-from-minibuffer === modified file 'lisp/net/eww.el' --- lisp/net/eww.el 2013-06-24 17:42:22 +0000 +++ lisp/net/eww.el 2013-06-25 14:59:13 +0000 @@ -339,7 +339,9 @@ (defun eww-browse-url (url &optional new-window) (when (and (equal major-mode 'eww-mode) eww-current-url) - (push (list eww-current-url (point)) + (push (list :url eww-current-url + :point (point) + :text (buffer-string)) eww-history)) (eww url)) @@ -354,8 +356,12 @@ (interactive) (when (zerop (length eww-history)) (error "No previous page")) - (let ((prev (pop eww-history))) - (url-retrieve (car prev) 'eww-render (list (car prev) (cadr prev))))) + (let ((prev (pop eww-history)) + (inhibit-read-only t)) + (erase-buffer) + (insert (plist-get prev :text)) + (goto-char (plist-get prev :point)) + (setq eww-current-url (plist-get prev :url)))) (defun eww-next-url () "Go to the page marked `next'. ------------------------------------------------------------ revno: 113168 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14710 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2013-06-25 09:07:04 -0400 message: * lisp/files-x.el (read-file-local-variable-value): Use read-from-minibuffer for values and use read--expression for expressions. (read-file-local-variable): Avoid setq. (read-file-local-variable-mode): Use minor-mode-list. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-25 09:18:09 +0000 +++ lisp/ChangeLog 2013-06-25 13:07:04 +0000 @@ -1,3 +1,10 @@ +2013-06-25 Stefan Monnier + + * files-x.el (read-file-local-variable-value): Use read-from-minibuffer + for values and use read--expression for expressions (bug#14710). + (read-file-local-variable): Avoid setq. + (read-file-local-variable-mode): Use minor-mode-list. + 2013-06-25 Rüdiger Sonderfeld * lisp/textmodes/bibtex.el (bibtex-generate-url-list): Add support @@ -31,7 +38,7 @@ * net/shr.el (shr-browse-url): Use an external browser if given a prefix. - * net/eww.el (eww-external-browser): Moved to shr. + * net/eww.el (eww-external-browser): Move to shr. 2013-06-24 Ivan Kanis @@ -119,8 +126,8 @@ 2013-06-21 Dmitry Gutov - * progmodes/ruby-mode.el (ruby-font-lock-keywords): Highlight - keyword-like methods on Kernel and Module with + * progmodes/ruby-mode.el (ruby-font-lock-keywords): + Highlight keyword-like methods on Kernel and Module with font-lock-builtin-face. (auto-mode-alist): Consolidate different entries into one regexp and add more *file-s. @@ -606,8 +613,8 @@ 2013-06-19 Michael Albinus - * net/secrets.el (secrets-struct-secret-content-type): Replace - check of introspection data by a test call of "CreateItem". + * net/secrets.el (secrets-struct-secret-content-type): + Replace check of introspection data by a test call of "CreateItem". Some servers do not offer introspection. 2013-06-19 Stefan Monnier === modified file 'lisp/files-x.el' --- lisp/files-x.el 2013-06-18 20:38:43 +0000 +++ lisp/files-x.el 2013-06-25 13:07:04 +0000 @@ -38,11 +38,10 @@ Intended to be used in the `interactive' spec of `add-file-local-variable', `delete-file-local-variable', `add-dir-local-variable', `delete-dir-local-variable'." - (let (default variable) - (setq default (variable-at-point)) - (setq default (and (symbolp default) (boundp default) + (let* ((default (variable-at-point)) + (default (and (symbolp default) (boundp default) (symbol-name default))) - (setq variable + (variable (completing-read (if default (format "%s (default %s): " prompt default) @@ -52,48 +51,46 @@ (or (custom-variable-p sym) (get sym 'safe-local-variable) (memq sym '(mode eval coding unibyte)))) - nil nil nil default nil)) + nil nil nil default nil))) (and (stringp variable) (intern variable)))) (defun read-file-local-variable-value (variable) "Read value of file-local VARIABLE using completion. Intended to be used in the `interactive' spec of `add-file-local-variable' and `add-dir-local-variable'." - (let (default value) - (cond - ((eq variable 'mode) - (setq default (and (symbolp major-mode) (symbol-name major-mode))) - (setq value - (completing-read - (if default - (format "Add %s with value (default %s): " variable default) - (format "Add %s with value: " variable)) - obarray - (lambda (sym) - (string-match-p "-mode\\'" (symbol-name sym))) - nil nil nil default nil)) + (cond + ((eq variable 'mode) + (let* ((default (and (symbolp major-mode) (symbol-name major-mode))) + (value + (completing-read + (if default + (format "Add %s with value (default %s): " variable default) + (format "Add %s with value: " variable)) + obarray + (lambda (sym) + (string-match-p "-mode\\'" (symbol-name sym))) + nil nil nil default nil))) (and (stringp value) - (intern (replace-regexp-in-string "-mode\\'" "" value)))) - ((eq variable 'eval) - (let ((minibuffer-completing-symbol t)) - (read-from-minibuffer (format "Add %s with expression: " variable) - nil read-expression-map t - 'read-expression-history))) - ((eq variable 'coding) - (setq default (and (symbolp buffer-file-coding-system) - (symbol-name buffer-file-coding-system))) + (intern (replace-regexp-in-string "-mode\\'" "" value))))) + ((eq variable 'eval) + (read--expression (format "Add %s with expression: " variable))) + ((eq variable 'coding) + (let ((default (and (symbolp buffer-file-coding-system) + (symbol-name buffer-file-coding-system)))) (read-coding-system (if default - (format "Add %s with value (default %s): " variable default) - (format "Add %s with value: " variable)) - default)) - (t - (read (read-string (format "Add %s with value: " variable) - nil 'set-variable-value-history - (format "%S" - (cond ((eq variable 'unibyte) t) - ((boundp variable) - (symbol-value variable)))))))))) + (format "Add %s with value (default %s): " variable default) + (format "Add %s with value: " variable)) + default))) + (t + (let ((default (format "%S" + (cond ((eq variable 'unibyte) t) + ((boundp variable) + (symbol-value variable))))) + (minibuffer-completing-symbol t)) + (read-from-minibuffer (format "Add %s with value: " variable) + nil read-expression-map t + 'set-variable-value-history))))) (defun read-file-local-variable-mode () "Read per-directory file-local variable's mode using completion. @@ -108,7 +105,9 @@ obarray (lambda (sym) (and (string-match-p "-mode\\'" (symbol-name sym)) - (not (string-match-p "-minor-mode\\'" (symbol-name sym))))) + (not (or (memq sym minor-mode-list) + (string-match-p "-minor-mode\\'" + (symbol-name sym)))))) nil nil nil default nil))) (cond ((equal mode "nil") nil) ------------------------------------------------------------ revno: 113167 committer: Roland Winkler branch nick: trunk timestamp: Tue 2013-06-25 21:18:09 +1200 message: bibtex-generate-url-list): Add support for DOI URLs diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-25 09:15:44 +0000 +++ lisp/ChangeLog 2013-06-25 09:18:09 +0000 @@ -1,5 +1,10 @@ 2013-06-25 Rüdiger Sonderfeld + * lisp/textmodes/bibtex.el (bibtex-generate-url-list): Add support + for DOI URLs. + +2013-06-25 Rüdiger Sonderfeld + * lisp/textmodes/bibtex.el (bibtex-mode, bibtex-set-dialect): Update imenu-support when dialect changes. === modified file 'lisp/textmodes/bibtex.el' --- lisp/textmodes/bibtex.el 2013-06-25 09:15:44 +0000 +++ lisp/textmodes/bibtex.el 2013-06-25 09:18:09 +0000 @@ -1224,7 +1224,10 @@ (function :tag "Personalized function"))) (defcustom bibtex-generate-url-list - '((("url" . ".*:.*"))) + '((("url" . ".*:.*")) + (("doi" . "10\\.[0-9]+/.+") + "http://dx.doi.org/%s" + ("doi" ".*" 0))) "List of schemes for generating the URL of a BibTeX entry. These schemes are used by `bibtex-url'. @@ -1261,6 +1264,7 @@ (\"volume\" \".*\" 0) (\"pages\" \"\\`[A-Z]?[0-9]+\" 0)))" :group 'bibtex + :version "24.4" :type '(repeat (cons :tag "Scheme" (cons :tag "Matcher" :extra-offset 4 ------------------------------------------------------------ revno: 113166 committer: Roland Winkler branch nick: trunk timestamp: Tue 2013-06-25 21:15:44 +1200 message: bibtex-mode: Update imenu-support when dialect changes diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-25 01:04:06 +0000 +++ lisp/ChangeLog 2013-06-25 09:15:44 +0000 @@ -1,3 +1,8 @@ +2013-06-25 Rüdiger Sonderfeld + + * lisp/textmodes/bibtex.el (bibtex-mode, bibtex-set-dialect): + Update imenu-support when dialect changes. + 2013-06-25 Leo Liu * ido.el (ido-read-internal): Allow forward slash on windows. === modified file 'lisp/textmodes/bibtex.el' --- lisp/textmodes/bibtex.el 2013-04-13 20:45:03 +0000 +++ lisp/textmodes/bibtex.el 2013-06-25 09:15:44 +0000 @@ -3400,9 +3400,6 @@ (set (make-local-variable 'syntax-propertize-function) (syntax-propertize-via-font-lock bibtex-font-lock-syntactic-keywords)) - (setq imenu-generic-expression - (list (list nil bibtex-entry-head bibtex-key-in-head)) - imenu-case-fold-search t) ;; Allow `bibtex-dialect' as a file-local variable. (add-hook 'hack-local-variables-hook 'bibtex-set-dialect nil t)) @@ -3479,7 +3476,10 @@ (concat "^[ \t]*@[ \t]*\\(?:" (regexp-opt (append '("String" "Preamble") - (mapcar 'car bibtex-entry-alist))) "\\)")))) + (mapcar 'car bibtex-entry-alist))) "\\)")) + (setq imenu-generic-expression + (list (list nil bibtex-entry-head bibtex-key-in-head)) + imenu-case-fold-search t))) ;; Entry commands and menus for BibTeX dialects ;; We do not use `easy-menu-define' here because this gets confused ------------------------------------------------------------ revno: 113165 committer: Glenn Morris branch nick: trunk timestamp: Mon 2013-06-24 19:31:09 -0700 message: Shameful typo diff: === modified file 'admin/notes/www' --- admin/notes/www 2013-06-25 02:15:00 +0000 +++ admin/notes/www 2013-06-25 02:31:09 +0000 @@ -42,7 +42,7 @@ the mod_rewrite rule does not use the [R] flag.) Sometimes this is what you want, sometimes not. -ii) it doesn't work write if the new page is in a different directory +ii) it doesn't work right if the new page is in a different directory to the old page: relative links from the visited page will break. ** Use a .htaccess file