GNU bug report logs - #12504
24.2.50; `bookmark-rename' and `bookmark-maybe-historicize-string'

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: minor; Reported by: "Drew Adams" <drew.adams@HIDDEN>; dated Mon, 24 Sep 2012 17:08:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 12504 <at> debbugs.gnu.org:


Received: (at 12504) by debbugs.gnu.org; 1 Oct 2012 22:32:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 01 18:32:04 2012
Received: from localhost ([127.0.0.1]:36837 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TIoWx-0006YL-VB
	for submit <at> debbugs.gnu.org; Mon, 01 Oct 2012 18:32:04 -0400
Received: from mail-ie0-f172.google.com ([209.85.223.172]:61497)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <kfogel@HIDDEN>) id 1TIoWv-0006Xz-Gm
	for 12504 <at> debbugs.gnu.org; Mon, 01 Oct 2012 18:32:02 -0400
Received: by iec9 with SMTP id 9so14101916iec.3
	for <12504 <at> debbugs.gnu.org>; Mon, 01 Oct 2012 15:31:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:from:to:cc:subject:references:reply-to:date:in-reply-to
	:message-id:user-agent:mime-version:content-type;
	bh=HLPjbIKKMJirVc89HmMkyXBAEcRn08qWQvS1Gmd10QA=;
	b=NR/wcNOxSyrtZ239OAoSNVnaau95pIlDi0NkBbLj+KU9hcq5BIqJdInDT0dn1d6FSk
	7oU+zA4oo1WN5zcq/XPTDelo70mv13zqpWhVVKq1LJr79s095YMJvXYiVRSZXIDNbb7x
	MdUgqAsjvTsYCqUtvlZS/Soze74t7HlfsSnRuVzgTGF8sIPj7nHoEMuxXMIdqQbwT8MU
	JYt5QWStOwM5ftd2UizahzRJFLkqccFPZhXRqzLtNf6KqsVhLlMm/4/AtbspEh/ZfdWC
	174+S5RK73EdcnKLM2CbloiB95bl84aYYwZ6vKZoE3rkGu3N4dRq6waJ1W+bvS1uRuI4
	+u7Q==
Received: by 10.50.95.227 with SMTP id dn3mr7207378igb.14.1349130692105;
	Mon, 01 Oct 2012 15:31:32 -0700 (PDT)
Received: from kwarm.red-bean.com
	(74-92-190-113-Illinois.hfc.comcastbusiness.net. [74.92.190.113])
	by mx.google.com with ESMTPS id ce10sm9199818igb.1.2012.10.01.15.31.30
	(version=TLSv1/SSLv3 cipher=OTHER);
	Mon, 01 Oct 2012 15:31:31 -0700 (PDT)
