[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [AUCTeX-devel] Changing TeX-doc?

From: Mosè Giordano
Subject: Re: [AUCTeX-devel] Changing TeX-doc?
Date: Thu, 28 Jan 2016 13:27:53 +0100

Hi all,

I'm (very!) slowly sorting out some old discussions, now I'm back to
simplification of the function for searching documentation.

My proposal is to keep `TeX-doc' as it is (maybe someone likes it, but
to be honest I don't) and define a new, much much simpler function
bound to "C-c ?" in place of it:

--8<---------------cut here---------------start------------->8---
(defun TeX-documentation-texdoc ()
  "Run texdoc to read documentation."
    (concat "texdoc --view "
        (TeX-read-string "View documentation for: "
                 (thing-at-point 'symbol))))))
--8<---------------cut here---------------end--------------->8---

Ideas about the name are welcome :-)

This function gets the symbol at point and uses it as initial input
for `read-string', then simply runs "texdoc --view <given-string>", no
more, as suggested also by Arash.  I think it's fast and effective.

A possible improvement could be to offer the list of alternatives, as
"texdoc --list" does, when calling the function with a prefix
argument.  I tried to call "texdoc --list <string>" with `comint-exec'
but it doesn't start the viewer, I suspect there is something wrong in
`texdoc' (or in its interaction with `comint-exec') because other
programs run with `comint-exec' are able to start external programs.
Thus, I think we should parse "Data.tlpdb.lua" as suggested by
Nicolas.  Anyway, I'd add this feature later.

Other suggestions?  Objections against taking over "C-c ?"?


2015-12-16 22:22 GMT+01:00 Arash Esbati <address@hidden>:
> Hi Mosè,
> Mosè Giordano <address@hidden> writes:
>> am I the only one who finds `TeX-doc' overly complicated to the point
>> it's sometimes useless?  It fails to find documentation for many
>> packages and classes, also pretty common ones like "babel", "fontenc",
>> and "memoir".  Wouldn't it better if it simply runs "texdoc NAME"?
>> Aucompletion is cool, but in this case is often useless as the
>> manual's basenames don't have to, and many times don't, match the name
>> of the package.
> I agree.  My suggestion is also to reduce this function to run "texdoc
> NAME".  `C-u TeX-doc' could run "texdoc -l NAME" and let the user choose
> a number.  I also agree that autocompletion is useless here.
> If I get it right MikTeX also includes "texdoc", so it seems to be
> portable as well.
> Best, Arash
> _______________________________________________
> auctex-devel mailing list
> address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]