From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vineet Naik Newsgroups: gmane.emacs.help Subject: Re: Getting an error when working with php files in nXhtml mode Date: Mon, 18 Jul 2011 11:50:17 +0530 Message-ID: References: <4E229D26.5060504@easy-emacs.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0015174beb2e2dd6d204a851fe90 X-Trace: dough.gmane.org 1310970162 18216 80.91.229.12 (18 Jul 2011 06:22:42 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 18 Jul 2011 06:22:42 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: =?ISO-8859-1?Q?Andreas_R=F6hler?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jul 18 08:22:38 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QihDx-000298-E8 for geh-help-gnu-emacs@m.gmane.org; Mon, 18 Jul 2011 08:22:37 +0200 Original-Received: from localhost ([::1]:37354 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QihDw-0005lc-BG for geh-help-gnu-emacs@m.gmane.org; Mon, 18 Jul 2011 02:22:36 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:45177) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QihBp-0005i9-S8 for help-gnu-emacs@gnu.org; Mon, 18 Jul 2011 02:20:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QihBk-0002OX-C8 for help-gnu-emacs@gnu.org; Mon, 18 Jul 2011 02:20:25 -0400 Original-Received: from mail-fx0-f52.google.com ([209.85.161.52]:49542) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QihBj-0002OJ-Ka for help-gnu-emacs@gnu.org; Mon, 18 Jul 2011 02:20:20 -0400 Original-Received: by fxd18 with SMTP id 18so4950890fxd.39 for ; Sun, 17 Jul 2011 23:20:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=2tYrV//0DfWdH3TUQ2ege+QgwpoLhRXE1zKK6WenM6o=; b=jUbSWedyfhS/WRJY6S60BBOpEruoJrW2eqPRjv13jo00h/Z97Cj2lF/nE1bzjlp8Tr Oqs3x32Vz1tN4HSmWRmPpQ/Y5uTN8b/rw5WRE/F2r2f0P2BZvdgmgzbkHQbPgTUG6PaS ODqfQBedTI1j04c0Si0UaWoMhoTo7rbyTJtyA= Original-Received: by 10.223.99.149 with SMTP id u21mr3482545fan.121.1310970017076; Sun, 17 Jul 2011 23:20:17 -0700 (PDT) Original-Received: by 10.223.6.88 with HTTP; Sun, 17 Jul 2011 23:20:17 -0700 (PDT) In-Reply-To: <4E229D26.5060504@easy-emacs.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.161.52 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:81643 Archived-At: --0015174beb2e2dd6d204a851fe90 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Andreas, Thank you for replying. Following is my .emacs file. I don't quite know emacs lisp so it mostly contains stuff copy pasted from forums and blogs ;; for php, xhtml, js mixed docs etc. (load "~/emacs/nxhtml/autostart.el") ;; Sets the basic indentation for C/php source files ;; to four spaces. (setq c-basic-offset 4) ;; I hate tabs! (setq-default indent-tabs-mode nil) ;; I hate line-wrapping! (setq-default truncate-lines t) ;; show line numbers on left (global-linum-mode t) ;; This .emacs file illustrates the minimul setup ;; required to run the JDE. ;; Set the debug option to enable a backtrace when a ;; problem occurs. (setq debug-on-error t) ;; Update the Emacs load-path to include the path to ;; the JDE and its require packages. This code assumes ;; that you have installed the packages in the emacs/site ;; subdirectory of your home directory. (add-to-list 'load-path (expand-file-name "~/emacs/site/jde/lisp")) (add-to-list 'load-path (expand-file-name "~/emacs/site/cedet-1.0/common")) (add-to-list 'load-path (expand-file-name "~/usr/share/emacs/site-lisp/elib")) ;; Initialize CEDET. (load-file (expand-file-name "~/emacs/site/cedet-1.0/common/cedet.el")) ;; If you want Emacs to defer loading the JDE until you open a ;; Java file, edit the following line (setq defer-loading-jde nil) ;; to read: ;; ;; (setq defer-loading-jde t) ;; (if defer-loading-jde (progn (autoload 'jde-mode "jde" "JDE mode." t) (setq auto-mode-alist (append '(("\\.java\\'" . jde-mode)) auto-mode-alist))) (require 'jde)) ;; Sets the basic indentation for Java source files ;; to four spaces. (defun my-jde-mode-hook () (setq c-basic-offset 4)) (add-hook 'jde-mode-hook 'my-jde-mode-hook) (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(espresso-indent-level 2) '(jde-compiler (quote (("eclipse java compiler server" "/home/vineet/eclipse/plugins/org.eclipse.jdt.core_3.5.2.v_981_R35x.jar")))= ) '(jde-jdk (quote ("1.6.0_20"))) '(jde-jdk-registry (quote (("1.6.0_20" . "/usr/lib/jvm/java-6-openjdk")))) '(jde-run-working-directory "/home/vineet/java/trial/src/") '(nxml-bind-meta-tab-to-complete-flag t) '(nxml-child-indent 4) '(nxml-outline-child-indent 2)) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(default ((t (:inherit nil :stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 113 :width normal :foundry "bitstream" :family "Courier 10 Pitch")))) '(mumamo-background-chunk-major ((((class color) (min-colors 88) (background light)) nil))) '(mumamo-background-chunk-submode1 ((((class color) (min-colors 88) (background light)) nil)))) (add-to-list 'load-path (expand-file-name "~/emacs/site/common")) ;; espresso (javascript mode) (autoload #'espresso-mode "espresso" "Start espresso-mode" t) (add-to-list 'auto-mode-alist '("\\.js$" . espresso-mode)) (add-to-list 'auto-mode-alist '("\\.json$" . espresso-mode)) ;;;;;;;;;;;;;;;;;;;;;;;;;;; php-mode ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; php, tpl etc (add-to-list 'auto-mode-alist '("\\.tpl\\'" . php-mode)) ;; for better array indentation in php (add-hook 'php-mode-hook (lambda () (defun ywb-php-lineup-arglist-intro (langelem) (save-excursion (goto-char (cdr langelem)) (vector (+ (current-column) c-basic-offset)))) (defun ywb-php-lineup-arglist-close (langelem) (save-excursion (goto-char (cdr langelem)) (vector (current-column)))) (c-set-offset 'arglist-intro 'ywb-php-lineup-arglist-intro) (c-set-offset 'arglist-close 'ywb-php-lineup-arglist-close))) ;;;;;;;;;;;;;;;;;;;;;;;;;;; flymake ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (require 'flymake) ;; flymake for php (defun flymake-php-init () "Use php to check the syntax of the current file." (let* ((temp (flymake-init-create-temp-buffer-copy 'flymake-create-temp-inplace)) (local (file-relative-name temp (file-name-directory buffer-file-name)))) (list "php" (list "-f" local "-l")))) (add-to-list 'flymake-err-line-patterns '("\\(Parse\\|Fatal\\) error: +\\(.*?\\) in \\(.*?\\) on line \\([0-9]+\\)$" 3 4 nil 2)) (add-to-list 'flymake-allowed-file-name-masks '("\\.php$" flymake-php-init)= ) ;; flymake for java (require 'jde-eclipse-compiler-server) (add-to-list 'flymake-allowed-file-name-masks '("\\.java$" jde-ecj-server-flymake-init jde-ecj-flymake-cleanup)) (add-hook 'find-file-hook 'flymake-mode) ;;;;;;;;;;;;;;;;;;;;;;;;;;; themes ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;= ; ;; color themes (require 'color-theme) ;; solarized theme (add-to-list 'load-path (expand-file-name "~/emacs/site/common/solarized-theme")) (require 'color-theme-solarized) (color-theme-solarized-dark) ;; zenburn theme ;;(require 'color-theme-zenburn) ;;(color-theme-zenburn) ;;;;;;;;;;;;;;;;;;;;;;;;; YasSnippet ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (require 'yasnippet-bundle) ;;;;;;;;;;;;;;;;;;;;;;;;; Markdown mode ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (autoload 'markdown-mode "markdown-mode.el" "Major mode for editing Markdown files" t) (setq auto-mode-alist (cons '("\\.md" . markdown-mode) auto-mode-alist)) On Sun, Jul 17, 2011 at 1:58 PM, Andreas R=F6hler < andreas.roehler@easy-emacs.de> wrote: > Am 08.07.2011 08:42, schrieb Vineet Naik: > > Hi, >> >> I am getting an error while working in .php files that also contain some >> html. >> >> I always get an error whenever typing the opening or closing brackets ( = () >> ) >> inside php code >> >> for eg. if I type >> >> getName(); ?> >> >> it shows me following error after typing ( and ) in getName() >> >> Debugger entered--Lisp error: (wrong-type-argument listp set-from-style) >> c-electric-paren(nil) >> call-interactively(c-electric-**paren nil nil) >> >> Please help! >> >> Thanks. >> > > Hi, > > not using these modes actively: > > seems c-electric-paren installs a global key. > Maybe have a look into your init. > > HTH, > > Andreas > > --=20 Vineet Naik --0015174beb2e2dd6d204a851fe90 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Andreas,

Thank you for replying. Following is my .ema= cs file. I don't quite know emacs lisp so it mostly contains stuff copy= pasted from forums and blogs

;; for php, xh= tml, js mixed docs etc.
(load "~/emacs/nxhtml/autostart.el")

;; Sets the basic indentat= ion for C/php source files
;; to four spaces.
(setq c-basic-offse= t 4)
;; I= hate tabs!
(setq-default inden= t-tabs-mode nil)

;; I hate line-wrapping!
(setq-default trunc= ate-lines t)

;; show line numbers on left
(global-linum-mode = t)

=
;; Thi= s .emacs file illustrates the minimul setup
;; required to run = the JDE.

= ;; Set the debug option to enable a backtrace when a
;; problem occurs.<= /font>
(setq d= ebug-on-error t)

;; Upd= ate the Emacs load-path to include the path to
;; the JDE and its require packages= . This code assumes
;; that you have in= stalled the packages in the emacs/site
;; subdirectory of your home directory.
(add-to-list 'l= oad-path (expand-file-name "~/emacs/site/jde/lisp"))
=
(add-to-list 'l= oad-path (expand-file-name "~/emacs/site/cedet-1.0/common"))
(add-to-list 'l= oad-path (expand-file-name "~/usr/share/emacs/site-lisp/elib"))

;; Initialize CEDET= .
(load= -file (expand-file-name "~/emacs/site/cedet-1.0/common/cedet.el")= )


;; If you want Emacs to= defer loading the JDE until you open a=A0
;; Java file, edit = the following line
(setq defer-loading-jde nil)
;; to read:
;;
;; =A0(setq defer-loadi= ng-jde t)
;;

(if defer-loading-jde=
=A0 = =A0 (progn
=A0 =A0 =A0 (autolo= ad 'jde-mode "jde" "JDE mode." t)
= =A0 =A0 =A0 (setq auto-m= ode-alist
=A0 =A0(append
<= div> =A0 =A0 '(("\\.java\= \'" . jde-mode))
=A0 =A0 auto-mode-alist)))
=A0 (req= uire 'jde))


;; Sets the basic inden= tation for Java source files
;; to four spaces.<= /font>
(defun = my-jde-mode-hook ()
=A0 (setq c-basic-offset 4))

(add-hook 'jde-mo= de-hook 'my-jde-mode-hook)
(custom-set-variables
=A0 ;; custom-set-v= ariables was added by Custom.
=A0 ;; If you edit it by hand, you could mess it up,= so be careful.
=A0 ;; Your init fi= le should contain only one such instance.
=A0 ;; If there is more than one, they w= on't work right.
=A0'(espresso-i= ndent-level 2)
=A0'(jde-compiler (quote (("eclipse java compiler server&q= uot; "/home/vineet/eclipse/plugins/org.eclipse.jdt.core_3.5.2.v_981_R3= 5x.jar"))))
=A0'(jde-jdk (q= uote ("1.6.0_20")))
=A0'(jde-jdk-registry (quote (("1.6.0_20&qu= ot; . "/usr/lib/jvm/java-6-openjdk"))))
=A0'(jde-run-wo= rking-directory "/home/vineet/java/trial/src/")
= =A0'(nxml-bind-meta-= tab-to-complete-flag t)
=A0'(nxml-child= -indent 4)
=A0'(nxml-outline-child-indent 2))
(custom-set-faces
=A0 ;; custom-set-f= aces was added by Custom.
=A0 ;; If you edit it by hand, you could mess it up, so = be careful.
=A0 ;; Your init fi= le should contain only one such instance.
=A0 ;; If there is more than one, they w= on't work right.
=A0'(default ((= t (:inherit nil :stipple nil :background "white" :foreground &quo= t;black" :inverse-video nil :box nil :strike-through nil :overline nil= :underline nil :slant normal :weight normal :height 113 :width normal :fou= ndry "bitstream" :family "Courier 10 Pitch"))))<= /div>
=A0'(mumamo-bac= kground-chunk-major ((((class color) (min-colors 88) (background light)) ni= l)))
= =A0'(mumamo-background-chunk-submode1 ((((class color) (min-colors 88) = (background light)) nil))))

(add-to-list 'loa= d-path (expand-file-name "~/emacs/site/common"))

;; esp= resso (javascript mode)
(autoload #'espresso-mode "espresso" "S= tart espresso-mode" t)
(add-to-list 'a= uto-mode-alist '("\\.js$" . espresso-mode))
= (add-to-list 'auto-m= ode-alist '("\\.json$" . espresso-mode))

;;;;;;;;;;;;;;;;;;;;;= ;;;;;; php-mode ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; php, tpl etc
(add-to-list 'a= uto-mode-alist '("\\.tpl\\'" . php-mode))

= ;; for better array inde= ntation in php
(add-hook 'php-= mode-hook (lambda ()
=A0 =A0 (defun ywb-php-lineup-arglist-intro (langelem)=
=A0 =A0 =A0 (save-excurs= ion
=A0= =A0 =A0 =A0 (goto-char (cdr langelem))
=A0 =A0 =A0 =A0 (vector (+ (current-column= ) c-basic-offset))))
=A0 =A0 (defun ywb-= php-lineup-arglist-close (langelem)
=A0 =A0 =A0 (save-excursion
<= font class=3D"Apple-style-span" color=3D"#006600">=A0 =A0 =A0 =A0 (goto-cha= r (cdr langelem))
=A0 =A0 =A0 =A0 (ve= ctor (current-column))))
=A0 =A0 (c-set-offset 'arglist-intro 'ywb-php-lin= eup-arglist-intro)
=A0 =A0 (c-set-offs= et 'arglist-close 'ywb-php-lineup-arglist-close)))

<= font class=3D"Apple-style-span" color=3D"#006600">;;;;;;;;;;;;;;;;;;;;;;;;;= ;; flymake ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(require 'flyma= ke)
;; fl= ymake for php
(defun flymake-php-= init ()
=A0 "Use php to check the syntax of the current file."
=A0 (let* ((temp (flymak= e-init-create-temp-buffer-copy 'flymake-create-temp-inplace))
(local (file-relative-nam= e temp (file-name-directory buffer-file-name))))
=A0 =A0 (list "= ;php" (list "-f" local "-l"))))
<= font class=3D"Apple-style-span" color=3D"#006600">
(add-to-list 'flymake-e= rr-line-patterns
=A0 '("\\(= Parse\\|Fatal\\) error: +\\(.*?\\) in \\(.*?\\) on line \\([0-9]+\\)$"= 3 4 nil 2))

(add-t= o-list 'flymake-allowed-file-name-masks '("\\.php$" flyma= ke-php-init))

;; fly= make for java
(require 'jde-eclipse-compiler-server)

(add-t= o-list 'flymake-allowed-file-name-masks '("\\.java$" jde-= ecj-server-flymake-init jde-ecj-flymake-cleanup))=A0

(add-h= ook 'find-file-hook 'flymake-mode)

;;;;;;;;;;;;;;;;;;;;;;;;;;; themes ;;;;;;= ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(require 'color-theme)

;; solarized theme
(add-to-l= ist 'load-path (expand-file-name "~/emacs/site/common/solarized-th= eme"))
(require 'color= -theme-solarized)
(color-theme-solarized-dark)

;; zen= burn theme
;;(require 'color-theme-zenburn)
;;(color-theme-zenburn)


;;;;;;;;;;;;;;;;;;;;;;;= ;; YasSnippet ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(require 'yasni= ppet-bundle)

;;;;;;;;;;;;;;;;;;;;;;;;; Markdown mode ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;= ;;;;;;
(autoload 'mark= down-mode "markdown-mode.el"
=A0 =A0"Major mode for editing Markdow= n files" t)
(setq auto-mode-ali= st
=A0 = =A0(cons '("\\.md" . markdown-mode) auto-mode-alist))<= /div>



On Sun,= Jul 17, 2011 at 1:58 PM, Andreas R=F6hler <andreas.roehler@easy-emacs.de>= ; wrote:
Am 08.07.2011 08:42, schrieb Vineet Naik:

Hi,

I am getting an error while working in .php files that also contain some html.

I always get an error whenever typing the opening or closing brackets ( () = )
inside php code

for eg. if I type

<td><?php echo $person->getName(); ?></td>

it shows me following error after typing ( and ) in getName()

Debugger entered--Lisp error: (wrong-type-argument listp set-from-style) =A0 c-electric-paren(nil)
=A0 call-interactively(c-electric-paren nil nil)

Please help!

Thanks.

Hi,

not using these modes actively:

seems c-electric-paren installs a global key.
Maybe have a look into your init.

HTH,

Andreas




--
Vineet Naik
<= br>
--0015174beb2e2dd6d204a851fe90--