* coding systems
@ 2009-11-03 0:42 Joseph Brenner
2009-11-03 4:06 ` Eli Zaretskii
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: Joseph Brenner @ 2009-11-03 0:42 UTC (permalink / raw)
To: help-gnu-emacs
What is the simplest possible thing I can do to convince emacs
to never, ever, bug me about what coding system a file should be
saved under?
For extra points, a solution that minimizes data lossage would be
nice, but not strictly necessary from my point of view. I just
want the "Select a coding system" question to go away.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: coding systems
2009-11-03 0:42 coding systems Joseph Brenner
@ 2009-11-03 4:06 ` Eli Zaretskii
[not found] ` <mailman.9963.1257221220.2239.help-gnu-emacs@gnu.org>
2009-11-03 7:31 ` coding systems Tim X
2 siblings, 0 replies; 12+ messages in thread
From: Eli Zaretskii @ 2009-11-03 4:06 UTC (permalink / raw)
To: help-gnu-emacs
> From: Joseph Brenner <doom@kzsu.stanford.edu>
> Date: Mon, 02 Nov 2009 16:42:00 -0800
>
>
> What is the simplest possible thing I can do to convince emacs
> to never, ever, bug me about what coding system a file should be
> saved under?
For what use-cases? Do you type non-ASCII characters? If so, what
ranges of Unicode or character sets do you use? How often does it
happen that you edit an existing file and add to it characters from
character sets that were not there in the first place? Etc., etc.
Also, how much data loss are you willing to sustain?
IOW, without further details it is impossible to answer your question.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: coding systems
[not found] ` <mailman.9963.1257221220.2239.help-gnu-emacs@gnu.org>
@ 2009-11-03 7:23 ` Joseph Brenner
2009-11-03 9:35 ` Peter Dyballa
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: Joseph Brenner @ 2009-11-03 7:23 UTC (permalink / raw)
To: help-gnu-emacs
Eli Zaretskii <eliz@gnu.org> writes:
>> Joseph Brenner <doom@kzsu.stanford.edu> wrote:
>>
>> What is the simplest possible thing I can do to convince emacs
>> to never, ever, bug me about what coding system a file should be
>> saved under?
>
> For what use-cases? Do you type non-ASCII characters? If so, what
> ranges of Unicode or character sets do you use? How often does it
> happen that you edit an existing file and add to it characters from
> character sets that were not there in the first place? Etc., etc.
>
> Also, how much data loss are you willing to sustain?
>
> IOW, without further details it is impossible to answer your question.
If it trashed everything but ascii characters, then that'd be my
problem, given the way I just asked the question.
However, it would seem to me that I should be able to just tell the
system to always use latin-1 (or utf-8) when in doubt, and that would
reduce the lossage to near zero.
And yes, I have been reading the docs, and will go back to reading the
docs if I need to; but someone must've been down this road already,
and I thought someone might have an answer off the top of their heads.
(Believe me, I am not the only American boob I've heard complain about
these complications.)
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: coding systems
2009-11-03 0:42 coding systems Joseph Brenner
2009-11-03 4:06 ` Eli Zaretskii
[not found] ` <mailman.9963.1257221220.2239.help-gnu-emacs@gnu.org>
@ 2009-11-03 7:31 ` Tim X
2009-11-03 19:11 ` Joseph Brenner
2 siblings, 1 reply; 12+ messages in thread
From: Tim X @ 2009-11-03 7:31 UTC (permalink / raw)
To: help-gnu-emacs
Joseph Brenner <doom@kzsu.stanford.edu> writes:
> What is the simplest possible thing I can do to convince emacs
> to never, ever, bug me about what coding system a file should be
> saved under?
>
> For extra points, a solution that minimizes data lossage would be
> nice, but not strictly necessary from my point of view. I just
> want the "Select a coding system" question to go away.
>
What version of emacs? There have been considerable changes, especially
in emacs 23 that may affect what solution is best.
It has been a long time since I've even seen this question. From memory,
when I moved from emacs 21 to emacs 22, I seem to remember an issue
related to coding systems. It turned out to be due to a configuration in
my .emacs that I required for emacs 21, but caused confusion for emacs
22. However, at about that time, I also moved from a C locale on my
system to a UTF-8 one. From memory, current-language-environment was, in
emacs 21, "en" and in emacs 22 and later, is "UTF-8". I don't know for
sure if it was the changing to a UTF-8 locale or the changes in my
.emacs or both that helped emacs determine the correct coding system. I
have also changed jobs and now get fewer files with different coding
systems, so its hard to tell for certain.
Given the improvements in emacs 23 for coding systems, I'd recommend
upgrading to emacs 23 if your not already using it and then start
diagnosing the issue to find a solution.
Tim
--
tcross (at) rapttech dot com dot au
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: coding systems
2009-11-03 7:23 ` Joseph Brenner
@ 2009-11-03 9:35 ` Peter Dyballa
2009-11-03 18:53 ` Eli Zaretskii
[not found] ` <mailman.9970.1257240951.2239.help-gnu-emacs@gnu.org>
2 siblings, 0 replies; 12+ messages in thread
From: Peter Dyballa @ 2009-11-03 9:35 UTC (permalink / raw)
To: Joseph Brenner; +Cc: help-gnu-emacs
Am 03.11.2009 um 08:23 schrieb Joseph Brenner:
> However, it would seem to me that I should be able to just tell the
> system to always use latin-1 (or utf-8) when in doubt, and that would
> reduce the lossage to near zero.
(prefer-coding-system 'utf-8) ?
--
Greetings
Pete
Every instructor assumes that you have nothing else to do except
study for that instructor's course.
– Fourth Law of Applied Terror
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: coding systems
2009-11-03 7:23 ` Joseph Brenner
2009-11-03 9:35 ` Peter Dyballa
@ 2009-11-03 18:53 ` Eli Zaretskii
[not found] ` <mailman.9970.1257240951.2239.help-gnu-emacs@gnu.org>
2 siblings, 0 replies; 12+ messages in thread
From: Eli Zaretskii @ 2009-11-03 18:53 UTC (permalink / raw)
To: help-gnu-emacs
> From: Joseph Brenner <doom@kzsu.stanford.edu>
> Date: Mon, 02 Nov 2009 23:23:41 -0800
>
> > For what use-cases? Do you type non-ASCII characters? If so, what
> > ranges of Unicode or character sets do you use? How often does it
> > happen that you edit an existing file and add to it characters from
> > character sets that were not there in the first place? Etc., etc.
> >
> > Also, how much data loss are you willing to sustain?
> >
> > IOW, without further details it is impossible to answer your question.
>
> If it trashed everything but ascii characters, then that'd be my
> problem, given the way I just asked the question.
Sadly, this tells nothing about your typical use-cases.
> However, it would seem to me that I should be able to just tell the
> system to always use latin-1 (or utf-8) when in doubt
There is no doubt. When Emacs asks you to provide a coding system, it
_knows_for_sure_ it cannot encode the text with any of the encodings
that are hinted by your defaults and the system's setup. So, if you
setup Emacs to prefer UTF-8, as Peter suggested, and Emacs still pops
the question, it means UTF-8 cannot be used in this case, period.
The only way to never get this question is to have your default
encoding be utf-8-emacs. (This is the encoding used by Emacs
internally, which extends UTF-8 and Unicode with some codepoints
private to Emacs.) It's possible that you can also avoid the question
by setting the default to raw-text. Caveat emptor: doing so may
produce files that only Emacs will be able to display correctly, and
that you may need to specify the encoding explicitly when visiting
files thus saved.
> someone must've been down this road already
Not necessarily. With Emacs 23, the question pops rather rarely, so I
gather most users aren't annoyed at all. Which is another reason to
tell more about your plight: if this happens to you more than you are
able to endure, something is probably wrong in your setup.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: coding systems
2009-11-03 7:31 ` coding systems Tim X
@ 2009-11-03 19:11 ` Joseph Brenner
2009-11-03 21:20 ` Eli Zaretskii
0 siblings, 1 reply; 12+ messages in thread
From: Joseph Brenner @ 2009-11-03 19:11 UTC (permalink / raw)
To: help-gnu-emacs
Tim X <timx@nospam.dev.null> writes:
> Joseph Brenner <doom@kzsu.stanford.edu> writes:
>
>> What is the simplest possible thing I can do to convince emacs
>> to never, ever, bug me about what coding system a file should be
>> saved under?
>>
>> For extra points, a solution that minimizes data lossage would be
>> nice, but not strictly necessary from my point of view. I just
>> want the "Select a coding system" question to go away.
>>
>
> What version of emacs? There have been considerable changes, especially
> in emacs 23 that may affect what solution is best.
Yes, I should've mentioned that I'm running a cvs emacs, of
late-October vintage.
> It has been a long time since I've even seen this question.
It's been a low-grade issue with me for some time. If I cut-and-paste
something from a firefox window to some notes in an emacs file,
there's invariable a "smart quote", or an emdash or something that
emacs doesn't know what to do with.
More recently, I've started seeing a worse problem: there's a package
I've been working on to use desktop.el for things like intelligent crash
recovery ("desktop-recover.el", at a github near you). When there are
some international characters stashed in a register that "desktop-save"
wants to preserve, then I'm asked for a coding system not just once, but
every single time the auto-save-hook fires, because I use it to do
automatic "desktop-save"s.
> Given the improvements in emacs 23 for coding systems, I'd recommend
> upgrading to emacs 23 if your not already using it and then start
> diagnosing the issue to find a solution.
You're probably right that emacs 23 is the way to go on this, but then
a side-effect of the improvements is that the documentation has gotten
a little more complicated.
It is a point that I should make sure I don't have any cruft from older
emacs in my set-up files.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: coding systems
[not found] ` <mailman.9970.1257240951.2239.help-gnu-emacs@gnu.org>
@ 2009-11-03 20:25 ` Joseph Brenner
2009-11-03 21:10 ` Drew Adams
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: Joseph Brenner @ 2009-11-03 20:25 UTC (permalink / raw)
To: help-gnu-emacs
Peter Dyballa <Peter_Dyballa@Web.DE> writes:
> Joseph Brenner:
>
>> However, it would seem to me that I should be able to just tell the
>> system to always use latin-1 (or utf-8) when in doubt, and that would
>> reduce the lossage to near zero.
>
> (prefer-coding-system 'utf-8) ?
Thanks, I'm giving it a try. Looks like it's more or less working.
By the way, on the subject of the virtue of code examples... if
I'd just given that a try on my own, I might very well tried a
quoted string first:
(prefer-coding-system "utf-8")
I would then have been very puzzled by this error message:
error: Invalid coding system `utf-8'
^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: coding systems
2009-11-03 20:25 ` Joseph Brenner
@ 2009-11-03 21:10 ` Drew Adams
[not found] ` <mailman.9998.1257282634.2239.help-gnu-emacs@gnu.org>
2009-11-05 5:52 ` convenience in c programming question: ifdefs Maindoor
2 siblings, 0 replies; 12+ messages in thread
From: Drew Adams @ 2009-11-03 21:10 UTC (permalink / raw)
To: 'Joseph Brenner', help-gnu-emacs
> By the way, on the subject of the virtue of code examples... if
> I'd just given that a try on my own, I might very well tried a
> quoted string first:
>
> (prefer-coding-system "utf-8")
>
> I would then have been very puzzled by this error message:
>
> error: Invalid coding system `utf-8'
This is a chance to help improve Emacs by submitting a bug report:
`M-x report-emacs-bug'. You can say something like the following:
The function's doc string should say what it expects as an argument - it should
say whether it is a string or a symbol or either (or something else).
(The same would be true of its treatment in the Elisp manual, if it were covered
there.)
IOW, you've learned something that isn't covered by the doc as it should be.
Please pass along that knowledge, to improve the doc and help others.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: coding systems
2009-11-03 19:11 ` Joseph Brenner
@ 2009-11-03 21:20 ` Eli Zaretskii
0 siblings, 0 replies; 12+ messages in thread
From: Eli Zaretskii @ 2009-11-03 21:20 UTC (permalink / raw)
To: help-gnu-emacs
> From: Joseph Brenner <doom@kzsu.stanford.edu>
> Date: Tue, 03 Nov 2009 11:11:28 -0800
>
> More recently, I've started seeing a worse problem: there's a package
> I've been working on to use desktop.el for things like intelligent crash
> recovery ("desktop-recover.el", at a github near you). When there are
> some international characters stashed in a register that "desktop-save"
> wants to preserve, then I'm asked for a coding system not just once, but
> every single time the auto-save-hook fires, because I use it to do
> automatic "desktop-save"s.
If the issue is with saving contents of internal Emacs data
structures, then utf-8-emacs (and its alias emacs-internal) is
definitely the way to go. Note: utf-8-emacs is NOT the same as utf-8,
the latter will not be able to encode every character Emacs can hold
in its buffers or strings, although it comes pretty close.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: coding systems
[not found] ` <mailman.9998.1257282634.2239.help-gnu-emacs@gnu.org>
@ 2009-11-04 0:30 ` Joseph Brenner
0 siblings, 0 replies; 12+ messages in thread
From: Joseph Brenner @ 2009-11-04 0:30 UTC (permalink / raw)
To: help-gnu-emacs
"Drew Adams" <drew.adams@oracle.com> writes:
>> By the way, on the subject of the virtue of code examples... if
>> I'd just given that a try on my own, I might very well tried a
>> quoted string first:
>>
>> (prefer-coding-system "utf-8")
>>
>> I would then have been very puzzled by this error message:
>>
>> error: Invalid coding system `utf-8'
>
> This is a chance to help improve Emacs by submitting a bug report:
> `M-x report-emacs-bug'.
Good point. Will do.
(And actually, now that I think about it, I think I have seen that error
message before... that particular rat-hole is probably the reason I
didn't solve this problem a year ago.)
^ permalink raw reply [flat|nested] 12+ messages in thread
* convenience in c programming question: ifdefs
2009-11-03 20:25 ` Joseph Brenner
2009-11-03 21:10 ` Drew Adams
[not found] ` <mailman.9998.1257282634.2239.help-gnu-emacs@gnu.org>
@ 2009-11-05 5:52 ` Maindoor
2 siblings, 0 replies; 12+ messages in thread
From: Maindoor @ 2009-11-05 5:52 UTC (permalink / raw)
To: help-gnu-emacs, Joseph Brenner
[-- Attachment #1: Type: text/plain, Size: 629 bytes --]
Hi,
I would like to hide or interpret certain ifdefs in c code so that i can browse the
code more easily. but cpp-highlight-buffer doesn't suit all my needs.
1) There is no command to turn it off other than to close and revisit the file.
2) The load command to load one settings from one workspace1 to another workspace2. doesn't work. when I press [L]oad ( capital L ) it doesn't do anything. I
have a configured .cpp.el file from workspace1 to current workspace2. But it is not
doing anything.
Can some emacs guru tell me what I am doing wrong or is there a better way to
deal with this code browsing.
-Maindoor.
[-- Attachment #2: Type: text/html, Size: 778 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2009-11-05 5:52 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-03 0:42 coding systems Joseph Brenner
2009-11-03 4:06 ` Eli Zaretskii
[not found] ` <mailman.9963.1257221220.2239.help-gnu-emacs@gnu.org>
2009-11-03 7:23 ` Joseph Brenner
2009-11-03 9:35 ` Peter Dyballa
2009-11-03 18:53 ` Eli Zaretskii
[not found] ` <mailman.9970.1257240951.2239.help-gnu-emacs@gnu.org>
2009-11-03 20:25 ` Joseph Brenner
2009-11-03 21:10 ` Drew Adams
[not found] ` <mailman.9998.1257282634.2239.help-gnu-emacs@gnu.org>
2009-11-04 0:30 ` Joseph Brenner
2009-11-05 5:52 ` convenience in c programming question: ifdefs Maindoor
2009-11-03 7:31 ` coding systems Tim X
2009-11-03 19:11 ` Joseph Brenner
2009-11-03 21:20 ` Eli Zaretskii
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).