From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: tilde in dired default-directory but not elsewhere Date: Wed, 09 Jul 2014 23:14:49 +0200 Message-ID: <87y4w2xmie.fsf@web.de> References: <87fvickfy2.fsf@debian.uxu> <874myqqvfn.fsf@debian.uxu> <87fviao1a1.fsf@debian.uxu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1404940559 10017 80.91.229.3 (9 Jul 2014 21:15:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 9 Jul 2014 21:15:59 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 09 23:15:52 2014 Return-path: Envelope-to: geh-help-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 1X4zDS-0002Y9-8N for geh-help-gnu-emacs@m.gmane.org; Wed, 09 Jul 2014 23:15:50 +0200 Original-Received: from localhost ([::1]:33802 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4zDR-0005wE-P8 for geh-help-gnu-emacs@m.gmane.org; Wed, 09 Jul 2014 17:15:49 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47294) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4zCq-0005tq-Iy for help-gnu-emacs@gnu.org; Wed, 09 Jul 2014 17:15:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X4zCj-0004dP-VN for help-gnu-emacs@gnu.org; Wed, 09 Jul 2014 17:15:12 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:59725) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4zCj-0004bV-Lr for help-gnu-emacs@gnu.org; Wed, 09 Jul 2014 17:15:05 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1X4zCh-000205-Re for help-gnu-emacs@gnu.org; Wed, 09 Jul 2014 23:15:03 +0200 Original-Received: from dslb-094-217-127-201.pools.arcor-ip.net ([94.217.127.201]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 09 Jul 2014 23:15:03 +0200 Original-Received: from michael_heerdegen by dslb-094-217-127-201.pools.arcor-ip.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 09 Jul 2014 23:15:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 34 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: dslb-094-217-127-201.pools.arcor-ip.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.92 (gnu/linux) Cancel-Lock: sha1:mvSeeX8Oa+zIwQW4OTiBcMR9TJE= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:98604 Archived-At: Emanuel Berg writes: > (setq column-number-mode nil) > (setq line-number-mode nil) > (defvar show-modified t) > (defvar show-path t) > (defvar show-modes nil) > > (setq-default mode-line-format > `(" " > (show-modified mode-line-modified) > " " > (show-path (:eval (abbreviate-file-name (buffer-file-name)) )) > " " > (show-modes mode-line-modes) > (line-number-mode "[%l] ") > (column-number-mode "{%c}") > )) Looks like a reasonable approach. Be careful with errors from :eval expressions, e.g. (:eval (abbreviate-file-name (buffer-file-name)) ) will give you annoying error messages when redisplay is performed when (buffer-file-name) yields nil. Of course you can ensure that show-path is always nil in this case ... but (:eval (and buffer-file-name (abbreviate-file-name buffer-file-name))) is probably safer. Michael.