From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sebastian Tennant Newsgroups: gmane.emacs.help Subject: Dired - highlight the name of the directory in directory headers Date: Wed, 18 Nov 2020 16:56:24 +0000 Message-ID: <87pn4apps7.fsf@sebyte.me> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4243"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 18 17:57:21 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kfQll-00010W-ND for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 18 Nov 2020 17:57:21 +0100 Original-Received: from localhost ([::1]:35390 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kfQlk-0004m1-P7 for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 18 Nov 2020 11:57:20 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60424) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kfQkv-0004kU-7g for help-gnu-emacs@gnu.org; Wed, 18 Nov 2020 11:56:29 -0500 Original-Received: from forward5-smtp.messagingengine.com ([66.111.4.239]:46019) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kfQkt-0007Mv-45 for help-gnu-emacs@gnu.org; Wed, 18 Nov 2020 11:56:28 -0500 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailforward.nyi.internal (Postfix) with ESMTP id 2D15B1942E27; Wed, 18 Nov 2020 11:56:26 -0500 (EST) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 18 Nov 2020 11:56:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=XHbNYSfn4huhJaW6w9DPggp0fCraD 9Sy1AlbbIkVA+c=; b=NV5HkYbIoGWf1+Ud9qTy7T/UvtJQI0bCAoTDNTiiAJi1H okQSGBU15dx2pMDryya549jgI7DdtPvkeZp1jMq8Tufsc/MAdbmDsqNuIPSL8T8p ygcCYZPuDO0pyrV2CXvkYVCcPS3H04SuFUWXrPQ564BBZBCl6T+Y0e6I/46xXb0a ur70IGNWMvWEwh38tk5Gazt3rdNBvBVLZPnlVTe8W4r1n6h6p4c7wx6t7f9Q5zvd h/akGi9c8vY+tBL++NsPsZPe9pQDoEt6GlJW8/FQgXUhuzOCK+XNDlf3e4cYVbNu fXxDTNIB9c2pBdPIz6slr0QNlJA94vRp7nXv8Bk/w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudefhedgleejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkfgggtgesthdtredttd ertdenucfhrhhomhepufgvsggrshhtihgrnhcuvfgvnhhnrghnthcuoehsughtsehsvggs hihtvgdrmhgvqeenucggtffrrghtthgvrhhnpeffheehgfduffdufeevteektefgudeuhf dvkeevteeutedtieeuhefhhfdtvdehueenucffohhmrghinhepuggrthhtuggsrdhinhhf ohenucfkphepleefrdelfedruddvkedrvdegieenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehsvggshihtvgdorhgvthhurhhnqdhprghthhes fhgrshhtmhgrihhlrdgtohhm X-ME-Proxy: Original-Received: from balor (balor.gnukahvesi.net [93.93.128.246]) by mail.messagingengine.com (Postfix) with ESMTPA id BE1B13064AAE; Wed, 18 Nov 2020 11:56:25 -0500 (EST) Original-Received: from sebyte by balor with local (Exim 4.92) (envelope-from ) id 1kfQkq-0003z4-Vi; Wed, 18 Nov 2020 16:56:24 +0000 Received-SPF: neutral client-ip=66.111.4.239; envelope-from=sebyte+return-path@fastmail.com; helo=forward5-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/18 11:32:26 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_NEUTRAL=0.779 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:125329 Archived-At: Hello all, I thought it would be easy to highlight the name of the directory in directory headers in Dired buffers. For example: /home/bob/Notes: ^^^^^ My first approach was to use font-lock-add-keywords: (font-lock-add-keywords 'dired-mode '("\\([^/]+\\):\n" . (1 'bold))) but try as I might I could not get this to work. I then thought I would add a function to dired-mode-hook: (defun highlight-directory-name-in-headers () (hi-lock-face-buffer "\\([^/]+\\):\n" 'bold 1)) (add-hook 'dired-mode-hook 'highlight-directory-name-in-headers t) but that didn't work either. In the end, I got the mode hook to 'work' by delaying the call to hi-lock-face-buffer: (defun highlight-directory-name-in-headers () (run-at-time 0.1 nil 'hi-lock-face-buffer "\\([^/]+\\):\n" 'bold 1)) but this is an ugly kludge if ever I saw one. How should it be done? sebyte -- Dorothy Annan Trevor Tennant database - DATTdb http://dattdb.info