From: Karl Fogel <kfogel@HIDDEN>
To: "Drew Adams" <drew.adams@HIDDEN>
Subject: Re: bug#12504: `bookmark-rename' and
	`bookmark-maybe-historicize-string'
References: <736CB5A93DF64F6BB3FDF32A163C35B3@HIDDEN>
	<87lifqhmj2.fsf@HIDDEN>
	<8B5272B140EB45FB822FEA3D45F3FB46@HIDDEN>
	<87bogldgs9.fsf@HIDDEN>
	<B609652D36144C569635CBD69C44C4A6@HIDDEN>
Date: Mon, 01 Oct 2012 17:31:29 -0500
In-Reply-To: <B609652D36144C569635CBD69C44C4A6@HIDDEN> (Drew Adams's
	message of "Mon, 1 Oct 2012 14:34:04 -0700")
Message-ID: <87626takou.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.1 (/)
X-Debbugs-Envelope-To: 12504
Cc: 12504 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: Karl Fogel <kfogel@HIDDEN>
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: 0.1 (/)

"Drew Adams" <drew.adams@HIDDEN> writes:
>Thanks.  But again, this really is not specific to bookmark commands.  A more
>general solution should be found, IMO.
>
>For bookmark.el, I would be happy if we did not try to add menu-invoked
>commands to the histry, and we just waited for a general solution.
>
>But I would also be happy if you implement a bookmark.el solution that
>does what we mentioned above: add to the history only when invoked by
>the user, interactively (menu or keys).

Understood -- and thank you for laying out the options so clearly!




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12504; Package emacs. Full text available.

Message received at 12504 <at> debbugs.gnu.org:


Received: (at 12504) by debbugs.gnu.org; 1 Oct 2012 21:34:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 01 17:34:53 2012
Received: from localhost ([127.0.0.1]:36796 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TIndc-0005Gs-Ng
	for submit <at> debbugs.gnu.org; Mon, 01 Oct 2012 17:34:53 -0400
Received: from rcsinet15.oracle.com ([148.87.113.117]:32763)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <drew.adams@HIDDEN>) id 1TInda-0005Gk-8b
	for 12504 <at> debbugs.gnu.org; Mon, 01 Oct 2012 17:34:51 -0400
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by rcsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id q91LYJuO029464
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 1 Oct 2012 21:34:20 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	q91LYJ7i009127
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 1 Oct 2012 21:34:19 GMT
Received: from abhmt111.oracle.com (abhmt111.oracle.com [141.146.116.63])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	q91LYJj8008276; Mon, 1 Oct 2012 16:34:19 -0500
Received: from dradamslap1 (/10.159.219.190)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Mon, 01 Oct 2012 14:34:19 -0700
From: "Drew Adams" <drew.adams@HIDDEN>
To: "'Karl Fogel'" <kfogel@HIDDEN>
References: <736CB5A93DF64F6BB3FDF32A163C35B3@HIDDEN><87lifqhmj2.fsf@HIDDEN><8B5272B140EB45FB822FEA3D45F3FB46@HIDDEN>
	<87bogldgs9.fsf@HIDDEN>
Subject: RE: bug#12504: `bookmark-rename' and
	`bookmark-maybe-historicize-string'
Date: Mon, 1 Oct 2012 14:34:04 -0700
Message-ID: <B609652D36144C569635CBD69C44C4A6@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook 11
In-Reply-To: <87bogldgs9.fsf@HIDDEN>
Thread-Index: Ac2gG5W38dwylQwvRK6ABJRbIdfiuQAAEVyg
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
X-Spam-Score: -6.3 (------)
X-Debbugs-Envelope-To: 12504
Cc: 12504 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.3 (------)

> >I agree about the usefulness, but I think it should be done only when
> >`bookmark-rename' is invoked interactively.
> 
> When I say "interactively", I'm including both minibuffer command
> and menu command -- anything the user did interactively, that is.

Yes, that's what I meant here, too.

But that is not what the code does, I believe.  It adds the name to the history
even when bookmark-rename is invoked non-interactively.

> >...  That's a bad workaround if the goal is to add to the 
> > history when the user uses the menu: non-interactively is not
> > the same thing as interactively-using-a-menu.
> 
> Sure, completely agree.  We're on the same page, 
> conceptually; the code just needs fixing, that's all :-).
> I'll try to do it, but am busy for a while again.

Thanks.  But again, this really is not specific to bookmark commands.  A more
general solution should be found, IMO.

For bookmark.el, I would be happy if we did not try to add menu-invoked commands
to the histry, and we just waited for a general solution.

But I would also be happy if you implement a bookmark.el solution that does what
we mentioned above: add to the history only when invoked by the user,
interactively (menu or keys).





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12504; Package emacs. Full text available.

Message received at 12504 <at> debbugs.gnu.org:


Received: (at 12504) by debbugs.gnu.org; 1 Oct 2012 21:28:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 01 17:28:08 2012
Received: from localhost ([127.0.0.1]:36791 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TInX5-00056x-T7
	for submit <at> debbugs.gnu.org; Mon, 01 Oct 2012 17:28:08 -0400
Received: from mail-ie0-f172.google.com ([209.85.223.172]:48141)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <kfogel@HIDDEN>) id 1TInX4-00056q-7f
	for 12504 <at> debbugs.gnu.org; Mon, 01 Oct 2012 17:28:07 -0400
