diff options
| author | Jim Blandy | 1992-01-28 01:53:11 +0000 |
|---|---|---|
| committer | Jim Blandy | 1992-01-28 01:53:11 +0000 |
| commit | 14e76af946582f7151f53da1579386891c9445d8 (patch) | |
| tree | 3c7fe71ed160198d8ae522f1b7fbb30ab70d3344 /src | |
| parent | c637ae6fc1d1c116567393a8493661bc9ba01de3 (diff) | |
| download | emacs-14e76af946582f7151f53da1579386891c9445d8.tar.gz emacs-14e76af946582f7151f53da1579386891c9445d8.zip | |
*** empty log message ***
Diffstat (limited to 'src')
| -rw-r--r-- | src/data.c | 32 | ||||
| -rw-r--r-- | src/s/bsd4-3.h | 3 | ||||
| -rw-r--r-- | src/s/template.h | 9 |
3 files changed, 33 insertions, 11 deletions
diff --git a/src/data.c b/src/data.c index 184cfba3a32..8906d68cabe 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -649,12 +649,14 @@ swap_in_symval_forwarding (sym, valcontents) | |||
| 649 | return XCONS (valcontents)->car; | 649 | return XCONS (valcontents)->car; |
| 650 | } | 650 | } |
| 651 | 651 | ||
| 652 | /* Note that it must not be possible to quit within this function. | 652 | /* Find the value of a symbol, returning Qunbound if it's not bound. |
| 653 | Great care is required for this. */ | 653 | This is helpful for code which just wants to get a variable's value |
| 654 | if it has one, without signalling an error. | ||
| 655 | Note that it must not be possible to quit | ||
| 656 | within this function. Great care is required for this. */ | ||
| 654 | 657 | ||
| 655 | DEFUN ("symbol-value", Fsymbol_value, Ssymbol_value, 1, 1, 0, | 658 | Lisp_Object |
| 656 | "Return SYMBOL's value. Error if that is void.") | 659 | find_symbol_value (sym) |
| 657 | (sym) | ||
| 658 | Lisp_Object sym; | 660 | Lisp_Object sym; |
| 659 | { | 661 | { |
| 660 | register Lisp_Object valcontents, tem1; | 662 | register Lisp_Object valcontents, tem1; |
| @@ -689,18 +691,26 @@ DEFUN ("symbol-value", Fsymbol_value, Ssymbol_value, 1, 1, 0, | |||
| 689 | case Lisp_Buffer_Objfwd: | 691 | case Lisp_Buffer_Objfwd: |
| 690 | return *(Lisp_Object *)(XUINT (valcontents) + (char *)current_buffer); | 692 | return *(Lisp_Object *)(XUINT (valcontents) + (char *)current_buffer); |
| 691 | 693 | ||
| 692 | case Lisp_Symbol: | ||
| 693 | /* For a symbol, check whether it is 'unbound. */ | ||
| 694 | if (!EQ (valcontents, Qunbound)) | ||
| 695 | break; | ||
| 696 | /* drops through! */ | ||
| 697 | case Lisp_Void: | 694 | case Lisp_Void: |
| 698 | return Fsignal (Qvoid_variable, Fcons (sym, Qnil)); | 695 | return Qunbound; |
| 699 | } | 696 | } |
| 700 | 697 | ||
| 701 | return valcontents; | 698 | return valcontents; |
| 702 | } | 699 | } |
| 703 | 700 | ||
| 701 | DEFUN ("symbol-value", Fsymbol_value, Ssymbol_value, 1, 1, 0, | ||
| 702 | "Return SYMBOL's value. Error if that is void.") | ||
| 703 | (sym) | ||
| 704 | Lisp_Object sym; | ||
| 705 | { | ||
| 706 | Lisp_Object val = find_symbol_value (sym); | ||
| 707 | |||
| 708 | if (EQ (val, Qunbound)) | ||
| 709 | return Fsignal (Qvoid_variable, Fcons (sym, Qnil)); | ||
| 710 | else | ||
| 711 | return val; | ||
| 712 | } | ||
| 713 | |||
| 704 | DEFUN ("set", Fset, Sset, 2, 2, 0, | 714 | DEFUN ("set", Fset, Sset, 2, 2, 0, |
| 705 | "Set SYMBOL's value to NEWVAL, and return NEWVAL.") | 715 | "Set SYMBOL's value to NEWVAL, and return NEWVAL.") |
| 706 | (sym, newval) | 716 | (sym, newval) |
diff --git a/src/s/bsd4-3.h b/src/s/bsd4-3.h index e9754af045a..332bbaa3856 100644 --- a/src/s/bsd4-3.h +++ b/src/s/bsd4-3.h | |||
| @@ -127,3 +127,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 127 | is named _avenrun. */ | 127 | is named _avenrun. */ |
| 128 | 128 | ||
| 129 | #define LDAV_SYMBOL "_avenrun" | 129 | #define LDAV_SYMBOL "_avenrun" |
| 130 | |||
| 131 | /* The return type of a signal handling function. */ | ||
| 132 | #define SIGTYPE int | ||
diff --git a/src/s/template.h b/src/s/template.h index 6cf4905db3e..6238ee7ef95 100644 --- a/src/s/template.h +++ b/src/s/template.h | |||
| @@ -128,6 +128,15 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 128 | 128 | ||
| 129 | #define CLASH_DETECTION | 129 | #define CLASH_DETECTION |
| 130 | 130 | ||
| 131 | /* Define this if your operating system declares signal handlers to | ||
| 132 | have a type other than the usual. `The usual' is `void' for ANSI C | ||
| 133 | systems (i.e. when the __STDC__ macro is defined), and `int' for | ||
| 134 | pre-ANSI systems. If you're using GCC on an older system, __STDC__ | ||
| 135 | will be defined, but the system's include files will still say that | ||
| 136 | signal returns int or whatever; in situations like that, define | ||
| 137 | this to be what the system's include files want. */ | ||
| 138 | /* #define SIGTYPE int */ | ||
| 139 | |||
| 131 | /* Here, on a separate page, add any special hacks needed | 140 | /* Here, on a separate page, add any special hacks needed |
| 132 | to make Emacs work on this system. For example, | 141 | to make Emacs work on this system. For example, |
| 133 | you might define certain system call names that don't | 142 | you might define certain system call names that don't |