From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: ctypes.el is stupid (by default) Date: Thu, 29 Dec 2005 12:34:32 -0700 Message-ID: References: <1135232276.410888.123020@f14g2000cwb.googlegroups.com> <1135755335.488553.158530@o13g2000cwo.googlegroups.com> <1135789262.772802.101410@g43g2000cwa.googlegroups.com> <1135872456.012502.181230@g14g2000cwa.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1135884937 6086 80.91.229.2 (29 Dec 2005 19:35:37 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 29 Dec 2005 19:35:37 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 29 20:35:36 2005 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Es3Yh-0004aO-HB for geh-help-gnu-emacs@m.gmane.org; Thu, 29 Dec 2005 20:35:32 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Es3a4-0006Zx-Hi for geh-help-gnu-emacs@m.gmane.org; Thu, 29 Dec 2005 14:36:56 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Es3Zk-0006Xe-NY for help-gnu-emacs@gnu.org; Thu, 29 Dec 2005 14:36:36 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Es3Zk-0006X5-3b for help-gnu-emacs@gnu.org; Thu, 29 Dec 2005 14:36:36 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Es3Zk-0006Ww-0M for help-gnu-emacs@gnu.org; Thu, 29 Dec 2005 14:36:36 -0500 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1Es3a8-0003cA-8Y for help-gnu-emacs@gnu.org; Thu, 29 Dec 2005 14:37:00 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Es3Y4-0004Jw-Hk for help-gnu-emacs@gnu.org; Thu, 29 Dec 2005 20:34:53 +0100 Original-Received: from 207.167.42.60 ([207.167.42.60]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 29 Dec 2005 20:34:52 +0100 Original-Received: from ihs_4664 by 207.167.42.60 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 29 Dec 2005 20:34:52 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 110 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 207.167.42.60 User-Agent: Mozilla Thunderbird 0.9 (X11/20041105) X-Accept-Language: en-us, en In-Reply-To: <1135872456.012502.181230@g14g2000cwa.googlegroups.com> X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:32292 Archived-At: shreevatsa wrote: > Kevin Rodgers wrote: >>One problem is that merely loading ctypes affects subsequent editing. >>You could try to disable ctypes with: >>(remove-hook 'find-file-hooks 'ctypes-find-file-hook) > > But I _want_ ctypes.el! It's nice and helpful, although it has a few > bugs: > 1. STL types not recognized Where are the STL types defined? > 2. In c++-mode, it recognizes a class as a new type, but not a struct > (probably because of the way it works in C). Unfortunately, I hardly > know any Emacs-lisp, so I can't fix this myself. I don't know C++, so I can't help either. > 3. The link given in ctypes.el, namely > http://www.csd.uu.se/~andersl/emacs.shtml does not work. There's even > an unanswered post about it at > http://list-archive.xemacs.org/xemacs-beta/200311/msg00064.html Indeed. emacswiki.org has version 1.2 (dated 12 Jun 1997), but Google found version 1.3.1 (dated 1999-06-23) at http://simon.nitro.dk/dotfiles/emacs/ctypes.el >>Did you read the commentary at the beginning of ctypes.el? > > The only relevant part seems to be: > ;; Currently, this package can parse C and C++ files. (However, since > ;; I do not use C++, the probability is high (about 12, on a scale > ;; from 1 to 12) that I've missed something). By default C++ inherits > ;; the types defined for C mode. > ;-) This is the part I think is relevant (assuming you can find a comprehensive list of STL types): ;; Defining types: ;; ;; The following commands are available to define and remove types: ;; ;; `ctypes-define-type' Add a type. ;; `ctypes-define-type-in-mode' Add a type to another major mode. ;; `ctypes-buffer' Scan a buffer for types. ;; `ctypes-all-buffer' Scan all buffer for types. ;; `ctypes-tags' Search through all files in a TAGS table. ;; `ctypes-dir' Search a directory hierarchy for files. ;; `ctypes-file' Search in a file for types. ;; `ctypes-remove-type' Remove one type. ;; `ctypes-remove-type-in-mode' Remove one type in another mode. ;; `ctypes-clear-types' Forget all types. ;; `ctypes-clear-types-all-modes' Forget all types in all major modes. ;; Edit types: ;; ;; If you would like to view or change the types found you can use the ;; function `ctypes-edit'. When done press C-c C-c. Should you like ;; do discard your changes just kill the buffer with C-x k. ;; ;; To edit the types for another major mode use the command ;; `ctypes-edit-types-for-mode'. ;; Saving types: ;; ;; The commands `ctypes-write-file' and `ctypes-read-file' can be used ;; to save your hard-earned collection of types to a file and to ;; retrieve it later. ;; ;; The default file name is stored in the variable `ctypes-file-name'. ;; ;; Note that only one collection of types are managed. Should you ;; prefer to keep one type file per project, remember to clear the set ;; of known types (using the command `ctypes-clear-types-all-modes') ;; before each new set is generated. ;; At Load: ;; ;; It is possible to automatically add new types, or read specific ;; type files, when Emacs opens a file. ;; ;; By adding a "Local Variables" section to the end of the file ;; containing the variables `ctypes-add-types-at-load' and/or ;; `ctypes-read-files-at-load' this can be accomplished. ;; ;; For example: ;; ;; /* ;; * Local Variables: ;; * ctypes-add-types-at-load: ("MyType" "YourType") ;; * ctypes-read-files-at-load: (".ctypes") ;; * End: ;; */ ;; The `Auto Parse' mode: ;; ;; This package can automatically search for new types in all visited ;; files. Activate the minor mode `ctypes-auto-parse-mode' to enable ;; this feature. ;; ;; Add the following line to your startup file to automatically ;; scan all visited files: ;; (ctypes-auto-parse-mode 1) > I must admit, however, that ctypes.el is quite smart and useful, so the > thread title is unjustified.... -- Kevin Rodgers