11
11
(defconst php-mode-version-number " 1.15.3"
12
12
" PHP Mode version number." )
13
13
14
- (defconst php-mode-modified " 2015-01-31 "
14
+ (defconst php-mode-modified " 2015-02-16 "
15
15
" PHP Mode build date." )
16
16
17
17
; ;; License
94
94
; ; Use the recommended cl functions in php-mode but alias them to the
95
95
; ; old names when we detect emacs < 24.3
96
96
(if (and (= emacs-major-version 24 ) (< emacs-minor-version 3 ))
97
- (progn
98
- (unless (fboundp 'cl-flet )
99
- (defalias 'cl-flet 'flet ))
100
- (unless (fboundp 'cl-set-difference )
101
- (defalias 'cl-set-difference 'set-difference ))))
97
+ (unless (fboundp 'cl-set-difference )
98
+ (defalias 'cl-set-difference 'set-difference )))
102
99
103
100
104
101
; ; Local variables
@@ -1280,27 +1277,24 @@ exists, and nil otherwise.
1280
1277
1281
1278
With a prefix argument, prompt (with completion) for a word to search for."
1282
1279
(interactive (php--search-documentation-read-arg))
1283
- (cl-flet ((php-file-for (type name)
1284
- (expand-file-name
1285
- (format " %s .%s .html" type
1286
- (replace-regexp-in-string
1287
- " _" " -" (downcase name)))
1288
- php-manual-path))
1289
- (php-file-url (file)
1290
- ; ; Some browsers require the file:// prefix.
1291
- ; ; Others do not seem to care. But it should
1292
- ; ; never be incorrect to use the prefix.
1293
- (if (string-prefix-p " file://" file)
1294
- file
1295
- (concat " file://" file))))
1296
- (let ((file (catch 'found
1297
- (loop for type in php-search-local-documentation-types do
1298
- (let ((file (php-file-for type word)))
1299
- (when (file-exists-p file)
1300
- (throw 'found file)))))))
1301
- (when file
1302
- (php-browse-documentation-url (php-file-url file))
1303
- t ))))
1280
+ (let ((file (catch 'found
1281
+ (loop for type in php-search-local-documentation-types do
1282
+ (let* ((doc-html (format " %s .%s .html"
1283
+ type
1284
+ (replace-regexp-in-string
1285
+ " _" " -" (downcase word))))
1286
+ (file (expand-file-name doc-html php-manual-path)))
1287
+ (when (file-exists-p file)
1288
+ (throw 'found file)))))))
1289
+ (when file
1290
+ (let ((file-url (if (string-prefix-p " file://" file)
1291
+ file
1292
+ (concat " file://" file))))
1293
+ (php-browse-documentation-url file-url))
1294
+ t )))
1295
+
1296
+ (defsubst php-search-web-documentation (word )
1297
+ (php-browse-documentation-url (concat php-search-url word)))
1304
1298
1305
1299
; ; Define function documentation function
1306
1300
(defun php-search-documentation (word )
@@ -1315,14 +1309,11 @@ With a prefix argument, prompt for a documentation word to search
1315
1309
for. If the local documentation is available, it is used to build
1316
1310
a completion list."
1317
1311
(interactive (php--search-documentation-read-arg))
1318
- (cl-flet ((php-search-web-documentation (name)
1319
- (php-browse-documentation-url
1320
- (concat php-search-url name))))
1321
- (if (and (stringp php-manual-path)
1322
- (not (string= php-manual-path " " )))
1323
- (or (php-search-local-documentation word)
1324
- (php-search-web-documentation word))
1325
- (php-search-web-documentation word))))
1312
+ (if (and (stringp php-manual-path)
1313
+ (not (string= php-manual-path " " )))
1314
+ (or (php-search-local-documentation word)
1315
+ (php-search-web-documentation word))
1316
+ (php-search-web-documentation word)))
1326
1317
1327
1318
; ; Define function for browsing manual
1328
1319
(defun php-browse-manual ()
@@ -1447,11 +1438,10 @@ The output will appear in the buffer *PHP*."
1447
1438
; ; Calling 'php -r' will fail if we send it code that starts with
1448
1439
; ; '<?php', which is likely. So we run the code through this
1449
1440
; ; function to check for that prefix and remove it.
1450
- (cl-flet ((clean-php-code (code)
1451
- (if (string-prefix-p " <?php" code t )
1452
- (substring code 5 )
1453
- code)))
1454
- (call-process " php" nil php-buffer nil " -r" (clean-php-code code)))))
1441
+ (let ((cleaned-php-code (if (string-prefix-p " <?php" code t )
1442
+ (substring code 5 )
1443
+ code)))
1444
+ (call-process " php" nil php-buffer nil " -r" cleaned-php-code))))
1455
1445
1456
1446
1457
1447
(defface php-annotations-annotation-face '((t . (:inherit font-lock-constant-face )))
0 commit comments