* bug#15499: [PATCH] Using ?\s for space character in vhdl-mode
@ 2013-10-01 6:15 Xue Fuqiao
2013-10-07 0:42 ` Glenn Morris
0 siblings, 1 reply; 2+ messages in thread
From: Xue Fuqiao @ 2013-10-01 6:15 UTC (permalink / raw)
To: 15499
tags patch
This patch uses ?\s instead of ? in Lisp code for a space character
in vhdl-mode.
=== modified file 'lisp/progmodes/vhdl-mode.el'
*** lisp/progmodes/vhdl-mode.el 2013-05-22 03:13:56 +0000
--- lisp/progmodes/vhdl-mode.el 2013-10-01 06:09:51 +0000
***************
*** 7308,7314 ****
"newline-and-indent or indent-new-comment-line if in comment and preceding
character is a space."
(interactive)
! (if (and (= (preceding-char) ? ) (vhdl-in-comment-p))
(indent-new-comment-line)
(when (and (>= (preceding-char) ?a) (<= (preceding-char) ?z)
(not (vhdl-in-comment-p)))
--- 7308,7314 ----
"newline-and-indent or indent-new-comment-line if in comment and preceding
character is a space."
(interactive)
! (if (and (= (preceding-char) ?\s) (vhdl-in-comment-p))
(indent-new-comment-line)
(when (and (>= (preceding-char) ?a) (<= (preceding-char) ?z)
(not (vhdl-in-comment-p)))
***************
*** 7640,7646 ****
(setq distance (- (match-beginning substr) bol))
(goto-char (match-beginning substr))
(delete-char width)
! (insert-char ? (+ (- max distance) spacing)))
(beginning-of-line)
(forward-line)
(setq bol (point)
--- 7640,7646 ----
(setq distance (- (match-beginning substr) bol))
(goto-char (match-beginning substr))
(delete-char width)
! (insert-char ?\s (+ (- max distance) spacing)))
(beginning-of-line)
(forward-line)
(setq bol (point)
***************
*** 8632,8642 ****
(if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
(cond ((= (preceding-char) vhdl-last-input-event)
(progn (delete-char -1)
! (unless (eq (preceding-char) ? ) (insert " "))
(insert ": ")
(setq this-command 'vhdl-electric-colon)))
((and
! (eq last-command 'vhdl-electric-colon) (= (preceding-char) ? ))
(progn (delete-char -1) (insert "= ")))
(t (insert-char ?\; 1)))
(self-insert-command count)))
--- 8632,8642 ----
(if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
(cond ((= (preceding-char) vhdl-last-input-event)
(progn (delete-char -1)
! (unless (eq (preceding-char) ?\s) (insert " "))
(insert ": ")
(setq this-command 'vhdl-electric-colon)))
((and
! (eq last-command 'vhdl-electric-colon) (= (preceding-char) ?\s))
(progn (delete-char -1) (insert "= ")))
(t (insert-char ?\; 1)))
(self-insert-command count)))
***************
*** 8646,8652 ****
(if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
(cond ((= (preceding-char) vhdl-last-input-event)
(progn (delete-char -1)
! (unless (eq (preceding-char) ? ) (insert " "))
(insert "<= ")))
(t (insert-char ?\, 1)))
(self-insert-command count)))
--- 8646,8652 ----
(if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
(cond ((= (preceding-char) vhdl-last-input-event)
(progn (delete-char -1)
! (unless (eq (preceding-char) ?\s) (insert " "))
(insert "<= ")))
(t (insert-char ?\, 1)))
(self-insert-command count)))
***************
*** 8656,8662 ****
(if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
(cond ((= (preceding-char) vhdl-last-input-event)
(progn (delete-char -1)
! (unless (eq (preceding-char) ? ) (insert " "))
(insert "=> ")))
(t (insert-char ?\. 1)))
(self-insert-command count)))
--- 8656,8662 ----
(if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
(cond ((= (preceding-char) vhdl-last-input-event)
(progn (delete-char -1)
! (unless (eq (preceding-char) ?\s) (insert " "))
(insert "=> ")))
(t (insert-char ?\. 1)))
(self-insert-command count)))
***************
*** 8666,8672 ****
(if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
(cond ((= (preceding-char) vhdl-last-input-event)
(progn (delete-char -1)
! (unless (eq (preceding-char) ? ) (insert " "))
(insert "== ")))
(t (insert-char ?\= 1)))
(self-insert-command count)))
--- 8666,8672 ----
(if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
(cond ((= (preceding-char) vhdl-last-input-event)
(progn (delete-char -1)
! (unless (eq (preceding-char) ?\s) (insert " "))
(insert "== ")))
(t (insert-char ?\= 1)))
(self-insert-command count)))
***************
*** 11343,11349 ****
(beginning-of-line)
(while (< (point) end)
(unless (looking-at "^$")
! (insert-char ? margin))
(beginning-of-line 2))
(goto-char start)
;; insert clock
--- 11343,11349 ----
(beginning-of-line)
(while (< (point) end)
(unless (looking-at "^$")
! (insert-char ?\s margin))
(beginning-of-line 2))
(goto-char start)
;; insert clock
***************
*** 11458,11464 ****
(when (> indent 0)
(while (string-match "^\\(--\\)" string)
(setq string (concat (substring string 0 (match-beginning 1))
! (make-string indent ? )
(substring string (match-beginning 1))))))
(beginning-of-line)
(insert string)
--- 11458,11464 ----
(when (> indent 0)
(while (string-match "^\\(--\\)" string)
(setq string (concat (substring string 0 (match-beginning 1))
! (make-string indent ?\s)
(substring string (match-beginning 1))))))
(beginning-of-line)
(insert string)
***************
*** 12885,12891 ****
(vhdl-replace-string
(cons "\\(.*\\) \\(.*\\)" (car vhdl-project-file-name))
(concat (subst-char-in-string
! ? ?_ (or (vhdl-project-p)
(error "ERROR: No current project")))
" " (user-login-name))))))
(list (read-file-name
--- 12885,12891 ----
(vhdl-replace-string
(cons "\\(.*\\) \\(.*\\)" (car vhdl-project-file-name))
(concat (subst-char-in-string
! ?\s ?_ (or (vhdl-project-p)
(error "ERROR: No current project")))
" " (user-login-name))))))
(list (read-file-name
***************
*** 14409,14415 ****
(vhdl-replace-string
(cons "\\(.*\\) \\(.*\\)" vhdl-speedbar-cache-file-name)
(concat
! (subst-char-in-string ? ?_ (or project "dir"))
" " (user-login-name)))))
(file-dir-name (expand-file-name file-name directory))
(cache-key (or project directory))
--- 14409,14415 ----
(vhdl-replace-string
(cons "\\(.*\\) \\(.*\\)" vhdl-speedbar-cache-file-name)
(concat
! (subst-char-in-string ?\s ?_ (or project "dir"))
" " (user-login-name)))))
(file-dir-name (expand-file-name file-name directory))
(cache-key (or project directory))
***************
*** 14479,14485 ****
(vhdl-replace-string
(cons "\\(.*\\) \\(.*\\)" vhdl-speedbar-cache-file-name)
(concat
! (subst-char-in-string ? ?_ (or (vhdl-project-p) "dir"))
" " (user-login-name)))))
(file-dir-name (expand-file-name file-name directory))
vhdl-cache-version)
--- 14479,14485 ----
(vhdl-replace-string
(cons "\\(.*\\) \\(.*\\)" vhdl-speedbar-cache-file-name)
(concat
! (subst-char-in-string ?\s ?_ (or (vhdl-project-p) "dir"))
" " (user-login-name)))))
(file-dir-name (expand-file-name file-name directory))
vhdl-cache-version)
***************
*** 15371,15380 ****
(insert (int-to-string depth) ":")
(put-text-property start (point) 'invisible t)
(setq visible-start (point))
! (insert-char ? (* depth speedbar-indentation-width))
(while (> offset 0)
(insert "|")
! (insert-char (if (= offset 1) ?- ? ) (1- speedbar-indentation-width))
(setq offset (1- offset)))
(put-text-property visible-start (point) 'invisible nil)
(setq start (point))
--- 15371,15380 ----
(insert (int-to-string depth) ":")
(put-text-property start (point) 'invisible t)
(setq visible-start (point))
! (insert-char ?\s (* depth speedbar-indentation-width))
(while (> offset 0)
(insert "|")
! (insert-char (if (= offset 1) ?- ?\s) (1- speedbar-indentation-width))
(setq offset (1- offset)))
(put-text-property visible-start (point) 'invisible nil)
(setq start (point))
***************
*** 15428,15434 ****
(insert (int-to-string depth) ":")
(put-text-property start (point) 'invisible t)
(setq visible-start (point))
! (insert-char ? (* depth speedbar-indentation-width))
(put-text-property visible-start (point) 'invisible nil)
(setq start (point))
(insert "[+]")
--- 15428,15434 ----
(insert (int-to-string depth) ":")
(put-text-property start (point) 'invisible t)
(setq visible-start (point))
! (insert-char ?\s (* depth speedbar-indentation-width))
(put-text-property visible-start (point) 'invisible nil)
(setq start (point))
(insert "[+]")
***************
*** 15436,15442 ****
start (point) 'speedbar-button-face 'speedbar-highlight-face
'vhdl-speedbar-expand-package pack-key)
(setq visible-start (point))
! (insert-char ? 1 nil)
(setq start (point))
(insert pack-name)
(speedbar-make-button
--- 15436,15442 ----
start (point) 'speedbar-button-face 'speedbar-highlight-face
'vhdl-speedbar-expand-package pack-key)
(setq visible-start (point))
! (insert-char ?\s 1 nil)
(setq start (point))
(insert pack-name)
(speedbar-make-button
***************
*** 15463,15469 ****
(insert (int-to-string depth) ":")
(put-text-property start (point) 'invisible t)
(setq visible-start (point))
! (insert-char ? (* depth speedbar-indentation-width))
(put-text-property visible-start (point) 'invisible nil)
(setq start (point))
(insert ">")
--- 15463,15469 ----
(insert (int-to-string depth) ":")
(put-text-property start (point) 'invisible t)
(setq visible-start (point))
! (insert-char ?\s (* depth speedbar-indentation-width))
(put-text-property visible-start (point) 'invisible nil)
(setq start (point))
(insert ">")
***************
*** 15499,15505 ****
(insert (int-to-string depth) ":")
(put-text-property start (point) 'invisible t)
(setq visible-start (point))
! (insert-char ? (* depth speedbar-indentation-width))
(put-text-property visible-start (point) 'invisible nil)
(setq start (point))
(insert ">")
--- 15499,15505 ----
(insert (int-to-string depth) ":")
(put-text-property start (point) 'invisible t)
(setq visible-start (point))
! (insert-char ?\s (* depth speedbar-indentation-width))
(put-text-property visible-start (point) 'invisible nil)
(setq start (point))
(insert ">")
***************
*** 15530,15536 ****
(insert (int-to-string depth) ":")
(put-text-property start (point) 'invisible t))
(setq visible-start (point))
! (insert-char ? (* (or depth 0) speedbar-indentation-width))
(setq start (point))
(insert text)
(speedbar-make-button start (point) nil nil nil nil)
--- 15530,15536 ----
(insert (int-to-string depth) ":")
(put-text-property start (point) 'invisible t))
(setq visible-start (point))
! (insert-char ?\s (* (or depth 0) speedbar-indentation-width))
(setq start (point))
(insert text)
(speedbar-make-button start (point) nil nil nil nil)
***************
*** 15972,15978 ****
(let ((project (vhdl-project-p)))
(if project
(vhdl-replace-string (car vhdl-components-package-name)
! (subst-char-in-string ? ?_ project))
(cdr vhdl-components-package-name))))
(defun vhdl-compose-new-component ()
--- 15972,15978 ----
(let ((project (vhdl-project-p)))
(if project
(vhdl-replace-string (car vhdl-components-package-name)
! (subst-char-in-string ?\s ?_ project))
(cdr vhdl-components-package-name))))
(defun vhdl-compose-new-component ()
***************
*** 16930,16942 ****
(while compiler-alist
;; add error message regexps
(setq error-regexp-alist
! (cons (append (list (make-symbol (concat "vhdl-"
(subst-char-in-string ? ?- (downcase (nth 0 (car
compiler-alist)))))))
(nth 11 (car compiler-alist)))
error-regexp-alist))
;; add filename regexps
(when (/= 0 (nth 1 (nth 12 (car compiler-alist))))
(setq error-regexp-alist
! (cons (append (list (make-symbol (concat "vhdl-"
(subst-char-in-string ? ?- (downcase (nth 0 (car compiler-alist))))
"-file")))
(nth 12 (car compiler-alist)))
error-regexp-alist)))
(setq compiler-alist (cdr compiler-alist)))
--- 16930,16942 ----
(while compiler-alist
;; add error message regexps
(setq error-regexp-alist
! (cons (append (list (make-symbol (concat "vhdl-"
(subst-char-in-string ?\s ?- (downcase (nth 0 (car
compiler-alist)))))))
(nth 11 (car compiler-alist)))
error-regexp-alist))
;; add filename regexps
(when (/= 0 (nth 1 (nth 12 (car compiler-alist))))
(setq error-regexp-alist
! (cons (append (list (make-symbol (concat "vhdl-"
(subst-char-in-string ?\s ?- (downcase (nth 0 (car compiler-alist))))
"-file")))
(nth 12 (car compiler-alist)))
error-regexp-alist)))
(setq compiler-alist (cdr compiler-alist)))
--
Best regards, Xue Fuqiao.
http://www.gnu.org/software/emacs/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-10-07 0:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-01 6:15 bug#15499: [PATCH] Using ?\s for space character in vhdl-mode Xue Fuqiao
2013-10-07 0:42 ` Glenn Morris
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.