* difficulty entering balance mode
@ 2015-07-24 19:23 Haines Brown
2015-07-25 1:31 ` Emanuel Berg
2015-07-25 8:02 ` Stefan Monnier
0 siblings, 2 replies; 24+ messages in thread
From: Haines Brown @ 2015-07-24 19:23 UTC (permalink / raw)
To: help-gnu-emacs
I don't know that I changed any emacs configuration, but it now has
problems entering balance mode.
Of do C-f to find ~/.balance.bal, nothing happens. If I do it a second
time, emacs enters the balance mode properly.
In .emacs I have:
(autoload 'balance-mode "balance")
(setq auto-mode-alist
(append '(("\\.bal$" . balance-mode)) auto-mode-alist))
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: difficulty entering balance mode
2015-07-24 19:23 difficulty entering balance mode Haines Brown
@ 2015-07-25 1:31 ` Emanuel Berg
2015-07-25 10:52 ` Haines Brown
2015-07-25 18:53 ` Haines Brown
2015-07-25 8:02 ` Stefan Monnier
1 sibling, 2 replies; 24+ messages in thread
From: Emanuel Berg @ 2015-07-25 1:31 UTC (permalink / raw)
To: help-gnu-emacs
Haines Brown <haines@engels.histomat.net> writes:
> I don't know that I changed any emacs configuration,
> but it now has problems entering balance mode.
>
> Of do C-f to find ~/.balance.bal, nothing happens.
> If I do it a second time, emacs enters the balance
> mode properly.
>
> In .emacs I have:
>
> (autoload 'balance-mode "balance")
> (setq auto-mode-alist
> (append '(("\\.bal$" . balance-mode)) auto-mode-alist))
What happens if you comment that out in .emacs, and
instead evaluate them manually - do you get any
error messages?
I just tried my way of doing it, which resembles
yours, and it works alright save for I don't have any
"balance-mode" in my system.
If you evaluate this -
(let ((modes '(
("\\.bal" . balance-mode)
("\\.gpi" . gnuplot-mode)
("\\.\\(glsl\\|oil\\|ssc\\|dfy\\)" . c-mode)
("\\.lua" . lua-mode)
("\\.\\(service\\|list\\|theme\\|mailrc\\|sed\\|inc\\)" . conf-mode)
("\\.pic" . nroff-mode)
("\\.xr" . conf-xdefaults-mode)
("inputrc" . conf-colon-mode)
("KILL" . emacs-lisp-mode)
("\\.service" . emacs)
)))
(setq auto-mode-alist (append modes auto-mode-alist)) )
- and then opens .balance.bal - what happens?
--
underground experts united
http://user.it.uu.se/~embe8573
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: difficulty entering balance mode
2015-07-25 1:31 ` Emanuel Berg
@ 2015-07-25 10:52 ` Haines Brown
2015-07-26 21:53 ` Emanuel Berg
2015-07-25 18:53 ` Haines Brown
1 sibling, 1 reply; 24+ messages in thread
From: Haines Brown @ 2015-07-25 10:52 UTC (permalink / raw)
To: help-gnu-emacs
On Sat, Jul 25, 2015 at 03:31:08AM +0200, Emanuel Berg wrote:
> What happens if you comment that out in .emacs, and
> instead evaluate them manually - do you get any
> error messages?
> If you evaluate this -
>
> (let ((modes '(
> ("\\.bal" . balance-mode)
> ("\\.gpi" . gnuplot-mode)
> ("\\.\\(glsl\\|oil\\|ssc\\|dfy\\)" . c-mode)
> ("\\.lua" . lua-mode)
> ("\\.\\(service\\|list\\|theme\\|mailrc\\|sed\\|inc\\)" . conf-mode)
> ("\\.pic" . nroff-mode)
> ("\\.xr" . conf-xdefaults-mode)
> ("inputrc" . conf-colon-mode)
> ("KILL" . emacs-lisp-mode)
> ("\\.service" . emacs)
> )))
> (setq auto-mode-alist (append modes auto-mode-alist)) )
>
> - and then opens .balance.bal - what happens?
I'm ignorant about lisp evaluation. I put emacs into lisp mode with M-x
emacs-lisp-mode. I then did M-:, which brings up Eval: prompt. At it I
pasted in all the above lines together and did RET. Error: . in wrong
context.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: difficulty entering balance mode
2015-07-25 10:52 ` Haines Brown
@ 2015-07-26 21:53 ` Emanuel Berg
0 siblings, 0 replies; 24+ messages in thread
From: Emanuel Berg @ 2015-07-26 21:53 UTC (permalink / raw)
To: help-gnu-emacs
Haines Brown <haines@histomat.net> writes:
> I'm ignorant about lisp evaluation. I put emacs into
> lisp mode with M-x emacs-lisp-mode. I then did M-:,
> which brings up Eval: prompt. At it I pasted in all
> the above lines together and did RET. Error: .
> in wrong context.
While it is a good thing to know about M-:, I find it
easier to do C-x C-e which runs the command
`eval-last-sexp'.
Just put point just after the parenthesis, and hit the
keystroke. Here, try:
(message "Mad skills")
^ cursor here
--
underground experts united
http://user.it.uu.se/~embe8573
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: difficulty entering balance mode
2015-07-25 1:31 ` Emanuel Berg
2015-07-25 10:52 ` Haines Brown
@ 2015-07-25 18:53 ` Haines Brown
2015-07-25 20:43 ` Ian Zimmerman
` (3 more replies)
1 sibling, 4 replies; 24+ messages in thread
From: Haines Brown @ 2015-07-25 18:53 UTC (permalink / raw)
To: help-gnu-emacs
I've reduced things to elementals. That is, I do $ emacs -q -l
.emacs-test. This .emacs-test file has in it only these lines:
(autoload 'balance-mode "balance")
(setq auto-mode-alist
(append '(("\\.bal\\'" . balance-mode)) auto-mode-alist))
When I do M-x f to find .balance.bal, now it opens on first try, but
emacs does enter balance mode. I get this error:
file mode specification error: (file-error) "Cannot open load file "no
such file or directory" "balance".
This is indeed no such file "balance". Rather there is .balance.bal.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: difficulty entering balance mode
2015-07-25 18:53 ` Haines Brown
@ 2015-07-25 20:43 ` Ian Zimmerman
2015-07-26 21:59 ` Emanuel Berg
` (2 subsequent siblings)
3 siblings, 0 replies; 24+ messages in thread
From: Ian Zimmerman @ 2015-07-25 20:43 UTC (permalink / raw)
To: help-gnu-emacs
On 2015-07-25 14:53 -0400, Haines Brown wrote:
> I've reduced things to elementals. That is, I do $ emacs -q -l
> .emacs-test. This .emacs-test file has in it only these lines:
>
> (autoload 'balance-mode "balance")
> (setq auto-mode-alist
> (append '(("\\.bal\\'" . balance-mode)) auto-mode-alist))
>
> When I do M-x f to find .balance.bal, now it opens on first try, but
> emacs does enter balance mode. I get this error:
>
> file mode specification error: (file-error) "Cannot open load file "no
> such file or directory" "balance".
>
> This is indeed no such file "balance". Rather there is .balance.bal.
Emacs cannot find the lisp module for some reason. The real file name
would be "balance.el" or "balance.elc". Since I don't know what OS
you're on, I can't advise how to look for it.
When it loads a module, emacs looks for one of those files in
directories which are in the lisp variable load-path. Your problem may
be that somehow the directory containing balance.el isn't in load-path
when your first try. But in this test scenario the reason is probably
simply that load-path isn't set as it is when you eval your normal init
code.
Then again, it is very strange that it works the 2nd time. Hmmm.
Perhaps a recursive load dependency problem? Unfortunately I don't know
what balance mode is (it's not on my system) so I can't try to repro in
detail.
--
Please *no* private copies of mailing list or newsgroup messages.
Rule 420: All persons more than eight miles high to leave the court.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: difficulty entering balance mode
2015-07-25 18:53 ` Haines Brown
2015-07-25 20:43 ` Ian Zimmerman
@ 2015-07-26 21:59 ` Emanuel Berg
2015-07-27 10:16 ` difficulty entering balance mode (SOLVED) Haines Brown
2015-07-29 17:04 ` difficulty entering balance mode Ian Zimmerman
[not found] ` <mailman.7618.1438189554.904.help-gnu-emacs@gnu.org>
3 siblings, 1 reply; 24+ messages in thread
From: Emanuel Berg @ 2015-07-26 21:59 UTC (permalink / raw)
To: help-gnu-emacs
Haines Brown <haines@histomat.net> writes:
> When I do M-x f to find .balance.bal, now it opens
> on first try, but emacs does enter balance mode.
> I get this error ...
>
> This is indeed no such file "balance". Rather there
> is .balance.bal.
This is what I told you. I don't have a balance-mode.
Actually I'm most often totally imbalanced! Are you
sure you are any better?
There are many things at work here: the file, the
filename and extention, the association, and the
desired mode. Are you sure all the Indians are in
the canoe?
Try to make up an extention, say .abc - and assign
that some mode you know is there, say
`emacs-lisp-mode'. Now open ~/test.abc - is that
buffer then in emacs-lisp-mode? If so, you know how
the association thing works!
Step two is to get the modes to work with the files.
Or if that actually is the first step, I'd be damned
if I knew...
--
underground experts united
http://user.it.uu.se/~embe8573
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: difficulty entering balance mode (SOLVED)
2015-07-26 21:59 ` Emanuel Berg
@ 2015-07-27 10:16 ` Haines Brown
2015-07-27 23:32 ` Emanuel Berg
[not found] ` <mailman.7494.1438040115.904.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 24+ messages in thread
From: Haines Brown @ 2015-07-27 10:16 UTC (permalink / raw)
To: help-gnu-emacs
On Sun, Jul 26, 2015 at 11:59:46PM +0200, Emanuel Berg wrote:
> Haines Brown <haines@histomat.net> writes:
>
> > When I do M-x f to find .balance.bal, now it opens
> > on first try, but emacs does enter balance mode.
After much fiddling, I found that my balance.bal file had a flaw in it.
This was not an issue of name, extension, permissions, mode, etc. I was
unable to see the flaw, but when I copied the content of that file to a
new balance.bal, the problem disappeared.
Thanks for your help and patience.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: difficulty entering balance mode (SOLVED)
2015-07-27 10:16 ` difficulty entering balance mode (SOLVED) Haines Brown
@ 2015-07-27 23:32 ` Emanuel Berg
[not found] ` <mailman.7494.1438040115.904.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 24+ messages in thread
From: Emanuel Berg @ 2015-07-27 23:32 UTC (permalink / raw)
To: help-gnu-emacs
Haines Brown <haines@histomat.net> writes:
> After much fiddling, I found that my balance.bal
> file had a flaw in it. This was not an issue of
> name, extension, permissions, mode, etc. I was
> unable to see the flaw, but when I copied the
> content of that file to a new balance.bal, the
> problem disappeared.
... really?
What flaw was that?
--
underground experts united
http://user.it.uu.se/~embe8573
^ permalink raw reply [flat|nested] 24+ messages in thread
[parent not found: <mailman.7494.1438040115.904.help-gnu-emacs@gnu.org>]
* Re: difficulty entering balance mode (SOLVED)
[not found] ` <mailman.7494.1438040115.904.help-gnu-emacs@gnu.org>
@ 2015-07-28 10:38 ` Haines Brown
2015-07-28 21:28 ` Emanuel Berg
0 siblings, 1 reply; 24+ messages in thread
From: Haines Brown @ 2015-07-28 10:38 UTC (permalink / raw)
To: help-gnu-emacs
Emanuel Berg <embe8573@student.uu.se> writes:
> Haines Brown <haines@histomat.net> writes:
>
>> After much fiddling, I found that my balance.bal
>> file had a flaw in it. This was not an issue of
>> name, extension, permissions, mode, etc. I was
>> unable to see the flaw, but when I copied the
>> content of that file to a new balance.bal, the
>> problem disappeared.
>
> ... really?
I had assumed, incorrectly perhaps, that if two files are identical in
respect to their observable properties (what is returned by $ ls -la),
the failure of one must be due to its content.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: difficulty entering balance mode (SOLVED)
2015-07-28 10:38 ` Haines Brown
@ 2015-07-28 21:28 ` Emanuel Berg
2015-07-28 21:46 ` Ian Zimmerman
0 siblings, 1 reply; 24+ messages in thread
From: Emanuel Berg @ 2015-07-28 21:28 UTC (permalink / raw)
To: help-gnu-emacs
Haines Brown <haines@engels.histomat.net> writes:
> I had assumed, incorrectly perhaps, that if two
> files are identical in respect to their observable
> properties (what is returned by $ ls -la), the
> failure of one must be due to its content.
In the context of this discussion so far, no, the file
should open fine either way (regardless of content)
and the only thing that would affect what mode Emacs
is to put it in is the extension (and, the Elisp that
tells Emacs what to do with files of such extentions).
However, there are a couple of special cases that
I know of.
For example, put this as the first line in an
elisp.el file:
;; -*- text -*-
Despite the .el extention, what you get is the
text mode!
Or, try evaluating this:
(setq magic-mode-alist '(("/\\* cpp \\*/" . c++-mode)))
Then, put this first in a file (without the whitespace
indentation):
/* cpp */
Now it should be in the C++ mode on startup.
--
underground experts united
http://user.it.uu.se/~embe8573
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: difficulty entering balance mode (SOLVED)
2015-07-28 21:28 ` Emanuel Berg
@ 2015-07-28 21:46 ` Ian Zimmerman
2015-07-29 15:44 ` Haines Brown
0 siblings, 1 reply; 24+ messages in thread
From: Ian Zimmerman @ 2015-07-28 21:46 UTC (permalink / raw)
To: help-gnu-emacs
On 2015-07-28 23:28 +0200, Emanuel Berg wrote:
> In the context of this discussion so far, no, the file should open
> fine either way (regardless of content) and the only thing that would
> affect what mode Emacs is to put it in is the extension (and, the
> Elisp that tells Emacs what to do with files of such extentions).
>
> However, there are a couple of special cases that I know of.
Also, the OP has not shown us _all_ of his auto-mode-alist additions.
It is conceivable that an earlier entry might match, for example because
of missing end-of-string anchor.
--
Please *no* private copies of mailing list or newsgroup messages.
Rule 420: All persons more than eight miles high to leave the court.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: difficulty entering balance mode (SOLVED)
2015-07-28 21:46 ` Ian Zimmerman
@ 2015-07-29 15:44 ` Haines Brown
0 siblings, 0 replies; 24+ messages in thread
From: Haines Brown @ 2015-07-29 15:44 UTC (permalink / raw)
To: help-gnu-emacs
On Tue, Jul 28, 2015 at 02:46:13PM -0700, Ian Zimmerman wrote:
> On 2015-07-28 23:28 +0200, Emanuel Berg wrote:
>
> > In the context of this discussion so far, no, the file should open
> > fine either way (regardless of content) and the only thing that would
> > affect what mode Emacs is to put it in is the extension (and, the
> > Elisp that tells Emacs what to do with files of such extentions).
> >
> > However, there are a couple of special cases that I know of.
>
> Also, the OP has not shown us _all_ of his auto-mode-alist additions.
> It is conceivable that an earlier entry might match, for example because
> of missing end-of-string anchor.
Sorry, I thought I had made clear that the entire test configuration
file consisted of just these line:
(autoload 'balance-mode "balance")
(setq auto-mode-alist
(append '(("\\.bal\\'" . balance-mode)) auto-mode-alist))
This configuration file is ~/.emacs-test. The balance mode configuration
file is ~/.emacs.d/elisp/balance.el. The database file is ~/.balance.bal.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: difficulty entering balance mode
2015-07-25 18:53 ` Haines Brown
2015-07-25 20:43 ` Ian Zimmerman
2015-07-26 21:59 ` Emanuel Berg
@ 2015-07-29 17:04 ` Ian Zimmerman
[not found] ` <mailman.7618.1438189554.904.help-gnu-emacs@gnu.org>
3 siblings, 0 replies; 24+ messages in thread
From: Ian Zimmerman @ 2015-07-29 17:04 UTC (permalink / raw)
To: help-gnu-emacs
On 2015-07-25 14:53 -0400, Haines Brown wrote:
> I've reduced things to elementals. That is, I do $ emacs -q -l
> .emacs-test. This .emacs-test file has in it only these lines:
>
> (autoload 'balance-mode "balance")
> (setq auto-mode-alist
> (append '(("\\.bal\\'" . balance-mode)) auto-mode-alist))
>
> When I do M-x f to find .balance.bal, now it opens on first try, but
> emacs does enter balance mode. I get this error:
>
> file mode specification error: (file-error) "Cannot open load file "no
> such file or directory" "balance".
Ok, let's start again from here. Forget about the database for now;
first, we have to debug loading the module. Put this into .emacs-test,
and nothing else:
(message (format "%s" load-path))
(load-library "balance")
Run emacs -q -l .emacs-test, what happens?
--
Please *no* private copies of mailing list or newsgroup messages.
Rule 420: All persons more than eight miles high to leave the court.
^ permalink raw reply [flat|nested] 24+ messages in thread
[parent not found: <mailman.7618.1438189554.904.help-gnu-emacs@gnu.org>]
* Re: difficulty entering balance mode
[not found] ` <mailman.7618.1438189554.904.help-gnu-emacs@gnu.org>
@ 2015-07-30 11:02 ` Haines Brown
2015-07-30 15:54 ` Ian Zimmerman
0 siblings, 1 reply; 24+ messages in thread
From: Haines Brown @ 2015-07-30 11:02 UTC (permalink / raw)
To: help-gnu-emacs
I get in minibuffer:
Cannot load open file: no such file or directory, balance
I assume this means it looks for balance.el, but can't find it in
~/.emacs.d/elisp/ because the line add-to-path pointing to elisp/ is
missing.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: difficulty entering balance mode
2015-07-30 11:02 ` Haines Brown
@ 2015-07-30 15:54 ` Ian Zimmerman
2015-07-30 17:30 ` Haines Brown
0 siblings, 1 reply; 24+ messages in thread
From: Ian Zimmerman @ 2015-07-30 15:54 UTC (permalink / raw)
To: help-gnu-emacs
On 2015-07-30 07:02 -0400, Haines Brown wrote:
> Cannot load open file: no such file or directory, balance
>
> I assume this means it looks for balance.el, but can't find it in
> ~/.emacs.d/elisp/ because the line add-to-path pointing to elisp/ is
> missing.
Yes, so add it. Before the load-library line.
--
Please *no* private copies of mailing list or newsgroup messages.
Rule 420: All persons more than eight miles high to leave the court.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: difficulty entering balance mode
2015-07-30 15:54 ` Ian Zimmerman
@ 2015-07-30 17:30 ` Haines Brown
2015-07-30 22:44 ` Emanuel Berg
0 siblings, 1 reply; 24+ messages in thread
From: Haines Brown @ 2015-07-30 17:30 UTC (permalink / raw)
To: help-gnu-emacs
On Thu, Jul 30, 2015 at 08:54:46AM -0700, Ian Zimmerman wrote:
> On 2015-07-30 07:02 -0400, Haines Brown wrote:
>
> > Cannot load open file: no such file or directory, balance
> >
> > I assume this means it looks for balance.el, but can't find it in
> > ~/.emacs.d/elisp/ because the line add-to-path pointing to elisp/ is
> > missing.
>
> Yes, so add it. Before the load-library line.
I prepended it and now the minibuffer says
Loading /home/haines/.emacs.d/elisp/buffer.el
I replaced the line you suggested with this stanza:
(autoload 'balance-mode "balance")
(setq auto-mode-alist
(append '(("\\.bal\\'" . balance-mode)) auto-mode-alist))
And then had emacs open a .balance.bal file. It opened in the balance
mode as it should. But then too does an old .balance.bal file that had
caused problems. That is, at the risk of discrediting myself, I can no
longer reproduce the problem with my proper .emacs configuration.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: difficulty entering balance mode
2015-07-24 19:23 difficulty entering balance mode Haines Brown
2015-07-25 1:31 ` Emanuel Berg
@ 2015-07-25 8:02 ` Stefan Monnier
2015-07-25 10:39 ` Haines Brown
2015-07-26 21:44 ` Emanuel Berg
1 sibling, 2 replies; 24+ messages in thread
From: Stefan Monnier @ 2015-07-25 8:02 UTC (permalink / raw)
To: help-gnu-emacs
> (append '(("\\.bal$" . balance-mode)) auto-mode-alist))
^
Should be \\'
Stefan
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: difficulty entering balance mode
2015-07-25 8:02 ` Stefan Monnier
@ 2015-07-25 10:39 ` Haines Brown
2015-07-25 16:06 ` Stefan Monnier
2015-07-26 21:44 ` Emanuel Berg
1 sibling, 1 reply; 24+ messages in thread
From: Haines Brown @ 2015-07-25 10:39 UTC (permalink / raw)
To: help-gnu-emacs
On Sat, Jul 25, 2015 at 04:02:34AM -0400, Stefan Monnier wrote:
> > (append '(("\\.bal$" . balance-mode)) auto-mode-alist))
> ^
> Should be \\'
Thanks, Stefan. There seem to be two legitimate versions of this. The
balance.el file says to use:
(autoload 'balance-mode "balance")
(setq auto-mode-alist
(append '(("\\.bal$" . balance-mode)) auto-mode-alist))
you and others have said to use:
(autoload 'balance-mode "balance") ;; takes twice
(setq auto-mode-alist
(append '(("\\.bal\\'" . balance-mode)) auto-mode-alist))
both open the balance.el file, given that it requires two commands to do
it. That is, this is not my problem.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: difficulty entering balance mode
2015-07-25 10:39 ` Haines Brown
@ 2015-07-25 16:06 ` Stefan Monnier
0 siblings, 0 replies; 24+ messages in thread
From: Stefan Monnier @ 2015-07-25 16:06 UTC (permalink / raw)
To: help-gnu-emacs
> it. That is, this is not my problem.
Indeed, it's not directly related to your problem. But since "\\.foo$"
is used (slightly) incorrectly at so many places, I try to point it out
whenever I get a chance, in the hope that others will see my comment and
copy "\\.bar\\'" in their own code rather than keep reproducing the
poorer version.
Stefan
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: difficulty entering balance mode
2015-07-25 8:02 ` Stefan Monnier
2015-07-25 10:39 ` Haines Brown
@ 2015-07-26 21:44 ` Emanuel Berg
2015-07-26 22:14 ` Ian Zimmerman
1 sibling, 1 reply; 24+ messages in thread
From: Emanuel Berg @ 2015-07-26 21:44 UTC (permalink / raw)
To: help-gnu-emacs
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> (append '(("\\.bal$" . balance-mode)) auto-mode-alist))
> ^
> Should be \\'
Interesting, I never did either $ nor \\' and it
always worked, but now that you say it, I also read in
the Elisp manual at
(info "(elisp)Auto Major Mode")
that
For example,
(("\\`/tmp/fol/" . text-mode)
("\\.texinfo\\'" . texinfo-mode)
("\\.texi\\'" . texinfo-mode)
("\\.el\\'" . emacs-lisp-mode)
("\\.c\\'" . c-mode)
("\\.h\\'" . c-mode)
...)
I believe that yes, that is the correct way :)
What is the reason, by the way? Does it have anything
to do with `this' Emacs notation?
PS. If I view an info page, is there a function to get
an Elisp reference to what I look at, e.g.
the one above?
--
underground experts united
http://user.it.uu.se/~embe8573
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: difficulty entering balance mode
2015-07-26 21:44 ` Emanuel Berg
@ 2015-07-26 22:14 ` Ian Zimmerman
2015-07-26 22:19 ` Emanuel Berg
0 siblings, 1 reply; 24+ messages in thread
From: Ian Zimmerman @ 2015-07-26 22:14 UTC (permalink / raw)
To: help-gnu-emacs
On 2015-07-26 23:44 +0200, Emanuel Berg wrote:
> Interesting, I never did either $ nor \\' and it
> always worked
But it could have worked a bit more often than desired :-)
> What is the reason, by the way? Does it have anything
> to do with `this' Emacs notation?
$ matches end of line. ' matches end of string or buffer.
If you use $ instead of ' when matching a string, you will falsely
succeed if there's an internal newline. Luckily that doesn't often
happen with file names.
If you use neither, you will falsely succeed if the search text occurs
in the middle of the string, which could very well happen with file
names.
--
Please *no* private copies of mailing list or newsgroup messages.
Rule 420: All persons more than eight miles high to leave the court.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: difficulty entering balance mode
2015-07-26 22:14 ` Ian Zimmerman
@ 2015-07-26 22:19 ` Emanuel Berg
0 siblings, 0 replies; 24+ messages in thread
From: Emanuel Berg @ 2015-07-26 22:19 UTC (permalink / raw)
To: help-gnu-emacs
Ian Zimmerman <itz@buug.org> writes:
> $ matches end of line. ' matches end of string
> or buffer.
Aha, crystal clear!
> If you use $ instead of ' when matching a string,
> you will falsely succeed if there's an internal
> newline. Luckily that doesn't often happen with
> file names.
>
> If you use neither, you will falsely succeed if the
> search text occurs in the middle of the string,
> which could very well happen with file names.
I see. This never happened because I never have dots
in my filenames save for the at the extention! See,
I'm so good, even when I make a mistake, nothing bad
can happen to me :) Nevertheless I'll change that to
\\' which is the right way.
--
underground experts united
http://user.it.uu.se/~embe8573
^ permalink raw reply [flat|nested] 24+ messages in thread
end of thread, other threads:[~2015-07-30 22:44 UTC | newest]
Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-24 19:23 difficulty entering balance mode Haines Brown
2015-07-25 1:31 ` Emanuel Berg
2015-07-25 10:52 ` Haines Brown
2015-07-26 21:53 ` Emanuel Berg
2015-07-25 18:53 ` Haines Brown
2015-07-25 20:43 ` Ian Zimmerman
2015-07-26 21:59 ` Emanuel Berg
2015-07-27 10:16 ` difficulty entering balance mode (SOLVED) Haines Brown
2015-07-27 23:32 ` Emanuel Berg
[not found] ` <mailman.7494.1438040115.904.help-gnu-emacs@gnu.org>
2015-07-28 10:38 ` Haines Brown
2015-07-28 21:28 ` Emanuel Berg
2015-07-28 21:46 ` Ian Zimmerman
2015-07-29 15:44 ` Haines Brown
2015-07-29 17:04 ` difficulty entering balance mode Ian Zimmerman
[not found] ` <mailman.7618.1438189554.904.help-gnu-emacs@gnu.org>
2015-07-30 11:02 ` Haines Brown
2015-07-30 15:54 ` Ian Zimmerman
2015-07-30 17:30 ` Haines Brown
2015-07-30 22:44 ` Emanuel Berg
2015-07-25 8:02 ` Stefan Monnier
2015-07-25 10:39 ` Haines Brown
2015-07-25 16:06 ` Stefan Monnier
2015-07-26 21:44 ` Emanuel Berg
2015-07-26 22:14 ` Ian Zimmerman
2015-07-26 22:19 ` Emanuel Berg
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).