From: Bruce Korb <Bruce.Korb@gmail.com>
To: Bruce Korb <Bruce.Korb@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: In "C" mode, how do I turn off electric mode?
Date: Mon, 26 Nov 2007 18:22:49 -0800 [thread overview]
Message-ID: <474B7F79.5080108@gmail.com> (raw)
In-Reply-To: <47486275.1090006@gmail.com>
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.
next prev parent reply other threads:[~2007-11-27 2:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-24 17:42 In "C" mode, how do I turn off electric mode? Bruce Korb
2007-11-24 20:04 ` Eli Zaretskii
2007-11-24 21:18 ` Alan Mackenzie
2007-11-27 2:22 ` Bruce Korb [this message]
2007-11-27 12:42 ` Peter Dyballa
2007-11-30 23:10 ` Alan Mackenzie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=474B7F79.5080108@gmail.com \
--to=bruce.korb@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).