From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#17064: 24.3.50; Enhancement request: dired: fontification of symlinks Date: Sat, 22 Mar 2014 00:34:01 +0100 Message-ID: <87siqb6s9i.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1395444913 20639 80.91.229.3 (21 Mar 2014 23:35:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 21 Mar 2014 23:35:13 +0000 (UTC) To: 17064@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 22 00:35:22 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WR8y9-00060R-Ls for geb-bug-gnu-emacs@m.gmane.org; Sat, 22 Mar 2014 00:35:21 +0100 Original-Received: from localhost ([::1]:55080 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WR8y9-0001MS-9C for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 Mar 2014 19:35:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58098) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WR8xy-0000zJ-Gq for bug-gnu-emacs@gnu.org; Fri, 21 Mar 2014 19:35:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WR8xr-0007d2-Cg for bug-gnu-emacs@gnu.org; Fri, 21 Mar 2014 19:35:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42827) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WR8xr-0007bC-9f for bug-gnu-emacs@gnu.org; Fri, 21 Mar 2014 19:35:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WR8xq-0004yj-Pd for bug-gnu-emacs@gnu.org; Fri, 21 Mar 2014 19:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Mar 2014 23:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 17064 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.139544489319117 (code B ref -1); Fri, 21 Mar 2014 23:35:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 21 Mar 2014 23:34:53 +0000 Original-Received: from localhost ([127.0.0.1]:44009 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WR8xg-0004yG-R9 for submit@debbugs.gnu.org; Fri, 21 Mar 2014 19:34:53 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56128) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WR8xf-0004y9-Dy for submit@debbugs.gnu.org; Fri, 21 Mar 2014 19:34:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WR8xX-0007Om-Ud for submit@debbugs.gnu.org; Fri, 21 Mar 2014 19:34:51 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:50550) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WR8xX-0007Oi-ST for submit@debbugs.gnu.org; Fri, 21 Mar 2014 19:34:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57659) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WR8xR-0000W3-Nj for bug-gnu-emacs@gnu.org; Fri, 21 Mar 2014 19:34:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WR8xL-0007Hx-Ig for bug-gnu-emacs@gnu.org; Fri, 21 Mar 2014 19:34:37 -0400 Original-Received: from mout.web.de ([212.227.15.4]:50630) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WR8xL-0007HK-9f for bug-gnu-emacs@gnu.org; Fri, 21 Mar 2014 19:34:31 -0400 Original-Received: from drachen.dragon ([90.186.94.218]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0Lpw63-1X4LOW0Dgt-00fhqL for ; Sat, 22 Mar 2014 00:34:29 +0100 X-Provags-ID: V03:K0:awZaKDJCSj3ETzCFwgyeOateEVc6+1ZNF+do/B8kqCZUJUrCLzc twgDCYeaP1ijOrkC+HfZdUWo6JaUcqDXcGaxp7JcfZpupDSTZFrt1B6HSM4VMlJ/yKN8Xe1 tLXRJwbS/5mNVfluVCIi2UE83Ki71MOpdKvFqqcvW0f7B0ly48ooVsqmpk4QZ+G93jyWP1M F/egBLcEKs9heEW5s5+fQ== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org 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 Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:87126 Archived-At: Hi, in dired, symlinks look like symlink -> target where the whole thing is fontified with dired-symlink-face. But I already know from the -> that I have a symlink, it would be more useful to know whether TARGET is a directory, which is what I normally see for non symlink files in dired by fontification with dired-directory-face. My proposal: fontify only the first part "symlink ->" with dired-symlink-face. Fontify "target" according to its truename type. I'm no expert for font lock, so I don't send a patch but just post the code I use in my config: --8<---------------cut here---------------start------------->8--- (cl-callf2 cl-remove dired-re-sym dired-font-lock-keywords :key #'car) (cl-callf nconc dired-font-lock-keywords `((,dired-re-sym ((lambda (end) (when (let ((file (dired-file-name-at-point))) (file-directory-p (file-truename file))) (search-forward-regexp "\\(.+-> ?\\)\\(.+\\)" end t))) (dired-move-to-filename) nil (1 dired-symlink-face) (2 dired-directory-face))) (,dired-re-sym ((lambda (end) (when (let ((file (dired-file-name-at-point))) (file-regular-p (file-truename file))) (search-forward-regexp "\\(.+-> ?\\)\\(.+\\)" end t))) (dired-move-to-filename) nil (1 dired-symlink-face) (2 'default))))) --8<---------------cut here---------------end--------------->8--- Or could this have any bad side effects? Is it maybe too heavy to call `file-truename'? Thanks, Michael. In GNU Emacs 24.3.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.7) of 2014-03-14 on drachen Windowing system distributor `The X.Org Foundation', version 11.0.11500000 System Description: Debian GNU/Linux testing (jessie) Important settings: value of $LC_ALL: de_DE.utf8 value of $LC_COLLATE: C value of $LC_TIME: C value of $LANG: de_DE.utf8 locale-coding-system: utf-8-unix Major mode: Emacs-Lisp