From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Toru TSUNEYOSHI" Newsgroups: gmane.emacs.devel Subject: Re: proposition about bookmark-buffer-file-name in bookmark.el Date: Wed, 19 Nov 2008 21:32:32 +0900 Message-ID: References: <874p24i2u3.fsf@red-bean.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0009_01C94A8E.5490B170" X-Trace: ger.gmane.org 1227097983 21282 80.91.229.12 (19 Nov 2008 12:33:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 19 Nov 2008 12:33:03 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Karl Fogel" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 19 13:34:04 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 1L2mFm-0002GR-2c for ged-emacs-devel@m.gmane.org; Wed, 19 Nov 2008 13:33:54 +0100 Original-Received: from localhost ([127.0.0.1]:54828 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L2mEd-0002zs-8x for ged-emacs-devel@m.gmane.org; Wed, 19 Nov 2008 07:32:43 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L2mEY-0002zn-N3 for emacs-devel@gnu.org; Wed, 19 Nov 2008 07:32:38 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L2mEX-0002zb-8j for emacs-devel@gnu.org; Wed, 19 Nov 2008 07:32:38 -0500 Original-Received: from [199.232.76.173] (port=42060 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L2mEX-0002zY-6C for emacs-devel@gnu.org; Wed, 19 Nov 2008 07:32:37 -0500 Original-Received: from bay0-omc3-s41.bay0.hotmail.com ([65.54.246.241]:8811) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L2mEW-00009F-PM for emacs-devel@gnu.org; Wed, 19 Nov 2008 07:32:37 -0500 Original-Received: from hotmail.com ([207.46.10.19]) by bay0-omc3-s41.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 19 Nov 2008 04:32:35 -0800 Original-Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Wed, 19 Nov 2008 04:32:35 -0800 Original-Received: from 124.155.30.210 by BAY121-DAV9.phx.gbl with DAV; Wed, 19 Nov 2008 12:32:33 +0000 X-Originating-IP: [124.155.30.210] X-Originating-Email: [t_tuneyosi@hotmail.com] X-Sender: t_tuneyosi@hotmail.com X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1933 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1933 X-OriginalArrivalTime: 19 Nov 2008 12:32:35.0654 (UTC) FILETIME=[E6C1FE60:01C94A42] X-detected-operating-system: by monty-python.gnu.org: Windows 2000 SP4, XP SP1+ 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:105813 Archived-At: This is a multi-part message in MIME format. ------=_NextPart_000_0009_01C94A8E.5490B170 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Thank you for replying. ----- Original Message ----- From: "Karl Fogel" To: "Toru TSUNEYOSHI" Cc: Sent: Wednesday, November 19, 2008 4:37 PM Subject: Re: proposition about bookmark-buffer-file-name in bookmark.el > "Toru TSUNEYOSHI" writes: > > I have a proposition. > > (I use GNU Emacs 22.3.1 (i386-msvc-nt5.0.2195).) > > > > Now, `bookmark-buffer-file-name' in bookmark.el do > > `abbreviate-file-name' buffer-file-name only. > > So, I wish this function do `abbreviate-file-name' dired-directory (and > > Info-current-file) on next version of Emacs. > > This sounds reasonable to me, but could you give examples of what the > new names would look like for those kinds of bookmarks? Sorry, I can't understand you clearly. Anyway, I wish that `bookmark-buffer-file-name' returns dired-directory relative to `~/'. examples of `bookmark-buffer-file-name' processing: case: home directory: "d:/home/user/" dired-directory: "d:/home/user/xyz/" (bookmark-buffer-file-name) now => "d:/home/user/xyz/" wish => "~/xyz/" > > (By the way, expressing the proposed change in 'patch' format is > probably the most precise way to communicate it.) > > Thanks, > -Karl Yes. I use `defadvice' in practice. But I made a patch for bookmark.el temporarily. ------=_NextPart_000_0009_01C94A8E.5490B170 Content-Type: application/octet-stream; name="bookmark.el.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="bookmark.el.diff" --- bookmark.el.original 2008-01-07 11:45:03.000000000 +0900=0A= +++ bookmark.el 2008-11-19 20:45:26.331974400 +0900=0A= @@ -1007,18 +1007,20 @@=0A= (defun bookmark-buffer-file-name ()=0A= "Return the current buffer's file in a way useful for bookmarks.=0A= For example, if this is a Info buffer, return the Info file's name."=0A= - (cond=0A= - ((eq major-mode 'Info-mode)=0A= - Info-current-file)=0A= - (buffer-file-name=0A= - ;; Abbreviate the path, both so it's shorter and so it's more=0A= - ;; portable. E.g., the user's home dir might be a different=0A= - ;; path on different machines, but "~/" will still reach it.=0A= - (abbreviate-file-name buffer-file-name))=0A= - ((and (boundp 'dired-directory) dired-directory)=0A= - (if (stringp dired-directory)=0A= - dired-directory=0A= - (car dired-directory)))))=0A= + (let (file)=0A= + (setq file (cond=0A= + ((eq major-mode 'Info-mode)=0A= + Info-current-file)=0A= + (buffer-file-name=0A= + ;; Abbreviate the path, both so it's shorter and so it's more=0A= + ;; portable. E.g., the user's home dir might be a different=0A= + ;; path on different machines, but "~/" will still reach it.=0A= + buffer-file-name)=0A= + ((and (boundp 'dired-directory) dired-directory)=0A= + (if (stringp dired-directory)=0A= + dired-directory=0A= + (car dired-directory)))))=0A= + (and file (abbreviate-file-name file))))=0A= =0A= =0A= (defun bookmark-maybe-load-default-file ()=0A= ------=_NextPart_000_0009_01C94A8E.5490B170--