XEmacsNull Blog

Bi-Day XEmacs Tip Blog

Wednesday, November 30, 2005

Topic: Used Key Bindings

Which keys are used under Ctrl-x? . . .

= Here are the used XEmacs bindings, in my setup. version: XEmacs 21.4 (patch 12) All Ctrl-x, ??? combos. (They are followed by the LISP functions tied to each.)

  • b: switch-to-buffer
  • h: mark-whole-buffer
  • i: insert-file
  • j: jump-to-register
  • k: kill-buffer
  • l: count-lines-page
  • m: compose-mail
  • o: other-window
  • q: kbd-macro-query
  • s: save-some-buffers
  • u: advertised-undo
  • x: copy-to-register
• So, what keys are available? a c d e f g n p r t v w y z. Fourteen of them. That doesn't seem to leave a lot. What else can we do?

= Do you want to "dare" toss away the standard key bindings, above. (A few are your rudimentary file command keys.) Royally scramble up your mode-support to key map? I don't think so. But, there has to be another way. Or a better way?

= Next, I show how to "define" a text string to a key binding. Then, we'll think about this problem, and look at other suggestions.

Platform: Linux
Level: Basic
GlR

Monday, November 28, 2005

Topic: Creating Key Bindings

Question: How do I assign my own key bindings? ie. Hit hotkey combination and get XEmacs to type, something personalized. . . .

= This is a rather deeper subject. So, I will have to introduce a few things. First, what is the XEmacs way? Answer: Using letters of the alphabet with the Ctrl-x key binding, is the recommended practice for assigning custom key bindings.

= How do I check, if a key binding is already in use?

Lookup Key Binding: Alt-?, Ctrl-k, key-binding.
Example to check: Ctrl-x, u. List: Alt-?, Ctrl-k, Ctrl-x, u.

Results: When it shows, "Look up key in XEmacs manual (still)". Then, it hasn't been allocated (by the major or minor modes, you are using).

= (A) Otherwise, if you see, a function name? Then, it is taken.

= (B) If you get stuck in a enter sequence, Don't forget Ctrl-g, in most instances. Othewise, if it is about buffer confusion. Use Ctrl-x, 1, (then) Ctrl-x, k, enter.

= If you try; Ctrl-x, Ctrl-c to test: You will see: Found save-buffers-kill-emacs. All the letters from a to z are available for Ctrl-c, ??? combinations. Also, capital A to Z are unique from the lower letters, as well. If you care to confuse yourself some more? (Full Correction)

Platform: Linux
Level: Amateur
GlR

PS. Yes, there are conflicts with Ctrl-x, and various letters. Just as "u" for Undo is one such letter. Ctrl-x keys typically are file-related, Ctrl-c being mode-specific bindings, and Ctrl-h for help.

• Key binding is a rather large subject. What can go wrong? (1) If you want to set it globally. (2) Or just override, when loading specifically. (3) Or what to run it with your own LISP functions. (4) Or dealing with mode-compatibility. ie. Not stepping on your file's mode toes. (5) Or assigning recorded macros. (6) Or just creating plain type shortcut keys, as the Windows people say.

= So, I'll apologize in advance. If I turn out to be not fully accurate. It is rather vacous and I'll assure you. I have spent three hours on key binding, so far, to reduce your time at, off the bat.

Saturday, November 26, 2005

Tip: Show X11 Colors

Question: What colors do I have in XEmacs with the X11 Window system? . . .

Answer: Presuming you are running in an X11 Windows system? Several colors are available, as long as you aren't running 16 color mode or something.

List Colors: Alt-x, list-colors-display, enter.

= Your colors are listed in a resource file under the X11 directory. rgb.txt at /usr/X11R6/lib/X11.

= What if I want to state a color via the command line?
  xemacs -bg wheat sample.txt  

Cautions: (1) The above -bg color command doesn't work in console mode. (2) If you have a pixmap setup? You won't be able to override it, via the command line.

Platform: Linux
Level: Basic
GlR

Thursday, November 24, 2005