Received: by iec9 with SMTP id 9so13984415iec.3
	for <12504 <at> debbugs.gnu.org>; Mon, 01 Oct 2012 14:27:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:from:to:cc:subject:references:reply-to:date:in-reply-to
	:message-id:user-agent:mime-version:content-type;
	bh=neptyk0/bBC3PFsColN/XQP9/YOHkpIKAFjrNxp7n34=;
	b=cH9X+VRWn4Cw5zPNd8K32xFM/X+sROvUFbK3No0pc+9huV1YsHzDNo/73P9FJa/Ojg
	0QS6ITkKN+7uupiQZA83MeC1v4yzZGxzM3QIz2qx8sstiKpqBxQVH9Xx5jNX+ynnuXzP
	FBqlfZWBYBsE87uVFs3u3KM2mseMEduYK+lb0h/Xw0u9a0+YWwnF9CpcLgXWTzDyPIL5
	LXGlhdQ71pzhYuRBCxP7aqAx8Nh4kvrXBx6xv0Ja5pAClSr1OFr5DO5fGuOkEQg4PLPM
	waZ7xGJwAfAQ9kgRjCCbZbf26HJd7vwmbZUfaSVRYgtHDV4TcQNWGtjZV9ZeQRQsPzEh
	tfFQ==
Received: by 10.50.185.194 with SMTP id fe2mr7060046igc.60.1349126857528;
	Mon, 01 Oct 2012 14:27:37 -0700 (PDT)
Received: from kwarm.red-bean.com
	(74-92-190-113-Illinois.hfc.comcastbusiness.net. [74.92.190.113])
	by mx.google.com with ESMTPS id hz10sm7376497igc.12.2012.10.01.14.27.35
	(version=TLSv1/SSLv3 cipher=OTHER);
	Mon, 01 Oct 2012 14:27:36 -0700 (PDT)
From: Karl Fogel <kfogel@HIDDEN>
To: "Drew Adams" <drew.adams@HIDDEN>
Subject: Re: bug#12504: `bookmark-rename' and
	`bookmark-maybe-historicize-string'
References: <736CB5A93DF64F6BB3FDF32A163C35B3@HIDDEN>
	<87lifqhmj2.fsf@HIDDEN>
	<8B5272B140EB45FB822FEA3D45F3FB46@HIDDEN>
Date: Mon, 01 Oct 2012 16:27:34 -0500
In-Reply-To: <8B5272B140EB45FB822FEA3D45F3FB46@HIDDEN> (Drew Adams's
	message of "Sun, 30 Sep 2012 21:29:13 -0700")
Message-ID: <87bogldgs9.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.1 (/)
X-Debbugs-Envelope-To: 12504
Cc: 12504 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: Karl Fogel <kfogel@HIDDEN>
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: 0.1 (/)

"Drew Adams" <drew.adams@HIDDEN> writes:
>I agree about the usefulness, but I think it should be done only when
>`bookmark-rename' is invoked interactively.

When I say "interactively", I'm including both minibuffer command
and menu command -- anything the user did interactively, that is.

>...  That's a bad workaround if the goal is to add to the history when
>the user uses the menu: non-interactively is not the same thing as
>interactively-using-a-menu.

Sure, completely agree.  We're on the same page, conceptually; the code
just needs fixing, that's all :-).  I'll try to do it, but am busy for a
while again.  Sorry for the delay.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12504; Package emacs. Full text available.

Message received at 12504 <at> debbugs.gnu.org:


Received: (at 12504) by debbugs.gnu.org; 1 Oct 2012 04:29:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 01 00:29:55 2012
Received: from localhost ([127.0.0.1]:35399 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TIXdi-000209-K6
	for submit <at> debbugs.gnu.org; Mon, 01 Oct 2012 00:29:54 -0400
Received: from rcsinet15.oracle.com ([148.87.113.117]:39986)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <drew.adams@HIDDEN>) id 1TIXdh-000202-1q
	for 12504 <at> debbugs.gnu.org; Mon, 01 Oct 2012 00:29:53 -0400
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by rcsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id q914TRE4023806
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 1 Oct 2012 04:29:28 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	q914TQSq018144
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 1 Oct 2012 04:29:27 GMT
Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	q914TQhi005765; Sun, 30 Sep 2012 23:29:26 -0500
Received: from dradamslap1 (/10.159.219.231)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Sun, 30 Sep 2012 21:29:26 -0700
From: "Drew Adams" <drew.adams@HIDDEN>
To: "'Karl Fogel'" <kfogel@HIDDEN>, <12504 <at> debbugs.gnu.org>
References: <736CB5A93DF64F6BB3FDF32A163C35B3@HIDDEN>
	<87lifqhmj2.fsf@HIDDEN>
