f



ow-find without sun 'find' key

I've just moved over to a windows platform from solaris and have
installed the windows version of xemacs 21.4. I'm having severe
withdrawal symptoms from the loss of the sun 'find' key. So to correct
this I would like to bind the M-s key combo to the ow-find function and
M-S-s to the ow-find-backward function. I have 2 problems trying to
achieve this.
1. I have sucessfully bound the M-s keys to the 'ow-find function using
the following code in the init.el file.
(define-key global-map [(meta ?s)] 'ow-find)
However when I execute the function it returns the following
information.
Symbol's function definition is void: ow-find
I assumed that this occured because the file containing the functions
(x-init.el) was not being loaded and I then copied the function out of
that file and into the init.el file but it still returned the same
message.
2 While trying to bind M-S-s to ow-find-backward using the following
command I received an Error regarding the shift key.
(global-set-key [(meta shift ?s)] 'ow_find_backwards )
If shift isn't the correct operator what is?

Any help with this would be greatly appreciated by this XEmacs novice.

0
sun
6/21/2005 2:18:11 PM
comp.emacs.xemacs 2750 articles. 0 followers. Post Follow

2 Replies
922 Views

Similar Articles

[PageSpeed] 19

sun.piper <dfrew@btinternet.com> wrote:
> I've just moved over to a windows platform from solaris and have
> installed the windows version of xemacs 21.4. I'm having severe
> withdrawal symptoms from the loss of the sun 'find' key. 

Tell it, brother! I realised long ago that I would have to spend the
majority of the editing time in my life on non-Sun keyboards, and it
was really hard to train myself to use the (always available) F keys
instead.

>                                                         So to correct
> this I would like to bind the M-s key combo to the ow-find function and
> M-S-s to the ow-find-backward function. I have 2 problems trying to
> achieve this.
> 1. I have sucessfully bound the M-s keys to the 'ow-find function using
> the following code in the init.el file.
> (define-key global-map [(meta ?s)] 'ow-find)
> However when I execute the function it returns the following
> information.
> Symbol's function definition is void: ow-find
> I assumed that this occured because the file containing the functions
> (x-init.el) was not being loaded 

Correct.

>                                 and I then copied the function out of
> that file and into the init.el file but it still returned the same
> message.

That can't possibly be true. After you restart XEmacs (or eval that
file again manually), you *must* either have that function available
or get an error message while loading it. (Unless you somehow managed
to call fmakunbound or something equally weird...)

<crystal ball on>

Let me guess. Did you get another error message almost but not quite
entirely like the first? If so, what was it? Was it about not finding
`ow-find-last-string'? 

<crystal ball off>

That means that you need to make more function definitions available
to use ow-find. The proper solution is to eval the entire file
x-init.el, by copying it somewhere where it will be found, and then
saying (require 'x-init).

> 2 While trying to bind M-S-s to ow-find-backward using the following
> command I received an Error regarding the shift key.

NEVER, ever, ask for help saying `I received an error'. ALWAYS report
*which* error message you get. Better still, read it yourself, and
follow its advice.


-- 
No animal was harmed in the composition of this message.

0
Kilian
6/21/2005 2:33:57 PM
Thanks for the reply. I took heart that you said my first work around
should have been successful.
I added the following lines to my init.el file.

(defvar ow-find-last-string nil)
(defvar ow-find-last-clipboard nil)

(defun ow-find (&optional backward-p)
  "Search forward the next occurrence of the text of the selection."
  (interactive)
  (let ((sel  (ignore-errors (get-selection)))
	(clip (ignore-errors (get-clipboard)))
	text)
    (setq text (cond
		(sel)
		((not (equal clip ow-find-last-clipboard))
		 (setq ow-find-last-clipboard clip))
		(ow-find-last-string)
		(t (error "No selection available"))))
    (setq ow-find-last-string text)
    (cond (backward-p
	   (search-backward text)
	   (set-mark (+ (point) (length text))))
	  (t
	   (search-forward text)
	   (set-mark (- (point) (length text)))))
    (zmacs-activate-region)))

(defun ow-find-backward ()
  "Search backward for the previous occurrence of the text of the
selection."
  (interactive)
  (ow-find t))

(define-key global-map [(meta ?s)] 'ow-find )
(define-key global-map [(meta ?S)] 'ow-find-backward )

I then used the 'Lisp>Byte-Compile This File' menu option to generate
the init.elc and hey presto it worked. Did some searching on combining
Meta with Shift and basically the way I was doing it was wrong. Instead
of (meta shift ?s) it should be (meta ?S) note the capital S of the
second example giving the same key combination but in a way that xemacs
is happy with.

I've also tried the (require 'x-init) method but an error message
complaining that x-init could not be found was generated. I then added
the following line to my init.el file above the 'require' statement.
(add-to-list 'load-path "C:\lisp")
The x-init.el and x-init.elc are both in this directory however the
same x-init not found error was produced when using 'Lisp>Byte-Compile
This File'. Should this have worked or are there some diferences with
the windows version? I also created an EMACSLOADPATH environmental
variable pointing to the same directory containing the x-init files but
still no success.

I'm happy with my solution for the moment but I don't want to have to
insert every extra function into the init.el file when I need it. I'd
like to get a handle on this 'require' methodology.

0
sun
6/21/2005 4:49:54 PM
Reply:

Similar Artilces:

SuSE 9.1 / chkrootkit finds 'top' and 'find'
Hi, recently I did a fresh install of SuSE 9.1 Prof. Today I ran a chkrootkit using the Knoppix 3.4 CD (provided by magazine c't 4/2004). chkrootkit thinks that these files are infected: - top - find No other issues are found. top is contained in procps-3.2.1-4, find in findutils-4.1.7-860. On the running SuSE 9.1 system I did rpm -V procps-3.2.1-4 rpm -V findutils-4.1.7-860 and did not find any problems. Now I am confused. Please advice what I can / should do. Thanks for your help. Manfred Manfred Schneider wrote: > > Today I ran a...

more efficient 'find' with 'and'
Hi, I have the following code, but it runs quite slowly: for k=1:1000 a=find(and((b(:,1)==c(k)),(b(:,2)==d(k)))); end Is there a more efficient method? Thanks for your help. Dave Brackett wrote: > Hi, I have the following code, but it runs quite slowly: > > for k=1:1000 > a=find(and((b(:,1)==c(k)),(b(:,2)==d(k)))); > end > > Is there a more efficient method? I will assume for this discussion that you do something with "a" inside the loop: if you do not, then "a" will be the same as if you had only done k=1000 You could try t...

advance 'ls' 'cp' and 'find'?
I have some questions which I hope are basic. This first one: how would I copy files based on date? For example, in the olden days when I used Vax VMS I could issue a command something like "copy /before=today" or "copy /since=<date>". I have not been able to find a similar command for linux. Is there a way to do this in linux? Second, I want to make a recursive directory listing of only directories. That is, I don't want to see regular files, only directories. How can I do this? ls -d still shows files. Thanks for the help! On 2004-12-26, AA <A...

'find' with 'millisec' granular level??
'find' has the '-newer' option with which the files older/newer than a specific timestamp can be found out. The timestamp should be of the format:CCYYMMDDhhmm i.e. the granularity is till minutes only. Is there any provision to do this operation with the granularity of millisec? Even fstat() functions do not seem to help here. Most filesystems save time stamps in seconds since the epoch (1.1.70). So I doubt that there is any possibility to get a granulatity which is less than seconds. Hubble. On 30 Jan 2006 07:45:43 -0800, Hubble wrote: > Most filesystems save time stam...

strange behavior with 'find' and 'for' commands
Hi, I have a large file with numeric test data and would like to sort by one column such that all identical values of that column are grouped. The data is unsorted and I have used the find command to locate the rows containing identical entries in that column so that these rows can be replaced by one row containg the average values of all these rows. For example, if I sort by torque, Torque Speed 2 100 1 123 2 101 3 50 2 99 2 100 3 51 5 40 should beco...

Using the 'amatch' gem with 'find'
Hello all, Has anyone used the gem 'amatch' for a search or with the 'find' method. I need to search or find a project title using a similar search string. I know that 'amatch' returns a number and not a related string. Thank you for any help. JohnM -- Posted via http://www.ruby-forum.com/. ...

how can I combine 'find' and 'cp' command ?
How are you ? Please give me your advice *.*; I was trying to find any text files and copy those to the specific folder. I used this: $find . -name "*.txt" -exec "cp {} ./destiny/" \; find: cp ./1.txt ./destiny/: No such file or directory find: cp ./a/2.txt ./destiny/: No such file or directory find: cp ./a/aa/3.txt ./destiny/: No such file or directory find: cp ./b/4.txt ./destiny/: No such file or directory is there any way to solve this ? text files should be copied to the destiny folder. On Sat, 27 Oct 2007 17:20:04 -0700, tryhard wrote: > How are you ? Please...

Does find() short-cut for 'first' or 'last' ?
Over the last couple of years, I've seen a couple of informal reports that find() with 'first' or 'last' might "short-cut" by only doing as many tests as needed to satisfy the requested count; I seem to recall that there was a posting that showed some timing results of this nature. I am pondering, though, whether this is indeed the case, and if so since which release and under what conditions? But mostly I'm wondering: if it _is_ true, then how is it implemented, and is there a way that we as programmers could such things in our code? My doub...

newbie: 'find' and 'cp' in a single line ?
Hello, I would like to make a 'find' on a repertory and copy every file like : find ... | cp - path or find ... -exec cp {} \; but I don't find how to do. Can you help ? Thanks. C. Tobini Is this going to help.. find / -name fileName 2>/dev/null |xargs -i cp {} . ctobini <ctemp2@free.fr> wrote: > Hello, > > I would like to make a 'find' on a repertory and copy every file like : > > find ... | cp - path > > or find ... -exec cp {} \; find ... -exec cp {} path \; -- Kenan Kalajdzic Kenan Kalajdzic wrote: > ctobini <ctemp2...

Getting Error can't find '__main__' module in 'X'
Hey I am newbie in python.I have installed python 2.7.5 correctly.It is working fine but I am having some issues.I have set windows Enviroment variables. The problem is when I try to save my program in a folder(C:\Users\John\X)it shows that module error but when I save it outside this X folder ( C:\Users\John ) It runs successfully.How to fix it? On 06/02/2013 07:04 AM, meakaakka wrote: > Hey I am newbie in python.I have installed python 2.7.5 correctly.It is working fine but I am having some issues.I have set windows Enviroment variables. Please be a lot more specific. Do you have ...

shouldn't 'string'.find('ugh') return 0, not -1 ?
the subject pretty much says it all. if I check a string for for a substring, and this substring isn't found, should't the .find method return 0 rather than -1? this breaks the if check.find('something'): do(somethingElse) idiom, which is a bit of a pity I think. cheers, -jelle jelle <jelleferinga@gmail.com> writes: > the subject pretty much says it all. > if I check a string for for a substring, and this substring isn't found, > should't the .find method return 0 rather than -1? How would you treat the case of 'something' being at ...

'is not' or '!='
A newbie question to you; what is the difference between statements like: if x is not None: and if x != None: Without any context, which one should be preferred? IMHO, the latter is more readable. On 2014-08-18 21:35, ElChino wrote: > A newbie question to you; what is the difference between statements > like: > if x is not None: > and > if x != None: > > Without any context, which one should be preferred? > IMHO, the latter is more readable. > "x == y" tells you whether x and y refer to objects that are equal. "x is y&qu...

'^=' and '~='?
Hello, What is the difference between '^=' and '~='? Thanks, Duckhye ...

Where to find and download 'jmxremote.jar' and 'jmxremote_optional.jar'
In order to run mx4j test suite, I need 'jmxremote.jar' and 'jmxremote_optional.jar', where to download? Thanks! ...

Web resources about - ow-find without sun 'find' key - comp.emacs.xemacs

Resources last updated: 2/3/2016 9:17:25 PM