all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Toru TSUNEYOSHI" <t_tuneyosi@hotmail.com>
To: "Karl Fogel" <kfogel@red-bean.com>
Cc: emacs-devel@gnu.org
Subject: Re: proposition about bookmark-buffer-file-name in bookmark.el
Date: Wed, 19 Nov 2008 21:32:32 +0900	[thread overview]
Message-ID: <BAY121-DAV9FA0731B0A883E44B757AE20D0@phx.gbl> (raw)
In-Reply-To: 874p24i2u3.fsf@red-bean.com

[-- Attachment #1: Type: text/plain, Size: 1382 bytes --]

Thank you for replying.

----- Original Message ----- 
From: "Karl Fogel" <kfogel@red-bean.com>
To: "Toru TSUNEYOSHI" <t_tuneyosi@hotmail.com>
Cc: <emacs-devel@gnu.org>
Sent: Wednesday, November 19, 2008 4:37 PM
Subject: Re: proposition about bookmark-buffer-file-name in bookmark.el


> "Toru TSUNEYOSHI" <t_tuneyosi@hotmail.com> 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.

[-- Attachment #2: bookmark.el.diff --]
[-- Type: application/octet-stream, Size: 1391 bytes --]

--- bookmark.el.original	2008-01-07 11:45:03.000000000 +0900
+++ bookmark.el	2008-11-19 20:45:26.331974400 +0900
@@ -1007,18 +1007,20 @@
 (defun bookmark-buffer-file-name ()
   "Return the current buffer's file in a way useful for bookmarks.
 For example, if this is a Info buffer, return the Info file's name."
-  (cond
-   ((eq major-mode 'Info-mode)
-    Info-current-file)
-   (buffer-file-name
-    ;; Abbreviate the path, both so it's shorter and so it's more
-    ;; portable.  E.g., the user's home dir might be a different
-    ;; path on different machines, but "~/" will still reach it.
-    (abbreviate-file-name buffer-file-name))
-   ((and (boundp 'dired-directory) dired-directory)
-    (if (stringp dired-directory)
-        dired-directory
-      (car dired-directory)))))
+  (let (file)
+    (setq file (cond
+		((eq major-mode 'Info-mode)
+		 Info-current-file)
+		(buffer-file-name
+		 ;; Abbreviate the path, both so it's shorter and so it's more
+		 ;; portable.  E.g., the user's home dir might be a different
+		 ;; path on different machines, but "~/" will still reach it.
+		 buffer-file-name)
+		((and (boundp 'dired-directory) dired-directory)
+		 (if (stringp dired-directory)
+		     dired-directory
+		   (car dired-directory)))))
+    (and file (abbreviate-file-name file))))
 
 
 (defun bookmark-maybe-load-default-file ()

  reply	other threads:[~2008-11-19 12:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-19  4:27 proposition about bookmark-buffer-file-name in bookmark.el Toru TSUNEYOSHI
2008-11-19  7:37 ` Karl Fogel
2008-11-19 12:32   ` Toru TSUNEYOSHI [this message]
2008-11-19 18:21     ` Karl Fogel
2008-11-20  2:15       ` Toru TSUNEYOSHI
2008-11-20 14:28         ` Stefan Monnier
2008-11-21 18:32         ` Karl Fogel
2008-11-22  3:15           ` Toru TSUNEYOSHI
2008-11-21 19:07 ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BAY121-DAV9FA0731B0A883E44B757AE20D0@phx.gbl \
    --to=t_tuneyosi@hotmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=kfogel@red-bean.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.