summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2002-09-09 23:13:18 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2002-09-09 23:13:18 +0000
commite9f13a9580e6bd5f71ed9ad684b586c4d445ec17 (patch)
tree16536601c40321b07cf6730f8e4c1eaf3b314e82 /lisp
parent03741cc50b071bc2755506851f7c65cb6b321deb (diff)
downloademacs-e9f13a9580e6bd5f71ed9ad684b586c4d445ec17.tar.gz
emacs-e9f13a9580e6bd5f71ed9ad684b586c4d445ec17.tar.bz2
emacs-e9f13a9580e6bd5f71ed9ad684b586c4d445ec17.zip
(symbol-file): Also work for autoloaded funcs.
(syntax-after): New fun moved from syntax.el.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/subr.el28
1 files changed, 19 insertions, 9 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index 4d1d1b350ec..5242ebbbd15 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -919,14 +919,16 @@ The value is normally a string that was passed to `load':
either an absolute file name, or a library name
\(with no directory name and no `.el' or `.elc' at the end).
It can also be nil, if the definition is not associated with any file."
-;;; (load-symbol-file-load-history)
- (let ((files load-history)
- file functions)
- (while files
- (if (memq function (cdr (car files)))
- (setq file (car (car files)) files nil))
- (setq files (cdr files)))
- file))
+ (if (and (symbolp function) (fboundp function)
+ (eq 'autoload (car-safe (symbol-function function))))
+ (nth 1 (symbol-function function))
+ (let ((files load-history)
+ file functions)
+ (while files
+ (if (memq function (cdr (car files)))
+ (setq file (car (car files)) files nil))
+ (setq files (cdr files)))
+ file)))
;;;; Specifying things to do after certain files are loaded.
@@ -952,7 +954,7 @@ evaluated whenever that feature is `provide'd."
(featurep file)
;; Make sure `load-history' contains the files dumped with
;; Emacs for the case that FILE is one of them.
- ;;; (load-symbol-file-load-history)
+ ;; (load-symbol-file-load-history)
(assoc file load-history))
(eval form))))
form)
@@ -1862,6 +1864,14 @@ from `standard-syntax-table' otherwise."
(set-char-table-parent table (or oldtable (standard-syntax-table)))
table))
+(defun syntax-after (pos)
+ "Return the syntax of the char after POS."
+ (unless (or (< pos (point-min)) (>= pos (point-max)))
+ (let ((st (if parse-sexp-lookup-properties
+ (get-char-property pos 'syntax-table))))
+ (if (consp st) st
+ (aref (or st (syntax-table)) (char-after pos))))))
+
(defun add-to-invisibility-spec (arg)
"Add elements to `buffer-invisibility-spec'.
See documentation for `buffer-invisibility-spec' for the kind of elements