Subject: RE: bug#12504: `bookmark-rename' and
	`bookmark-maybe-historicize-string'
Date: Sun, 30 Sep 2012 21:29:13 -0700
Message-ID: <8B5272B140EB45FB822FEA3D45F3FB46@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook 11
In-Reply-To: <87lifqhmj2.fsf@HIDDEN>
Thread-Index: Ac2fiQxXfJykwfmXQneZlZq4efcyqQAAeFOg
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
X-Spam-Score: -7.1 (-------)
X-Debbugs-Envelope-To: 12504
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -7.1 (-------)

> I agree there is a bug, or maybe a buglet, here, for the reasons you
> describe, but I'm not sure how to solve it.
> 
> Does invoking functions through a menu result in an environment where
> `called-interactively-p' returns non-nil?  In that case, the premise
> behind `bookmark-maybe-historicize-string' is all wrong 
> anyway, and the macro should be rewritten to:
> 
>   `(when (called-interactively-p 'interactive)
>      (setq bookmark-history (cons ,string bookmark-history))))

I think the problem that the code comment refers to, namely that invoking it
from a menu will not add it to the history, is a real problem, albeit a minor
one.  And as you say, it has nothing to do with bookmarks in particular.

I would suggest removing this workaround to try to make it DTRT for bookmark.el
menu commands, and just kick the question up to emacs-devel.  There might be a
good general answer.  In any case, it is a general question.  And I don't see a
crying need for bookmark renaming etc. to handle this specially.

There was some discussion on emacs-devel a few years back about optionally
(i.e., a user could choose) adding commands invoked using menus to the command
history (which is a bit different, but which could cover this case as well).

I implemented that in Icicles, with user option
`icicle-menu-items-to-history-flag':

 "Non-nil means to add menu-item commands to the command history.
  This history is `extended-command-history'."

FWIW, I do that by adding/removing this function to/from `pre-command-hook',
according to the option value:

(defun icicle-add-menu-item-to-cmd-history ()
  "Add `this-command' to command history, if it is a menu item.
