From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Bob" Newsgroups: gmane.emacs.bugs Subject: bug#5570: Emacs 23.1.91.1 C++ mode "ESC C-q" and TAB indenting issue. Date: Wed, 17 Feb 2010 08:40:36 -0800 Message-ID: <000301caafef$f64d3520$e2e79f60$@net> References: <000301caac36$0fc0b760$2f422620$@net> <87pr494md5.fsf@stupidchicken.com> <000e01caad1e$dcbfc560$963f5020$@net> <876360s8rw.fsf@stupidchicken.com> <20100214201006.GA6169@muc.de> <000001caae62$638af6c0$2aa0e440$@net> <20100216163923.GB3456@muc.de> <000301caaf36$d5f86100$81e92300$@net> <20100217094652.GC2392@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0004_01CAAFAC.E829F520" X-Trace: ger.gmane.org 1266425581 10513 80.91.229.12 (17 Feb 2010 16:53:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 17 Feb 2010 16:53:01 +0000 (UTC) Cc: 'Chong Yidong' , 5570@debbugs.gnu.org To: "'Alan Mackenzie'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Feb 17 17:52:59 2010 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.69) (envelope-from ) id 1Nhn90-0008NL-Jc for geb-bug-gnu-emacs@m.gmane.org; Wed, 17 Feb 2010 17:52:59 +0100 Original-Received: from localhost ([127.0.0.1]:54550 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nhn90-0004aO-5v for geb-bug-gnu-emacs@m.gmane.org; Wed, 17 Feb 2010 11:52:58 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nhn8t-0004YH-QW for bug-gnu-emacs@gnu.org; Wed, 17 Feb 2010 11:52:51 -0500 Original-Received: from [140.186.70.92] (port=50431 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nhn8s-0004Xh-Qf for bug-gnu-emacs@gnu.org; Wed, 17 Feb 2010 11:52:51 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nhn8q-00051U-Fm for bug-gnu-emacs@gnu.org; Wed, 17 Feb 2010 11:52:50 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36656) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nhn8q-00051M-5L for bug-gnu-emacs@gnu.org; Wed, 17 Feb 2010 11:52:48 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NhmxS-0005X2-3E; Wed, 17 Feb 2010 11:41:02 -0500 X-Loop: bug-gnu-emacs@gnu.org Resent-From: "Bob" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Feb 2010 16:41:02 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: followup 5570 X-Emacs-PR-Package: emacs,cc-mode X-Emacs-PR-Keywords: Original-Received: via spool by 5570-submit@debbugs.gnu.org id=B5570.126642483821250 (code B ref 5570); Wed, 17 Feb 2010 16:41:02 +0000 Original-Received: (at 5570) by debbugs.gnu.org; 17 Feb 2010 16:40:38 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nhmx4-0005Wh-8J for submit@debbugs.gnu.org; Wed, 17 Feb 2010 11:40:38 -0500 Original-Received: from qmta05.emeryville.ca.mail.comcast.net ([76.96.30.48]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nhmx2-0005WZ-Nz for 5570@debbugs.gnu.org; Wed, 17 Feb 2010 11:40:37 -0500 Original-Received: from omta16.emeryville.ca.mail.comcast.net ([76.96.30.72]) by qmta05.emeryville.ca.mail.comcast.net with comcast id j1ii1d0011ZMdJ4A54gYlP; Wed, 17 Feb 2010 16:40:32 +0000 Original-Received: from Cache ([71.202.16.94]) by omta16.emeryville.ca.mail.comcast.net with comcast id j4id1d00221mHQP8c4ijog; Wed, 17 Feb 2010 16:42:49 +0000 In-Reply-To: <20100217094652.GC2392@muc.de> X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcqvtSBXMSmisxwESJOoYruD+NFUvQAN/hEg Content-Language: en-us X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 17 Feb 2010 11:41:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , 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:35149 Archived-At: This is a multi-part message in MIME format. ------=_NextPart_000_0004_01CAAFAC.E829F520 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Alan, Attached is "Foo.cpp" and "dribble" (if I did it correctly, dribble recorded what I typed). It illustrates a case where indentation is one level deeper than it should be. (The other case we've been working on is one level shallower than it should be). Maybe they are related? visit-file "Foo.cpp", note indentation for "class Bar" is too deep. Now, TAB on the "class Bar" line the indentation corrects. If you reconstruct the file from "dribble" you should see TAB on the "class Bar" line incorrectly indents too deep. My ".emacs" file sets indentation to 2 spaces. I would guess there is an issue where the default (I think 4 spaces) is being used instead of my setting. I've also attached my ".emacs" file as "emacs_init" (Outlook doesn't attach files without a file-name). Please excuse the accumulation of junk in it from many years of emacs use and recommendations obtained from internet sites. Bob Foo.cpp: ---------------------------------------- template< class Bar, int _depth = -1 > class Foo; template< int _depth = -1 > class Foo { }; ----------------------------------------- ------=_NextPart_000_0004_01CAAFAC.E829F520 Content-Type: application/octet-stream; name="dribble" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="dribble" class Foo=01=0A= =05=0A= {}=10;=10=10=10=10template<=0A= >=10=05=0A= int _depth =3D -1=01=10=01 = 0x4000020=0E=0E=0E=0Ew=10=10=10=10=19=10=05;=10=10=10=10=05=0A= class = Bar,=0E=01=0E=01=0E=01=0E=0E=0E=10=10=10=10=10=10=18=13=18=03yes ------=_NextPart_000_0004_01CAAFAC.E829F520 Content-Type: text/plain; name="Foo.cpp" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="Foo.cpp" template< class Bar, int _depth = -1 > class Foo; template< int _depth = -1 > class Foo { }; ------=_NextPart_000_0004_01CAAFAC.E829F520 Content-Type: application/octet-stream; name="emacs_init" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="emacs_init" ; To see ^M or write the file without ^M=0A= ; M-X set-variable=0A= ; inhibit-eol-conversion=0A= ; t=0A= =0A= ;(set-face-font default "Lucida Console")=0A= ;(set-default-font "Lucida Console")=0A= =0A= (setenv "PATH" (concat "c:/cygwin/bin;" (getenv "PATH")))=0A= (setq exec-path (cons "c:/cygwin/bin/" exec-path))=0A= ; Set emacs path in ".bashrc"=0A= ; emacs 22.3 & 23.1 complains=0A= ;(require 'cygwin-mount)=0A= ;(cygwin-mount-activate)=0A= =0A= ; Replace DOS shell with Cygwin Bash Shell =0A= =0A= (add-hook 'comint-output-filter-functions=0A= 'shell-strip-ctrl-m nil t)=0A= (add-hook 'comint-output-filter-functions=0A= 'comint-watch-for-password-prompt nil t)=0A= (setq explicit-shell-file-name "bash.exe")=0A= ;; For subprocesses invoked via the shell=0A= ;; (e.g., "shell -c command")=0A= (setq shell-file-name explicit-shell-file-name)=0A= =0A= =0A= ; Key Binding for Previous Commands =0A= ; Some people like to use the up and down arrow keys to traverse through = the previous commands. Here is the way to bind the keys. =0A= =0A= (add-hook 'shell-mode-hook 'n-shell-mode-hook)=0A= (defun n-shell-mode-hook ()=0A= "12Jan2002 - bob, shell mode customizations."=0A= (local-set-key '[up] 'comint-previous-input)=0A= (local-set-key '[down] 'comint-next-input)=0A= (local-set-key '[(shift tab)] 'comint-next-matching-input-from-input)=0A= )=0A= =0A= ; Gzip and Gunzip =0A= ;When viewing files using the Emacs dired utility, press Z should = compress or uncompress a file. Since Cygwin is equiped with the gzip = utility, you should be able to get this function working on your Windows = Gnu Emacs. The lisp statement you need in your .emacs file is =0A= =0A= (setq archive-zip-use-pkzip nil)=0A= =0A= =0A= ;=0A= ; make searches case sensitive=0A= ;=0A= (setq default-case-fold-search nil)=0A= (setq-default case-fold-search nil)=0A= =0A= ;(setq auto-mode-list '("\\.d$" . c-mode))=0A= =0A= ; Enter c++ mode for .h files on windows - even though the file ends=0A= ; in .H emacs seems to think it's a little h and otherwise enters c mode=0A= (setq auto-mode-alist (cons '("\\.h$" . c++-mode) auto-mode-alist))=0A= =0A= ; C customizing=0A= ; Note these constants enforce the location of {}'s and indentation.=0A= ;=0A= ; C-h i Indentation Functions=0A= (require 'cc-mode)=0A= (add-hook `c-mode-common-hook (lambda () (c-toggle-auto-state 1)))=0A= ;(add-hook `c-mode-common-hook (lambda () (c-toggle-hungry-state 1)))=0A= ; left '{' not indented=0A= (c-set-offset 'substatement-open 0)=0A= ; c-lineup-multi-inher=0A= (c-set-offset 'inher-cont 0)=0A= ; c-lineup-streamop=0A= (c-set-offset 'stream-op 0)=0A= ; c-lineup-arglist=0A= (c-set-offset 'arglist-cont-nonempty 0)=0A= ; c-lineup-arglist=0A= ;(c-set-offset 'arglist-intro 0)=0A= ;(c-set-offset 'arglist-close 0)=0A= ; c-lineup-math=0A= (c-set-offset 'statement-cont 0)=0A= ; does auto indentation, like C-n=0A= ;(define-key c-mode-base-map "\C-m" 'c-context-line-break)=0A= ; syntax coloring=0A= (global-font-lock-mode 1)=0A= =0A= ;(setq c-auto-newline t)=0A= (setq c-tab-always-indent nil)=0A= ;(setq c-indent-level 4)=0A= ;(setq c-continued-statement-offset 4)=0A= ;(setq c-brace-offset -4)=0A= ;(setq c-brace-imaginary-offset 0)=0A= ;(setq c-argdecl-indent 2)=0A= ;(setq c-label-offset -4)=0A= ;(setq comment-multi-line t)=0A= ;(setq comment-start-skip "/\\*+[ \\n\\t]*")=0A= ;(setq comment-start "/*")=0A= ;(setq comment-end "*/")=0A= =0A= ; Matching '{' '}' , '<' '>', '[' ']' are hilighted=0A= (show-paren-mode)=0A= =0A= ;=0A= ; compilation command=0A= ;=0A= ;(setq compile-command "make" )=0A= =0A= ;=0A= ; prevent deletion of auto saved files when the file is written=0A= ;=0A= (setq delete-auto-save-files t)=0A= =0A= ;=0A= ; allow recursive use of minibuffers=0A= ;=0A= (setq enable-recursive-minibuffers t)=0A= =0A= ;=0A= ; establish search paths to look for for programs=0A= ;=0A= ;(setq exec-path '("." "/usr/local/bin" "/usr/ucb" "/usr/bin" "/bin" = "/mimi/devel/bin" "/mimi/emacs/etc"))=0A= =0A= ;=0A= ; establish the imagen printer as the one to default to=0A= ;=0A= ;(setq lpr-switches "-Pim")=0A= =0A= ;=0A= ; Regexp used by Newline command in shell mode to match subshell prompts.=0A= ;=0A= ;(setq shell-prompt-pattern "^.\.[0-9]*[0-9]>")=0A= =0A= ;=0A= ; Let emacs know about my P and p macros=0A= ;=0A= ;(setq shell-pushd-regexp "pushd\\|p")=0A= ;(setq shell-popd-regexp "popd")=0A= ;=0A= =0A= ;=0A= ; Rebind ESC-r (move-to-window-line) to replace-string=0A= ;=0A= (global-unset-key "\er")=0A= (global-set-key "\er" 'replace-string)=0A= =0A= ; Get rid of the tool bar icons which take up screen space by toggleing=0A= (tool-bar-mode)=0A= =0A= ; Choose visible flicker instead of auditable bell rings=0A= ;(setq visible-bell t)=0A= ; Or just silence the bell entirely=0A= (set-message-beep 'silent)=0A= =0A= ; See http://www.emacswiki.org/emacs/PrintingPackage#toc5=0A= ; See printing.el=0A= ; Printer must be shared on CACHE=0A= (setq printer-name "//CACHE/HP Photosmart C7200 series")=0A= ;(setq printer-name "D:/Bob/PrintFile.ps") ; print postscript to a file=0A= (require 'printing) ; load printing package=0A= (setq pr-gv-command "c:/Program Files/Ghostgum/gsview/gsview64.exe")=0A= (setq pr-gs-command "c:/Program Files/gs/gs8.64/bin/gswin32.exe")=0A= (setq pr-print-using-ghostscript t) ; C7280 is not a postscript printer=0A= (setq pr-faces-p t) ; print colors, fonts etc.=0A= (pr-update-menus t) ; update now printer and utility menus=0A= =0A= =0A= ; Default scrolling of 5 lines at a time is too much. This sets it to 1 = line=0A= (setq mouse-wheel-scroll-amount '(1 ((shift) . 1) ((control) . nil)))=0A= (setq mouse-wheel-progressive-speed nil)=0A= =0A= ;=0A= ; Bind 'goto-line'=0A= ;=0A= (global-unset-key "\C-x\C-l")=0A= (global-set-key "\C-x\C-l" 'goto-line)=0A= =0A= (global-set-key [f2] 'grep)=0A= (global-set-key [f3] 'tags-search)=0A= =0A= ;=0A= ; Bind 'query-replace-regexp'=0A= ;=0A= (global-unset-key "\e$")=0A= (global-set-key "\e$" 'query-replace-regexp)=0A= (global-unset-key "\ee")=0A= (global-set-key "\ee" 'replace-regexp)=0A= =0A= ;=0A= ; These re-maps are done to allow xon/xoff=0A= ;=0A= ;(global-unset-key "\C-s")=0A= ;(global-set-key "\es" 'isearch-forward)=0A= ;(global-unset-key "\C-q")=0A= ;(global-unset-key "\eq")=0A= ;(global-set-key "\eq" 'quoted-insert)=0A= =0A= ;(load-file "/usr/local/lib/emacs/19.19/lisp/hilit19.el")=0A= ; (cond (window-system=0A= ; (setq hilit-mode-enable-list '(not text-mode)=0A= ; hilit-auto-highlight-maxout 150000=0A= ; hilit-background-mode 'light=0A= ; hilit-inhibit-hooks nil=0A= ; hilit-inhibit-rebinding nil)=0A= ; =0A= ; (require 'hilit19)=0A= ; ))=0A= =0A= =0A= ;(setq explicit-shell-file-name "C:/Program Files/Hamilton = Shell/bin/csh.exe")=0A= =0A= ;(load-file "d:/src/cooksrc/database/emacs-setup.el")=0A= ;(global-set-key "\ep" 'cooksrc-file-preamble)=0A= =0A= =0A= ;=0A= ; Easy mark.=0A= ;=0A= ;(global-set-key "\C- " 'set-mark-command)=0A= =0A= ;=0A= ; Easy way to clear screen and enter shell command=0A= ;=0A= ;(global-set-key "\e\r" 'cr-top)=0A= =0A= ;=0A= ; cr-top and freeze screen=0A= ;=0A= ;(global-set-key "\C-x\r" 'cr-top-freeze)=0A= =0A= ;(transient-mark-mode nil)=0A= ;(setq vc-make-backup-files 1)=0A= ;(setq vc-mistrust-permissions nil)=0A= =0A= ;=0A= ; Region hilite when mark is active=0A= ;=0A= (transient-mark-mode t)=0A= =0A= ;(setq shell-file-name "c:/cygwin/bin/bash")=0A= ;(setq explicit-shell-file-name "c:/cygwin/bin/bash")=0A= (shell)=0A= ;(eshell)=0A= ;(eshell-command-result "rm -f BROWSE; ebrowse *.h *.cpp *.xml")=0A= ;(shell-command "rm -f BROWSE; ebrowse smt2/maxflowsttest.cpp *.y *.l = *.cpp *.xml")=0A= ;(rename-buffer "sh-cook")=0A= ;(shell-command "cd d:/bob")=0A= ;(shell)=0A= ;(rename-buffer "sh-endogLib")=0A= ;(shell-command "cd d:/endogLib; rm -f BROWSE; ebrowse */*.h")=0A= ;(shell-process-cd "d:/endogLib")=0A= ;(eshell)=0A= ;(rename-buffer "sh-endogLib")=0A= ;(make-frame-command)=0A= ;(find-file "BROWSE")=0A= ;(global-set-key "\C-x4." 'ebrowse-tags-find-definition-other-window)=0A= ;(global-set-key "\C-x." 'ebrowse-tags-find-definition)=0A= ;(global-set-key "=1B," 'ebrowse-tags-loop-continue)=0A= =0A= =0A= (put 'upcase-region 'disabled nil)=0A= =0A= (put 'downcase-region 'disabled nil)=0A= =0A= ------=_NextPart_000_0004_01CAAFAC.E829F520--