Building Emacs For Mac
While you are fixing things: I have two gripes with the CVS version of 21.3.50 (last fetched at Sep 18, so please tell me this has been fixed already): 1) The default installation does not set the selection coding system. So, pasting non-ASCII characters generates coding errors. The following.emacs entry solves the problem only partially, because the selection coding system actually depends on what is selected, but it works for most European applications: (if (eq window-system 'mac) (progn (setq selection-coding-system 'mac-roman) )) (Setting the selection coding system should also obviate the need for the r-to- n replacement loop, no?) This is just a simple matter of configuration. I have no objection to putting this in term/mac-win.el as the default. I'll do this when I can.
Meanwhile please continue to set it in.emacs. 2) I can't seem to tame the fonts. I want to use andale-mono as my main font (much better readability), and I want to use it at size 9because my Powerbook is only 1152x768. This works, so there is no reason to complain in the code above, but of course all non-ascii characters stand out in the etl fonts (which is.mucho ugly.
in German text:-). K I cannot work on a fix at this time. I invite anyone who can to contribute such a patch. At size 9, you can use Monaco instead of Andale Mono. To properly display latin-1 characters, do this: (create-fontset-from-fontset-spec '-apple-monaco-medium-r-normal-9-.-.-.-.-.-fontset-monaco, ascii:-apple-monaco-medium-r-normal-9-90-75-75-m-90-mac-roman, latin-iso8859-1:-apple-monaco-medium-r-normal-9-90-75-75-m-90-mac-roman') You can also use any other font that has non-zero size in the list returned by the function x-list-fonts. Please discuss Emacs for Mac OS X in the proper newsgroups. I'll defer to Andrew on this one.
Emacs is going through an internal change from mule to unicode which should solve most of these problems. When that gets a little closer to working, I was going to switch emacs to being a 'unicode' app.
All text coming from the outside would be in unicode instead of the current script. Then all of these problems will be fixed.
For now, just setting the selection-coding-system removes 95% of the pain; this might be useful information for other bleeding-edge-testers. 3) (setq mac-wheel-button-is-mouse-2 nil) (The meaning is inverted in Mac OS X: setting it to nil means that the wheel button is the mouse) I'm not sure I follow.
The Mac treats the mouse-wheel-button as mouse button 4 (After the left and right click). The default is t to follow the convention for NT emacs (and because for most mice the wheel button is in the middle). If it is set to nil, the wheel button is treated as mouse-3 and the right-click is treated as mouse-2. That's what the docs say, but not what happens on my Mac with the various USB mice I have. I need to set it to nil to have the wheel button as mouse-2 and the right button as mouse-3.
If I set mac-wheel-button-is-mouse-2 to t, the wheel button is mouse-3 and the right button is mouse-2, which is quite confusing of course. Maybe there is some other remapping at work, but I have no idea where to look.
Gruesse, Carsten. The change for dealing with 'return' will be placed in the latest distribution once my public key is updated by savannah's cron job ( 2000 GMT) Here are the questions I feel qualified to try and answer.
1) The default installation does not set the selection coding system. So, pasting non-ASCII characters generates coding errors.
The following.emacs entry solves the problem only partially, because the selection coding system actually depends on what is selected, but it works for most European applications: (if (eq window-system 'mac) (progn (setq selection-coding-system 'mac-roman) )) (Setting the selection coding system should also obviate the need for the r-to- n replacement loop, no?) I'll defer to Andrew on this one. Emacs is going through an internal change from mule to unicode which should solve most of these problems.
When that gets a little closer to working, I was going to switch emacs to being a 'unicode' app. All text coming from the outside would be in unicode instead of the current script. Then all of these problems will be fixed. 3) (setq mac-wheel-button-is-mouse-2 nil) (The meaning is inverted in Mac OS X: setting it to nil means that the wheel button is the mouse) I'm not sure I follow. The Mac treats the mouse-wheel-button as mouse button 4 (After the left and right click). The default is t to follow the convention for NT emacs (and because for most mice the wheel button is in the middle). If it is set to nil, the wheel button is treated as mouse-3 and the right-click is treated as mouse-2.
On Friday, Oct 4, 2002, at 08:48 Europe/Berlin, Carsten Bormann wrote: While you are fixing things: Oh, and while I'm at it: 3) (setq mac-wheel-button-is-mouse-2 nil) (The meaning is inverted in Mac OS X: setting it to nil means that the wheel button is the mouse) 4) There is still the bug with asynchronous process input, which gets cut off at the end randomly. This affects grep, man, pcl-cvs. Really gross. I thought there was a fix (workaround?) in the CVS, but then I didn't understand the fix, and obviously it does not work (at least not under 10.2.1).
Gruesse, Carsten. While you are fixing things: I have two gripes with the CVS version of 21.3.50 (last fetched at Sep 18, so please tell me this has been fixed already): 1) The default installation does not set the selection coding system. So, pasting non-ASCII characters generates coding errors. The following.emacs entry solves the problem only partially, because the selection coding system actually depends on what is selected, but it works for most European applications: (if (eq window-system 'mac) (progn (setq selection-coding-system 'mac-roman) )) (Setting the selection coding system should also obviate the need for the r-to- n replacement loop, no?) 2) I can't seem to tame the fonts. I want to use andale-mono as my main font (much better readability), and I want to use it at size 9, because my Powerbook is only 1152x768. So I say: (if (fboundp 'new-fontset) (progn (create-fontset-from-fontset-spec '-etl-fixed-medium-r-normal-.-9-.-.-.-.-.-fontset-mac, ascii:-apple-andale mono-.-9-.-.-.-.-.-.-m-.-mac-roman') (let ((monaco-font '('monaco'. 'mac-roman'))) (map-char-table (function (lambda (key val) (or (generic-char-p key) (memq (char-charset key) '(ascii eight-bit-control eight-bit-graphic)) (set-fontset-font 'fontset-mac' key monaco-font)))) (get 'mac-roman-encoder 'translation-table))))) This gives me a problem, complaining about the andale-mono font.
It only works if I substitute -0- for -9-, but of course, this doesn't give me the right size. As a workaround, what I'm doing is (if (eq window-system 'mac) (set-frame-font '-apple-andale mono-medium-r-normal-9-120-75-75-m-120-mac-roman').) This works, so there is no reason to complain in the code above, but of course all non-ascii characters stand out in the etl fonts (which is.mucho ugly. in German text:-). Gruesse, Carsten.
The solution is to make RET appear to be a non-ascii character (then it becomes ). This is what happens on X-windows as you have noted. To do this, modify macterm.c:keycodetoxkeysymtable to start like this (where keycode 0x24 is mapped to Xkeysym 0xff0d) static unsigned char keycodetoxkeysymtable = /. 0x00 - 0x3f./ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 00, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 00, 0, 0, 0, ' x0d', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 00, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0Then you need to have emacs recognize the the new key return is actually C-m. So add these to lisp/term/mac-win.el or to your.emacs file (define-key function-key-map return ? C-m) (define-key function-key-map M-return ? M- C-m) (put 'return 'ascii-character 13) Should this be put in the main distribution?
Building Emacs For Mac Pro
Should this be done for other chars like escape and tab? Hi Steven, Thank you for solving this problem.
I've checked that the above modification works on my machine. Please go ahead and install it to the main distribution. I suggest putting the Lisp definitions of `return' in lisp/term/mac-win.el so the return key will work as before for everyone. It will also be useful to do the same for the tab and escape keys. It is mac specific (see the P.S.) C-RET isn't recognized by the 'carbon' mac distribution.
This is because the mac version treats RET as a standard ascii character and not as a special 'X Key Code'. So when it tries to apply the ctrl to RET is sees C-m and so interprets it as C-C-m.
So the first C- is lost The solution is to make RET appear to be a non-ascii character (then it becomes ). This is what happens on X-windows as you have noted.
To do this, modify macterm.c:keycodetoxkeysymtable to start like this (where keycode 0x24 is mapped to Xkeysym 0xff0d) static unsigned char keycodetoxkeysymtable = /. 0x00 - 0x3f./ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ' x0d', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Then you need to have emacs recognize the the new key return is actually C-m. So add these to lisp/term/mac-win.el or to your.emacs file (define-key function-key-map return ? C-m) (define-key function-key-map M-return ? M- C-m) (put 'return 'ascii-character 13) Should this be put in the main distribution?
Should this be done for other chars like escape and tab? These mailing lists are being deprecated. Look at for more information. On Thursday, October 3, 2002, at 03:23 AM, Matthias Scheidegger wrote: Hi allthis might not be a mac-emacs specific question: Coming from Linux/Xemacs I tried to convert my hooks for various major modes. Changing (define-key c-mode-map.) to (local-set-key.) worked pretty well with the exception of the key combination Ctrl-Return. I figured this would be written (local-set-key ' C- r' 'my-function) or (local-set-key ? R 'my-function) but neither worked.
How can I get this to work? tnx Matthias - This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven.
Mac-emacs-users mailing list Mac-emacs-users@. On Tuesday, August 20, 2002, at 11:30 PM, Andrew Choi wrote: P.S. The mac-emacs-users and mac-emacs-devel will be used for Emacs for Mac OS 8/9.
Please use the places suggested in the webpage for discussing Emacs for Mac OS X. Last week I wrote about Emacs.app appearing to have problems where the command line version didn't. Would it be proper to talk about Emacs.app in the regular emacs mailing lists you mention? BTW, I never did understand what you were trying to tell me but on Saturday I did a complete CVS fetch and build and it now works. Bob Love mail: rlove@. Jabber: rlove@. I still can't double-click to open Emacs.app.
But, that's ok; the workaround is simple. However, one problem that remains and that I can't workaround is that the Command key is not recognized. I looked at the old macterm.c patch and I couldn't tell if it had been applied or not. The new code is very different. Here's a comparison, although, I have no idea what the problem may be: old macterm.c patch. 7.
1 - if (er.modifiers & (NILP (Vmaccommandkeyismeta)? OptionKey: cmdKey)) themodifiers = metamodifier; + + if (NILP (Vmaccommandkeyismeta) && (er.modifiers & cmdKey)) + themodifiers = altmodifier; + bufp-modifiers = themodifiers;. new macterm.c (120) #define macAltKey (NILP (Vmaccommandkeyismeta)? CmdKey: optionKey). New macterm.c (9) if (NILP (Vmaccommandkeyismeta) && (mods & macAltKey)) result = altmodifier; Rodney Sparapani Medical College of Wisconsin Sr. Biostatistician Patient Care & Outcomes Research (PCOR) rsparapa@.
Was 'Name That Tune' rigged? WWLD - What Would Lombardi Do. Hi Mitchell, Did you read the message I've just posted? I've attached it at the end. Please also read the mac/INSTALL file. It is not possible to build a single binary that will run under both Aqua and X Window. Two separate binaries can probably coexist on the same system, but you'll have to try it yourself since I don't run X Window on my Macs, and therefore I don't use the X Window version.
Every distinct Emacs port known to me that will run on Mac OS X are listed in the `Links' section of the web page. And that's probably a complete list. I am phasing out the use of the two mailing lists mac-emacs-users and mac-emacs-devel at SourceForge. Blah, blah, blah. Hi Jeffery, From mac/INSTALL: If you are building Emacs to run on Mac OS X and X Window, you need to create a directory containing statically-linked X libraries.
Sudo mkdir /usr/X11R6/libstatic cd /usr/X11R6/libstatic sudo ln -s./lib/lib.a./lib/X11. Instead of typing `./configure' above, type./configure -without-carbon -with-x -x-libraries=/usr/X11R6/libstatic I do not have more details because I do not run X Window on my Macs. Of course you can always post to the newsgroups and perhaps others can help. I am phasing out the use of the two mailing lists mac-emacs-users and mac-emacs-devel at SourceForge.
For questions like this, please consider posting to the gnu.emacs.help newsgroup for help. For other matters related to Emacs for Mac OS X, see the suggestions on on where to send them. New Webpage for Emacs for Mac OS X Andrew, is it possible to build emacs for Xdarwin?
I sometimes would like to be able to edit things while running under X but I have run into problems trying to build emacs without adding -without-x Does the way of building it now you specify include X? -JP - Jeffrey Poore thatjeff@. Hi Jeffery, From mac/INSTALL: If you are building Emacs to run on Mac OS X and X Window, you need to create a directory containing statically-linked X libraries. Sudo mkdir /usr/X11R6/libstatic cd /usr/X11R6/libstatic sudo ln -s./lib/lib.a./lib/X11.
Instead of typing `./configure' above, type./configure -without-carbon -with-x -x-libraries=/usr/X11R6/libstatic I do not have more details because I do not run X Window on my Macs. Of course you can always post to the newsgroups and perhaps others can help. I am phasing out the use of the two mailing lists mac-emacs-users and mac-emacs-devel at SourceForge. For questions like this, please consider posting to the gnu.emacs.help newsgroup for help.
For other matters related to Emacs for Mac OS X, see the suggestions on on where to send them. Emacs Users and Developers, I've finally set up a separate web page for Emacs for Mac OS X: I hope to be updating this page quite often (perhaps once or twice a month) with information on new developments on the Mac OS X code. The old webpage at SourceForge has also been updated to carry only information on Emacs for Mac OS 8/9. As you probably know, these two mailing lists, mac-emacs-devel and mac-emacs-users hosted on lists.sourceforge.net, were originally used to discuss Emacs for Mac OS Classic. As the version of Emacs for Mac OS X matures, users and developers have continued to carry out their discussions on this new version there.
Since the Mac OS code (both X and classic) is already part of the standard Emacs code, I feel that it is now more suitable to use the common venues already available to Emacs users and developers of other platforms. Many more knowledgeable people there will be available to answer general usage questions. Mac OS users and developers of Emacs will hopefully also feel less isolated and be part of this bigger Emacs community. I would like to keep around the Mac OS 8/9 page at SourceForge, so people can still find my projects, but phase out the mailing lists and discussion forums there. So from now on, to discuss the development of Emacs for Mac OS X and 8/9 or submit patches and bug fixes, please post to the mailing list emacs-devel@. Please post general questions to the gnu.emacs.help newsgroup.
Read and post bug reports and fixes in the gnu.emacs.bug newsgroup. To send bug reports from Emacs for Mac OS X, type M-x report-emacs-bug RET. Also please read the comp.emacs newsgroup for general information and announcements about Emacs. As usual please read the posts in the respectively mailing lists and newsgroups to get a feeling of their scopes before you post, as I'm sure you will. Therefore, so long!
But see you on the other channels. Yours faithfully, Andrew. Rodney Sparapani wrote: Gang: I had trouble with the latest code via CVS. It was failing due to the non-existence of the directory mac/Contents/. Instead it created./mac/Contents. SoI created this directory by hand, and make completes fine. But, then make install fails: cd /Users/rodney/cvs/emacs/man; makeinfo tramp.texi tramp.texi:25: Unknown command `copying'.
tramp.texi:50: Unmatched `@end'. makeinfo: Removing output file `./info/tramp' due to errors; use -force to preserve. make1:./info/tramp Error 2 make:. info Error 2 I had this same problem. Do you have Fink installed? In my case, removing the Fink directories from my PATH environment variable and then recompiling fixed the problem. Apparently the version of makeinfo I had in Fink wasn't happy with the tramp.texi file, but the one Apple ships likes it fine.
Seth Tisue seth@. On Sunday, August 11, 2002, at 12:24 PM, Andrew Choi wrote:. Debugger entered-Lisp error: (void-function x-selection-exists-p) (x-selection-exists-p) (and (x-selection-exists-p) (not buffer-read-only)) sit-for(120) command-line-1(nil) command-line normal-top-level. You're not running the version you rebuilt. The function x-selection-exists-p is a built-in function since That may be true but I'm double clicking in: /Users/rlove/Library/OpenUp/emacs-2110/emacs-21.1/mac which is where I built it. I've performed the 'sudo make install' prior to this.
How do I make Emacs.app use the correct one? Note that I deleted all emacs files from /usr/local before I started the build.
In other words I did what I could to avoid having the wrong one used. What else is there? - Bob Love mail: rlove@. Jabber: rlove@.
I had Emacs.app running fine on my OSX box. Then came the security update and even after rebuilding from scratch I can't get Emacs.app to run correctly. It just hangs.
Debugger entered-Lisp error: (void-function x-selection-exists-p) (x-selection-exists-p) (and (x-selection-exists-p) (not buffer-read-only)) sit-for(120) command-line-1(nil) command-line normal-top-level. You're not running the version you rebuilt. The function x-selection-exists-p is a built-in function since 2002-08-02 Andrew Choi. mac.c (symsofmac): Defsubr Sxselectionexistsp. I had Emacs.app running fine on my OSX box.
Then came the security update and even after rebuilding from scratch I can't get Emacs.app to run correctly. It just hangs. eagle: rlove% which emacs /usr/local/bin/emacs When I run emacs from the command line as 'emacs -nw' I get an emacs that runs in the terminal and seems to work just fine. The above shows I'm getting the rebuilt version. If I double click on Emacs.app I see the app launch, the screen appear, it splits with an error in the bottom half that reads: Debugger entered-Lisp error: (void-function x-selection-exists-p) (x-selection-exists-p) (and (x-selection-exists-p) (not buffer-read-only)) sit-for(120) command-line-1(nil) command-line normal-top-level And when I go C-X C-f to load a file I see the minibuffer have a prompt for me to enter the file name and the program hangs. I can't even click on the window to bring to the foreground after moving to another app. I must use Force Quit to kill it.
Same if I launch Emacs and use the menu to try and start gnus. Why does the command line version run just fine, with no error msg but the app version has problems?
All advice appreciated. Bob Love mail: rlove@. Jabber: rlove@.