Skip to content
Snippets Groups Projects
Commit f33b8f85 authored by llaffont's avatar llaffont
Browse files

Phafi: indentation javascript forcée à 2, chargement web-mode sur les phtml

parent 8588354d
No related merge requests found
......@@ -5846,6 +5846,9 @@ scripts/emacs/phpunit.el -text
scripts/emacs/popup-0.5/popup-autoloads.el -text
scripts/emacs/popup-0.5/popup-pkg.el -text
scripts/emacs/popup-0.5/popup.el -text
scripts/emacs/web-mode-master/README.md -text
scripts/emacs/web-mode-master/web-mode.el -text
scripts/emacs/web-mode-master/wfs-mode.el -text
scripts/find_tests.php -text
scripts/import_avis_csv.php -text
scripts/import_sitotheque.php -text
......
......@@ -35,18 +35,25 @@
(phafi-autoload-load "nxhtml-2.08-100425")
(phafi-autoload-load "popup-0.5")
(phafi-autoload-load "auto-complete-1.4")
(phafi-autoload-load "web-mode-master")
(require 'php-mode)
(add-to-list 'auto-mode-alist '("\\.php[34]?\\'\\|\\.phtml\\'" . php-mode))
(require 'magit)
(require 'magit-svn)
(add-hook 'magit-mode-hook 'turn-on-magit-svn)
;; (load "nxhtml-2.08-100425/autostart.el")
;; (add-to-list 'auto-mode-alist '("\\.phtml\\'" . nxhtml-mumamo-mode))
;; (require 'nxhtml-autostart)
(require 'js)
(defun phafi-js-mode()
(setq js-indent-level 2)
)
(add-hook 'js-mode-hook 'phafi-js-mode)
(require 'phafi-mode)
(defun phafi-autoload-php-mode()
......@@ -55,5 +62,18 @@
(add-hook 'php-mode-hook 'phafi-autoload-php-mode t)
(require 'web-mode)
(add-to-list 'auto-mode-alist '("\\.phtml\\'" . web-mode))
(setq web-mode-engines-alist '(("php" . "\\.phtml\\'")) )
(defun phafi-web-mode-hook ()
"Hooks for Web mode."
(setq web-mode-markup-indent-offset 2)
(phafi-mode))
(add-hook 'web-mode-hook 'phafi-web-mode-hook)
(unless (featurep 'phafi-autoload)
(provide 'phafi-autoload))
web-mode.el [![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/thing/1849746/web-mode-el)
=========
web-mode.el is an emacs major mode for editing **web templates** aka HTML files embedding client parts (CSS/JavaScript) and server blocks.
web-mode.el is compatible with many template engines: PHP, JSP, ASP, Django, Twig, Jinja(2), ERB, FreeMarker, Velocity, Cheetah, Smarty, CTemplate, Mustache, Blade, ErlyDTL, Go Template, Dust.js, Google Closure (soy), etc.
More infos on http://web-mode.org/
![ScreenShot](http://web-mode.org/web-mode.png?v=1)
This source diff could not be displayed because it is too large. You can view the blob instead.
;;; wfs-mode.el --- minor mode for accessing files by http
;; Copyright 2013 François-Xavier Bois
;; Version: 0.0.1
;; Author: François-Xavier Bois <fxbois AT Google Mail Service>
;; Maintainer: François-Xavier Bois
;; Created: August 2013
;; Keywords: files http network
;; =========================================================================
;; This work is sponsored by Kernix : Digital Agency (Web & Mobile) in Paris
;; =========================================================================
;; This file is not part of Emacs
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;; This file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to
;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;; Code goes here
(defgroup wfs nil
"web fs."
:group 'comm
:group 'files
:version "0.0.1")
(defcustom wfs-verbose nil
"Verbosity."
:group 'wfs
:type 'boolean)
(defcustom wfs-repo-alist nil
"List of repositories."
:group 'wfs
:type 'list)
(defvar wfs-repo nil)
(defun wfs-repo-names ()
"Repo names."
;; (interactive)
(let ((names '("scopalto" "titi<")))
names
))
(defun wfs-connect (repo)
"connect to a repo."
(interactive
(list (completing-read
"Repo: "
(wfs-repo-names))))
;; (message "repo=%S" repo)
(setq wfs-repo repo)
)
(defun wfs-url-get (url)
"url get"
(with-current-buffer (url-retrieve-synchronously "http://localhost")
(goto-char (point-min))
(re-search-forward "^$")
(forward-char)
(buffer-substring-no-properties (point) (point-max)))
)
(defun wfs-open ()
"open remote file."
(interactive)
(unless wfs-repo
(call-interactively 'wfs-connect))
(unless wfs-repo
(error "select a repo"))
(let (name buffer enable-local-variables magic-mode-alist)
(setq name (concat "wsf://" wfs-repo "/www/test.psp"))
(setq buffer (get-buffer name))
(if buffer
(switch-to-buffer buffer)
(setq buffer (get-buffer-create name))
(switch-to-buffer buffer)
(with-silent-modifications
(insert (wfs-url-get "http://localhost"))
(set-visited-file-name "www-test.psp")
;; (message "%S" (buffer-file-name))
(set-auto-mode)
(rename-buffer name)
;; (set-visited-file-name nil)
;; (web-mode)
)
;; (not-modified)
);if
);let
)
(defun wfs-save ()
"save local buffer to remote file."
(interactive))
(defun wfs-reload ()
"Reload wfs-mode."
(interactive)
(unload-feature 'wfs-mode)
(wfs-mode)
(when (fboundp 'wfs-mode-hook)
(wfs-mode-hook))
(message "wfs is reloaded")
)
(define-minor-mode wfs-mode
"web fs."
;;(wfs-connect)
)
(provide 'wfs-mode)
;;; wfs-mode.el ends here
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment