From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Markus Rost Newsgroups: gmane.emacs.devel Subject: Re: Patch for tex-mode.el (more compatibility with AUCTeX) Date: Mon, 29 Nov 2004 16:08:08 -0500 Message-ID: <200411292108.iATL88EL004187@haifa.math.ias.edu> References: <200411272340.iARNec4N006202@haifa.math.ias.edu> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1101762557 32017 80.91.229.6 (29 Nov 2004 21:09:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 29 Nov 2004 21:09:17 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 29 22:09:11 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CYsli-0005Wk-00 for ; Mon, 29 Nov 2004 22:09:10 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CYsv8-0006kG-6Z for ged-emacs-devel@m.gmane.org; Mon, 29 Nov 2004 16:18:54 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CYsuQ-0006bx-F7 for emacs-devel@gnu.org; Mon, 29 Nov 2004 16:18:10 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CYsuP-0006bR-DA for emacs-devel@gnu.org; Mon, 29 Nov 2004 16:18:09 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CYsuP-0006bM-7j for emacs-devel@gnu.org; Mon, 29 Nov 2004 16:18:09 -0500 Original-Received: from [192.16.204.67] (helo=smtp1.ias.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CYskl-000600-8u; Mon, 29 Nov 2004 16:08:11 -0500 X-IAS: Institute for Advanced Study Original-Received: from yttrium.net.ias.edu (yttrium.net.ias.edu [172.16.12.11]) by smtp1.ias.edu (www.sendmail.org/2003) with SMTP id iATL88vr004692; Mon, 29 Nov 2004 16:08:09 -0500 (EST) Original-Received: from mailhost.math.ias.edu ([172.16.41.5]) by yttrium.net.ias.edu (NAVGW 2.5.2.9) with SMTP id M2004112916080816759 ; Mon, 29 Nov 2004 16:08:08 -0500 Original-Received: from haifa.math.ias.edu (haifa.math.ias.edu [172.16.41.42]) by mailhost.math.ias.edu (8.12.10/8.12.10) with ESMTP id iATL7LqS027826; Mon, 29 Nov 2004 16:07:21 -0500 Original-Received: from haifa.math.ias.edu (localhost.localdomain [127.0.0.1]) by haifa.math.ias.edu (8.12.8/8.12.8) with ESMTP id iATL88Ll004191; Mon, 29 Nov 2004 16:08:08 -0500 Original-Received: (from rost@localhost) by haifa.math.ias.edu (8.12.8/8.12.8/Submit) id iATL88EL004187; Mon, 29 Nov 2004 16:08:08 -0500 Original-To: rms@gnu.org In-reply-to: (message from Richard Stallman on Mon, 29 Nov 2004 01:11:12 -0500) X-Mailer: GNU Emacs 21.3+ X-Home-Page: http://www.math.uni-bielefeld.de/~rost X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:30498 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:30498 > From: Richard Stallman > CC: emacs-devel@gnu.org > Reply-to: rms@gnu.org > Date: Mon, 29 Nov 2004 01:11:12 -0500 > X-Scanned-By: MIMEDefang 2.42 > X-Spam-Level: > > Wouldn't this patch be a more natural way to handle TeX-master = t? Yes, but your patch may perhaps result in an error if buffer-file-name is nil. Below is another version, which is essentially your patch, except for a test for buffer-file-name being non-nil. Let me know whether I should install it. By the way, one could fix my original problem also by just removing the handling of TeX-master completely. Not that I want to suggest that -- with the new patch things should work well. ===Buffer *vc-diff*========================================= Index: tex-mode.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/textmodes/tex-mode.el,v retrieving revision 1.150 diff -c -r1.150 tex-mode.el *** tex-mode.el 25 Oct 2004 20:35:24 -0000 1.150 --- tex-mode.el 29 Nov 2004 19:38:52 -0000 *************** *** 1693,1701 **** (let* ((file (or tex-main-file ;; Compatibility with AUCTeX. (with-no-warnings ! (when (and (boundp 'TeX-master) (stringp TeX-master)) ! (make-local-variable 'tex-main-file) ! (setq tex-main-file TeX-master))) ;; Try to guess the main file. (if (not buffer-file-name) (error "Buffer is not associated with any file") --- 1693,1704 ---- (let* ((file (or tex-main-file ;; Compatibility with AUCTeX. (with-no-warnings ! (when (boundp 'TeX-master) ! (cond ((stringp TeX-master) ! (make-local-variable 'tex-main-file) ! (setq tex-main-file TeX-master)) ! ((and (eq TeX-master t) buffer-file-name) ! (file-relative-name buffer-file-name))))) ;; Try to guess the main file. (if (not buffer-file-name) (error "Buffer is not associated with any file") ============================================================ > > *** tex-mode.el 26 Oct 2004 04:21:48 -0400 1.150 > --- tex-mode.el 28 Nov 2004 16:19:05 -0500 > *************** > *** 1693,1701 **** > (let* ((file (or tex-main-file > ;; Compatibility with AUCTeX. > (with-no-warnings > ! (when (and (boundp 'TeX-master) (stringp TeX-master)) > ! (make-local-variable 'tex-main-file) > ! (setq tex-main-file TeX-master))) > ;; Try to guess the main file. > (if (not buffer-file-name) > (error "Buffer is not associated with any file") > --- 1693,1705 ---- > (let* ((file (or tex-main-file > ;; Compatibility with AUCTeX. > (with-no-warnings > ! (when (boundp 'TeX-master) > ! (if (stringp TeX-master) > ! (progn > ! (make-local-variable 'tex-main-file) > ! (setq tex-main-file TeX-master)) > ! (when (eq TeX-master t) > ! (file-relative-name buffer-file-name))))) > ;; Try to guess the main file. > (if (not buffer-file-name) > (error "Buffer is not associated with any file") >