Menu items that are not associated with a command symbol are ignored.
Used on `pre-command-hook'."
  (condition-case nil ; Just in case, since this is on `pre-command-hook'.
      (when (and (> (length (this-command-keys-vector)) 0)
                 (equal '(menu-bar) (elt (this-command-keys-vector) 0))
                 ;; Exclude uninterned symbols such as `menu-function-356'.
                 (symbolp this-command)
                 (intern-soft this-command))
        (pushnew (symbol-name this-command) extended-command-history))
    (error nil)))

> The issue is larger than just `bookmark-rename', obviously.

Yup.  I don't think bookmark.el should try to deal with it.  How important is it
for menu access to add such stuff to the history?

> By the way, your guess is right: it's useful (I think) to have the old
> name in the history for `bookmark-rename', because someone may want to
> use it or a variant of it in another bookmark soon.  History is cheap
> that way: it's better to have a little junk than to *not* 
> have the thing the user needs when they need it.

I agree about the usefulness, but I think it should be done only when
`bookmark-rename' is invoked interactively.

(In my code, there is, in some contexts, some automatic bookmark renaming, and
it makes no sense in such non-interactive calls to add the old names to the
history.  Anyway, that's my problem, but for bookmark.el I still don't think it
helps to add to the history unless invoked interactively.)

> Let's tackle the larger issue with 
> `bookmark-maybe-historicize-string',

See above.  Any solution to satisfy this need should, in any case, not be adding
to the history "if caller non-interactive".  That's a bad workaround if the goal
is to add to the history when the user uses the menu: non-interactively is not
the same thing as interactively-using-a-menu.

> and then figure out whether `bookmark-rename' is doing the 
> right thing.

See above for my opinion.

HTH - Drew





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12504; Package emacs. Full text available.

Message received at 12504 <at> debbugs.gnu.org:


Received: (at 12504) by debbugs.gnu.org; 1 Oct 2012 03:58:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 30 23:58:07 2012
Received: from localhost ([127.0.0.1]:35340 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TIX8x-0001Gh-99
	for submit <at> debbugs.gnu.org; Sun, 30 Sep 2012 23:58:07 -0400
Received: from mail-ie0-f172.google.com ([209.85.223.172]:52729)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <kfogel@HIDDEN>) id 1TIX8v-0001Ga-OR
	for 12504 <at> debbugs.gnu.org; Sun, 30 Sep 2012 23:58:06 -0400
Received: by iec9 with SMTP id 9so11848302iec.3
	for <12504 <at> debbugs.gnu.org>; Sun, 30 Sep 2012 20:57:41 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=sender:from:to:subject:reply-to:date:message-id:mime-version
	:content-type; bh=L9kLC4aVW6yAGCSVGpSYc1enQF7dPrXKLsz7njl/Skw=;
	b=mZh3YwlFhySqQ7A7ZChwgDIeoMLnAGYbPqJkrmExPTaPL874hlzLWcnL40kJ7Edl3E
	Ll910sHMHludekM86E9cH5QayLf6UtXfY8vR860TpGYxkQLJ/y8bFxRHc7T0vcu8QukT
	tEZjPU5BIeCI4TTNBQMSi+aNvTginJG2p8zKOHbTOOWEsLk2SEr3rDbE4DUSo0CCu3fh
	2jlfRLwDX5Q0QY9kSVkTgH0cNm6MVlyVJv1FV3BRI/gNZieygSnZhtX8ULLpLYY8P34M
	WawDM9j0ay3EZj+RrJQNkm+i9TCZJZlpNQ3jd1F5XV3mn4J3UubSq0+NLNPtreH1bLG2
	MLQQ==
Received: by 10.50.150.144 with SMTP id ui16mr4557419igb.68.1349063860930;
	Sun, 30 Sep 2012 20:57:40 -0700 (PDT)
Received: from floss.red-bean.com (173-109-178-220.pools.spcsdns.net.
	[173.109.178.220])
	by mx.google.com with ESMTPS id a10sm6215410igd.1.2012.09.30.20.57.39
	(version=TLSv1/SSLv3 cipher=OTHER);
	Sun, 30 Sep 2012 20:57:40 -0700 (PDT)
From: Karl Fogel <kfogel@HIDDEN>
To: 12504 <at> debbugs.gnu.org
Subject: Re: `bookmark-rename' and `bookmark-maybe-historicize-string'
Date: Sun, 30 Sep 2012 22:57:37 -0500
Message-ID: <87lifqhmj2.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 12504
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: Karl Fogel <kfogel@HIDDEN>
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -0.7 (/)

I agree there is a bug, or maybe a buglet, here, for the reasons you
describe, but I'm not sure how to solve it.

Does invoking functions through a menu result in an environment where
`called-interactively-p' returns non-nil?  In that case, the premise
behind `bookmark-maybe-historicize-string' is all wrong anyway, and the
macro should be rewritten to:

  `(when (called-interactively-p 'interactive)
     (setq bookmark-history (cons ,string bookmark-history))))

The issue is larger than just `bookmark-rename', obviously.

By the way, your guess is right: it's useful (I think) to have the old
name in the history for `bookmark-rename', because someone may want to
use it or a variant of it in another bookmark soon.  History is cheap
that way: it's better to have a little junk than to *not* have the thing
the user needs when they need it.

Let's tackle the larger issue with `bookmark-maybe-historicize-string',
and then figure out whether `bookmark-rename' is doing the right thing.

-Karl




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12504; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 24 Sep 2012 17:07:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 24 13:07:16 2012
Received: from localhost ([127.0.0.1]:53463 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TGC7n-0004my-8A
	for submit <at> debbugs.gnu.org; Mon, 24 Sep 2012 13:07:16 -0400
Received: from eggs.gnu.org ([208.118.235.92]:41019)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <drew.adams@HIDDEN>) id 1TGC7j-0004mo-QD
	for submit <at> debbugs.gnu.org; Mon, 24 Sep 2012 13:07:12 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <drew.adams@HIDDEN>) id 1TGC5r-0007t1-B9
	for submit <at> debbugs.gnu.org; Mon, 24 Sep 2012 13:05:16 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,
	UNPARSEABLE_RELAY autolearn=unavailable version=3.3.2
Received: from lists.gnu.org ([208.118.235.17]:54415)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <drew.adams@HIDDEN>) id 1TGC5r-0007st-8S
	for submit <at> debbugs.gnu.org; Mon, 24 Sep 2012 13:05:15 -0400
Received: from eggs.gnu.org ([208.118.235.92]:47530)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <drew.adams@HIDDEN>) id 1TGC5o-000861-9T
	for bug-gnu-emacs@HIDDEN; Mon, 24 Sep 2012 13:05:14 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <drew.adams@HIDDEN>) id 1TGC5g-0007dv-Ey
	for bug-gnu-emacs@HIDDEN; Mon, 24 Sep 2012 13:05:11 -0400
Received: from acsinet15.oracle.com ([141.146.126.227]:34803)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <drew.adams@HIDDEN>) id 1TGC5g-0007cT-8u
	for bug-gnu-emacs@HIDDEN; Mon, 24 Sep 2012 13:05:04 -0400
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with
	ESMTP id q8OH50bp028047
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <bug-gnu-emacs@HIDDEN>; Mon, 24 Sep 2012 17:05:01 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	q8OH50Nh005563
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <bug-gnu-emacs@HIDDEN>; Mon, 24 Sep 2012 17:05:00 GMT
Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	q8OH50RR027650
	for <bug-gnu-emacs@HIDDEN>; Mon, 24 Sep 2012 12:05:00 -0500
Received: from dradamslap1 (/10.159.184.43)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Mon, 24 Sep 2012 10:05:00 -0700
From: "Drew Adams" <drew.adams@HIDDEN>
To: <bug-gnu-emacs@HIDDEN>
Subject: 24.2.50; `bookmark-rename' and `bookmark-maybe-historicize-string'
Date: Mon, 24 Sep 2012 10:04:46 -0700
Message-ID: <736CB5A93DF64F6BB3FDF32A163C35B3@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook 11
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157
Thread-Index: Ac2adrLvXKvbyYt+R66DpTvSpp055g==
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 208.118.235.17
X-Spam-Score: -6.1 (------)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.1 (------)

Should `bookmark-rename' call `bookmark-maybe-historicize-string', as it
does now?  I am not sure this is a bug, but I would like to raise the
question.
 
What is the reason for that macro call by `bookmark-rename'?  The macro
pushes the STRING arg to `bookmark-history' for non-interactive use.
 
Why would we do that for the old bookmark name, when you rename a
bookmark?  Is it because we want to let you access that old name later,
so you can rename other bookmarks that might have the old name as a
prefix?
 
That's about all I can think of.  But with such a rationale, why don't
we do that only when `bookmark-rename' is called interactively?
Instead, we do it only when the function is NOT called interactively.
 
It seems to me that Lisp code should be able to use `bookmark-rename'
without adding the old name to the history.  Renaming a bookmark should
do only that, I think.
 
Is there a bug here?  If not, what is the rationale?
 
The doc string for `bookmark-rename' offers this rationale:
 
 Put STRING into the bookmark prompt history, if caller non-interactive.
 We need this because sometimes bookmark functions are invoked from
 menus, so `completing-read' never gets a chance to set `bookmark-history'.
 
(Such a rationale really should be a comment, not part of the doc
string, BTW.)
 
OK, it is true that `bookmark-rename' is used in a menu.  But what's
done does not seem the best way to handle the problem cited.  If it were,
then presumably we would be doing that kind of thing all over the place,
not just in bookmark.el.
 
And the implementation is overkill for that rationale.  It presumes that
every non-interactive call to `bookmark-rename' should update the
history.
 
I think there is a bug here, but if not I'd like to understand this
better.  Thx.
 

In GNU Emacs 24.2.50.1 (i386-mingw-nt5.1.2600)
 of 2012-09-17 on MARVIN
Bzr revision: 110062 cyd@HIDDEN
Windowing system distributor `Microsoft Corp.', version 5.1.2600
Configured using:
 `configure --with-gcc (4.7) --no-opt --enable-checking --cflags
 -ID:/devel/emacs/libs/libXpm-3.5.8/include
 -ID:/devel/emacs/libs/libXpm-3.5.8/src
 -ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include
 -ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include
 -ID:/devel/emacs/libs/giflib-4.1.4-1/include
 -ID:/devel/emacs/libs/jpeg-6b-4/include
 -ID:/devel/emacs/libs/tiff-3.8.2-1/include
 -ID:/devel/emacs/libs/gnutls-3.0.9/include
 -ID:/devel/emacs/libs/libiconv-1.13.1-1-dev/include
 -ID:/devel/emacs/libs/libxml2-2.7.8/include/libxml2'
 





Acknowledgement sent to "Drew Adams" <drew.adams@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#12504; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.