unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* emacs verilog mode
@ 2013-08-14  0:54 Paul Cheng
  2013-08-14  4:52 ` Bob Proulx
  0 siblings, 1 reply; 8+ messages in thread
From: Paul Cheng @ 2013-08-14  0:54 UTC (permalink / raw)
  To: Peter Dyballa; +Cc: help-gnu-emacs@gnu.org

[-- Attachment #1: Type: text/plain, Size: 579 bytes --]

Hi,

Emacs would reformat my verilog file after I press enter/return, is there any way to stop it from doing that?
My init.el is attached.

Thank you,
Paul


________________________________

This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.

[-- Attachment #2: init.el --]
[-- Type: application/octet-stream, Size: 6596 bytes --]

(put 'eval-expression 'disabled nil)
;;(load "hilit19")

      (global-set-key "%" 'match-paren)
      (global-set-key "\M-g" 'goto-line) ; [ESC]-[g] 
;      (global-set-key "\C-m" 'set-mark-command)  ; CTRL-m --> works 
;      (global-set-key "\C-SPC" 'set-mark-command)  ; Not yet working
;      (global-set-key "C-cm" 'set-mark)   --> doesn't work
;(define-key  global-map  "\C-<SPC>"  'set-mark)

      (defun match-paren (arg)
        "Go to the matching parenthesis if on parenthesis otherwise insert %."
        (interactive "p")
        (cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1))
              ((looking-at "\\s\)") (forward-char 1) (backward-list 1))
              (t (self-insert-command (or arg 1)))))

;; Remove splash screen
(setq inhibit-splash-screen t)

(setq explicit-shell-file-name "/bin/tcsh")

(setq mail-archive-file-name "~/.Omail")
(setq default-major-mode 'text-mode) 
; --- this is annoying
;(setq text-mode-hook '(lambda () (auto-fill-mode 1))) 

;(setq explicit-shell-file-name "/bin/csh")
 
 
(defun find-file-new-window (filename) 
  (interactive "FFind file in a new window: ") 
  (split-window-vertically) 
  (find-file-other-window filename)) 
 
(defun prev-window () 
  (interactive) 
  (other-window -1) 
  ) 
 
(defun justify-paragraph ()  
  (interactive) 
  (fill-paragraph t) 
) 
;;------- to fix the c-spc using gnome terminal 
;;(global-set-key (kbd "SPC") 'cmd) ; the Space bar key
;(global-set-key (kbd "C-SPC") 'set-mark-cmd)  ; doesn't work, let's try to unset C-@
;(global-set-key [f1] 'set-mark-cmd) ; emacs doesn't like f1 to overtake C-@
;;(global-unset-key (kbd "C-@")) ;; see if unset this would work;; this unsets C-@, but C-SPC still doesn't work

;;----------------------------------------------
;(global-set-key "\C-SPC" 'set-mark-command) ; C-SPC doesn't work; \C-SPC is bad; \C is flagged
(global-set-key "\C-x\C-v" 'find-file-new-window) 
(global-set-key "\C-x\C-i" 'insert-file) 
(global-set-key "\C-cs" 'shell) 
(global-set-key "\C-xn" 'other-window) 
(global-set-key "\C-xp" 'prev-window) 
(global-set-key "\C-xd" 'delete-window) 
(global-set-key "\C-h"  'delete-backward-char) 
(global-set-key "\C-xl" 'what-line) 
(global-set-key "\C-j"  'justify-paragraph) 
 
(define-key lisp-interaction-mode-map "\C-c\C-e" 'eval-print-last-sexp) 
 
 
(autoload 'byte-compile "bytecomp" "byte-compile a symbol") 
 
(put 'eval-expression 'disabled nil) 
(put 'narrow-to-region 'disabled nil) 
(put 'narrow-to-page 'disabled nil) 
 
; Sets the "REPLY" command to reply to the sender only, and not 
; all recipients of the message. 
;(setq rmail-dont-reply-to-names ".+") 
 
;(autoload 'c++-mode "c++-mode" "C++ Editing Mode" t)
;(autoload 'vhdl-mode "vhdl-mode" "VHDL Editing Mode" t)

(setq auto-mode-alist 
      (append '(("\\.vhd$" . vhdl-mode) ("\\.C$" . c++-mode) 
		("\\.h$" . c++-mode) ("\\.ch$" . c++-mode)
		) auto-mode-alist)) 


;; gnus 
;;
;;(autoload 'gnus "gnus" "Read network news." t)
;; (autoload 'gnus-post-news "gnuspost" "Post a news." t)

;; gdb
;;(autoload 'gdb "gdb" "GDB." t)



;; Options Menu Settings
;; =====================
(cond
 ((and (string-match "XEmacs" emacs-version)
       (boundp 'emacs-major-version)
       (or (and
            (= emacs-major-version 19)
            (>= emacs-minor-version 14))
           (= emacs-major-version 20))
       (fboundp 'load-options-file))
  (load-options-file "/home/yogesh/.xemacs-options")))
;; ============================
;; End of Options Menu Settings

;; MACROs for OneNAND Flash
(fset 'reg_prog_main
   [(menu-bar) edit search search-forward ?$ ?q ?e ?l return (menu-bar) edit search search-forward ?. ?r ?a ?w return left left left left ?\C-  (menu-bar) edit search search-backward ?  return right (menu-bar) edit copy (menu-bar) edit search search-backward ?i ?n ?t ?_ ?m ?e ?m ?_ ?a ?r ?r ?a ?y return ?\C-y ?\C-d ?\C-d ?\C-d ?\C-d ?\C-d ?\C-d ?\C-d ?\C-d ?\C-d ?\C-d ?\C-d ?\C-d ?\C-d right right right right right right right right right right right right right right right right right right right (menu-bar) edit search search-forward ?- ?s ?t ?a ?r ?t return left left left left left left left ?" ?) ?\; ?\C-  down ?\C-w down left left left ?\C-y ?\C-k (menu-bar) edit search search-backward ?% ?m return right right ?\C-  ?i ?n ?t ?_ ?m ?e ?m ?_ ?a ?r ?r ?a ?y ?\C-  (menu-bar) edit search search-forward ?  return left ?\C-w])


(put 'set-goal-column 'disabled nil)

;;;====P. Cheng completion and set-mark-command
;;(require hippie-exp)

;(setq hippie-expand-try-functions-list
;(try-expand-dabbrev
;try-expand-dabbrev-all-buffers
;try-expand-dabbrev-from-kill
;try-complete-file-name-partially
;try-complete-file-name
;try-complete-lisp-symbol-partially
;try-complete-lisp-symbol
;try-expand-whole-kill))

;;also, I tend to use C-SPC for this instead of set-mark-command:

;(global-set-key (kbd C-SPC) hippie-expand)
; === describe-bindings
;====== set tabspace=4
;(setq c-basic-indent 2)
(setq-default indent-tabs-mode nil) 
;(setq-default tab-width 4) 
(setq default-tab-width 4) 
;(setq tab-width 4)
(setq indent-line-function 'insert-tab)
; use the following to for tab stops
;(setq tab-stop-list '(4 8 12 16))
;=====to highlight tabs
; Sets tab width to 4.
(defun set-tab-width-4 ()
  "Set the tab-width variable to 4."
  (interactive)
  (setq tab-width 4)
  (redraw-display)
  (message "*NOTE: Setting tab-width = 4")
)

; Sets tab width to 8.
(defun set-tab-width-8 ()
  "Set the tab-width variable to 8."
  (interactive)
  (setq tab-width 8)
  (redraw-display)
  (message "*NOTE: Setting tab-width = 8")
)

; Sets tab width to 12.
(defun set-tab-width-12 ()
  "Set the tab-width variable to 12."
  (interactive)
  (setq tab-width 12)
  (redraw-display)
  (message "*NOTE: Setting tab-width = 12")
)
;==== see if this will take care of indent caused by newline
;==== no use
;(add-hook 'verilog-mode-hook
;	  '(lambda () 
;	  	     (setq verilog-auto-newline nil
;			 		   verilog-tab-always-indent nil)))
;==== see if this helps; better but not quite
; `verilog-auto-indent-on-newline'   (default nil)
(add-hook 'verilog-mode-hook
	  '(lambda () 
	  	     (define-key verilog-mode-map [newline] 'self-insert-command)))
;==== ; is just semicolon
(add-hook 'verilog-mode-hook
	  '(lambda () 
	  	     (define-key verilog-mode-map ";" 'self-insert-command)))

;====  macro for inserting verilog comment
  (fset 'vericomment
     (lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ([1 47 47 down] 0 "%d")) arg)))
;=====
(put 'upcase-region 'disabled nil)
(put 'downcase-region 'disabled nil)

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-10-29 12:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-14  0:54 emacs verilog mode Paul Cheng
2013-08-14  4:52 ` Bob Proulx
2013-08-14 16:27   ` Paul Cheng
2013-09-08 23:52   ` Paul Cheng
2013-09-09  0:05     ` Stefan Monnier
2013-10-28 21:57   ` Paul Cheng
2013-10-29 12:45     ` Stefan Monnier
     [not found]   ` <mailman.4860.1382997450.10748.help-gnu-emacs@gnu.org>
2013-10-29  3:17     ` Rustom Mody

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).