From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Masatake YAMATO Newsgroups: gmane.emacs.bugs Subject: bug#28685: 25.3; wrong handling ~/.cpp.el Date: Tue, 17 Oct 2017 19:23:03 +0900 (JST) Organization: Red Hat Japan, Inc. Message-ID: <20171017.192303.945206897976012626.yamato@redhat.com> References: <87a80tahdu.fsf@users.sourceforge.net> <83a80tiw2h.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1508235876 23162 195.159.176.226 (17 Oct 2017 10:24:36 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 17 Oct 2017 10:24:36 +0000 (UTC) Cc: 28685@debbugs.gnu.org, npostavs@users.sourceforge.net To: rgm@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 17 12:24:23 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4P2g-0003W9-Lp for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Oct 2017 12:24:10 +0200 Original-Received: from localhost ([::1]:37503 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4P2n-0005cG-Sg for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Oct 2017 06:24:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38422) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4P2d-0005c9-Hq for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2017 06:24:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4P2Y-0002br-QP for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2017 06:24:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36233) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e4P2Y-0002bj-LS for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2017 06:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e4P2Y-0003g1-FI for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2017 06:24:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Masatake YAMATO Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Oct 2017 10:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28685 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 28685-submit@debbugs.gnu.org id=B28685.150823579314071 (code B ref 28685); Tue, 17 Oct 2017 10:24:02 +0000 Original-Received: (at 28685) by debbugs.gnu.org; 17 Oct 2017 10:23:13 +0000 Original-Received: from localhost ([127.0.0.1]:44914 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4P1l-0003et-LL for submit@debbugs.gnu.org; Tue, 17 Oct 2017 06:23:13 -0400 Original-Received: from mx1.redhat.com ([209.132.183.28]:41482) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4P1j-0003ee-1r for 28685@debbugs.gnu.org; Tue, 17 Oct 2017 06:23:11 -0400 Original-Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 53313356E6; Tue, 17 Oct 2017 10:23:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 53313356E6 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=yamato@redhat.com Original-Received: from localhost (dhcp-193-29.nrt.redhat.com [10.64.193.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id 573DC77FEE; Tue, 17 Oct 2017 10:23:04 +0000 (UTC) In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 17 Oct 2017 10:23:05 +0000 (UTC) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:138603 Archived-At: On Sat, 14 Oct 2017 18:11:06 -0400, Glenn Morris wrote: > Eli Zaretskii wrote: > >>> E.g. this entry from NEWS.24: >>> >>> ** More packages look for ~/.emacs.d/ additionally to ~/.. >> >> I'm okay with looking in both places. > > This is what locate-user-emacs-file is for. How about following extra patch? Ideally, ~/.emacs.d/.cpp.el should be ~/.emacs.d/cpp.el. However, I cannot find good way to implement it. commit 765dfed4bd1ea1a3b6d9b51383fa0ec745479cce (HEAD -> cpp-highlight-check) Author: Masatake YAMATO Date: Tue Oct 17 19:20:38 2017 +0900 Put .cpp.el to ~/.emacs.d if possible *lisp/progmodes/cpp.el (cpp-edit-load): Use locate-user-emacs-file instead of specifying "~/" (cpp-edit-save): Ditto. diff --git a/lisp/progmodes/cpp.el b/lisp/progmodes/cpp.el index 3a7dab72b4..0a68a0cf2c 100644 --- a/lisp/progmodes/cpp.el +++ b/lisp/progmodes/cpp.el @@ -576,8 +576,8 @@ cpp-edit-load nil) ((file-readable-p cpp-config-file) (load-file cpp-config-file)) - ((file-readable-p (concat "~/" cpp-config-file)) - (load-file (concat "~/" cpp-config-file)))) + ((file-readable-p (locate-user-emacs-file cpp-config-file)) + (load-file (locate-user-emacs-file cpp-config-file)))) (if (derived-mode-p 'cpp-edit-mode) (cpp-edit-reset))) @@ -588,7 +588,7 @@ cpp-edit-save (with-current-buffer cpp-edit-buffer (let* ((config-file (if (file-writable-p cpp-config-file) cpp-config-file - (concat "~/" cpp-config-file))) + (locate-user-emacs-file cpp-config-file))) (buffer (find-file-noselect config-file)) ) (set-buffer buffer)