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

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

Re: In "C" mode, how do I turn off electric mode?


From: Bruce Korb
Subject: Re: In "C" mode, how do I turn off electric mode?
Date: Mon, 26 Nov 2007 18:22:49 -0800
User-agent: Thunderbird 2.0.0.6 (X11/20070801)

I know I probably seem cranky.  I am feeling cranky, after all.
I mean, I've used this wonderful editor for over 20 years and
it has been getting better all the time.  Until I loaded version 22.1
that came with my SuSE installation.  I really do find it irritating
that I have to go find and eyeball parse this stuff:


> ;; Safe local variables:
> ;;
> ;; For variables defined by major modes, the safety declarations can go into
> ;; the major mode's file, since that will be loaded before file variables are
> ;; processed.
> ;;
> ;; For variables defined by minor modes, put the safety declarations in the
> ;; file defining the minor mode after the defcustom/defvar using an autoload
> ;; cookie, e.g.:
> ;;
> ;;   ;;;###autoload(put 'variable 'safe-local-variable 'stringp)
> ;;
> ;; Otherwise, when Emacs visits a file specifying that local variable, the
> ;; minor mode file may not be loaded yet.
> ;;
> ;; For variables defined in the C source code the declaration should go here:
> 
> (mapc (lambda (pair)
>       (put (car pair) 'safe-local-variable (cdr pair)))
>       '((buffer-read-only     . booleanp)   ;; C source code
>       (default-directory    . stringp)    ;; C source code
>       (fill-column          . integerp)   ;; C source code
>       (indent-tabs-mode     . booleanp)   ;; C source code
>       (left-margin          . integerp)   ;; C source code
>       (no-update-autoloads  . booleanp)
>       (tab-width            . integerp)   ;; C source code
>       (truncate-lines       . booleanp))) ;; C source code
> 
> (put 'c-set-style 'safe-local-eval-function t)
> 
> (defun hack-local-variables-confirm (vars unsafe-vars risky-vars)
>   (if noninteractive
>       nil
>     (let ((name (if buffer-file-name

only to discover that there really does not seem to be any way
to shut up this damn "hack-local-variables-confirm" junk.
Except to rewrite the thing and have it do nothing.  What a pain.
I mean, really!  It is not a good interface to force all competent
users to say, "Mother, please may I?" every time some new variable
is encountered.  As best I can tell from my ability meander around
this stuff, there is no other way.  So, I surely hope you do not
change the name of that procedure that I am about to replace.

And I would still like to be able to press the space bar and not
have my comment reformatted:

Bruce Korb wrote:
> c-toggle-electric-state
> 
> does not seem to do the trick.  I try to put text into a comment,
> and the electric mode is so helpful, it is impossible to do it, except
> by using text mode in another buffer and pasting it into my C code.
> What is going on?  What are the emacs developers thinking?
> STOP BEING SO HELPFUL.  IT IS NOT HELPFUL.  I JUST WANT TO EDIT
> MY TEXT.  SOME ASSISTS ARE NICE BUT THIS IS WAY OVER THE LINE.
> ARGHHHH!!!!!!!!!!!

Here is an example.  I pressed "enter" and "*" and got this:

    /*=event  power_fail_received
     * evt-sev:     debug
     * evt-class:   debug
     * display:     'received <evt_type> regarding <disk_id>'
     *              ' from node <src_node>: <text_id>'
     *
     * arg:  enum-pfail_evt_type_name, evt_type
     * arg:  enum-pfail_evt_type_desc, text_id
     *
     * arg:  tpd_u32, src_node
     * arg:  tpd_u32, disk_id
     * arg:  tpd_u32, tag_type
*
    =*/

Normally, I would expect the star to be "electric" and line up.
But I am also trying to disable electric mode because there is
simply too much magic involved.  So, okay, I had to press "tab",
but it is still weird:


     * arg:  tpd_u32, tag_type
    *
    =*/

So, I move the cursor in front of the "*" character and press "space-bar":


     * arg:  tpd_u32, tag_type

    *=*/

and the cursor remains on the this new star, but on the next line.
There is some magical property somewhere.  What nonsense is this?

"describe-key" says that "space-bar" is still bound to "insert-self",
but that is obviously not true.  How can I do simple stuff without
resorting to X-clip/paste, changing modes to edit comments, reverting
my distribution to a back-rev emacs or just punting my favorite editor
and using VI?  :(  This is really way too painful.




reply via email to

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