Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C-x C-s fails to save file #1392

Closed
veripoolbot opened this issue Jan 22, 2019 · 3 comments
Closed

C-x C-s fails to save file #1392

veripoolbot opened this issue Jan 22, 2019 · 3 comments

Comments

@veripoolbot
Copy link
Collaborator


Author Name: Don Allingham
Original Redmine Issue: 1392 from https://www.veripool.org


On emacs25 and emacs26, if I open a .sv file, make an edit, and attempt to save with C-x C-s, the file does not save. The message "Saving " is displayed, but the file does not save and the buffer remains marked as unsaved. I can save with C-x C-w, and after this save, subsequent attempts to write the buffer with C-x C-s will then succeed. But until the buffer is written with C-x C-w, the normal save-file will not work.

This problem does not seem to occur in versions before emacs24.

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2019-01-22T17:57:49Z


Verilog-mode does not override the C-xC-s keys so it's extremely unlikely it breaks this. Furthermore I'm using 25 with no problems.

You must have something in your .emacs that is breaking this.

Do M-X describe-key [RET] C-x C-s to debug what that runs.

Of course if you find something wrong with verilog-mode be sure to post it.

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Don Allingham
Original Date: 2019-01-22T22:21:20Z


The problem seems to be with some verilog-mode-hook additions. These worked in older emacs versions, but longer appear to work. I've removed these hooks, and the problem as gone away.

For the record, the hooks were:

;;;
;;; Remove tabs from a Verilog file when saving
;;; 
(add-hook 'verilog-mode-hook 
	  '(lambda () (add-hook
		       'local-write-file-hooks 
		       (lambda() (untabify (point-min) (point-max))))))

;;;
;;; Remove trailing white space from Verilog files when saving
;;;
(add-hook 'verilog-mode-hook
	  (lambda ()
	    (add-hook 'local-write-file-hooks
		      '(lambda()
			 (save-excursion
			  (delete-trailing-whitespace))))))

;; Any files in verilog mode should have their keywords colorized
(add-hook 'verilog-mode-hook '(lambda () (font-lock-mode 1)))

@kopinions
Copy link

use this one

(add-hook 'verilog-mode-hook '(lambda () (add-hook 'write-contents-hooks (lambda () (progn (untabify (point-min) (point-max)) (save-excursion (delete-trailing-whitespace)))) nil t)))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants