SUMMARY - repeating a macro X times
flag
Messages 1 - 10 of 326 - Collapse all
/groups/adfetch?adid=cD36qhIAAABb_Bh96fdcdFF7J0V_9W9bxyxpo7bMRVgpn9ZMKisPfQ
SUMMARY - repeating a macro X times  
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
1.  Barry Margolin  
View profile  
 More options Oct 1 1992, 4:25 am
Newsgroups: gnu.emacs.help
From: bar...@think.com (Barry Margolin)
Date: 1 Oct 1992 09:19:56 GMT
Local: Thurs, Oct 1 1992 9:19 am
Subject: Re: SUMMARY - repeating a macro X times
In article <EJH.92Sep30164...@khonshu.colorado.edu> e...@khonshu.colorado.edu (Edward J. Hartnett) writes:

>> Yes, but the problem was I couldn't find the way to give a repeat
>> count! (Now I know, of course). But where is that in the manual? I
>> tried help for repeat, count, repeat count, numeric argument,
>> argument, numberic, and couldn't think of anything else.

The Glossary section in the Emacs manual has an entry for "Numeric
Argument" which has a cross-reference to the "Arguments" section of the
manual that describes how to supply arguments.

In other words, I found out by typing:

C-h i           { enter Info }
m emacs         { select Emacs manual }
m glossary      { go to Glossary section }
C-s numeric argument <Esc>
r arguments     { follow cross-reference }
--
Barry Margolin
System Manager, Thinking Machines Corp.

bar...@think.com          {uunet,harvard}!think!barmar


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
help  
1.  Corey Carroll  
View profile   Translate to Translated (View Original)
 More options Oct 1 1992, 11:48 am
Newsgroups: gnu.emacs.help
From: co...@sdf.lonestar.ORG (Corey Carroll)
Date: Thu, 1 Oct 1992 08:14:51 GMT
Local: Thurs, Oct 1 1992 8:14 am
Subject: help

    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
filtering output from shell  
1.  Kevin Rodgers  
View profile  
 More options Oct 1 1992, 12:31 pm
Newsgroups: gnu.emacs.help
From: ke...@traffic.den.mmc.com (Kevin Rodgers)
Date: 1 Oct 92 15:19:32 GMT
Local: Thurs, Oct 1 1992 3:19 pm
Subject: Re: filtering output from shell

In article <GARY.92Sep30160...@strident.think.com> g...@think.com (Gary Sabot) writes:

>I'm running telnet in shell mode to talk to a balky computer that insists
>on echoing my input lines AND putting ^M's on the end of all lines that it
>prints (i.e. both its output and its echoes).

>Does anyone have code fragment that shows how I can filter some of this
>junk out, perhaps using process-filter?  Note that my problem with ^M's
>isn't the usual one that gets solved by saying "stty nl", since the machine
>I'm telneting to is not Unix and I can't change the output that it is
>sending me.

I rewrote telnet-filter in a file called telnet-filter.el in a directory
in my load-path, and put this in my ~/.emacs:

(autoload 'telnet "telnet-filter"
          "*Open a network login connection to HOST on optional PORT..." t)

Here's my telnet-filter.el:

;;;; telnet-filter.el

;;;; Delete unprintable characters from telnet output.

