bugGNU Octave - Bugs: bug #31061, 'end' keyword not recognized by...

 
 

bug #31061: 'end' keyword not recognized by emacs as block delimiter in octave-mode

Submitted by:  Manjul Apratim <manzdagratiano>
Submitted on:  Fri 17 Sep 2010 08:04:08 PM UTC  
 
Category: Configuration and Build SystemSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Feature Request
Status: NoneAssigned to: None
Originator Name: Manjul ApratimOpen/Closed: Closed
Release: 3.2.3Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 17 Sep 2010 08:49:50 PM UTC, comment #2:

Ah the legendary John Eaton himself! Thanks for the input - I will file the bug on Emacs.

Manjul Apratim <manzdagratiano>
Fri 17 Sep 2010 08:43:53 PM UTC, comment #1:

I'm closing this report because octave-mode.el and related files have been removed from Octave and are now part of GNU Emacs. Would you please report this problem to the Emacs maintainers instead?

John W. Eaton <jwe>
Project Administrator
Fri 17 Sep 2010 08:04:08 PM UTC, original submission:

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 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 have noticed an older version of octave-mod.el on the website:

opensource.apple.com/source/emacs/emacs-41/emacs/lisp/progmodes/octave-mod.el

which I am also attaching here, in which the "end" keyword is explicitly present in the octave-end-keywords list. Substituting this file for mine own, however, did not work for me.

Manjul Apratim <manzdagratiano>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #21480:  octave-mod.el added by manzdagratiano (100KiB - text/x-emacs-lisp - octave-mod.el file from opensource.apple.com/source/emacs/emacs-41/emacs/lisp/progmodes/)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by manzdagratiano (Submitted the item)
  • -unavailable- added by manzdagratiano
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 17 Sep 2010 08:43:53 PM UTCjweOpen/ClosedOpen=>Closed
    Fri 17 Sep 2010 08:04:08 PM UTCmanzdagratianoAttached File-=>Added octave-mod.el, #21480
      Carbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1