From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xue Fuqiao Newsgroups: gmane.emacs.bugs Subject: bug#15499: [PATCH] Using ?\s for space character in vhdl-mode Date: Tue, 1 Oct 2013 14:15:11 +0800 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1380608167 27631 80.91.229.3 (1 Oct 2013 06:16:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 1 Oct 2013 06:16:07 +0000 (UTC) To: 15499@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 01 08:16:11 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VQtFi-0001re-AN for geb-bug-gnu-emacs@m.gmane.org; Tue, 01 Oct 2013 08:16:10 +0200 Original-Received: from localhost ([::1]:52992 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQtFh-0008Hn-S0 for geb-bug-gnu-emacs@m.gmane.org; Tue, 01 Oct 2013 02:16:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56280) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQtFd-0008Hg-7e for bug-gnu-emacs@gnu.org; Tue, 01 Oct 2013 02:16:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VQtFa-0008Lf-Pb for bug-gnu-emacs@gnu.org; Tue, 01 Oct 2013 02:16:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38421) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQtFa-0008LX-LH for bug-gnu-emacs@gnu.org; Tue, 01 Oct 2013 02:16:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VQtFa-00009N-Dj for bug-gnu-emacs@gnu.org; Tue, 01 Oct 2013 02:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Xue Fuqiao Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 01 Oct 2013 06:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 15499 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs Original-Received: via spool by submit@debbugs.gnu.org id=B.1380608124524 (code B ref -1); Tue, 01 Oct 2013 06:16:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 1 Oct 2013 06:15:24 +0000 Original-Received: from localhost ([127.0.0.1]:46713 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VQtEx-00008M-LC for submit@debbugs.gnu.org; Tue, 01 Oct 2013 02:15:24 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54071) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VQtEt-00008D-U1 for submit@debbugs.gnu.org; Tue, 01 Oct 2013 02:15:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VQtEr-00081t-Fm for submit@debbugs.gnu.org; Tue, 01 Oct 2013 02:15:19 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:45888) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQtEr-00081n-Bm for submit@debbugs.gnu.org; Tue, 01 Oct 2013 02:15:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55732) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQtEp-0008FS-8e for bug-gnu-emacs@gnu.org; Tue, 01 Oct 2013 02:15:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VQtEn-0007ym-33 for bug-gnu-emacs@gnu.org; Tue, 01 Oct 2013 02:15:15 -0400 Original-Received: from mail-ie0-x234.google.com ([2607:f8b0:4001:c03::234]:52635) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQtEm-0007yJ-SK for bug-gnu-emacs@gnu.org; Tue, 01 Oct 2013 02:15:13 -0400 Original-Received: by mail-ie0-f180.google.com with SMTP id u16so12484699iet.39 for ; Mon, 30 Sep 2013 23:15:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=kbM+VXI8ok+8A39sNLEg2NpqFZUfReN4QL50L/N1qp8=; b=zk0al1n///qsU6B5Y6/WpGgcgYiNB0tQsrCbBePD1KaS3gY118gJyLqOiGolEGtQLn vW1x0se3UGpf5lC0U4wdd1aV+n/itP9YxaK2l/s8EAUuBM+ougzOZtMGHa3sYsuO5w1T oAU/GU23zrTSx0NHpXBO8liPyf/sQC8RLj37d/XAf45exTJasjL2oEduKXHVAuggmYJu 7lZZLtRHB7tcozqFt+Ma0HVkF6ZanOXHM44hAfjGb2meKsmyfVTi4bGjtQVpBDoRzFPi II0aSM8DXw6lHoceDeW7JgyZWdCQK4sy6b43/nkCVC2qwOu0yznh8Um1vxtckHzNIqA0 piOw== X-Received: by 10.50.17.97 with SMTP id n1mr16576240igd.51.1380608111918; Mon, 30 Sep 2013 23:15:11 -0700 (PDT) Original-Received: by 10.42.133.72 with HTTP; Mon, 30 Sep 2013 23:15:11 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:78835 Archived-At: 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/