From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?R=FCdiger?= Sonderfeld Newsgroups: gmane.emacs.devel Subject: [PATCH 1/5] eww: Use `user-error'. Date: Fri, 20 Dec 2013 00:44:24 +0100 Message-ID: <5736070.MFe9JdVJE8@descartes> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1387496702 13408 80.91.229.3 (19 Dec 2013 23:45:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Dec 2013 23:45:02 +0000 (UTC) Cc: Lars Magne Ingebrigtsen , Ted Zlatanov To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 20 00:45:07 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VtnH8-0002CQ-W9 for ged-emacs-devel@m.gmane.org; Fri, 20 Dec 2013 00:45:07 +0100 Original-Received: from localhost ([::1]:46909 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtnH7-0001R4-AB for ged-emacs-devel@m.gmane.org; Thu, 19 Dec 2013 18:45:05 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53962) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtnGg-0000uq-2m for emacs-devel@gnu.org; Thu, 19 Dec 2013 18:44:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VtnGZ-0002RG-Pu for emacs-devel@gnu.org; Thu, 19 Dec 2013 18:44:38 -0500 Original-Received: from ptmx.org ([178.63.28.110]:33825) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtnGZ-0002Qy-FP for emacs-devel@gnu.org; Thu, 19 Dec 2013 18:44:31 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by ptmx.org (Postfix) with ESMTP id E64A922ACB; Fri, 20 Dec 2013 00:44:30 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at ptmx.org Original-Received: from ptmx.org ([127.0.0.1]) by localhost (ptmx.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bSQWDxI8NoSL; Fri, 20 Dec 2013 00:44:29 +0100 (CET) Original-Received: from descartes.localnet (chello080108246092.7.14.vie.surfer.at [80.108.246.92]) by ptmx.org (Postfix) with ESMTPSA id 21A652130B; Fri, 20 Dec 2013 00:44:29 +0100 (CET) User-Agent: KMail/4.11.2 (Linux/3.11.0-14-generic; KDE/4.11.2; x86_64; ; ) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 178.63.28.110 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:166631 Archived-At: * lisp/net/eww.el (eww-back-url, eww-forward-url, eww-next-url) (eww-previous-url, eww-up-url, eww-top-url, eww-add-bookmark) (eww-bookmark-prepare, eww-bookmark-kill, eww-bookmark-yank) (eww-bookmark-browse, eww-next-bookmark, eww-previous-bookmark): Use `user-error'. --- lisp/ChangeLog | 8 ++++++++ lisp/net/eww.el | 28 ++++++++++++++-------------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 85e961e..db57dbc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2013-12-19 R=C3=83=C2=BCdiger Sonderfeld + +=09* net/eww.el (eww-back-url, eww-forward-url, eww-next-url) +=09(eww-previous-url, eww-up-url, eww-top-url, eww-add-bookmark) +=09(eww-bookmark-prepare, eww-bookmark-kill, eww-bookmark-yank) +=09(eww-bookmark-browse, eww-next-bookmark, eww-previous-bookmark): +=09Use `user-error'. + 2013-12-19 Teodor Zlatanov =20 =09* net/eww.el (eww-exit, eww-close, eww-mode-map): Revert change of diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 2263f81..feec873 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -474,7 +474,7 @@ (defun eww-back-url () "Go to the previously displayed page." (interactive) (when (>=3D eww-history-position (length eww-history)) - (error "No previous page")) + (user-error "No previous page")) (eww-save-history) (setq eww-history-position (+ eww-history-position 2)) (eww-restore-history (elt eww-history (1- eww-history-position)))) @@ -483,7 +483,7 @@ (defun eww-forward-url () "Go to the next displayed page." (interactive) (when (zerop eww-history-position) - (error "No next page")) + (user-error "No next page")) (eww-save-history) (eww-restore-history (elt eww-history (1- eww-history-position)))) =20 @@ -505,7 +505,7 @@ (defun eww-next-url () (interactive) (if eww-next-url (eww-browse-url (shr-expand-url eww-next-url eww-current-url)) - (error "No `next' on this page"))) + (user-error "No `next' on this page"))) =20 (defun eww-previous-url () "Go to the page marked `previous'. @@ -514,7 +514,7 @@ (defun eww-previous-url () (interactive) (if eww-previous-url (eww-browse-url (shr-expand-url eww-previous-url eww-current-url= )) - (error "No `previous' on this page"))) + (user-error "No `previous' on this page"))) =20 (defun eww-up-url () "Go to the page marked `up'. @@ -523,7 +523,7 @@ (defun eww-up-url () (interactive) (if eww-up-url (eww-browse-url (shr-expand-url eww-up-url eww-current-url)) - (error "No `up' on this page"))) + (user-error "No `up' on this page"))) =20 (defun eww-top-url () "Go to the page marked `top'. @@ -535,7 +535,7 @@ (defun eww-top-url () =09=09 eww-home-url))) (if best-url =09(eww-browse-url (shr-expand-url best-url eww-current-url)) - (error "No `top' for this page")))) + (user-error "No `top' for this page")))) =20 (defun eww-reload () "Reload the current page." @@ -1073,7 +1073,7 @@ (defun eww-add-bookmark () (dolist (bookmark eww-bookmarks) (when (equal eww-current-url =09=09 (plist-get bookmark :url)) - (error "Already bookmarked"))) + (user-error "Already bookmarked"))) (if (y-or-n-p "bookmark this page? ") (progn =09(let ((title (replace-regexp-in-string "[\n\t\r]" " " eww-current-t= itle))) @@ -1106,8 +1106,8 @@ (defun eww-list-bookmarks () =20 (defun eww-bookmark-prepare () (eww-read-bookmarks) - (when (null eww-bookmarks) - (error "No bookmarks are defined")) + (unless eww-bookmarks + (user-error "No bookmarks are defined")) (set-buffer (get-buffer-create "*eww bookmarks*")) (eww-bookmark-mode) (let ((format "%-40s %s") @@ -1135,7 +1135,7 @@ (defun eww-bookmark-kill () =09 (bookmark (get-text-property start 'eww-bookmark)) =09 (inhibit-read-only t)) (unless bookmark - (error "No bookmark on the current line")) + (user-error "No bookmark on the current line")) (forward-line 1) (push (buffer-substring start (point)) eww-bookmark-kill-ring) (delete-region start (point)) @@ -1146,7 +1146,7 @@ (defun eww-bookmark-yank () "Yank a previously killed bookmark to the current line." (interactive) (unless eww-bookmark-kill-ring - (error "No previously killed bookmark")) + (user-error "No previously killed bookmark")) (beginning-of-line) (let ((inhibit-read-only t) =09(start (point)) @@ -1170,7 +1170,7 @@ (defun eww-bookmark-browse () (interactive) (let ((bookmark (get-text-property (line-beginning-position) 'eww-bo= okmark))) (unless bookmark - (error "No bookmark on the current line")) + (user-error "No bookmark on the current line")) ;; We wish to leave this window, but if it's the only window here,= ;; just let it remain. (ignore-errors @@ -1192,7 +1192,7 @@ (defun eww-next-bookmark () (setq bookmark (get-text-property (line-beginning-position) =09=09=09=09=09'eww-bookmark)) (unless bookmark -=09(error "No next bookmark"))) +=09(user-error "No next bookmark"))) (eww-browse-url (plist-get bookmark :url)))) =20 (defun eww-previous-bookmark () @@ -1211,7 +1211,7 @@ (defun eww-previous-bookmark () (when (eolp) =09(forward-line -1)) (if (bobp) -=09 (error "No previous bookmark") +=09 (user-error "No previous bookmark") =09(forward-line -1)) (setq bookmark (get-text-property (line-beginning-position) =09=09=09=09=09'eww-bookmark))) --=20 1.8.5