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

 
 

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

Submitter:  Manjul Apratim <manzdagratiano>
Submitted:  Fri 17 Sep 2010 08:04:08 PM UTC
   
 
Category:  Configuration and Build System Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  None Assigned to:  None
Originator Name:  Manjul Apratim Open/Closed:  * Closed
Release:  * 3.2.3 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group 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 Files:
   
   
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
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by manzdagratiano (Submitted the item)
  • -email is unavailable- added by manzdagratiano
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-09-17 jwe Open/ClosedOpen Closed
    2010-09-17 manzdagratiano Attached File- Added octave-mod.el, #21480
        Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code