From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: bookmark.el and lisp/gnus/gnus-bookmark.el Date: Fri, 07 Mar 2008 16:51:54 -0500 Message-ID: References: <874pbj682f.fsf@red-bean.com> <87zltbhbq8.fsf@bzg.ath.cx> <87iqzzigv6.fsf@bzg.ath.cx> <87ejan7xhq.fsf@member.fsf.org> <87hcfi3egg.fsf@bzg.ath.cx> <87abla8w6b.fsf@member.fsf.org> <87bq5qhba6.fsf@bzg.ath.cx> <871w6m8t59.fsf@member.fsf.org> <87ablamphg.fsf@red-bean.com> <87skz2lacp.fsf@bzg.ath.cx> <87tzjil9oz.fsf@red-bean.com> <8763vyl964.fsf@bzg.ath.cx> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1204926742 32077 80.91.229.12 (7 Mar 2008 21:52:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 7 Mar 2008 21:52:22 +0000 (UTC) Cc: Karl Fogel , Tassilo Horn , Reiner Steib , emacs-devel@gnu.org To: Bastien Guerry Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 07 22:52:48 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JXkUe-0006um-Dy for ged-emacs-devel@m.gmane.org; Fri, 07 Mar 2008 22:52:44 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JXkU6-0006Et-Ia for ged-emacs-devel@m.gmane.org; Fri, 07 Mar 2008 16:52:10 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JXkU0-0006EG-HO for emacs-devel@gnu.org; Fri, 07 Mar 2008 16:52:04 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JXkTy-0006CC-1y for emacs-devel@gnu.org; Fri, 07 Mar 2008 16:52:03 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JXkTx-0006C6-Rt for emacs-devel@gnu.org; Fri, 07 Mar 2008 16:52:01 -0500 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JXkTx-0000Ji-F6 for emacs-devel@gnu.org; Fri, 07 Mar 2008 16:52:01 -0500 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 28B802CF6BD; Fri, 7 Mar 2008 16:52:01 -0500 (EST) Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 9339D3FE0; Fri, 7 Mar 2008 16:51:54 -0500 (EST) Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 809A66C7F7; Fri, 7 Mar 2008 16:51:54 -0500 (EST) In-Reply-To: <8763vyl964.fsf@bzg.ath.cx> (Bastien Guerry's message of "Fri, 07 Mar 2008 17:45:55 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:91665 Archived-At: >>> 2. Use `bookmark-make-name-function' function in `bookmark-set' instead >>> of `bookmark-make-record-function': >> You mean for making it buffer-local, right? > Right! I do not understand. Bookmark.el shouldn't make any of those variables buffer-local, AFAICT. >> But wouldn't we need to make them *both* buffer-local? External code >> will still need to call `bookmark-make-record-function' too. > Yes, they should be both buffer-local. Let the modes that use them call make-local-variable. > My single remaining hesitation is this one: having two buffer local > variables is a bit too much, since each mode would have to set them > both. Better use `bookmark-make-record-function' for both purposes: > returning a name *or* returning a record. > For example, the function for text files would look like: > (defun bookmark-make-record-for-text-file (annotation &optional name) > "Return the record. > If optional arg NAME is non-nil, just return the default name for > this bookmark." > ...) > I think it's easier. Each mode should have to worry about one > buffer-local variable (and each dev would only read one docstring...) This might work, tho I'd throw away the `name' arg. Let the buffer-local function build a bookmark record (i.e. a cons cell of the form (NAME . ALIST)) with any name it chooses, and then change the name according to the user's choice. I.e. make the bookmark record before even prompting the user for a name. Stefan