From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#20785: user-error for mark-inactive Date: Thu, 11 Jun 2015 02:34:06 +0300 Organization: LINKOV.NET Message-ID: <87oakncf4h.fsf@mail.linkov.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1433979450 9978 80.91.229.3 (10 Jun 2015 23:37:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 10 Jun 2015 23:37:30 +0000 (UTC) To: 20785@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jun 11 01:37:18 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1Z2pYb-0007Io-2k for geb-bug-gnu-emacs@m.gmane.org; Thu, 11 Jun 2015 01:37:17 +0200 Original-Received: from localhost ([::1]:42692 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2pYa-0005hA-KC for geb-bug-gnu-emacs@m.gmane.org; Wed, 10 Jun 2015 19:37:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52622) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2pYW-0005gp-99 for bug-gnu-emacs@gnu.org; Wed, 10 Jun 2015 19:37:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2pYN-0007LQ-C2 for bug-gnu-emacs@gnu.org; Wed, 10 Jun 2015 19:37:12 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35469) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2pYN-0007LM-8c for bug-gnu-emacs@gnu.org; Wed, 10 Jun 2015 19:37:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z2pYM-00066z-Qa for bug-gnu-emacs@gnu.org; Wed, 10 Jun 2015 19:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 Jun 2015 23:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 20785 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.143397937223422 (code B ref -1); Wed, 10 Jun 2015 23:37:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 10 Jun 2015 23:36:12 +0000 Original-Received: from localhost ([127.0.0.1]:49929 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z2pXX-00065h-Ar for submit@debbugs.gnu.org; Wed, 10 Jun 2015 19:36:11 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38905) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z2pXU-00065U-HT for submit@debbugs.gnu.org; Wed, 10 Jun 2015 19:36:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2pXO-0006mn-23 for submit@debbugs.gnu.org; Wed, 10 Jun 2015 19:36:03 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:52910) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2pXN-0006mh-Vk for submit@debbugs.gnu.org; Wed, 10 Jun 2015 19:36:01 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52396) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2pXM-0005SD-UO for bug-gnu-emacs@gnu.org; Wed, 10 Jun 2015 19:36:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2pXH-0006jf-NR for bug-gnu-emacs@gnu.org; Wed, 10 Jun 2015 19:36:00 -0400 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:57694 helo=homiemail-a20.g.dreamhost.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2pXH-0006jS-2G for bug-gnu-emacs@gnu.org; Wed, 10 Jun 2015 19:35:55 -0400 Original-Received: from homiemail-a20.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTP id 790157EC07D for ; Wed, 10 Jun 2015 16:35:52 -0700 (PDT) Original-Received: from localhost.linkov.net (m213-102-136-198.cust.tele2.ee [213.102.136.198]) (Authenticated sender: jurta@jurta.org) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTPA id A54F17EC078 for ; Wed, 10 Jun 2015 16:35:51 -0700 (PDT) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:103806 Archived-At: A single remaining case that is too annoying is when the debugger is called due to a user error while accidentally typing `C-w' (kill-region) when there is no active mark in the buffer: Debugger entered--Lisp error: (mark-inactive) signal(mark-inactive nil) mark() byte-code("\300 `\301E\207" [mark region] 3) call-interactively(kill-region nil nil) command-execute(kill-region) The following patch avoids this in both cases: 1. when mark-even-if-inactive is non-nil, displays the message: "user-error: The mark is not set now, so there is no region" 2. when mark-even-if-inactive is nil, displays the message: "mark: The mark is not active now" diff --git a/lisp/simple.el b/lisp/simple.el index 1eb0643..31810a4 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4017,7 +4021,7 @@ (defun kill-region (beg end &optional region) ;; calling `kill-append'. (interactive (list (mark) (point) 'region)) (unless (and beg end) - (error "The mark is not set now, so there is no region")) + (user-error "The mark is not set now, so there is no region")) (condition-case nil (let ((string (if region (funcall region-extract-function 'delete) diff --git a/lisp/bindings.el b/lisp/bindings.el index b658914..3672812 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -633,7 +633,7 @@ (setq debug-ignored-errors ;; file-supersession should all be user-errors! `(beginning-of-line beginning-of-buffer end-of-line end-of-buffer end-of-file buffer-read-only - file-supersession + file-supersession mark-inactive user-error ;; That's the main one! ))