From: michael@cadilhac.name (Michaël Cadilhac)
To: emacs-devel@gnu.org
Subject: Re: Fontification in ' *' buffers.
Date: Fri, 31 Aug 2007 15:33:53 +0200 [thread overview]
Message-ID: <87lkbr4ym6.fsf@cadilhac.name> (raw)
In-Reply-To: <87odgtavcu.fsf@cadilhac.name> ("Michaël Cadilhac"'s message of "Mon, 27 Aug 2007 16:46:25 +0200")
[-- Attachment #1.1: Type: text/plain, Size: 1098 bytes --]
michael@cadilhac.name (Michaël Cadilhac) writes:
> (defun create-file-buffer (filename)
> "Create a suitably named buffer for visiting FILENAME, and return it.
> FILENAME (sans directory) is used unchanged if that name is free;
> ! otherwise a string <2> or <3> or ... is appended to get an unused name.
> ! Spaces at the start of FILENAME (sans directory) are removed."
> (let ((lastname (file-name-nondirectory filename)))
> (if (string= lastname "")
> (setq lastname filename))
> ! (save-match-data
> ! (string-match "^ *\\(.*\\)" lastname)
> ! (generate-new-buffer (match-string 1 lastname)))))
>
> (defun generate-new-buffer (name)
> "Create and return a buffer with a name based on NAME.
Installed.
--
| Michaël `Micha' Cadilhac | <ESC>ape this <COLON> thing, |
| http://michael.cadilhac.name | <Q>uit and |
| JID/MSN: | do <NOT> <RET>urn. |
`---- michael.cadilhac@gmail.com | -- VI - --'
[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]
[-- Attachment #2: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel
prev parent reply other threads:[~2007-08-31 13:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-23 17:16 Fontification in ' *' buffers Michaël Cadilhac
2007-08-26 19:26 ` Michaël Cadilhac
2007-08-27 4:27 ` Stefan Monnier
2007-08-27 7:25 ` Michaël Cadilhac
2007-08-27 14:17 ` Stefan Monnier
2007-08-27 14:46 ` Michaël Cadilhac
2007-08-27 20:13 ` Stefan Monnier
2007-08-31 13:33 ` Michaël Cadilhac [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lkbr4ym6.fsf@cadilhac.name \
--to=michael@cadilhac.name \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.