unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Getting an error when working with php files in nXhtml mode
@ 2011-07-08  6:42 Vineet Naik
  2011-07-17  8:28 ` Andreas Röhler
  0 siblings, 1 reply; 4+ messages in thread
From: Vineet Naik @ 2011-07-08  6:42 UTC (permalink / raw)
  To: help-gnu-emacs

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

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)
  c-electric-paren(nil)
  call-interactively(c-electric-paren nil nil)

Please help!

Thanks.
-- 
Vineet Naik

[-- Attachment #2: Type: text/html, Size: 769 bytes --]

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

* Re: Getting an error when working with php files in nXhtml mode
  2011-07-08  6:42 Getting an error when working with php files in nXhtml mode Vineet Naik
@ 2011-07-17  8:28 ` Andreas Röhler
  2011-07-18  6:20   ` Vineet Naik
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Röhler @ 2011-07-17  8:28 UTC (permalink / raw)
  To: help-gnu-emacs

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)
>    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



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

* Re: Getting an error when working with php files in nXhtml mode
  2011-07-17  8:28 ` Andreas Röhler
@ 2011-07-18  6:20   ` Vineet Naik
  2011-07-18  6:44     ` Andreas Röhler
  0 siblings, 1 reply; 4+ messages in thread
From: Vineet Naik @ 2011-07-18  6:20 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: help-gnu-emacs

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

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 <http://www.nongnu.org/color-theme/>
(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öhler <
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)
>>   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
>
>


-- 
Vineet Naik

[-- Attachment #2: Type: text/html, Size: 17888 bytes --]

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

* Re: Getting an error when working with php files in nXhtml mode
  2011-07-18  6:20   ` Vineet Naik
@ 2011-07-18  6:44     ` Andreas Röhler
  0 siblings, 0 replies; 4+ messages in thread
From: Andreas Röhler @ 2011-07-18  6:44 UTC (permalink / raw)
  To: Vineet Naik; +Cc: help-gnu-emacs

Am 18.07.2011 08:20, schrieb Vineet Naik:
> 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

Hi Vineet,

unfortunatly can't see a related line in your post.

BTW would recommend copying stuff only when being able to read it - 
otherwise trouble is probable.

As not in active use here, can't track the error, sorry.

Please write to the Author/Maintainer, who is known being attentive.
nXhtml has it's own bug-report function BTW which you may use likewise.

Good luck,

Andreas



>
> ;; 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<http://www.nongnu.org/color-theme/>
> (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öhler<
> 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)
>>>    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
>>
>>
>
>




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

end of thread, other threads:[~2011-07-18  6:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-08  6:42 Getting an error when working with php files in nXhtml mode Vineet Naik
2011-07-17  8:28 ` Andreas Röhler
2011-07-18  6:20   ` Vineet Naik
2011-07-18  6:44     ` Andreas Röhler

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).