tags 665314 + patch thanks Ola Lundqvist <o...@debian.org> writes: > > A patch for this is welcome.
I get some joy from the few lines below. Similar to what Peter Galbraith might have posted earlier, but trying to make the defcustom php-file-patterns work. With this change it'll be necessary to symlink the sources to the flavour directory to have them available in "C-h f php-mode" though. But that's desirable in any case. (if (not (file-exists-p "/usr/share/emacs/site-lisp/php-elisp")) (message "php-elisp removed but not purged, skipping setup") (let ((dir (concat "/usr/share/" (symbol-name debian-emacs-flavor) "/site-lisp/php-elisp"))) (if (not (file-exists-p dir)) (message "php-elisp not for this flavour emacs, skipping setup") ;; debian-pkg-add-load-path-item as from debian 3.1 "sarge", ;; emacsen-common 1.4.14 of June 2002 (debian-pkg-add-load-path-item dir) ;; The following as per php-mode.el ;;;###autoload cookies. ;; ;; Copying the defcustom to here ensures that if the user has done ;; `M-x customize-variable php-file-patterns' then any extra patterns ;; are added to auto-mode-alist ready to use immediately. ;; ;; If the user customizes to remove a pattern, such as one of the ;; defaults here, then alas such a removed pattern is not removed from ;; `auto-mode-alist'. Perhaps the :set blob should remove the old ;; before adding the new. But let the php-mode.el code take the lead ;; on that. Probably most users manipulate auto-mode-alist from ;; .emacs rather than customize anyway. ;; (autoload 'php-mode "php-mode" "mode for editing php files" t) (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)))) -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org