How to define <backtab>
short key in emacs24 ?
I had found some solution,
like:
- http://stuff.mit.edu/afs/sipb/user/daveg/Info/backtab-howto.txt
- Emacs Shift-Tab to left shift the block
but it isn't work for me.
In the end:
(global-set-key (kbd "<backtab>") 'un-indent-by-removing-4-spaces)
(defun un-indent-by-removing-4-spaces ()
"remove 4 spaces from beginning of of line"
(interactive)
(save-excursion
(save-match-data
(beginning-of-line)
;; get rid of tabs at beginning of line
(when (looking-at "^\\s-+")
(untabify (match-beginning 0) (match-end 0)))
(when (looking-at "^ ")
(replace-match "")))))
worked for me !!!
thanks @Drew and @lawlist.
<backtab>
is in fact the key you want to bind. The key labeledTab
on your keyboard, when pressed with modifier keyShift
, can produce different soft keys for different keyboards and for different versions of Emacs. If, after trying the solution provided by @lawlist, it does not seem to work, check whatC-h k
says forShift
+Tab
. It might not be<backtab>
. It might be<S-tab>
of<S-iso-lefttab>
. Whatever key it tells you is the one you want to bind. – Velutinous