all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* modeline should note file gotten-via-symlink
@ 2005-02-21 23:46 David Combs
  2005-02-22  0:05 ` Peter Dyballa
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: David Combs @ 2005-02-21 23:46 UTC (permalink / raw)


>From the dired for .../4msnew:

|   -rw-r--r--   1 dkc      other       4509 Aug 29 18:11 run-tools--16.29.8.smd
|
|   lrwxrwxrwx   1 dkc      other         22 Aug 29 17:56 run-tools.smd -> run-tools--16.29.8.smd

, note that run-tools.smd is a symlink.

"Click" (hit <return>) on it, and you end up with a buffer named
run-tools.smd (the name of the symlink), the buffer's *contents* being the
pointed-to file "run-tools--16.29.8.smd".

Fine and good; nice rms-DWIM, does what I wanted.

However, the *mode-line*, which shows the name of the *symlink*,
"run-tools.smd", gives NO indication that the file I'm *actually* at (or at
least actually looking-at/into), "run-tools--16.29.8.smd", is *via a symlink*.

Would be a helpful reminder, at least for me, if the mode-line also
contained the word "SYMLINK".

(And if gotten-to via a chain of eg three symlinks, then maybe something
like "SYMLINKS3".)

QUESTION: would anyone else reading this post find helpful such a modeline additon?

QUESTION: does such a thing *already* exist?  (If so, where's the most
recent version?

  -------

Related idea, for "*Buffer Menu*":

|  MR Buffer           Size  Mode         File
|  -- ------           ----  ----         ----
|  .....
|     run-tools.smd    4509  Fundamental	/opt6/myexternals/home/dkc/4msnew/run-tools--16.29.8.smd


Note that the buffer's name is run-cuffs.smd, but is actually "at" the file
pointed at by the symlink -- and again, there's no explicit, "in your face"
notice that it's via a symlink.

(As far as the user can tell from the line, he originally (last week, in
this still-running emacs session) did a C-x C-f on "run-tools--16.29.8.smd",
and then did a rename-buffer to the shorter name, and there's no way to
tell.

So, again, some explicit, "in your face" notation might be helpful here too.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: modeline should note file gotten-via-symlink
  2005-02-21 23:46 modeline should note file gotten-via-symlink David Combs
@ 2005-02-22  0:05 ` Peter Dyballa
  2005-02-22  4:45 ` Eli Zaretskii
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Peter Dyballa @ 2005-02-22  0:05 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 22.02.2005 um 00:46 schrieb David Combs:

> QUESTION: would anyone else reading this post find helpful such a 
> modeline additon?

Yes, could be good and valuable features!

--
Greetings

   Pete

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: modeline should note file gotten-via-symlink
  2005-02-21 23:46 modeline should note file gotten-via-symlink David Combs
  2005-02-22  0:05 ` Peter Dyballa
@ 2005-02-22  4:45 ` Eli Zaretskii
  2005-02-22 14:51 ` Stefan Monnier
       [not found] ` <mailman.977.1109049635.32256.help-gnu-emacs@gnu.org>
  3 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2005-02-22  4:45 UTC (permalink / raw)


> From: dkcombs@panix.com (David Combs)
> Date: 21 Feb 2005 18:46:25 -0500
> 
> However, the *mode-line*, which shows the name of the *symlink*,
> "run-tools.smd", gives NO indication that the file I'm *actually* at (or at
> least actually looking-at/into), "run-tools--16.29.8.smd", is *via a symlink*.
> 
> Would be a helpful reminder, at least for me, if the mode-line also
> contained the word "SYMLINK".

Does it help to customize the variable find-file-visit-truename to a
non-nil value?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: modeline should note file gotten-via-symlink
  2005-02-21 23:46 modeline should note file gotten-via-symlink David Combs
  2005-02-22  0:05 ` Peter Dyballa
  2005-02-22  4:45 ` Eli Zaretskii
@ 2005-02-22 14:51 ` Stefan Monnier
  2005-02-23  1:45   ` David Combs
       [not found] ` <mailman.977.1109049635.32256.help-gnu-emacs@gnu.org>
  3 siblings, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2005-02-22 14:51 UTC (permalink / raw)


> "Click" (hit <return>) on it, and you end up with a buffer named
> run-tools.smd (the name of the symlink), the buffer's *contents* being the
> pointed-to file "run-tools--16.29.8.smd".

> Fine and good; nice rms-DWIM, does what I wanted.

This is no rms-DWIM, it's just the way Unix symlinks work.
It's all done in the kernel for you.
This is not to say that Emacs can't do anything about it, of course.


        Stefan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: modeline should note file gotten-via-symlink
  2005-02-22 14:51 ` Stefan Monnier
@ 2005-02-23  1:45   ` David Combs
  0 siblings, 0 replies; 7+ messages in thread
From: David Combs @ 2005-02-23  1:45 UTC (permalink / raw)


