all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: modeline should note file gotten-via-symlink
Date: Thu, 24 Feb 2005 09:54:59 -0700	[thread overview]
Message-ID: <386f79F5le78uU1@individual.net> (raw)
In-Reply-To: <cvgnk1$2a2$1@reader2.panix.com>

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

      reply	other threads:[~2005-02-24 16:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

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=386f79F5le78uU1@individual.net \
    --to=ihs_4664@yahoo.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.