Note: A Note from the Author

Yes, greetings, this post is more of a signpost for my readers. If I were putting this into a book, at this point, there would be a big stop sign. . . .

• I'm starting to get into some hard material, now. Yes, I know, finally starting to run out of "newbie" topics. (Not insulting you newbies, just keep working it.) (Yes, I was a newbie, once. Actually, I have been several times, for that matter. )

• Anyhow, digging into deeper issues, customization, and "reasons to use" LISP code inside XEmacs are hard posts. I will strive to give you all the facts, be precise about "every detail" necessary, to make such and such work. However, please be aware, Unix as great as it is. There are times, things just don't work, as someone else says. (I find this a lot. While, researching the details for material on these posts.) (A good example, assigning custom control keys for your own "key bindings.")

Plus, you have to pay a lot of attention, to every keystroke, the "exact" way code is written, and occasionally "reflect" why is it written that way. Until, you get it working the first time, which should be considerably easier for you, since I'm giving very explicit instructions. You have to be prepared for a little bit of a bumpy road, at times. If you get frustrated or need a break. Take one, cool off. You'll never master LISP in one night. (Unless, your mind really is a LISP state machine. Mine is not.)

= Several of these instructions, how you set it up, and "actually" getting it to work; are particular things. This means, it is quite likely E-macs and XEmacs differ a little or a lot, in doing the same thing. Also, it can quickly become version (to XEmacs) specific or particular. (Although, I haven't observed such a problem, yet. Just using the current newest / recent Debian release.)

= Here are the version specifics to two of my systems. xemacs --version will reveal this on the command line.


XEmacs 21.4 (patch 12) "Portable Code" [Lucid]
XEmacs 21.4 (patch 17) "Jumbo Shrimp" [Lucid] (i386-debian-linux, Mule)


  • Now, I've said all this. Enjoy.

Platform: Linux
Level: Basic
GlR

Tuesday, November 22, 2005

Tip: Jump to Listed Bookmark

Question: I can see a list of my bookmarks. Now, how do I just jump to one of them? . . .

Answer: Yes, you have to list bookmarks. Move to the line with the bookmark you want. Then, hit the "v" key and it will jump to it, in your file. (ie. Select bookmark, where its line point is located.)

List bookmarks: Ctrl-x, r, l, enter. (Again, a letter L.)
Move to line with desired bookmark: v.
Help inside bookmark list frame: Ctrl-h, m.

Platform: Linux
Level: Basic
GlR

Sunday, November 20, 2005

Tip: Remembered Bookmarks

Question: How do I show my saved bookmarks? Why can't I jump to it? Just like when I created (only one) during the original editing session? . . .

This is where it gets a little bumpy. Remember, I mentioned XEmacs remembers a "blanked" bookmark named "matching" the filename? When you run, Ctrl-x, r, m, enter, and your file is named, "sample.txt."

= It actually named the bookmark, "sample.txt." However, when you first Mark this bookmark. You can simply jump to it, via: Ctrl-x, r, b, enter. Then, when you leave XEmacs and re-enter anew. It don't work.

Answer: The second time around, you'll have to enter: Ctrl-x, r, b, sample.txt, enter. Then, it remembers. If your installation of XEmacs is not remembering it persistently? First, look for a ~/.emacs.bmk file in your home directory.

= If it isn't there? You need to turn on saving your bookmarks. The bookmark-save-flag needs to be set to 1. (True) This is something to configure in the custom.el file. (There is a way to change it's value through the menus, too.)

= Next, as an advanced feature, you can also write your bookmarks to a different file. The use for doing this, is when you are really deep into editing several text files, and have several special locations you want to remember.

= Perhaps, you edit several "similar" named files, in just different sets of directories, and you want to keep the bookmark files separated? (This is definately, using XEmacs for advanced editing.)

Write bookmarks to File: Alt-x, hotBmarks.txt, enter.
List bookmarks: Ctrl-x, r, l, enter. (Again, a letter L.)

Platform: Linux
Level: Amateur
GlR

