]> git.eshelyaron.com Git - emacs.git/commitdiff
(display-buffer, special-display-buffer-names)
authorRichard M. Stallman <rms@gnu.org>
Thu, 22 Sep 1994 05:04:59 +0000 (05:04 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 22 Sep 1994 05:04:59 +0000 (05:04 +0000)
(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.

src/window.c

index 7f17248642639b84f3e3bf1e52c325bccfe62b34..67fe10fe26c205b592d76874de85870d9bb630a5 100644 (file)
@@ -1858,9 +1858,24 @@ Returns the window displaying BUFFER.")
       if (!NILP (tem))
        return call1 (Vspecial_display_function, buffer);
 
+      tem = Fassoc (XBUFFER (buffer)->name, Vspecial_display_buffer_names);
+      if (!NILP (tem))
+       return call2 (Vspecial_display_function, buffer, XCONS (tem)->cdr);
+      
       for (tem = Vspecial_display_regexps; CONSP (tem); tem = XCONS (tem)->cdr)
-       if (fast_string_match (XCONS (tem)->car, XBUFFER (buffer)->name) >= 0)
-         return call1 (Vspecial_display_function, buffer);
+       {
+         Lisp_Object car = XCONS (tem)->car;
+         if (STRINGP (car)
+             && fast_string_match (car, XBUFFER (buffer)->name) >= 0)
+           return call1 (Vspecial_display_function, buffer);
+         else if (CONSP (car)
+                  && STRINGP (XCONS (car)->car)
+                  && fast_string_match (XCONS (car)->car,
+                                        XBUFFER (buffer)->name) >= 0)
+           return call2 (Vspecial_display_function,
+                         buffer,
+                         XCONS (car)->cdr);
+       }
     }
 
 #ifdef MULTI_FRAME
@@ -3245,20 +3260,28 @@ where `pop-up-frame-alist' would hold the default frame parameters.");
   DEFVAR_LISP ("special-display-buffer-names", &Vspecial_display_buffer_names,
     "*List of buffer names that should have their own special frames.\n\
 Displaying a buffer whose name is in this list makes a special frame for it\n\
-using `special-display-function'.  See also `special-display-regexps'.");
+using `special-display-function'.\n\
+Instead of a buffer name, the list entries can be cons cells.  In that\n\
+case the car should be a buffer name, and the cdr data to be passed as a 
+second argument to `special-display-function'.\n\
+See also `special-display-regexps'.");
   Vspecial_display_buffer_names = Qnil;
 
   DEFVAR_LISP ("special-display-regexps", &Vspecial_display_regexps,
     "*List of regexps saying which buffers should have their own special frames.\n\
 If a buffer name matches one of these regexps, it gets its own frame.\n\
 Displaying a buffer whose name is in this list makes a special frame for it\n\
-using `special-display-function'.  See also `special-display-buffer-names'.");
+using `special-display-function'.\n\
+Instead of a buffer name, the list entries can be cons cells.  In that\n\
+case the car should be the regexp, and the cdr data to be passed as a 
+second argument to `special-display-function'.\n\
+See also `special-display-buffer-names'.");
   Vspecial_display_regexps = Qnil;
 
   DEFVAR_LISP ("special-display-function", &Vspecial_display_function,
     "Function to call to make a new frame for a special buffer.\n\
-It is called with one argument, the buffer,\n\
-and should return a window displaying that buffer.\n\
+It is called with two arguments, the buffer and optional buffer specific\n\
+data, and should return a window displaying that buffer.\n\
 The default value makes a separate frame for the buffer,\n\
 using `special-display-alist' to specify the frame parameters.\n\
 \n\