[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
keymap problem with modes derived from sh-mode
From: |
Andreas Voegele |
Subject: |
keymap problem with modes derived from sh-mode |
Date: |
10 Nov 2001 16:24:01 +0100 |
This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English, because the Emacs maintainers do not have
translators to read other languages for them.
Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list,
and to the gnu.emacs.bug news group.
In GNU Emacs 21.1.1 (i586-pc-linux-gnu, X toolkit)
of 2001-10-23 on columbus.localdomain
configured using `configure --host=i586-pc-linux-gnu --prefix=/usr
--libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info
--with-x --with-xpm --with-jpeg --with-tiff --with-gif --with-png'
Important settings:
value of $LC_ALL: nil
value of $LC_COLLATE: nil
value of $LC_CTYPE: nil
value of $LC_MESSAGES: nil
value of $LC_MONETARY: nil
value of $LC_NUMERIC: nil
value of $LC_TIME: nil
value of $LANG: nil
locale-coding-system: nil
default-enable-multibyte-characters: t
Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:
I use a major mode derived from sh-mode. Under GNU Emacs 21, I get
the message "This buffer is not in Shell-script mode" when I try to
intend a line with the TAB key.
The function sh-must-be-shell-mode uses the expression
(eq major-mode 'sh-mode) to check the mode. Since the derived mode
is called ebuild-script-mode the check fails.
I think that sh-must-be-shell-mode should use the expression
(derived-mode-p 'sh-mode)
instead of
(eq major-mode 'sh-mode).
I've written an advice for sh-must-be-shell-mode but IMHO the next
Emacs revision should include a fix.
Here's the code that I use:
(define-derived-mode ebuild-script-mode
sh-mode "Ebuild-script" nil
(setq tab-width 4))
(setq auto-mode-alist
(append
'(("\\.ebuild$" . ebuild-script-mode))
auto-mode-alist))
(defadvice sh-must-be-shell-mode
(around sh-must-be-shell-mode-around activate)
"Accept modes derived from sh-mode."
(unless (derived-mode-p 'sh-mode)
ad-do-it))
Recent input:
<help-echo> C-y C-x C-e <escape> x e b u i l d - s
c r i p t - m o d e <return> <tab> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <menu-bar> <help-menu>
<report-emacs-bug>
Recent messages:
Loading easy-mmode...done
Loading sh-script...done
Setting up indent for shell type sh
Loading regexp-opt...done
Loading mule-util...done
setting up indent stuff
Indentation variable are now local.
Indentation setup for shell type sh
sh-must-be-shell-mode: This buffer is not in Shell-script mode
Loading emacsbug...done
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- keymap problem with modes derived from sh-mode,
Andreas Voegele <=