PS. A rather thick post. However, until you try using new things in more complicated ways. You won't master deeper XEmacs.

Friday, November 18, 2005

Bookmarks

How do you set one? Can you make more than one? Are they persistent between XEmacs sessions? . . .

= Yes, XEmacs has the ability to create, list, and remember bookmarks. Just a matter of practicising the keystrokes. When would I use it?

• Only when it is a file, you are editing over the course of days. Otherwise, for casual files or short-term ones, I presume not too much reason to use. Even though, XEmacs is more than happy to remember (easily) at least one bookmark per file. (It is even named. Guess what? The same name as the file.)

= This post will explain the first basic bookmark commands. Then, I'll touch on the harder issues, later.

Mark your bookmark: Ctrl-x, r, m, enter.
List bookmarks: Ctrl-x, r, l, enter. (That is a letter L, before the enter.)
Jump to bookmark: Ctrl-x, r, b, name-of-file, enter.

When you list your bookmarks, it is useful to close that buffer. ie. Use the kill buffer command.
Kill buffer: Ctrl-x, k, enter

Platform: Linux
Level: Basic
GlR

Wednesday, November 16, 2005

Tip: Calling Tramp SCP Direct

Question: Can I simply call a SCP file without "manually" typing everything, inside XEmacs, too? . . .

Answer: Certainly. If you want it to start inside a console. Simply put the following into a shell script and customize it, yourself.

The same points mentioned with Tip: Calling Ange-FTP Direct, are pertinent here, as well.

• I find this handy, if you have a file you are always using. Plus, all communication to / from, besides where it is stored, is private. (Unless, someone sees your open editor session.)


xemacs -nw /[ssh/auser@www.cs.ndsu.nodak.
............... edu]~/data/sample.txt

Platform: Linux
Level: Amateur
GlR

Monday, November 14, 2005

Tip: Jump a Word

Question: Sometimes, I just want to jump a word, backwards or forwards. Do I have to use Alt-f or Alt-b? . . .

= True, you can use Alt-f and Alt-b for forwards and back. However, sometimes, I don't want to tie up two fingers. If you remember, ESC is the meta key, also. Although, figuring out how to set this up, can be difficult. (It depends on your Linux distribution. Where is the config file? If it is a system wide issue or user related? ((Seems like .Xdefault is the file.)) Most come setup with it working.)

Of course, if you try this? And it works. Then, you don't have an issue. So there.

Answer: Try this inside of XEmacs. ESC (release), arrow left. Did it jump right? If so, yes, your keyboard mapping is setup for it.

• Also, you will notice ESC, f - then ESC, b - then ESC, a - then ESC, e; work, too.

Platform: Linux
Level: Basic
GlR

Saturday, November 12, 2005

Apps: E-macs Code Browser

Of course, XEmacs applies special modes for almost any computer language. However, if you want a system of informational windows, akin to an Integrated Development Environment. . . .

One that works hand and hand with: functions / methods / classes, directory trees, history of recently visited files, plus a speedbar.

You should try ECB. The E-macs Code Browser

I'll be compiling XEmacs from scratch and adding in ECB, by hand. Around mid-December, I hope to have a Gallery service running and I'll show some screen shots. Plus, I'll write up an in-depth review and tell you guys and gals. What I think of it?

Platform: Linux
Level: Amateur
GlR

Thursday, November 10, 2005

External: Resources about Packages

What are all the available packages with XEmacs? . . .

A listing of all the Lisp routines in (or available) for XEmacs.

  1. FAQ (Questions) about XEmacs

  2. Solutions: Emacsen Common Problem Guide: Several Windows specific, how to fix this problem answers.

  3. XEmacs Quickstart Package Guide

  4. An overview of the XEmacs Packaging System

  5. Solutions to Common Problems with E-macs and XEmacs

Level: Advanced
GlR

Tuesday, November 08, 2005

Network: Writing by SCP

Also, how to edit a file by SCP? . . .

Yep, you guessed it, there is another package for it.

