GNU bug report logs - #7060
23.2; emacs does not recognize the "end" keyword as a block-delimiter in octave-mode

Previous Next

Package: emacs;

Reported by: Manjul Apratim <manjul.apratim <at> gmail.com>

Date: Fri, 17 Sep 2010 21:40:02 UTC

Severity: normal

Found in version 23.2

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 7060 in the body.
You can then email your comments to 7060 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#7060; Package emacs. (Fri, 17 Sep 2010 21:40:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Manjul Apratim <manjul.apratim <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 17 Sep 2010 21:40:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Manjul Apratim <manjul.apratim <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 23.2; emacs does not recognize the "end" keyword as a block-delimiter
	in octave-mode
Date: Fri, 17 Sep 2010 17:31:33 -0400
[Message part 1 (text/plain, inline)]
Message-ID:
<878w3083wr.fsf <at> chaar.i-did-not-set--mail-host-address--so-tickle-me>
--text follows this line--

emacs does not recognize the "end" keyword as a block-delimiter in
octave-mode. Upon inspecting the file octave-mod.el, I see the following
line before
the variable "octave-end-keywords":

";; FIXME: only use specific "end" tokens here to avoid confusion when "end"
;; is used in indexing (the real fix is much more complex)."

I could not ascertain what the fix was, but I tried manually appending
the "end" keyword in the "octave-end-keywords" list as well as the
"octave-block-match-alist" environment, and I still could not get the
"end" keyword to be recognized. I did not understand why this was so
because upon doing a find for "endif" on the file, one sees that "endif"
occurs exactly thrice - once for a short-cut, and once each in the
above-mentioned environments, and putting the "end" keyword on the same
footing as "endif" would be naively expected to work (also "endwhile"
and "endfor"). I have the following in the my .emacs file:

;; octave bindings

