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, 03 Oct 2017 20:19:05 +0900 (JST) Organization: Red Hat Japan, Inc. Message-ID: <20171003.201905.799741493914957289.yamato@redhat.com> 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 1507030024 28814 195.159.176.226 (3 Oct 2017 11:27:04 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 3 Oct 2017 11:27:04 +0000 (UTC) To: 28685@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 03 13:26:53 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 1dzLLg-0006YY-2a for geb-bug-gnu-emacs@m.gmane.org; Tue, 03 Oct 2017 13:26:52 +0200 Original-Received: from localhost ([::1]:57897 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzLFK-00080Q-R1 for geb-bug-gnu-emacs@m.gmane.org; Tue, 03 Oct 2017 07:20:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55900) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzLFA-0007wd-1i for bug-gnu-emacs@gnu.org; Tue, 03 Oct 2017 07:20:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dzLF4-0000QB-Vw for bug-gnu-emacs@gnu.org; Tue, 03 Oct 2017 07:20:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36586) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dzLF4-0000Pw-QP for bug-gnu-emacs@gnu.org; Tue, 03 Oct 2017 07:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dzLF4-00049g-L6 for bug-gnu-emacs@gnu.org; Tue, 03 Oct 2017 07:20: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, 03 Oct 2017 11:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 28685 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.150702956615914 (code B ref -1); Tue, 03 Oct 2017 11:20:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 Oct 2017 11:19:26 +0000 Original-Received: from localhost ([127.0.0.1]:45267 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzLET-00048b-E0 for submit@debbugs.gnu.org; Tue, 03 Oct 2017 07:19:25 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36562) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzLER-00048M-Mt for submit@debbugs.gnu.org; Tue, 03 Oct 2017 07:19:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dzLEK-0007fM-GO for submit@debbugs.gnu.org; Tue, 03 Oct 2017 07:19:18 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:44506) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dzLEK-0007eV-Ah for submit@debbugs.gnu.org; Tue, 03 Oct 2017 07:19:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55755) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzLEI-0007qx-AQ for bug-gnu-emacs@gnu.org; Tue, 03 Oct 2017 07:19:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dzLED-0007Lu-A3 for bug-gnu-emacs@gnu.org; Tue, 03 Oct 2017 07:19:14 -0400 Original-Received: from mx1.redhat.com ([209.132.183.28]:46758) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dzLEC-0007Hx-Vy for bug-gnu-emacs@gnu.org; Tue, 03 Oct 2017 07:19:09 -0400 Original-Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DE37D800A8 for ; Tue, 3 Oct 2017 11:19:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DE37D800A8 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.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 72CF160259 for ; Tue, 3 Oct 2017 11:19:06 +0000 (UTC) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 03 Oct 2017 11:19:07 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:137819 Archived-At: cpp.el tries to load ./.cpp.el even when it is not readable. Though it checks ~/.cpp.el can be readable, it still tries to load ./.cpp.el. A patch is attached to the end of this mail. In GNU Emacs 25.3.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.22.19) of 2017-09-12 built on buildvm-08.phx2.fedoraproject.org Windowing system distributor 'Fedora Project', version 11.0.11903000 System Description: Fedora release 26 (Twenty Six) Configured using: 'configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-dbus --with-gif --with-jpeg --with-png --with-rsvg --with-tiff --with-xft --with-xpm --with-x-toolkit=gtk3 --with-gpm=no --with-xwidgets --with-modules build_alias=x86_64-redhat-linux-gnu host_alias=x86_64-redhat-linux-gnu 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' LDFLAGS=-Wl,-z,relro PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GCONF GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 MODULES XWIDGETS Important settings: value of $LC_MONETARY: ja_JP.UTF-8 value of $LC_NUMERIC: ja_JP.UTF-8 value of $LC_TIME: ja_JP.UTF-8 value of $LANG: en_US.utf8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Text Minor modes in effect: diff-auto-refine-mode: t shell-dirtrack-mode: t which-function-mode: t show-paren-mode: t savehist-mode: t winner-mode: t iswitchb-mode: t editorconfig-mode: t tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Recent messages: Undo! [2 times] Mark set [5 times] Saving file /home/yamato/var/emacs/MESSAGE... Wrote /home/yamato/var/emacs/MESSAGE line-move-visual: Beginning of buffer [13 times] Mark set Saving file /home/yamato/var/emacs/MESSAGE... Wrote /home/yamato/var/emacs/MESSAGE Saving file /home/yamato/var/emacs/MESSAGE... Wrote /home/yamato/var/emacs/MESSAGE line-move-visual: Beginning of buffer [7 times] Load-path shadows: /home/yamato/.emacs.d/ioccur hides /home/yamato/.emacs.d/elpa/ioccur-2.4/ioccur /home/yamato/.emacs.d/markdown-mode hides /home/yamato/.emacs.d/elpa/markdown-mode-20160928.932/markdown-mode /home/yamato/.emacs.d/bs hides /usr/share/emacs/25.3/lisp/bs Features: (shadow emacsbug message idna rfc822 mml mml-sec epg mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums bug-reference cpp whitespace go-mode find-file ffap css-mode ruby-mode markdown-mode ewoc eww mm-url gnus gnus-ems nnheader mail-utils url-queue url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util url-parse url-vars mailcap shr dom debug tramp-cache cmake-mode rx nxml-uchnm rng-xsd xsd-regexp rng-cmpct rng-nxml rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap nxml-util nxml-glyph nxml-enc xmltok desktop-entry-mode conf-mode js sgml-mode lookup-entry lookup-content lookup-vse ndtp lookup lookup-types lookup-utils lookup-vars evi evi-mule smerge-mode novice log-view pcvs-util vc-annotate tex-mode latexenc ediff-merg ediff-wind ediff-diff ediff-mult ediff-help ediff-init ediff-util ediff python tramp-sh tramp tramp-compat tramp-loaddefs trampver ucs-normalize format-spec json map rst eieio-opt speedbar sb-image ezimage dframe find-func bat-mode make-mode yaml-mode dabbrev ispell vc pcmpl-unix autoconf autoconf-mode vc-git diff-mode sh-script smie executable rect skk-isearch skk-comp skk-cdb cdb skk-num skk-tankan skk-cursor skk-server skk-cus cus-edit skk skk-emacs skk-macs hl-line shell pcomplete thingatpt tabify man parse-time cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs misearch multi-isearch skk-vars dired-aux zoom-frm frame-cmds frame-fns pp qp network-stream nsm auth-source gnus-util mm-util help-fns mail-prsvr password-cache starttls tls gnutls mew-varsx mew-unix warnings ccc spelunker etags xref project eieio eieio-core assoc ibuf-macs ibuf-ext ibuffer grep srpmix-guess col-highlight vline dee-record scheme edit-string tour stitch vc-dispatcher vc-svn editorconfig-core editorconfig-core-handle editorconfig-fnmatch avoid add-log mew-w3m w3m doc-view subr-x jka-compr image-mode timezone w3m-hist w3m-fb bookmark-w3m w3m-ems wid-edit w3m-ccl w3m-favicon w3m-image w3m-proc w3m-util mew-auth mew-config mew-imap2 mew-imap mew-nntp2 mew-nntp mew-pop mew-smtp mew-ssl mew-ssh mew-net mew-highlight mew-sort mew-fib mew-ext mew-refile mew-demo mew-attach mew-draft mew-message mew-thread mew-virtual mew-summary4 mew-summary3 mew-summary2 mew-summary mew-search mew-pick mew-passwd mew-scan mew-syntax mew-bq mew-smime mew-pgp mew-header mew-exec mew-mark mew-mime mew-edit mew-decode mew-encode mew-cache mew-minibuf mew-complete mew-addrbook mew-local mew-vars3 mew-vars2 mew-vars mew-env mew-mule3 mew-mule mew-gemacs mew-key mew-func mew-blvs mew-const mew mew-ical cal-menu calendar cal-loaddefs browse-url tango-dark-theme which-func imenu paren savehist cus-start cus-load yamato izonmoji-mode ccl dired-tar compile comint ansi-color server winner ring windmove gauche scheme-complete graphviz-dot-mode ioccur cl-seq cl-macs edmacro kmacro wdired noutline outline easy-mmode cl derived dired-x dired iswitchb editorconfig finder-inf info go-mode-autoloads ioccur-autoloads minimap-autoloads register-list-autoloads package epg-config seq byte-opt gv bytecomp byte-compile cl-extra help-mode easymenu cconv cl-loaddefs pcase cl-lib mozc skk-leim time-date mule-util advice skk-setup skk-autoloads tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify dynamic-setting system-font-setting font-render-setting xwidget-internal move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 2902878 333248) (symbols 48 64343 1) (miscs 40 9256 11314) (strings 32 199064 26399) (string-bytes 1 6554129) (vectors 16 87195) (vector-slots 8 2451990 90410) (floats 8 1375 3690) (intervals 56 491991 4413) (buffers 976 519)) commit f8c0c6c11c9cce6429476070bcc550526d534651 (HEAD -> master) Author: Masatake YAMATO Date: Tue Oct 3 20:18:06 2017 +0900 Fix reading and writing cpp-config-file under home directory * lisp/progmodes/cpp.el (cpp-edit-load): load ~/.cpp.el when it is readable. (cpp-edit-save): write to ~/.cpp.el when it is wriable. diff --git a/lisp/progmodes/cpp.el b/lisp/progmodes/cpp.el index 8aaebdde5b..3a7dab72b4 100644 --- a/lisp/progmodes/cpp.el +++ b/lisp/progmodes/cpp.el @@ -577,7 +577,7 @@ You can also use the keyboard accelerators indicated like this: [K]ey." ((file-readable-p cpp-config-file) (load-file cpp-config-file)) ((file-readable-p (concat "~/" cpp-config-file)) - (load-file cpp-config-file))) + (load-file (concat "~/" cpp-config-file)))) (if (derived-mode-p 'cpp-edit-mode) (cpp-edit-reset))) @@ -586,7 +586,11 @@ You can also use the keyboard accelerators indicated like this: [K]ey." (interactive) (require 'pp) (with-current-buffer cpp-edit-buffer - (let ((buffer (find-file-noselect cpp-config-file))) + (let* ((config-file (if (file-writable-p cpp-config-file) + cpp-config-file + (concat "~/" cpp-config-file))) + (buffer (find-file-noselect config-file)) + ) (set-buffer buffer) (erase-buffer) (pp (list 'setq 'cpp-known-face @@ -601,7 +605,7 @@ You can also use the keyboard accelerators indicated like this: [K]ey." (list 'quote cpp-unknown-writable)) buffer) (pp (list 'setq 'cpp-edit-list (list 'quote cpp-edit-list)) buffer) - (write-file cpp-config-file)))) + (write-file config-file)))) (defun cpp-edit-home () "Switch back to original buffer."