help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ctypes.el is stupid (by default)


From: Kevin Rodgers
Subject: Re: ctypes.el is stupid (by default)
Date: Thu, 29 Dec 2005 12:34:32 -0700
User-agent: Mozilla Thunderbird 0.9 (X11/20041105)

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]