diff options
| author | Stefan Monnier | 2008-06-06 20:02:42 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-06-06 20:02:42 +0000 |
| commit | 2e6750c8f8f1bc4af059574da7cea898321dc914 (patch) | |
| tree | 8e65f6f26f204d9fcbc05712ae701adf2ace58e4 | |
| parent | bb9ba46f2178db819f4be76c8e2d9a4a3061011b (diff) | |
| download | emacs-2e6750c8f8f1bc4af059574da7cea898321dc914.tar.gz emacs-2e6750c8f8f1bc4af059574da7cea898321dc914.zip | |
* help.el (function-called-at-point):
* help-fns.el (variable-at-point): Use emacs-lisp-mode-syntax-table
even when calling find-tag-default.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/help-fns.el | 26 | ||||
| -rw-r--r-- | lisp/help.el | 68 |
3 files changed, 53 insertions, 47 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6ca7bffdceb..f4b0748c764 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2008-06-06 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * help.el (function-called-at-point): | ||
| 4 | * help-fns.el (variable-at-point): Use emacs-lisp-mode-syntax-table | ||
| 5 | even when calling find-tag-default. | ||
| 6 | |||
| 1 | 2008-06-06 Daniel Colascione <danc@merrillpress.com> | 7 | 2008-06-06 Daniel Colascione <danc@merrillpress.com> |
| 2 | 8 | ||
| 3 | * nxml/nxml-mode.el (nxml-syntax-highlight-flag) | 9 | * nxml/nxml-mode.el (nxml-syntax-highlight-flag) |
diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 1d1130f21a8..f2e9b1e1b98 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el | |||
| @@ -443,8 +443,8 @@ face (according to `face-differs-from-default-p')." | |||
| 443 | "Return the bound variable symbol found at or before point. | 443 | "Return the bound variable symbol found at or before point. |
| 444 | Return 0 if there is no such symbol. | 444 | Return 0 if there is no such symbol. |
| 445 | If ANY-SYMBOL is non-nil, don't insist the symbol be bound." | 445 | If ANY-SYMBOL is non-nil, don't insist the symbol be bound." |
| 446 | (or (condition-case () | 446 | (with-syntax-table emacs-lisp-mode-syntax-table |
| 447 | (with-syntax-table emacs-lisp-mode-syntax-table | 447 | (or (condition-case () |
| 448 | (save-excursion | 448 | (save-excursion |
| 449 | (or (not (zerop (skip-syntax-backward "_w"))) | 449 | (or (not (zerop (skip-syntax-backward "_w"))) |
| 450 | (eq (char-syntax (following-char)) ?w) | 450 | (eq (char-syntax (following-char)) ?w) |
| @@ -452,17 +452,17 @@ If ANY-SYMBOL is non-nil, don't insist the symbol be bound." | |||
| 452 | (forward-sexp -1)) | 452 | (forward-sexp -1)) |
| 453 | (skip-chars-forward "'") | 453 | (skip-chars-forward "'") |
| 454 | (let ((obj (read (current-buffer)))) | 454 | (let ((obj (read (current-buffer)))) |
| 455 | (and (symbolp obj) (boundp obj) obj)))) | 455 | (and (symbolp obj) (boundp obj) obj))) |
| 456 | (error nil)) | 456 | (error nil)) |
| 457 | (let* ((str (find-tag-default)) | 457 | (let* ((str (find-tag-default)) |
| 458 | (sym (if str (intern-soft str)))) | 458 | (sym (if str (intern-soft str)))) |
| 459 | (if (and sym (or any-symbol (boundp sym))) | 459 | (if (and sym (or any-symbol (boundp sym))) |
| 460 | sym | 460 | sym |
| 461 | (save-match-data | 461 | (save-match-data |
| 462 | (when (and str (string-match "\\`\\W*\\(.*?\\)\\W*\\'" str)) | 462 | (when (and str (string-match "\\`\\W*\\(.*?\\)\\W*\\'" str)) |
| 463 | (setq sym (intern-soft (match-string 1 str))) | 463 | (setq sym (intern-soft (match-string 1 str))) |
| 464 | (and (or any-symbol (boundp sym)) sym))))) | 464 | (and (or any-symbol (boundp sym)) sym))))) |
| 465 | 0)) | 465 | 0))) |
| 466 | 466 | ||
| 467 | (defun describe-variable-custom-version-info (variable) | 467 | (defun describe-variable-custom-version-info (variable) |
| 468 | (let ((custom-version (get variable 'custom-version)) | 468 | (let ((custom-version (get variable 'custom-version)) |
diff --git a/lisp/help.el b/lisp/help.el index 5ed67566c93..44e3f707af1 100644 --- a/lisp/help.el +++ b/lisp/help.el | |||
| @@ -254,40 +254,40 @@ C-w Information on absence of warranty for GNU Emacs." | |||
| 254 | (defun function-called-at-point () | 254 | (defun function-called-at-point () |
| 255 | "Return a function around point or else called by the list containing point. | 255 | "Return a function around point or else called by the list containing point. |
| 256 | If that doesn't give a function, return nil." | 256 | If that doesn't give a function, return nil." |
| 257 | (or (with-syntax-table emacs-lisp-mode-syntax-table | 257 | (with-syntax-table emacs-lisp-mode-syntax-table |
| 258 | (or (condition-case () | 258 | (or (condition-case () |
| 259 | (save-excursion | 259 | (save-excursion |
| 260 | (or (not (zerop (skip-syntax-backward "_w"))) | 260 | (or (not (zerop (skip-syntax-backward "_w"))) |
| 261 | (eq (char-syntax (following-char)) ?w) | 261 | (eq (char-syntax (following-char)) ?w) |
| 262 | (eq (char-syntax (following-char)) ?_) | 262 | (eq (char-syntax (following-char)) ?_) |
| 263 | (forward-sexp -1)) | 263 | (forward-sexp -1)) |
| 264 | (skip-chars-forward "'") | 264 | (skip-chars-forward "'") |
| 265 | (let ((obj (read (current-buffer)))) | 265 | (let ((obj (read (current-buffer)))) |
| 266 | (and (symbolp obj) (fboundp obj) obj))) | 266 | (and (symbolp obj) (fboundp obj) obj))) |
| 267 | (error nil)) | 267 | (error nil)) |
| 268 | (condition-case () | 268 | (condition-case () |
| 269 | (save-excursion | 269 | (save-excursion |
| 270 | (save-restriction | 270 | (save-restriction |
| 271 | (narrow-to-region (max (point-min) | 271 | (narrow-to-region (max (point-min) |
| 272 | (- (point) 1000)) (point-max)) | 272 | (- (point) 1000)) (point-max)) |
| 273 | ;; Move up to surrounding paren, then after the open. | 273 | ;; Move up to surrounding paren, then after the open. |
| 274 | (backward-up-list 1) | 274 | (backward-up-list 1) |
| 275 | (forward-char 1) | 275 | (forward-char 1) |
| 276 | ;; If there is space here, this is probably something | 276 | ;; If there is space here, this is probably something |
| 277 | ;; other than a real Lisp function call, so ignore it. | 277 | ;; other than a real Lisp function call, so ignore it. |
| 278 | (if (looking-at "[ \t]") | 278 | (if (looking-at "[ \t]") |
| 279 | (error "Probably not a Lisp function call")) | 279 | (error "Probably not a Lisp function call")) |
| 280 | (let ((obj (read (current-buffer)))) | 280 | (let ((obj (read (current-buffer)))) |
| 281 | (and (symbolp obj) (fboundp obj) obj)))) | 281 | (and (symbolp obj) (fboundp obj) obj)))) |
| 282 | (error nil)))) | 282 | (error nil)) |
| 283 | (let* ((str (find-tag-default)) | 283 | (let* ((str (find-tag-default)) |
| 284 | (sym (if str (intern-soft str)))) | 284 | (sym (if str (intern-soft str)))) |
| 285 | (if (and sym (fboundp sym)) | 285 | (if (and sym (fboundp sym)) |
| 286 | sym | 286 | sym |
| 287 | (save-match-data | 287 | (save-match-data |
| 288 | (when (and str (string-match "\\`\\W*\\(.*?\\)\\W*\\'" str)) | 288 | (when (and str (string-match "\\`\\W*\\(.*?\\)\\W*\\'" str)) |
| 289 | (setq sym (intern-soft (match-string 1 str))) | 289 | (setq sym (intern-soft (match-string 1 str))) |
| 290 | (and (fboundp sym) sym))))))) | 290 | (and (fboundp sym) sym)))))))) |
| 291 | 291 | ||
| 292 | 292 | ||
| 293 | ;;; `User' help functions | 293 | ;;; `User' help functions |