aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJim Blandy1992-05-10 18:15:10 +0000
committerJim Blandy1992-05-10 18:15:10 +0000
commite065a56e2d6322cba165ceb5c1d46cc59c5a5148 (patch)
tree4b00ff121a271a6b9e8df84cf7eb1fb340be0e3d /src
parent1b1f8f85bf08bd6b1cdb5ca8d731ff3b12ff60d2 (diff)
downloademacs-e065a56e2d6322cba165ceb5c1d46cc59c5a5148.tar.gz
emacs-e065a56e2d6322cba165ceb5c1d46cc59c5a5148.zip
*** empty log message ***
Diffstat (limited to 'src')
-rw-r--r--src/.gdbinit59
-rw-r--r--src/alloc.c8
-rw-r--r--src/callproc.c20
-rw-r--r--src/data.c6
-rw-r--r--src/emacs.c5
-rw-r--r--src/filelock.c2
-rw-r--r--src/floatfns.c7
-rw-r--r--src/keyboard.c4
-rw-r--r--src/lisp.h2
-rw-r--r--src/lread.c8
-rw-r--r--src/process.c5
-rw-r--r--src/search.c8
-rw-r--r--src/sysdep.c25
13 files changed, 92 insertions, 67 deletions
diff --git a/src/.gdbinit b/src/.gdbinit
index bd6646da5fc..55000f571eb 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -3,7 +3,6 @@ define pr
3set Fprin1 ($, Qexternal_debugging_output) 3set Fprin1 ($, Qexternal_debugging_output)
4echo \n 4echo \n
5end 5end
6
7document pr 6document pr
8Print the emacs s-expression which is $. 7Print the emacs s-expression which is $.
9Works only when an inferior emacs is executing. 8Works only when an inferior emacs is executing.
@@ -13,73 +12,105 @@ define xtype
13print (enum Lisp_Type) (($ >> 24) & 0x7f) 12print (enum Lisp_Type) (($ >> 24) & 0x7f)
14p $$ 13p $$
15end 14end
15document xtype
16Print the type of $, assuming it is an Elisp value.
17end
16 18
17define xint 19define xint
18print (($ & 0x00ffffff) << 8) >> 8 20print (($ & 0x00ffffff) << 8) >> 8
19end 21end
22document xint
23Print $, assuming it is an Elisp integer. This gets the sign right.
24end
20 25
21define xptr 26define xptr
22print (void *) ($ & 0x00ffffff) 27print (void *) ($ & 0x00ffffff)
23end 28end
29document xptr
30Print the pointer portion of $, assuming it is an Elisp value.
31end
24 32
25define xwindow 33define xwindow
26print (struct window *) ($ & 0x00ffffff) 34print (struct window *) ($ & 0x00ffffff)
27end 35end
36document xwindow
37Print $ as a window pointer, assuming it is an Elisp window value.
38end
28 39
29define xmarker 40define xmarker
30print (struct Lisp_Marker *) ($ & 0x00ffffff) 41print (struct Lisp_Marker *) ($ & 0x00ffffff)
31end 42end
43document xmarker
44Print $ as a marker pointer, assuming it is an Elisp marker value.
45end
32 46
33define xbuffer 47define xbuffer
34print (struct buffer *) ($ & 0x00ffffff) 48print (struct buffer *) ($ & 0x00ffffff)
35end 49end
50document xbuffer
51Print $ as a buffer pointer, assuming it is an Elisp buffer value.
52end
36 53
37define xsymbol 54define xsymbol
38print (struct Lisp_Symbol *) ($ & 0x00ffffff) 55print (struct Lisp_Symbol *) ($ & 0x00ffffff)
39print &$->name->data 56print &$->name->data
40print $$ 57print $$
41end 58end
59document xsymbol
60Print the name and address of the symbol $.
61This command assumes that $ is an Elisp symbol value.
62end
42 63
43define xstring 64define xstring
44print (struct Lisp_String *) ($ & 0x00ffffff) 65print (struct Lisp_String *) ($ & 0x00ffffff)
45print ($->data[0])@($->size) 66print ($->size > 10000) ? "big string" : ($->data[0])@($->size)
46print $$ 67print $$
47end 68end
48
49document xstring 69document xstring
50Assume that $ is an Emacs Lisp string object, print the string's 70Print the contents and address of the string $.
51contents, and set $ to a pointer to the string. 71This command assumes that $ is an Elisp string value.
52end 72end
53 73
54define xvector 74define xvector
55set $temp = (struct Lisp_Vector *) ($ & 0x00ffffff) 75set $temp = (struct Lisp_Vector *) ($ & 0x00ffffff)
56print ($temp->contents[0])@($temp->size) 76print ($temp->size > 10000) ? "big vector" : ($temp->contents[0])@($temp->size)
57print $temp 77print $temp
58end 78end
59
60document xvector 79document xvector
61Assume that $ is an Emacs Lisp vector object, print the vector's 80Print the contents and address of the vector $.
62contents, and set $ to a pointer to the vector. 81This command assumes that $ is an Elisp vector value.
63end 82end
64 83
65define xscreen 84define xscreen
66print (struct screen *) ($ & 0x00ffffff) 85print (struct screen *) ($ & 0x00ffffff)
67end 86end
87document xwindow
88Print $ as a screen pointer, assuming it is an Elisp screen value.
89end
68 90
69define xcons 91define xcons
70print (struct Lisp_Cons *) ($ & 0x00ffffff) 92print (struct Lisp_Cons *) ($ & 0x00ffffff)
71print *$ 93print *$
72end 94end
95document xcons
96Print the contents of $, assuming it is an Elisp cons.
97end
73 98
74define xcar 99define xcar
75print ((($ >> 24) & 0x7f) == Lisp_Cons ? ((struct Lisp_Cons *) ($ & 0x00ffffff))->car : 0) 100print ((($ >> 24) & 0x7f) == Lisp_Cons ? ((struct Lisp_Cons *) ($ & 0x00ffffff))->car : 0)
76end 101end
102document xcar
103Print the car of $, assuming it is an Elisp pair.
104end
77 105
78define xcdr 106define xcdr
79print ((($ >> 24) & 0x7f) == Lisp_Cons ? ((struct Lisp_Cons *) ($ & 0x00ffffff))->cdr : 0) 107print ((($ >> 24) & 0x7f) == Lisp_Cons ? ((struct Lisp_Cons *) ($ & 0x00ffffff))->cdr : 0)
80end 108end
109document xcdr
110Print the cdr of $, assuming it is an Elisp pair.
111end
81 112
82set prettyprint on 113set print pretty on
83 114
84# Don't let abort actually run, as it will make 115# Don't let abort actually run, as it will make
85# stdio stop working and therefore the `pr' command below as well. 116# stdio stop working and therefore the `pr' command below as well.
@@ -90,8 +121,8 @@ break abort
90# instead... 121# instead...
91break _XPrintDefaultError 122break _XPrintDefaultError
92 123
93unset env TERMCAP 124unset environment TERMCAP
94unset env TERM 125unset environment TERM
95set env DISPLAY :0.0 126set environment DISPLAY :0.0
96info env DISPLAY 127show environment DISPLAY
97set args -q 128set args -q
diff --git a/src/alloc.c b/src/alloc.c
index b4637970dd7..9b7da1d0f5b 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -29,6 +29,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
29#endif /* MULTI_SCREEN */ 29#endif /* MULTI_SCREEN */
30#endif 30#endif
31 31
32#include "syssignal.h"
33
32#define max(A,B) ((A) > (B) ? (A) : (B)) 34#define max(A,B) ((A) > (B) ? (A) : (B))
33 35
34/* Macro to verify that storage intended for Lisp objects is not 36/* Macro to verify that storage intended for Lisp objects is not
@@ -549,11 +551,11 @@ DEFUN ("make-marker", Fmake_marker, Smake_marker, 0, 0, 0,
549{ 551{
550 register Lisp_Object val; 552 register Lisp_Object val;
551 register struct Lisp_Marker *p; 553 register struct Lisp_Marker *p;
554
552 /* Detact the bug that seems to have caused this to be called from 555 /* Detact the bug that seems to have caused this to be called from
553 a signal handler. */ 556 a signal handler. */
554 int mask, dummy; 557 SIGMASKTYPE mask;
555 EMACS_SIGSETMASK (-1, mask); 558 mask = sigblock (SIGEMPTYMASK);
556 EMACS_SIGSETMASK (mask, dummy);
557 if (mask != 0) 559 if (mask != 0)
558 abort (); 560 abort ();
559 561
diff --git a/src/callproc.c b/src/callproc.c
index 1a564ad7ccc..9544ecf0a21 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -195,12 +195,9 @@ If you quit, the process is killed with SIGKILL.")
195 Protect it from permanent change. */ 195 Protect it from permanent change. */
196 register char **save_environ = environ; 196 register char **save_environ = environ;
197 register int fd1 = fd[1]; 197 register int fd1 = fd[1];
198 char **env;
199
200 env = environ;
201 198
202#if 0 /* Some systems don't have sigblock. */ 199#if 0 /* Some systems don't have sigblock. */
203 EMACS_SIGBLOCK (sigmask (SIGCHLD), mask); 200 mask = sigblock (sigmask (SIGCHLD));
204#endif 201#endif
205 202
206 /* Record that we're about to create a synchronous process. */ 203 /* Record that we're about to create a synchronous process. */
@@ -217,18 +214,14 @@ If you quit, the process is killed with SIGKILL.")
217#else 214#else
218 setpgrp (pid, pid); 215 setpgrp (pid, pid);
219#endif /* USG */ 216#endif /* USG */
220 child_setup (filefd, fd1, fd1, new_argv, env, 0, current_dir); 217 child_setup (filefd, fd1, fd1, new_argv, 0, current_dir);
221 } 218 }
222 219
223#if 0 220#if 0
224 /* Tell SIGCHLD handler to look for this pid. */ 221 /* Tell SIGCHLD handler to look for this pid. */
225 synch_process_pid = pid; 222 synch_process_pid = pid;
226 /* Now let SIGCHLD come through. */ 223 /* Now let SIGCHLD come through. */
227 { 224 sigsetmask (mask);
228 int dummy;
229
230 EMACS_SIGSETMASK (mask, dummy);
231 }
232#endif 225#endif
233 226
234 environ = save_environ; 227 environ = save_environ;
@@ -368,13 +361,14 @@ If you quit, the process is killed with SIGKILL.")
368 a decent error from within the child, this should be verified as an 361 a decent error from within the child, this should be verified as an
369 executable directory by the parent. */ 362 executable directory by the parent. */
370 363
371child_setup (in, out, err, new_argv, env, set_pgrp, current_dir) 364child_setup (in, out, err, new_argv, set_pgrp, current_dir)
372 int in, out, err; 365 int in, out, err;
373 register char **new_argv; 366 register char **new_argv;
374 char **env;
375 int set_pgrp; 367 int set_pgrp;
376 Lisp_Object current_dir; 368 Lisp_Object current_dir;
377{ 369{
370 char **env;
371
378 register int pid = getpid(); 372 register int pid = getpid();
379 373
380 setpriority (PRIO_PROCESS, pid, 0); 374 setpriority (PRIO_PROCESS, pid, 0);
@@ -424,7 +418,7 @@ child_setup (in, out, err, new_argv, env, set_pgrp, current_dir)
424 /* new_length + 1 to include terminating 0 */ 418 /* new_length + 1 to include terminating 0 */
425 env = new_env = (char **) alloca ((new_length + 1) * sizeof (char *)); 419 env = new_env = (char **) alloca ((new_length + 1) * sizeof (char *));
426 420
427 /* Copy the env strings into new_env. */ 421 /* Copy the Vprocess_alist strings into new_env. */
428 for (tem = Vprocess_environment; 422 for (tem = Vprocess_environment;
429 (XTYPE (tem) == Lisp_Cons 423 (XTYPE (tem) == Lisp_Cons
430 && XTYPE (XCONS (tem)->car) == Lisp_String); 424 && XTYPE (XCONS (tem)->car) == Lisp_String);
diff --git a/src/data.c b/src/data.c
index 48af4ec9149..4e95494d593 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1959,11 +1959,7 @@ arith_error (signo)
1959#ifdef BSD4_1 1959#ifdef BSD4_1
1960 sigrelse (SIGFPE); 1960 sigrelse (SIGFPE);
1961#else /* not BSD4_1 */ 1961#else /* not BSD4_1 */
1962 { 1962 sigsetmask (SIGEMPTYMASK);
1963 int dummy;
1964
1965 EMACS_SIGSETMASK (SIGEMPTYMASK, dummy);
1966 }
1967#endif /* not BSD4_1 */ 1963#endif /* not BSD4_1 */
1968 1964
1969 Fsignal (Qarith_error, Qnil); 1965 Fsignal (Qarith_error, Qnil);
diff --git a/src/emacs.c b/src/emacs.c
index 90a86b26723..104ba671253 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -721,7 +721,10 @@ decode_env_path (evarname, defalt)
721 /* It's okay to use getenv here, because this function is only used 721 /* It's okay to use getenv here, because this function is only used
722 to initialize variables when Emacs starts up, and isn't called 722 to initialize variables when Emacs starts up, and isn't called
723 after that. */ 723 after that. */
724 path = (char *) getenv (evarname); 724 if (evarname != 0)
725 path = (char *) getenv (evarname);
726 else
727 path = 0;
725 if (!path) 728 if (!path)
726 path = defalt; 729 path = defalt;
727 lpath = Qnil; 730 lpath = Qnil;
diff --git a/src/filelock.c b/src/filelock.c
index 7a473753e58..b76ee689d55 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -65,7 +65,7 @@ char *superlock_path;
65 65
66/* Set LOCK to the name of the lock file for the filename FILE. 66/* Set LOCK to the name of the lock file for the filename FILE.
67 char *LOCK; Lisp_Object FILE; */ 67 char *LOCK; Lisp_Object FILE; */
68#define MAKE_LOCK_PATH (lock, file) \ 68#define MAKE_LOCK_PATH(lock, file) \
69 (lock = (char *) alloca (XSTRING (file)->size + strlen (lock_path) + 1), \ 69 (lock = (char *) alloca (XSTRING (file)->size + strlen (lock_path) + 1), \
70 fill_in_lock_file_name (lock, (file))) 70 fill_in_lock_file_name (lock, (file)))
71 71
diff --git a/src/floatfns.c b/src/floatfns.c
index c99ba487e71..20b90e63a85 100644
--- a/src/floatfns.c
+++ b/src/floatfns.c
@@ -22,6 +22,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
22 22
23#include "config.h" 23#include "config.h"
24#include "lisp.h" 24#include "lisp.h"
25#include "syssignal.h"
25 26
26Lisp_Object Qarith_error; 27Lisp_Object Qarith_error;
27 28
@@ -509,11 +510,7 @@ float_error (signo)
509#ifdef BSD4_1 510#ifdef BSD4_1
510 sigrelse (SIGILL); 511 sigrelse (SIGILL);
511#else /* not BSD4_1 */ 512#else /* not BSD4_1 */
512 { 513 sigsetmask (SIGEMPTYMASK);
513 int dummy;
514
515 EMACS_SIGSETMASK (0, dummy);
516 }
517#endif /* not BSD4_1 */ 514#endif /* not BSD4_1 */
518#else 515#else
519 /* Must reestablish handler each time it is called. */ 516 /* Must reestablish handler each time it is called. */
diff --git a/src/keyboard.c b/src/keyboard.c
index 122fa247c39..e6139cfaf11 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -2105,9 +2105,9 @@ gobble_input (expected)
2105 if (interrupt_input) 2105 if (interrupt_input)
2106 { 2106 {
2107 SIGMASKTYPE mask; 2107 SIGMASKTYPE mask;
2108 EMACS_SIGBLOCKX (SIGIO, mask); 2108 mask = sigblockx (SIGIO);
2109 read_avail_input (expected); 2109 read_avail_input (expected);
2110 EMACS_SIGSETMASK (mask, mask); 2110 sigsetmask (mask);
2111 } 2111 }
2112 else 2112 else
2113#endif 2113#endif
diff --git a/src/lisp.h b/src/lisp.h
index c7dd07058eb..b263370dac6 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -269,7 +269,7 @@ Lisp_Object;
269/* Extract the value of a Lisp_Object as a signed integer. */ 269/* Extract the value of a Lisp_Object as a signed integer. */
270 270
271#ifndef XINT /* Some machines need to do this differently. */ 271#ifndef XINT /* Some machines need to do this differently. */
272#define XINT(a) (((a) << INTBITS-VALBITS) >> INTBITS-VALBITS) 272#define XINT(a) (((a) << (INTBITS-VALBITS)) >> (INTBITS-VALBITS))
273#endif 273#endif
274 274
275/* Extract the value as an unsigned integer. This is a basis 275/* Extract the value as an unsigned integer. This is a basis
diff --git a/src/lread.c b/src/lread.c
index c3157c8d618..5ffa1ea5183 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1436,7 +1436,7 @@ init_lread ()
1436 /* Compute the default load-path. */ 1436 /* Compute the default load-path. */
1437#ifdef CANNOT_DUMP 1437#ifdef CANNOT_DUMP
1438 normal = PATH_LOADSEARCH; 1438 normal = PATH_LOADSEARCH;
1439 Vload_path = decode_env_path ("", normal); 1439 Vload_path = decode_env_path (0, normal);
1440#else 1440#else
1441 if (NILP (Vpurify_flag)) 1441 if (NILP (Vpurify_flag))
1442 normal = PATH_LOADSEARCH; 1442 normal = PATH_LOADSEARCH;
@@ -1452,12 +1452,12 @@ init_lread ()
1452 { 1452 {
1453 Lisp_Object dump_path; 1453 Lisp_Object dump_path;
1454 1454
1455 dump_path = decode_env_path ("", PATH_DUMPLOADSEARCH); 1455 dump_path = decode_env_path (0, PATH_DUMPLOADSEARCH);
1456 if (! NILP (Fequal (dump_path, Vload_path))) 1456 if (! NILP (Fequal (dump_path, Vload_path)))
1457 Vload_path = decode_env_path ("", normal); 1457 Vload_path = decode_env_path (0, normal);
1458 } 1458 }
1459 else 1459 else
1460 Vload_path = decode_env_path ("", normal); 1460 Vload_path = decode_env_path (0, normal);
1461#endif 1461#endif
1462 1462
1463 /* Warn if dirs in the *standard* path don't exist. */ 1463 /* Warn if dirs in the *standard* path don't exist. */
diff --git a/src/process.c b/src/process.c
index d9e2734957f..9ba48ef7d56 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1109,11 +1109,8 @@ create_process (process, new_argv)
1109#endif 1109#endif
1110 int pty_flag = 0; 1110 int pty_flag = 0;
1111 Lisp_Object current_dir; 1111 Lisp_Object current_dir;
1112 char **env;
1113 extern char **environ; 1112 extern char **environ;
1114 1113
1115 env = environ;
1116
1117 inchannel = outchannel = -1; 1114 inchannel = outchannel = -1;
1118 1115
1119#ifdef HAVE_PTYS 1116#ifdef HAVE_PTYS
@@ -1318,7 +1315,7 @@ create_process (process, new_argv)
1318 1315
1319 child_setup_tty (xforkout); 1316 child_setup_tty (xforkout);
1320 child_setup (xforkin, xforkout, xforkout, 1317 child_setup (xforkin, xforkout, xforkout,
1321 new_argv, env, 1, current_dir); 1318 new_argv, 1, current_dir);
1322 } 1319 }
1323 environ = save_environ; 1320 environ = save_environ;
1324 } 1321 }
diff --git a/src/search.c b/src/search.c
index 886f93f41c0..bd962d21491 100644
--- a/src/search.c
+++ b/src/search.c
@@ -111,11 +111,11 @@ signal_failure (arg)
111} 111}
112 112
113DEFUN ("looking-at", Flooking_at, Slooking_at, 1, 1, 0, 113DEFUN ("looking-at", Flooking_at, Slooking_at, 1, 1, 0,
114 "Return t if text after point matches regular expression PAT. 114 "Return t if text after point matches regular expression PAT.\n\
115This function modifies the match data that `match-beginning', 115This function modifies the match data that `match-beginning',\n\
116`match-end' and `match-data' access; save and restore the match 116`match-end' and `match-data' access; save and restore the match\n\
117data if you want to preserve them.") 117data if you want to preserve them.")
118") 118 "Return t if text after point matches regular expression PAT.")
119 (string) 119 (string)
120 Lisp_Object string; 120 Lisp_Object string;
121{ 121{
diff --git a/src/sysdep.c b/src/sysdep.c
index 62980380a68..5f6090a2460 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -638,11 +638,7 @@ reset_sigio ()
638request_sigio () 638request_sigio ()
639{ 639{
640#ifdef SIGWINCH 640#ifdef SIGWINCH
641 { 641 sigunblock (sigmask (SIGWINCH));
642 int dummy;
643
644 EMACS_SIGUNBLOCKX (SIGWINCH, dummy);
645 }
646#endif 642#endif
647 fcntl (0, F_SETFL, old_fcntl_flags | FASYNC); 643 fcntl (0, F_SETFL, old_fcntl_flags | FASYNC);
648 644
@@ -652,11 +648,7 @@ request_sigio ()
652unrequest_sigio () 648unrequest_sigio ()
653{ 649{
654#ifdef SIGWINCH 650#ifdef SIGWINCH
655 { 651 sigblock (sigmask (SIGWINCH));
656 int dummy;
657
658 EMACS_SIGBLOCK (SIGWINCH, dummy);
659 }
660#endif 652#endif
661 fcntl (0, F_SETFL, old_fcntl_flags); 653 fcntl (0, F_SETFL, old_fcntl_flags);
662 interrupts_deferred = 1; 654 interrupts_deferred = 1;
@@ -1882,6 +1874,19 @@ sys_signal (int signal_number, signal_handler_t action)
1882#endif /* DGUX */ 1874#endif /* DGUX */
1883} 1875}
1884 1876
1877#ifndef __GNUC__
1878/* If we're compiling with GCC, we don't need this function, since it
1879 can be written as a macro. */
1880sigset_t
1881sys_sigmask (int sig)
1882{
1883 sigset_t mask;
1884 sigemptyset (&mask);
1885 sigaddset (&mask, sig);
1886 return mask;
1887}
1888#endif
1889
1885int 1890int
1886sys_sigpause (sigset_t new_mask) 1891sys_sigpause (sigset_t new_mask)
1887{ 1892{