Now on revision 113197. ------------------------------------------------------------ revno: 113197 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-06-26 22:46:51 -0700 message: * python-tests.el (python-tests-with-temp-file): Clean up after ourself diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2013-06-27 02:16:53 +0000 +++ test/ChangeLog 2013-06-27 05:46:51 +0000 @@ -1,5 +1,8 @@ 2013-06-27 Glenn Morris + * automated/python-tests.el (python-tests-with-temp-file): + Clean up after ourself. + * automated/undo-tests.el (undo-test3): Remove test that seems to do nothing that the previous one doesn't, except leave a tempfile. === modified file 'test/automated/python-tests.el' --- test/automated/python-tests.el 2013-04-19 02:31:09 +0000 +++ test/automated/python-tests.el 2013-06-27 05:46:51 +0000 @@ -39,7 +39,8 @@ BODY is code to be executed within the temp buffer. Point is always located at the beginning of buffer." (declare (indent 1) (debug t)) - `(let* ((temp-file (concat (make-temp-file "python-tests") ".py")) + ;; temp-file never actually used for anything? + `(let* ((temp-file (make-temp-file "python-tests" nil ".py")) (buffer (find-file-noselect temp-file))) (unwind-protect (with-current-buffer buffer @@ -47,7 +48,8 @@ (insert ,contents) (goto-char (point-min)) ,@body) - (and buffer (kill-buffer buffer))))) + (and buffer (kill-buffer buffer)) + (delete-file temp-file)))) (defun python-tests-look-at (string &optional num restore-point) "Move point at beginning of STRING in the current buffer. ------------------------------------------------------------ revno: 113196 committer: Leo Liu branch nick: trunk timestamp: Thu 2013-06-27 12:27:53 +0800 message: * net/eww.el (eww-read-bookmarks): Check file size. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-26 22:31:19 +0000 +++ lisp/ChangeLog 2013-06-27 04:27:53 +0000 @@ -1,3 +1,7 @@ +2013-06-27 Leo Liu + + * net/eww.el (eww-read-bookmarks): Check file size. + 2013-06-26 Stefan Monnier * emacs-lisp/nadvice.el (advice--defalias-fset): Move advice back to === modified file 'lisp/net/eww.el' --- lisp/net/eww.el 2013-06-26 17:14:46 +0000 +++ lisp/net/eww.el 2013-06-27 04:27:53 +0000 @@ -965,10 +965,12 @@ (pp eww-bookmarks (current-buffer)))) (defun eww-read-bookmarks () - (with-temp-buffer - (insert-file-contents - (expand-file-name "eww-bookmarks" user-emacs-directory)) - (setq eww-bookmarks (read (current-buffer))))) + (let ((file (expand-file-name "eww-bookmarks" user-emacs-directory))) + (setq eww-bookmarks + (unless (zerop (or (nth 7 (file-attributes file)) 0)) + (with-temp-buffer + (insert-file-contents file) + (read (current-buffer))))))) (defun eww-list-bookmarks () "Display the bookmarks." ------------------------------------------------------------ revno: 113195 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-06-26 19:16:53 -0700 message: Fix ChangeLog typo diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2013-06-27 02:00:54 +0000 +++ test/ChangeLog 2013-06-27 02:16:53 +0000 @@ -1,7 +1,7 @@ 2013-06-27 Glenn Morris * automated/undo-tests.el (undo-test3): Remove test that seems to - nothing that the previous one doesn't, except leave a tempfile. + do nothing that the previous one doesn't, except leave a tempfile. 2013-06-26 Glenn Morris ------------------------------------------------------------ revno: 113194 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-06-26 19:00:54 -0700 message: * automated/undo-tests.el (undo-test3): Remove test that seems to nothing that the previous one doesn't, except leave a tempfile. Fix copyright header. diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2013-06-26 01:52:09 +0000 +++ test/ChangeLog 2013-06-27 02:00:54 +0000 @@ -1,3 +1,8 @@ +2013-06-27 Glenn Morris + + * automated/undo-tests.el (undo-test3): Remove test that seems to + nothing that the previous one doesn't, except leave a tempfile. + 2013-06-26 Glenn Morris * automated/info-xref.el: New file. === modified file 'test/automated/undo-tests.el' --- test/automated/undo-tests.el 2013-01-09 21:29:27 +0000 +++ test/automated/undo-tests.el 2013-06-27 02:00:54 +0000 @@ -1,6 +1,6 @@ ;;; undo-tests.el --- Tests of primitive-undo -;; Copyright (C) 2012 Aaron S. Hawley +;; Copyright (C) 2012-2013 Free Software Foundation, Inc. ;; Author: Aaron S. Hawley @@ -140,26 +140,6 @@ (undo) (buffer-string)))))) -(ert-deftest undo-test3 () - "Test modtime with \\[undo] command." - (let ((tmpfile (make-temp-file "undo-test3"))) - (with-temp-file tmpfile - (let ((buffer-file-name tmpfile)) - (buffer-enable-undo) - (set (make-local-variable 'make-backup-files) nil) - (undo-boundary) - (insert ?\s) - (undo-boundary) - (basic-save-buffer) - (insert ?\t) - (undo) - (should - (string-equal (buffer-string) - (progn - (undo) - (buffer-string))))) - (delete-file tmpfile)))) - (ert-deftest undo-test4 () "Test \\[undo] of \\[flush-lines]." (with-temp-buffer ------------------------------------------------------------ revno: 113193 committer: Juanma Barranquero branch nick: trunk timestamp: Thu 2013-06-27 03:40:46 +0200 message: Do not create locallisppath directories. * Makefile.in (install-arch-indep): Do not create directories passed with --enable-locallisppath. * etc/NEWS: Mention policy change with respect to locallisppath dirs. diff: === modified file 'ChangeLog' --- ChangeLog 2013-06-24 06:58:52 +0000 +++ ChangeLog 2013-06-27 01:40:46 +0000 @@ -1,3 +1,8 @@ +2013-06-27 Juanma Barranquero + + * Makefile.in (install-arch-indep): Do not create directories passed + with --enable-locallisppath. + 2013-06-24 Glenn Morris * configure.ac: Include X11/X.h when testing for Xft.h. (Bug#14684) === modified file 'Makefile.in' --- Makefile.in 2013-06-07 08:08:29 +0000 +++ Makefile.in 2013-06-27 01:40:46 +0000 @@ -548,13 +548,9 @@ ## Note that the Makefiles in the etc directory are potentially useful ## in an installed Emacs, so should not be excluded. -## I'm not sure creating locallisppath here serves any useful purpose. -## If it has the default value, then the later write_subdir commands -## will ensure all these components exist. -## This will only do something if locallisppath has a non-standard value. -## Is it really Emacs's job to create those directories? -## Should we also be ensuring they contain subdirs.el files? -## It would be easy to do, just use write_subdir. +## We used to create locallisppath, but if it points to non-standard +## locations, is not really Emacs's job to create these directories, +## so it is no longer done. ## Note that we use tar instead of plain old cp -R/-r because the latter ## is apparently not portable (even in 2012!). @@ -564,12 +560,6 @@ ## See also these comments from 2004 about cp -r working fine: ## http://lists.gnu.org/archive/html/autoconf-patches/2004-11/msg00005.html install-arch-indep: lisp leim install-info install-man ${INSTALL_ARCH_INDEP_EXTRA} - umask 022 ; \ - locallisppath='${locallisppath}'; \ - IFS=:; \ - for d in $$locallisppath; do \ - ${MKDIR_P} "$(DESTDIR)$$d"; \ - done -set ${COPYDESTS} ; \ unset CDPATH; \ $(set_installuser); \ === modified file 'etc/ChangeLog' --- etc/ChangeLog 2013-06-19 20:10:57 +0000 +++ etc/ChangeLog 2013-06-27 01:40:46 +0000 @@ -1,3 +1,7 @@ +2013-06-27 Juanma Barranquero + + * NEWS: Mention policy change with respect to locallisppath dirs. + 2013-06-18 Juanma Barranquero * NEWS: Document new Prettify Symbols mode. === modified file 'etc/NEWS' --- etc/NEWS 2013-06-26 12:54:33 +0000 +++ etc/NEWS 2013-06-27 01:40:46 +0000 @@ -57,6 +57,9 @@ directories and will find the files in there automatically; there's no need to set any variables due to this change.) +** Directories passed to configure option `--enable-locallisppath' are +no longer created during installation. + * Startup Changes in Emacs 24.4 ------------------------------------------------------------ revno: 113192 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13820 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2013-06-26 18:31:19 -0400 message: * lisp/emacs-lisp/nadvice.el (advice--defalias-fset): Move advice back to advice--pending if newdef is nil or an autoload. (advice-mapc): New function. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-26 17:14:46 +0000 +++ lisp/ChangeLog 2013-06-26 22:31:19 +0000 @@ -1,3 +1,9 @@ +2013-06-26 Stefan Monnier + + * emacs-lisp/nadvice.el (advice--defalias-fset): Move advice back to + advice--pending if newdef is nil or an autoload (bug#13820). + (advice-mapc): New function. + 2013-06-26 Lars Magne Ingebrigtsen * net/eww.el (eww-mode): Undo isn't necessary in eww buffers, === modified file 'lisp/emacs-lisp/nadvice.el' --- lisp/emacs-lisp/nadvice.el 2013-05-06 15:27:11 +0000 +++ lisp/emacs-lisp/nadvice.el 2013-06-26 22:31:19 +0000 @@ -313,8 +313,7 @@ (when (get symbol 'advice--saved-rewrite) (put symbol 'advice--saved-rewrite nil)) (setq newdef (advice--normalize symbol newdef)) - (let* ((olddef (advice--strip-macro - (if (fboundp symbol) (symbol-function symbol)))) + (let* ((olddef (advice--strip-macro (symbol-function symbol))) (oldadv (cond ((null (get symbol 'advice--pending)) @@ -324,15 +323,18 @@ symbol) nil))) ((or (not olddef) (autoloadp olddef)) - (prog1 (get symbol 'advice--pending) - (put symbol 'advice--pending nil))) + (get symbol 'advice--pending)) (t (message "Dropping left-over advice--pending for %s" symbol) - (put symbol 'advice--pending nil) olddef)))) - (let* ((snewdef (advice--strip-macro newdef)) - (snewadv (advice--subst-main oldadv snewdef))) - (funcall (or fsetfun #'fset) symbol - (if (eq snewdef newdef) snewadv (cons 'macro snewadv)))))) + (if (and newdef (not (autoloadp newdef))) + (let* ((snewdef (advice--strip-macro newdef)) + (snewadv (advice--subst-main oldadv snewdef))) + (put symbol 'advice--pending nil) + (funcall (or fsetfun #'fset) symbol + (if (eq snewdef newdef) snewadv (cons 'macro snewadv)))) + (unless (eq oldadv (get symbol 'advice--pending)) + (put symbol 'advice--pending (advice--subst-main oldadv nil))) + (funcall (or fsetfun #'fset) symbol newdef)))) ;;;###autoload @@ -345,7 +347,7 @@ ;; - change all defadvice in lisp/**/*.el. ;; - rewrite advice.el on top of this. ;; - obsolete advice.el. - (let* ((f (and (fboundp symbol) (symbol-function symbol))) + (let* ((f (symbol-function symbol)) (nf (advice--normalize symbol f))) (unless (eq f nf) ;; Most importantly, if nf == nil! (fset symbol nf)) @@ -370,37 +372,34 @@ ;;;###autoload (defun advice-remove (symbol function) "Like `remove-function' but for the function named SYMBOL. -Contrary to `remove-function', this will work also when SYMBOL is a macro -and it will not signal an error if SYMBOL is not `fboundp'. +Contrary to `remove-function', this also works when SYMBOL is a macro +or an autoload and it preserves `fboundp'. Instead of the actual function to remove, FUNCTION can also be the `name' of the piece of advice." - (when (fboundp symbol) - (let ((f (symbol-function symbol))) - ;; Can't use the `if' place here, because the body is too large, - ;; resulting in use of code that only works with lexical-scoping. - (remove-function (if (eq (car-safe f) 'macro) - (cdr f) - (symbol-function symbol)) - function) - (unless (advice--p - (if (eq (car-safe f) 'macro) (cdr f) (symbol-function symbol))) - ;; Not advised any more. - (remove-function (get symbol 'defalias-fset-function) - #'advice--defalias-fset) - (if (eq (symbol-function symbol) - (cdr (get symbol 'advice--saved-rewrite))) - (fset symbol (car (get symbol 'advice--saved-rewrite)))))) - nil)) + (let ((f (symbol-function symbol))) + ;; Can't use the `if' place here, because the body is too large, + ;; resulting in use of code that only works with lexical-scoping. + (remove-function (if (eq (car-safe f) 'macro) + (cdr f) + (symbol-function symbol)) + function) + (unless (advice--p + (if (eq (car-safe f) 'macro) (cdr f) (symbol-function symbol))) + ;; Not advised any more. + (remove-function (get symbol 'defalias-fset-function) + #'advice--defalias-fset) + (if (eq (symbol-function symbol) + (cdr (get symbol 'advice--saved-rewrite))) + (fset symbol (car (get symbol 'advice--saved-rewrite)))))) + nil) -;; (defun advice-mapc (fun symbol) -;; "Apply FUN to every function added as advice to SYMBOL. -;; FUN is called with a two arguments: the function that was added, and the -;; properties alist that was specified when it was added." -;; (let ((def (or (get symbol 'advice--pending) -;; (if (fboundp symbol) (symbol-function symbol))))) -;; (while (advice--p def) -;; (funcall fun (advice--car def) (advice--props def)) -;; (setq def (advice--cdr def))))) +(defun advice-mapc (fun def) + "Apply FUN to every advice function in DEF. +FUN is called with a two arguments: the function that was added, and the +properties alist that was specified when it was added." + (while (advice--p def) + (funcall fun (advice--car def) (advice--props def)) + (setq def (advice--cdr def)))) ;;;###autoload (defun advice-member-p (advice function-name) @@ -410,8 +409,7 @@ (advice--member-p advice advice (or (get function-name 'advice--pending) (advice--strip-macro - (if (fboundp function-name) - (symbol-function function-name)))))) + (symbol-function function-name))))) ;; When code is advised, called-interactively-p needs to be taught to skip ;; the advising frames. ------------------------------------------------------------ revno: 113191 committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Wed 2013-06-26 19:14:46 +0200 message: (eww-bookmark-browse): Don't bug out if it's the only window. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-26 16:59:21 +0000 +++ lisp/ChangeLog 2013-06-26 17:14:46 +0000 @@ -6,6 +6,7 @@ (eww-add-bookmark): New command. (eww-bookmark-mode): New mode and commands. (eww-add-bookmark): Remove newlines from the title. + (eww-bookmark-browse): Don't bug out if it's the only window. 2013-06-26 Glenn Morris === modified file 'lisp/net/eww.el' --- lisp/net/eww.el 2013-06-26 16:59:21 +0000 +++ lisp/net/eww.el 2013-06-26 17:14:46 +0000 @@ -1043,7 +1043,10 @@ (let ((bookmark (get-text-property (line-beginning-position) 'eww-bookmark))) (unless bookmark (error "No bookmark on the current line")) - (delete-window) + ;; We wish to leave this window, but if it's the only window here, + ;; just let it remain. + (ignore-errors + (delete-window)) (eww (plist-get bookmark :url)))) (defun eww-next-bookmark () ------------------------------------------------------------ revno: 113190 committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Wed 2013-06-26 18:59:21 +0200 message: (eww-add-bookmark): Remove newlines from the title. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-26 16:54:48 +0000 +++ lisp/ChangeLog 2013-06-26 16:59:21 +0000 @@ -5,6 +5,7 @@ (eww-mode-map): Add a menu bar. (eww-add-bookmark): New command. (eww-bookmark-mode): New mode and commands. + (eww-add-bookmark): Remove newlines from the title. 2013-06-26 Glenn Morris === modified file 'lisp/net/eww.el' --- lisp/net/eww.el 2013-06-26 16:54:48 +0000 +++ lisp/net/eww.el 2013-06-26 16:59:21 +0000 @@ -950,10 +950,12 @@ (when (equal eww-current-url (plist-get bookmark :url)) (error "Already bookmarked"))) - (push (list :url eww-current-url - :title eww-current-title - :time (current-time-string)) - eww-bookmarks) + (let ((title (replace-regexp-in-string "[\n\t\r]" " " eww-current-title))) + (setq title (replace-regexp-in-string "\\` +\\| +\\'" "" title)) + (push (list :url eww-current-url + :title title + :time (current-time-string)) + eww-bookmarks)) (eww-write-bookmarks) (message "Bookmarked %s (%s)" eww-current-url eww-current-title)) ------------------------------------------------------------ revno: 113189 committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Wed 2013-06-26 18:54:48 +0200 message: Add bookmark support to eww * net/eww.el (eww-mode): Undo isn't necessary in eww buffers, probably. (eww-mode-map): Add a menu bar. (eww-add-bookmark): New command. (eww-bookmark-mode): New mode and commands. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-26 13:07:24 +0000 +++ lisp/ChangeLog 2013-06-26 16:54:48 +0000 @@ -3,6 +3,8 @@ * net/eww.el (eww-mode): Undo isn't necessary in eww buffers, probably. (eww-mode-map): Add a menu bar. + (eww-add-bookmark): New command. + (eww-bookmark-mode): New mode and commands. 2013-06-26 Glenn Morris === modified file 'lisp/net/eww.el' --- lisp/net/eww.el 2013-06-26 13:07:24 +0000 +++ lisp/net/eww.el 2013-06-26 16:54:48 +0000 @@ -337,6 +337,11 @@ (define-key map "w" 'eww-copy-page-url) (define-key map "C" 'url-cookie-list) + (define-key map "b" 'eww-add-bookmark) + (define-key map "B" 'eww-list-bookmarks) + (define-key map [(meta n)] 'eww-next-bookmark) + (define-key map [(meta p)] 'eww-previous-bookmark) + (easy-menu-define nil map "" '("eww" ["Quit" eww-quit t] @@ -348,6 +353,8 @@ ["Browse with external browser" eww-browse-with-external-browser t] ["Download" eww-download t] ["Copy page URL" eww-copy-page-url t] + ["Add bookmark" eww-add-bookmark t] + ["List bookmarks" eww-copy-page-url t] ["List cookies" url-cookie-list t])) map)) @@ -366,6 +373,7 @@ (defun eww-save-history () (push (list :url eww-current-url + :title eww-current-title :point (point) :text (buffer-string)) eww-history)) @@ -404,7 +412,8 @@ (erase-buffer) (insert (plist-get elem :text)) (goto-char (plist-get elem :point)) - (setq eww-current-url (plist-get elem :url)))) + (setq eww-current-url (plist-get elem :url) + eww-current-title (plist-get elem :title)))) (defun eww-next-url () "Go to the page marked `next'. @@ -929,6 +938,169 @@ (setq count (1+ count))) (expand-file-name file directory))) +;;; Bookmarks code + +(defvar eww-bookmarks nil) + +(defun eww-add-bookmark () + "Add the current page to the bookmarks." + (interactive) + (eww-read-bookmarks) + (dolist (bookmark eww-bookmarks) + (when (equal eww-current-url + (plist-get bookmark :url)) + (error "Already bookmarked"))) + (push (list :url eww-current-url + :title eww-current-title + :time (current-time-string)) + eww-bookmarks) + (eww-write-bookmarks) + (message "Bookmarked %s (%s)" eww-current-url eww-current-title)) + +(defun eww-write-bookmarks () + (with-temp-file (expand-file-name "eww-bookmarks" user-emacs-directory) + (insert ";; Auto-generated file; don't edit\n") + (pp eww-bookmarks (current-buffer)))) + +(defun eww-read-bookmarks () + (with-temp-buffer + (insert-file-contents + (expand-file-name "eww-bookmarks" user-emacs-directory)) + (setq eww-bookmarks (read (current-buffer))))) + +(defun eww-list-bookmarks () + "Display the bookmarks." + (interactive) + (eww-bookmark-prepare) + (pop-to-buffer "*eww bookmarks*")) + +(defun eww-bookmark-prepare () + (eww-read-bookmarks) + (when (null eww-bookmarks) + (error "No bookmarks are defined")) + (set-buffer (get-buffer-create "*eww bookmarks*")) + (eww-bookmark-mode) + (let ((format "%-40s %s") + (inhibit-read-only t) + start url) + (erase-buffer) + (setq header-line-format (concat " " (format format "URL" "Title"))) + (dolist (bookmark eww-bookmarks) + (setq start (point)) + (setq url (plist-get bookmark :url)) + (when (> (length url) 40) + (setq url (substring url 0 40))) + (insert (format format url + (plist-get bookmark :title)) + "\n") + (put-text-property start (1+ start) 'eww-bookmark bookmark)) + (goto-char (point-min)))) + +(defvar eww-bookmark-kill-ring nil) + +(defun eww-bookmark-kill () + "Kill the current bookmark." + (interactive) + (let* ((start (line-beginning-position)) + (bookmark (get-text-property start 'eww-bookmark)) + (inhibit-read-only t)) + (unless bookmark + (error "No bookmark on the current line")) + (forward-line 1) + (push (buffer-substring start (point)) eww-bookmark-kill-ring) + (delete-region start (point)) + (setq eww-bookmarks (delq bookmark eww-bookmarks)) + (eww-write-bookmarks))) + +(defun eww-bookmark-yank () + "Yank a previously killed bookmark to the current line." + (interactive) + (unless eww-bookmark-kill-ring + (error "No previously killed bookmark")) + (beginning-of-line) + (let ((inhibit-read-only t) + (start (point)) + bookmark) + (insert (pop eww-bookmark-kill-ring)) + (setq bookmark (get-text-property start 'eww-bookmark)) + (if (= start (point-min)) + (push bookmark eww-bookmarks) + (let ((line (count-lines start (point)))) + (setcdr (nthcdr (1- line) eww-bookmarks) + (cons bookmark (nthcdr line eww-bookmarks))))) + (eww-write-bookmarks))) + +(defun eww-bookmark-quit () + "Kill the current buffer." + (interactive) + (kill-buffer (current-buffer))) + +(defun eww-bookmark-browse () + "Browse the bookmark under point in eww." + (interactive) + (let ((bookmark (get-text-property (line-beginning-position) 'eww-bookmark))) + (unless bookmark + (error "No bookmark on the current line")) + (delete-window) + (eww (plist-get bookmark :url)))) + +(defun eww-next-bookmark () + "Go to the next bookmark in the list." + (interactive) + (let ((first nil) + bookmark) + (unless (get-buffer "*eww bookmarks*") + (setq first t) + (eww-bookmark-prepare)) + (with-current-buffer (get-buffer "*eww bookmarks*") + (when (and (not first) + (not (eobp))) + (forward-line 1)) + (setq bookmark (get-text-property (line-beginning-position) + 'eww-bookmark)) + (unless bookmark + (error "No next bookmark"))) + (eww-browse-url (plist-get bookmark :url)))) + +(defun eww-previous-bookmark () + "Go to the previous bookmark in the list." + (interactive) + (let ((first nil) + bookmark) + (unless (get-buffer "*eww bookmarks*") + (setq first t) + (eww-bookmark-prepare)) + (with-current-buffer (get-buffer "*eww bookmarks*") + (if first + (goto-char (point-max)) + (beginning-of-line)) + ;; On the final line. + (when (eolp) + (forward-line -1)) + (if (bobp) + (error "No previous bookmark") + (forward-line -1)) + (setq bookmark (get-text-property (line-beginning-position) + 'eww-bookmark))) + (eww-browse-url (plist-get bookmark :url)))) + +(defvar eww-bookmark-mode-map + (let ((map (make-sparse-keymap))) + (suppress-keymap map) + (define-key map "q" 'eww-bookmark-quit) + (define-key map [(control k)] 'eww-bookmark-kill) + (define-key map [(control y)] 'eww-bookmark-yank) + (define-key map "\r" 'eww-bookmark-browse) + map)) + +(define-derived-mode eww-bookmark-mode nil "eww bookmarks" + "Mode for listing bookmarks. + +\\{eww-bookmark-mode-map}" + (buffer-disable-undo) + (setq buffer-read-only t + truncate-lines t)) + (provide 'eww) ;;; eww.el ends here === modified file 'lisp/url/ChangeLog' --- lisp/url/ChangeLog 2013-06-26 12:54:33 +0000 +++ lisp/url/ChangeLog 2013-06-26 16:54:48 +0000 @@ -2,6 +2,7 @@ * url-cookie.el: Implement a command and mode for displaying and editing cookies. + (url-cookie-mode): Fix mode name. 2013-06-21 Glenn Morris === modified file 'lisp/url/url-cookie.el' --- lisp/url/url-cookie.el 2013-06-26 12:54:33 +0000 +++ lisp/url/url-cookie.el 2013-06-26 16:54:48 +0000 @@ -427,9 +427,10 @@ (suppress-keymap map) (define-key map "q" 'url-cookie-quit) (define-key map [delete] 'url-cookie-delete) + (define-key map [(control k)] 'url-cookie-delete) map)) -(define-derived-mode url-cookie-mode nil "eww" +(define-derived-mode url-cookie-mode nil "URL Cookie" "Mode for listing cookies. \\{url-cookie-mode-map}" ------------------------------------------------------------ revno: 113188 committer: Christopher Schmidt branch nick: emacs-trunk timestamp: Wed 2013-06-26 17:22:21 +0200 message: * tips.texi (Coding Conventions): Improve wording. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2013-06-24 06:58:52 +0000 +++ doc/lispref/ChangeLog 2013-06-26 15:22:21 +0000 @@ -1,3 +1,7 @@ +2013-06-26 Christopher Schmidt + + * tips.texi (Coding Conventions): Improve wording. + 2013-06-24 Glenn Morris * loading.texi (Autoload): Fix typo. === modified file 'doc/lispref/tips.texi' --- doc/lispref/tips.texi 2013-04-15 17:01:00 +0000 +++ doc/lispref/tips.texi 2013-06-26 15:22:21 +0000 @@ -54,12 +54,12 @@ Lisp programs. The names of all global symbols in your program, that is the names of variables, constants, and functions, should begin with that chosen prefix. Separate the prefix from the rest of the name -with a hyphen, @samp{-}. Use two hyphens if the symbol is not meant -to be used by other packages. This practice helps avoid name -conflicts, since all global variables in Emacs Lisp share the same -name space, and all functions share another name space@footnote{The -benefits of a Common Lisp-style package system are considered not to -outweigh the costs.}. +with a hyphen, @samp{-}. This practice helps avoid name conflicts, +since all global variables in Emacs Lisp share the same name space, +and all functions share another name space@footnote{The benefits of a +Common Lisp-style package system are considered not to outweigh the +costs.}. Use two hyphens to separate prefix and name if the symbol is +not meant to be used by other packages. Occasionally, for a command name intended for users to use, it is more convenient if some words come before the package's name prefix. And ------------------------------------------------------------ revno: 113187 committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Wed 2013-06-26 15:07:24 +0200 message: (eww-mode-map): Add a menu bar. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-26 12:54:33 +0000 +++ lisp/ChangeLog 2013-06-26 13:07:24 +0000 @@ -2,6 +2,7 @@ * net/eww.el (eww-mode): Undo isn't necessary in eww buffers, probably. + (eww-mode-map): Add a menu bar. 2013-06-26 Glenn Morris === modified file 'lisp/net/eww.el' --- lisp/net/eww.el 2013-06-26 12:54:33 +0000 +++ lisp/net/eww.el 2013-06-26 13:07:24 +0000 @@ -335,6 +335,20 @@ (define-key map "&" 'eww-browse-with-external-browser) (define-key map "d" 'eww-download) (define-key map "w" 'eww-copy-page-url) + (define-key map "C" 'url-cookie-list) + + (easy-menu-define nil map "" + '("eww" + ["Quit" eww-quit t] + ["Reload" eww-reload t] + ["Back to previous page" eww-back-url + :active (not (zerop (length eww-history)))] + ["Forward to next page" eww-forward-url + :active (not (zerop eww-history-position))] + ["Browse with external browser" eww-browse-with-external-browser t] + ["Download" eww-download t] + ["Copy page URL" eww-copy-page-url t] + ["List cookies" url-cookie-list t])) map)) (define-derived-mode eww-mode nil "eww" ------------------------------------------------------------ revno: 113186 committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Wed 2013-06-26 14:54:33 +0200 message: Implement a command and mode for displaying and editing cookies diff: === modified file 'etc/NEWS' --- etc/NEWS 2013-06-25 15:49:02 +0000 +++ etc/NEWS 2013-06-26 12:54:33 +0000 @@ -1194,6 +1194,9 @@ The `url-retrieve' function now uses this to encode its URL argument, in case that is not properly encoded. +*** New command `url-cookie-list' displays all the current cookies, and +allows deleting selected cookies. + ** notifications.el supports now version 1.2 of the Notifications API. The function `notifications-get-capabilities' returns the supported server properties. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-26 06:59:48 +0000 +++ lisp/ChangeLog 2013-06-26 12:54:33 +0000 @@ -1,3 +1,8 @@ +2013-06-26 Lars Magne Ingebrigtsen + + * net/eww.el (eww-mode): Undo isn't necessary in eww buffers, + probably. + 2013-06-26 Glenn Morris * htmlfontify.el (hfy-triplet): Handle unspecified-fg, bg. === modified file 'lisp/net/eww.el' --- lisp/net/eww.el 2013-06-25 22:29:01 +0000 +++ lisp/net/eww.el 2013-06-26 12:54:33 +0000 @@ -346,6 +346,7 @@ (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) + (buffer-disable-undo) ;;(setq buffer-read-only t) ) === modified file 'lisp/url/ChangeLog' --- lisp/url/ChangeLog 2013-06-21 06:32:50 +0000 +++ lisp/url/ChangeLog 2013-06-26 12:54:33 +0000 @@ -1,3 +1,8 @@ +2013-06-26 Lars Magne Ingebrigtsen + + * url-cookie.el: Implement a command and mode for displaying and + editing cookies. + 2013-06-21 Glenn Morris * url-future.el (url-future-call): Remove useless value call. === modified file 'lisp/url/url-cookie.el' --- lisp/url/url-cookie.el 2013-01-01 09:11:05 +0000 +++ lisp/url/url-cookie.el 2013-06-26 12:54:33 +0000 @@ -349,6 +349,94 @@ url-cookie-save-interval #'url-cookie-write-file)))) +;;; Mode for listing and editing cookies. + +(defun url-cookie-list () + "List the URL cookies." + (interactive) + + (when (and (null url-cookie-secure-storage) + (null url-cookie-storage)) + (error "No cookies are defined")) + + (pop-to-buffer "*url cookies*") + (let ((inhibit-read-only t) + (domains (sort + (copy-sequence + (append url-cookie-secure-storage + url-cookie-storage)) + (lambda (e1 e2) + (string< (car e1) (car e2))))) + (domain-length 0) + start name format domain) + (erase-buffer) + (url-cookie-mode) + (dolist (elem domains) + (setq domain-length (max domain-length (length (car elem))))) + (setq format (format "%%-%ds %%-20s %%s" domain-length) + header-line-format + (concat " " (format format "Domain" "Name" "Value"))) + (dolist (elem domains) + (setq domain (car elem)) + (dolist (cookie (sort (copy-sequence (cdr elem)) + (lambda (c1 c2) + (string< (url-cookie-name c1) + (url-cookie-name c2))))) + (setq start (point) + name (url-cookie-name cookie)) + (when (> (length name) 20) + (setq name (substring name 0 20))) + (insert (format format domain name + (url-cookie-value cookie)) + "\n") + (setq domain "") + (put-text-property start (1+ start) 'url-cookie cookie))) + (goto-char (point-min)))) + +(defun url-cookie-delete () + "Delete the cookie on the current line." + (interactive) + (let ((cookie (get-text-property (line-beginning-position) 'url-cookie)) + (inhibit-read-only t) + variable) + (unless cookie + (error "No cookie on the current line")) + (setq variable (if (url-cookie-secure cookie) + 'url-cookie-secure-storage + 'url-cookie-storage)) + (let* ((list (symbol-value variable)) + (elem (assoc (url-cookie-domain cookie) list))) + (setq elem (delq cookie elem)) + (when (zerop (length (cdr elem))) + (setq list (delq elem list))) + (set variable list)) + (setq url-cookies-changed-since-last-save t) + (url-cookie-write-file) + (delete-region (line-beginning-position) + (progn + (forward-line 1) + (point))))) + +(defun url-cookie-quit () + "Kill the current buffer." + (interactive) + (kill-buffer (current-buffer))) + +(defvar url-cookie-mode-map + (let ((map (make-sparse-keymap))) + (suppress-keymap map) + (define-key map "q" 'url-cookie-quit) + (define-key map [delete] 'url-cookie-delete) + map)) + +(define-derived-mode url-cookie-mode nil "eww" + "Mode for listing cookies. + +\\{url-cookie-mode-map}" + (buffer-disable-undo) + (setq buffer-read-only t + truncate-lines t)) + (provide 'url-cookie) ;;; url-cookie.el ends here ------------------------------------------------------------ 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"))