TRAMP User Manual This manual discusses the package. However, I didn't find it too useful, as to how to use it, admittedly, (TRAMP = Transparent Remote (file) Access, Multiple Protocol, btw.)

The preferred way to access any remote system is via "scp." As I mentioned in my first Ange-FTP post. You do not want to use telnet or ftp, on any remote systems. Why? Because, the password and all information is sent in plain-text. There is no encryption or even attempt to scramble the data.

• Ergo, my own motive and why I highly suggest you only use Tramp. It will reference scp or ssh, to connect to a remote system. (However, I need to verify. If FTP is available, at first? Does it go to scp, as a default? It should!!!)

So, without further adieu, you should have it installed. Otherwise, you can get it and instructions on installing the package from the web site, above.

One starting point, though, it works easier, if you have the file already present. If you can? Enter the site and create a blank or partial file, for it, at first. Otherwise, you certainly can create new files, as well.)


= Ctrl-x, Ctrl-f
= /[ssh/auser@www.cs.ndsu.nodak.edu]~/data/sample.txt, enter.
= Prepare to wait a while, before the password prompt, and
............ watch all the behind the scenes work.
= Once, your file is up, you can edit it, save it, or exit
............ and save the file.

Note: The [ssh ...] is important. One, if you don't have ssh. Ange-FTP will take over. Two, this is a syntactic difference between E-macs and XEmacs. (The first, I have found actually.)

Platform: Linux
Level: Amateur
GlR

Sunday, November 06, 2005

Tip: Calling Ange-FTP Direct

Question: Can I simply call a FTP file without "manually" typing everything, inside XEmacs? . . .

Answer: Certainly. If you want it to start inside a console. Simply put the following into a shell script and customize it, yourself.

However, if you want to work with other files, or not always the same file. Then, you'll have to plan some new ideas for your shell script.

You could have a standard base file on the remote system. Load it and edit it, then save it under another name. (Ctrl-x, Ctrl-w, newname.txt, enter)

xemacs -nw /auser@ftp.cs.ndsu.edu:sample.txt  

Platform: Linux
Level: Amateur
GlR

Friday, November 04, 2005

Tip: How to List Packages

Question: Where do I find the command to list my packages in XEmacs? . . .

One way is to find your XEmacs directory and it's installation, the lisp directory.

Answer: However, the real way is simply in the menus.

Menu: Tools, Packages, List and Install

If you don't have the Tramp package installed? You can check here. (Soon, to be posted.)

Platform: Linux
Level: Basic
GlR

Wednesday, November 02, 2005

Network: Writing by FTP

What if, you could edit a file through FTP? . . .

Yes, you can actually do this with XEmacs. Why is it useful?

Simply put, you can edit files through FTP. XEmacs will retrieve the file by FTP, then it is stored in XEmacs's buffer. When you are done, just write it out, by FTP again. You will have to enter your password, once. When you save or exit XEmacs. It won't prompt you for the password, then.

Another excellent example of packages working for you and extending XEmacs, to new horizons. Your installation might not have the package to support this? However, you simply have to obtain and install the Ange-FTP package or contact your System Administrator. Most XEmacs editors are pre-built with it.

= Start XEmacs
= Call Ange-FTP through the read file command: Ctrl-x, Ctrl-f
= Now, enter the file syntax to load via FTP: You will probably see. ~/ You need to delete this. So, backspace delete, twice over it.
= Now, type the FTP invocation: /auser@ftp.cs.ndsu.nodak.edu:~/afile.txt, enter.

= Then, wait for the FTP process to launch and ask for password.
= Once, it is up. and running. You are live.

= Edit file and save (often) or just exit, as normal.

• Note: If you want to force a X11 system to run XEmacs in a console? Just launch as xemacs -nw sample.txt.

Platform: Linux
Level: Amateur
GlR

PS. I don't recommend FTP connections. Using scp is preferred. Soon, I'll discuss the next package which does use scp. Other note, connecting to remote systems isn't always reliable. Please bear in mind, XEmacs does not control the network or Internet. File transfers are often probablematic, when the Internet is flaky.