php-elisp-1.5.0/0000775000175000017500000000000011104104175013350 5ustar thierrythierryphp-elisp-1.5.0/php-mode.el0000775000175000017500000013623511104074137015424 0ustar thierrythierry;;; php-mode.el --- major mode for editing PHP code ;; Copyright (C) 1999, 2000, 2001, 2003, 2004 Turadg Aleahmad ;; 2008 Aaron S. Hawley ;; Maintainer: Aaron S. Hawley ;; Author: Turadg Aleahmad, 1999-2004 ;; Keywords: php languages oop ;; Created: 1999-05-17 ;; Modified: 2008-11-04 ;; X-URL: http://php-mode.sourceforge.net/ (defconst php-mode-version-number "1.5.0" "PHP Mode version number.") ;;; License ;; 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 3 ;; of the License, 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 this file; if not, write to the Free Software ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ;; 02110-1301, USA. ;;; Usage ;; Put this file in your Emacs lisp path (eg. site-lisp) and add to ;; your .emacs file: ;; ;; (require 'php-mode) ;; To use abbrev-mode, add lines like this: ;; (add-hook 'php-mode-hook ;; '(lambda () (define-abbrev php-mode-abbrev-table "ex" "extends"))) ;; To make php-mode compatible with html-mode, see http://php-mode.sf.net ;; Many options available under Help:Customize ;; Options specific to php-mode are in ;; Programming/Languages/Php ;; Since it inherits much functionality from c-mode, look there too ;; Programming/Languages/C ;;; Commentary: ;; PHP mode is a major mode for editing PHP 3 and 4 source code. It's ;; an extension of C mode; thus it inherits all C mode's navigation ;; functionality. But it colors according to the PHP grammar and indents ;; according to the PEAR coding guidelines. It also includes a couple ;; handy IDE-type features such as documentation search and a source ;; and class browser. ;;; Contributors: (in chronological order) ;; Juanjo, Torsten Martinsen, Vinai Kopp, Sean Champ, Doug Marcey, ;; Kevin Blake, Rex McMaster, Mathias Meyer, Boris Folgmann, Roland ;; Rosenfeld, Fred Yankowski, Craig Andrews, John Keller, Ryan ;; Sammartino, ppercot, Valentin Funk, Stig Bakken, Gregory Stark, ;; Chris Morris, Nils Rennebarth, Gerrit Riessen, Eric Mc Sween, ;; Ville Skytta, Giacomo Tesio, Lennart Borgman, Stefan Monnier, ;; Aaron S. Hawley, Ian Eure, Bill Lovett, Dias Badekas, David House ;;; Changelog: ;; 1.5 ;; Support function keywords like public, private and the ampersand ;; character for function-based commands. Support abstract, final, ;; static, public, private and protected keywords in Imenu. Fix ;; reversed order of Imenu entries. Use font-lock-preprocessor-face ;; for PHP and ASP tags. Make php-mode-modified a literal value ;; rather than a computed string. Add date and time constants of ;; PHP. (Dias Badekas) Fix false syntax highlighting of keywords ;; because of underscore character. Change HTML indentation warning ;; to match only HTML at the beginning of the line. Fix ;; byte-compiler warnings. Clean-up whitespace and audited style ;; consistency of code. Remove conditional bindings and XEmacs code ;; that likely does nothing. ;; ;; 1.4 ;; Updated GNU GPL to version 3. Ported to Emacs 22 (CC mode ;; 5.31). M-x php-mode-version shows version. Provide end-of-defun ;; beginning-of-defun functionality. Support add-log library. ;; Fix __CLASS__ constant (Ian Eure). Allow imenu to see visibility ;; declarations -- "private", "public", "protected". (Bill Lovett) ;; ;; 1.3 ;; Changed the definition of # using a tip from Stefan ;; Monnier to correct highlighting and indentation. (Lennart Borgman) ;; Changed the highlighting of the HTML part. (Lennart Borgman) ;; ;; See the ChangeLog file included with the source package. ;;; Code: (require 'speedbar) (require 'font-lock) (require 'cc-mode) (require 'cc-langs) (require 'custom) (require 'etags) (eval-when-compile (require 'regexp-opt)) ;; Local variables (defgroup php nil "Major mode `php-mode' for editing PHP code." :prefix "php-" :group 'languages) (defcustom php-default-face 'default "Default face in `php-mode' buffers." :type 'face :group 'php) (defcustom php-speedbar-config t "When set to true automatically configures Speedbar to observe PHP files. Ignores php-file patterns option; fixed to expression \"\\.\\(inc\\|php[s34]?\\)\"" :type 'boolean :set (lambda (sym val) (set-default sym val) (if (and val (boundp 'speedbar)) (speedbar-add-supported-extension "\\.\\(inc\\|php[s34]?\\|phtml\\)"))) :group 'php) (defcustom php-mode-speedbar-open nil "Normally `php-mode' starts with the speedbar closed. Turning this on will open it whenever `php-mode' is loaded." :type 'boolean :set (lambda (sym val) (set-default sym val) (when val (speedbar 1))) :group 'php) (defvar php-imenu-generic-expression '( ("Private Methods" "^\\s-*\\(?:\\(?:abstract\\|final\\)\\s-+\\)?private\\s-+\\(?:static\\s-+\\)?function\\s-+\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-*(" 1) ("Protected Methods" "^\\s-*\\(?:\\(?:abstract\\|final\\)\\s-+\\)?protected\\s-+\\(?:static\\s-+\\)?function\\s-+\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-*(" 1) ("Public Methods" "^\\s-*\\(?:\\(?:abstract\\|final\\)\\s-+\\)?public\\s-+\\(?:static\\s-+\\)?function\\s-+\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-*(" 1) ("Classes" "^\\s-*class\\s-+\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-*" 1) ("All Functions" "^\\s-*\\(?:\\(?:abstract\\|final\\|private\\|protected\\|public\\|static\\)\\s-+\\)*function\\s-+\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-*(" 1) ) "Imenu generic expression for PHP Mode. See `imenu-generic-expression'." ) (defcustom php-manual-url "http://www.php.net/manual/en/" "URL at which to find PHP manual. You can replace \"en\" with your ISO language code." :type 'string :group 'php) (defcustom php-search-url "http://www.php.net/" "URL at which to search for documentation on a word." :type 'string :group 'php) (defcustom php-completion-file "" "Path to the file which contains the function names known to PHP." :type 'string :group 'php) (defcustom php-manual-path "" "Path to the directory which contains the PHP manual." :type 'string :group 'php) ;;;###autoload (defcustom php-file-patterns '("\\.php[s34]?\\'" "\\.phtml\\'" "\\.inc\\'") "List of file patterns for which to automatically invoke `php-mode'." :type '(repeat (regexp :tag "Pattern")) :set (lambda (sym val) (set-default sym val) (let ((php-file-patterns-temp val)) (while php-file-patterns-temp (add-to-list 'auto-mode-alist (cons (car php-file-patterns-temp) 'php-mode)) (setq php-file-patterns-temp (cdr php-file-patterns-temp))))) :group 'php) (defcustom php-mode-hook nil "List of functions to be executed on entry to `php-mode'." :type 'hook :group 'php) (defcustom php-mode-pear-hook nil "Hook called when a PHP PEAR file is opened with `php-mode'." :type 'hook :group 'php) (defcustom php-mode-force-pear nil "Normally PEAR coding rules are enforced only when the filename contains \"PEAR.\" Turning this on will force PEAR rules on all PHP files." :type 'boolean :group 'php) (defconst php-mode-modified "2008-11-04" "PHP Mode build date.") (defun php-mode-version () "Display string describing the version of PHP mode." (interactive) (message "PHP mode %s of %s" php-mode-version-number php-mode-modified)) (defconst php-beginning-of-defun-regexp "^\\s-*\\(?:\\(?:abstract\\|final\\|private\\|protected\\|public\\|static\\)\\s-+\\)*function\\s-+&?\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-*(" "Regular expression for a PHP function.") (defun php-beginning-of-defun (&optional arg) "Move to the beginning of the ARGth PHP function from point. Implements PHP version of `beginning-of-defun-function'." (interactive "p") (let ((arg (or arg 1))) (while (> arg 0) (re-search-backward php-beginning-of-defun-regexp nil 'noerror) (setq arg (1- arg))) (while (< arg 0) (end-of-line 1) (let ((opoint (point))) (beginning-of-defun 1) (forward-list 2) (forward-line 1) (if (eq opoint (point)) (re-search-forward php-beginning-of-defun-regexp nil 'noerror)) (setq arg (1+ arg)))))) (defun php-end-of-defun (&optional arg) "Move the end of the ARGth PHP function from point. Implements PHP befsion of `end-of-defun-function' See `php-beginning-of-defun'." (interactive "p") (php-beginning-of-defun (- (or arg 1)))) (defvar php-warned-bad-indent nil) (make-variable-buffer-local 'php-warned-bad-indent) ;; Do it but tell it is not good if html tags in buffer. (defun php-check-html-for-indentation () (let ((html-tag-re "^\\s-*") (here (point))) (if (not (or (re-search-forward html-tag-re (line-end-position) t) (re-search-backward html-tag-re (line-beginning-position) t))) t (goto-char here) (setq php-warned-bad-indent t) (lwarn 'php-indent :warning "\n\t%s\n\t%s\n\t%s\n" "Indentation fails badly with mixed HTML and PHP." "Look for an Emacs Lisp library that supports \"multiple" "major modes\" like mumamo, mmm-mode or multi-mode.") nil))) (defun php-cautious-indent-region (start end &optional quiet) (if (or php-warned-bad-indent (php-check-html-for-indentation)) (funcall 'c-indent-region start end quiet))) (defun php-cautious-indent-line () (if (or php-warned-bad-indent (php-check-html-for-indentation)) (funcall 'c-indent-line))) (defconst php-tags '("" "[^_]?") '(1 font-lock-constant-face)) ;; Fontify keywords (cons (concat "[^_$]?\\<\\(" php-keywords "\\)\\>[^_]?") '(1 font-lock-keyword-face)) ;; Fontify keywords and targets, and case default tags. (list "\\<\\(break\\|case\\|continue\\)\\>\\s-+\\(-?\\sw+\\)?" '(1 font-lock-keyword-face) '(2 font-lock-constant-face t t)) ;; This must come after the one for keywords and targets. '(":" ("^\\s-+\\(\\sw+\\)\\s-+\\s-+$" (beginning-of-line) (end-of-line) (1 font-lock-constant-face))) ;; treat 'print' as keyword only when not used like a function name '("\\" . font-lock-keyword-face) ;; Fontify PHP tag (cons php-tags-key font-lock-preprocessor-face) ;; Fontify ASP-style tag '("<\\%\\(=\\)?" . font-lock-preprocessor-face) '("\\%>" . font-lock-preprocessor-face) ) "Subdued level highlighting for PHP mode.") (defconst php-font-lock-keywords-2 (append php-font-lock-keywords-1 (list ;; class declaration '("\\<\\(class\\|interface\\)\\s-+\\(\\sw+\\)?" (1 font-lock-keyword-face) (2 font-lock-type-face nil t)) ;; handle several words specially, to include following word, ;; thereby excluding it from unknown-symbol checks later ;; FIX to handle implementing multiple ;; currently breaks on "class Foo implements Bar, Baz" '("\\<\\(new\\|extends\\|implements\\)\\s-+\\$?\\(\\sw+\\)" (1 font-lock-keyword-face) (2 font-lock-type-face)) ;; function declaration '("\\<\\(function\\)\\s-+&?\\(\\sw+\\)\\s-*(" (1 font-lock-keyword-face) (2 font-lock-function-name-face nil t)) ;; class hierarchy '("\\<\\(self\\|parent\\)\\>" (1 font-lock-constant-face nil nil)) ;; method and variable features '("\\<\\(private\\|protected\\|public\\)\\s-+\\$?\\sw+" (1 font-lock-keyword-face)) ;; method features '("^\\s-*\\(abstract\\|static\\|final\\)\\s-+\\$?\\sw+" (1 font-lock-keyword-face)) ;; variable features '("^\\s-*\\(static\\|const\\)\\s-+\\$?\\sw+" (1 font-lock-keyword-face)) )) "Medium level highlighting for PHP mode.") (defconst php-font-lock-keywords-3 (append php-font-lock-keywords-2 (list ;; or for HTML ;;'(" ]*>" . font-lock-constant-face) ;;'("]*" . font-lock-constant-face) ;;'(" '("<[^>]*\\(>\\)" (1 font-lock-constant-face)) ;; HTML tags '("\\(<[a-z]+\\)[[:space:]]+\\([a-z:]+=\\)[^>]*?" (1 font-lock-constant-face) (2 font-lock-constant-face) ) '("\"[[:space:]]+\\([a-z:]+=\\)" (1 font-lock-constant-face)) ;; HTML entities ;;'("&\\w+;" . font-lock-variable-name-face) ;; warn about '$' immediately after -> '("\\$\\sw+->\\s-*\\(\\$\\)\\(\\sw+\\)" (1 font-lock-warning-face) (2 php-default-face)) ;; warn about $word.word -- it could be a valid concatenation, ;; but without any spaces we'll assume $word->word was meant. '("\\$\\sw+\\(\\.\\)\\sw" 1 font-lock-warning-face) ;; Warn about ==> instead of => '("==+>" . font-lock-warning-face) ;; exclude casts from bare-word treatment (may contain spaces) `(,(concat "(\\s-*\\(" php-types "\\)\\s-*)") 1 font-lock-type-face) ;; PHP5: function declarations may contain classes as parameters type `(,(concat "[(,]\\s-*\\(\\sw+\\)\\s-+&?\\$\\sw+\\>") 1 font-lock-type-face) ;; Fontify variables and function calls '("\\$\\(this\\|that\\)\\W" (1 font-lock-constant-face nil nil)) `(,(concat "\\$\\(" php-superglobals "\\)\\W") (1 font-lock-constant-face nil nil)) ;; $_GET & co '("\\$\\(\\sw+\\)" (1 font-lock-variable-name-face)) ;; $variable '("->\\(\\sw+\\)" (1 font-lock-variable-name-face t t)) ;; ->variable '("->\\(\\sw+\\)\\s-*(" . (1 php-default-face t t)) ;; ->function_call '("\\(\\sw+\\)::\\sw+\\s-*(?" . (1 font-lock-type-face)) ;; class::member '("::\\(\\sw+\\>[^(]\\)" . (1 php-default-face)) ;; class::constant '("\\<\\sw+\\s-*[[(]" . php-default-face) ;; word( or word[ '("\\<[0-9]+" . php-default-face) ;; number (also matches word) ;; Warn on any words not already fontified '("\\<\\sw+\\>" . font-lock-warning-face) )) "Gauchy level highlighting for PHP mode.") (provide 'php-mode) ;;; php-mode.el ends here php-elisp-1.5.0/fdl.texi0000664000175000017500000005103010734521104015012 0ustar thierrythierry@c The GNU Free Documentation License. @center Version 1.2, November 2002 @c This file is intended to be included within another document, @c hence no sectioning command or @node. @display Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @end display @enumerate 0 @item PREAMBLE The purpose of this License is to make a manual, textbook, or other functional and useful document @dfn{free} in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of ``copyleft'', which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. @item APPLICABILITY AND DEFINITIONS This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The ``Document'', below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as ``you''. You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law. A ``Modified Version'' of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. A ``Secondary Section'' is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The ``Invariant Sections'' are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none. The ``Cover Texts'' are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words. A ``Transparent'' copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not ``Transparent'' is called ``Opaque''. Examples of suitable formats for Transparent copies include plain @sc{ascii} without markup, Texinfo input format, La@TeX{} input format, @acronym{SGML} or @acronym{XML} using a publicly available @acronym{DTD}, and standard-conforming simple @acronym{HTML}, PostScript or @acronym{PDF} designed for human modification. Examples of transparent image formats include @acronym{PNG}, @acronym{XCF} and @acronym{JPG}. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, @acronym{SGML} or @acronym{XML} for which the @acronym{DTD} and/or processing tools are not generally available, and the machine-generated @acronym{HTML}, PostScript or @acronym{PDF} produced by some word processors for output purposes only. The ``Title Page'' means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, ``Title Page'' means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. A section ``Entitled XYZ'' means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as ``Acknowledgements'', ``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title'' of such a section when you modify the Document means that it remains a section ``Entitled XYZ'' according to this definition. The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License. @item VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies. @item COPYING IN QUANTITY If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document. @item MODIFICATIONS You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: @enumerate A @item Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. @item List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement. @item State on the Title page the name of the publisher of the Modified Version, as the publisher. @item Preserve all the copyright notices of the Document. @item Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. @item Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. @item Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice. @item Include an unaltered copy of this License. @item Preserve the section Entitled ``History'', Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled ``History'' in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. @item Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the ``History'' section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. @item For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. @item Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. @item Delete any section Entitled ``Endorsements''. Such a section may not be included in the Modified Version. @item Do not retitle any existing section to be Entitled ``Endorsements'' or to conflict in title with any Invariant Section. @item Preserve any Warranty Disclaimers. @end enumerate If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles. You may add a section Entitled ``Endorsements'', provided it contains nothing but endorsements of your Modified Version by various parties---for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version. @item COMBINING DOCUMENTS You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers. The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. In the combination, you must combine any sections Entitled ``History'' in the various original documents, forming one section Entitled ``History''; likewise combine any sections Entitled ``Acknowledgements'', and any sections Entitled ``Dedications''. You must delete all sections Entitled ``Endorsements.'' @item COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document. @item AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an ``aggregate'' if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate. @item TRANSLATION Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail. If a section in the Document is Entitled ``Acknowledgements'', ``Dedications'', or ``History'', the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title. @item TERMINATION You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. @item FUTURE REVISIONS OF THIS LICENSE The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See @uref{http://www.gnu.org/copyleft/}. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License ``or any later version'' applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. @end enumerate @page @heading ADDENDUM: How to use this License for your documents To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page: @smallexample @group Copyright (C) @var{year} @var{your name}. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License''. @end group @end smallexample If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the ``with@dots{}Texts.'' line with this: @smallexample @group with the Invariant Sections being @var{list their titles}, with the Front-Cover Texts being @var{list}, and with the Back-Cover Texts being @var{list}. @end group @end smallexample If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation. If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software. @c Local Variables: @c ispell-local-pdict: "ispell-dict" @c End: php-elisp-1.5.0/php-mode.texi0000664000175000017500000012172011104076647015773 0ustar thierrythierry\input texinfo @c -*-texinfo-*- @c %**start of header @setfilename php-mode.info @settitle PHP Mode Manual @set version 1.5.0 @c %**end of header @copying This manual documents PHP mode version @value{version} for use with GNU Emacs. Copyright @copyright{} 2008 Aaron S. Hawley @quotation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, and no Cover Texts. A copy of the license is included in the section entitled ``Copying This Manual.'' A copy of the license is also available from the Free Software Foundation Web site at @url{http://www.gnu.org/licenses/fdl.html}. @end quotation The document was typeset with @uref{http://www.texinfo.org/, GNU Texinfo}. $Date: 2008-11-04 11:51:51 -0500 (Tue, 04 Nov 2008) $ $Revision: 90 $ @c See the indexes at the end of this document for notes on @c maintaining the index. @c Throughout the document there are comments about @c maintaining the manual, the motivation for a section, @c and todo items. Keep all these current alongside the @c ``printed'' portions of the documentation. @c The strategy is to document everything that is useful to @c a PHP programmer using Emacs. The intended audience is @c describe in the introduction. The scope is not. @c Obviously, everything about PHP mode should be described @c here, but even items that are not, should also be @c explained or at least mentioned. @end copying @titlepage @title PHP Mode Manual @subtitle Editing PHP in GNU Emacs @author Aaron S. Hawley @page @vskip 0pt plus 1filll @insertcopying @end titlepage @c Output the table of the contents at the beginning. @contents @ifnottex @node Top @top PHP Mode Manual @insertcopying @end ifnottex @c Generate the nodes for this menu with `C-c C-u C-m'. @menu * Introduction:: * Installation:: * Electricity:: * Motion:: * Indentation:: * Editing:: * Completion:: * PHP Comments:: * PHP Documentation:: * Index Menu:: * Change Logs:: * Speedbar:: * Customization:: * Embedded HTML:: * Contributors:: * Copying This Manual:: * Concept Index:: * Function Index:: * Keyboard Index:: * Variable Index:: @end menu @c Update all node entries with `C-c C-u C-n'. @c Insert new nodes with `C-c C-c n'. @node Introduction @chapter Introduction @cindex C mode @cindex features @cindex PEAR @cindex PHP versions @cindex syntax highlighting @cindex version, PHP PHP mode is a major mode for editing PHP source code in Emacs. As an extension of Emacs's C mode, it inherits all C mode's navigation and editing functionality. Syntax elements of PHP source code is colored according to the grammar of PHP versions 3, 4 and 5. By default, the indent rules follow the PHP PEAR coding guidelines. Additional aids for developing in PHP include documentation search of the PHP manual, code completion and a class browser. @cindex version, PHP mode @findex php-mode-version @kindex M-x php-mode-version To find out what version of PHP mode you have installed run @kbd{M-x php-mode-version}. PHP mode was first released in 1999 and was written by Turadg Aleahmad. At the time of PHP mode's initial release, version 2 of PHP (PHP/FI) was only 2 years old and the release of PHP 3 had happened the year before. In May of 2000, PHP 4 was released. Subsequent versions of PHP mode scurried to support the quickly evolving syntax of this emerging programming language. In 2001, PHP mode became a SourceForge project and version 1.0 was released later that year. Further refinements of the Emacs library included improvements to the syntax coloring rules, portability between XEmacs and GNU Emacs, integration of various development tools available in various Emacsen. PHP mode's support for PHP 5 first appeared in 2004, the same year PHP 5 was released. 2004 was the last year Aleahmad made a release. In 2005, Lennart Borgman combined a forked version of PHP mode with his ``new XML mode for Emacs'' (nXhtml). The stalled development of PHP resulted in people sharing various patches and improvements to PHP mode over the Internet. The 1.4 release in 2008 represented a renewed commitment to the Emacs Lisp library with the addition of considerable updates and improvements -- the first in over 2 years. @c In 2007, Aaron S. Hawley offered to update and maintain @c PHP mode. PHP mode's files were moved from CVS to a @c Subversion code repository. A release appeared in 2008 @c with a number of improvements and updates to support @c newer versions of CC mode and Emacs that were finally @c released in 2007. PHP mode shipped with a 16 page @c Texinfo manual authored by Hawley. This manual describes PHP mode for practiced Emacs users especially those who have read or can refer to the Emacs manual. The reader should already know how to program in PHP, although one could easily learn how to program PHP using PHP mode and Emacs. There are no explanations of PHP programming in this manual. @node Installation @chapter Installation @cindex installing PHP mode @cindex PHP mode, installing PHP mode can be installed like any Emacs Lisp library. @cindex downloading PHP mode @cindex PHP mode, downloading Download a source archive of the file. It is available from PHP mode's Web site. @cindex PHP mode Web site @cindex Web site, PHP mode @url{http://php-mode.sourceforge.net/} @cindex GPG signature @cindex verifiy PHP mode with GPG @cindex OpenPGP @cindex GnuPG Download either the file @file{php-mode-@value{version}.tar.gz} or @file{php-mode-@value{version}.zip}. Both source files have a respective GnuPG@footnote{More information on GPG and OpenPGP at @url{http://www.gnupg.org/}} signature file with a @var{.sig} file name extension. To verify the source archive you need the key of the maintainer. The public key can be downloaded from the Web site and imported, or imported from a key server. @example $ gpg --recv-keys 8E372922 gpg: requesting key 8E372922 from hkp server keys.gnupg.net gpg: key 8E372922: public key "Aaron S. Hawley (SourceForge) " imported @end example The public key can also be imported from a file. @example $ gpg --import ashawley-sf-pubkey.asc gpg: key 8E372922: public key "Aaron S. Hawley (SourceForge) " imported gpg: Total number processed: 1 gpg: imported: 1 @end example Assign the trust for the maintainer key. @example $ gpg --edit-key 8E372922 Command> trust pub 1024D/8E372922 created: 2008-01-25 expires: 2010-01-01 usage: SC trust: unknown validity: unknown sub 2048g/A4B44512 created: 2008-01-25 expires: 2010-01-01 usage: E [ unknown] (1). Aaron S. Hawley (SourceForge) Please decide how far you trust this user to correctly verify other users' keys (by looking at passports, checking fingerprints from different sources, etc.) 1 = I don't know or won't say 2 = I do NOT trust 3 = I trust marginally 4 = I trust fully 5 = I trust ultimately m = back to the main menu Your decision? 1 pub 1024D/8E372922 created: 2008-01-25 expires: 2010-01-01 usage: SC trust: undefined validity: unknown sub 2048g/A4B44512 created: 2008-01-25 expires: 2010-01-01 usage: E [ unknown] (1). Aaron S. Hawley (SourceForge) Command> quit @end example @c The key has to be signed as well? -- ASH 2008-10-22 Verify a source package by using the GPG verify command on the signature file with the source file located in the same directory. @example $ gpg --verify php-mode-1.4.0.tar.gz.sig gpg: Signature made Fri 25 Jan 2008 01:30:24 PM EST gpg: using DSA key ID 8E372922 gpg: Good signature from "Aaron S. Hawley (SourceForge) " Primary key fingerprint: B425 30C2 4F72 D4F1 FD01 D07D 7087 6760 8E37 2922 @end example @cindex PHP mode, unpacking @cindex unpacking PHP mode @cindex extracting PHP mode After the source package is verified, unpack the source archive. @example $ tar zxf php php-mode-@value{version}.tar.gz @end example @cindex PHP mode documentation @cindex documentatino, PHP mode The files are extracted to the directory @file{php-mode-@value{version}}. Run @kbd{make} in the directory to build all the formats of the documentation -- Info, HTML, PostScript and PDF. Read the notes in the @file{Makefile} to learn how to run @kbd{make} to compile the manual into a single particular format. @cindex .emacs, load-path @vindex load-path If you have a local directory where Emacs Lisp libraries are stored, for example @file{~/elisp}, then put the following in your @file{.emacs} file if you haven't already @lisp (add-to-list 'load-path "~/elisp") @end lisp @cindex php-mode.el, installing @cindex installing php-mode.el @cindex php-mode.el, loading @cindex loading php-mode.el @findex php-mode @vindex load-path Then, put the file @file{php-model.el} into your Emacs @code{load-path}, @file{~/elisp}, and add @code{php-mode} to your @file{.emacs} file. @lisp (load "php-mode") @end lisp @cindex PHP file name extension @cindex extension, PHP file name @cindex file name extension, PHP @findex customize-variable @kindex M-x customize-variable From inside Emacs, run @kbd{M-x customize-variable RET php-file-patterns RET}. This variable instructs Emacs what file names should be opened in PHP mode. If the defaults are fine, then click or hit @kbd{RET} on @samp{Save for Future Sessions}. @cindex .emacs, auto-mode-alist Alternatively, put these lines in your @file{.emacs} file. @lisp (add-to-list 'auto-mode-alist '("\\.php[34]?\\'\\|\\.phtml\\'" . php-mode)) @end lisp @cindex Drupal @cindex .emacs, Drupal If you work on projects, like Drupal, that use other extension for PHP source file, you may need to add this to your @file{.emacs}. @lisp (add-to-list 'auto-mode-alist '("\\.module\\'" . php-mode)) (add-to-list 'auto-mode-alist '("\\.inc\\'" . php-mode)) @end lisp @c Consider canvasing your operating system or software @c distributor to include PHP mode as a package, or have it @c installed with the existing Emacs package. @c At some point, PHP mode should be included into Emacs. @c In 2008, PHP mode is not very stable. Further, it is @c unclear whether php-mode should be absorbed into CC mode @c or not. Further, it is not clear how Emacs is planning @c to support ``server page'' languages, where source code @c is mixed with other languages and markup. @c Explain how to install the info files in @c Info-directory-list? @node Electricity @chapter Electricity @c This article explains electricity, because the Emacs @c manual, as of 2008, doesn't do a good job of introducing @c the concept. @c The section only gives examples of ``electric'' @c commands. There should be a list of those commands. @cindex electricity @findex self-insert-command Certain characters when inserted in Emacs have @dfn{electricity}. Emacs recognizes them as ``electric'' and automatically reacts in some way to their insertion. This is unlike the @code{self-insert-command} -- the conventional manner Emacs inserts most characters into the buffer and without side-effect. @cindex indentation, electric @cindex electric indentation @cindex declaration blocks @cindex conditional statements @cindex braces @cindex comments @kindex TAB For example, the indent commands for programming language modes -- including PHP mode -- are electric. Hitting @kbd{TAB} (or @kbd{C-i}) typically indents the line to the correct column based on the nested declaration blocks or conditional (control) syntax statements. Other examples of electric characters include braces (@{ and @}), characters related to comments (#, / and *), and semicolons. Inserting ``electric'' characters causes the line to be automatically be indented appropriately by PHP mode. @findex quoted-insert @kindex C-q @findex c-toggle-electric-state @kindex C-c C-l Should PHP mode ever do something you wish it didn't, like indenting incorrectly after inserting a character when you wish it didn't, then you've been @dfn{electrocuted}. To avoid this, use @code{quoted-insert} by prefixing the character with @kbd{C-q}. For example, @kbd{C-q TAB} for a tab. Alternatively, disable the electric effect of PHP mode with @kbd{C-c C-l}. Issue @kbd{C-c C-l} again to activate the electric effect again. @c Is there a setting to use in ones .emacs to permanently @c shut off electricity? @node Motion @chapter Motion @c It's important to explain when a feature is really a @c subset of a feature of Emacs or C Mode, and take the @c opportunity to create a cross-reference to those free @c manuals. @cindex motion @cindex movement @cindex C mode, movement @cindex point The traditional point movement commands for Emacs@footnote{@xref{Moving Point, Changing the Location of Point, Changing the Location of Point, emacs, GNU Emacs Manual}.} and Emacs's C mode@footnote{@xref{Movement Commands, Movement Commands, Movement Commands, ccmode, CC Mode Manual}.} are supported in PHP mode. The following are noteworthy commands for working on PHP code or are extensions expressly provided by PHP mode. @table @kbd @c The forward-sexp command isn't optimally named nor @c behaved for a language like PHP, but it comes for free @c (gratis) from Emacs, and may prove useful. It would be @c better to have a php-forward-syntax command that follows @c the parsing rules of PHP and not a lisp language. For @c instance, if at the beginning or end of a statement, move @c to the next statement. The syntaxes that would be useful @c to move across would need to be researched. @cindex block @cindex braces @cindex parentheses @cindex string @cindex statements @cindex syntax, forward @findex forward-sexp @kindex C-M-f @item C-M-f Move forward past the current syntax (@code{forward-sexp}). If point is in a string literal, move to the end of the string. If point is at the beginning of a parenthetical expression, move to the end of it. If at the beginning of statement block that is surrounded by braces, move to the end of the block. If point is at an identifier, skip to the end of it. @cindex syntax, backward @findex backward-sexp @kindex C-M-b @item C-M-b Same as @kbd{C-M-f}, except a syntactic element move to its beginning (@code{backward-sexp}). @cindex beginning of function @cindex function, beginning of @findex c-beginning-of-defun @kindex C-M-a @item C-M-a Move point to the beginning of the top-level function definition (@code{c-beginning-of-defun}). @cindex end of function @cindex function, end of @findex c-end-of-defun @kindex C-M-e @item C-M-e Move point to the end of the top-level function definition (@code{c-end-of-defun}). @cindex end of function @cindex function, end of @findex beginning-of-defun @kindex C-M- @item C-M- Move point to the beginning of the current function (@code{beginning-of-defun}). @cindex end of function @cindex function, end of @findex end-of-defun @kindex C-M- @item C-M- Move point to the end of the current function (@code{end-of-defun}). @cindex indentation, move to @findex back-to-indentation @kindex M-m @item M-m Move to the indentation at the beginning of the line (@code{back-to-indentation}). @cindex bumpy case @cindex camel case @cindex mixed case @cindex case, mixed @cindex function, end of @findex backward-word @findex forward-word @findex c-subword-mode @kindex C-c C-w @item C-c C-w Enable word motion across mixed case identifiers with @code{forward-word} and @code{backward-word} commands (@code{c-subword-mode}). @end table @cindex universal argument @cindex numeric argument @findex universal-argument @kindex C-u Most movement commands support prefixing the command with a @dfn{numeric argument} by using Emacs's @dfn{universal argument} command. Type @kbd{C-u @var{n}}, where @var{n} is the number of times to repeat a command. If no number @var{n} is provided, Emacs will repeat the command 4 times by default. @xref{Arguments, Numeric Arguments, Numeric Arguments, emacs, GNU Emacs Manual}. @node Indentation @chapter Indentation @c It's important to explain when a feature is really a @c subset of a feature of Emacs or C Mode, and take the @c opportunity to create a cross-reference to those free @c manuals. @cindex indentation, rules for @cindex C mode, indentation rules PHP mode's indentation settings inherit the defaults set by Emacs C mode, or the rules customized for C mode.@footnote{@xref{Customizing Indentation, Customizing Indentation, Customizing Indentation, ccmode, CC Mode Manual}.} @cindex PEAR, indentation @cindex spaces @cindex tabs PHP mode provides indentation settings that follow the PHP PEAR ``Coding Standards''@footnote{@url{http://pear.php.net/manual/en/standards.php}}. It has the consequence in PHP mode of making the indentation commands use four spaces, and not tabs. This setting is turned on whenever the file name associated with a buffer includes the string ``PEAR'', case insensitive and the file ends in ``.php''. @cindex indentation, force PEAR rules @vindex php-mode-force-pear @findex customize-variable @kindex M-x customize-variable @cindex .emacs, php-mode-force-pear You can force the use of this setting for all files edited with PHP mode by setting @code{php-mode-force-pear} to non-nil. Configure the variable with either @kbd{M-x customize-variable RET php-mode-force-pear RET}, or by setting its value in your Emacs initialization file (@file{~/.emacs}). @cindex HTML PHP does not appropriately indent HTML tags. @xref{Embedded HTML}. To customize PHP mode's indentation rules, change the following variables. @c There are probably other variables that are safe for @c users to change and are worth mentioning. Ones from C @c mode come to mind, like indentation-style. Some day it @c would also be useful to support a variety of PHP @c programming styles. @c Perhaps the indentation commands should be featured @c before customization. They could have separate sections. @table @code @cindex indentation, level of @vindex c-basic-offset @item c-basic-offset This style variable of C mode controls how many columns in the level of indentation. By default this is 4 spaces in PHP mode (and in C mode). @vindex indent-tabs-mode @item indent-tabs-mode Variable of Emacs that determines whether indentation commands should insert the tab character or insert the equivalent number of space characters. In PHP mode, this is set to to nil by default. @vindex tab-width @item tab-width This variable of Emacs determines how ``wide'' a tab in the buffer should be considered. This is also traditionally described as setting the distance between ``tab stops''. By default, PHP mode does not insert tabs for indentation. @item php-mode-force-pear Use the indentation rules of PHP PEAR for all files opened in PHP mode. See above. @end table @cindex indentation, commands for @cindex C mode, indentation rules @cindex C mode, indentation commands The usual commands for indenting in Emacs@footnote{@xref{Indentation Commands, Indentation Commands, Indentation Commands, emacs, GNU Emacs Manual}.} and Emacs's C mode@footnote{@xref{Indentation Commands, Indentation Commands, Indentation Commands, ccmode, CC Mode Manual}.}: are supported in PHP mode, following the indentation rules of PHP. @table @kbd @cindex tab @cindex indent line @cindex line, indent @findex c-indent-command @kindex TAB @item TAB Properly indent current line, even from the middle of the line (@code{c-indent-command}). @c provide examples? -- ash 2007-12-29 @cindex newline @cindex indent newline @cindex indent newline @findex newline-and-indent @kindex C-j @item C-j Insert text after point to a newline, and properly indent the newline (@code{c-indent-command}). @cindex indent region @cindex region, indent @findex indent-region @kindex C-M-\ @item C-M-\ Properly indent each line of region (@code{indent-region}). @c I'm not going to bother mentioning C-x TAB, @c M-x indent-rigidly. -- ash 2007-12-29 @cindex function, indent @cindex indent function @cindex class, indent @cindex indent class @findex c-indent-defun @kindex C-c C-q @item C-c C-q Properly indent each line of current top-level function or top-level class (@code{c-indent-defun}). @end table @node Editing @chapter Editing @c Provide an introduction to this section. @table @kbd @cindex paragraph, fill @cindex filling @cindex indentation, filling @cindex filling indentation @cindex filling comment @cindex comment, filling @cindex Docblock comment @cindex comment, Docblock @findex c-fill-paragraph @kindex M-q @item M-q Fill the paragraph to current value of @code{fill-column}. The command does the right thing for indented code and PHP comments including Docblock comments. @cindex column, fill @cindex fill column @vindex fill-column @findex set-fill-column @findex fill-paragraph @kindex C-x f @item C-u @var{n} C-x f Set the @code{fill-column} to @var{n} when using the @kbd{M-q} command (@code{fill-paragraph}). @cindex function, mark @findex kill-region @findex kill-ring-save @findex indent-region @findex indent-rigidly @findex c-mark-function @kindex C-M-h @kindex C-w @kindex M-w @kindex C-M-\ @item C-M-h Mark the current function (@code{c-mark-function}). Puts the mark at the end and of the function and the point at the beginning. Useful if you want to kill the region with @kbd{C-w} or @kbd{M-w}, or indent the region with @kbd{C-M-\} or @kbd{C-x TAB} (@xref{Indentation}.). @cindex defun, mark @findex mark-defun @kindex M-x mark-defun @item M-x mark-defun Like @kbd{C-M-h} (@code{c-mark-function}), except place the mark at the end of the function even if it's not at the top-level. With functions that are methods defined in a class, they may be indented and not top-level functions, however this command will only mark the current function. @c Perhaps, M-x mark-defun should be the default for running @c C-M-h again. This is the downside of inheriting C mode's @c key bindings. @end table @c This narrowing stuff could deserve its own @c chapter/section. @cindex narrowing @cindex widening The traditional commands for narrowing to a region in Emacs@footnote{@xref{Narrowing, Narrowing, Narrowing, emacs, GNU Emacs Manual}.} are supported in PHP mode. The following commands are notable to mention for working with PHP or are extensions expressly provided PHP mode. @table @kbd @cindex function narrowing @cindex function, narrow @findex narrow-to-defun @kindex C-x n d @item C-x n d Narrow the buffer to the contents of the current function (@code{narrow-to-defun}). This will narrow to the function as identified to the current function, even if it is nested in an object or another function. The logic to narrow the function is the same as the @code{beginning-of-defun} and @code{end-of-defun} commands -- see @ref{Motion}, and the @code{mark-defun} command -- see above. @cindex widening @findex widen @kindex C-x n w @item C-x n w Undo any narrowing by widening the buffer again by making the rest of the buffer available (@code{widen}). @end table @node Completion @chapter Completion @cindex completion Completing function names, identifiers and PHP keywords is possible in PHP mode. In PHP mode, it is possible to complete identifiers defined by the PHP programming language, and to complete functions defined by you. @cindex customization, PHP manual path @cindex PHP manual path @vindex php-manual-path @cindex .emacs, php-manual-path @findex customize-variable @kindex M-x customize-variable For PHP mode to know the functions of keywords of PHP, it must have access to the PHP manual. Download the HTML archive of the manual made of separate files for each function.@footnote{@uref{http://www.php.net/download-docs.php}} Unpack the files to a directory, and define the variable @code{php-manual-path} to the location of these files. Configure this setting with either @kbd{M-x customize-variable RET php-manual-path RET}, or by setting its value in your Emacs initialization file (@file{~/.emacs}). @c FIXME: Explain how the function name completion works, as @c much as the user would need to know. @c The following explains how to get completion to work in @c detail, with any expectation that the reader knows how @c completion works in Emacs. The more opportunities to @c share features that come with Emacs as they apply to PHP @c development, the better. @cindex etags @cindex tag file @cindex Makefile For functions and classes you define, you'll need to provide them to Emacs as a @dfn{tag file}.@footnote{@xref{Tags, Tags Tables, Tags Tables, emacs, GNU Emacs Manual}.} Creating a tag file (@file{TAGS}) from a PHP source code file is done by running the @command{etags} command on the file.@footnote{@xref{Create Tags Table, Creating Tags Tables, Creating Tags Tables, emacs, GNU Emacs Manual}.} The @command{etags} command can even generate tag files for providing completion across multiple files. For larger projects and PHP coded libraries, use a system like a Makefile to generate and maintain the tag tables. @cindex etags, running Run, @example etags @var{file} @end example to create a @file{TAGS} file for @var{file}. To generate a @file{TAGS} file for all the PHP files in the current directory, run @example etags *.php @end example To enable a tags file you need to use the following command. @table @kbd @cindex tag @findex visit-tags-table @kindex M-x visit-tags-table @item C-u M-x visit-tags-table Specify the @file{TAGS} file that PHP mode should use to find completion candidates for the current buffer. @item M-x visit-tags-table Specify the @file{TAGS} file that PHP mode should use to find completion candidates for all buffers, and even other modes other than PHP mode. @end table @cindex customization, PHP completion file @cindex PHP completion file @vindex php-completion-file @cindex .emacs, php-completion-file If you are interested in any one or more of the following consider using the variable @code{php-completion-file}. @enumerate @item avoid regenerating the completion table from the PHP manual every Emacs session, @item generating a completion file from a facility external to Emacs tags, @item or provide more granular control over the completion rules for files; @end enumerate @findex customize-variable @kindex M-x customize-variable Configure this setting with either @kbd{M-x customize-variable RET php-completion-file RET}, or by setting its value in your Emacs initialization file (@file{~/.emacs}). To create a file that can be set for @code{php-completion-file}, create with the following shell commands with the HTML version of the PHP manual installed at @file{/usr/share/doc/php-manual/en/html}. @example $ cd /usr/share/doc/php-manual/en/html $ ls -1 function*.html \ | sed -e 's/^function\.\([-a-zA-Z_0-9]*\)\.html/\1/' \ | tr - _ \ > ~/.emacs.d/php/php-completion-file @end example @c PHP mode could ship with a php-completion-file, but that @c could require releasing a new version of PHP mode @c whenever significant changes occur to the API of PHP. @c Keep the following notes on third-party packages updated @c with respect to managing Emacs settings on a per-project @c basis. Otherwise, delete the paragraph(s). Perhaps the @c Emacs project will choose or develop a solution, soon. In larger projects or with other specific needs, conventional methods of setting these and other variables may be inadequate. As of 2008, third-party packages do exist for Emacs to configure Emacs settings on groups of files or for directory trees, including @file{dirvars.el}. @table @kbd @cindex complete function @cindex function, complete @findex php-complete-function @kindex M-TAB @kindex ESC TAB @kindex C-[ TAB @item M-TAB @item ESC TAB @item C-[ TAB Complete function name at point (@code{php-complete-function}). @cindex argument list, function @cindex function argument list @cindex minibuffer @findex php-show-arglist @kindex C-. @item C-. Show in the minibuffer the argument list for the current function at point (@code{php-show-arglist}). The argument list is generated by finding and jumping to the respective function's location specified in the tag file (see above). The argument list is then read and printed to the minibuffer. @end table @node PHP Comments @chapter PHP Comments @cindex comment The usual commands for inserting, managing and editing source code comments in Emacs@footnote{@xref{Comments, Manipulating Comments,Manipulating Comments, emacs, GNU Emacs Manual}.} and Emacs's C mode@footnote{@xref{Comment Commands, Comment Commands, Comment Commands, ccmode, CC Mode Manual}.} are supported in PHP mode. The following noteworthy commands are useful for working with PHP or are extensions expressly provided by PHP mode. @c These commands aren't provided by PHP mode, but are @c important to mention sine the PHP language has comments! @c It should probably discuss the various types of comments. @c A section should explain the phpdoc format as supported @c in PHP mode. @table @kbd @cindex comment, insert @cindex indent comment @cindex insert comment @cindex comment, indent @findex comment-indent @findex comment-dwim @kindex M-; @item M-; Insert comment at point (@code{comment-dwim}). If comment already exist, indent comment (@code{comment-indent}). @kindex M-x comment-indent @cindex newline, comment @cindex comment newline @findex c-indent-new-comment-line @kindex M-j @item M-j Insert a newline in a comment on the next line with the comment starting at the same column as the current line (@code{c-indent-new-comment-line}). @cindex column, comment @cindex comment column @vindex comment-column @findex comment-set-column @kindex C-x ; @item C-x ; Set the current column as the column to start comments from in the buffer (@code{comment-set-column}). This affects the variable @code{comment-column}. @cindex comment region @cindex region, comment @findex comment-region @kindex C-c C-c @item C-c C-c Comment out the current region (@code{comment-region}). If region is already commented, the region is uncommented. @c I'm not going to bother mentioning the numeric prefix @c argument variations. -- ash 2008-01-01 @cindex comment, kill @cindex kill comment @findex comment-dwim @findex comment-set-column @findex comment-kill @kindex M-- C-x ; @item M-- C-x ; @item C-u M-; Kill the comment on the current line (@code{comment-kill} called by @code{comment-set-column} or @code{comment-dwim}). @item C-u @var{n} M-; Kill the next @var{n} comments (@code{comment-dwim}). @cindex region, comment box @cindex comment box @findex comment-box @kindex M-x comment-box @item M-x comment-box Surround region with comment characters. @end table @node PHP Documentation @chapter PHP Documentation @cindex customization, browse-url @cindex documentation, PHP @cindex PHP documentation @findex browse-url @findex customize-group PHP mode supports the online documentation available from @uref{http://www.php.net/}. The @code{browse-url} system of Emacs supports these commands. Run the Emacs command @kbd{M-x customize-group RET browse-url RET} to configure how @code{browse-url} behaves. For example, you may want to change the Web browser Emacs uses for visiting a page of the manual for PHP. @table @kbd @cindex browse PHP manual @findex php-browse-manual @kindex C-c C-m @kindex C-c RET @item C-c C-m @item C-c RET Browse PHP manual in a Web browser. @cindex search PHP manual @findex php-search-documentation @kindex C-c C-f @item C-c C-f Search PHP manual using identifier at point. @end table @node Index Menu @chapter Index Menu @c Imenu is documented, but it should be mentioned here @c because PHP explicitly supports it by configuring @c imenu-generic-expression with PHP-specific settings in @c php-imenu-generic-expression. It should also documented @c because PHP does not implicitly add the index menu to the @c menubar, it needs to be done by the user. @c PHP mode could automatically add the Imenu to the menubar @c when it starts, however, it may be prohibitively slow for @c large files. The first step towards this is suggesting @c to users that they run imenu-add-menubar-index by adding @c it to php-mode-hook. However, php-mode-hook isn't @c documented, yet. @cindex index menu @cindex menu, index @cindex index, class @cindex index, function @cindex class index @cindex function index PHP mode provides a menu of the functions and classes defined in the current buffer. The menu is pretty simple, but is helpful when navigating large files. The contents of the menu also provide a good overview to the user about the file's contents. @c Initially contributed by Gerrit Riessen To enable this menu, run the following command. @table @kbd @cindex menu bar @findex imenu-add-menubar-index @item M-x imenu-add-menubar-index Scan the file for functions and class declarations, then add a menu item called ``Index'' to the menu bar. @end table In the menu will be any one or more of the following menu items. @table @samp @findex imenu @item All Functions A sub-menu containing the names of functions defined in the current buffer. Clicking on a function name will visit the location of the function's definition. @findex imenu @item Classes A sub-menu containing the names of classes defined in the current buffer. Clicking on a class name will visit the location of the class's definition. @item Public Methods, Private Methods, Protected Methods Each of these three ``method'' sub-menus list the names of objects methods defined as ``public'', ``private'' or ``protected''. Clicking on a method name will visit the location of the function's definition. @findex imenu-update-menubar @cindex rescan @item *Rescan* Rescan the contents of the current buffer, and update both the indexes the entries in the menu. @end table @cindex customization, Imenu auto rescan @cindex rescan, automatically @cindex .emacs, imenu-auto-rescan @vindex imenu-auto-rescan @findex customize-variable @kindex M-x customize-variable To have Emacs automatically rescan the current buffer, change the setting for @code{imenu-auto-rescan} to non-nil with either @kbd{M-x customize-variable RET php-completion-file RET}, or by setting its value in your Emacs initialization file (@file{~/.emacs}). @node Change Logs @chapter Change Logs @vindex php-beginning-of-defun-regexp @vindex add-log-current-defun-header-regexp @c This is documented, because PHP mode explicitly supports @c the features of add-log by setting the value for the @c add-log-current-defun-header-regexp to @c php-beginning-of-defun-regexp. This feature is @c documented in the PHP manual, but it is worth advertising @c to PHP programmers. @cindex ChangeLog @cindex file, ChangeLog PHP mode can help generate @file{ChangeLog} files, a widely-adopted format for documenting the changes made to source code--especially software. PHP mode and Emacs will determine the current function, file name, author information and date and use it all to prepare a properly formatted @file{ChangeLog} entry in the file. @cindex Diff mode @cindex diff file @cindex file, diff @cindex patch file @cindex file, patch @findex add-change-log-entry The @code{add-change-log-entry} commands can be run from within a buffer containing a PHP buffer, or from a buffer in Diff mode with a revision patch to a PHP source file. @xref{Diff Mode, Diff Mode, Diff Mode, emacs, GNU Emacs Manual}. @table @kbd @cindex ChangeLog entry @cindex add ChangeLog entry @findex add-change-log-entry-other-window @kindex C-x 4 a @item C-x 4 a Add an entry in a @file{ChangeLog} file opened in another window, or add a new line to the already begun entry (@code{add-change-log-entry-other-window}). Provides the file name and the respective function name, when applicable, for the current point. The point can be in a PHP source file, or in the hunk of a diff file.@footnote{@xref{Diff Mode, Diff Mode, Diff Mode, emacs, GNU Emacs Manual}.} This command will also add the current author and date to the entry. @end table @node Speedbar @chapter Speedbar FIXME: Document speedbar support for PHP mode. @node Customization @chapter Customization @cindex customization @cindex .emacs @cindex initialization file Customization for PHP mode can be done using Emacs's ``Customize'' feature@footnote{@xref{Customization, Customization, Customization, emacs, GNU Emacs Manual}.}, or by adding bits of Emacs Lisp to your Emacs initialization file (@file{~/.emacs}). @table @kbd @findex customize-group @kindex M-x customize-group @item M-x customize-group RET php RET Start a @samp{*Customize*} buffer with the customizable settings for PHP mode. @end table @c There are other sections that talk about customization, @c but they aren't mentioned here and they don't @c cross-reference back to this section. @c Things that aren't documented elsewhere but deserve @c documentation, in order of importance: @c * php-mode-hook @c * php-search-url @c * php-file-patterns @c * php-mode-pear-hook @node Embedded HTML @appendix Embedded HTML @c Someday, there will be a decisive way to work on PHP and @c HTML markup together. For now, it's not decided. This @c section offers some workarounds and offers some @c suggestions. @cindex markup formats @cindex XML @cindex SGML @cindex embedded code @cindex indentation, markup @cindex HTML The PHP programming language is commonly embedded with HTML but also with other markup formats. Unfortunately, PHP mode is currently unable to recognize these other bits and provide commands that behave appropriately. Other Emacs modes for properly indenting HTML include HTML mode, SGML mode and XML mode. @findex php-mode @kindex M-x php-mode @findex html-mode @kindex M-x html-mode For example, when editing the HTML sections found in a PHP file, consider turning on HTML mode with @kbd{M-x html-mode}. Use the the mode-specific commands for manipulating the HTML. When finished, turn back on PHP mode with @kbd{M-x php-mode} to return working on the PHP sections of the file. @cindex multiple major mode @cindex mumamo @cindex mmm-mode @cindex multi-mode Alternatively, consider using a @dfn{multiple major mode} like mumamo, mmm-mode or multi-mode. These modes allow a single buffer to appoint different major modes to respective portions of the buffer. @node Contributors @appendix Contributors @itemize @item Juanjo @item Torsten Martinsen @item Vinai Kopp @item Sean Champ @item Doug Marcey @item Kevin Blake @item Rex McMaster @item Mathias Meyer @item Boris Folgmann @item Roland Rosenfeld @item Fred Yankowski @item Craig Andrews @item John Keller @item Ryan Sammartino @item ppercot @item Valentin Funk @item Stig Bakken @item Gregory Stark @item Chris Morris @item Nils Rennebarth @item Gerrit Riessen @item Eric Mc Sween @item Ville Skytta @item Giacomo Tesio @item Lennart Borgman @item Stefan Monnier @item Aaron S. Hawley @item Aaron Iba @item Dias Badekas @end itemize @node Copying This Manual @appendix Copying This Manual @c Get fdl.texi from http://www.gnu.org/licenses/fdl.html @include fdl.texi @c Indices @c @c Indexes are well-supported and easy to add in Texinfo, so @c I have created them liberally in this document. Every @c command, variable and function that is mentioned is @c indexed regardless if it is defined by PHP-mode or @c not. -- ASH 2008-10-22 @c @c Quickly, variable mentions are given a @vindex, functions @c a @findex, keyboard commands a @kindex and everything @c else a @cindex. And if a concept is a multiple word @c phrase, be sure to use the various permutations to @c provide different alphabetical ordered entries for @c readers. Take a look at the conventions already used @c throughout the document for examples to follow from. @c @c If the indexing philosophy is less than adequate it will @c take less effort to retract entries, then it would be if @c an entire index had to be created from scratch. So with @c each edit, spend a little time keeping it up to date. @node Concept Index @unnumbered Concept Index @printindex cp @node Function Index @unnumbered Function Index @printindex fn @node Keyboard Index @unnumbered Keyboard Index @printindex ky @node Variable Index @unnumbered Variable Index @printindex vr @bye @c Local Variables: ** @c mode: auto-fill ** @c fill-column: 60 ** @c End: ** @c php-mode.texi ends here @c LocalWords: texinfo setfilename php settitle url uref @c LocalWords: Docblock titlepage vskip pt FI filll @c LocalWords: insertcopying ifnottex HTML cindex findex @c LocalWords: kbd dfn kindex pxref ccmode var xref sexp @c LocalWords: defun subword CC ChangeLog Diff XML SGML @c LocalWords: html mumamo mmm Juanjo Torsten Martinsen @c LocalWords: Vinai Kopp Stig Marcey McMaster Folgmann @c LocalWords: Rosenfeld Yankowski Sammartino Bakken @c LocalWords: ppercot Rennebarth Gerrit Riessen Mc Sween @c LocalWords: Skytta Tesio fdl cp Lennart Borgman Monnier @c LocalWords: texi printindex fn ky RET etags ESC CVS @c LocalWords: imenu menubar samp Turadg Aleahmad @c LocalWords: SourceForge Emacsen Hawley nXML vindex @c LocalWords: dirvars arglist FIXME speedbar vr minibuffer @c LocalWords: dwim nXhtml emacs makefile el uncommented @c LocalWords: online multi syntaxes API phpdoc Iba Badekas @c LocalWords: recv todo GPG OpenPGP gpg ashawley pubkey @c LocalWords: asc GnuPG DSA zxf PDF PostScript elisp alist @c LocalWords: Drupal Indices php-elisp-1.5.0/Makefile0000664000175000017500000000612011104076647015023 0ustar thierrythierry#!/usr/bin/make -f ### php-mode.make -- Makefile for PHP mode for Emcs ## Copyright (C) 2008 Aaron S. Hawley ## Author: Aaron S. Hawley ## $Revision: 90 $ ## $Date: 2008-11-04 11:51:51 -0500 (Tue, 04 Nov 2008) $ ## X-URL: http://php-mode.sourceforge.net/ ## 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 3, 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., 51 Franklin Street, Fifth Floor, ## Boston, MA 02110-1301, USA. ### Commentary: ## Build a release source distribution of PHP mode: ## $ make dist ## Build a PDF version of the manual: ## $ make php-mode.pdf ## Build a Postscript version of the manual: ## $ make php-mode.ps ## Build a device independent (DVI) version of the manual: ## $ make php-mode.ps ## Build an HTML version (monolothic and multi-page) of the manual: ## $ make php-mode.html ## Build an HTML monolothic and multi-page versions of the manual: ## $ make php-mode.html ## Build a GNU Info version of the manual: ## $ make php-mode.info ## Build a Gzipped version of any file by adding the .gz suffix: ## $ make php-mode.info.gz ## Build the manual in all the formats: ## $ make ### History: ## Written on January 3, 2008 in South Burlington, Vermont, USA. ### Code: package = php-mode version = 1.5.0 release = $(package)-$(version) lisp_files = *.el texi_files = *.texi #info_files = *.info #html_files = *.html CCMODE_MANUAL = http://cc-mode.sourceforge.net/html-manual/ EMACS_MANUAL = http://emacswiki.org/cgi-bin/info-ref?find= CP ?= cp -p GZIP ?= gzip -f TAR ?= tar ZIP ?= zip dist: $(release).tar.gz $(release).zip $(RM) -r $(release) manuals: php-mode.info.gz php-mode.pdf php-mode.ps.gz php-mode.html $(release): $(lisp_files) $(texi_files) Makefile ChangeLog mkdir $@ \ && $(CP) $^ $@ $(release).tar: $(release) $(TAR) cf $@ $< $(release).zip: $(release) $(ZIP) -9 -r $@ $< %.gz: % $(GZIP) $< %.html: %.texi makeinfo --html --output $@ --no-split --no-headers $< makeinfo --html --output html-manual $< for f in html-manual/*.html $@; do \ $(CP) $${f} $${f}~; \ perl -pe 'while (/emacs\.html#[^"-]*-/){s/(emacs\.html#[^"-]*)-/\1 /g;}' $${f}~ \ | sed -e 's!ccmode\.html!${CCMODE_MANUAL}!g' \ -e 's!\.\./ccmode/\([^#]*\)!${CCMODE_MANUAL}\1!g' \ -e 's!emacs\.html\#!${EMACS_MANUAL}!g' \ -e 's!\.\./emacs/\([^#]*\)!${EMACS_MANUAL}\1!g' > $${f}; \ done %.info: %.texi makeinfo $< %.txt: %.texi makeinfo --plaintext --output $@ --no-split --no-headers $< %.pdf: %.texi texi2pdf $< %.dvi: %.texi texi2dvi $< %.ps: %.dvi dvips -o $@ $< php-elisp-1.5.0/ChangeLog0000664000175000017500000005015611104100677015134 0ustar thierrythierry2008-11-04 Aaron S. Hawley * Makefile (version): Change to 1.5.0 for release. * php-mode.el: Update modification date in the header and add ChangeLog entry for new version. (php-mode-version-number, php-mode-modified): Mark as 1.5.0 release with today's date. * php-mode.texi (version): Change to 1.5.0 for release. 2008-11-03 Aaron S. Hawley * php-mode.el (php-class-key): Use c-lang-const to retrieve value for c-symbol-key. (php-mode): Add underscore (_) to syntax table for font-lock-defaults. (php-font-lock-keywords-1, php-font-lock-keywords-2) (php-font-lock-keywords-3): Change references to \\s_ in regular expressions to just using \\sw. Remove usage of "[^_$]?" and "[^_]?" regular expression. 2008-10-27 Aaron S. Hawley * php-mode.el: Removed items in the ChangeLog section. A ChangeLog file is now included with the source package. Convert tabs to spaces. Add form feed characters between sections. Fix indentation levels. Fix various typos and documentation string errors. Make in-line comment style consistent. (php-default-face, font-lock-keyword-face) (font-lock-constant-face): Remove conditional bindings and XEmacs code that likely does nothing. 2008-10-23 Aaron S. Hawley * php-mode.el (php-imenu-generic-expression): Reverse order of expression, since Imenu displays it in reverse. (php-completion-table): Move next to php-complete-function. 2008-10-23 David House * php-mode.el (php-font-lock-keywords-1) (php-font-lock-keywords-2): Fix regular expression for highlighting various keywords when they're at the beginning or end of the line. 2008-10-22 Aaron S. Hawley * php-mode.el (php-imenu-generic-expression) (php-beginning-of-defun-regexp): Fix regular expression that is failing to match identifiers in function definitions for Imenu and add-change-log commands. (php-keywords): Remove "private" since its handled like "protected" and "public", not as a generic keyword. (php-font-lock-keywords-1): The use of grouping in the regular expression for php-constants and php-keywords added on 2008-04-12 requires referencing the group number to highlight, otherwrise the entire match is highlighted. * php-mode.texi: Fix typos and fill long paragraphs. Add maintainer comment near top of file. Correct maintainer email address with working address. (Introduction): Add index entry for M-x php-mode-version. (Installation): New section. (Editing): Change concept index entry of fill-column to a variable index entry. (Completion): Add index entry for M-x visit-tags-table, and M-x customize-variable. (Index Menu): Finish maintainer comments on Imenu. "Functions" sub-menu is now named "All Functions". Document new sub-menus "Public methods", "Private methods", "Protected methods". Add index entry for M-x customize-variable. (Customization): Add index entry for M-x customize-group. (Embedded HTML): Add index entry for M-x html-mode and M-x html-mode. (Contributors): Add Dias Badekas. (Concept Index): Add maintainer notes on indexing. 2008-10-21 Aaron S. Hawley * php-mode.el (php-imenu-generic-expression) (php-block-stmt-1-kwds, php-block-stmt-2-kwds) (php-block-stmt-1-key, php-block-stmt-2-key) (php-class-decl-kwds, php-class-key): Move some definitions to earlier in the file to avoid "free variable" warnings on byte compilation. (php-tags-key) Remove eval-when-compile for strange compilation error about void variable php-tags. 2008-10-20 Aaron S. Hawley * php-mode.el (php-check-html-for-indentation): Change regular expression for indentation warning to match only HTML at the beginning of the line. (php-check-html-for-indentation, defun-prompt-regexp) (php-class-key): Make regular expressions consistent for whitespace characters by using "\s-". (php-imenu-generic-expression): Support abstract, final, static, public, private and protected keywords in Imenu. 2008-10-20 Dias Badekas * php-mode.el (php-constants): Add date and time constants of PHP. 2008-05-21 Aaron S. Hawley * php-mode.texi (Indentation): PHP mode's indentation rules are inherited from C mode, not the PEAR coding standards by default. Explain when PEAR indentation is on. (Indentation, Motion, Completion, Embedded HTML): Modify various concept index entries. (Completion, Index Menu): Use "its" when describing the value of a variable. * php-mode.el (php-mode): Add "\s *" after "&?" in defun-prompt-regexp, since functions can have an ampersand before the identifier with whitespace added. (php-speedbar-config, php-mode-speedbar-open, php-manual-url) (php-mode-force-pear): Remove backslash that causes continuation of the line in docstrings. 2008-05-02 Aaron S. Hawley * php-mode.texi (Completion): Give example of making a php-completion-file from the PHP manual HTMl files. (Change Logs): Add index entries to this section. (Customization): Add notes as source code comments about what should be documented in this section. 2008-04-12 Aaron S. Hawley * php-mode.texi: Insert various comments for maintaining the manual. Make grammatical fixes throughout document. (Introduction): Add description of intended audience. (Editing): Document mark-defun, narrow-to-defun and widen. (Change Logs): Mention `C-x 4 a' can be run from PHP file or Diff mode buffer. (Contributors): Add Aaron Iba. * php-mode.el: Update modification date to today's date. (php-tags, php-tags-key): Move definition to above php-mode to avoid byte compiler warning. Use eval-when-compile for regexp-opt. (php-font-lock-keywords-1): Use font-lock-preprocessor-face for PHP and ASP tags. (php-mode-modified): Use a string literal rather than a computed value. (php-font-lock-keywords-1, php-font-lock-keywords-2): Add [^_$] to beginning and [^_] to end of font-lock regular expressions to avoid false matches in user variable and function names. Affects highlighting of self, parent, print, break, case, continue, other keywords and internal constants. 2008-04-09 Aaron S. Hawley * php-mode.el (php-mode): Add commented-out c-lang-defvar statements below commented-out out c-lang-defconst. (php-mode-modified): Resolve setting constant by using format-time-string, but still using eval-when-compile. (php-mode): Turn on c-mode features with c-add-language, including c-symbol-key. (php-mode): Overwrite C-style macros rule to recognize PHP tags instead. (php-tags, php-tags-key): New constants. (php-font-lock-keywords-1): Use php-tags-key for syntax highlighting of PHP tags. 2008-04-07 Aaron S. Hawley * php-mode.el (php-beginning-of-defun-regexp): Support function keywords like public, private per #1892662. 2008-04-06 Aaron S. Hawley * php-mode.el: Change incorrect year, "2007", in "Modified" field at top of file. (php-mode-version-number): Mark as "alpha" release. (php-show-arglist, php-font-lock-keywords-1) (php-font-lock-keywords-2): Replace "\\s-" for "[ \t]" in regular expressions to maintain consistency. (php-imenu-generic-expression): Delete comment explaining Imenu, since it's documented *correctly* in the manual. (php-mode): Remove definition php-mode-syntax-table and XEmacs bits that likely don't even work. 2008-01-25 Aaron S. Hawley * Makefile: File added. 2008-01-03 Aaron S. Hawley * php-mode.el: Release candidate for 1.4.0. Update copyright. Update version number. 2008-01-02 Aaron S. Hawley * php-mode.el (php-mode-modified): Fix this constant when library is compiled by wrapping in eval-when-compile. 2007-12-26 Aaron S. Hawley * php-mode.el (php-mode): Delete use of php-conditional-key, as reported by Diego 'Flameeyes' Pettenò. 2007-11-24 Lennart Borgman * php-mode.el (php-mode): Delete trailing whitespace. Fix capitalization of t value for font-lock-defaults. (php-constants): Delete trailing whitespace. 2007-11-23 Lennart Borgman * php-mode.el: Fix typo in changelog "versoin". Put occurences of `php-mode' in quotes when in an Emacs Lisp documentation string. * php-mode.el (php-mode-hook): Add period to doc string. 2007-11-06 Aaron S. Hawley * php-mode.el: Update file header for 1.4 beta release. Release under version 3 of the GNU GPL or later. 2007-11-06 Aaron S. Hawley * php-mode.el (php-mode-version): Rename php-mode-version-number. (php-mode): Use setq rather than c-lang-defconst to support CC Mode version 5.31 in Emacs 22. (php-constants): "decomment" -> "uncomment". (php-conditional-key): Delete constant. (php-block-stmt-1-key, php-block-stmt-2-key): Generate from values of php-block-stmt-1-kwds, php-block-stmt-2-kwds, respectively. 2007-11-05 Aaron S. Hawley * php-mode.texi (Indentation): Explain CC mode customizations. 2007-10-27 Aaron S. Hawley * php-mode.texi: Rename manual from "Emacs PHP mode" to "PHP Mode Manual". Add local variable compile-command. (Top): Add new sections to menu. (Introduction): Add index entries. (Electricity): Add index entries. Give example electric characters. Explain how to temporarily shut off electricity. (Motion): Add index entries. (Indentation): Add index entries. Explain indentation rules. Mention HTML indentation. (Embedded HTML): New appendix section. (Concept Index): Renamed from Index. (Function Index, Keyboard Index): New indexes. 2007-10-26 Aaron S. Hawley * php-mode.el (php-mode-modified): Silence error for re-search-backward. (php-check-html-for-indentation): Fix error "Invalid search bound (wrong side of point)". Have HTML regexp match opening elements, with attributes. 2007-10-25 Aaron S. Hawley * php-mode.texi: File added. * php-mode.el (php-check-html-for-indentation): Search for HTML tags only on current line. (php-mode): Delete variables that generate compiler warnings. (php-mode-force-pear): Define customization. 2007-10-24 Aaron S. Hawley * php-mode.el (php-mode-modified): New constant. (php-speedbar-config): Use boundp for speedbar conditional. (php-mode-version): New function. (php-mode): Specify Javadoc as c-doc-comment-style. (php-imenu-generic-expression): Replace [a-zA-z0-9] with [[:alnum:]]. 2007-10-23 Aaron S. Hawley * php-mode.el (php-font-lock-keywords-2): Fix by Ian Eure for __CLASS__ constant. 2007-10-22 Aaron S. Hawley * php-mode.el: Add form feed characters between sections. (php-beginning-of-defun-regexp): New constant. (php-beginning-of-defun, php-end-of-defun): New functions. (php-mode): Call (c-add-language). Provide local versions of {beginning,end}-of-defun-function, set open-paren-in-column-0-is-defun-start to nil, provide value for defun-prompt-regexp and add-log-current-defun-header-regexp. (php-constants): Add __FUNCTION__, __CLASS__, __METHOD__, E_STRICT, PHP_EOL. Keep PREG_*, PGSQL_*, and PRINTER_* constants on separate lines. (php-font-lock-keywords-3): Fontify "class::member". Allow call-by-reference for PHP 5 function declarations. Use php-default-face everywhere. (php-imenu-generic-expression) Imenu fix by Bill Lovett for functions with visibility declarations (private, public, protected). (php-conditional-key): Rewritten using php-block-stmt-1-kwds and php-block-stmt-2-kwds. (php-block-stmt-1-kwds): New constant. (php-block-stmt-1-kwds): New constant. (php-class-kwds): Removed. (php-class-decl-kwds): New constant. (php-class-key): Don't use php-class-kwds. 2007-04-21 Lennart Borgman * php-mode.el: Release separately by Lennart Borgman on 2007-04-21 as version 1.3.0. Documentation changes and fixes of XEmacs conditionals throughout code. (php-default-face): New font-lock face. (php-speedbar-config, php-mode-speedbar-open): Ignore php-file patterns option, by default set to (php-manual-url, php-search-url, php-completion-file) (php-manual-path): Fix documentation strings. (php-mode-user-hook): Renamed to php-mode-hook. (xemacsp): Removed constant. (php-check-html-for-indentation, php-cautious-indent-region) (php-cautious-indent-line, php-warned-bad-indent): Changed the highlighting of the HTML part. Use or suggest mumamo. (php-mode): Don't use comment-start, comment-end and comment-start-skip. Changed the definition of # using a tip from Stefan Monnier. This corrected highlighting and indentation. Let Customization handle Speedbar setting. (php-font-lock-keywords-1): Use php-default-face. (php-font-lock-keywords-3): Improved HTML highlighting. Use php-default-face. Add warnings for words not fontified. (php-font-lock-syntactic-keywords): Removed constant. 2005-08-02 Turadg Aleahmad * php-mode.el: Release of version 1.2.0. Fix some keybindings and default settings by Engelke Eschner. (php-manual-url): Add "manual.php". (php-show-arglist) Implemented by Engelke Eschner. Bound to C-. (php-complete-function) Implemented by Engelke Eschner. Bound to M-TAB. (php-mode) Re-enabled #-style comment detection in GNU Emacs by Urban Müller. 2004-01-24 Turadg Aleahmad * php-mode.el: Release version 1.1.0. Added PHP5 support by Giacomo Tesio (known problem: doesn't highlight after first 'implements'. (php-imenu-generic-expression, php-font-lock-keywords-2) (php-font-lock-keywords-3): Better XEmacs compatibility by Ville Skytta -- imenu, regexp, and comments! (php-conditional-key) Improvement to regexp by Eric Mc Sween. 2003-09-28 Turadg Aleahmad * php-mode.el: Release version 1.0.5. Add Contributors section. Cleared the Changelog. (php-mode, php-conditional-key): Add "foreach" to conditional introducing keywords by Nils Rennebarth. (php-mode, php-imenu-generic-expression): Incorporated speedbar defs by Gerrit Riessen. 2003-02-26 Turadg Aleahmad * php-mode.el: Release version 1.0.4. Removed abbreviation definitions since they cause abbrev-mode to always be enabled. If you want them, include them in your php-mode-user-hook as described above. (php-font-lock-keywords-3): Fixed unbalanced regexp for "->symbol" match. 2003-02-24 Turadg Aleahmad * php-mode.el: Release version 1.0.3. (php-keywords): Include ZE 2 keywords (Stig Bakken). (php-superglobals): Highlight superglobals (Stig Bakken) (php-font-lock-keywords-1, php-font-lock-keywords-2) (php-font-lock-keywords-3): Revised regexps to include '_'. (php-font-lock-keywords-3): Removed '_' out of word syntax table as suggested by Gregory Stark. (php-types) Addition of "boolean" to types from Valentin Funk. (php-mode-abbrev-table): Removed abbreviation definitions since they cause abbrev-mode to always be enabled. (php-file-patterns): Autoloaded as submitted by SourceForge user ppercot. 2002-01-22 Turadg Aleahmad * php-mode.el: Release version 1.0.2. Highlight HTML tags and entities (see site for more on HTML). Highlight more constants by default. Fixed problem with $-line indenting inside switch (see comments). Fix to show keymap in help mode (Ryan Sammartino). Added .phps to default extensions to match (John Keller) 2001-11-04 Turadg Aleahmad * php-mode.el: Release version 1.0.1. Fix for some speedbar problems. 2001-10-21 Turadg Aleahmad * php-mode.el: Release version 1.0.0. Function indentation fix (Craig Andrews). Added option to open speedbar on buffer load. Fixed PEAR filename matching regexps and bug with mmm-mode. Added preference option to always use PEAR standards. Fixed PEAR hook bug with XEmacs. Took out warning for empty parens in "new Object()". Fixed keyword highlighting of 'this' at start of variable. Removed "goto" references. Added 'next' as keyword. 2001-07-13 Turadg Aleahmad * php-mode.el: Release version 0.9.9. Fixed highlights for targets of gotos and 'default' within a switch. Changed my e-mail and URL to SourceForge. Changed name of hook variable (update your .emacs). Wrapped PEAR standards into a PEAR hook. Disabled coloring non-core constants (see comments to re-enable). 2001-05-29 Turadg Aleahmad * php-mode.el: Release version 0.9.8. Thanks to Stig Saether Bakken for a patch that: Checks for PEAR before setting indent-tabs-mode to nil Adds some keywords that got lost Highlights function $foo and class::method Removes C++ template from speedbar search expression :) Adds about a thousand constants So many that if you want to recompile php-mode-098.el you'll have to greatly increase max-specpdl-size. 2001-05-23 Turadg Aleahmad * php-mode.el: Release version 0.97. This version marks a huge advance and will become 1.0.0 after I wait a bit for possible bug reports. The primary improvement is support for shell-style comments in both GNU Emacs and XEmacs. Thank for this goes to Fred Yankowski . Customization of mode hook (Roland Rosenfeld). Fontifies object references much more intelligently. Added .inc to filename and Speedbar patterns. PEAR coding standards (tabs -> 4 spaces). Fontify ASP-style tag (Fred). Rudimentary coloration of HTML tags (Fred). Buges fixed: Fixed extraneous newline at end of file (Fred). Colored functions within comments. Didn't recognize keywords in caps. Fixed colored functions as variables when referenced by an object. 2001-01-28 Turadg Aleahmad * php-mode.el: Release version 0.9.6. Keyboard shortcuts for menu functions (Boris Folgmann). Fixed default regexp for detecting PHP files (Mathias Meyer). Changed PHP3 menu to simply PHP. 2001-01-14 Turadg Aleahmad * php-mode.el: Release version 0.9.5. Been told that problems with XEmacs are no longer. Search documention command actually works. Browse manual customization improved. 2001-01-08 Turadg Aleahmad * php-mode.el: Release version 0.9.4. Search documentation command. Browse manual function. Simplified file patterns for which to load php-mode. PHP awareness in Speedbar. Customization options for all of the above. 2000-11-12 Turadg Aleahmad * php-mode.el: Release version 0.9.3. Imenu support for classes and functions (Rex McMaster). Dramatically improved regexps (Kevin Blake). Fix for XEmacs font-lock-pre-idle-hook problem? (Doug Marcey). Progress on PHP3 menu functions (Sean Champ). Added "foreach" to list of keywords (Sean Champ). More file suffixes observed (Vinai Kopp). 2000-03-08 Turadg Aleahmad * php-mode.el: Release version 0.9.2. Fixed bug with 1-character identifiers. Fixed bug with class declaration coloring. Added coloring for true, false, null. Officially not supporting XEmacs. 2000-02-21 Turadg Aleahmad * php-mode.el: Release version 0.9.1. Disabled keywords in XEmacs for compatibility Added usage info to comments. 2000-01-09 Turadg Aleahmad * php-mode.el: Release version 0.9. Clarified bug with XEmacs (Juanjo). Fixed minor bug with comment highlighting (Juanjo). Syntax parsing from PHP3 lexical scanner (Torsten Martinsen). Highlights function and method names now. Highlights "this" as keyword when used as an object in variable names. 1999-05-17 Turadg Aleahmad * php-mode.el: Initial release, version 0.8.