499
499
(string-match "STA" ess-language)
500
500
(string-match "SAS" ess-language)))
501
501
(let* ((help-files-list
502
(ess-uniq-list (append (ess-get-help-files-list)
503
(ess-get-help-aliases-list)
506
ess-current-process-name)))))
502
(ess-get-help-topics-list ess-current-process-name))
507
503
(default (ess-read-helpobj-name-default help-files-list))
508
504
(prompt-string (if default
509
505
(format "%s(default %s) " p-string default)
519
515
;;*;; Utility functions
517
(defun ess-get-help-topics-list (name)
518
"Return a list of current S help topics associated with process NAME.
519
If `ess-sp-change' is non-nil or `ess-help-topics-list' is nil, (re)-populate
520
the latter and return it. Otherwise, return `ess-help-topics-list'."
522
(set-buffer (process-buffer (get-ess-process name)))
523
(ess-make-buffer-current)
524
(ess-write-to-dribble-buffer
525
(format "(ess-get-help-topics-list %s) .." name))
526
(if (or (not ess-help-topics-list) ess-sp-change)
527
(setq ess-help-topics-list
530
(append (ess-get-help-files-list)
531
(ess-get-help-aliases-list)
532
(ess-get-object-list name)))))
533
;; else return the existing list
534
ess-help-topics-list)))
521
536
(defun ess-get-help-files-list ()
522
537
"Return a list of files which have help available."
525
(mapcar '(lambda (dirname)
526
(if (file-directory-p dirname)
527
(directory-files dirname)))
528
(mapcar '(lambda (str) (concat str "/.Help"))
529
(ess-search-list))))))
539
(mapcar '(lambda (dirname)
540
(if (file-directory-p dirname)
541
(directory-files dirname)))
542
(mapcar '(lambda (str) (concat str "/.Help"))
543
(ess-search-list)))))
531
545
(defun ess-get-help-aliases-list ()
532
546
"Return a list of aliases which have help available."
536
(mapcar '(lambda (a-file)
537
(if (file-exists-p a-file)
538
(ess-get-words-from-vector
540
"names(.readRDS(\"%s\"))\n" a-file))))
541
(mapcar '(lambda (str) (concat str "/help/aliases.rds"))
542
(ess-get-words-from-vector
543
"searchpaths()\n")))))))
548
(mapcar '(lambda (a-file)
549
(if (file-exists-p a-file)
550
(ess-get-words-from-vector
552
"names(.readRDS(\"%s\"))\n" a-file))))
553
(mapcar '(lambda (str) (concat str "/help/aliases.rds"))
554
(ess-get-words-from-vector
555
"searchpaths()\n")))))
545
557
(defun ess-nuke-help-bs ()
546
558
"Remove ASCII underlining and overstriking performed by ^H codes."