diff options
| author | Richard M. Stallman | 1994-09-22 05:04:59 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-09-22 05:04:59 +0000 |
| commit | 0a952b5763c4a75da9dd0fbfa3c44878f1db2239 (patch) | |
| tree | c56523af92740688cca879bd46dbb74459eb2bc4 /src/window.c | |
| parent | 42354c891c40ab141dbd1abe2c6bb1d3eb40f9b8 (diff) | |
| download | emacs-0a952b5763c4a75da9dd0fbfa3c44878f1db2239.tar.gz emacs-0a952b5763c4a75da9dd0fbfa3c44878f1db2239.zip | |
(display-buffer, special-display-buffer-names)
(special-display-regexps, special-display-function): Accept cons
cells in `special-display-buffer-names' and
`special-display-regexps'. If the buffer name matches the car,
call `special-display-function' with the cdr as a second argument.
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/src/window.c b/src/window.c index 7f172486426..67fe10fe26c 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -1858,9 +1858,24 @@ Returns the window displaying BUFFER.") | |||
| 1858 | if (!NILP (tem)) | 1858 | if (!NILP (tem)) |
| 1859 | return call1 (Vspecial_display_function, buffer); | 1859 | return call1 (Vspecial_display_function, buffer); |
| 1860 | 1860 | ||
| 1861 | tem = Fassoc (XBUFFER (buffer)->name, Vspecial_display_buffer_names); | ||
| 1862 | if (!NILP (tem)) | ||
| 1863 | return call2 (Vspecial_display_function, buffer, XCONS (tem)->cdr); | ||
| 1864 | |||
| 1861 | for (tem = Vspecial_display_regexps; CONSP (tem); tem = XCONS (tem)->cdr) | 1865 | for (tem = Vspecial_display_regexps; CONSP (tem); tem = XCONS (tem)->cdr) |
| 1862 | if (fast_string_match (XCONS (tem)->car, XBUFFER (buffer)->name) >= 0) | 1866 | { |
| 1863 | return call1 (Vspecial_display_function, buffer); | 1867 | Lisp_Object car = XCONS (tem)->car; |
| 1868 | if (STRINGP (car) | ||
| 1869 | && fast_string_match (car, XBUFFER (buffer)->name) >= 0) | ||
| 1870 | return call1 (Vspecial_display_function, buffer); | ||
| 1871 | else if (CONSP (car) | ||
| 1872 | && STRINGP (XCONS (car)->car) | ||
| 1873 | && fast_string_match (XCONS (car)->car, | ||
| 1874 | XBUFFER (buffer)->name) >= 0) | ||
| 1875 | return call2 (Vspecial_display_function, | ||
| 1876 | buffer, | ||
| 1877 | XCONS (car)->cdr); | ||
| 1878 | } | ||
| 1864 | } | 1879 | } |
| 1865 | 1880 | ||
| 1866 | #ifdef MULTI_FRAME | 1881 | #ifdef MULTI_FRAME |
| @@ -3245,20 +3260,28 @@ where `pop-up-frame-alist' would hold the default frame parameters."); | |||
| 3245 | DEFVAR_LISP ("special-display-buffer-names", &Vspecial_display_buffer_names, | 3260 | DEFVAR_LISP ("special-display-buffer-names", &Vspecial_display_buffer_names, |
| 3246 | "*List of buffer names that should have their own special frames.\n\ | 3261 | "*List of buffer names that should have their own special frames.\n\ |
| 3247 | Displaying a buffer whose name is in this list makes a special frame for it\n\ | 3262 | Displaying a buffer whose name is in this list makes a special frame for it\n\ |
| 3248 | using `special-display-function'. See also `special-display-regexps'."); | 3263 | using `special-display-function'.\n\ |
| 3264 | Instead of a buffer name, the list entries can be cons cells. In that\n\ | ||
| 3265 | case the car should be a buffer name, and the cdr data to be passed as a | ||
| 3266 | second argument to `special-display-function'.\n\ | ||
| 3267 | See also `special-display-regexps'."); | ||
| 3249 | Vspecial_display_buffer_names = Qnil; | 3268 | Vspecial_display_buffer_names = Qnil; |
| 3250 | 3269 | ||
| 3251 | DEFVAR_LISP ("special-display-regexps", &Vspecial_display_regexps, | 3270 | DEFVAR_LISP ("special-display-regexps", &Vspecial_display_regexps, |
| 3252 | "*List of regexps saying which buffers should have their own special frames.\n\ | 3271 | "*List of regexps saying which buffers should have their own special frames.\n\ |
| 3253 | If a buffer name matches one of these regexps, it gets its own frame.\n\ | 3272 | If a buffer name matches one of these regexps, it gets its own frame.\n\ |
| 3254 | Displaying a buffer whose name is in this list makes a special frame for it\n\ | 3273 | Displaying a buffer whose name is in this list makes a special frame for it\n\ |
| 3255 | using `special-display-function'. See also `special-display-buffer-names'."); | 3274 | using `special-display-function'.\n\ |
| 3275 | Instead of a buffer name, the list entries can be cons cells. In that\n\ | ||
| 3276 | case the car should be the regexp, and the cdr data to be passed as a | ||
| 3277 | second argument to `special-display-function'.\n\ | ||
| 3278 | See also `special-display-buffer-names'."); | ||
| 3256 | Vspecial_display_regexps = Qnil; | 3279 | Vspecial_display_regexps = Qnil; |
| 3257 | 3280 | ||
| 3258 | DEFVAR_LISP ("special-display-function", &Vspecial_display_function, | 3281 | DEFVAR_LISP ("special-display-function", &Vspecial_display_function, |
| 3259 | "Function to call to make a new frame for a special buffer.\n\ | 3282 | "Function to call to make a new frame for a special buffer.\n\ |
| 3260 | It is called with one argument, the buffer,\n\ | 3283 | It is called with two arguments, the buffer and optional buffer specific\n\ |
| 3261 | and should return a window displaying that buffer.\n\ | 3284 | data, and should return a window displaying that buffer.\n\ |
| 3262 | The default value makes a separate frame for the buffer,\n\ | 3285 | The default value makes a separate frame for the buffer,\n\ |
| 3263 | using `special-display-alist' to specify the frame parameters.\n\ | 3286 | using `special-display-alist' to specify the frame parameters.\n\ |
| 3264 | \n\ | 3287 | \n\ |