(defgroup reftex): Update home page url-link.
[bpt/emacs.git] / lisp / help-mode.el
index a5cdf1f..ce79e61 100644 (file)
@@ -157,7 +157,9 @@ The format is (FUNCTION ARGS...).")
                   (let ((location
                          (find-function-search-for-symbol fun nil file)))
                     (pop-to-buffer (car location))
-                    (goto-char (cdr location))))
+                    (if (cdr location)
+                        (goto-char (cdr location))
+                      (message "Unable to find location in file"))))
   'help-echo (purecopy "mouse-2, RET: find function's definition"))
 
 (define-button-type 'help-variable-def
@@ -167,8 +169,10 @@ The format is (FUNCTION ARGS...).")
                     (setq file (help-C-file-name var 'var)))
                   (let ((location (find-variable-noselect var file)))
                     (pop-to-buffer (car location))
-                    (goto-char (cdr location))))
-  'help-echo (purecopy"mouse-2, RET: find variable's definition"))
+                    (if (cdr location)
+                      (goto-char (cdr location))
+                      (message "Unable to find location in file"))))
+  'help-echo (purecopy "mouse-2, RET: find variable's definition"))
 
 (define-button-type 'help-face-def
   :supertype 'help-xref
@@ -179,7 +183,9 @@ The format is (FUNCTION ARGS...).")
                   (let ((location
                          (find-function-search-for-symbol fun 'defface file)))
                     (pop-to-buffer (car location))
-                    (goto-char (cdr location))))
+                    (if (cdr location)
+                        (goto-char (cdr location))
+                      (message "Unable to find location in file"))))
   'help-echo (purecopy "mouse-2, RET: find face's definition"))
 
 \f
@@ -197,7 +203,10 @@ Commands:
   (view-mode)
   (make-local-variable 'view-no-disable-on-exit)
   (setq view-no-disable-on-exit t)
-  (setq view-exit-action (lambda (buffer) (delete-window)))
+  (setq view-exit-action (lambda (buffer)
+                          (or (window-minibuffer-p (selected-window))
+                              (one-window-p t)
+                              (delete-window))))
   (run-mode-hooks 'help-mode-hook))
 
 ;;;###autoload
@@ -235,9 +244,9 @@ Commands:
 
 (defconst help-xref-symbol-regexp
   (purecopy (concat "\\(\\<\\(\\(variable\\|option\\)\\|"  ; Link to var
-                   "\\(function\\|command\\)\\|"          ; Link to function
-                   "\\(face\\)\\|"                        ; Link to face
-                   "\\(symbol\\|program\\)\\|"            ; Don't link
+                   "\\(function\\|command\\)\\|"          ; Link to function
+                   "\\(face\\)\\|"                        ; Link to face
+                   "\\(symbol\\|program\\|property\\)\\|" ; Don't link
                    "\\(source \\(?:code \\)?\\(?:of\\|for\\)\\)\\)"
                    "[ \t\n]+\\)?"
                    ;; Note starting with word-syntax character: