unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Emanuel Berg <embe8573@student.uu.se>
To: help-gnu-emacs@gnu.org
Subject: Re: While editing a CMake file, how to turn off smart indentation?
Date: Sat, 18 Jul 2015 02:26:32 +0200	[thread overview]
Message-ID: <87zj2ufgzr.fsf@nl106-137-147.student.uu.se> (raw)
In-Reply-To: CAOj2CQQmF3+Qctki3Xi=b+oTP3zkNpJ-UOcoydxJ6jKnWJnogA@mail.gmail.com

John Mastro <john.b.mastro@gmail.com> writes:

> Yaron will actually need something like this for the
> second one:
>
> (global-set-key [backtab] 'remove-four-chars)

Right, it was shift, not Meta! Yes, Mastro is right.

> I also had to change the key for the first one to
> (kbd "<C-tab>") or [C-tab] for it to work on
> my system.

This

    (global-set-key [C-tab] 'insert-four-spaces)

works for me as well. The reason I put it the other
way is I first put it this way:

    (global-set-key [C-TAB] 'insert-four-spaces)

And then it says:

    To bind the key C-TAB, use [?\\C-\\t], not [C-TAB]

But neither, nor

    (global-set-key [?\C-\t]   'insert-four-spaces)
    (global-set-key [?\\C-\\t] 'insert-four-spaces)

works what I can see (and the second don't even eval).

What does it mean?

> One more thing - I'd recommend binding the keys in
> cmake-mode's keymap rather than the global map, in
> case you want to do things differently in
> other modes.

Yes, of course, I thought that was self-evident.
Ehm... Anyway, another way to do it is to `defvar'
the cmake-mode-map, and then set the keys up in
a hook. Like this, but not with IELM but cmake:

(defvar ielm-map)

;; (setq ielm-mode-hook nil) ; use to reset hook
(defun ielm-mode-hook-f ()
  (let ((the-map ielm-map))
    (define-key the-map "\C-xk" 'bury-buffer)
    (define-key the-map "\C-p"  'comint-previous-input)
    (define-key the-map "\C-n"  'comint-next-input) ))
(add-hook 'ielm-mode-hook 'ielm-mode-hook-f)

-- 
underground experts united
http://user.it.uu.se/~embe8573




  reply	other threads:[~2015-07-18  0:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-17  4:18 While editing a CMake file, how to turn off smart indentation? Yaron Cohen-Tal
2015-07-17  5:59 ` Vaidheeswaran C
2015-07-17 23:34 ` Emanuel Berg
2015-07-17 23:54   ` John Mastro
2015-07-18  0:26     ` Emanuel Berg [this message]
2015-07-18 17:58       ` Yaron Cohen-Tal
2015-07-18 19:18         ` John Mastro
2015-07-19 17:35           ` Yaron Cohen-Tal
  -- strict thread matches above, loose matches on Subject: below --
2015-07-16  7:23 Yaron Cohen-Tal
2015-07-16 22:55 ` Emanuel Berg
2015-07-16 23:55 ` Stefan Monnier
     [not found] ` <mailman.7023.1437087429.904.help-gnu-emacs@gnu.org>
2015-07-17  1:14   ` Dan Espen
2015-07-17  5:39 ` Vaidheeswaran C
2015-07-17 23:37   ` Emanuel Berg
2015-07-17  5:52 ` Vaidheeswaran C
2015-07-17 15:01 ` Ian Zimmerman

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=87zj2ufgzr.fsf@nl106-137-147.student.uu.se \
    --to=embe8573@student.uu.se \
    --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).