unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Skipping the buffer extension .~HEAD~ when choosing major mode during ediff session
@ 2008-05-28 10:23 Nordlöw
  2008-05-28 11:20 ` Johan Bockgård
  0 siblings, 1 reply; 4+ messages in thread
From: Nordlöw @ 2008-05-28 10:23 UTC (permalink / raw)
  To: help-gnu-emacs

Is there a simple way for emacs to ignore the .~HEAD~ suffix when its
chooses its major-mode based on name of the file/buffer. The .~HEAD~
suffix is typically appended to a temporary buffer name created when
we ediff a file with its vc head version.

The brute-force and ugly way is of course to modify all entries in
auto-mode-alist but that seems far too cumbersome.

If nobody has any clue should I start digging into the code where auto-
mode-alist is used?

Thanks in advance,
Nordlöw


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Skipping the buffer extension .~HEAD~ when choosing major mode during ediff session
  2008-05-28 10:23 Skipping the buffer extension .~HEAD~ when choosing major mode during ediff session Nordlöw
@ 2008-05-28 11:20 ` Johan Bockgård
  2008-05-29  6:53   ` Kevin Rodgers
       [not found]   ` <mailman.12369.1212044029.18990.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 4+ messages in thread
From: Johan Bockgård @ 2008-05-28 11:20 UTC (permalink / raw)
  To: help-gnu-emacs

Nordlöw <per.nordlow@gmail.com> writes:

> Is there a simple way for emacs to ignore the .~HEAD~ suffix when its
> chooses its major-mode based on name of the file/buffer. The .~HEAD~
> suffix is typically appended to a temporary buffer name created when
> we ediff a file with its vc head version.

Emacs versions >= 22.2 already do the right thing.

-- 
Johan Bockgård


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Skipping the buffer extension .~HEAD~ when choosing major mode during ediff session
  2008-05-28 11:20 ` Johan Bockgård
@ 2008-05-29  6:53   ` Kevin Rodgers
       [not found]   ` <mailman.12369.1212044029.18990.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 4+ messages in thread
From: Kevin Rodgers @ 2008-05-29  6:53 UTC (permalink / raw)
  To: help-gnu-emacs

Johan Bockgård wrote:
> Nordlöw <per.nordlow@gmail.com> writes:
> 
>> Is there a simple way for emacs to ignore the .~HEAD~ suffix when its
>> chooses its major-mode based on name of the file/buffer. The .~HEAD~
>> suffix is typically appended to a temporary buffer name created when
>> we ediff a file with its vc head version.
> 
> Emacs versions >= 22.2 already do the right thing.

If one wanted to explain to Nordlöw how Emacs 22.2 does it, where would
one look?  There's no mention in etc/NEWS.

-- 
Kevin Rodgers
Denver, Colorado, USA





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Skipping the buffer extension .~HEAD~ when choosing major mode during ediff session
       [not found]   ` <mailman.12369.1212044029.18990.help-gnu-emacs@gnu.org>
@ 2008-05-29  7:39     ` Johan Bockgård
  0 siblings, 0 replies; 4+ messages in thread
From: Johan Bockgård @ 2008-05-29  7:39 UTC (permalink / raw)
  To: help-gnu-emacs

Kevin Rodgers <kevin.d.rodgers@gmail.com> writes:

> Johan Bockgård wrote:
>> Nordlöw <per.nordlow@gmail.com> writes:
>>
>>> Is there a simple way for emacs to ignore the .~HEAD~ suffix when its
>>> chooses its major-mode based on name of the file/buffer. The .~HEAD~
>>> suffix is typically appended to a temporary buffer name created when
>>> we ediff a file with its vc head version.
>>
>> Emacs versions >= 22.2 already do the right thing.
>
> If one wanted to explain to Nordlöw how Emacs 22.2 does it, where would
> one look?  There's no mention in etc/NEWS.

[file-name-sans-versions]

 			 (length name))
 		   (if keep-backup-version
 		       (length name)
-		     (or (string-match "\\.~[0-9.]+~\\'" name)
+		     (or (string-match "\\.~[-[:alnum:]:#@^._]+~\\'" name)
 			 (string-match "~\\'" name)
 			 (length name))))))))

-- 
Johan Bockgård


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-05-29  7:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-28 10:23 Skipping the buffer extension .~HEAD~ when choosing major mode during ediff session Nordlöw
2008-05-28 11:20 ` Johan Bockgård
2008-05-29  6:53   ` Kevin Rodgers
     [not found]   ` <mailman.12369.1212044029.18990.help-gnu-emacs@gnu.org>
2008-05-29  7:39     ` Johan Bockgård

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).