;; Advertise provided feature:
(provide 'telnet-filter)

;; Load telnet:
(if (not (fboundp 'telnet-filter))
    (load-library "telnet"))

;; Options:

(defvar telnet-filter-regexp "[^\t\n -~]" ; all unprintable characters
  "*Regular expression to match characters to be filtered from telnet output.
Automatically made local to buffer when set.")

(make-variable-buffer-local 'telnet-filter-regexp)

;; Modify the process output filter:

(defun telnet-filter (proc string)
  (let ((buffer (current-buffer))
        (match-data (match-data)))
    (unwind-protect                     ; restore buffer and match data
        (let ((output-start (point-max)))
          (set-buffer (process-buffer proc))
          (goto-char output-start)
          (insert string)
          (set-marker (process-mark proc) (point))
          ;; replace unprintable chars:
          (goto-char output-start)
          (if telnet-filter-regexp
              (while (re-search-forward telnet-filter-regexp (point-max) t)
                (let* ((unprintable-char
                        (char-after (match-beginning 0)))
                       (replacement-string
                        (if (and (char-equal unprintable-char ?\C-g)
                                 telnet-replace-c-g) ; backward compatibility
                            (char-to-string telnet-replace-c-g)
                          "")))
                  ;; primitive terminal emulation:
                  (cond ((char-equal unprintable-char ?\a) (beep t))
                        ((char-equal unprintable-char ?\f) (recenter 0)))
                  ;; do the replacement:
                  (if replacement-string
                      (replace-match replacement-string)))))
          (goto-char (point-max))       ; restore point
          ;; naively copied from telnet.el:
          (if (and (integer-or-marker-p last-input-start)
                   (marker-position last-input-start)
                   telnet-remote-echoes)
              (delete-region last-input-start last-input-end)))
      (set-buffer buffer)
      (store-match-data match-data))))
--
Kevin Rodgers                           ke...@traffic.den.mmc.com
Martin Marietta MS A16401               (303) 790-3971
116 Inverness Dr. East
Englewood CO 80112 USA                  GO BUFFS!


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Killing inferior lisp buffer: Make emacs confirm: How?  
1.  T. V. Raman  
View profile  
 More options Oct 1 1992, 1:27 pm
Newsgroups: gnu.emacs.help
From: ra...@cs.cornell.edu (T. V. Raman)
Date: Thu, 1 Oct 1992 17:02:19 GMT
Local: Thurs, Oct 1 1992 5:02 pm
Subject: Killing inferior lisp buffer: Make emacs confirm: How?

The summary and keywords say it all. I am running ilisp and have lucid
running in an inferior lisp buffer.

How do I prevent the *lucid* buffer getting killed accidentally?
Emacs asks for confirmation before killing the  shell buffer when
quitting so how can I make it do the same if the lisp is running?

Of course I could kluge it so that the *lucid* buffer always looks as
if it is modified to emacs and attach a file to the buffer so that
emacs  emacs asks me if I want to save it when I try to kill the
buffer, but this would become a major irritant. What I would like is
for emacs to check that the lucid is still running and if so ask me to
confirm the kill of the buffer.

Thanks,

--Raman
--
   T. V. Raman <ra...@cs.cornell.edu>Tel: (607)255-9202  R 272-3649
                       Office: 4116 Upson Hall,
Department of Computer Science, Cornell University Ithaca NY 14853-6201
                Res: 226 Bryant Avenue Ithaca NY 14850


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
position function?  
1.  Dave Gillespie  
View profile  
 More options Oct 2 1992, 1:21 am
Newsgroups: gnu.emacs.help
From: da...@thymus.synaptics.COM (Dave Gillespie)
Date: Thu, 1 Oct 1992 17:42:00 GMT
Subject: Re: position function?

Steven L. Smith writes:
> Is there a "position" (cl) function for GNU emacs or something
> similar?

and Barry Margolin replies with some Lisp code:

> (defun position (object list)
>   (let ((i 0)
>         (found nil))
>     (while (not (or found (null list)))
>       ...

While this will certainly do the job, you can do the job much more
simply, as well as more efficiently, using "length" and "memq".
Remember, "memq" (like to Common Lisp's "member") returns the tail
of the list starting at the found item:

(defun position (object list)
  (let ((found (memq object list)))
    (and found (- (length list) found))))

It's true that this version traverses part of the list twice in
the two "length" calls, but that's insignificant next to the fact
that "length" is a primitive written in C rather than a
byte-compiled loop.  One of the main performance rules for Emacs
Lisp is to use the primitive functions whenever they are even
roughly appropriate, rather than writing a loop yourself.

                                                                -- Dave


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
2.  Barry Margolin  
View profile  
 More options Oct 2 1992, 10:54 pm
Newsgroups: gnu.emacs.help
From: bar...@think.com (Barry Margolin)
Date: 2 Oct 1992 21:08:41 GMT
Local: Fri, Oct 2 1992 9:08 pm
Subject: Re: position function?

In article <9210020742.AA01...@thymus.synaptics> da...@synaptics.com writes:
>While this will certainly do the job, you can do the job much more
>simply, as well as more efficiently, using "length" and "memq".

I actually thought of this, but didn't think it was worth posting (see
below).

>(defun position (object list)
>  (let ((found (memq object list)))
>    (and found (- (length list) found))))

That should be

(defun position (object list)
  (let ((found (memq object list)))
    (and found (- (length list) (length found)))))

>It's true that this version traverses part of the list twice in
>the two "length" calls, but that's insignificant next to the fact
>that "length" is a primitive written in C rather than a
>byte-compiled loop.

That was the factor that I didn't take into account.  I'm too used to real
Lisps, where the loop will be compiled into machine code, so the
performance difference between built-in and user-written functions is less
significant.
--
Barry Margolin
System Manager, Thinking Machines Corp.

bar...@think.com          {uunet,harvard}!think!barmar


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
3.  Dave Gillespie  
View profile  
 More options Oct 3 1992, 3:25 am
Newsgroups: gnu.emacs.help
From: da...@thymus.synaptics.COM (Dave Gillespie)
Date: Fri, 2 Oct 1992 15:05:27 GMT
Local: Fri, Oct 2 1992 3:05 pm
Subject: Re: position function?

Barry Margolin writes:
>>    (and found (- (length list) found))))
> That should be
>     (and found (- (length list) (length found)))))

Oops---sorry about that!

> I'm too used to real
> Lisps, where the loop will be compiled into machine code, so the
> performance difference between built-in and user-written functions is less
> significant.

It would not be all that hard to compile Emacs Lisp into C, and then
into machine code.  (Well, okay, pretty hard, but not *that* hard.  :-)
I looked into this once, but without some kind of dynamic linker in
Emacs the scheme is just too much trouble to use.

                                                                -- Dave


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
4.  Joe Wells  
View profile  
 More options Oct 7 1992, 11:06 am
Newsgroups: gnu.emacs.help
From: j...@bigbird.bu.edu (Joe Wells)
Date: 7 Oct 92 17:48:55 GMT
Local: Wed, Oct 7 1992 5:48 pm
Subject: Re: position function?
In article <BvE9Lv....@news.larc.nasa.gov> sm...@icat.larc.nasa.gov (Steven L. Smith) writes:

   Is there a "position" (cl) function for GNU emacs or something similar?

No, and don't write one.  If you need to use such a function, name it
xxx-position, where "xxx" is your package name.

This is very important because it will prevent your code from clashing
with code written by people who were unwise and didn't follow this advice.

   What I want to do is find the position of a symbol in a list of
   symbols.

(defun xxx-symbol-position (symbol list)
  (let ((tmp (memq symbol list)))
    (if tmp (- (length list) (length tmp)))))

   Also, what dialect of lisp does GNU emacs run?

GNU Emacs Lisp.

--
Enjoy,

Joe Wells <j...@cs.bu.edu>
Member of the League for Programming Freedom --- send e-mail for details


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Changing to Unix Mailbox?  
1.  Jean Orloff  
View profile  
 More options Oct 2 1992, 1:16 pm
Newsgroups: gnu.emacs.help, comp.emacs, gnu.emacs.gnus, gnu.emacs.vm.bug
From: orl...@surya4.cern.ch (Jean Orloff)
Date: Fri, 2 Oct 1992 10:01:39 GMT
Local: Fri, Oct 2 1992 10:01 am
Subject: Re: Changing to Unix Mailbox?

>>>>> On Thu, 24 Sep 1992 11:48:42 GMT, me...@geomatic.no (Harald Martens Meyer) said:

Harald> I'm now able to sort out my incoming mails. But I'd like to be
Harald> able to do the same with the outgoing ones. I'm currently
Harald> using the FCC header to make a file-copy of the outgoing
Harald> mails.

Harald> Anyone know a smart method to make my outgoing mails in Unix
Harald> mail format??

I have included
  (setq mail-self-blind t)
in my .vm file. This makes you send a copy of all outgoing mail to
yourself by default (you can always decide to kill the BCC line before
sending). You can then save your out-mail in folders as you do for
in-mail.

--
*************************************************************************
*       Jean Orloff             *       e-mail: ORL...@dxcern.cern.ch  *
*       TH-Division, CERN       *       phone:  (41-22) 767-3204        *
*       CH-1211 Geneva 23       *       fax:    (41-22) 782-3914        *
*************************************************************************


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
2.  Jean Orloff  
View profile  
 More options Oct 2 1992, 1:31 pm
Newsgroups: gnu.emacs.help, comp.emacs, gnu.emacs.gnus, gnu.emacs.vm.bug
From: orl...@surya4.cern.ch (Jean Orloff)
Date: Fri, 2 Oct 1992 11:14:52 GMT
Local: Fri, Oct 2 1992 11:14 am
Subject: Re: Changing to Unix Mailbox?

>>>>> On Thu, 24 Sep 1992 11:48:42 GMT, me...@geomatic.no (Harald Martens Meyer) said:

Harald> I'm now able to sort out my incoming mails. But I'd like to be
Harald> able to do the same with the outgoing ones. I'm currently
Harald> using the FCC header to make a file-copy of the outgoing
Harald> mails.

Harald> Anyone know a smart method to make my outgoing mails in Unix
Harald> mail format??

I have included
  (setq mail-self-blind t)
in my .vm file. This makes you send a copy of all outgoing mail to
yourself by default (you can always decide to kill the BCC line before
sending). You can then save your out-mail in folders as you do for
in-mail.

--
*************************************************************************
*       Jean Orloff             *       e-mail: ORL...@dxcern.cern.ch  *
*       TH-Division, CERN       *       phone:  (41-22) 767-3204        *
*       CH-1211 Geneva 23       *       fax:    (41-22) 782-3914        *
*************************************************************************


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google