In article <87mztw644c.fsf-monnier+gnu.emacs.help@gnu.org>,
Stefan Monnier  <monnier@iro.umontreal.ca> wrote:
>> "Click" (hit <return>) on it, and you end up with a buffer named
>> run-tools.smd (the name of the symlink), the buffer's *contents* being the
>> pointed-to file "run-tools--16.29.8.smd".
>
>> Fine and good; nice rms-DWIM, does what I wanted.
>
>This is no rms-DWIM, it's just the way Unix symlinks work.
>It's all done in the kernel for you.
>This is not to say that Emacs can't do anything about it, of course.
>        Stefan

No, no, that's not what I meant.

It was that *in general*, *throughout* emacs, I experience lots
of DWIM, and I think it's all *brilliantly* done.

Like the default-actions that are taken when you don't
specify a command-arg, for instance.

  C-x b    is pretty good about choosing the buffer I want.

 or when you take an action of some kind, that maybe
  seems ambiguous as what the effect will be,
  and what ends up happening turns out to be just
  what I wanted -- even though I might not have
  known it beforehand!

Lots and lots of brainpower have gotten into emacs,
from probably hundreds of very clever people (each of
whom actually used the product many hours *each day* --
so unlike at a commercial software house!), over
*many, many* years (what, since '75 or so?).

Anyway, just my opinion.

David

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: modeline should note file gotten-via-symlink
       [not found] ` <mailman.977.1109049635.32256.help-gnu-emacs@gnu.org>
@ 2005-02-23  1:52   ` David Combs
  2005-02-24 16:54     ` Kevin Rodgers
  0 siblings, 1 reply; 7+ messages in thread
From: David Combs @ 2005-02-23  1:52 UTC (permalink / raw)


In article <mailman.977.1109049635.32256.help-gnu-emacs@gnu.org>,
Eli Zaretskii <eliz@gnu.org> wrote:
>
>Does it help to customize the variable find-file-visit-truename to a
>non-nil value?

Not sure that's what I want.

What I really want to know is that I *arrived* there
via a *SYMLINK*  --  maybe shouted out at me in
uppercase or something!

So often, for me at least, if I've gotten to some file
via a symlink -- hey, something's *wrong*.

So, for me, anyway, some (optionally *loud*!) mark or word
or other indication *on the buffer-name*, both in
*Buffer List* and in the mode-line too.

Again, LOUD -- since for me getting to some file via
a symlink is really unusual, and for sure I want
to know about it -- and be reminded of it each time
I deal with that file (buffer).

Comments, anyone?

David

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: modeline should note file gotten-via-symlink
  2005-02-23  1:52   ` David Combs
@ 2005-02-24 16:54     ` Kevin Rodgers
  0 siblings, 0 replies; 7+ messages in thread
From: Kevin Rodgers @ 2005-02-24 16:54 UTC (permalink / raw)


David Combs wrote:
 > What I really want to know is that I *arrived* there
 > via a *SYMLINK*  --  maybe shouted out at me in
 > uppercase or something!
 >
 > So often, for me at least, if I've gotten to some file
 > via a symlink -- hey, something's *wrong*.
 >
 > So, for me, anyway, some (optionally *loud*!) mark or word
 > or other indication *on the buffer-name*, both in
 > *Buffer List* and in the mode-line too.
 >
 > Again, LOUD -- since for me getting to some file via
 > a symlink is really unusual, and for sure I want
 > to know about it -- and be reminded of it each time
 > I deal with that file (buffer).

I don't know what to do about the *Buffer List*, but here's a start:

;;; symlink-phobia-mode.el --- Indicate files visited via symbolic links

(defvar symlink-phobia-mode-indicator
   (concat " " (propertize "SymLink" 'face 'font-lock-warning-face)))

(define-minor-mode symlink-phobia-mode
   "Minor mode to indicate when the visited file name is a symbolic link.
It also indicates when the file name's directory includes any symbolic 
links."
   nil (:eval symlink-phobia-mode-indicator) nil
   (require 'font-lock))

(defun turn-on-symlink-phobia-mode ()
   "Turn on `symlink-phobia-mode'."
   (when (or (file-symlink-p buffer-file-name)
             (not (equal buffer-file-name buffer-file-truename)))
     (symlink-phobia-mode 1)))

(add-hook 'find-file-hooks 'turn-on-symlink-phobia-mode)
(add-hook 'find-file-not-found-hooks 'turn-on-symlink-phobia-mode)

(provide 'symlink-phobia-mode)

;;; symlink-phobia-mode.el ends here

-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-02-24 16:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-21 23:46 modeline should note file gotten-via-symlink David Combs
2005-02-22  0:05 ` Peter Dyballa
2005-02-22  4:45 ` Eli Zaretskii
2005-02-22 14:51 ` Stefan Monnier
2005-02-23  1:45   ` David Combs
     [not found] ` <mailman.977.1109049635.32256.help-gnu-emacs@gnu.org>
2005-02-23  1:52   ` David Combs
2005-02-24 16:54     ` Kevin Rodgers

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.