Article View: gnu.emacs.bug
Article #98302bug fix to c++-mode.el
From: Gary Oberbrunner
Date: Thu, 10 Oct 1991 19:09
Date: Thu, 10 Oct 1991 19:09
53 lines
2734 bytes
2734 bytes
Here's a patch to c++-mode.el that makes all the c++-mode variables that
are likely to interfere with other modes buffer-local. This fixes a
problem I was having where indent-line-function was being globally set to
c++-indent-line, even (for instance) in mail buffers, and causing bizarre
auto-fill behavior.
-- Gary Oberbrunner
=============================================================================
diff -c c++-mode.el.~3~ c++-mode.el
*** c++-mode.el.~3~ Thu May 30 15:50:11 1991
--- c++-mode.el Thu Oct 10 15:04:34 1991
***************
*** 4,11 ****
;; Done by fairly faithful modification of:
;; c-mode.el, Copyright (C) 1985 Richard M. Stallman.
;;
! ;; Last modified on Wed Jan 23 20:21:34 1991 by weikart
;;
;; Jan, 1991 (Chris Weikart, weikart@prl.dec.com)
;; In function calculate-c++-indent, added check for adding
;; c-continued-brace-offset after c-continued-statement-offset
--- 4,15 ----
;; Done by fairly faithful modification of:
;; c-mode.el, Copyright (C) 1985 Richard M. Stallman.
;;
! ;; Last modified on Thu Oct 10 1991 by garyo
;;
+ ;; Oct, 1991 (Gary Oberbrunner, garyo@think.com)
+ ;; In function c++-mode, made all local variables buffer-local to
+ ;; avoid changing variable values in other buffers.
+ ;;
;; Jan, 1991 (Chris Weikart, weikart@prl.dec.com)
;; In function calculate-c++-indent, added check for adding
;; c-continued-brace-offset after c-continued-statement-offset
***************
*** 199,204 ****
--- 203,216 ----
(kill-all-local-variables)
(use-local-map c++-mode-map)
(set-syntax-table c++-mode-syntax-table)
+ (make-local-variable 'mode-name)
+ (make-local-variable 'indent-line-function)
+ (make-local-variable 'comment-start)
+ (make-local-variable 'comment-end)
+ (make-local-variable 'comment-column)
+ (make-local-variable 'comment-start-skip)
+ (make-local-variable 'comment-indent-hook)
+ (make-local-variable 'local-abbrev-table)
(setq major-mode 'c++-mode
mode-name "C++"
indent-line-function 'c++-indent-line
Technical Details
Message-ID:
<9110101909.AA14472@prometheus.think.com>Path:
arc1-ca.pugleaf.net!gmdzi!unido!fauern!ira.uka.de!sol.ctr.columbia.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!think.com!garyoShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb2f1,fabcba7dfbfd84e0,start X-Google-Attributes: gidfb2f1,public X-Google-ArrivalTime: 1991-10-10 12:09:29 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!fauern!ira.uka.de!sol.ctr.columbia.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!think.com!garyo From: garyo@think.com (Gary Oberbrunner) Newsgroups: gnu.emacs.bug Subject: bug fix to c++-mode.el Message-ID: <9110101909.AA14472@prometheus.think.com> Date: 10 Oct 91 19:09:29 GMT Sender: gnulists@ai.mit.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 53 Approved: bug-gnu-emacs@prep.ai.mit.edu