/[emacs]/emacs/src/buffer.c
ViewVC logotype

Diff of /emacs/src/buffer.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.358 by eliz, Tue Sep 18 13:51:22 2001 UTC revision 1.358.4.1 by gerd, Thu Nov 1 10:21:29 2001 UTC
# Line 1444  record_buffer (buf) Line 1444  record_buffer (buf)
1444  }  }
1445    
1446  DEFUN ("set-buffer-major-mode", Fset_buffer_major_mode, Sset_buffer_major_mode, 1, 1, 0,  DEFUN ("set-buffer-major-mode", Fset_buffer_major_mode, Sset_buffer_major_mode, 1, 1, 0,
1447    "Set an appropriate major mode for BUFFER, according to `default-major-mode'.\n\    "Set an appropriate major mode for BUFFER.\n\
1448    For the *scratch* buffer use `initial-major-mode', otherwise choose a\n\
1449    mode according to `default-major-mode'.\n\
1450  Use this function before selecting the buffer, since it may need to inspect\n\  Use this function before selecting the buffer, since it may need to inspect\n\
1451  the current buffer's major mode.")  the current buffer's major mode.")
1452    (buffer)    (buffer)
# Line 1453  the current buffer's major mode.") Line 1455  the current buffer's major mode.")
1455    int count;    int count;
1456    Lisp_Object function;    Lisp_Object function;
1457    
1458    function = buffer_defaults.major_mode;    if (STRINGP (XBUFFER (buffer)->name)
1459    if (NILP (function) && NILP (Fget (current_buffer->major_mode, Qmode_class)))        && strcmp (XSTRING (XBUFFER (buffer)->name)->data, "*scratch*") == 0)
1460      function = current_buffer->major_mode;      function = find_symbol_value (intern ("initial-major-mode"));
1461      else
1462        {
1463          function = buffer_defaults.major_mode;
1464          if (NILP (function)
1465              && NILP (Fget (current_buffer->major_mode, Qmode_class)))
1466            function = current_buffer->major_mode;
1467        }
1468      
1469    if (NILP (function) || EQ (function, Qfundamental_mode))    if (NILP (function) || EQ (function, Qfundamental_mode))
1470      return Qnil;      return Qnil;
1471    

Legend:
Removed from v.1.358  
changed lines
  Added in v.1.358.4.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26