unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How do I avoid the line-wrap character?
@ 2012-03-07  6:01 Dennis Lin
  0 siblings, 0 replies; 3+ messages in thread
From: Dennis Lin @ 2012-03-07  6:01 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1482 bytes --]

Salutations!

I want to be able to copy a url from a text terminal.  (Actually, I'm using
a terminal emulator that will just open the link with the appropriate
incantation.)  For long links, however, the line-wrap character gets in the
way.  I tried the tip at

http://www.emacswiki.org/emacs/LineWrap

but none of the suggested replacement characters work.  (I'm running 23.3.1
under tmux.)  I then tried shelling out to something like "less," but it
seems like there is no way to suspend emacs from full-screen.  Using M-x
shell or M-x terminal-emulator seems to leave a gap in the last column.  I
eventually ended up doing something like:

(defun show-with-tmux ()
  "Displays the region in a new tmux window using less

   Unfortunately, this is the easiest way I can think of for
   getting a string without any end-of-line continuation on my
   terminal.  I want to do this for URLs so that I can use my
   terminal program to open the link."
  (interactive)
   (let ((oldbuf (current-buffer))
         (beginning (region-beginning))
         (end (region-end))
         )
     (with-temp-file "~/tmp/toread.txt"
       (insert-buffer-substring-no-properties oldbuf beginning end))
     (call-process "tmux" nil nil nil "neww" "less ~/tmp/toread.txt")
     )
   )

To display the text with "less" in a different tmux screen.  This seems to
have a pretty inelegant feel, so I was wondering if anyone knows of a
better way.

Dennis Lin
<http://www.emacswiki.org/emacs/LineWrap>

[-- Attachment #2: Type: text/html, Size: 1973 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How do I avoid the line-wrap character?
@ 2012-03-07  7:39 Silvio Levy
  2012-03-07 18:21 ` Dennis Lin
  0 siblings, 1 reply; 3+ messages in thread
From: Silvio Levy @ 2012-03-07  7:39 UTC (permalink / raw)
  To: Dennis Lin; +Cc: help-gnu-emacs


> I was wondering if anyone knows of a better way.

I isolate the URL on a line by itself (if it's in a buffer that 
I don't mind messing up -- otherwise I copy it to *scratch*). 

Then I edit it so it reads

x 'long://and.complicated&url' 

Then I use M-| to feed the line to the shell. (x is my alias for the
browser executable, which either opens the browser or adds a new tab
if already open.)

Undoubtedly this can be all be put into a single function, but I've
been too lazy to do it. For now this method feels very natural,
because I use M-| for all sorts of other things anyway.

Silvio





^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How do I avoid the line-wrap character?
  2012-03-07  7:39 How do I avoid the line-wrap character? Silvio Levy
@ 2012-03-07 18:21 ` Dennis Lin
  0 siblings, 0 replies; 3+ messages in thread
From: Dennis Lin @ 2012-03-07 18:21 UTC (permalink / raw)
  To: Silvio Levy; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 689 bytes --]

Salutations!

On Wed, Mar 7, 2012 at 1:39 AM, Silvio Levy <levy@msri.org> wrote:

>
> > I was wondering if anyone knows of a better way.
>
> I isolate the URL on a line by itself (if it's in a buffer that
> I don't mind messing up -- otherwise I copy it to *scratch*).
>
> Then I edit it so it reads
>
> x 'long://and.complicated&url'
>
> Then I use M-| to feed the line to the shell. (x is my alias for the
> browser executable, which either opens the browser or adds a new tab
> if already open.)
>

The problem is that I'm running emacs on a headless remote server.  All I
want is to display the url uninterrupted so that I can copy it into the
browser on my local machine.

Dennis Lin

[-- Attachment #2: Type: text/html, Size: 1050 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-03-07 18:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-07  7:39 How do I avoid the line-wrap character? Silvio Levy
2012-03-07 18:21 ` Dennis Lin
  -- strict thread matches above, loose matches on Subject: below --
2012-03-07  6:01 Dennis Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).