Is there a variable I can set to disable the call of octave-sync-function-file-names after saving a file?


There's no such variable. However, you can still do this, by removing the function from before-save-hook. This is untested, but try:

(remove-hook  'before-save-hook 'octave-sync-function-file-names t)

You'll have to do this in each octave-mode buffer, so you should probably do it from octave-mode-hook like this:

(defun my-octave-deactivate-sync-function ()
  "Don't check equality of function and file names.
Add this to `octave-mode-hook'."
  (remove-hook 'before-save-hook 'octave-sync-function-file-names t))

(add-hook 'octave-mode-hook #'my-octave-deactivate-sync-function)
  • 1
    thanks a lot for this piece! I accidentally found out that you can cheat around it by have a statement in the first line of the file. It can be anything like 0; or a=4; Feb 28 '17 at 19:42
  • Removing the hook had no effect for me, but Daniel's kluge did. Dec 6 '17 at 6:30
  • @DanielHitzel Yes that works because the file is no longer a function file but an octave script file. This is detected by octave-function-file-p: "Return non-nil if the first token is \"function\"."
    – Tobias
    Apr 20 '18 at 9:23
  • @holocronweaver I've added some code example that works for me.
    – Tobias
    Apr 20 '18 at 9:33

This worked for me:

(defun octave-sync-function-file-names () (ignore))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.