(autoload 'octave-mode "octave-mod" nil t)
(setq auto-mode-alist
(cons '("\\.m$" . octave-mode) auto-mode-alist))

(add-hook 'octave-mode-hook
(lambda ()
(abbrev-mode 1)
(auto-fill-mode 1)
(if (eq window-system 'x)
(font-lock-mode 1))))

(defun RET-behaves-as-LFD ()
(let ((x (key-binding "\C-j")))
(local-set-key "\C-m" x)))
(add-hook 'octave-mode-hook 'RET-behaves-as-LFD)

(setq octave-auto-indent t)

Specifically, I want the "end" keyword to indent properly because I have
to write matlab-compatible code - the University server I submit jobs on
has matlab installed on it and the sysadmin is reluctant to install
octave there. I can obtain matlab from my University for free, but I
refuse to do so and I would rather continue to work in
octave. Similarly, I would rather not use 'matlab-mode' and stick to
'octave-mode' instead.

I have come across certain previous versions of
octave-mod.el, and they seem to contain the "end" keyword alongwith the
other octave-end-keywords. I tried to replace my original octave-mod.el
file with one of those old files - specifically, one at (disdainfully on
an apple site, but no immediate alternatives were available):
opensource.apple.com/source/emacs/emacs-41/emacs/lisp/progmodes/octave-mod.el
but that did not help either, and though all the other keywords still
behaved the same, the "end" keyword was still not recognized.

I also apologize for not sending the email directly from emacs, since I did
not have my smtp settings
configured at this time.

Sincerely,

Manjul Apratim





In GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.1)
 of 2010-09-01 on rutherfordium, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.10706000
configured using `configure  '--build=i486-linux-gnu'
'--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib'
'--libexecdir=/usr/lib' '--localstatedir=/var/lib'
'--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes'
'--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.2/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.2/leim'
'--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars'
'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g
-O2' 'LDFLAGS=-g' 'CPPFLAGS=''

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: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Octave

Minor modes in effect:
  show-paren-mode: t
  cua-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Recent input:
<next> <next> <next> <next> <next> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<next> <next> <prior> <prior> <prior> <prior> <prior>
<prior> <help-echo> <down-mouse-1> x <mouse-1> <down-mouse-1>
<mouse-movement> x <drag-mouse-1> <down-mouse-1> x
<mouse-1> <down-mouse-1> <mouse-1> <double-down-mouse-1>
x <double-mouse-1> <down-mouse-1> x <mouse-1> <down-mouse-1>
<mouse-1> C-x M-x <down-mouse-1> <mouse-1> <down-mouse-1>
<mouse-1> M-x <help-echo> r e p o r t - e m a c s -
b u g <return>

Recent messages:
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el
(source)...done
Loading debian-ispell...done
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el
(source)...done
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...done
Loading /etc/emacs/site-start.d/50octave3.2-emacsen.el (source)...done
Loading cua-base...done
Loading paren...done
For information about GNU Emacs and the GNU system, type C-h C-a.
Mark set

Load-path shadows:
/usr/share/emacs/23.2/site-lisp/debian-startup hides
/usr/share/emacs/site-lisp/debian-startup
/usr/share/emacs23/site-lisp/dictionaries-common/flyspell hides
/usr/share/emacs/23.2/lisp/textmodes/flyspell
/usr/share/emacs23/site-lisp/dictionaries-common/ispell hides
/usr/share/emacs/23.2/lisp/textmodes/ispell
/usr/share/emacs/23.2/site-lisp/octave3.2-emacsen/octave-inf hides
/usr/share/emacs/23.2/lisp/progmodes/octave-inf
/usr/share/emacs/23.2/site-lisp/octave3.2-emacsen/octave-mod hides
/usr/share/emacs/23.2/lisp/progmodes/octave-mod

Features:
(shadow sort mail-extr message sendmail regexp-opt ecomplete rfc822 mml
mml-sec password-cache mm-decode mm-bodies mm-encode mailcap mail-parse
rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader gnus-util
netrc time-date mm-util mail-prsvr gmm-utils wid-edit mailheader canlock
sha1 hex-util hashcash mail-utils emacsbug easymenu octave-mod paren
cua-base cus-start cus-load tooltip ediff-hook vc-hooks lisp-float-type
mwheel x-win x-dnd font-setting tool-bar dnd fontset image fringe
lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar
mldrag mouse jit-lock font-lock syntax facemenu font-core frame cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese hebrew greek romanian slovak czech european ethiopic
indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple
abbrev loaddefs button minibuffer faces cus-face files text-properties
overlay md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
system-font-setting font-render-setting gtk x-toolkit x multi-tty emacs)
[Message part 2 (text/html, inline)]

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#7060; Package emacs. (Sat, 18 Sep 2010 00:41:01 GMT) Full text and rfc822 format available.

Message #8 received at 7060 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Manjul Apratim <manjul.apratim <at> gmail.com>
Cc: 7060 <at> debbugs.gnu.org
Subject: Re: bug#7060: 23.2;
	emacs does not recognize the "end" keyword as a block-delimiter in
	octave-mode
Date: Sat, 18 Sep 2010 02:42:43 +0200
> emacs does not recognize the "end" keyword as a block-delimiter in
> octave-mode. Upon inspecting the file octave-mod.el, I see the following
> line before
> the variable "octave-end-keywords":

The octave-mod.el that will be in Emacs-24 has completely rewritten the
indentation and block navigation code.  I cannot reproduce the
problem there.  Sadly it uses a new package smie.el that's not in
Emacs-23.

This said, the octave-mod.el that's in the emacs-23 branch (and that
will be released as Emacs-23.3 in the not too distant future) also seems
to correctly handle "end".

If you could confirm that one of those two versions works for you, that
would be great (of course I recommend the version from `trunk' which
uses smie.el since I'm the author of that code).


        Stefan




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#7060; Package emacs. (Sat, 18 Sep 2010 19:54:02 GMT) Full text and rfc822 format available.

Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Manjul Apratim <manjul.apratim <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: bug#7060: 23.2; emacs does not recognize the "end" keyword as a
	block-delimiter in octave-mode
Date: Sat, 18 Sep 2010 15:32:35 -0400
[Message part 1 (text/plain, inline)]
Very nice! I pulled the trunk version of emacs - 24.0.50 - from bazaar and
checkinstalled it. "end" is working perfectly on this version, as also all
the other keywords. One thing however - emacs does not warn anymore if two
non-matching block delimiters are tried, say if I put in "endif" with "for",
while in the previous version, it did warn that the keywords do not match.

I think I understand from the "make bootstrap" process why merely changing
the octave-mod.el file did not work before - I believe it needed to be
compiled into an elc file, which would only happen if I were to rebuild the
source from scratch - is that correct?

Manjul
[Message part 2 (text/html, inline)]

bug closed, send any further explanations to 7060 <at> debbugs.gnu.org and Manjul Apratim <manjul.apratim <at> gmail.com> Request was from Chong Yidong <cyd <at> stupidchicken.com> to control <at> debbugs.gnu.org. (Sun, 07 Aug 2011 20:43:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 05 Sep 2011 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 348 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.