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 21:38:49 -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> <874pbiypad.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 1204943957 13324 80.91.229.12 (8 Mar 2008 02:39:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 8 Mar 2008 02:39:17 +0000 (UTC) Cc: Karl Fogel , Tassilo Horn , Reiner Steib , emacs-devel@gnu.org To: Bastien Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 08 03:39:43 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 1JXoyN-0008NZ-5o for ged-emacs-devel@m.gmane.org; Sat, 08 Mar 2008 03:39:43 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JXoxp-0008TB-7D for ged-emacs-devel@m.gmane.org; Fri, 07 Mar 2008 21:39:09 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JXoxl-0008QX-5Q for emacs-devel@gnu.org; Fri, 07 Mar 2008 21:39:05 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JXoxj-0008OC-EQ for emacs-devel@gnu.org; Fri, 07 Mar 2008 21:39:04 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JXoxj-0008O9-AX for emacs-devel@gnu.org; Fri, 07 Mar 2008 21:39:03 -0500 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JXoxi-0003GM-VO for emacs-devel@gnu.org; Fri, 07 Mar 2008 21:39:03 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtkCAE+L0UfO+J2CdGdsb2JhbACQegEwm1KBBw X-IronPort-AV: E=Sophos;i="4.25,465,1199682000"; d="scan'208";a="15729957" Original-Received: from smtp.pppoe.ca ([65.39.196.238]) by ironport2-out.pppoe.ca with ESMTP; 07 Mar 2008 21:38:49 -0500 Original-Received: from pastel.home ([206.248.157.130]) by smtp.pppoe.ca (Internet Mail Server v1.0) with ESMTP id OFU60149; Fri, 07 Mar 2008 21:38:49 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 32F9F7F60; Fri, 7 Mar 2008 21:38:49 -0500 (EST) In-Reply-To: <874pbiypad.fsf@bzg.ath.cx> (Bastien's message of "Sat, 08 Mar 2008 01:31:38 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. 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:91691 Archived-At: >>> (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. > Following Karl advice I've applied a different patch. There is now > `bookmark-make-name-function' *and* `bookmark-make-record-function', > both buffer local. For an example on how this is supposed to work > look at the changes I've made in info.el. > I think it's okay like this. If you plan to change anything please > tell me before I work on gnus-bookmark.el. I think we should do as I suggest above: a single function of no arguments that is called first that returns a bookmark record, including a suggested name (which can be nil so as to use the default heuristic to decide the default bookmark name). This has another advantage: since the function is called first, it can signal an error if the bookmark can't be created (e.g. if buffer-file-name is nil), so we can drop the (or (local-variable-p ...) (bookmark-buffer-file-name) (error ...)) test which is currently forced to guess whether the actual bookmark construction function will work. Stefan