-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Want TEdit to support links (URLs) in text #1951
Comments
You can define a link image object that would display its user-label in some obvious way (underlined italics?)
There are a couple of schemes, in different add-ons, for augmenting the main Tedit menu to make it easy to insert objects. We probably ought to settle on one of those schemes, and build it in.
… On Jan 3, 2025, at 1:28 PM, Herb Jellinek ***@***.***> wrote:
@abhikhasnain1 <https://github.com/abhikhasnain1> is revising the Medley Primer, the source of which is a set of TEdit documents. The Primer refers to a number of other documents that include the IRM, some Lisp introductory books, etc. When the Primer was current, we expected readers to search for these texts by name. Nowadays we can do better.
The Primer would be so much better if, for instance, a sentence that now reads
- Power Tools For Programmers by Beau Sheil. It appeared in Datamation in February, 1983, Pages 131 - 144.
contained a link to, say, the PDF of that article:
- Power Tools For Programmers by Beau Sheil. It appeared in Datamation in February, 1983, Pages 131 - 144 <https://www.sciencedirect.com/science/article/abs/pii/B9780934613125500483>.
If it's hard or infeasible to make text spans act as links, some kind of URL/link imageobject would be almost as good:
- Power Tools For Programmers by Beau Sheil. It appeared in Datamation in February, 1983, Pages 131 - 144. {link} <https://www.sciencedirect.com/science/article/abs/pii/B9780934613125500483>
—
Reply to this email directly, view it on GitHub <#1951>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AQSTUJPNYGJM2N57UWETNKT2I36HVAVCNFSM6AAAAABUSLWI56VHI2DSMVQWIX3LMV43ASLTON2WKOZSG43DQMJZGY3TKMQ>.
You are receiving this because you are subscribed to this thread.
|
Sounds good. Can you describe the different schemes at a high level? It strikes me that a sort of readmacro-like technique would be handy for adding links to a document. The user types a special key sequence in their TEdit text and is prompted for the URL. |
For example, a new item “Object” on the Tedit middle-button menu. When you click it, it brings up a menu of object-types that you can pick from.
The object-types would be taken from a list of (type function) pairs, some built in, some added by the user or application. If you select an item, its function would be applied to the stream and the current selection. The function could get the selected string (TEDIT.SEL.AS.STRING), build an object based on that, and insert it as a replacement for the selection (TEDIT.DELETE, TEDIT.INSERT.OBJECT). Among other things, a particular kind of click on the object would dismantle it in some way so that its parameters can be changed.
Something like that.
So, you could put a Link item on the list with a function that makes a link object out of the current selection and inserts it. Maybe it parses the selection into a label-part and a URL part, or if a point selection, maybe it asks the user for more info. Later left-clicking on the link-object, however it displays itself, would issue a show-URL shell command. Middle-clicking, say, would allow the link to be edited.
This is a mouse/menu approach. You could also arm a meta-key in the tedit readtable, and have that bring up a menu of possible object types. I don’t think we want an interface that is specialized just for links. E.g. another type would be the BKSYSBUF object that Larry wants for demos, and I have defined a pagenumber object that can be inserted in any heading, to clean up the pageformatting menu (and eliminating a lot of complicated code that goes with it). Then there are equations, LFG f-structures, etc. Any object that can be created with a text-to-object conversion.
… On Jan 3, 2025, at 5:31 PM, Herb Jellinek ***@***.***> wrote:
You can define a link image object that would display its user-label in some obvious way (underlined italics?) There are a couple of schemes, in different add-ons, for augmenting the main Tedit menu to make it easy to insert objects. We probably ought to settle on one of those schemes, and build it in.
Sounds good. Can you describe the different schemes at a high level?
It strikes me that a sort of readmacro-like technique would be handy for adding links to a document. The user types a special key sequence in their TEdit text and is prompted for the URL.
—
Reply to this email directly, view it on GitHub <#1951 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AQSTUJMTVMLGZONPT6EOHTL2I42W3AVCNFSM6AAAAABUSLWI56VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNRZHE4DSOBQHA>.
You are receiving this because you commented.
|
The current key sequence is ctrl-O followed by an s-expr [say, (URL.CREATE)] that evals to prompt you for the URL and the text to display in the document and drops a (yet to be created) URL image object. In the same way that you do ctrl-O (HRULE.CREATE 5) to drop in a 5pt hrule. |
I was thinking of something even simpler, since this object is just for links, like typing "<<https://foo.bar CR" and having the link imageobj created and inserted. But the invocation technique is secondary to having the imageobj at all |
You want Tedit to scan for some special string in the input, without some user action to kick it off? It is not set up to do that.
… On Jan 3, 2025, at 7:18 PM, Herb Jellinek ***@***.***> wrote:
I was thinking of something even simpler, since this object is just for links, like typing "<<https://foo.bar <https://foo.bar/> CR" and having the link imageobj created and inserted. But the invocation technique is secondary to having the imageobj at all
—
Reply to this email directly, view it on GitHub <#1951 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AQSTUJNVYT4T6MRF2A6VIFL2I5HJNAVCNFSM6AAAAABUSLWI56VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNZQGAZDQMBRGU>.
You are receiving this because you commented.
|
Not exactly: I'd like TEdit to listen for a special key or key sequence, then prompt for or silently read a URL the user types and turn it into an embedded link. |
Put the key as a FN in the Tedit readtable with the function like what I described earlier—look at the selection (maybe scan backwards if it’s a point), create the object, replace the selection. Look at the way that I added the meta-O and meta-D keys.
… On Jan 4, 2025, at 7:21 AM, Herb Jellinek ***@***.***> wrote:
Not exactly: I'd like TEdit to listen for a special key or key sequence, then prompt for or silently read a URL the user types and turn it into an embedded link.
—
Reply to this email directly, view it on GitHub <#1951 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AQSTUJJ23W5EHXH34R2PGF32I74BJAVCNFSM6AAAAABUSLWI56VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNZRGMZTEMZVGI>.
You are receiving this because you commented.
|
@abhikhasnain1 is revising the Medley Primer, the source of which is a set of TEdit documents. The Primer refers to a number of other documents that include the IRM, some Lisp introductory books, etc. When the Primer was current, we expected readers to search for these texts by name. Nowadays we can do better.
The Primer would be so much better if, for instance, a sentence that now reads
- Power Tools For Programmers by Beau Sheil. It appeared in Datamation in February, 1983, Pages 131 - 144.
contained a link to, say, the PDF of that article:
- Power Tools For Programmers by Beau Sheil. It appeared in Datamation in February, 1983, Pages 131 - 144.
If it's hard or infeasible to make text spans act as links, some kind of URL/link imageobject would be almost as good:
- Power Tools For Programmers by Beau Sheil. It appeared in Datamation in February, 1983, Pages 131 - 144. {link}
I should mention that since the Primer is mostly used in PDF form, links in the source document should be rendered as links in the PDF "hardcopy" file. I wonder if we need to think about how/whether we can do that using the existing device-independent graphics/imagestream API.
The text was updated successfully, but these errors were encountered: