3898 |
If DISPLAY-FLAG is non-nil, the new buffer is shown with `pop-to-buffer'. |
If DISPLAY-FLAG is non-nil, the new buffer is shown with `pop-to-buffer'. |
3899 |
This runs the normal hook `clone-buffer-hook' in the new buffer |
This runs the normal hook `clone-buffer-hook' in the new buffer |
3900 |
after it has been set up properly in other respects." |
after it has been set up properly in other respects." |
3901 |
(interactive (list (if current-prefix-arg (read-string "Name: ")) |
(interactive |
3902 |
t)) |
(progn |
3903 |
|
(if buffer-file-name |
3904 |
|
(error "Cannot clone a file-visiting buffer")) |
3905 |
|
(if (get major-mode 'no-clone) |
3906 |
|
(error "Cannot clone a buffer in %s mode" mode-name)) |
3907 |
|
(list (if current-prefix-arg (read-string "Name: ")) |
3908 |
|
t))) |
3909 |
(if buffer-file-name |
(if buffer-file-name |
3910 |
(error "Cannot clone a file-visiting buffer")) |
(error "Cannot clone a file-visiting buffer")) |
3911 |
(if (get major-mode 'no-clone) |
(if (get major-mode 'no-clone) |
3969 |
|
|
3970 |
Optional last arg NORECORD non-nil means do not put this buffer at the |
Optional last arg NORECORD non-nil means do not put this buffer at the |
3971 |
front of the list of recently selected ones." |
front of the list of recently selected ones." |
3972 |
(interactive (list (if current-prefix-arg |
(interactive |
3973 |
(read-string "BName of indirect buffer: ")) |
(progn |
3974 |
t)) |
(if (get major-mode 'no-clone-indirect) |
3975 |
|
(error "Cannot indirectly clone a buffer in %s mode" mode-name)) |
3976 |
|
(list (if current-prefix-arg |
3977 |
|
(read-string "BName of indirect buffer: ")) |
3978 |
|
t))) |
3979 |
|
(if (get major-mode 'no-clone-indirect) |
3980 |
|
(error "Cannot indirectly clone a buffer in %s mode" mode-name)) |
3981 |
(setq newname (or newname (buffer-name))) |
(setq newname (or newname (buffer-name))) |
3982 |
(if (string-match "<[0-9]+>\\'" newname) |
(if (string-match "<[0-9]+>\\'" newname) |
3983 |
(setq newname (substring newname 0 (match-beginning 0)))) |
(setq newname (substring newname 0 (match-beginning 0)))) |