From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "David J. Biesack" Newsgroups: gmane.emacs.bugs Subject: enhancement to bookmark.el Date: Tue, 8 Jun 2004 16:33:46 -0400 (EDT) Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <200406082033.i58KXke03980@mozart.unx.sas.com> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1086726910 27060 80.91.224.253 (8 Jun 2004 20:35:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 8 Jun 2004 20:35:10 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 08 22:34:59 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BXnJD-0000Wh-00 for ; Tue, 08 Jun 2004 22:34:59 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BXnJp-0003uy-3Z for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Jun 2004 16:35:37 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BXnJn-0003uZ-Le for bug-gnu-emacs@gnu.org; Tue, 08 Jun 2004 16:35:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BXnJm-0003uG-UZ for bug-gnu-emacs@gnu.org; Tue, 08 Jun 2004 16:35:35 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BXnJm-0003uD-Qg for bug-gnu-emacs@gnu.org; Tue, 08 Jun 2004 16:35:34 -0400 Original-Received: from [149.173.6.5] (helo=merc95.na.sas.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BXnJ2-0004cG-VK for bug-gnu-emacs@gnu.org; Tue, 08 Jun 2004 16:34:49 -0400 Original-Received: from mozart.unx.sas.com ([10.19.150.41]) by merc95.na.sas.com with InterScan Messaging Security Suite; Tue, 08 Jun 2004 16:33:47 -0400 Original-Received: from D4566.d5120.us.sas.com (sasdjb@D4566.na.sas.com [10.28.11.110]) by mozart.unx.sas.com (8.11.1 (Revision 1.5+JAGae91741) /8.11.1) with ESMTP id i58KXke03980 for ; Tue, 8 Jun 2004 16:33:47 -0400 (EDT) Original-To: bug-gnu-emacs@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.4 Precedence: list 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 Xref: main.gmane.org gmane.emacs.bugs:8154 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:8154 I have an enhancement request for bookmark.el. Bookmark's menu mode does not have a key/command for moving the file. The below adds this, as well as an interactive bookmark-move command. I'm not particularly happy with the key binding, but 'm' (for 'move) and 'r' (rename0 are already taken. ;; Add a "Move" action to bookmark-bmenu, to move a bookmark to a new file ;; David.Biesack@sas.com (defun bookmark-bmenu-move () "Move bookmark on current line. Prompts for a new filename." (interactive) (if (bookmark-bmenu-check-position) (let ((bmrk (bookmark-bmenu-bookmark)) (thispoint (point))) ;; could also invoke ;(bookmark-relocate bmrk) ;; but that only prompts for the directory name; sometimes ;; bookmarked file names change as well. (bookmark-move bmrk) (bookmark-bmenu-list) (goto-char thispoint)))) (defun bookmark-move (name &optional to) (interactive (bookmark-completing-read "Move bookmark: ")) (bookmark-maybe-load-default-file) (setq bookmark-current-point (point)) (setq bookmark-yank-point (point)) (setq bookmark-current-buffer (current-buffer)) (let ((newname (or to ; use second arg, if non-nil (read-from-minibuffer "Move to: " (bookmark-get-filename name) (let ((now-map (copy-keymap minibuffer-local-map))) (define-key now-map "\C-w" 'bookmark-yank-word) now-map) nil 'bookmark-history)))) (bookmark-set-filename name newname) (setq bookmark-current-bookmark name) (bookmark-bmenu-surreptitiously-rebuild-list) (setq bookmark-alist-modification-count (1+ bookmark-alist-modification-count)) (if (bookmark-time-to-save-p) (bookmark-save)))) (define-key bookmark-bmenu-mode-map "M" 'bookmark-bmenu-move) -- David J. Biesack SAS Institute Inc. R&D Java Strategist SAS Campus Drive Cary, NC 27513 (919) 531-7771 http://www.sas.com