Navigation Menu

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

Indentation not working after statement using concatenation #1177

Closed
veripoolbot opened this issue Jun 20, 2017 · 7 comments
Closed

Indentation not working after statement using concatenation #1177

veripoolbot opened this issue Jun 20, 2017 · 7 comments
Assignees
Labels

Comments

@veripoolbot
Copy link
Collaborator


Author Name: Victor Lau
Original Redmine Issue: 1177 from https://www.veripool.org

Original Assignee: Wilson Snyder (@wsnyder)


Indentation not working following statement using concatenation {}. Here are some examples.
Got the following error (symbol's function definition is void: ignore-errors)
Verilog version verilog-mode-version "2017-06-06-1941d2f-vpo".

    always_comb begin
        a = b;
        b = {c, d};
 e = f;
 end
 
     always_ff @(posedge clk) begin
        a <= b;
        c <= {4{d}};
 f <= g;
 end
     
     always_ff @(posedge clk) begin
        a <= b;
        c <= {d, e};
 f <= g;
 end

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2017-06-20T16:08:51Z


This is probably caused by that error. Which version of Emacs are you using?

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Victor Lau
Original Date: 2017-06-20T16:13:55Z


GNU Emacs 22.3.1 (x86_64-suse-linux-gnu, X toolkit, Xaw3d scroll bars)
of 2015-03-23 on sheep22

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2017-06-20T16:19:00Z


You're stuck in 2009? :)

Anyhow, try this patch, if it works I'll commit it, I don't have that old of a version around to try it with.

diff --git a/verilog-mode.el b/verilog-mode.el
index d938f11..e779266 100644
--- a/verilog-mode.el
+++ b/verilog-mode.el
@@ -344,6 +344,12 @@ wherever possible, since it is slow."
        (unless (fboundp 'buffer-chars-modified-tick)  ; Emacs 22 added
         (defmacro buffer-chars-modified-tick () (buffer-modified-tick)))
      (error nil))
+  ;; Added in Emacs 23.1
+  (condition-case nil
+      (unless (fboundp 'ignore-errors)
+        (defmacro ignore-errors (&rest body)
+          (declare (debug t) (indent 0))
+          `(condition-case nil (progn ,@body) (error nil)))))
    ;; Added in Emacs 24.1
    (condition-case nil
        (unless (fboundp 'prog-mode)

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Victor Lau
Original Date: 2017-06-20T16:43:05Z


I test it with version emacs 25.1. It works. Thanks.

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Victor Lau
Original Date: 2017-06-20T16:55:44Z


Your Patch work with my aging company default version 22.3.1
:)
Please commit your changes. Thanks again!

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2017-06-20T17:01:30Z


Committed to git as 2017-06-20-42e1d15-vpo.

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Kaushal Modi
Original Date: 2017-06-20T18:33:43Z


@victor While you are updating emacs, please update to emacs 25.2 as that's a bug fix release following 25.1.

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

No branches or pull requests

2 participants