From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: don@donarmstrong.com (Emacs bug Tracking System) Newsgroups: gmane.emacs.bugs Subject: bug#1511: marked as done (23.0.60; [PATCH] auto-insert: use expand-file-name rather than "concat".) Date: Mon, 8 Dec 2008 08:40:04 -0800 Message-ID: References: <36366a980812071620y65b31f00h1b07407c42764ade@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----------=_1228754404-18263-0" X-Trace: ger.gmane.org 1228755742 14097 80.91.229.12 (8 Dec 2008 17:02:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 8 Dec 2008 17:02:22 +0000 (UTC) To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 08 18:03:25 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1L9jVb-0002W2-DR for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Dec 2008 18:03:01 +0100 Original-Received: from localhost ([127.0.0.1]:48889 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L9jUQ-0001X9-Jh for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Dec 2008 12:01:46 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L9jJM-0005Dg-CS for bug-gnu-emacs@gnu.org; Mon, 08 Dec 2008 11:50:20 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L9jJL-0005Cz-3M for bug-gnu-emacs@gnu.org; Mon, 08 Dec 2008 11:50:19 -0500 Original-Received: from [199.232.76.173] (port=39158 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L9jJK-0005Ck-An for bug-gnu-emacs@gnu.org; Mon, 08 Dec 2008 11:50:18 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:52848) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L9jJJ-0001mc-FG for bug-gnu-emacs@gnu.org; Mon, 08 Dec 2008 11:50:18 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB8GoEwO021805; Mon, 8 Dec 2008 08:50:15 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id mB8Ge4RS018363; Mon, 8 Dec 2008 08:40:04 -0800 X-Mailer: MIME-tools 5.420 (Entity 5.420) X-Loop: don@donarmstrong.com X-Emacs-PR-Message: closed 1511 X-Emacs-PR-Package: emacs X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:23053 Archived-At: This is a multi-part message in MIME format... ------------=_1228754404-18263-0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Your message dated Mon, 08 Dec 2008 11:31:34 -0500 with message-id and subject line Re: bug#1511: 23.0.60; [PATCH] auto-insert: use expand-fil= e-name rather than "concat". has caused the Emacs bug report #1511, regarding 23.0.60; [PATCH] auto-insert: use expand-file-name rather than "c= oncat". to be marked as done. This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact don@donarmstrong.com immediately.) --=20 1511: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=3D1511 Emacs Bug Tracking System Contact don@donarmstrong.com with problems ------------=_1228754404-18263-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.9 required=4.0 tests=AWL,BAYES_00,FOURLA, IMPRONONCABLE_2,MURPHY_DRUGS_REL8,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 8 Dec 2008 00:20:49 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB80KjSB005900 for ; Sun, 7 Dec 2008 16:20:46 -0800 Received: from mx10.gnu.org ([199.232.76.166]:37442) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1L9Tr9-0008A4-QJ for emacs-pretest-bug@gnu.org; Sun, 07 Dec 2008 19:20:12 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1L9Tre-00039s-VD for emacs-pretest-bug@gnu.org; Sun, 07 Dec 2008 19:20:44 -0500 Received: from wf-out-1314.google.com ([209.85.200.169]:31042) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L9Tre-00039h-06 for emacs-pretest-bug@gnu.org; Sun, 07 Dec 2008 19:20:42 -0500 Received: by wf-out-1314.google.com with SMTP id 28so923641wfc.24 for ; Sun, 07 Dec 2008 16:20:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=ssti4imzUhYsLbZVgvqfo3yCGIPLtgqmSEnwHxTRIOQ=; b=tLDyM+PEEj9d6SwIJgHJ+XnmJO8u/1at68SgqXDC2/CRFAg71Np4TKE5amXtvBy+hK 8KAFoYvZEgIzr2RWnpZFOiRwcowuR8BgwrHDLVYQ1+c94V8uydl4WqqjnLTEw5ch9zy+ 7kEqOYFLLH9A7QmRXKRS0T5EaJO8Yo7EOK7bM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=Y3bBcM3yXw9xQ2N8W6J6P/v9Gr7exUmW+ZDShdSLW78aFLtsG2a6BCjbA/YPOBa1si ubIF6lIeLxqUExfsk1pLWPkTpzRP7XDr2Y5OU9tZLV140Sm7h0annuWqCzpT27DjPe/e XmyyXw33LrBV2vMHpCfYxNrZRp/h0acLWssOo= Received: by 10.142.234.16 with SMTP id g16mr1186057wfh.264.1228695640189; Sun, 07 Dec 2008 16:20:40 -0800 (PST) Received: by 10.142.106.21 with HTTP; Sun, 7 Dec 2008 16:20:40 -0800 (PST) Message-ID: <36366a980812071620y65b31f00h1b07407c42764ade@mail.gmail.com> Date: Sun, 7 Dec 2008 16:20:40 -0800 From: "Eric Hanchrow" To: emacs-pretest-bug@gnu.org Subject: 23.0.60; [PATCH] auto-insert: use expand-file-name rather than "concat". MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Please write in English if possible, because the Emacs maintainers usually do not have translators to read other languages for them. Your bug report will be posted to the emacs-pretest-bug@gnu.org mailing list. Please describe exactly what actions triggered the bug and the precise symptoms of the bug: I put this in my .emacs, and evaluated it: (add-to-list 'auto-insert-alist `(scheme-mode . ,(expand-file-name "~/doodles/plt-scheme/v4-script-template.ss"))) I then visited a non-existent file whose name ended wit ".ss", and noted that it was properly put into scheme-mode -- but it remained empty, whereas I'd wanted to see the contents of v4-script-template.ss. I determined that the auto-insert function was doing nothing when the file name was absolute (but it appeared to do the right thing for relative paths). Anyway, here's the patch that works for me: From 39bd280f55edd84d025b166a799c5a62bd2a6f9a Mon Sep 17 00:00:00 2001 From: Eric Hanchrow Date: Sun, 7 Dec 2008 08:09:24 -0800 Subject: [PATCH] auto-insert: use expand-file-name rather than "concat". --- lisp/autoinsert.el | 52 +++++++++++++++++++++++++++------------------------- 1 files changed, 27 insertions(+), 25 deletions(-) diff --git a/lisp/autoinsert.el b/lisp/autoinsert.el index 92a5f9f..3f555f8 100644 --- a/lisp/autoinsert.el +++ b/lisp/autoinsert.el @@ -343,31 +343,33 @@ Matches the visited file name against the elements of `auto-insert-alist'." ;; Now, if we found something, do it (and action - (if (stringp action) - (file-readable-p (concat auto-insert-directory action)) - t) - (if auto-insert-query - (or (if (eq auto-insert-query 'function) - (eq this-command 'auto-insert)) - (y-or-n-p (format auto-insert-prompt desc))) - t) - (mapc - (lambda (action) - (if (stringp action) - (if (file-readable-p - (setq action (concat auto-insert-directory action))) - (insert-file-contents action)) - (save-window-excursion - ;; make buffer visible before skeleton or function - ;; which might ask the user for something - (switch-to-buffer (current-buffer)) - (if (and (consp action) - (not (eq (car action) 'lambda))) - (skeleton-insert action) - (funcall action))))) - (if (vectorp action) - action - (vector action)))) + (let ((abs-file-name + (and (stringp action) + (expand-file-name action auto-insert-directory)))) + (and + (stringp abs-file-name) + (if auto-insert-query + (or (if (eq auto-insert-query 'function) + (eq this-command 'auto-insert)) + (y-or-n-p (format auto-insert-prompt desc))) + t) + (mapc + (lambda (action) + (if (stringp action) + (if (file-readable-p + (setq action (expand-file-name action auto-insert-directory))) + (insert-file-contents action)) + (save-window-excursion + ;; make buffer visible before skeleton or function + ;; which might ask the user for something + (switch-to-buffer (current-buffer)) + (if (and (consp action) + (not (eq (car action) 'lambda))) + (skeleton-insert action) + (funcall action))))) + (if (vectorp action) + action + (vector abs-file-name)))))) (and (buffer-modified-p) (not (eq this-command 'auto-insert)) (set-buffer-modified-p (eq auto-insert t))))) -- 1.6.1.rc1.35.gae26e If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands: `bt full' and `xbacktrace'. If you would like to further debug the crash, please read the file /usr/local/src/emacs-with-my-tweaks.git/etc/DEBUG for instructions. In GNU Emacs 23.0.60.1 (i686-pc-linux-gnu, GTK+ Version 2.14.4) of 2008-12-06 on enver-laptop Windowing system distributor `The X.Org Foundation', version 11.0.10502000 Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: nil value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default-enable-multibyte-characters: t Major mode: Diff Minor modes in effect: erc-ring-mode: t erc-pcomplete-mode: t erc-netsplit-mode: t erc-button-mode: t erc-fill-mode: t erc-stamp-mode: t erc-autojoin-mode: t erc-track-mode: t erc-match-mode: t erc-services-mode: t erc-networks-mode: t erc-irccontrols-mode: t erc-noncommands-mode: t erc-readonly-mode: t desktop-save-mode: t display-time-mode: t global-auto-revert-mode: t diff-auto-refine-mode: t shell-dirtrack-mode: t tooltip-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: SPC " y o w " M-> M-p C-p C-p C-p C-p M-b M-d M e SPC < n o b o d y @ n o q w h e r e . c o m > M-> M-p C-p C-p C-p C-p M-f M-f C-b \ n M-> M-p C-M-p C-n M-m C-M-k C-M-u C-y C-M-k C-M-p M-1 M-( e x t r a c e t - a l l - f i e l d s C-M-o C-M-u C-M-q M-> M-p C-u C-p M-f M-f C-d C-d C-n M-b M-b M-b C-b C-M-k M-SPC C-f M-d s n r u u r k @ z o t z . o r g M-> C-x b . s s C-g C-x b i d o M-1 C-x $ C-x b s h e c d SPC / u s r l o c / l o c r s r e m - w g i t SPC s h o w C-x 1 C-c C-p M-0 C-l M-> M-p SPC - - i g n o r e - a l l - s p a c e C-c C-p M-0 C-l C-v M-> M-p C-a C-e C-c C-u f o r SPC g i t SPC f o r m a t - p a t h c h SPC H E A D ^ C-p M-x f f a p C-x b i n i C-a C-p M-m C-M-SPC M-w M-x r e p o r t - e m C-x o C-x b C-x b M-x M-p Recent messages: Completed Partially completed Type space to flush; repeat completion command to scroll Completed /usr/local/src/emacs-with-my-tweaks.git Mark set History item: 1 Mark set History item: 1 Mark set byte-code: Command attempted to use minibuffer while in minibuffer ------------=_1228754404-18263-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1511-done) by emacsbugs.donarmstrong.com; 8 Dec 2008 16:31:44 +0000 Received: from ironport2-out.teksavvy.com (ironport2-out.teksavvy.com [206.248.154.182]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB8GVewm016985 for <1511-done@emacsbugs.donarmstrong.com>; Mon, 8 Dec 2008 08:31:42 -0800 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtEEAFfaPElLd+Db/2dsb2JhbACBbM0UgwWBJg X-IronPort-AV: E=Sophos;i="4.33,735,1220241600"; d="scan'208";a="30785816" Received: from 75-119-224-219.dsl.teksavvy.com (HELO pastel.home) ([75.119.224.219]) by ironport2-out.teksavvy.com with ESMTP; 08 Dec 2008 11:31:34 -0500 Received: by pastel.home (Postfix, from userid 20848) id C487C8219; Mon, 8 Dec 2008 11:31:34 -0500 (EST) From: Stefan Monnier To: 1511-done@emacsbugs.donarmstrong.com Subject: Re: bug#1511: 23.0.60; [PATCH] auto-insert: use expand-file-name rather than "concat". Message-ID: References: <36366a980812071620y65b31f00h1b07407c42764ade@mail.gmail.com> Date: Mon, 08 Dec 2008 11:31:34 -0500 In-Reply-To: <36366a980812071620y65b31f00h1b07407c42764ade@mail.gmail.com> (Eric Hanchrow's message of "Sun, 7 Dec 2008 16:20:40 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > I determined that the auto-insert function was doing nothing when the > file name was absolute (but it appeared to do the right thing for > relative paths). Thanks. Should be fixed now. Stefan ------------=_1228754404-18263-0--