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#12107: 24.1.50; In Info mode, add the name of the manual as completion candidate for "bookmark-set" Date: Thu, 02 Aug 2012 02:04:48 +0300 Organization: JURTA Message-ID: <87obmudymn.fsf@mail.jurta.org> References: <87ipd38tc7.fsf@mail.jurta.org> <87vch3xbf4.fsf@mail.jurta.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1343863004 8251 80.91.229.3 (1 Aug 2012 23:16:44 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 1 Aug 2012 23:16:44 +0000 (UTC) Cc: 12107@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 02 01:16:43 2012 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 1Swi9i-0001uI-VW for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 Aug 2012 01:16:43 +0200 Original-Received: from localhost ([::1]:45614 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Swi9i-00030m-6A for geb-bug-gnu-emacs@m.gmane.org; Wed, 01 Aug 2012 19:16:42 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:43505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Swi9d-0002r5-W0 for bug-gnu-emacs@gnu.org; Wed, 01 Aug 2012 19:16:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Swi9c-0006nO-9q for bug-gnu-emacs@gnu.org; Wed, 01 Aug 2012 19:16:37 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45988) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Swi9c-0006nJ-6T for bug-gnu-emacs@gnu.org; Wed, 01 Aug 2012 19:16:36 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SwiGp-00089E-3U for bug-gnu-emacs@gnu.org; Wed, 01 Aug 2012 19:24:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 01 Aug 2012 23:24:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12107 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12107-submit@debbugs.gnu.org id=B12107.134386341331257 (code B ref 12107); Wed, 01 Aug 2012 23:24:03 +0000 Original-Received: (at 12107) by debbugs.gnu.org; 1 Aug 2012 23:23:33 +0000 Original-Received: from localhost ([127.0.0.1]:55527 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SwiGK-000885-MK for submit@debbugs.gnu.org; Wed, 01 Aug 2012 19:23:32 -0400 Original-Received: from ps18281.dreamhost.com ([69.163.218.105]:59022 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SwiGI-00087s-55 for 12107@debbugs.gnu.org; Wed, 01 Aug 2012 19:23:31 -0400 Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 11D95451CBA6; Wed, 1 Aug 2012 16:16:00 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Wed, 01 Aug 2012 16:35:46 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:62734 Archived-At: >> Multiple values for bookmark names are not supported >> by `bookmark-make-record'. > > Then let's change that. Due to the extensible design of bookmark records, it's easy to implement this: === modified file 'lisp/bookmark.el' --- lisp/bookmark.el 2012-07-10 11:51:54 +0000 +++ lisp/bookmark.el 2012-08-01 23:02:43 +0000 @@ -772,7 +772,14 @@ (defun bookmark-set (&optional name no-o (interactive (list nil current-prefix-arg)) (unwind-protect (let* ((record (bookmark-make-record)) - (default (car record))) + (defaults (bookmark-prop-get record 'defaults)) + (default (if (consp defaults) (car defaults) defaults))) + + (if defaults + ;; Don't store default values in the record. + (setq record (assq-delete-all 'defaults record)) + ;; When no defaults in the record, use its first element. + (setq defaults (car record) default defaults)) (bookmark-maybe-load-default-file) ;; Don't set `bookmark-yank-point' and `bookmark-current-buffer' @@ -788,7 +795,7 @@ (defun bookmark-set (&optional name no-o (format "Set bookmark (%s): " default) nil bookmark-minibuffer-read-name-map - nil nil default)))) + nil nil defaults)))) (and (string-equal str "") (setq str default)) (bookmark-store str (cdr record) no-overwrite) === modified file 'lisp/info.el' --- lisp/info.el 2012-07-10 11:51:54 +0000 +++ lisp/info.el 2012-08-01 23:02:53 +0000 @@ -5020,11 +5025,18 @@ (declare-function bookmark-get-bookmark- (defun Info-bookmark-make-record () "This implements the `bookmark-make-record-function' type (which see) for Info nodes." - `(,Info-current-node - ,@(bookmark-make-record-default 'no-file) - (filename . ,Info-current-file) - (info-node . ,Info-current-node) - (handler . Info-bookmark-jump))) + (let* ((file (and (stringp Info-current-file) + (file-name-nondirectory Info-current-file))) + (bookmark-name (if file + (concat "(" file ") " Info-current-node) + Info-current-node)) + (defaults (delq nil (list bookmark-name file Info-current-node)))) + `(,bookmark-name + ,@(bookmark-make-record-default 'no-file) + (filename . ,Info-current-file) + (info-node . ,Info-current-node) + (handler . Info-bookmark-jump) + (defaults . ,defaults)))) ;;;###autoload (defun Info-bookmark-jump (bmk)