Couldn't make condition-case workHow to condition-case Lisp nesting exceeds `max-lisp-eval-depth'?What is the...

Why does every calorie tracking app give a different target calorie count for the same goals?

LED glows slightly during soldering

Backspace functionality in normal mode

What is a "Lear Processor" and how did it work?

Integer Lists of Noah

Yet another hash table in C

Why does the Antonov AN-225 not have any winglets?

What attributes and how big would a sea creature(s) need to be able to tow a ship?

Is that a case of "DOUBLE-NEGATIVES" as claimed by Grammarly?

What is the correct parsing of お高くとまる?

Why did Harry Potter get a bedroom?

What is /bin/red

Why archangel Michael didn't save Jesus when he was crucified?

[Future]Historical experience as a guide to warship design?

Could you brine steak?

How do you move up one folder in Finder?

What's it called when the bad guy gets eaten?

What is the right approach to quit a job during probation period for a competing offer?

Is a request to book a business flight ticket for a graduate student an unreasonable one?

"was fiction" vs "were fictions"

Party going through airport security at separate times?

Can i use larger/smaller circular saw blades on my circular / plunge / table / miter saw?

How to drill holes in 3/8" steel plates?

Postgres trigram match acting strange for specific characters



Couldn't make condition-case work


How to condition-case Lisp nesting exceeds `max-lisp-eval-depth'?What is the difference between the error handler in condition-case and the error functionOn Windows 8.1, in Emacs Ghostscript doesn't work, while on commandline it doesHow Can I Prevent make-process from failing if the default-directory doesn't exist?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







1















Hello fellow Emacs Lisp enthusiasts!



I've encountered problem that I am even embarrassed to describe. It is very clear how to use condition-case from all the docs and examples that I can find online, but still even the simplest example won't work for me.



Here is a minimal code snippet:



(defun foo ()
(signal 'test-signal '(1 2 3)))

(condition-case nil
(foo)
(test-signal nil))


I use Emacs 26.1, but encounter the same behaviour on other versions as well.



Thank you for any help!










share|improve this question







New contributor



Valeriy Savchenko is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.


























    1















    Hello fellow Emacs Lisp enthusiasts!



    I've encountered problem that I am even embarrassed to describe. It is very clear how to use condition-case from all the docs and examples that I can find online, but still even the simplest example won't work for me.



    Here is a minimal code snippet:



    (defun foo ()
    (signal 'test-signal '(1 2 3)))

    (condition-case nil
    (foo)
    (test-signal nil))


    I use Emacs 26.1, but encounter the same behaviour on other versions as well.



    Thank you for any help!










    share|improve this question







    New contributor



    Valeriy Savchenko is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






















      1












      1








      1








      Hello fellow Emacs Lisp enthusiasts!



      I've encountered problem that I am even embarrassed to describe. It is very clear how to use condition-case from all the docs and examples that I can find online, but still even the simplest example won't work for me.



      Here is a minimal code snippet:



      (defun foo ()
      (signal 'test-signal '(1 2 3)))

      (condition-case nil
      (foo)
      (test-signal nil))


      I use Emacs 26.1, but encounter the same behaviour on other versions as well.



      Thank you for any help!










      share|improve this question







      New contributor



      Valeriy Savchenko is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      Hello fellow Emacs Lisp enthusiasts!



      I've encountered problem that I am even embarrassed to describe. It is very clear how to use condition-case from all the docs and examples that I can find online, but still even the simplest example won't work for me.



      Here is a minimal code snippet:



      (defun foo ()
      (signal 'test-signal '(1 2 3)))

      (condition-case nil
      (foo)
      (test-signal nil))


      I use Emacs 26.1, but encounter the same behaviour on other versions as well.



      Thank you for any help!







      error-handling






      share|improve this question







      New contributor



      Valeriy Savchenko is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share|improve this question







      New contributor



      Valeriy Savchenko is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share|improve this question




      share|improve this question






      New contributor



      Valeriy Savchenko is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      asked 9 hours ago









      Valeriy SavchenkoValeriy Savchenko

      1083 bronze badges




      1083 bronze badges




      New contributor



      Valeriy Savchenko is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




      New contributor




      Valeriy Savchenko is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.
























          2 Answers
          2






          active

          oldest

          votes


















          2














          Your error symbol test-signal is not defined. C-h f signal says:




          An error symbol is a symbol with an error-conditions property
          that is a list of condition names.




          Let's check this for some standard error symbols and the test-signal



          (get 'error 'error-conditions)
          ;; => (error)

          (get 'args-out-of-range 'error-conditions)
          ;; => (args-out-of-range error)

          (get 'test-signal 'error-conditions)
          ;; => nil


          To define an error symbol, use define-error, e.g.,



          (define-error 'test-signal "My error for testing")


          then you can handle the error in condition-case, e.g.,



          (condition-case err
          (signal 'test-signal '(1 2 3))
          (test-signal (error-message-string err)))
          ;; => "My error for testing: 1, 2, 3"





          share|improve this answer
























          • Thanks a lot! That was the problem. I was checkin eieio code, but their error (invalid-slot-type ) doesn't seem to be defined like this.

            – Valeriy Savchenko
            7 hours ago











          • @ValeriySavchenko The invalid-slot-type error symbol is defined with define-error since Emacs 25.1. In early versions, it is defined with put. By the way, define-error is added in Emacs 24.4.

            – xuchunyang
            7 hours ago





















          1














          You need to define a symbol as an error to get Emacs to recognize it:



          (define-error 'test-signal
          "Test signal" 'error)

          (defun foo ()
          (signal 'test-signal '(1 2 3)))

          (condition-case nil
          (foo)
          (error nil))


          From (elisp) Error Symbols:




          -- Function: define-error name message &optional parent

          In order for a symbol to be an error symbol, it must be defined
          with define-error which takes a parent condition (defaults to
          error). This parent defines the conditions that this kind of
          error belongs to. The transitive set of parents always includes
          the error symbol itself, and the symbol error. Because quitting
          is not considered an error, the set of parents of quit is just
          (quit).







          share|improve this answer
























          • Thanks a lot! It helped!

            – Valeriy Savchenko
            7 hours ago














          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "583"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          Valeriy Savchenko is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f51488%2fcouldnt-make-condition-case-work%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          Your error symbol test-signal is not defined. C-h f signal says:




          An error symbol is a symbol with an error-conditions property
          that is a list of condition names.




          Let's check this for some standard error symbols and the test-signal



          (get 'error 'error-conditions)
          ;; => (error)

          (get 'args-out-of-range 'error-conditions)
          ;; => (args-out-of-range error)

          (get 'test-signal 'error-conditions)
          ;; => nil


          To define an error symbol, use define-error, e.g.,



          (define-error 'test-signal "My error for testing")


          then you can handle the error in condition-case, e.g.,



          (condition-case err
          (signal 'test-signal '(1 2 3))
          (test-signal (error-message-string err)))
          ;; => "My error for testing: 1, 2, 3"





          share|improve this answer
























          • Thanks a lot! That was the problem. I was checkin eieio code, but their error (invalid-slot-type ) doesn't seem to be defined like this.

            – Valeriy Savchenko
            7 hours ago











          • @ValeriySavchenko The invalid-slot-type error symbol is defined with define-error since Emacs 25.1. In early versions, it is defined with put. By the way, define-error is added in Emacs 24.4.

            – xuchunyang
            7 hours ago


















          2














          Your error symbol test-signal is not defined. C-h f signal says:




          An error symbol is a symbol with an error-conditions property
          that is a list of condition names.




          Let's check this for some standard error symbols and the test-signal



          (get 'error 'error-conditions)
          ;; => (error)

          (get 'args-out-of-range 'error-conditions)
          ;; => (args-out-of-range error)

          (get 'test-signal 'error-conditions)
          ;; => nil


          To define an error symbol, use define-error, e.g.,



          (define-error 'test-signal "My error for testing")


          then you can handle the error in condition-case, e.g.,



          (condition-case err
          (signal 'test-signal '(1 2 3))
          (test-signal (error-message-string err)))
          ;; => "My error for testing: 1, 2, 3"





          share|improve this answer
























          • Thanks a lot! That was the problem. I was checkin eieio code, but their error (invalid-slot-type ) doesn't seem to be defined like this.

            – Valeriy Savchenko
            7 hours ago











          • @ValeriySavchenko The invalid-slot-type error symbol is defined with define-error since Emacs 25.1. In early versions, it is defined with put. By the way, define-error is added in Emacs 24.4.

            – xuchunyang
            7 hours ago
















          2












          2








          2







          Your error symbol test-signal is not defined. C-h f signal says:




          An error symbol is a symbol with an error-conditions property
          that is a list of condition names.




          Let's check this for some standard error symbols and the test-signal



          (get 'error 'error-conditions)
          ;; => (error)

          (get 'args-out-of-range 'error-conditions)
          ;; => (args-out-of-range error)

          (get 'test-signal 'error-conditions)
          ;; => nil


          To define an error symbol, use define-error, e.g.,



          (define-error 'test-signal "My error for testing")


          then you can handle the error in condition-case, e.g.,



          (condition-case err
          (signal 'test-signal '(1 2 3))
          (test-signal (error-message-string err)))
          ;; => "My error for testing: 1, 2, 3"





          share|improve this answer













          Your error symbol test-signal is not defined. C-h f signal says:




          An error symbol is a symbol with an error-conditions property
          that is a list of condition names.




          Let's check this for some standard error symbols and the test-signal



          (get 'error 'error-conditions)
          ;; => (error)

          (get 'args-out-of-range 'error-conditions)
          ;; => (args-out-of-range error)

          (get 'test-signal 'error-conditions)
          ;; => nil


          To define an error symbol, use define-error, e.g.,



          (define-error 'test-signal "My error for testing")


          then you can handle the error in condition-case, e.g.,



          (condition-case err
          (signal 'test-signal '(1 2 3))
          (test-signal (error-message-string err)))
          ;; => "My error for testing: 1, 2, 3"






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 8 hours ago









          xuchunyangxuchunyang

          9,6571 gold badge9 silver badges27 bronze badges




          9,6571 gold badge9 silver badges27 bronze badges













          • Thanks a lot! That was the problem. I was checkin eieio code, but their error (invalid-slot-type ) doesn't seem to be defined like this.

            – Valeriy Savchenko
            7 hours ago











          • @ValeriySavchenko The invalid-slot-type error symbol is defined with define-error since Emacs 25.1. In early versions, it is defined with put. By the way, define-error is added in Emacs 24.4.

            – xuchunyang
            7 hours ago





















          • Thanks a lot! That was the problem. I was checkin eieio code, but their error (invalid-slot-type ) doesn't seem to be defined like this.

            – Valeriy Savchenko
            7 hours ago











          • @ValeriySavchenko The invalid-slot-type error symbol is defined with define-error since Emacs 25.1. In early versions, it is defined with put. By the way, define-error is added in Emacs 24.4.

            – xuchunyang
            7 hours ago



















          Thanks a lot! That was the problem. I was checkin eieio code, but their error (invalid-slot-type ) doesn't seem to be defined like this.

          – Valeriy Savchenko
          7 hours ago





          Thanks a lot! That was the problem. I was checkin eieio code, but their error (invalid-slot-type ) doesn't seem to be defined like this.

          – Valeriy Savchenko
          7 hours ago













          @ValeriySavchenko The invalid-slot-type error symbol is defined with define-error since Emacs 25.1. In early versions, it is defined with put. By the way, define-error is added in Emacs 24.4.

          – xuchunyang
          7 hours ago







          @ValeriySavchenko The invalid-slot-type error symbol is defined with define-error since Emacs 25.1. In early versions, it is defined with put. By the way, define-error is added in Emacs 24.4.

          – xuchunyang
          7 hours ago















          1














          You need to define a symbol as an error to get Emacs to recognize it:



          (define-error 'test-signal
          "Test signal" 'error)

          (defun foo ()
          (signal 'test-signal '(1 2 3)))

          (condition-case nil
          (foo)
          (error nil))


          From (elisp) Error Symbols:




          -- Function: define-error name message &optional parent

          In order for a symbol to be an error symbol, it must be defined
          with define-error which takes a parent condition (defaults to
          error). This parent defines the conditions that this kind of
          error belongs to. The transitive set of parents always includes
          the error symbol itself, and the symbol error. Because quitting
          is not considered an error, the set of parents of quit is just
          (quit).







          share|improve this answer
























          • Thanks a lot! It helped!

            – Valeriy Savchenko
            7 hours ago
















          1














          You need to define a symbol as an error to get Emacs to recognize it:



          (define-error 'test-signal
          "Test signal" 'error)

          (defun foo ()
          (signal 'test-signal '(1 2 3)))

          (condition-case nil
          (foo)
          (error nil))


          From (elisp) Error Symbols:




          -- Function: define-error name message &optional parent

          In order for a symbol to be an error symbol, it must be defined
          with define-error which takes a parent condition (defaults to
          error). This parent defines the conditions that this kind of
          error belongs to. The transitive set of parents always includes
          the error symbol itself, and the symbol error. Because quitting
          is not considered an error, the set of parents of quit is just
          (quit).







          share|improve this answer
























          • Thanks a lot! It helped!

            – Valeriy Savchenko
            7 hours ago














          1












          1








          1







          You need to define a symbol as an error to get Emacs to recognize it:



          (define-error 'test-signal
          "Test signal" 'error)

          (defun foo ()
          (signal 'test-signal '(1 2 3)))

          (condition-case nil
          (foo)
          (error nil))


          From (elisp) Error Symbols:




          -- Function: define-error name message &optional parent

          In order for a symbol to be an error symbol, it must be defined
          with define-error which takes a parent condition (defaults to
          error). This parent defines the conditions that this kind of
          error belongs to. The transitive set of parents always includes
          the error symbol itself, and the symbol error. Because quitting
          is not considered an error, the set of parents of quit is just
          (quit).







          share|improve this answer













          You need to define a symbol as an error to get Emacs to recognize it:



          (define-error 'test-signal
          "Test signal" 'error)

          (defun foo ()
          (signal 'test-signal '(1 2 3)))

          (condition-case nil
          (foo)
          (error nil))


          From (elisp) Error Symbols:




          -- Function: define-error name message &optional parent

          In order for a symbol to be an error symbol, it must be defined
          with define-error which takes a parent condition (defaults to
          error). This parent defines the conditions that this kind of
          error belongs to. The transitive set of parents always includes
          the error symbol itself, and the symbol error. Because quitting
          is not considered an error, the set of parents of quit is just
          (quit).








          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 8 hours ago









          DoMiNeLa10DoMiNeLa10

          2,0991 gold badge7 silver badges24 bronze badges




          2,0991 gold badge7 silver badges24 bronze badges













          • Thanks a lot! It helped!

            – Valeriy Savchenko
            7 hours ago



















          • Thanks a lot! It helped!

            – Valeriy Savchenko
            7 hours ago

















          Thanks a lot! It helped!

          – Valeriy Savchenko
          7 hours ago





          Thanks a lot! It helped!

          – Valeriy Savchenko
          7 hours ago










          Valeriy Savchenko is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          Valeriy Savchenko is a new contributor. Be nice, and check out our Code of Conduct.













          Valeriy Savchenko is a new contributor. Be nice, and check out our Code of Conduct.












          Valeriy Savchenko is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Emacs Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f51488%2fcouldnt-make-condition-case-work%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

          Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

          Ciclooctatetraenă Vezi și | Bibliografie | Meniu de navigare637866text4148569-500570979m